+
-
+
-
+
-
-
diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php
index 7da2498588..6262fa6319 100644
--- a/wp-admin/inline-uploading.php
+++ b/wp-admin/inline-uploading.php
@@ -150,6 +150,7 @@ if ( $start > 0 ) {
$uwidth_sum = 0;
$html = '';
+$popups = '';
$style = '';
$script = '';
if ( count($attachments) > 0 ) {
@@ -162,6 +163,7 @@ if ( count($attachments) > 0 ) {
$__using_thumbnail = __('Using Thumbnail');
$__using_original = __('Using Original');
$__no_thumbnail = ''.__('No Thumbnail').'';
+ $__send_to_editor = __('Send to editor');
$__close = __('Close Options');
$__confirmdelete = __('Delete this file from the server?');
$__nothumb = __('There is no thumbnail associated with this photo.');
@@ -190,7 +192,8 @@ var srcb = new Array();
add_post_meta($ID, '_wp_attachment_metadata', $meta);
}
$attachment = array_merge($attachment, $meta);
- $delete_cancel = "$__delete
+ $send_delete_cancel = "$__send_to_editor
+$__delete
$__close
";
$uwidth_sum += 128;
@@ -219,30 +222,32 @@ imga[{$ID}] = ' ';
";
$html .= "
+";
+ $popups .= "
";
} else {
- $script .= "a{$ID}a = '{$attachment['post_title']} ';
-a{$ID}b = '{$attachment['post_title']} ';
+ $script .= "aa[{$ID}] = '{$attachment['post_title']} ';
+ab[{$ID}] = '{$attachment['post_title']} ';
";
$html .= "
+";
+ $popups .= "
";
}
}
@@ -278,13 +283,14 @@ function doPopup(i) {
target = document.getElementById('target'+i);
popup = document.getElementById('popup'+i);
popup.style.left = (target.offsetLeft) + 'px';
+ popup.style.top = (target.offsetTop) + 'px';
popup.style.display = 'block';
}
-function init() {
- popup = false;
-}
+popup = false;
function selectLink(n) {
o=document.getElementById('div'+n);
+ if ( typeof document.body.createTextRange == 'undefined' || typeof win.tinyMCE == 'undefined' || win.tinyMCE.configs.length < 1 )
+ return;
r = document.body.createTextRange();
if ( typeof r != 'undefined' ) {
r.moveToElementText(o);
@@ -333,6 +339,24 @@ function toggleImage(n) {
oi.innerHTML = usingthumbnail;
}
}
+
+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
+ h = h.replace(new RegExp(' (class|title|width|height|id|onclick|onmousedown)=([^\'"][^ ]*)( |/|>)', 'g'), ' $1="$2"$3'); // Enclose attribs in quotes
+ h = h.replace(new RegExp(' on(click|mousedown)="[^"]*"', 'g'), ''); // Drop menu events
+ h = h.replace(new RegExp('<(/?)A', 'g'), '<$1a'); // Lowercase tagnames
+ h = h.replace(new RegExp(' ', 'g'), '$1 />'); // XHTML
+ if ( richedit )
+ win.tinyMCE.execCommand('mceInsertContent', false, h);
+ else
+ win.edInsertContent(win.edCanvas, h);
+}
-
+
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 06ac711136..88619565c5 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -1,7 +1,9 @@
* html #poststuff {
height: 100%; /* kill peekaboo bug in IE */
}
-
+body {
+ border: none;
+}
a {
border-bottom: 1px solid #69c;
color: #00019b;
diff --git a/wp-includes/js/quicktags.js b/wp-includes/js/quicktags.js
index 7f4d7a3763..be628e0740 100644
--- a/wp-includes/js/quicktags.js
+++ b/wp-includes/js/quicktags.js
@@ -386,4 +386,4 @@ function edInsertImage(myField) {
+ '" />';
edInsertContent(myField, myValue);
}
-}
\ No newline at end of file
+}
diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js
index babc33533f..27ce403ef8 100644
--- a/wp-includes/js/tinymce/tiny_mce.js
+++ b/wp-includes/js/tinymce/tiny_mce.js
@@ -5526,7 +5526,7 @@ TinyMCEControl.prototype.execCommand = function(command, user_interface, value)
case "mceInsertContent":
var insertHTMLFailed = false;
this.getWin().focus();
-
+/* WP
if (tinyMCE.isGecko || tinyMCE.isOpera) {
try {
// Is plain text or HTML
@@ -5560,7 +5560,7 @@ TinyMCEControl.prototype.execCommand = function(command, user_interface, value)
return;
}
}
-
+*/
// Ugly hack in Opera due to non working "inserthtml"
if (tinyMCE.isOpera && insertHTMLFailed) {
this.getDoc().execCommand("insertimage", false, tinyMCE.uniqueURL);