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