Skip to content

Instantly share code, notes, and snippets.

@Petah
Created November 15, 2012 22:50
Show Gist options
  • Save Petah/4082064 to your computer and use it in GitHub Desktop.
Save Petah/4082064 to your computer and use it in GitHub Desktop.
Raptor Example
<script type="text/javascript">
raptor(function($) {
$('.editable').editor({
urlPrefix: '/'
});
});
</script> <script type="text/javascript">
jQuery(function($) {
$('.editable').editor({
urlPrefix: '../',
ui: {
save: {
plugin: 'saveRest'
}
},
plugins: {
saveRest: {
/**
* True if you want all editing elements to be saved at once.
*/
multiple: true,
ajax: {
type: 'post',
dataType: 'json',
url: function(id) {
return '../certified-save.php';
},
data: function(html) {
return {
_method: 'put',
id: this.editor.getElement().data('id'),
content: html
};
}
}
}
}
});
});
</script>
<script type="text/javascript">
raptor(function($) {
$('.editable').editor({
urlPrefix: '../',
ui: {
save: {
plugin: 'saveRest'
}
},
plugins: {
saveRest: {
/**
* True if you want all editing elements to be saved at once.
*/
multiple: true,
ajax: {
type: 'post',
dataType: 'json',
url: function(id) {
return '../certified-save.php';
},
data: function(html) {
return {
_method: 'put',
id: this.editor.getElement().data('id'),
content: html
};
}
}
}
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment