Skip to content

Commit

Permalink
Item12000: use foswiki.post()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/Html5EditContrib@15230 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jul 30, 2012
1 parent 6d1be38 commit b1b9a45
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Foswiki/Contrib/Html5EditContrib/Hallojs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ sub renderJS {
}).bind('hallodeactivated', function(event, data){
var item = jQuery(this).data('hallo');
if (item.isModified()) {
jQuery.post('%SCRIPTURL{save}%/%BASEWEB%/%BASETOPIC%', { text: this.innerHTML, wysiwyg_edit: 'go' },
function(data) {
alert('Data saved: ' + data);
}).error(function(event, data) {
foswiki.post('save', { text: this.innerHTML, wysiwyg_edit: 'go', web: foswiki.getPreference('WEB'), topic: foswiki.getPreference('TOPIC') })
.success(function(event, data) {alert('Data saved: ' + data);})
.error(function(event, data) {
//TODO: this darstadly hack is because i've not made a POST form and used that to submit the save, so strikeone has a hissyfit
//OH BOY YOU CANT BE SERIOUS - and it relies on the strikeone.js being loaded due to the bootstrap search being POST..
var entirehtml = jQuery(event.responseText).filter('.foswikiMain');
Expand Down

0 comments on commit b1b9a45

Please sign in to comment.