diff -r e00489a30c72 -r 5d9f6ecf748e includes/clientside/static/editor.js --- a/includes/clientside/static/editor.js Tue Oct 12 23:07:27 2010 -0400 +++ b/includes/clientside/static/editor.js Thu Oct 28 03:04:24 2010 -0400 @@ -6,6 +6,8 @@ var editor_img_path = cdnPath + '/images/editor'; var editor_save_lock = false; var editor_wikitext_transform_enable = true; +var editor_orig_text = ''; +var editor_last_draft = ''; window.ajaxEditor = function(revid) { @@ -194,6 +196,10 @@ // Textarea containing the content var ta_wrapper = document.createElement('div'); ta_wrapper.style.margin = '10px 0'; + + // A hook allowing plugins to create a toolbar on top of the textarea + eval(setHook('editor_gui_toolbar')); + // ta_wrapper.style.clear = 'both'; var textarea = document.createElement('textarea'); ta_wrapper.appendChild(textarea); @@ -480,6 +486,7 @@ $dynano('ajaxEditArea').object.focus(); $dynano('ajaxEditArea').object._edTimestamp = timestamp; $dynano('ajaxEditArea').setContent(content); + editor_orig_text = content; // If the editor preference is tinymce, switch the editor to TinyMCE now if ( response.page_format == 'xhtml' && allow_wysiwyg ) @@ -1071,11 +1078,13 @@ var ta_content = $dynano('ajaxEditArea').getContent(); - if ( ta_content == '' || ta_content == '
' || ta_content == '' ) + if ( ta_content == '' || ta_content == '' || ta_content == '
' || ta_content == editor_orig_text || ta_content == editor_last_draft ) { return false; } + editor_last_draft = ta_content; + ajaxEditorSave(true); } @@ -1110,6 +1119,7 @@ $dynano('ajaxEditArea').setContent(response.src); $dynano('ajaxEditArea').object.used_draft = true; + editor_orig_text = editor_last_draft = response.src; var es = document.getElementById('enano_editor_field_summary'); if ( es.value == '' )