X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/256a3b381f63716209b3527d0a14442ae570c283..245e789b234afa4525862e7a6e5e3c2e7a52ef20:/wp-includes/js/quicktags.js diff --git a/wp-includes/js/quicktags.js b/wp-includes/js/quicktags.js index b55a55e3..9fc9c69d 100644 --- a/wp-includes/js/quicktags.js +++ b/wp-includes/js/quicktags.js @@ -1,4 +1,4 @@ -/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, fullscreen, prompt */ +/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */ /* * Quicktags * @@ -185,6 +185,9 @@ function edButton(id, display, tagStart, tagEnd, access) { tb = document.createElement('div'); tb.id = toolbar_id; tb.className = 'quicktags-toolbar'; + tb.onclick = function() { + window.wpActiveEditor = id; + }; canvas.parentNode.insertBefore(tb, canvas); t.toolbar = tb; @@ -403,7 +406,10 @@ function edButton(id, display, tagStart, tagEnd, access) { }; qt.Button.prototype.html = function(idPrefix) { var access = this.access ? ' accesskey="' + this.access + '"' : ''; - return ''; + if ( this.id === 'fullscreen' ) { + return ''; + } + return ''; }; qt.Button.prototype.callback = function(){}; @@ -563,8 +569,8 @@ function edButton(id, display, tagStart, tagEnd, access) { qt.LinkButton.prototype.callback = function(e, c, ed, defaultValue) { var URL, t = this; - if ( typeof(wpLink) !== 'undefined' ) { - wpLink.open(); + if ( typeof wpLink !== 'undefined' ) { + wpLink.open( ed.id ); return; } @@ -605,11 +611,11 @@ function edButton(id, display, tagStart, tagEnd, access) { }; qt.FullscreenButton.prototype = new qt.Button(); qt.FullscreenButton.prototype.callback = function(e, c) { - if ( !c.id || typeof(fullscreen) === 'undefined' ) { + if ( ! c.id || typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) { return; } - fullscreen.on(); + wp.editor.fullscreen.on(); }; qt.TextDirectionButton = function() { @@ -640,7 +646,7 @@ function edButton(id, display, tagStart, tagEnd, access) { edButtons[90] = new qt.TagButton('ol','ol','
    \n','
\n\n','o'), edButtons[100] = new qt.TagButton('li','li','\t
  • ','
  • \n','l'), edButtons[110] = new qt.TagButton('code','code','','','c'), - edButtons[120] = new qt.TagButton('more','more','','','t'), + edButtons[120] = new qt.TagButton('more','more','\n\n','','t'), edButtons[140] = new qt.CloseButton(); })();