Suppression des images attachées fonctionnelle.
authorBenoît Pin <pin@cri.ensmp.fr>
Fri, 19 Aug 2011 10:00:33 +0000 (12:00 +0200)
committerBenoît Pin <pin@cri.ensmp.fr>
Fri, 19 Aug 2011 10:00:33 +0000 (12:00 +0200)
skins/ckeditor/plugins/plinn_image/dialog/embedded_images.html.pt

index 0034dd1..4a438b9 100644 (file)
                    var a = target.parentNode;
                    window.parent.updateOrInsertImage(a.getAttribute('href', 2), true);
                    break;
                    var a = target.parentNode;
                    window.parent.updateOrInsertImage(a.getAttribute('href', 2), true);
                    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);
-//                 }
+                 case 'A' :
+                   if (target.name == 'suppr')
+                     var a = target.parentNode.parentNode.getElementsByTagName('a')[0];
+                     var href = a.getAttribute('href', 2);
+                     var imgPath = contentPath + '/' + 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);
+                   }
                }
                }
                
                }
                }