]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/quicktags.js
WordPress 3.9
[autoinstalls/wordpress.git] / wp-includes / js / quicktags.js
index b55a55e3eb2724babf8f231e8ab54d6ddf7ff93d..9fc9c69d4a5f8ed05287b88d140791dcec1b7f71 100644 (file)
@@ -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 '<input type="button" id="' + idPrefix + this.id + '"' + access + ' class="ed_button" title="' + this.title + '" value="' + this.display + '" />';
+               if ( this.id === 'fullscreen' ) {
+                       return '<button type="button" id="' + idPrefix + this.id + '"' + access + ' class="ed_button qt-fullscreen" title="' + this.title + '"></button>';
+               }
+               return '<input type="button" id="' + idPrefix + this.id + '"' + access + ' class="ed_button button button-small" title="' + this.title + '" value="' + this.display + '" />';
        };
        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','<ol>\n','</ol>\n\n','o'),
        edButtons[100] = new qt.TagButton('li','li','\t<li>','</li>\n','l'),
        edButtons[110] = new qt.TagButton('code','code','<code>','</code>','c'),
-       edButtons[120] = new qt.TagButton('more','more','<!--more-->','','t'),
+       edButtons[120] = new qt.TagButton('more','more','<!--more-->\n\n','','t'),
        edButtons[140] = new qt.CloseButton();
 
 })();