# HG changeset patch # User Dan Fuhry # Date 1288249464 14400 # Node ID 5d9f6ecf748ebc395c48b9d17db89aab0ee629ea # Parent e00489a30c729f7e8fcd4ccc83ab00255235bf1a Added an editor hook that allows plugins to insert their own content right before the editor box. diff -r e00489a30c72 -r 5d9f6ecf748e includes/clientside/static/autofill.js --- a/includes/clientside/static/autofill.js Tue Oct 12 23:07:27 2010 -0400 +++ b/includes/clientside/static/autofill.js Thu Oct 28 03:04:24 2010 -0400 @@ -152,7 +152,7 @@ // Create results var results = document.createElement("div"); - $(results).addClass('tblholder').css('z-index', getHighestZ() + 1).css('margin-top', 0); + $(results).addClass('tblholder').css('z-index', getHighestZ() + 50).css('margin-top', 0); $(results).css('clip', 'rect(0px,auto,auto,0px)').css('overflow', 'auto').css('max-height', '300px'); // Create jQuery object for results 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 == '' )