コード例 #1
0
ファイル: example.php プロジェクト: jhrzic/raptor-example
<?php

include __DIR__ . '/../../include.php';
$example = new Raptor\Comment\Example('Inline');
$content = $example->getContent();
ksort($content);
?>
<!doctype html>
<html>
<head>
    <?php 
echo $example->renderHead();
?>
    <script type="text/javascript">
        init(function($) {
            $('.editable').raptor(extendDefaults({
                preset: 'inline',
                bind: {
                    layoutShow: function() {
                        setTimeout(function() {
                            this.getElement().closest('.source-watch').find('.ui-notification').hide();
                            this.getElement().show();
                            this.getElement().parent().show();
                        }.bind(this), 1000);
                    }
                }
            }));
        });
    </script>
    <style>
        body {
コード例 #2
0
<?php

include __DIR__ . '/../include.php';
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : '/';
try {
    $example = new Raptor\Comment\Example('Save Comment');
    $example->save();
    header("Location: {$redirect}?status=success");
} catch (Raptor\ClientException $exception) {
    http_response_code(400);
    header("Location: {$redirect}?status=failed&message=" . urlencode($exception->getMessage()));
} catch (Raptor\ServerException $exception) {
    http_response_code(500);
    header("Location: {$redirect}?status=failed&message=" . urlencode($exception->getMessage()));
}