Changeset 669
- Timestamp:
- 12/31/2003 04:05:41 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/quicktags.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/quicktags.js
r623 r669 158 158 edOpenTags[edOpenTags.length] = button; 159 159 document.getElementById(edButtons[button].id).value = '/' + document.getElementById(edButtons[button].id).value; 160 161 160 } 162 161 } … … 250 249 //IE support 251 250 if (document.selection) { 252 myField.focus(); 251 myField.focus(); 253 252 sel = document.selection.createRange(); 254 253 if (sel.text.length > 0) { … … 271 270 var startPos = myField.selectionStart; 272 271 var endPos = myField.selectionEnd; 273 var cursorPos ;272 var cursorPos = endPos; 274 273 if (startPos != endPos) { 275 274 myField.value = myField.value.substring(0, startPos) … … 278 277 + edButtons[i].tagEnd 279 278 + myField.value.substring(endPos, myField.value.length); 280 cursorPos = endPos 281 + edButtons[i].tagStart.length 282 + edButtons[i].tagEnd.length; 279 cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length; 283 280 } 284 281 else { … … 344 341 } 345 342 if (!edCheckOpenTags(i)) { 346 edButtons[i].tagStart = '<a href="' 347 + prompt('Enter the URL' 348 ,defaultValue 349 ) 350 + '">'; 351 } 352 edInsertTag(myField, i); 343 var URL = prompt('Enter the URL' ,defaultValue); 344 if (URL) { 345 edButtons[i].tagStart = '<a href="' + URL + '">'; 346 edInsertTag(myField, i); 347 } 348 } 349 else { 350 edInsertTag(myField, i); 351 } 353 352 } 354 353 355 354 function edInsertImage(myField) { 356 var myValue = '<img src="' 357 + prompt('Enter the URL of the image', 'http://') 358 + '" alt="' 359 + prompt('Enter a description of the image', '') 360 + '" />'; 361 edInsertContent(myField, myValue); 362 } 355 var myValue = prompt('Enter the URL of the image', 'http://'); 356 if (myValue) { 357 myValue = '<img src="' 358 + myValue 359 + '" alt="' + prompt('Enter a description of the image', '') 360 + '" />'; 361 edInsertContent(myField, myValue); 362 } 363 }
Note: See TracChangeset
for help on using the changeset viewer.