+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+ <title>Embedded images</title>
+ <style type="text/css" media="screen">
+ a, a:hover, a:active, a:visited {
+ text-decoration:none;
+ color:#369;
+ }
+
+ #slides {
+ margin-top: 1em;
+ }
+
+ .lightbox span {
+ width: 222px;
+ height: 222px;
+ display:block;
+ float:left;
+ margin-left:1px;
+ margin-top:1px;
+ }
+
+ .lightbox a.slide {
+ position:absolute;
+ display:block;
+ width: 222px;
+ height: 222px;
+ border: 1px solid #ddd;
+ }
+
+ .lightbox .slide img {
+ position:absolute;
+ border: 1px solid black;
+ }
+
+ .lightbox span.button {
+ background:none;
+ position: relative;
+ }
+
+ .lightbox span[class].button {
+ visibility:hidden;
+ }
+
+ .lightbox span:hover span.button {
+ visibility:visible;
+ }
+
+ </style>
+ <script type="text/javascript" language="javascript" charset="utf-8" src="epoz_script_detect.js"></script>
+ <script type="text/javascript" language="javascript" charset="utf-8" src="javascript_events_api.js"></script>
+ <script type="text/javascript" language="javascript" charset="utf-8" src="sarissa.js"></script>
+ <script type="text/javascript" language="javascript" charset="utf-8" src="DHTMLapi.js"></script>
+ <script type="text/javascript">
+ // <!--
+ var FCK = window.parent.FCK;
+ var contentPath = FCK.Config.contentPath;
+
+ var FCKConfig = window.parent.FCKConfig;
+ var connUrl = FCKConfig.AttachmentBrowserConnectorUrl;
+ var imagesPath = 'images/';
+
+ var slide_size = 222;
+
+ function _initBrowser(){
+ var form = document.getElementById('uploadAttachmentForm');
+ form.elements['path'].value = contentPath;
+ var loc = window.location;
+ form.elements['redirUrl'].value = loc.protocol + '//' + loc.host + loc.pathname;
+ form.action = connUrl;
+ addListener(document.getElementById('slides'), 'click', handleClick)
+ importAttachments();
+ }
+
+ function importAttachments() {
+ var req = new XMLHttpRequest();
+ req.open("POST", connUrl, false); // synchrone
+ req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
+ req.send("command=ls&path="+escape(contentPath));
+ var respDom = req.responseXML.documentElement;
+
+ var rows = respDom.getElementsByTagName('row');
+ var row, img, slide, a;
+ var slides = document.getElementById('slides');
+
+ for (var i = 0 ; i<rows.length ; i++)
+ addControlThumbnail(rows[i], slides);
+ }
+
+ function addControlThumbnail(row, dest) {
+ var slide = document.createElement('span');
+
+ var a = document.createElement('a');
+ a.href = row.getAttribute('url');
+ a.className = 'slide';
+
+ var img = document.createElement('img');
+ img.src = row.getAttribute('previewUrl');
+ img.width = row.getAttribute('width');
+ img.height = row.getAttribute('height');
+ img.style.marginTop = (slide_size - parseInt(img.height)) / 2 + 'px';
+ img.style.marginLeft = (slide_size - parseInt(img.width)) / 2 + 'px';
+ img.border = 0;
+
+ a.appendChild(img);
+ slide.appendChild(a);
+ dest.appendChild(slide);
+
+ var spanButton = document.createElement('span');
+ spanButton.className = 'button';
+ var a = document.createElement('a');
+ a.href = '#';
+ a.text = "Supprimer";
+ a.name = 'suppr';
+ spanButton.appendChild(a);
+ slide.appendChild(spanButton);
+
+ var spanButtonWidth = getObjectWidth(a);
+ var spanButtonHeight = getObjectHeight(a);
+ spanButton.style.width = spanButtonWidth + 'px';
+ spanButton.style.height = spanButtonHeight + 'px';
+ spanButton.style.top = slide_size - spanButtonHeight - 3 + 'px';
+ spanButton.style.left = slide_size - spanButtonWidth - 3 + 'px';
+ }
+
+ function handleClick(evt) {
+ var target = getTargetedObject(evt);
+ disableDefault(evt);
+ disablePropagation(evt);
+ switch (target.tagName) {
+ case 'IMG' :
+ var a = target.parentNode;
+ window.parent.updateOrInsertImage(a.getAttribute('href', 2));
+ break;
+ case 'A' :
+ if (target.name == 'suppr')
+ var a = target.parentNode.parentNode.getElementsByTagName('a')[0];
+ var href = a.getAttribute('href', 2);
+ var imgPath = window.parent.editor.FCKConfig.EditorPath + href;
+
+ var req = new XMLHttpRequest();
+ req.open("POST", connUrl, false); // synchrone
+ req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
+ req.send("command=rm&path="+escape(imgPath));
+ var doc = req.responseXML.documentElement;
+ if (doc.tagName == 'done') {
+ var slide = target.parentNode.parentNode;
+ slide.parentNode.removeChild(slide);
+ }
+ }
+
+ }
+
+ addListener(window, 'load', _initBrowser);
+ // -->
+ </script>
+ </head>
+
+ <body i18n:domain="plinn">
+ <form id="uploadAttachmentForm" action="." method="post" enctype="multipart/form-data">
+ <input type="file" name="file"/>
+ <input type="hidden" name="path" value="" />
+ <input type="hidden" name="command" value="upload" />
+ <input type="hidden" name="Type" value="Photo" />
+ <input type="hidden" name="redirUrl" value="">
+ <input type="submit" name="upload" value="Upload" i18n:attributes="value"/>
+ </form>
+ <div id="slides" class="lightbox"></div>
+ </body>
+</html>
+