X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/959f97d8ecd5c1668103a3e41c795486b944bc68..9c2096d803812dacbdf6cf8efe90053e39f00b96:/wp-includes/js/scriptaculous/builder.js?ds=sidebyside diff --git a/wp-includes/js/scriptaculous/builder.js b/wp-includes/js/scriptaculous/builder.js index 953b4a53..f1f42b9a 100644 --- a/wp-includes/js/scriptaculous/builder.js +++ b/wp-includes/js/scriptaculous/builder.js @@ -1,6 +1,6 @@ -// script.aculo.us builder.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 +// script.aculo.us builder.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ @@ -26,7 +26,7 @@ var Builder = { // due to a Firefox bug node: function(elementName) { elementName = elementName.toUpperCase(); - + // try innerHTML approach var parentTag = this.NODEMAP[elementName] || 'div'; var parentElement = document.createElement(parentTag); @@ -34,14 +34,14 @@ var Builder = { parentElement.innerHTML = "<" + elementName + ">"; } catch(e) {} var element = parentElement.firstChild || null; - + // see if browser added wrapping tags if(element && (element.tagName.toUpperCase() != elementName)) element = element.getElementsByTagName(elementName)[0]; - + // fallback to createElement approach if(!element) element = document.createElement(elementName); - + // abort if nothing could be created if(!element) return; @@ -62,19 +62,19 @@ var Builder = { // workaround firefox 1.0.X bug if(!element) { element = document.createElement(elementName); - for(attr in arguments[1]) + for(attr in arguments[1]) element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; } if(element.tagName.toUpperCase() != elementName) element = parentElement.getElementsByTagName(elementName)[0]; } - } + } // text, or array of children if(arguments[2]) this._children(element, arguments[2]); - return element; + return $(element); }, _text: function(text) { return document.createTextNode(text); @@ -100,7 +100,7 @@ var Builder = { if(typeof children=='object') { // array can hold nodes and text children.flatten().each( function(e) { if(typeof e=='object') - element.appendChild(e) + element.appendChild(e); else if(Builder._isStringOrNumber(e)) element.appendChild(Builder._text(e)); @@ -117,20 +117,20 @@ var Builder = { $(element).update(html.strip()); return element.down(); }, - dump: function(scope) { - if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope - + dump: function(scope) { + if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); - - tags.each( function(tag){ - scope[tag] = function() { - return Builder.node.apply(Builder, [tag].concat($A(arguments))); - } + + tags.each( function(tag){ + scope[tag] = function() { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + }; }); } -} +}; \ No newline at end of file