From: Jan Schneider Date: Mon, 21 Jun 2010 21:30:13 +0000 (+0200) Subject: Use clone(), not cloneNode(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4ff6763fddf80477f6e7d5c169bedf33cbf8e6ec;p=horde.git Use clone(), not cloneNode(). --- diff --git a/horde/js/dragdrop.js b/horde/js/dragdrop.js index 15c6dbca6..3e907750b 100644 --- a/horde/js/dragdrop.js +++ b/horde/js/dragdrop.js @@ -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 +}; diff --git a/horde/js/dragdrop2.js b/horde/js/dragdrop2.js index ad135d74a..678b52fd9 100644 --- a/horde/js/dragdrop2.js +++ b/horde/js/dragdrop2.js @@ -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' }); diff --git a/horde/js/redbox.js b/horde/js/redbox.js index 9d120f0b2..4ea42eca3 100644 --- a/horde/js/redbox.js +++ b/horde/js/redbox.js @@ -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(); }, diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index e69dd22e2..45e47803b 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -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; diff --git a/imp/js/dimpcore.js b/imp/js/dimpcore.js index 55b0e4f45..065953798 100644 --- a/imp/js/dimpcore.js +++ b/imp/js/dimpcore.js @@ -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'); diff --git a/imp/js/fullmessage-dimp.js b/imp/js/fullmessage-dimp.js index f5c722e9f..049fc5233 100644 --- a/imp/js/fullmessage-dimp.js +++ b/imp/js/fullmessage-dimp.js @@ -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); diff --git a/imp/js/message.js b/imp/js/message.js index ab949903c..4714fea00 100644 --- a/imp/js/message.js +++ b/imp/js/message.js @@ -101,7 +101,7 @@ var ImpMessage = { return; } - fixcopy = iefix.cloneNode(false); + fixcopy = iefix.clone(false); li.insert(fixcopy); fixcopy.clonePosition(ul); diff --git a/imp/js/search.js b/imp/js/search.js index cdd24b2fa..7d6837ef8 100644 --- a/imp/js/search.js +++ b/imp/js/search.js @@ -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(); diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index a1c583293..b9848aeda 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -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(); diff --git a/shout/templates/extensions.inc.php b/shout/templates/extensions.inc.php index d8ff56476..392a24cba 100644 --- a/shout/templates/extensions.inc.php +++ b/shout/templates/extensions.inc.php @@ -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';