1 // (c) Benoît PIN 2006-2007
5 var editor
= window
.dialogArguments
.editor
;
6 var pluginPath
= window
.dialogArguments
.pluginPath
;
7 //var FCK = editor.FCK ;
8 //var FCKLang = editor.FCKLang ;
9 //var FCKConfig = editor.FCKConfig ;
10 //var FCKPlugins = editor.FCKPlugins;
11 //var FCKDebug = editor.FCKDebug ;
13 window
.onload = function() {
14 var mainFrame
= window
.frames
['main'];
15 mainFrame
.src
= pluginPath
+ 'dialog/embedded_images.html';
16 mainFrame
.location
.href
= mainFrame
.src
;
18 var tabsFrame
= window
.frames
['tabs'];
19 tabsFrame
.src
= pluginPath
+ 'dialog/plinn_image_tabs.html';
20 tabsFrame
.location
.href
= tabsFrame
.src
;
23 function updateOrInsertImage(url
) {
24 var getSizeUrl
= url
+ '/getResizedImageSize';
25 var req
= new XMLHttpRequest();
26 req
.open("POST", getSizeUrl
, false); // synchrone
27 req
.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
28 var boxSize
= FCKConfig
.ImageMaxDefaultDimension
+ '_' + FCKConfig
.ImageMaxDefaultDimension
;
29 req
.send("asXml:boolean=True&size=" + boxSize
);
30 var doc
= req
.responseXML
.documentElement
;
32 var width
= doc
.getElementsByTagName('width')[0].firstChild
.nodeValue
;
33 var height
= doc
.getElementsByTagName('height')[0].firstChild
.nodeValue
;
36 var img
= FCK
.CreateElement('img');
37 img
.src
= url
+ '/getResizedImage?size=' + boxSize
;
41 //FCK.InsertElement(img);