X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=30ba5abf5ae3008515c538ecd7d4c0935369d07d;hb=9d8d74569c8114f9c9b0f42bca71536e154c5944;hp=dbf86a7b3aff9d30576de8cd1e6888a644e174fb;hpb=b7d4e0e46cb2cad6f400173cd09ce44d1b8ad04e;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index dbf86a7..30ba5ab 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,6 +1,5 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, - rsingleTag = /^<(\w+)\s*\/?>$/, rxhtmlTag = /(<(\w+)[^>]*?)\/>/g, rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i, rinsideTable = /^<(thead|tbody|tfoot|colg|cap)/, @@ -166,8 +165,7 @@ jQuery.fn.extend({ }, domManip: function( args, table, callback ) { - var fragment, scripts, cacheable, cached, cacheresults, first, - value = args[0]; + var results, first, value = args[0], scripts = []; if ( jQuery.isFunction(value) ) { return this.each(function() { @@ -177,23 +175,14 @@ jQuery.fn.extend({ } if ( this[0] ) { - if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf(" 1 || i > 0 ? - fragment.cloneNode(true) : - fragment + results.cacheable || this.length > 1 || i > 0 ? + results.fragment.cloneNode(true) : + results.fragment ); } } @@ -213,10 +202,6 @@ jQuery.fn.extend({ if ( scripts ) { jQuery.each( scripts, evalScript ); } - - if ( cacheable ) { - jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; - } } return this; @@ -230,6 +215,33 @@ jQuery.fn.extend({ } }); +function buildFragment(args, nodes, scripts){ + var fragment, cacheable, cached, cacheresults, doc; + + if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("