X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/07784b9fcc5174d9d31afdd13d6921c82eaaabaf..b67a02e371649e700299602f4ccee716fa3903e2:/skins/ckeditor/plugins/plinn_image/dialog/plinn_image.js diff --git a/skins/ckeditor/plugins/plinn_image/dialog/plinn_image.js b/skins/ckeditor/plugins/plinn_image/dialog/plinn_image.js index 424024a..bb4883c 100644 --- a/skins/ckeditor/plugins/plinn_image/dialog/plinn_image.js +++ b/skins/ckeditor/plugins/plinn_image/dialog/plinn_image.js @@ -1,30 +1,30 @@ -// (c) Benoît PIN 2006-2007 +// (c) Benoît PIN 2006-2011 // http://plinn.org // Licence GPL +var CKEDITOR = window.dialogArguments.CKEDITOR; var editor = window.dialogArguments.editor; -var FCK = editor.FCK ; -var FCKLang = editor.FCKLang ; -var FCKConfig = editor.FCKConfig ; -var FCKPlugins = editor.FCKPlugins; -var FCKDebug = editor.FCKDebug ; +var pluginPath = window.dialogArguments.pluginPath; window.onload = function() { var mainFrame = window.frames['main']; - mainFrame.src = FCKPlugins.Items['image'].Path + 'embedded_images.html'; + mainFrame.src = pluginPath + 'dialog/embedded_images.html'; mainFrame.location.href = mainFrame.src; var tabsFrame = window.frames['tabs']; - tabsFrame.src = FCKPlugins.Items['image'].Path + 'plinn_image_tabs.html' - tabsFrame.location.href = FCKPlugins.Items['image'].Path + 'plinn_image_tabs.html' + tabsFrame.src = pluginPath + 'dialog/plinn_image_tabs.html'; + tabsFrame.location.href = tabsFrame.src; } -function updateOrInsertImage(url) { - var getSizeUrl = url + '/getResizedImageSize'; +function updateOrInsertImage(url, relative) { + if (relative) + var getSizeUrl = window.location.protocol + '//' + window.location.host + '/' + editor.contentPath + '/' + url + '/getResizedImageSize'; + else + var getSizeUrl = url + '/getResizedImageSize'; var req = new XMLHttpRequest(); req.open("POST", getSizeUrl, false); // synchrone req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - var boxSize = FCKConfig.ImageMaxDefaultDimension + '_' + FCKConfig.ImageMaxDefaultDimension; + var boxSize = editor.config.imageMaxDefaultDimension + '_' + editor.config.imageMaxDefaultDimension; req.send("asXml:boolean=True&size=" + boxSize); var doc = req.responseXML.documentElement; @@ -32,11 +32,11 @@ function updateOrInsertImage(url) { var height = doc.getElementsByTagName('height')[0].firstChild.nodeValue; - var img = FCK.CreateElement('img'); - img.src = url + '/getResizedImage?size=' + boxSize; - img.width = width; - img.height = height; - - //FCK.InsertElement(img); + var imgHtml = ''; + var img = CKEDITOR.dom.element.createFromHtml(imgHtml); + editor.insertElement(img); window.close(); } \ No newline at end of file