diff --git a/src/admin/dialog/select_images.php b/src/admin/dialog/select_images.php index a5ea47a7..1701c34d 100644 --- a/src/admin/dialog/select_images.php +++ b/src/admin/dialog/select_images.php @@ -17,6 +17,7 @@ if (empty($imgstick)) { $imgstick = ''; } $noeditor = isset($noeditor) ? $noeditor : ''; +$iseditor = isset($iseditor) ? $iseditor : ''; $activepath = str_replace('.', '', $activepath); $activepath = preg_replace("#\/{1,}#", '/', $activepath); if (strlen($activepath) < strlen($cfg_image_dir)) { @@ -45,6 +46,9 @@ if (!empty($CKEditorFuncNum)) { if (!empty($noeditor)) { $addparm .= '&noeditor=yes'; } +if (!empty($iseditor)) { + $addparm .= '&iseditor='.$iseditor; +} ?> @@ -98,31 +102,37 @@ a{text-decoration:none!important} } function ReturnImg(reimg) { var funcNum = getUrlParam('CKEditorFuncNum'); + var iseditor = parseInt(getUrlParam('iseditor')); if (funcNum > 1) { var fileUrl = reimg; window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl); } - if (window.opener.document. != null) { - window.opener.document..value = reimg; - if (window.opener.document.getElementById('div')) { - if (TNav() == 'IE') { - //window.opener.document.getElementById('div').filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = reimg; - window.opener.document.getElementById('div').src = reimg; - window.opener.document.getElementById('div').style.width = '150px'; - window.opener.document.getElementById('div').style.height = '100px'; - } else - window.opener.document.getElementById('div').style.backgroundImage = "url(" + reimg + ")"; - } else if (window.opener.document.getElementById('')) { - window.opener.document.getElementById('').src = reimg; - } - //适配新的缩略图 - if (window.opener.document.getElementById('litPic')) { - window.opener.document.getElementById('litPic').src = reimg; - } - if (document.all) window.opener = true; - } else if (typeof window.opener.CKEDITOR.instances[""] !== "undefined") { + if (iseditor==1) { let addonHTML = ``; window.opener.CKEDITOR.instances[""].insertHtml(addonHTML); + } else { + if (window.opener.document. != null) { + window.opener.document..value = reimg; + if (window.opener.document.getElementById('div')) { + if (TNav() == 'IE') { + //window.opener.document.getElementById('div').filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = reimg; + window.opener.document.getElementById('div').src = reimg; + window.opener.document.getElementById('div').style.width = '150px'; + window.opener.document.getElementById('div').style.height = '100px'; + } else + window.opener.document.getElementById('div').style.backgroundImage = "url(" + reimg + ")"; + } else if (window.opener.document.getElementById('')) { + window.opener.document.getElementById('').src = reimg; + } + //适配新的缩略图 + if (window.opener.document.getElementById('litPic')) { + window.opener.document.getElementById('litPic').src = reimg; + } + if (document.all) window.opener = true; + } else if (typeof window.opener.CKEDITOR.instances[""] !== "undefined") { + let addonHTML = ``; + window.opener.CKEDITOR.instances[""].insertHtml(addonHTML); + } } window.close(); } diff --git a/src/static/ckeditor/plugins/image/dialogs/image.js b/src/static/ckeditor/plugins/image/dialogs/image.js index 4e7f6daf..eaede9ec 100755 --- a/src/static/ckeditor/plugins/image/dialogs/image.js +++ b/src/static/ckeditor/plugins/image/dialogs/image.js @@ -1105,7 +1105,7 @@ var systemZoom = width / window.screen.availWidth; var posLeft = (width - w) / 2 / systemZoom + dualScreenLeft; var posTop = (height - h) / 2 / systemZoom + dualScreenTop; - window.open("./dialog/select_images.php?f=body", "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + posLeft + ", top=" + posTop); + window.open("./dialog/select_images.php?iseditor=1&f="+editor.name, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + posLeft + ", top=" + posTop); CKEDITOR.dialog.getCurrent().hide(); } },