| Kwiki-Edit-BackgroundSave documentation | view source | Contained in the Kwiki-Edit-BackgroundSave distribution. |
Click "Edit" on a page
Start editing
Click "Background Save"
Continue editing
When finished click "Save"
Eric Anderson, <eric at cordata.com>
Copyright 2006 CorData, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __javascript/background_save.js__ function do_background_save(page_name) { var old_value = $('background_save').value; $('background_save').value = 'Saving...'; var arguments = $H({ action: 'background_save', page_name: page_name, content: $('page_content').value, page_time: $('page_time').value }).toQueryString(); new Ajax.Request('index.cgi', { parameters: arguments, method: 'get', onComplete: function(transport, json) { $('background_save').value = old_value; $('page_time').value = transport.responseText; if( json != null && json.problem == 'contention' ) { alert(json.user+' edited this file on '+json.edittime+ " while you were editing this file.\n"+ 'You can save again to override their '+ 'changes if you wish.'); } }, onFailure: function(transport, json) { alert("Failed to save page for some reason:\n\n"+ 'Status Code: '+transport.status+"\n"+ 'Status Text: '+transport.statusText); $('background_save').value = old_value; } }); } __config/background_save.yaml__ edit_save_background_button_text: SAVE BACKGROUND
| Kwiki-Edit-BackgroundSave documentation | view source | Contained in the Kwiki-Edit-BackgroundSave distribution. |