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

include __DIR__ . '/../../include.php';
$example = new Raptor\Revision\RestExample('Save REST');
?>
<!doctype html>
<html>
<head>
    <?php 
echo $example->renderHead();
?>
    <script type="text/javascript">
        init(function($) {
            $('.editable').raptor(extendDefaults({
                plugins: {
                    save: {
                        plugin: 'saveRest'
                    },
                    saveRest: {
                        url: '../../actions/save-content-rest.php',
                        data: function(html) {
                            // Returns an object containing the data to send to the server
                            return {
                                id: this.raptor.getElement().data('id'),
                                content: html
                            };
                        }
                    }
                }
            }));
        });