Changeset 22857
- Timestamp:
- 11/27/2012 01:31:51 AM (12 years ago)
- Location:
- trunk/wp-includes/js/tinymce/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
r22652 r22857 7 7 8 8 tinymce.create('tinymce.plugins.WordPress', { 9 showButtons : 0,10 11 9 init : function(ed, url) { 12 10 var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key; … … 375 373 'display' : 'block' 376 374 }); 377 378 this.showButtons = true;379 375 }, 380 376 381 377 _hideButtons : function() { 382 if ( ! this.showButtons ) 383 return; 384 385 if ( document.getElementById('wp_editbtns') ) 386 tinymce.DOM.hide('wp_editbtns'); 387 388 if ( document.getElementById('wp_gallerybtns') ) 389 tinymce.DOM.hide('wp_gallerybtns'); 390 391 this.showButtons = false; 378 tinymce.DOM.hide(['wp_editbtns', 'wp_gallerybtns']); 392 379 }, 393 380 -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js
r22644 r22857 206 206 207 207 _createButtons : function() { 208 var t = this, ed = t.editor, DOM = tinymce.DOM, editButton, dellButton, isRetina; 208 var t = this, ed = tinymce.activeEditor, DOM = tinymce.DOM, editButton, dellButton, isRetina; 209 210 if ( DOM.get('wp_editbtns') ) 211 return; 209 212 210 213 isRetina = ( window.devicePixelRatio && window.devicePixelRatio > 1 ) || // WebKit, Opera 211 214 ( window.matchMedia && window.matchMedia('(min-resolution:130dpi)').matches ); // Firefox, IE10, Opera 212 213 DOM.remove('wp_editbtns');214 215 215 216 DOM.add(document.body, 'div', { … … 240 241 241 242 tinymce.dom.Event.add(dellButton, 'mousedown', function(e) { 242 var e l = ed.selection.getNode(), p;243 var ed = tinymce.activeEditor, el = ed.selection.getNode(), parent; 243 244 244 245 if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) { 245 if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) 246 ed.dom.remove(p); 247 else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) 248 ed.dom.remove(p); 249 else 246 if ( (parent = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(parent, 'mceTemp') ) { 247 ed.dom.remove(parent); 248 } else { 249 if ( el.parentNode.nodeName == 'A' && el.parentNode.childNodes.length == 1 ) 250 el = el.parentNode; 251 252 if ( el.parentNode.nodeName == 'P' && el.parentNode.childNodes.length == 1 ) 253 el = el.parentNode; 254 250 255 ed.dom.remove(el); 256 } 251 257 252 258 ed.execCommand('mceRepaint'); … … 258 264 259 265 _editImage : function() { 260 var ed = t his.editor, url = this.url, el = ed.selection.getNode(), vp, H, W, cls = el.className;266 var ed = tinymce.activeEditor, url = this.url, el = ed.selection.getNode(), vp, H, W, cls = el.className; 261 267 262 268 if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' ) -
trunk/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js
r22602 r22857 12 12 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); 13 13 ed.addCommand('WP_Gallery', function() { 14 if ( tinymce.isIE ) 15 ed.selection.moveToBookmark( ed.wpGalleryBookmark ); 16 14 17 var el = ed.selection.getNode(), 15 18 gallery = wp.media.gallery, … … 50 53 ed.onMouseDown.add(function(ed, e) { 51 54 if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wpGallery') ) { 55 ed.plugins.wordpress._hideButtons(); 52 56 ed.plugins.wordpress._showButtons(e.target, 'wp_gallerybtns'); 53 57 } … … 88 92 89 93 _createButtons : function() { 90 var t = this, ed = t.editor, DOM = tinymce.DOM, editButton, dellButton, isRetina; 94 var t = this, ed = tinymce.activeEditor, DOM = tinymce.DOM, editButton, dellButton, isRetina; 95 96 if ( DOM.get('wp_gallerybtns') ) 97 return; 91 98 92 99 isRetina = ( window.devicePixelRatio && window.devicePixelRatio > 1 ) || // WebKit, Opera 93 100 ( window.matchMedia && window.matchMedia('(min-resolution:130dpi)').matches ); // Firefox, IE10, Opera 94 95 DOM.remove('wp_gallerybtns');96 101 97 102 DOM.add(document.body, 'div', { … … 109 114 110 115 tinymce.dom.Event.add(editButton, 'mousedown', function(e) { 111 ed.windowManager.bookmark = ed.selection.getBookmark('simple'); 116 var ed = tinymce.activeEditor; 117 ed.wpGalleryBookmark = ed.selection.getBookmark('simple'); 112 118 ed.execCommand("WP_Gallery"); 113 119 ed.plugins.wordpress._hideButtons(); … … 123 129 124 130 tinymce.dom.Event.add(dellButton, 'mousedown', function(e) { 125 var e l = ed.selection.getNode();131 var ed = tinymce.activeEditor, el = ed.selection.getNode(); 126 132 127 133 if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wpGallery') ) {
Note: See TracChangeset
for help on using the changeset viewer.