Ticket #16695: 16695.2.diff
File 16695.2.diff, 4.0 KB (added by , 13 years ago) |
---|
-
wp-includes/js/quicktags.dev.js
4 4 5 5 var edButtons = new Array(), edLinks = new Array(), edOpenTags = new Array(), now = new Date(), datetime; 6 6 7 // cross browser dom ready 8 (function(func,w) { 9 if (typeof jQuery != 'undefined') { 10 jQuery(func); 11 } else { 12 if ( w.addEventListener ) 13 w.addEventListener('load', func, false); 14 else if ( w.attachEvent ) 15 w.attachEvent( 'onload', func ); 16 } 17 })(edToolbar,window); 18 7 19 function edButton(id, display, tagStart, tagEnd, access, open) { 8 20 this.id = id; // used to name the toolbar button 9 21 this.display = display; // label on button … … 154 166 155 167 function edShowButton(button, i) { 156 168 if (button.id == 'ed_img') { 157 document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertImage(edCanvas);" value="' + button.display + '" />');169 return '<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertImage(edCanvas);" value="' + button.display + '" />'; 158 170 } 159 171 else if (button.id == 'ed_link') { 160 document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');172 return '<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />'; 161 173 } 162 174 else { 163 document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertTag(edCanvas, ' + i + ');" value="' + button.display + '" />');175 return '<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertTag(edCanvas, ' + i + ');" value="' + button.display + '" />'; 164 176 } 165 177 } 166 178 … … 170 182 tempStr += '<option value="' + i + '">' + edLinks[i].display + '</option>'; 171 183 } 172 184 tempStr += '</select>'; 173 document.write(tempStr);185 return tempStr; 174 186 } 175 187 176 188 function edAddTag(button) { … … 253 265 } 254 266 255 267 function edToolbar() { 256 document.write('<div id="ed_toolbar">'); 268 var tb = document.getElementById('ed_toolbar'), html = ''; 269 257 270 for (var i = 0; i < edButtons.length; i++) { 258 edShowButton(edButtons[i], i);271 html += edShowButton(edButtons[i], i); 259 272 } 260 document.write('<input type="button" id="ed_spell" class="ed_button" onclick="edSpell(edCanvas);" title="' + quicktagsL10n.dictionaryLookup + '" value="' + quicktagsL10n.lookup + '" />'); 261 document.write('<input type="button" id="ed_close" class="ed_button" onclick="edCloseAllTags();" title="' + quicktagsL10n.closeAllOpenTags + '" value="' + quicktagsL10n.closeTags + '" />'); 262 // edShowLinks(); // disabled by default 263 document.write('</div>'); 273 274 html += '<input type="button" id="ed_spell" class="ed_button" onclick="edSpell(edCanvas);" title="' + quicktagsL10n.dictionaryLookup + '" value="' + quicktagsL10n.lookup + '" />'; 275 html += '<input type="button" id="ed_close" class="ed_button" onclick="edCloseAllTags();" title="' + quicktagsL10n.closeAllOpenTags + '" value="' + quicktagsL10n.closeTags + '" />'; 276 277 // html += edShowLinks(); // disabled by default 278 tb.innerHTML = html; 264 279 } 265 280 266 281 // insertion code -
wp-includes/general-template.php
1827 1827 ?> 1828 1828 <div id="quicktags"><?php 1829 1829 wp_print_scripts( 'quicktags' ); ?> 1830 < script type="text/javascript">edToolbar()</script>1830 <div id="ed_toolbar"> 1831 1831 </div> 1832 </div> 1832 1833 1833 1834 <?php 1834 1835 $the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea rows='$rows'$class cols='40' name='$id' tabindex='$tab_index' id='$id'>%s</textarea></div>\n");