Last active
December 14, 2015 06:28
-
-
Save Petah/5042409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="raptor-editable" data-id="main-content"> | |
<p> | |
Raptor may be integrated into a site many ways. | |
This article aims to cover the simplest integration possible. | |
</p> | |
</div> | |
<script> | |
$(function() { | |
$('.raptor-editable').raptor({ | |
plugins: { | |
// Define which save plugin to use. May be saveJson or saveRest | |
save: { | |
plugin: 'saveJson' | |
}, | |
// Provide options for the saveJson plugin | |
saveJson: { | |
// The URL to which Raptor data will be POSTed | |
url: '/save.php', | |
// The parameter name for the posted data | |
postName: 'raptor-content', | |
// A string or function that returns the identifier for the Raptor instance being saved | |
id: function() { | |
return this.raptor.getElement().data('id'); | |
} | |
} | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment