Changeset 25031
- Timestamp:
- 08/15/2013 09:43:29 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/wplink.js
r24841 r25031 280 280 }, 281 281 setDefaultValues : function() { 282 var selectedText,283 textarea = wpLink.textarea;284 285 282 // Set URL and description to defaults. 286 283 // Leave the new tab setting as-is. 287 284 inputs.url.val('http://'); 288 285 inputs.title.val(''); 289 if ( wpLink.isMCE() ) { 290 selectedText = tinyMCEPopup.editor.selection.getContent( { format: 'text' } ); 291 } else { 292 if ( document.selection && wpLink.range ) { 293 selectedText = wpLink.range.text; 294 } else if ( typeof textarea.selectionStart !== 'undefined' ) { 295 selectedText = textarea.value.substring( textarea.selectionStart, textarea.selectionEnd ); 286 287 if ( $('#search-panel').is(':visible') ) { 288 var selectedText, 289 textarea = wpLink.textarea; 290 291 if ( wpLink.isMCE() ) { 292 selectedText = tinyMCEPopup.editor.selection.getContent( { format: 'text' } ); 293 } else { 294 if ( document.selection && wpLink.range ) { 295 selectedText = wpLink.range.text; 296 } else if ( 'undefined' !== typeof textarea.selectionStart ) { 297 selectedText = textarea.value.substring( textarea.selectionStart, textarea.selectionEnd ); 298 } 296 299 } 297 } 298 if ( selectedText && ( selectedText = selectedText.replace( /^\s+|\s+$/g, '' ) ) ) { 299 if ( ! $('#search-panel').is(':visible') ) 300 $('#internal-toggle').trigger('click'); 301 inputs.search.val( selectedText ).trigger('keyup'); 300 301 if ( selectedText && ( selectedText = selectedText.replace( /^\s+|\s+$/g, '' ) ) ) { 302 inputs.search.val( selectedText ).trigger('keyup'); 303 } 302 304 } 303 305
Note: See TracChangeset
for help on using the changeset viewer.