Use clone(), not cloneNode().
authorJan Schneider <jan@horde.org>
Mon, 21 Jun 2010 21:30:13 +0000 (23:30 +0200)
committerJan Schneider <jan@horde.org>
Mon, 21 Jun 2010 21:36:57 +0000 (23:36 +0200)
horde/js/dragdrop.js
horde/js/dragdrop2.js
horde/js/redbox.js
imp/js/dimpbase.js
imp/js/dimpcore.js
imp/js/fullmessage-dimp.js
imp/js/message.js
imp/js/search.js
kronolith/js/kronolith.js
shout/templates/extensions.inc.php

index 15c6dbc..3e90775 100644 (file)
@@ -331,7 +331,7 @@ var Draggable = Class.create({
     }
 
     if(this.options.ghosting) {
-      this._clone = this.element.cloneNode(true);
+      this._clone = this.element.clone(true);
       this._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
       if (!this._originallyAbsolute)
         Position.absolutize(this.element);
@@ -971,4 +971,4 @@ Element.findChildren = function(element, only, recursive, tagName) {
 
 Element.offsetSize = function (element, type) {
   return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
-};
\ No newline at end of file
+};
index ad135d7..678b52f 100644 (file)
@@ -283,7 +283,7 @@ Drag = Class.create({
                     if (isNaN(z)) {
                         z = 2;
                     }
-                    DragDrop.Drags.cover.insert(DragDrop.Drags.cover.down().cloneNode(false).setStyle({ zIndex: z }).clonePosition(i).show());
+                    DragDrop.Drags.cover.insert(DragDrop.Drags.cover.down().clone(false).setStyle({ zIndex: z }).clonePosition(i).show());
                 }
             }, this);
         }
@@ -323,7 +323,7 @@ Drag = Class.create({
                 // Create the "ghost", i.e. the moving element, a clone of the
                 // original element, if it doesn't exist yet.
                 var layout = this.element.getLayout();
-                this.ghost = $(this.element.cloneNode(true))
+                this.ghost = $(this.element.clone(true))
                     .writeAttribute('id', null)
                     .addClassName(this.options.classname)
                     .setStyle({ position: 'absolute', height: layout.get('height') + 'px', width: layout.get('width') + 'px' });
index 9d120f0..4ea42ec 100644 (file)
@@ -116,7 +116,7 @@ var RedBox = {
 
     cloneWindowContents: function(id)
     {
-        $('RB_window').appendChild($($(id).cloneNode(true)).setStyle({ display: 'block' }));
+        $('RB_window').appendChild($($(id).clone(true)).setStyle({ display: 'block' }));
         this.setWindowPosition();
     },
 
index e69dd22..45e4780 100644 (file)
@@ -1182,7 +1182,7 @@ var DimpBase = {
         [ 'from', 'to', 'cc' ].each(function(a) {
             if (r[a]) {
                 (a == 'from' ? pm.select('.' + a) : [ t.down('.' + a) ]).each(function(elt) {
-                    elt.replace(DimpCore.buildAddressLinks(r[a], elt.cloneNode(false)));
+                    elt.replace(DimpCore.buildAddressLinks(r[a], elt.clone(false)));
                 });
             }
             [ $('msgHeader' + a.capitalize()) ].invoke(r[a] ? 'show' : 'hide');
@@ -2172,7 +2172,7 @@ var DimpBase = {
 
     _createFolderForm: function(action, text)
     {
-        var n = $($('folderform').down().cloneNode(true)).writeAttribute('id', 'RB_folder');
+        var n = $($('folderform').down().clone(true)).writeAttribute('id', 'RB_folder');
         n.down('P').insert(text);
 
         this.cfolderaction = action;
index 55b0e4f..0659537 100644 (file)
@@ -384,7 +384,7 @@ var DimpCore = {
             cnt = alist.size();
 
         if (cnt > 15) {
-            tmp = $('largeaddrspan').cloneNode(true).writeAttribute('id', 'largeaddrspan_active');
+            tmp = $('largeaddrspan').clone(true).writeAttribute('id', 'largeaddrspan_active');
             elt.insert(tmp);
             base = tmp.down('.dispaddrlist');
             tmp = tmp.down('.largeaddrlist');
index f5c722e..049fc52 100644 (file)
@@ -221,7 +221,7 @@ var DimpFullmessage = {
         [ 'from', 'to', 'cc', 'bcc', 'replyTo' ].each(function(a) {
             if (this[a]) {
                 var elt = $('msgHeader' + a.charAt(0).toUpperCase() + a.substring(1)).down('TD', 1);
-                elt.replace(DimpCore.buildAddressLinks(this[a], elt.cloneNode(false)));
+                elt.replace(DimpCore.buildAddressLinks(this[a], elt.clone(false)));
             }
         }, this);
 
index ab94990..4714fea 100644 (file)
@@ -101,7 +101,7 @@ var ImpMessage = {
                 return;
             }
 
-            fixcopy = iefix.cloneNode(false);
+            fixcopy = iefix.clone(false);
             li.insert(fixcopy);
             fixcopy.clonePosition(ul);
 
index cdd24b2..7d6837e 100644 (file)
@@ -29,11 +29,11 @@ var ImpSearch = {
     updateFolderList: function(folders)
     {
         var fragment = document.createDocumentFragment(),
-            node = $($('folder_row').cloneNode(true)).writeAttribute('id', false).show(),
+            node = $($('folder_row').clone(true)).writeAttribute('id', false).show(),
             div = $('search_folders_hdr').next('DIV');
 
         folders.each(function(f) {
-            var n = $(node.cloneNode(true));
+            var n = $(node.clone(true));
             n.down().writeAttribute({ disabled: Boolean(f.c), value: (f.co ? null : f.v.escapeHTML()) }).insert({ after: f.l });
             fragment.appendChild(n);
         });
@@ -50,7 +50,7 @@ var ImpSearch = {
         $('recent_searches_div').show();
 
         $H(searches).each(function(s) {
-            fragment.appendChild($(node.cloneNode(false)).writeAttribute({ value: s.value.v.escapeHTML() }).update(s.value.l.escapeHTML()));
+            fragment.appendChild($(node.clone(false)).writeAttribute({ value: s.value.v.escapeHTML() }).update(s.value.l.escapeHTML()));
             this.saved_searches[s.key] = s.value.c;
         }, this);
 
@@ -205,7 +205,7 @@ var ImpSearch = {
         }
 
         tds.each(function(node) {
-            tr.insert(td.cloneNode(false).insert(node));
+            tr.insert(td.clone(false).insert(node));
         });
 
         tds.shift();
@@ -282,7 +282,7 @@ var ImpSearch = {
 
         var tmp = [
             new Element('EM').insert(this.getLabel(id)),
-            new Element('SPAN').insert(new Element('INPUT', { type: 'text', size: 8 }).setValue(data.v)).insert(' ').insert($($('within_criteria').cloneNode(true)).writeAttribute({ id: null }).show().setValue(data.l))
+            new Element('SPAN').insert(new Element('INPUT', { type: 'text', size: 8 }).setValue(data.v)).insert(' ').insert($($('within_criteria').clone(true)).writeAttribute({ id: null }).show().setValue(data.l))
         ];
         this.criteria[this.insertCriteria(tmp)] = { t: id };
         tmp[1].activate();
index a1c5832..b9848ae 100644 (file)
@@ -768,7 +768,7 @@ KronolithCore = {
             row, cell, dateString;
 
         // Create a copy of the row template.
-        row = $('kronolithRowTemplate').cloneNode(true);
+        row = $('kronolithRowTemplate').clone(true);
         row.removeAttribute('id');
 
         // Fill week number and day cells.
@@ -817,7 +817,7 @@ KronolithCore = {
 
         // Create a copy of the row template.
         var body = $('kronolithViewAgendaBody'),
-            row = $('kronolithAgendaTemplate').cloneNode(true);
+            row = $('kronolithAgendaTemplate').clone(true);
 
         // Fill week number and day cells.
         row.store('date', date)
@@ -857,7 +857,7 @@ KronolithCore = {
     createYearMonth: function(year, month, idPrefix)
     {
         // Create a copy of the month template.
-        var table = $('kronolithYearTemplate').cloneNode(true),
+        var table = $('kronolithYearTemplate').clone(true),
             tbody = table.down('tbody');
         table.removeAttribute('id');
         tbody.writeAttribute('id', 'kronolithYearTable' + month);
@@ -2312,7 +2312,7 @@ KronolithCore = {
      */
     insertTask: function(task)
     {
-        var row = $('kronolithTasksTemplate').cloneNode(true),
+        var row = $('kronolithTasksTemplate').clone(true),
             col = row.down();
 
         row.removeAttribute('id');
@@ -3264,7 +3264,7 @@ KronolithCore = {
         }
 
         var tr = elm.up('tr'),
-            row = tr.cloneNode(true).store('remove', true),
+            row = tr.clone(true).store('remove', true),
             td = row.down('td'),
             clearName = elm.tagName == 'SELECT' ? elm.options[elm.selectedIndex].text: elm.getValue();
 
index d8ff564..392a24c 100644 (file)
@@ -415,14 +415,14 @@ function showDestForm()
 
     $('destEditForm').appendChild(select);
 
-    $('destEditForm').appendChild(spacer.cloneNode(true));
+    $('destEditForm').appendChild(spacer.clone(true));
 
     var span = document.createElement('span');
     span.id = 'destValueContainer';
     $('destEditForm').appendChild(span);
 
 
-    $('destEditForm').appendChild(spacer.cloneNode(true));
+    $('destEditForm').appendChild(spacer.clone(true));
 
     var save = document.createElement("input");
     save.id = 'destSave';