mirror of
https://github.com/torrentpier/torrentpier.git
synced 2024-12-14 16:11:16 -08:00
30 lines
34 KiB
JavaScript
30 lines
34 KiB
JavaScript
// json [http://jollytoad.googlepages.com/json.js]
|
|
(function($){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},s={array:function(x){var a=["["],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a[a.length]=v;b=true}}}a[a.length]="]";return a.join("")},"boolean":function(x){return String(x)},"null":function(x){return"null"},number:function(x){return isFinite(x)?String(x):"null"},object:function(x){if(x){if(x instanceof Array){return s.array(x)}var a=["{"],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a.push(s.string(i),":",v);b=true}}}a[a.length]="}";return a.join("")}return"null"},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})}return'"'+x+'"'}};$.toJSON=function(v){var f=isNaN(v)?s[typeof v]:s.number;if(f){return f(v)}};$.evalJSON=function(v,safe){if(safe===undefined){safe=$.evalJSON.safe}if(safe&&!/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v)){return undefined}return eval("("+v+")")};$.evalJSON.safe=false})(jQuery);
|
|
|
|
// treeview pre-1.4.1 [http://plugins.jquery.com/project/treeview]
|
|
(function(a){a.extend(a.fn,{swapClass:function(e,d){var c=this.filter("."+e);this.filter("."+d).removeClass(d).addClass(e);c.removeClass(e).addClass(d);return this},replaceClass:function(d,c){return this.filter("."+d).removeClass(d).addClass(c).end()},hoverClass:function(c){c=c||"hover";return this.hover(function(){a(this).addClass(c)},function(){a(this).removeClass(c)})},heightToggle:function(c,d){c?this.animate({height:"toggle"},c,d):this.each(function(){jQuery(this)[jQuery(this).css("display")!="block"?"show":"hide"]();if(d){d.apply(this,arguments)}})},heightHide:function(c,d){if(c){this.animate({height:"hide"},c,d)}else{this.hide();if(d){this.each(d)}}},prepareBranches:function(c){if(!c.prerendered){this.filter(":last-child:not(ul)").addClass(b.last);this.filter((c.collapsed?"":"."+b.closed)+":not(."+b.open+")").find(">ul").hide()}return this.filter(":has(>ul)")},applyClasses:function(d,e){this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",function(f){if(this==f.target){e.apply(a(this).next())}}).add(a("a",this)).hoverClass();if(!d.prerendered){this.filter(":has(>ul:hidden)").addClass(b.expandable).replaceClass(b.last,b.lastExpandable);this.not(":has(>ul:hidden)").addClass(b.collapsable).replaceClass(b.last,b.lastCollapsable);var c=this.find("div."+b.hitarea);if(!c.length){c=this.prepend('<div class="'+b.hitarea+'"/>').find("div."+b.hitarea)}c.removeClass().addClass(b.hitarea).each(function(){var f="";a.each(a(this).parent().attr("class").split(" "),function(){f+=this+"-hitarea "});a(this).addClass(f)})}this.find("div."+b.hitarea).click(e)},treeview:function(d){d=a.extend({cookieId:"treeview"},d);if(d.toggle){var i=d.toggle;d.toggle=function(){return i.apply(a(this).parent()[0],arguments)}}function c(l,n){function m(o){return function(){f.apply(a("div."+b.hitarea,l).filter(function(){return o?a(this).parent("."+o).length:true}));return false}}a("a:eq(0)",n).click(m(b.collapsable));a("a:eq(1)",n).click(m(b.expandable));a("a:eq(2)",n).click(m())}function f(){a(this).parent().find(">.hitarea").swapClass(b.collapsableHitarea,b.expandableHitarea).swapClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().swapClass(b.collapsable,b.expandable).swapClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightToggle(d.animated,d.toggle);if(d.unique){a(this).parent().siblings().find(">.hitarea").replaceClass(b.collapsableHitarea,b.expandableHitarea).replaceClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().replaceClass(b.collapsable,b.expandable).replaceClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightHide(d.animated,d.toggle)}}this.data("toggler",f);function k(){function m(n){return n?1:0}var l=[];j.each(function(n,o){l[n]=a(o).is(":has(>ul:visible)")?1:0});a.cookie(d.cookieId,l.join(""),d.cookieOptions)}function e(){var l=a.cookie(d.cookieId);if(l){var m=l.split("");j.each(function(n,o){a(o).find(">ul")[parseInt(m[n])?"show":"hide"]()})}}this.addClass("treeview");var j=this.find("li").prepareBranches(d);switch(d.persist){case"cookie":var h=d.toggle;d.toggle=function(){k();if(h){h.apply(this,arguments)}};e();break;case"location":var g=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});if(g.length){g.addClass("selected").parents("ul, li").add(g.next()).show()}break}j.applyClasses(d,f);if(d.control){c(this,d.control);a(d.control).show()}return this}});a.treeview={};var b=(a.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"});a.fn.Treeview=a.fn.treeview})(jQuery);
|
|
|
|
// scrollTo 1.4.2 [http://flesler.blogspot.com/2007/10/jqueryscrollto.html]
|
|
(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);
|
|
|
|
// TableSorter 2.0.3 [http://tablesorter.com]
|
|
(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);log(cache)}return cache}function getElementText(config,node){if(!node){return""}var t=undefined;if(config.textExtraction=="simple"){if(node.childNodes[0]){var c=node.childNodes;var l=c.length;for(var i=0;i<l;i++){if(c[i].nodeType!=1){continue}else{if(c[i].tagName=="U"){t=c[i].innerHTML}break}}}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}}if(t===undefined){t=getElText(node)}t=$.trim(t);return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader).find(".tbs-text").after('<span class="tbs-icon"> </span>')}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);
|
|
|
|
// ElementSort 1.1 [http://plugins.jquery.com/project/ElementSort]
|
|
(function(a){a.fn.extend({elementsort:function(g){if(!g.length){g=[g]}var i=function(l,j){var k;var n;for(var m=0;m<g.length;m++){n=c(l,j,m);k=d(n.a,n.b,g[m].direction);if(k!=0){break}}return k};var c=function(k,j,m){var q=g[m].sortType;var n,l;var p,o;n=e(k,m);l=e(j,m);if(q=="date"){p=new Date(Date.parse(n));o=new Date(Date.parse(l))}else{if(q=="number"){p=new Number(n);o=new Number(l)}else{p=new String(n).toLowerCase();o=new String(l).toLowerCase()}}return{a:p,b:o}};var e=function(k,j){var l;if(k.hash[j]){l=k.hash[j]}else{l=f(k.row,g[j].sortOn);k.hash[j]=l}return l};var f=function(k,j){return k.find(j).text()};var d=function(l,j,m){var k;if(l>j){k=1}else{if(l<j){k=-1}else{k=0}}if(m=="desc"){k*=-1}return k};var b=function(k){var l=[];for(var j=0;j<k.length;j++){l[j]={row:a(k[j]),hash:[]}}return l};var h=function(k,l){var m=a("<div></div>");for(var j=0;j<l.length;j++){m.append(l[j].row)}k.append(m.children())};return this.each(function(){var j=a(this);var k=j.children();var l=b(k);l.sort(i);h(j,l)})}})})(jQuery);
|
|
|
|
// metadata 2.1 [http://plugins.jquery.com/project/metadata]
|
|
(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";var getData=function(data){if(typeof data!="string"){return data}if(data.indexOf("{")<0){data=eval("("+data+")")}};var getObject=function(data){if(typeof data!="string"){return data}data=eval("("+data+")");return data};if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/)){name=name.replace(/^data-/,"")}else{return true}object[name]=getObject(this.nodeValue)})}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}$.data(elem,settings.single,object);return object}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);
|
|
|
|
// quicksearch March 07, 2010 [http://github.com/riklomas/quicksearch]
|
|
jQuery(function(a){a.fn.quicksearch=function(g,c){var j,b,f,i,d="",h=this,k=a.extend({delay:100,selector:null,stripeRows:null,loader:null,noResults:"",bind:"keyup",onBefore:function(){return},onAfter:function(){return},show:function(){this.style.display=""},hide:function(){this.style.display="none"}},c);this.go=function(){var e=0,n=true,m=d.toLowerCase().split(" ");var l=f.length;for(var e=0;e<l;e++){if(this.test(m,b[e])||d==""){k.show.apply(f[e]);n=false}else{k.hide.apply(f[e])}}if(n){this.results(false)}else{this.results(true);this.stripe()}this.loader(false);k.onAfter();return this};this.stripe=function(){if(typeof k.stripeRows==="object"&&k.stripeRows!==null){var l=k.stripeRows.join(" ");var e=k.stripeRows.length;i.not(":hidden").each(function(m){a(this).removeClass(l).addClass(k.stripeRows[m%e])})}return this};this.strip_html=function(l){var e=l.replace(new RegExp("<[^<]+>","g"),"");e=a.trim(e.toLowerCase());return e};this.results=function(e){if(typeof k.noResults==="string"&&k.noResults!==""){if(e){a(k.noResults).hide()}else{a(k.noResults).show()}}return this};this.loader=function(e){if(typeof k.loader==="string"&&k.loader!==""){(e)?a(k.loader).show():a(k.loader).hide()}return this};this.test=function(m,l){for(var e=0;e<m.length;e+=1){if(l.indexOf(m[e])===-1){return false}}return true};this.cache=function(){i=a(g);if(typeof k.noResults==="string"&&k.noResults!==""){i=i.not(k.noResults)}var e=(typeof k.selector==="string")?i.find(k.selector):a(g).not(k.noResults);b=e.map(function(){return h.strip_html(this.innerHTML)});f=i.map(function(){return this});return this.go()};this.trigger=function(){this.loader(true);k.onBefore();window.clearTimeout(j);j=window.setTimeout(function(){h.go()},k.delay);return this};this.cache();this.results(true);this.stripe();this.loader(false);return this.each(function(){a(this).bind(k.bind,function(){d=a(this).val();h.trigger()})})}});
|
|
|
|
// php_js.js - $P
|
|
(function(){if(typeof(C)=="undefined"){var C=function(){if(window==this||!this.init){return new C()}else{return this.init()}}}C.prototype={init:function(){},md5:function(j){var l=function(a,b){return(a<<b)|(a>>>(32-b))};var m=function(a,b){var c,lY4,lX8,lY8,lResult;lX8=(a&0x80000000);lY8=(b&0x80000000);c=(a&0x40000000);lY4=(b&0x40000000);lResult=(a&0x3FFFFFFF)+(b&0x3FFFFFFF);if(c&lY4){return(lResult^0x80000000^lX8^lY8)}if(c|lY4){if(lResult&0x40000000){return(lResult^0xC0000000^lX8^lY8)}else{return(lResult^0x40000000^lX8^lY8)}}else{return(lResult^lX8^lY8)}};var F=function(x,y,z){return(x&y)|((~x)&z)};var G=function(x,y,z){return(x&z)|(y&(~z))};var H=function(x,y,z){return(x^y^z)};var I=function(x,y,z){return(y^(x|(~z)))};var n=function(a,b,c,d,x,s,e){a=m(a,m(m(F(b,c,d),x),e));return m(l(a,s),b)};var o=function(a,b,c,d,x,s,e){a=m(a,m(m(G(b,c,d),x),e));return m(l(a,s),b)};var p=function(a,b,c,d,x,s,e){a=m(a,m(m(H(b,c,d),x),e));return m(l(a,s),b)};var q=function(a,b,c,d,x,s,e){a=m(a,m(m(I(b,c,d),x),e));return m(l(a,s),b)};var r=function(a){var b;var c=a.length;var d=c+8;var e=(d-(d%64))/64;var f=(e+1)*16;var g=Array(f-1);var h=0;var i=0;while(i<c){b=(i-(i%4))/4;h=(i%4)*8;g[b]=(g[b]|(a.charCodeAt(i)<<h));i++}b=(i-(i%4))/4;h=(i%4)*8;g[b]=g[b]|(0x80<<h);g[f-2]=c<<3;g[f-1]=c>>>29;return g};var t=function(a){var b="",WordToHexValue_temp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(a>>>(lCount*8))&255;WordToHexValue_temp="0"+lByte.toString(16);b=b+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2)}return b};var x=Array();var k,AA,BB,CC,DD,a,b,c,d;var u=7,S12=12,S13=17,S14=22;var v=5,S22=9,S23=14,S24=20;var w=4,S32=11,S33=16,S34=23;var A=6,S42=10,S43=15,S44=21;j=this.utf8_encode(j);x=r(j);a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;for(k=0;k<x.length;k+=16){AA=a;BB=b;CC=c;DD=d;a=n(a,b,c,d,x[k+0],u,0xD76AA478);d=n(d,a,b,c,x[k+1],S12,0xE8C7B756);c=n(c,d,a,b,x[k+2],S13,0x242070DB);b=n(b,c,d,a,x[k+3],S14,0xC1BDCEEE);a=n(a,b,c,d,x[k+4],u,0xF57C0FAF);d=n(d,a,b,c,x[k+5],S12,0x4787C62A);c=n(c,d,a,b,x[k+6],S13,0xA8304613);b=n(b,c,d,a,x[k+7],S14,0xFD469501);a=n(a,b,c,d,x[k+8],u,0x698098D8);d=n(d,a,b,c,x[k+9],S12,0x8B44F7AF);c=n(c,d,a,b,x[k+10],S13,0xFFFF5BB1);b=n(b,c,d,a,x[k+11],S14,0x895CD7BE);a=n(a,b,c,d,x[k+12],u,0x6B901122);d=n(d,a,b,c,x[k+13],S12,0xFD987193);c=n(c,d,a,b,x[k+14],S13,0xA679438E);b=n(b,c,d,a,x[k+15],S14,0x49B40821);a=o(a,b,c,d,x[k+1],v,0xF61E2562);d=o(d,a,b,c,x[k+6],S22,0xC040B340);c=o(c,d,a,b,x[k+11],S23,0x265E5A51);b=o(b,c,d,a,x[k+0],S24,0xE9B6C7AA);a=o(a,b,c,d,x[k+5],v,0xD62F105D);d=o(d,a,b,c,x[k+10],S22,0x2441453);c=o(c,d,a,b,x[k+15],S23,0xD8A1E681);b=o(b,c,d,a,x[k+4],S24,0xE7D3FBC8);a=o(a,b,c,d,x[k+9],v,0x21E1CDE6);d=o(d,a,b,c,x[k+14],S22,0xC33707D6);c=o(c,d,a,b,x[k+3],S23,0xF4D50D87);b=o(b,c,d,a,x[k+8],S24,0x455A14ED);a=o(a,b,c,d,x[k+13],v,0xA9E3E905);d=o(d,a,b,c,x[k+2],S22,0xFCEFA3F8);c=o(c,d,a,b,x[k+7],S23,0x676F02D9);b=o(b,c,d,a,x[k+12],S24,0x8D2A4C8A);a=p(a,b,c,d,x[k+5],w,0xFFFA3942);d=p(d,a,b,c,x[k+8],S32,0x8771F681);c=p(c,d,a,b,x[k+11],S33,0x6D9D6122);b=p(b,c,d,a,x[k+14],S34,0xFDE5380C);a=p(a,b,c,d,x[k+1],w,0xA4BEEA44);d=p(d,a,b,c,x[k+4],S32,0x4BDECFA9);c=p(c,d,a,b,x[k+7],S33,0xF6BB4B60);b=p(b,c,d,a,x[k+10],S34,0xBEBFBC70);a=p(a,b,c,d,x[k+13],w,0x289B7EC6);d=p(d,a,b,c,x[k+0],S32,0xEAA127FA);c=p(c,d,a,b,x[k+3],S33,0xD4EF3085);b=p(b,c,d,a,x[k+6],S34,0x4881D05);a=p(a,b,c,d,x[k+9],w,0xD9D4D039);d=p(d,a,b,c,x[k+12],S32,0xE6DB99E5);c=p(c,d,a,b,x[k+15],S33,0x1FA27CF8);b=p(b,c,d,a,x[k+2],S34,0xC4AC5665);a=q(a,b,c,d,x[k+0],A,0xF4292244);d=q(d,a,b,c,x[k+7],S42,0x432AFF97);c=q(c,d,a,b,x[k+14],S43,0xAB9423A7);b=q(b,c,d,a,x[k+5],S44,0xFC93A039);a=q(a,b,c,d,x[k+12],A,0x655B59C3);d=q(d,a,b,c,x[k+3],S42,0x8F0CCC92);c=q(c,d,a,b,x[k+10],S43,0xFFEFF47D);b=q(b,c,d,a,x[k+1],S44,0x85845DD1);a=q(a,b,c,d,x[k+8],A,0x6FA87E4F);d=q(d,a,b,c,x[k+15],S42,0xFE2CE6E0);c=q(c,d,a,b,x[k+6],S43,0xA3014314);b=q(b,c,d,a,x[k+13],S44,0x4E0811A1);a=q(a,b,c,d,x[k+4],A,0xF7537E82);d=q(d,a,b,c,x[k+11],S42,0xBD3AF235);c=q(c,d,a,b,x[k+2],S43,0x2AD7D2BB);b=q(b,c,d,a,x[k+9],S44,0xEB86D391);a=m(a,AA);b=m(b,BB);c=m(c,CC);d=m(d,DD)}var B=t(a)+t(b)+t(c)+t(d);return B.toLowerCase()},utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");var b=[],ac=0;for(var n=0;n<a.length;n++){var c=a.charCodeAt(n);if(c<128){b[ac++]=String.fromCharCode(c)}else if((c>127)&&(c<2048)){b[ac++]=String.fromCharCode((c>>6)|192);b[ac++]=String.fromCharCode((c&63)|128)}else{b[ac++]=String.fromCharCode((c>>12)|224);b[ac++]=String.fromCharCode(((c>>6)&63)|128);b[ac++]=String.fromCharCode((c&63)|128)}}return b.join('')}};window.$P=C()})();
|
|
|
|
// SWFObject 1.5.1 [http://blog.deconcept.com/swfobject/]
|
|
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
|
|
|
|
// ypanel
|
|
ypanel=function(e,d){if(!e){return false}d=$.extend({moving:0,resizing:1,title:"",menu:"",content:"",footer:"",close:1,minimize:0,width:300,hidetitle:0},d);if(!document.getElementById("PanelsDock")){var b=document.createElement("div");b.id="PanelsDock";document.body.appendChild(b)}else{b=document.getElementById("PanelsDock")}var a="";if(d.close||d.minimize){a+='<div class="PanelsButton">';if(d.minimize){a+='<span class="button PanelsMinimize" title="Свернуть">[свернуть]</span>'}if(d.close){a+='<a class="PanelsClose">[закрыть]</a>'}a+="</div>"}a+='<div class="PanelsTitle'+(d.hidetitle?" Hidden":"")+'">'+d.title+'</div><div class="PanelsMenu'+(d.menu==""?" Hidden":"")+'">'+d.menu+"</div>";if(d.content!=""){a+='<div class="PanelsContent">'+d.content+"</div>"}if(d.footer!=""){a='<div class="PanelsFooter">'+d.footer+"</div>"}var c=document.createElement("div");c.id="Panel_"+e;c.className="Panels";c.innerHTML=a;c.style.width=d.width+"px";b.appendChild(c);d.height=Math.min((d.height||c.clientHeight),(typeof window.innerHeight=="number"?window.innerHeight:document.documentElement.clientHeight)-100);c.style.height=d.height+"px";c.style.marginTop=-(d.height/2)+"px";c.style.marginLeft=-(d.width/2)+"px";if(d.moving){$(c).moving({moveby:".PanelsTitle, .PanelsMenu"})}if(d.resizing){$(c).resizing({color:"transparent",sides:"all"})}$(c).find(".PanelsClose").click(function(){$(this).parent().parent().fadeOut(300,function(){$(this).remove()})})};
|