# HG changeset patch # User Raphael Velt # Date 1322070592 -3600 # Node ID 698e4280d2705a2c6720b40e9c15f26e27a0ad46 # Parent 239f91ac1f317908ce9721613e873ad985ea748e minor changes (highlighting search results, ...) diff -r 239f91ac1f31 -r 698e4280d270 tweetcast/nodejs-bis/client/css/style.css --- a/tweetcast/nodejs-bis/client/css/style.css Tue Nov 22 18:33:51 2011 +0100 +++ b/tweetcast/nodejs-bis/client/css/style.css Wed Nov 23 18:49:52 2011 +0100 @@ -25,6 +25,14 @@ font-family: Helvetica, Arial, sans-serif; background-color: #F7F6F6; background-image: url("../img/bgd.jpg"); background-repeat: repeat-x; } +b { + font-weight: bold; +} + +.highlight { + background: #ffff00; +} + #container { width: 960px; margin: 0 auto; } @@ -42,7 +50,7 @@ } .rechercheCourante { - background: #ffe0ff; color: #000080; font-weight: bold; + background: #ffa0ff; font-weight: bold; color: #000080; } /* Menu */ @@ -93,7 +101,7 @@ /* Recherche */ #recherche { - float: left; margin: 2px 0; + position: relative; float: left; padding: 2px 0; width: 452px; border-bottom: 1px solid #999; } #recherche input { @@ -128,8 +136,55 @@ background-position: -40px -20px; } +#time_legende { + float: left; margin-left: 30px; width: 30px; height: 20px; background: url(../img/scale.png) left; +} + +#time_scale { + float: left; font-size: 12px; margin: 3px 0 0; color: #666; width: 50px; text-align: center; +} + +#time_zoomout, #time_zoomin { + float: left; width: 12px; height: 20px; background: url(../img/scale.png); +} + +#time_zoomout { + background-position: -30px; +} + +#time_zoomout.inactive { + background-position: -54px; +} + +#time_zoomin { + background-position: -42px; +} + +#time_zoomin.inactive { + background-position: -66px; +} + +#recherche_annot { + position: absolute; top: 20px; z-index: 4; background: #ffffff; border: 1px solid #ccc; padding: 4px; font-size: 12px; + display: none; box-shadow: 2px 2px 2px rgba(0, 0, 0, .5) +} + +#recherche_annot a { + padding: 1px; line-height: 13px; margin: 1px; font-weight: bold; text-decoration: none; color: #000000; +} + +/* Liste des tweets */ + #tweetlist { - float: left; width: 280px; height: 450px; list-style: none; border-right: 1px solid #999; color: #585858; cursor: pointer; cursor: hand; + float: left; width: 280px; height: 480px; list-style: none; border-right: 1px solid #999; color: #585858; cursor: pointer; cursor: hand; background: #ffffff; +} + +#tweetlist a { + text-decoration: none; color: #1985B5; +} + +#tweetlist a:hover { + text-decoration: underline; color: #105060; } li.tweet, li.placeholder { @@ -141,7 +196,7 @@ } li.full { - width: 270px; height: 84px; border-right: 10px solid #ff0; + width: 270px; height: 117px; border-right: 10px solid #ff0; } li.half { @@ -161,7 +216,7 @@ } .full p.tweet_text { - font-size: 12px; margin: 5px 0 5px 58px; height: 75px; width: 207px; color: #000000; + font-size: 12px; margin: 5px 0 5px 58px; height: 108px; width: 207px; color: #000000; } .half p.tweet_text { @@ -184,14 +239,10 @@ margin: 2px; width: 16px; height: 16px; } -.full p.created_at { +p.created_at { font-size: 12px; text-align: center; font-style: italic; color: #999999; width: 58px; overflow: hidden; } -.half p.created_at, .icons p { - display: none -} - .annotations { position: absolute; margin: 0; padding: 0; top: 0; left: 0; width: 100%; height: 100%; } @@ -208,14 +259,18 @@ position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; } +div.tweet_actions { + position: absolute; bottom : 2px; right: 4px; font-size: 11px; +} + /* timeline */ #timeline { - float: left; height: 450px; width: 150px; border-right: 1px solid #999; cursor: pointer; cursor: hand; + float: left; height: 480px; width: 150px; border-right: 1px solid #999; cursor: pointer; cursor: hand; } #scrollcont { - float: left; width: 20px; height: 450px; overflow: auto; + float: left; width: 20px; height: 480px; overflow: auto; } #scrollin { @@ -225,7 +280,7 @@ /* hovertweet */ #hovertweet { - position: absolute; display: none; margin: -20px 0 0 15px; + position: absolute; display: none; margin: -20px 0 0 15px; z-index: 12; } div.full { diff -r 239f91ac1f31 -r 698e4280d270 tweetcast/nodejs-bis/client/index.html --- a/tweetcast/nodejs-bis/client/index.html Tue Nov 22 18:33:51 2011 +0100 +++ b/tweetcast/nodejs-bis/client/index.html Wed Nov 23 18:49:52 2011 +0100 @@ -12,6 +12,7 @@ + @@ -40,9 +41,18 @@
- + +
+
+
+ + +
+
+ Recherche par annotation :
+
diff -r 239f91ac1f31 -r 698e4280d270 tweetcast/nodejs-bis/client/js/script.js --- a/tweetcast/nodejs-bis/client/js/script.js Tue Nov 22 18:33:51 2011 +0100 +++ b/tweetcast/nodejs-bis/client/js/script.js Wed Nov 23 18:49:52 2011 +0100 @@ -5,19 +5,18 @@ var socket, tlPaper, twCx = { - zoomLevel : 1, followLast : true, position : "0", date_levels : [ + 3600 * 1000, 15 * 60 * 1000, 5 * 60 * 1000, - 60 * 1000, - 15 * 1000 + 60 * 1000 ], - timeLevel : 0, + timeLevel : 1, deltaX : 40, tlWidth : 150, - tlHeight : 450, + tlHeight : 480, globalWords : {}, refMouse : { x : 0, y : 0}, refPosTl : { x : 0, y : 0}, @@ -29,7 +28,7 @@ relHover = [], wheelDelta = 0, scrollEnabled = false, - scrollExtent = 8000 - 452, + scrollExtent = 8000 - 480, lastScrollPos = 0, rx_url = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g, rx_word = /[^ \.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, @@ -170,8 +169,14 @@ } function trimFDS() { - var centralTweet = ( twCx.centralTweet ? twCx.centralTweet : twCx.tweets[twCx.tweets.length - 1] ) - slices = flattenDateStruct(twCx.timeline, twCx.timeLevel), + var slices = flattenDateStruct(twCx.timeline, twCx.timeLevel); + while (slices[0].tweets.length == 0) { + slices.splice(0,1); + } + while (slices[slices.length - 1].tweets.length == 0) { + slices.pop(); + } + var centralTweet = ( twCx.centralTweet ? twCx.centralTweet : twCx.tweets[twCx.tweets.length - 1] ), delta = 30 * twCx.date_levels[twCx.timeLevel], centre = Math.min(slices[slices.length - 1].end - delta , Math.max(slices[0].start + delta, centralTweet.date_value)), min = centre - delta, @@ -235,16 +240,21 @@ } function goToPos(nPos) { - twCx.position = twCx.idIndex[Math.min( twCx.tweets.length - 1, Math.max(0, nPos ) )]; - twCx.followLast = (nPos == twCx.tweets.length - 1); + twCx.position = twCx.currentIdIndex[Math.min( twCx.currentIdIndex.length - 1, Math.max(0, nPos ) )]; + twCx.followLast = (!twCx.filtre && nPos == twCx.tweets.length - 1); updateDisplay(); } function movePos(delta) { - goToPos( delta + twCx.idIndex.indexOf(twCx.position) ); + goToPos( delta + twCx.currentIdIndex.indexOf(twCx.position) ); } function tweetToHtml(tweet, className, elName) { + + function highlight(texte) { + return ( twCx.filtre ? texte.replace(twCx.filtre, '$1' ) : texte ); + } + if (!tweet) { return placeHolder(className); } @@ -261,12 +271,12 @@ if (tweet.annotations.length) { html += '
'; for (var i in tweet.annotations) { - html += '
'; + html += '
'; } html += '
'; } html += '
'; - a_user = ''; + a_user = ''; html += '
' + a_user + ''; if (className == 'full') { html += '

' + new Date(tweet.date_value).toTimeString().substr(0,8) + '

'; @@ -280,7 +290,8 @@ entities.push({ "start" : tweet.entities.hashtags[i].indices[0], "end" : tweet.entities.hashtags[i].indices[1], - "html" : '#' + tweet.entities.hashtags[i].text + '' + "link" : '', + "text" : '#' + tweet.entities.hashtags[i].text }); } for (var i in tweet.entities.urls) { @@ -292,23 +303,30 @@ entities.push({ "start" : tweet.entities.urls[i].indices[0], "end" : tweet.entities.urls[i].indices[1], - "html" : '' + dispurl + '' + "link" : '', + "text" : dispurl }); } for (var i in tweet.entities.user_mentions) { entities.push({ "start" : tweet.entities.user_mentions[i].indices[0], "end" : tweet.entities.user_mentions[i].indices[1], - "html" : '@' + tweet.entities.user_mentions[i].screen_name + '' + "link" : '', + "text" : '@' + tweet.entities.user_mentions[i].screen_name }); } entities.sort(function(a, b) { return a.start - b.start }); for (var i in entities) { - txt += tweet.text.substring(lastend, entities[i].start) + entities[i].html; + txt += highlight( tweet.text.substring(lastend, entities[i].start) ) + entities[i].link + highlight( entities[i].text ) + ''; lastend = entities[i].end; } - txt += tweet.text.substring(lastend); - html += '

' + a_user + '@' + tweet.user.screen_name + ': ' + txt + '

'; + txt += highlight( tweet.text.substring(lastend) ); + html += '

' + a_user + highlight('@' + tweet.user.screen_name) + '' + ( className == 'full' ? ' (' + tweet.user.name + ')
' : ' : ') + txt + '

'; + if (className == 'full' && el == 'li') { + html += '
répondre · '; + html += 'retweeter · '; + html += 'favori
'; + } } html += '
'; return html; @@ -341,6 +359,9 @@ } function tlPosTweet(tweet, annotation) { + if (!twCx.tweets) { + return; + } var x, y, dt = tweet.date_value, @@ -437,11 +458,15 @@ } function updateDisplay() { - + if (!twCx.tweets) { + return; + } if (twCx.filtre) { var tweets = twCx.tweets.filter(function(tweet) { - return ( tweet.text.search(twCx.filtre) != -1 ) || ( tweet.user.screen_name.search(twCx.filtre) != -1 ) + var mention = '@' + tweet.user.screen_name; + return ( tweet.text.search(twCx.filtre) != -1 ) || ( mention.search(twCx.filtre) != -1 ); }); + $("#inp_q").val(twCx.filtreTexte + ' (' + tweets.length + ' tweets)'); if (tweets.length) { var idIndex = tweets.map(function(tweet) { return tweet.id; @@ -451,10 +476,12 @@ for (p = idIndex.length - 1; p > 0 && idIndex[p] > twCx.position; p--) { } } - console.log(p); + twCx.position = idIndex[p]; + twCx.currentIdIndex = idIndex; } } else { + twCx.currentIdIndex = twCx.idIndex; var tweets = twCx.tweets; var p = twCx.idIndex.indexOf(twCx.position); if (p == -1) { @@ -547,45 +574,49 @@ /* Recherche des mots pertinents correspondant à la sélection */ - for (var j in localWords) { - if (localWords[j].freq < 2) delete localWords[j]; - } - var tab = []; - for (var j in localWords) { - tab.push({ - "word": j, - "freq" : localWords[j].freq, - "annotations" : localWords[j].annotations, - "score" : localWords[j].freq / Math.log(1+twCx.globalWords[j]) - }); + var tab = _(localWords).map(function(v, k) { + return { + "word": k, + "freq" : v.freq, + "annotations" : v.annotations, + "score" : v.freq / Math.log( 2 + twCx.globalWords[j] ) + }; + }).filter(function(v) { + return v.freq > 1; + }); + + if (tab.length) { + + tab = _(tab).sortBy( function(a) { return ( - a.score ) }).slice(0,20); + var minfreq = _(tab).min( function(a) { return a.freq} ).freq, + maxfreq = Math.max(minfreq + .1, _(tab).max( function(a) { return a.freq} ).freq), + echfreq = 8 / Math.sqrt( maxfreq - minfreq ), + html = ''; + for (var j in tab) { + var maxann = 0, + ann = "default"; + for (var k in tab[j].annotations) { + if (tab[j].annotations[k] == maxann) { + ann = "default"; + } + if (tab[j].annotations[k] > maxann) { + ann = k; + maxann = tab[j].annotations[k]; + } + } + if (ann == "default") { + var coul = ''; + } else { + var c = getColor(ann, .6), + coul = "background: rgba(" + [ Math.floor(c.r), Math.floor(c.g), Math.floor(c.b), ( tab[j].annotations[ann] / tab[j].freq )].join(',') + ")"; + } + var fontsize = Math.floor( ( 12 + Math.sqrt( tab[j].freq - minfreq ) * echfreq ) ); + html += '' + tab[j].word + ' '; + } + $("#motscles").html(html); + } else { + $("#motscles").html(''); } - tab.sort( function(a,b){ return ( b.score - a.score ) }).splice(20); - var minfreq = tab[tab.length - 1].score, - maxfreq = Math.max(minfreq + .1, tab[0].score), - echfreq = 8 / Math.sqrt( maxfreq - minfreq ), - html = ''; - for (var j in tab) { - var maxann = 0, - ann = "default"; - for (var k in tab[j].annotations) { - if (tab[j].annotations[k] == maxann) { - ann = "default"; - } - if (tab[j].annotations[k] > maxann) { - ann = k; - maxann = tab[j].annotations[k]; - } - } - if (ann == "default") { - var coul = ''; - } else { - var c = getColor(ann, .6), - coul = "background: rgba(" + [ Math.floor(c.r), Math.floor(c.g), Math.floor(c.b), ( tab[j].annotations[ann] / tab[j].freq )].join(',') + ")"; - } - var fontsize = Math.floor( ( 12 + Math.sqrt( tab[j].score - minfreq ) * echfreq ) ); - html += '' + tab[j].word + ' '; - } - $("#motscles").html(html); twCx.centralTweet = tweets[p]; } else { $("#tweetlist").html(''); @@ -700,7 +731,7 @@ var yy = posp.y - .5 * twCx.scaleY, path = "M0 " + ppy + "C" + ( .7 * twCx.deltaX ) + " " + ppy + " " + ( .2 * twCx.deltaX ) + " " + yy + " " + ( twCx.deltaX ) + " " + yy + "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy; yy = posp.y + .5 * twCx.scaleY; - ppy += 84; + ppy += 117; path += "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy + "L" + twCx.deltaX + " " + yy + "C" + ( .2 * twCx.deltaX ) + " " + yy + " " + ( .7 * twCx.deltaX ) + " " + ppy + " 0 " + ppy; tlPaper.path( path ).attr({"stroke":"#ffff00", "fill" : "#ffff00", "fill-opacity" : .15}); @@ -709,11 +740,25 @@ } } -function filtrer(valeur) { - twCx.filtreTexte = valeur; - $("#inp_q").val(valeur).attr("class","rechercheCourante"); - twCx.filtre = ( valeur ? new RegExp(valeur.replace(/(\W)/g, '\\$1'),'ig') : null ); - twCx.followLast = !valeur && (twCx.position == twCx.idIndex[twCx.tweets.length - 1]); +function filtrerAnnotation(annotation) { + if (annotations[annotation]) { + effectuerFiltrage(annotations[annotation].display_name, + new RegExp( "(" + annotations[annotation].keywords.map(function(a) { return a.source }).join("|") + ")", "gi" ) ); + } else { + effectuerFiltrage('', null) + } +} + +function filtrerTexte(valeur) { + effectuerFiltrage( valeur, valeur ? new RegExp("(" + valeur.replace(/(\W)/g, '\\$1') + ")" ,'gi') : null ); +} + +function effectuerFiltrage(filtreTexte, tabRegexp) { + $("#recherche_annot").slideUp(); + $("#inp_q").val(filtreTexte).attr("class","rechercheCourante"); + twCx.filtreTexte = filtreTexte; + twCx.filtre = tabRegexp; + twCx.followLast = !tabRegexp && (twCx.position == twCx.idIndex[twCx.idIndex.length - 1]); updateDisplay(); } @@ -755,17 +800,36 @@ } function focusOutRecherche() { + $("#recherche_annot").slideUp(); var inpq = $("#inp_q"), val = inpq.val(); if (val == '' || val == twCx.filtreTexte) { if (twCx.filtre) { inpq.attr("class", "rechercheCourante").val(twCx.filtreTexte); } else { - inpq.attr("class", "greyed").val("Rechercher dans les tweets"); + inpq.attr("class", "greyed").val("Rechercher"); } } } +function chaineTimeZoom() { + var chaine = "", + t = twCx.date_levels[twCx.timeLevel], + h = 3600*1000, + m = 60*1000, + s = 1000, + heures = Math.floor(t/h); + if (heures) { chaine += heures + ' h. ' }; + t -= (heures * h); + var minutes = Math.floor(t/m); + if (minutes) { chaine += minutes + ' min. ' }; + t -= (minutes * m); + if (t) { chaine += Math.floor(t/s) + ' sec.' } + $("#time_scale").html(chaine); + $("#time_zoomout").attr("class",(twCx.timeLevel == 0 ? "inactive" : "")); + $("#time_zoomin").attr("class",(twCx.timeLevel == twCx.date_levels.length - 1 ? "inactive" : "")); +} + $(document).ready(function() { tlPaper = Raphael("timeline", twCx.tlWidth, twCx.tlHeight); @@ -791,6 +855,15 @@ $.getScript("tweetdata.js"); } + var html = ''; + for (var j in annotations) { + if (j != "default") { + html += '' + annotations[j].display_name + ' ' + } + } + $("#rech_list_annot").html(html); + + chaineTimeZoom(); $("#tweetlist").mousewheel(function(e, d) { wheelDelta += d; @@ -810,12 +883,27 @@ } if (tl != twCx.timeLevel) { twCx.timeLevel = tl; + chaineTimeZoom(); updateDisplay(); } wheelDelta = 0; } return false; }); + $("#time_zoomin").click(function() { + if (twCx.timeLevel < twCx.date_levels.length - 1) { + twCx.timeLevel++; + chaineTimeZoom(); + updateDisplay(); + } + }); + $("#time_zoomout").click(function() { + if (twCx.timeLevel > 0) { + twCx.timeLevel--; + chaineTimeZoom(); + updateDisplay(); + } + }); $("#timeline, #tweetlist").mouseout(function() { twCx.tlMouseClicked = false; twCx.tlMouseMoved = false; @@ -838,6 +926,8 @@ twCx.tlMouseMoved = false; }); $("#inp_q").focus(function() { + $("#recherche_annot").slideDown(); + $(this).val($(this).val().replace(/ \(.+\)$/, '')) if ($(this).hasClass("greyed")) { $(this).val(""); } @@ -847,25 +937,28 @@ focusOutRecherche(); }); $("#inp_reset").click(function() { + $("#inp_q").val(''); if (twCx.filtre) { twCx.filtre = null; updateDisplay(); } + twCx.filtreTexte = ''; focusOutRecherche(); return false; }) - $("#recherche").submit(function() { + $("#recherche").submit(function(evt) { + evt.preventDefault(); if (!$("#inp_q").hasClass("greyed")) { var valeur = $("#inp_q").val(); - filtrer(valeur); + filtrerTexte(valeur); } return false; }); setInterval(function() { var sc = $("#scrollcont"); - if (sc.scrollTop() != lastScrollPos) { - var p = Math.floor( twCx.tweets.length * ( 1 - sc.scrollTop() / scrollExtent ) ); + if (sc.scrollTop() != lastScrollPos && twCx.tweets) { + var p = Math.floor( twCx.currentIdIndex.length * ( 1 - sc.scrollTop() / scrollExtent ) ); goToPos(p); } diff -r 239f91ac1f31 -r 698e4280d270 tweetcast/nodejs-bis/client/js/underscore-min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/nodejs-bis/client/js/underscore-min.js Wed Nov 23 18:49:52 2011 +0100 @@ -0,0 +1,30 @@ +// Underscore.js 1.2.2 +// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the MIT license. +// Portions of Underscore are inspired or borrowed from Prototype, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore +(function(){function r(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(b.isFunction(a.isEqual))return a.isEqual(c);if(b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return String(a)==String(c);case "[object Number]":return a=+a,c=+c,a!=a?c!=c:a==0?1/a==1/c:a==c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== +c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&r(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(m.call(a,h)&&(f++,!(g=m.call(c,h)&&r(a[h],c[h],d))))break;if(g){for(h in c)if(m.call(c, +h)&&!f--)break;g=!f}}d.pop();return g}var s=this,F=s._,o={},k=Array.prototype,p=Object.prototype,i=k.slice,G=k.unshift,l=p.toString,m=p.hasOwnProperty,v=k.forEach,w=k.map,x=k.reduce,y=k.reduceRight,z=k.filter,A=k.every,B=k.some,q=k.indexOf,C=k.lastIndexOf,p=Array.isArray,H=Object.keys,t=Function.prototype.bind,b=function(a){return new n(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else typeof define==="function"&&define.amd? +define("underscore",function(){return b}):s._=b;b.VERSION="1.2.2";var j=b.each=b.forEach=function(a,c,b){if(a!=null)if(v&&a.forEach===v)a.forEach(c,b);else if(a.length===+a.length)for(var e=0,f=a.length;e=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,c){var b=e(a,c);(d[b]||(d[b]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e< +f;){var g=e+f>>1;d(a[g])=0})})};b.difference=function(a,c){return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=H||function(a){if(a!== +Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)m.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)? +a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return r(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(m.call(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=p||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=l.call(arguments)=="[object Arguments]"?function(a){return l.call(a)=="[object Arguments]"}: +function(a){return!(!a||!m.call(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null}; +b.isUndefined=function(a){return a===void 0};b.noConflict=function(){s._=F;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),function(c){I(c,b[c]=a[c])})};var J=0;b.uniqueId=function(a){var b=J++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g, +interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g, +"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e(a,b)}};var n=function(a){this._wrapped=a};b.prototype=n.prototype;var u=function(a,c){return c?b(a).chain():a},I=function(a,c){n.prototype[a]=function(){var a=i.call(arguments);G.call(a,this._wrapped);return u(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];n.prototype[a]=function(){b.apply(this._wrapped, +arguments);return u(this._wrapped,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];n.prototype[a]=function(){return u(b.apply(this._wrapped,arguments),this._chain)}});n.prototype.chain=function(){this._chain=true;return this};n.prototype.value=function(){return this._wrapped}}).call(this);