Changeset 2964
- Timestamp:
- 10/25/2005 11:10:14 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/admin-header.php (modified) (2 diffs)
-
wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js (modified) (12 diffs)
-
wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r2917 r2964 88 88 width : "100%", 89 89 theme : "advanced", 90 theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,emotions,separator, undo,redo,wordpress,code",90 theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,emotions,separator,wordpress,separator,undo,redo,code", 91 91 theme_advanced_buttons2 : "", 92 92 theme_advanced_buttons3 : "", … … 100 100 entity_encoding : "raw", 101 101 relative_urls : false, 102 remove_script_host : false, 102 103 valid_elements : "a[href|title],strong/b,em/i,strike,u,p[class|align],ol,ul,li,br,img[class|src|alt|title|width|height|align],sub,sup,blockquote,table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[dir|class|colspan|rowspan|width|height|align|valign],div[dir|class|align],span[class|align],pre[class],address,h1[class|align],h2[class|align],h3[class|align],h4[class|align],h5[class|align],h6[class|align],hr", 103 plugins : " autosave, contextmenu"104 plugins : "contextmenu,wordpress" 104 105 <?php do_action('mce_options'); ?> 105 106 }); -
trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
r2820 r2964 10 10 switch (control_name) { 11 11 case "wordpress": 12 return '< img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="More..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" /><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="...Page..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');" />';12 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onmousedown="return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="More..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a><!--<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onmousedown="return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="...Page..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>-->'; 13 13 } 14 14 … … 66 66 } 67 67 68 // Handle commands69 switch (command) {68 // Handle commands 69 switch (command) { 70 70 case "mcewordpressmore": 71 var name= "";71 var flag = ""; 72 72 var template = new Array(); 73 73 var inst = tinyMCE.getInstanceById(editor_id); … … 76 76 // Is selection a image 77 77 if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { 78 name = getAttrib(focusElm, 'name');79 80 if ( name!= 'mce_plugin_wordpress_more') // Not a wordpress78 flag = getAttrib(focusElm, 'class'); 79 80 if (flag != 'mce_plugin_wordpress_more') // Not a wordpress 81 81 return true; 82 82 … … 85 85 86 86 html = '' 87 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '87 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ' 88 88 + ' width="100%" height="10px" ' 89 89 + 'alt="More..." title="More..." class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />'; 90 tinyMCE.execCommand("mceInsertContent",true,html);90 tinyMCE.execCommand("mceInsertContent",true,html); 91 91 tinyMCE.selectedInstance.repaint(); 92 92 return true; 93 93 case "mcewordpresspage": 94 var name= "";94 var flag = ""; 95 95 var template = new Array(); 96 96 var inst = tinyMCE.getInstanceById(editor_id); … … 99 99 // Is selection a image 100 100 if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { 101 name= getAttrib(focusElm, 'name');102 103 if ( name!= 'mce_plugin_wordpress_page') // Not a wordpress101 flag = getAttrib(focusElm, 'name'); 102 103 if (flag != 'mce_plugin_wordpress_page') // Not a wordpress 104 104 return true; 105 105 … … 108 108 109 109 html = '' 110 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '110 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ' 111 111 + ' width="100%" height="10px" ' 112 112 + 'alt="More..." title="More..." class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page" />'; 113 tinyMCE.execCommand("mceInsertContent",true,html);113 tinyMCE.execCommand("mceInsertContent",true,html); 114 114 tinyMCE.selectedInstance.repaint(); 115 115 return true; 116 }117 118 // Pass to next handler in chain119 return false;116 } 117 118 // Pass to next handler in chain 119 return false; 120 120 } 121 121 … … 131 131 var contentAfter = content.substring(startPos + 11); 132 132 content = content.substring(0, startPos); 133 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';133 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '; 134 134 content += ' width="100%" height="10px" '; 135 content += 'alt="More..." title="More..." class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more"/>';135 content += 'alt="More..." title="More..." class="mce_plugin_wordpress_more" />'; 136 136 content += contentAfter; 137 137 … … 145 145 var contentAfter = content.substring(startPos + 15); 146 146 content = content.substring(0, startPos); 147 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';147 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '; 148 148 content += ' width="100%" height="10px" '; 149 content += 'alt="...Next Page..." title="...Next Page..." class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page"/>';149 content += 'alt="...Next Page..." title="...Next Page..." class="mce_plugin_wordpress_page" />'; 150 150 content += contentAfter; 151 151 … … 161 161 var attribs = TinyMCE_wordpress_parseAttributes(content.substring(startPos + 4, endPos)); 162 162 163 if (attribs[' name'] == "mce_plugin_wordpress_more") {163 if (attribs['class'] == "mce_plugin_wordpress_more") { 164 164 endPos += 2; 165 165 … … 171 171 content = chunkBefore + embedHTML + chunkAfter; 172 172 } 173 if (attribs[' name'] == "mce_plugin_wordpress_page") {173 if (attribs['class'] == "mce_plugin_wordpress_page") { 174 174 endPos += 2; 175 175 … … 182 182 } 183 183 } 184 185 // Handle TinyMCE weirdness without messing up the core 186 //alert("Content before TinyMCE_wordpress_cleanup\n\n'"+content+"'"); 187 188 // Strip any trailing <br /> and whitespace. 189 content = content.replace(new RegExp('<br ?/?>[ \t]*$', ''), ''); 190 191 //alert("Content after TinyMCE_wordpress_cleanup\n\n'"+content+"'"); 184 192 break; 185 193 } … … 201 209 202 210 do { 203 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, ' name').indexOf('mce_plugin_wordpress_more') == 0)211 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_more') == 0) 204 212 tinyMCE.switchClassSticky(editor_id + '_wordpress_more', 'mceButtonSelected'); 205 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, ' name').indexOf('mce_plugin_wordpress_page') == 0)213 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_page') == 0) 206 214 tinyMCE.switchClassSticky(editor_id + '_wordpress_page', 'mceButtonSelected'); 207 215 } while ((node = node.parentNode)); -
trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
r2820 r2964 10 10 switch (control_name) { 11 11 case "wordpress": 12 return '< img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="More..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" /><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="...Page..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');" />';12 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onmousedown="return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="More..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a><!--<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onmousedown="return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="...Page..." width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>-->'; 13 13 } 14 14 … … 66 66 } 67 67 68 // Handle commands69 switch (command) {68 // Handle commands 69 switch (command) { 70 70 case "mcewordpressmore": 71 var name= "";71 var flag = ""; 72 72 var template = new Array(); 73 73 var inst = tinyMCE.getInstanceById(editor_id); … … 76 76 // Is selection a image 77 77 if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { 78 name = getAttrib(focusElm, 'name');79 80 if ( name!= 'mce_plugin_wordpress_more') // Not a wordpress78 flag = getAttrib(focusElm, 'class'); 79 80 if (flag != 'mce_plugin_wordpress_more') // Not a wordpress 81 81 return true; 82 82 … … 85 85 86 86 html = '' 87 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '87 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ' 88 88 + ' width="100%" height="10px" ' 89 89 + 'alt="More..." title="More..." class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />'; 90 tinyMCE.execCommand("mceInsertContent",true,html);90 tinyMCE.execCommand("mceInsertContent",true,html); 91 91 tinyMCE.selectedInstance.repaint(); 92 92 return true; 93 93 case "mcewordpresspage": 94 var name= "";94 var flag = ""; 95 95 var template = new Array(); 96 96 var inst = tinyMCE.getInstanceById(editor_id); … … 99 99 // Is selection a image 100 100 if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { 101 name= getAttrib(focusElm, 'name');102 103 if ( name!= 'mce_plugin_wordpress_page') // Not a wordpress101 flag = getAttrib(focusElm, 'name'); 102 103 if (flag != 'mce_plugin_wordpress_page') // Not a wordpress 104 104 return true; 105 105 … … 108 108 109 109 html = '' 110 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '110 + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ' 111 111 + ' width="100%" height="10px" ' 112 112 + 'alt="More..." title="More..." class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page" />'; 113 tinyMCE.execCommand("mceInsertContent",true,html);113 tinyMCE.execCommand("mceInsertContent",true,html); 114 114 tinyMCE.selectedInstance.repaint(); 115 115 return true; 116 }117 118 // Pass to next handler in chain119 return false;116 } 117 118 // Pass to next handler in chain 119 return false; 120 120 } 121 121 … … 131 131 var contentAfter = content.substring(startPos + 11); 132 132 content = content.substring(0, startPos); 133 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';133 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '; 134 134 content += ' width="100%" height="10px" '; 135 content += 'alt="More..." title="More..." class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more"/>';135 content += 'alt="More..." title="More..." class="mce_plugin_wordpress_more" />'; 136 136 content += contentAfter; 137 137 … … 145 145 var contentAfter = content.substring(startPos + 15); 146 146 content = content.substring(0, startPos); 147 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';147 content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '; 148 148 content += ' width="100%" height="10px" '; 149 content += 'alt="...Next Page..." title="...Next Page..." class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page"/>';149 content += 'alt="...Next Page..." title="...Next Page..." class="mce_plugin_wordpress_page" />'; 150 150 content += contentAfter; 151 151 … … 161 161 var attribs = TinyMCE_wordpress_parseAttributes(content.substring(startPos + 4, endPos)); 162 162 163 if (attribs[' name'] == "mce_plugin_wordpress_more") {163 if (attribs['class'] == "mce_plugin_wordpress_more") { 164 164 endPos += 2; 165 165 … … 171 171 content = chunkBefore + embedHTML + chunkAfter; 172 172 } 173 if (attribs[' name'] == "mce_plugin_wordpress_page") {173 if (attribs['class'] == "mce_plugin_wordpress_page") { 174 174 endPos += 2; 175 175 … … 182 182 } 183 183 } 184 185 // Handle TinyMCE weirdness without messing up the core 186 //alert("Content before TinyMCE_wordpress_cleanup\n\n'"+content+"'"); 187 188 // Strip any trailing <br /> and whitespace. 189 content = content.replace(new RegExp('<br ?/?>[ \t]*$', ''), ''); 190 191 //alert("Content after TinyMCE_wordpress_cleanup\n\n'"+content+"'"); 184 192 break; 185 193 } … … 201 209 202 210 do { 203 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, ' name').indexOf('mce_plugin_wordpress_more') == 0)211 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_more') == 0) 204 212 tinyMCE.switchClassSticky(editor_id + '_wordpress_more', 'mceButtonSelected'); 205 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, ' name').indexOf('mce_plugin_wordpress_page') == 0)213 if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_page') == 0) 206 214 tinyMCE.switchClassSticky(editor_id + '_wordpress_page', 'mceButtonSelected'); 207 215 } while ((node = node.parentNode));
Note: See TracChangeset
for help on using the changeset viewer.