Tabbed editor from skeltoac. fixes #2829

git-svn-id: https://develop.svn.wordpress.org/trunk@4206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-09-22 07:04:41 +00:00
parent 2afc3e16b4
commit c82cc535bc
8 changed files with 232 additions and 80 deletions
-41
View File
@@ -1250,47 +1250,6 @@ function save_mod_rewrite_rules() {
insert_with_markers($home_path.'.htaccess', 'WordPress', $rules);
}
function the_quicktags() {
echo '
<div id="quicktags">
';
wp_print_scripts( 'quicktags' );
echo ' <script type="text/javascript">
//<![CDATA[
if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();
//]]>
</script>
</div>
';
echo '
<script type="text/javascript">
function edInsertContent(myField, myValue) {
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
myField.focus();
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == "0") {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
myField.focus();
myField.selectionStart = startPos + myValue.length;
myField.selectionEnd = startPos + myValue.length;
} else {
myField.value += myValue;
myField.focus();
}
}
</script>
';
}
function get_broken_themes() {
global $wp_broken_themes;
+1 -2
View File
@@ -410,7 +410,6 @@ function updateOtherIcon(n) {
var win = window.opener ? window.opener : window.dialogArguments;
if (!win) win = top;
tinyMCE = win.tinyMCE;
richedit = ( typeof tinyMCE == 'object' && tinyMCE.configs.length > 0 );
function sendToEditor(n) {
o = document.getElementById('div'+n);
h = o.innerHTML.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // Trim
@@ -420,7 +419,7 @@ function sendToEditor(n) {
h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames
h = h.replace(new RegExp('<IMG', 'g'), '<img'); // Lowercase again
h = h.replace(new RegExp('(<img .+?")>', 'g'), '$1 />'); // XHTML
if ( richedit )
if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') )
win.tinyMCE.execCommand('mceInsertContent', false, h);
else
win.edInsertContent(win.edCanvas, h);
+40 -5
View File
@@ -1,4 +1,4 @@
* html #poststuff {
z* html #poststuff {
height: 100%; /* kill peekaboo bug in IE */
}
@@ -490,10 +490,6 @@ table .vers {
width: 100%;
}
#quicktags {
margin-left: -1px;
}
#currenttheme img {
float: left;
border: 1px solid #666;
@@ -512,6 +508,27 @@ table .vers {
color: #fff;
}
#postdivrich #quicktags {
background: #f0f0ee;
padding: 0px;
border: 1px solid #ccc;
border-bottom: none;
}
#postdiv #quicktags {
padding-right: 6px;
}
#postdivrich #quicktags {
display: none;
}
#quicktags #ed_toolbar {
padding: 0px 2px;
}
#ed_toolbar input {
background: #fff url( images/fade-butt.png ) repeat-x 0px -2px;
margin: 3px 2px 2px;
}
#quicktags #ed_strong {
font-weight: bold;
}
@@ -531,6 +548,7 @@ table .vers {
#quicktags #ed_code {
font-family: "Courier New", Courier, mono;
margin-bottom: 3px;
}
#title {
@@ -1118,3 +1136,20 @@ input#catadd { background: #a4a4a4;
#ajax-response.alignleft {
margin-left: 2em;
}
#postdivrich #edButtons {
padding-left: 3px;
}
#postdivrich #content, #postdivrich #content:active {
border: 1px solid #ccc;
}
#edButtons input, #edButtons input:active {
margin: 0px 2px -1px;
}
#edButtons input.edButtonFore, #edButtons input.edButtonFore:active {
background: #f0f0ee;
border-bottom: 1px solid #f0f0ee;
}
#edButtons input.edButtonBack, #edButtons input.edButtonBack:active {
background: #fff url( images/fade-butt.png ) repeat-x 0px 15px;
border-bottom: 1px solid #ccc;
}