Changeset 36777
- Timestamp:
- 02/29/2016 07:37:42 PM (10 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
-
tinymce/plugins/wplink/plugin.js (modified) (2 diffs)
-
wplink.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js
r36747 r36777 145 145 ], true ); 146 146 147 editToolbar = editor.wp._createToolbar([147 var editButtons = [ 148 148 'wp_link_input', 149 'wp_link_apply', 150 'wp_link_advanced' 151 ], true ); 149 'wp_link_apply' 150 ]; 151 152 if ( typeof window.wpLink !== 'undefined' ) { 153 editButtons.push( 'wp_link_advanced' ); 154 } 155 156 editToolbar = editor.wp._createToolbar( editButtons, true ); 152 157 153 158 editToolbar.on( 'show', function() { … … 178 183 179 184 editor.addCommand( 'WP_Link', function() { 180 if ( tinymce.Env.ie && tinymce.Env.ie < 10 ) { 181 if ( typeof window.wpLink !== 'undefined' ) { 182 window.wpLink.open( editor.id ); 183 } 184 185 if ( tinymce.Env.ie && tinymce.Env.ie < 10 && typeof window.wpLink !== 'undefined' ) { 186 window.wpLink.open( editor.id ); 185 187 return; 186 188 } -
trunk/src/wp-includes/js/wplink.js
r36751 r36777 1 /* global tinymce, wpLinkL10n, wpActiveEditor */ 1 2 2 var wpLink; 3 3 4 ( function( $ ) {4 ( function( $, wpLinkL10n ) { 5 5 var editor, correctedURL, linkNode, 6 6 inputs = {}, … … 81 81 $input.val( ui.item.permalink ); 82 82 83 if ( inputs.wrap.hasClass( 'has-text-field' ) && tinymce.trim( inputs.text.val() ) === '' ) {83 if ( inputs.wrap.hasClass( 'has-text-field' ) && $.trim( inputs.text.val() ) === '' ) { 84 84 inputs.text.val( ui.item.title ); 85 85 } … … 145 145 this.textarea = $( '#' + window.wpActiveEditor ).get( 0 ); 146 146 147 if ( typeof tinymce !== 'undefined' ) {147 if ( typeof window.tinymce !== 'undefined' ) { 148 148 // Make sure the link wrapper is the last element in the body, 149 149 // or the inline editor toolbar may show above the backdrop. 150 150 $body.append( inputs.backdrop, inputs.wrap ); 151 151 152 ed = tinymce.get(wpActiveEditor );152 ed = window.tinymce.get( window.wpActiveEditor ); 153 153 154 154 if ( ed && ! ed.isHidden() ) { … … 158 158 } 159 159 160 if ( editor && tinymce.isIE && ! editor.windowManager.wplinkBookmark ) {160 if ( editor && window.tinymce.isIE && ! editor.windowManager.wplinkBookmark ) { 161 161 editor.windowManager.wplinkBookmark = editor.selection.getBookmark(); 162 162 } … … 237 237 node = nodes[i]; 238 238 239 if ( node.nodeType != 3 && ! tinymce.dom.BookmarkManager.isBookmarkNode( node ) ) {239 if ( node.nodeType != 3 && ! window.tinymce.dom.BookmarkManager.isBookmarkNode( node ) ) { 240 240 return false; 241 241 } … … 254 254 linkText = linkNode.innerText || linkNode.textContent; 255 255 256 if ( ! tinymce.trim( linkText ) ) {256 if ( ! $.trim( linkText ) ) { 257 257 linkText = text || ''; 258 258 } … … 398 398 editor.focus(); 399 399 400 if ( tinymce.isIE && editor.windowManager.wplinkBookmark ) {400 if ( window.tinymce.isIE && editor.windowManager.wplinkBookmark ) { 401 401 editor.selection.moveToBookmark( editor.windowManager.wplinkBookmark ); 402 402 editor.windowManager.wplinkBookmark = null; … … 475 475 } 476 476 477 selection = tinymce.trim( selection );477 selection = $.trim( selection ); 478 478 479 479 if ( selection && emailRegexp.test( selection ) ) { … … 497 497 498 498 $( document ).ready( wpLink.init ); 499 })( jQuery );499 })( jQuery, window.wpLinkL10n );
Note: See TracChangeset
for help on using the changeset viewer.