- Timestamp:
- 09/26/2005 06:52:30 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/themes/advanced/source_editor.htm
r2812 r2916 1 <html >1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 2 <head> 3 <title>{$lang_theme_code_title}</title> 4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 5 <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script> 6 <script language="javascript" type="text/javascript"> 7 <!-- 8 tinyMCE.setWindowArg('mce_windowresize', false); 3 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 4 <title>{$lang_theme_code_title}</title> 5 <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script> 6 <script language="javascript" type="text/javascript" src="jscripts/source_editor.js"></script> 7 </head> 8 <body onload="onLoadInit();" onresize="resizeInputs();" style="display: none"> 9 <form name="source" onsubmit="saveContent();" action="#"> 10 <div style="float: left" class="title">{$lang_theme_code_title}</div> 9 11 10 function saveContent() { 11 if (window.opener) { 12 window.opener.tinyMCE.setContent(document.getElementById('htmlSource').value); 13 window.close(); 14 } 15 } 12 <div style="float: right"> 13 <script language="javascript" type="text/javascript">renderWordWrap();</script> 14 </div> 16 15 17 // Fixes some charcode issues 18 function fixContent(html) { 19 html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1'); 20 html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n'); 21 html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi'); 22 html = tinyMCE.regexpReplace(html, '\n\n','\n','gi'); 23 return html; 24 } 16 <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea> 25 17 26 function onLoadInit() { 27 document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'))); 28 resizeInputs(); 29 setWrap('off'); 30 } 18 <div class="mceActionPanel"> 19 <div style="float: left"> 20 <input type="button" name="insert" value="{$lang_update}" onclick="saveContent();" id="insert" /> 21 </div> 31 22 32 function setWrap(val) { 33 // hard soft off 34 document.forms[0].htmlSource.wrap = val; 35 } 36 37 function toggleWordWrap(elm) { 38 if (elm.checked) 39 setWrap('soft'); 40 else 41 setWrap('off'); 42 } 43 44 var wHeight=0, wWidth=0, owHeight=0, owWidth=0; 45 46 function resizeInputs() { 47 if (!tinyMCE.isMSIE) { 48 wHeight = self.innerHeight-80; 49 wWidth = self.innerWidth-25; 50 } else { 51 wHeight = document.body.clientHeight-80; 52 wWidth = document.body.clientWidth-25; 53 } 54 55 document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px'; 56 document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px'; 57 58 } 59 //--> 60 </script> 61 </head> 62 <body scroll="no" onload="onLoadInit();" onresize="resizeInputs();"> 63 <form name="source" onsubmit="saveContent();"> 64 <table border="0" cellpadding="0" cellspacing="2" align="center"> 65 <tr> 66 <td class="title">{$lang_theme_code_title}</td> 67 <td align="right"><script language="javascript" type="text/javascript"> 68 <!-- 69 if (tinyMCE.isMSIE) { 70 document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>'); 71 } 72 //--> 73 </script></td> 74 </tr> 75 <tr> 76 <td colspan="2" align="center"> 77 <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea> 78 </td> 79 </tr> 80 <tr> 81 <td colspan="2" align="right"><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="saveContent();" /></td> 82 </tr> 83 </table> 84 </form> 23 <div style="float: right"> 24 <input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" /> 25 </div> 26 </div> 27 </form> 85 28 </body> 86 29 </html>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)