From 3d533b362fa91d4a240a665c53b6085072b279c1 Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Sat, 8 Apr 2017 19:09:46 +0200 Subject: [PATCH 01/11] trying to fix CI, it seems a newer version of setup_tools is needed --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4e673ccd..bee18117 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,7 @@ matrix: # command to install dependencies install: + - "pip install --upgrade setuptools" - "pip install cherrypy${CHERRYPY_VERSION} --no-use-wheel" - "pip install coveralls pyyaml" - "if [[ $TRAVIS_PYTHON_VERSION = 2.6 ]]; then pip install unittest2; fi" From 30d2d03c5a7ffa3c34929f83fcec5af0cadf598d Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Thu, 20 Jul 2017 21:19:49 -0700 Subject: [PATCH 02/11] change download zip name, closes #622 --- cherrymusicserver/httphandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cherrymusicserver/httphandler.py b/cherrymusicserver/httphandler.py index 389dcc51..5192aa47 100644 --- a/cherrymusicserver/httphandler.py +++ b/cherrymusicserver/httphandler.py @@ -347,7 +347,7 @@ def download(self, value): _save_and_release_session() zipmime = 'application/x-zip-compressed' cherrypy.response.headers["Content-Type"] = zipmime - zipname = 'attachment; filename="music.zip"' + zipname = 'attachment; filename="CherryMusic-archive.zip"' cherrypy.response.headers['Content-Disposition'] = zipname basedir = cherry.config['media.basedir'] fullpath_filelist = [os.path.join(basedir, f) for f in filelist] From 1a2de1b62a95354477bde93a4de62540e0c2ee12 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Thu, 20 Jul 2017 21:07:49 -0700 Subject: [PATCH 03/11] Make username case-insensitive --- cherrymusicserver/userdb.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/cherrymusicserver/userdb.py b/cherrymusicserver/userdb.py index 62442367..7e83e4aa 100644 --- a/cherrymusicserver/userdb.py +++ b/cherrymusicserver/userdb.py @@ -54,11 +54,17 @@ def addUser(self, username, password, admin): return False user = User.create(username, password, admin) try: - self.conn.execute(''' - INSERT INTO users - (username, admin, password, salt) - VALUES (?,?,?,?)''', - (user.name, 1 if user.isadmin else 0, user.password, user.salt)) + exists = self.conn.execute('SELECT username' + ' FROM users WHERE lower(username) = lower(?)', + (username,)).fetchone() + if (not exists): + self.conn.execute(''' + INSERT INTO users + (username, admin, password, salt) + VALUES (?,?,?,?)''', + (user.name, 1 if user.isadmin else 0, user.password, user.salt)) + else: + raise sqlite3.IntegrityError; except sqlite3.IntegrityError: log.e('cannot create user "%s", already exists!' % user.name) return False @@ -82,7 +88,7 @@ def changePassword(self, username, newpassword): newuser = User.create(username, newpassword, False) #dummy user for salt self.conn.execute(''' - UPDATE users SET password = ?, salt = ? WHERE username = ? + UPDATE users SET password = ?, salt = ? WHERE lower(username) = lower(?) ''', (newuser.password, newuser.salt, newuser.name) ) self.conn.commit() return "success" @@ -103,7 +109,7 @@ def auth(self, username, password): return User.nobody() rows = self.conn.execute('SELECT rowid, username, admin, password, salt' - ' FROM users WHERE username = ?', (username,))\ + ' FROM users WHERE lower(username) = lower(?)', (username,))\ .fetchall() assert len(rows) <= 1 if rows: @@ -131,7 +137,7 @@ def getNameById(self, userid): return username[0] if username else 'nobody' def getIdByName(self, username): - res = self.conn.execute('''SELECT rowid FROM users WHERE username = ?''',(username,)) + res = self.conn.execute('''SELECT rowid FROM users WHERE lower(username) = lower(?)''',(username,)) userid = res.fetchone() if userid: return userid[0] From 24a609ca952fc25493948562f720950b5ddbae4a Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Fri, 21 Jul 2017 09:47:49 -0700 Subject: [PATCH 04/11] Update jQuery to 3.2.1 Too many changes to name, primarily bugfixes for us. jquery-ui is updated to the latest patch version, not stable (so still 1.11, just 1.11.4) --- devscripts/deploy.py | 2 +- res/devel.html | 2 +- res/dist/cherrymusic.dist.js | 2315 +++-- res/js/ext/jquery-1.10.2.js | 9789 ------------------ res/js/ext/jquery-1.10.2.min.js | 6 - res/js/ext/jquery-3.2.1.js | 10253 +++++++++++++++++++ res/js/ext/jquery-ui.js | 16166 ++++++++++++++++++++++++++++-- res/setup.html | 2 +- 8 files changed, 27232 insertions(+), 11303 deletions(-) delete mode 100644 res/js/ext/jquery-1.10.2.js delete mode 100644 res/js/ext/jquery-1.10.2.min.js create mode 100644 res/js/ext/jquery-3.2.1.js mode change 100644 => 100755 res/js/ext/jquery-ui.js diff --git a/devscripts/deploy.py b/devscripts/deploy.py index 27461775..e81fcc60 100755 --- a/devscripts/deploy.py +++ b/devscripts/deploy.py @@ -102,4 +102,4 @@ def remove_whitespace(html): html = remove_whitespace(html) with open(MAIN_OUTPUT_HTML, 'w') as mainhtml: - mainhtml.write(html) \ No newline at end of file + mainhtml.write(html) diff --git a/res/devel.html b/res/devel.html index 5056cf65..4545be2c 100644 --- a/res/devel.html +++ b/res/devel.html @@ -46,7 +46,7 @@ - + diff --git a/res/dist/cherrymusic.dist.js b/res/dist/cherrymusic.dist.js index 2536aee9..50477a01 100644 --- a/res/dist/cherrymusic.dist.js +++ b/res/dist/cherrymusic.dist.js @@ -1,170 +1,155 @@ /*! - jQuery JavaScript Library v1.10.2 - http://jquery.com/ + jQuery JavaScript Library v3.2.1 + https://jquery.com/ Includes Sizzle.js - http://sizzlejs.com/ + https://sizzlejs.com/ - Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors + Copyright JS Foundation and other contributors Released under the MIT license - http://jquery.org/license + https://jquery.org/license - Date: 2013-07-03T13:48Z - */(function(window,undefined){var -readyList,rootjQuery,core_strundefined=typeof undefined,location=window.location,document=window.document,docElem=document.documentElement,_jQuery=window.jQuery,_$=window.$,class2type={},core_deletedIds=[],core_version="1.10.2",core_concat=core_deletedIds.concat,core_push=core_deletedIds.push,core_slice=core_deletedIds.slice,core_indexOf=core_deletedIds.indexOf,core_toString=class2type.toString,core_hasOwn=class2type.hasOwnProperty,core_trim=core_version.trim,jQuery=function(selector,context){return new jQuery.fn.init(selector,context,rootjQuery);},core_pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,core_rnotwhite=/\S+/g,rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase();},completed=function(event){if(document.addEventListener||event.type==="load"||document.readyState==="complete"){detach();jQuery.ready();}},detach=function(){if(document.addEventListener){document.removeEventListener("DOMContentLoaded",completed,false);window.removeEventListener("load",completed,false);}else{document.detachEvent("onreadystatechange",completed);window.detachEvent("onload",completed);}};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector){return this;} -if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);} -if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}} -return this;}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector);} -this.length=1;this[0]=elem;} -this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);} -if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;} -return jQuery.makeArray(selector,this);},selector:"",length:0,toArray:function(){return core_slice.call(this);},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num]);},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.ready.promise().done(fn);return this;},slice:function(){return this.pushStack(core_slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j=0&&j0){return;} -readyList.resolveWith(document,[jQuery]);if(jQuery.fn.trigger){jQuery(document).trigger("ready").off("ready");}},isFunction:function(obj){return jQuery.type(obj)==="function";},isArray:Array.isArray||function(obj){return jQuery.type(obj)==="array";},isWindow:function(obj){return obj!=null&&obj==obj.window;},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj);},type:function(obj){if(obj==null){return String(obj);} -return typeof obj==="object"||typeof obj==="function"?class2type[core_toString.call(obj)]||"object":typeof obj;},isPlainObject:function(obj){var key;if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;} -try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;}}catch(e){return false;} -if(jQuery.support.ownLast){for(key in obj){return core_hasOwn.call(obj,key);}} -for(key in obj){} -return key===undefined||core_hasOwn.call(obj,key);},isEmptyObject:function(obj){var name;for(name in obj){return false;} -return true;},error:function(msg){throw new Error(msg);},parseHTML:function(data,context,keepScripts){if(!data||typeof data!=="string"){return null;} -if(typeof context==="boolean"){keepScripts=context;context=false;} -context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];} -parsed=jQuery.buildFragment([data],context,scripts);if(scripts){jQuery(scripts).remove();} -return jQuery.merge([],parsed.childNodes);},parseJSON:function(data){if(window.JSON&&window.JSON.parse){return window.JSON.parse(data);} -if(data===null){return data;} -if(typeof data==="string"){data=jQuery.trim(data);if(data){if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return(new Function("return "+data))();}}} -jQuery.error("Invalid JSON: "+data);},parseXML:function(data){var xml,tmp;if(!data||typeof data!=="string"){return null;} -try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml");}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data);}}catch(e){xml=undefined;} -if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);} -return xml;},noop:function(){},globalEval:function(data){if(data&&jQuery.trim(data)){(window.execScript||function(data){window["eval"].call(window,data);})(data);}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray){for(;i0&&(length-1)in obj);} -rootjQuery=jQuery(document);/*! - Sizzle CSS Selector Engine v1.10.2 - http://sizzlejs.com/ - - Copyright 2013 jQuery Foundation, Inc. and other contributors +args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;},now:Date.now,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];} +jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=jQuery.type(obj);if(type==="function"||jQuery.isWindow(obj)){return false;} +return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;} +var Sizzle=/*! + Sizzle CSS Selector Engine v2.3.3 + https://sizzlejs.com/ + + Copyright jQuery Foundation and other contributors Released under the MIT license http://jquery.org/license - Date: 2013-07-03 - */(function(window,undefined){var i,support,cachedruns,Expr,getText,isXML,compile,outermostContext,sortInput,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+-(new Date()),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),hasDuplicate=false,sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0;} -return 0;},strundefined=typeof undefined,MAX_NEGATIVE=1<<31,hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){var i=0,len=this.length;for(;i+~]|"+whitespace+")"+whitespace+"*"),rsibling=new RegExp(whitespace+"*[+~]"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+characterEncoding+")"),"CLASS":new RegExp("^\\.("+characterEncoding+")"),"TAG":new RegExp("^("+characterEncoding.replace("w","w*")+")"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ -whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);};try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){} + Date: 2016-08-08 + */(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;} +return 0;},hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+identifier+")"),"CLASS":new RegExp("^\\.("+identifier+")"),"TAG":new RegExp("^("+identifier+"|[*])"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ +whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";} +return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ";} +return"\\"+ch;},unloadHandler=function(){setDocument();},disabledAncestor=addCombinator(function(elem){return elem.disabled===true&&("form"in elem||"label"in elem);},{dir:"parentNode",next:"legend"});try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){} target.length=j-1;}};} -function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);} -context=context||document;results=results||[];if(!selector||typeof selector!=="string"){return results;} -if((nodeType=context.nodeType)!==1&&nodeType!==9){return[];} -if(documentIsHTML&&!seed){if((match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){elem=context.getElementById(m);if(elem&&elem.parentNode){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}} -if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){nid=old=expando;newContext=context;newSelector=nodeType===9&&selector;if(nodeType===1&&context.nodeName.toLowerCase()!=="object"){groups=tokenize(selector);if((old=context.getAttribute("id"))){nid=old.replace(rescape,"\\$&");}else{context.setAttribute("id",nid);} -nid="[id='"+nid+"'] ";i=groups.length;while(i--){groups[i]=nid+toSelector(groups[i]);} -newContext=rsibling.test(selector)&&context.parentNode||context;newSelector=groups.join(",");} -if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(!old){context.removeAttribute("id");}}}}} +function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;} +if(!seed){if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);} +context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}} +if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(nodeType!==1){newContext=context;newSelector=selector;}else if(context.nodeName.toLowerCase()!=="object"){if((nid=context.getAttribute("id"))){nid=nid.replace(rcssescape,fcssescape);}else{context.setAttribute("id",(nid=expando));} +groups=tokenize(selector);i=groups.length;while(i--){groups[i]="#"+nid+" "+toSelector(groups[i]);} +newSelector=groups.join(",");newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;} +if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(nid===expando){context.removeAttribute("id");}}}}}} return select(selector.replace(rtrim,"$1"),context,results,seed);} -function createCache(){var keys=[];function cache(key,value){if(keys.push(key+=" ")>Expr.cacheLength){delete cache[keys.shift()];} -return(cache[key]=value);} +function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];} +return(cache[key+" "]=value);} return cache;} function markFunction(fn){fn[expando]=true;return fn;} -function assert(fn){var div=document.createElement("div");try{return!!fn(div);}catch(e){return false;}finally{if(div.parentNode){div.parentNode.removeChild(div);} -div=null;}} -function addHandle(attrs,handler){var arr=attrs.split("|"),i=attrs.length;while(i--){Expr.attrHandle[arr[i]]=handler;}} -function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)- -(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff;} +function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el);}catch(e){return false;}finally{if(el.parentNode){el.parentNode.removeChild(el);} +el=null;}} +function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}} +function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&a.sourceIndex-b.sourceIndex;if(diff){return diff;} if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}} return a?1:-1;} function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};} function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};} +function createDisabledPseudo(disabled){return function(elem){if("form"in elem){if(elem.parentNode&&elem.disabled===false){if("label"in elem){if("label"in elem.parentNode){return elem.parentNode.disabled===disabled;}else{return elem.disabled===disabled;}} +return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&disabledAncestor(elem)===disabled;} +return elem.disabled===disabled;}else if("label"in elem){return elem.disabled===disabled;} +return false;};} function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});} -isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};support=Sizzle.support={};setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc,parent=doc.defaultView;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;} -document=doc;docElem=doc.documentElement;documentIsHTML=!isXML(doc);if(parent&&parent.attachEvent&&parent!==parent.top){parent.attachEvent("onbeforeunload",function(){setDocument();});} -support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className");});support.getElementsByTagName=assert(function(div){div.appendChild(doc.createComment(""));return!div.getElementsByTagName("*").length;});support.getElementsByClassName=assert(function(div){div.innerHTML="
";div.firstChild.className="i";return div.getElementsByClassName("i").length===2;});support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!doc.getElementsByName||!doc.getElementsByName(expando).length;});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!==strundefined&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[];}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId;};};} -Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!==strundefined){return context.getElementsByTagName(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}} +function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;} +support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;} +document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if(preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){if(subWindow.addEventListener){subWindow.addEventListener("unload",unloadHandler,false);}else if(subWindow.attachEvent){subWindow.attachEvent("onunload",unloadHandler);}} +support.attributes=assert(function(el){el.className="i";return!el.getAttribute("className");});support.getElementsByTagName=assert(function(el){el.appendChild(document.createComment(""));return!el.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(el){docElem.appendChild(el).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});if(support.getById){Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[];}};}else{Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];} +elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}}} +return[];}};} +Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}} return tmp;} -return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(doc.querySelectorAll))){assert(function(div){div.innerHTML="";if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");} -if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}});assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("t","");if(div.querySelectorAll("[t^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");} -if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled");} -div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});} -if((support.matchesSelector=rnative.test((matches=docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});} -rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));contains=rnative.test(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}} -return false;};sortOrder=docElem.compareDocumentPosition?function(a,b){if(a===b){hasDuplicate=true;return 0;} -var compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);if(compare){if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===doc||contains(preferredDoc,a)){return-1;} -if(b===doc||contains(preferredDoc,b)){return 1;} -return sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0;} -return compare&4?-1:1;} -return a.compareDocumentPosition?-1:1;}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b){hasDuplicate=true;return 0;}else if(!aup||!bup){return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);} +return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(el){docElem.appendChild(el).innerHTML=""+"";if(el.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");} +if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");} +if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");} +if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");} +if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}});assert(function(el){el.innerHTML=""+"";var input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");if(el.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");} +if(el.querySelectorAll(":enabled").length!==2){rbuggyQSA.push(":enabled",":disabled");} +docElem.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled");} +el.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});} +if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(el){support.disconnectedMatch=matches.call(el,"*");matches.call(el,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});} +rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}} +return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;} +var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;} +compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1;} +if(b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1;} +return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;} +return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;} +var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);} cur=a;while((cur=cur.parentNode)){ap.unshift(cur);} cur=b;while((cur=cur.parentNode)){bp.unshift(cur);} while(ap[i]===bp[i]){i++;} -return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return doc;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);} -expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}} +return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);} +expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}} return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context);} return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem);} -var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val===undefined?support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null:val;};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}} +var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape);};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}} while(j--){results.splice(duplicates[j],1);}} -return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){for(;(node=elem[i]);i++){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;} -return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";} +sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;} +return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";} return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);} match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);} -return match;},"PSEUDO":function(match){var excess,unquoted=!match[5]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;} -if(match[3]&&match[4]!==undefined){match[2]=match[4];}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);} -return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";} +return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;} +if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);} +return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";} if(!operator){return true;} -result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}} +result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}} start=dir=type==="only"&&!start&&"nextSibling";} return true;} -start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=cache[0]===dirruns&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break;}}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns){diff=cache[1];}else{while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){(node[expando]||(node[expando]={}))[type]=[dirruns,diff];} -if(node===elem){break;}}}} +start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;} +if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];} +if(node===elem){break;}}}}} diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);} -if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};} -return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);} -lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":function(elem){return elem.disabled===false;},"disabled":function(elem){return elem.disabled===true;},"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;} -return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeName>"@"||elem.nodeType===3||elem.nodeType===4){return false;}} -return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()===elem.type);},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};} +return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);} +lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":createDisabledPseudo(false),"disabled":createDisabledPseudo(true),"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;} +return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}} +return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i=0;){matchIndexes.push(i);} return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}} return true;}:matchers[0];} +function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});} -function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){return(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));}];for(;i-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});} +function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=expandContext!=null,contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",expandContext&&context.parentNode||context),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1);if(outermost){outermostContext=context!==document&&context;cachedruns=matcherCachedRuns;} -for(;(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;while((matcher=elementMatchers[j++])){if(matcher(elem,context,xml)){results.push(elem);break;}} -if(outermost){dirruns=dirrunsUnique;cachedruns=++matcherCachedRuns;}} +function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context===document||context||outermost;} +for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!==document){setDocument(elem);xml=!documentIsHTML;} +while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}} +if(outermost){dirruns=dirrunsUnique;}} if(bySet){if((elem=!matcher&&elem)){matchedCount--;} if(seed){unmatched.push(elem);}}} matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);} @@ -189,355 +175,431 @@ setMatched=condense(setMatched);} push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}} if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;} return unmatched;};return bySet?markFunction(superMatcher):superMatcher;} -compile=Sizzle.compile=function(selector,group){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!group){group=tokenize(selector);} -i=group.length;while(i--){cached=matcherFromTokens(group[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}} -cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));} -return cached;};function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;} +compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);} +i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}} +cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;} +return cached;};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;} selector=selector.slice(tokens.shift().value.length);} i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;} -if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;} -break;}}}}} -compile(selector,match)(seed,context,!documentIsHTML,results,rsibling.test(selector));return results;} -support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1;});if(!assert(function(div){div.innerHTML="";return div.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});} -if(!support.attributes||!assert(function(div){div.innerHTML="";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});} -if(!assert(function(div){return div.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return(val=elem.getAttributeNode(name))&&val.specified?val.value:elem[name]===true?name.toLowerCase():null;}});} -jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;})(window);var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=true;});return object;} -jQuery.Callbacks=function(options){options=typeof options==="string"?(optionsCache[options]||createOptions(options)):jQuery.extend({},options);var -firing,memory,fired,firingLength,firingIndex,firingStart,list=[],stack=!options.once&&[],fire=function(data){memory=options.memory&&data;fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex-1){list.splice(index,1);if(firing){if(index<=firingLength){firingLength--;} -if(index<=firingIndex){firingIndex--;}}}});} -return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!!(list&&list.length);},empty:function(){list=[];firingLength=0;return this;},disable:function(){list=stack=memory=undefined;return this;},disabled:function(){return!list;},lock:function(){stack=undefined;if(!memory){self.disable();} -return this;},locked:function(){return!stack;},fireWith:function(context,args){if(list&&(!fired||stack)){args=args||[];args=[context,args.slice?args.slice():args];if(firing){stack.push(args);}else{fire(args);}} -return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify);}else{newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments);}});});fns=null;}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[i^1][2].disable,tuples[2][2].lock);} -deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);} -return deferred;},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=length!==1||(subordinate&&jQuery.isFunction(subordinate.promise))?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?core_slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values);}else if(!(--remaining)){deferred.resolveWith(contexts,values);}};},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i
a";all=div.getElementsByTagName("*")||[];a=div.getElementsByTagName("a")[0];if(!a||!a.style||!all.length){return support;} -select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];a.style.cssText="top:1px;float:left;opacity:.5";support.getSetAttribute=div.className!=="t";support.leadingWhitespace=div.firstChild.nodeType===3;support.tbody=!div.getElementsByTagName("tbody").length;support.htmlSerialize=!!div.getElementsByTagName("link").length;support.style=/top/.test(a.getAttribute("style"));support.hrefNormalized=a.getAttribute("href")==="/a";support.opacity=/^0.5/.test(a.style.opacity);support.cssFloat=!!a.style.cssFloat;support.checkOn=!!input.value;support.optSelected=opt.selected;support.enctype=!!document.createElement("form").enctype;support.html5Clone=document.createElement("nav").cloneNode(true).outerHTML!=="<:nav>";support.inlineBlockNeedsLayout=false;support.shrinkWrapBlocks=false;support.pixelPosition=false;support.deleteExpando=true;support.noCloneEvent=true;support.reliableMarginRight=true;support.boxSizingReliable=true;input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test;}catch(e){support.deleteExpando=false;} -input=document.createElement("input");input.setAttribute("value","");support.input=input.getAttribute("value")==="";input.value="t";input.setAttribute("type","radio");support.radioValue=input.value==="t";input.setAttribute("checked","t");input.setAttribute("name","t");fragment=document.createDocumentFragment();fragment.appendChild(input);support.appendChecked=input.checked;support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;if(div.attachEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false;});div.cloneNode(true).click();} -for(i in{submit:true,change:true,focusin:true}){div.setAttribute(eventName="on"+i,"t");support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===false;} -div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";for(i in jQuery(support)){break;} -support.ownLast=i!=="0";jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];if(!body){return;} -container=document.createElement("div");container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";body.appendChild(container).appendChild(div);div.innerHTML="
t
";tds=div.getElementsByTagName("td");tds[0].style.cssText="padding:0;margin:0;border:0;display:none";isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);div.innerHTML="";div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";jQuery.swap(body,body.style.zoom!=null?{zoom:1}:{},function(){support.boxSizing=div.offsetWidth===4;});if(window.getComputedStyle){support.pixelPosition=(window.getComputedStyle(div,null)||{}).top!=="1%";support.boxSizingReliable=(window.getComputedStyle(div,null)||{width:"4px"}).width==="4px";marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText=divReset;marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight);} -if(typeof div.style.zoom!==core_strundefined){div.innerHTML="";div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1";support.inlineBlockNeedsLayout=(div.offsetWidth===3);div.style.display="block";div.innerHTML="
";div.firstChild.style.width="5px";support.shrinkWrapBlocks=(div.offsetWidth!==3);if(support.inlineBlockNeedsLayout){body.style.zoom=1;}} -body.removeChild(container);container=div=tds=marginDiv=null;});all=select=fragment=opt=a=input=null;return support;})({});var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;function internalData(elem,name,data,pvt){if(!jQuery.acceptData(elem)){return;} -var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if((!id||!cache[id]||(!pvt&&!cache[id].data))&&data===undefined&&typeof name==="string"){return;} -if(!id){if(isNode){id=elem[internalKey]=core_deletedIds.pop()||jQuery.guid++;}else{id=internalKey;}} -if(!cache[id]){cache[id]=isNode?{}:{toJSON:jQuery.noop};} -if(typeof name==="object"||typeof name==="function"){if(pvt){cache[id]=jQuery.extend(cache[id],name);}else{cache[id].data=jQuery.extend(cache[id].data,name);}} -thisCache=cache[id];if(!pvt){if(!thisCache.data){thisCache.data={};} -thisCache=thisCache.data;} -if(data!==undefined){thisCache[jQuery.camelCase(name)]=data;} -if(typeof name==="string"){ret=thisCache[name];if(ret==null){ret=thisCache[jQuery.camelCase(name)];}}else{ret=thisCache;} -return ret;} -function internalRemoveData(elem,name,pvt){if(!jQuery.acceptData(elem)){return;} -var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(!cache[id]){return;} -if(name){thisCache=pvt?cache[id]:cache[id].data;if(thisCache){if(!jQuery.isArray(name)){if(name in thisCache){name=[name];}else{name=jQuery.camelCase(name);if(name in thisCache){name=[name];}else{name=name.split(" ");}}}else{name=name.concat(jQuery.map(name,jQuery.camelCase));} -i=name.length;while(i--){delete thisCache[name[i]];} -if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache)){return;}}} -if(!pvt){delete cache[id].data;if(!isEmptyDataObject(cache[id])){return;}} -if(isNode){jQuery.cleanData([elem],true);}else if(jQuery.support.deleteExpando||cache!=cache.window){delete cache[id];}else{cache[id]=null;}} -jQuery.extend({cache:{},noData:{"applet":true,"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(elem){elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando];return!!elem&&!isEmptyDataObject(elem);},data:function(elem,name,data){return internalData(elem,name,data);},removeData:function(elem,name){return internalRemoveData(elem,name);},_data:function(elem,name,data){return internalData(elem,name,data,true);},_removeData:function(elem,name){return internalRemoveData(elem,name,true);},acceptData:function(elem){if(elem.nodeType&&elem.nodeType!==1&&elem.nodeType!==9){return false;} -var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==true&&elem.getAttribute("classid")===noData;}});jQuery.fn.extend({data:function(key,value){var attrs,name,data=null,i=0,elem=this[0];if(key===undefined){if(this.length){data=jQuery.data(elem);if(elem.nodeType===1&&!jQuery._data(elem,"parsedAttrs")){attrs=elem.attributes;for(;i:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i);var risSimple=/^.[^:#\[\.,]*$/;function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});} +if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});} +if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});} +if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);} +qualifier=jQuery.filter(qualifier,elements);return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not&&elem.nodeType===1;});} +jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";} +if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[];} +return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i1?jQuery.uniqueSort(ret):ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;} +root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);} +if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}} +return this;}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1;} +return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(jQuery.isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);} +return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}}} +return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;} +if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);} +return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){} +return cur;} +jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){if(nodeName(elem,"iframe")){return elem.contentDocument;} +if(nodeName(elem,"template")){elem=elem.content||elem;} +return jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;} +if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);} +if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);} +if(rparentsprev.test(name)){matched.reverse();}} +return this.pushStack(matched);};});var rnothtmlwhite=(/[^\x20\t\r\n\f]+/g);function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=true;});return object;} +jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var +firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];} +return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory="";} +return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}} +return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};function Identity(v){return v;} +function Thrower(ex){throw ex;} +function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&jQuery.isFunction((method=value.promise))){method.call(value).done(resolve).fail(reject);}else if(value&&jQuery.isFunction((method=value.then))){method.call(value,resolve,reject);}else{resolve.apply(undefined,[value].slice(noValue));}}catch(value){reject.apply(undefined,[value]);}} +jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},"catch":function(fn){return promise.then(null,fn);},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this,fn?[returned]:arguments);}});});fns=null;}).promise();},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(depth=maxDepth){if(handler!==Thrower){that=undefined;args=[e];} +deferred.rejectWith(that,args);}}};if(depth){process();}else{if(jQuery.Deferred.getStackHook){process.stackTrace=jQuery.Deferred.getStackHook();} +window.setTimeout(process);}};} +return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,jQuery.isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,jQuery.isFunction(onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,jQuery.isFunction(onRejected)?onRejected:Thrower));}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[3-i][2].disable,tuples[0][2].lock);} +list.add(tuple[3].fire);deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);} +return deferred;},when:function(singleValue){var +remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){master.resolveWith(resolveContexts,resolveValues);}};};if(remaining<=1){adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining);if(master.state()==="pending"||jQuery.isFunction(resolveValues[i]&&resolveValues[i].then)){return master.then();}} +while(i--){adoptValue(resolveValues[i],updateFunc(i),master.reject);} +return master.promise();}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack);}};jQuery.readyException=function(error){window.setTimeout(function(){throw error;});};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error);});return this;};jQuery.extend({isReady:false,readyWait:1,ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;} +jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;} +readyList.resolveWith(document,[jQuery]);}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();} +if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);} +var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true;} +if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value);};}} +if(fn){for(;i1?this.each(function(){jQuery.data(this,key,value);}):elem?dataAttr(elem,key,jQuery.data(elem,key)):null;},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data;}catch(e){} -jQuery.data(elem,key,data);}else{data=undefined;}} +function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data);}catch(e){} +dataUser.set(elem,key,data);}else{data=undefined;}} return data;} -function isEmptyDataObject(obj){var name;for(name in obj){if(name==="data"&&jQuery.isEmptyObject(obj[name])){continue;} -if(name!=="toJSON"){return false;}} -return true;} -jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=jQuery._data(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=jQuery._data(elem,type,jQuery.makeArray(data));}else{queue.push(data);}} +jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem);},data:function(elem,name,data){return dataUser.access(elem,name,data);},removeData:function(elem,name){dataUser.remove(elem,name);},_data:function(elem,name,data){return dataPriv.access(elem,name,data);},_removeData:function(elem,name){dataPriv.remove(elem,name);}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}} +dataPriv.set(elem,"hasDataAttrs",true);}} +return data;} +if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});} +return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data;} +data=dataAttr(elem,key);if(data!==undefined){return data;} +return;} +this.each(function(){dataUser.set(this,key,value);});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}} return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;} if(fn){if(type==="fx"){queue.unshift("inprogress");} delete hooks.stop;fn.call(elem,next,hooks);} -if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue");jQuery._removeData(elem,key);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;} +if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;} if(arguments.length1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){name=jQuery.propFix[name]||name;return this.each(function(){try{this[name]=undefined;delete this[name];}catch(e){}});},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed=typeof value==="string"&&value;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className));});} -if(proceed){classes=(value||"").match(core_rnotwhite)||[];for(;i=0){cur=cur.replace(" "+clazz+" "," ");}} -elem.className=value?jQuery.trim(cur):"";}}} -return this;},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value);} -if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal);});} -return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),classNames=value.match(core_rnotwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(type===core_strundefined||type==="boolean"){if(this.className){jQuery._data(this,"__className__",this.className);} -this.className=this.className||value===false?"":jQuery._data(this,"__className__")||"";}});},hasClass:function(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i=0){return true;}} -return false;},val:function(value){var ret,hooks,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} -ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;} -return;} -isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;} -if(isFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;} -if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});} -hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:elem.text;}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i=0)){optionSet=true;}} -if(!optionSet){elem.selectedIndex=-1;} -return values;}}},attr:function(elem,name,value){var hooks,ret,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;} -if(typeof elem.getAttribute===core_strundefined){return jQuery.prop(elem,name,value);} -if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook);} -if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);}else if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{elem.setAttribute(name,value+"");return value;}}else if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}else{ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem[propName]=false;}else{elem[jQuery.camelCase("default-"+name)]=elem[propName]=false;}}else{jQuery.attr(elem,name,"");} -elem.removeAttribute(getSetAttribute?name:propName);}}},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;} -return value;}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;} -notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];} -if(value!==undefined){return hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem[name]=value);}else{return hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null?ret:elem[name];}},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1;}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name);}else{elem[jQuery.camelCase("default-"+name)]=elem[name]=true;} -return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=jQuery.expr.attrHandle[name]||jQuery.find.attr;jQuery.expr.attrHandle[name]=getSetInput&&getSetAttribute||!ruseDefault.test(name)?function(elem,name,isXML){var fn=jQuery.expr.attrHandle[name],ret=isXML?undefined:(jQuery.expr.attrHandle[name]=undefined)!=getter(elem,name,isXML)?name.toLowerCase():null;jQuery.expr.attrHandle[name]=fn;return ret;}:function(elem,name,isXML){return isXML?undefined:elem[jQuery.camelCase("default-"+name)]?name.toLowerCase():null;};});if(!getSetInput||!getSetAttribute){jQuery.attrHooks.value={set:function(elem,value,name){if(jQuery.nodeName(elem,"input")){elem.defaultValue=value;}else{return nodeHook&&nodeHook.set(elem,value,name);}}};} -if(!getSetAttribute){nodeHook={set:function(elem,value,name){var ret=elem.getAttributeNode(name);if(!ret){elem.setAttributeNode((ret=elem.ownerDocument.createAttribute(name)));} -ret.value=value+="";return name==="value"||value===elem.getAttribute(name)?value:undefined;}};jQuery.expr.attrHandle.id=jQuery.expr.attrHandle.name=jQuery.expr.attrHandle.coords=function(elem,name,isXML){var ret;return isXML?undefined:(ret=elem.getAttributeNode(name))&&ret.value!==""?ret.value:null;};jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&ret.specified?ret.value:undefined;},set:nodeHook.set};jQuery.attrHooks.contenteditable={set:function(elem,value,name){nodeHook.set(elem,value===""?false:value,name);}};jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]={set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");return value;}}};});} -if(!jQuery.support.hrefNormalized){jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4);}};});} -if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined;},set:function(elem,value){return(elem.style.cssText=value+"");}};} -if(!jQuery.support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}} -return null;}};} -jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});if(!jQuery.support.enctype){jQuery.propFix.enctype="encoding";} -jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0);}}};if(!jQuery.support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;function returnTrue(){return true;} +return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;} +type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}} +resolve();return defer.promise(obj);}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var isHiddenWithinTree=function(elem,el){elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&jQuery.contains(elem.ownerDocument,elem)&&jQuery.css(elem,"display")==="none";};var swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];} +ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name];} +return ret;};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale=1,maxIterations=20,currentValue=tween?function(){return tween.cur();}:function(){return jQuery.css(elem,prop,"");},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){unit=unit||initialInUnit[3];valueParts=valueParts||[];initialInUnit=+initial||1;do{scale=scale||".5";initialInUnit=initialInUnit/scale;jQuery.style(elem,prop,initialInUnit+unit);}while(scale!==(scale=currentValue()/initial)&&scale!==1&&--maxIterations);} +if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted;}} +return adjusted;} +var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display;} +temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block";} +defaultDisplayMap[nodeName]=display;return display;} +function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index\x20\t\r\n\f]+)/i);var rscriptType=(/^$|\/(?:java|ecma)script/i);var wrapMap={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function getAll(context,tag){var ret;if(typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*");}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*");}else{ret=[];} +if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret);} +return ret;} +function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i-1){if(ignored){ignored.push(elem);} +continue;} +contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp);} +if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}} +return fragment;} +(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;})();var documentElement=document.documentElement;var +rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;} function returnFalse(){return false;} function safeActiveElement(){try{return document.activeElement;}catch(err){}} -jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(!elemData){return;} +function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;} +for(type in types){on(elem,type,selector,data,types[type],one);} +return elem;} +if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}} +if(fn===false){fn=returnFalse;}else if(!fn){return elem;} +if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);} +return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});} +jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!elemData){return;} if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;} +if(selector){jQuery.find.matchesSelector(documentElement,selector);} if(!handler.guid){handler.guid=jQuery.guid++;} if(!(events=elemData.events)){events=elemData.events={};} -if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!==core_strundefined&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.dispatch.apply(eventHandle.elem,arguments):undefined;};eventHandle.elem=elem;} -types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;} -special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}} +if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};} +types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;} +special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}} if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}} if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);} -jQuery.event.global[type]=true;} -elem=null;},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(!elemData||!(events=elemData.events)){return;} -types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);} +jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;} +types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);} continue;} special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;} if(special.remove){special.remove.call(elem,handleObj);}}} if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);} delete events[type];}} -if(jQuery.isEmptyObject(events)){delete elemData.handle;jQuery._removeData(elem,"events");}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;} -if(rfocusMorph.test(type+jQuery.event.triggered)){return;} -if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} -ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;} -data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;} -if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;} -for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;} -if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}} -i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle");if(handle){handle.apply(cur,data);} -handle=ontype&&cur[ontype];if(handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===false){event.preventDefault();}} -event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&jQuery.acceptData(elem)){if(ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;} -jQuery.event.triggered=type;try{elem[type]();}catch(e){} -jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}} -return event.result;},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;} -handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}} +if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(nativeEvent){var event=jQuery.event.fix(nativeEvent);var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(i=1;i=0:jQuery.find(sel,this,null,[cur]).length;} -if(matches[sel]){matches.push(handleObj);}} -if(matches.length){handlerQueue.push({elem:cur,handlers:matches});}}}} -if(delegateCount=1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(event.type==="click"&&cur.disabled===true)){matchedHandlers=[];matchedSelectors={};for(i=0;i-1:jQuery.find(sel,this,null,[cur]).length;} +if(matchedSelectors[sel]){matchedHandlers.push(handleObj);}} +if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers});}}}} +cur=this;if(delegateCount1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret;},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){cur=ret.push(cur);break;}}} -return this.pushStack(ret.length>1?jQuery.unique(ret):ret);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;} -if(typeof elem==="string"){return jQuery.inArray(this[0],jQuery(elem));} -return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){do{cur=cur[dir];}while(cur&&cur.nodeType!==1);return cur;} -jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;} -if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);} -if(this.length>1){if(!guaranteedUnique[name]){ret=jQuery.unique(ret);} -if(rparentsprev.test(name)){ret=ret.reverse();}} -return this.pushStack(ret);};});jQuery.extend({filter:function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";} -return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);} -cur=cur[dir];} -return matched;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}} -return r;}});function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});} -if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});} -if(typeof qualifier==="string"){if(isSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);} -qualifier=jQuery.filter(qualifier,elements);} -return jQuery.grep(elements,function(elem){return(jQuery.inArray(elem,qualifier)>=0)!==not;});} -function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement){while(list.length){safeFrag.createElement(list.pop());}} -return safeFrag;} -var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/\s*$/g,wrapMap={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value));},null,value,arguments.length);},append:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},remove:function(selector,keepData){var elem,elems=selector?jQuery.filter(selector,this):this,i=0;for(;(elem=elems[i])!=null;i++){if(!keepData&&elem.nodeType===1){jQuery.cleanData(getAll(elem));} -if(elem.parentNode){if(keepData&&jQuery.contains(elem.ownerDocument,elem)){setGlobalEval(getAll(elem,"script"));} -elem.parentNode.removeChild(elem);}} -return this;},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));} -while(elem.firstChild){elem.removeChild(elem.firstChild);} -if(elem.options&&jQuery.nodeName(elem,"select")){elem.options.length=0;}} -return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined){return elem.nodeType===1?elem.innerHTML.replace(rinlinejQuery,""):undefined;} -if(typeof value==="string"&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/\s*$/g;function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(">tbody",elem)[0]||elem;} +return elem;} +function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;} function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1];}else{elem.removeAttribute("type");} return elem;} -function setGlobalEval(elems,refElements){var elem,i=0;for(;(elem=elems[i])!=null;i++){jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"));}} -function cloneCopyEvent(src,dest){if(dest.nodeType!==1||!jQuery.hasData(src)){return;} -var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle;curData.events={};for(type in events){for(i=0,l=events[type].length;i")){clone=elem.cloneNode(true);}else{fragmentDiv.innerHTML=elem.outerHTML;fragmentDiv.removeChild(clone=fragmentDiv.firstChild);} -if((!jQuery.support.noCloneEvent||!jQuery.support.noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0;(node=srcElements[i])!=null;++i){if(destElements[i]){fixCloneNodeIssues(node,destElements[i]);}}} -if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0;(node=srcElements[i])!=null;i++){cloneCopyEvent(node,destElements[i]);}}else{cloneCopyEvent(elem,clone);}} +function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return;} +if(dataPriv.hasData(src)){pdataOld=dataPriv.access(src);pdataCur=dataPriv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(isFunction){args[0]=value.call(this,index,self.html());} +domManip(self,args,callback,ignored);});} +if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;} +if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i");},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));} -destElements=srcElements=node=null;return clone;},buildFragment:function(elems,context,scripts,selection){var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;for(;i")+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;} -if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]));} -if(!jQuery.support.tbody){elem=tag==="table"&&!rtbody.test(elem)?tmp.firstChild:wrap[1]===""&&!rtbody.test(elem)?tmp:0;j=elem&&elem.childNodes.length;while(j--){if(jQuery.nodeName((tbody=elem.childNodes[j]),"tbody")&&!tbody.childNodes.length){elem.removeChild(tbody);}}} -jQuery.merge(nodes,tmp.childNodes);tmp.textContent="";while(tmp.firstChild){tmp.removeChild(tmp.firstChild);} -tmp=safe.lastChild;}}} -if(tmp){safe.removeChild(tmp);} -if(!jQuery.support.appendChecked){jQuery.grep(getAll(nodes,"input"),fixDefaultChecked);} -i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)!==-1){continue;} -contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(safe.appendChild(elem),"script");if(contains){setGlobalEval(tmp);} -if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}} -tmp=null;return safe;},cleanData:function(elems,acceptData){var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;for(;(elem=elems[i])!=null;i++){if(acceptData||jQuery.acceptData(elem)){id=elem[internalKey];data=id&&cache[id];if(data){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}} -if(cache[id]){delete cache[id];if(deleteExpando){delete elem[internalKey];}else if(typeof elem.removeAttribute!==core_strundefined){elem.removeAttribute(internalKey);}else{elem[internalKey]=null;} -core_deletedIds.push(id);}}}}},_evalUrl:function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true});}});jQuery.fn.extend({wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});} -if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);} -wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;} -return elem;}).append(this);} -return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});} -return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];function vendorPropName(style,name){if(name in style){return name;} -var capName=name.charAt(0).toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name;}} -return origName;} -function isHidden(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem);} -function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index1);},show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();} -return this.each(function(){if(isHidden(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"columnCount":true,"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;} -var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name));type="number";} -if(value==null||type==="number"&&isNaN(value)){return;} -if(type==="number"&&!jQuery.cssNumber[origName]){value+="px";} -if(!jQuery.support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";} -if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){try{style[name]=value;}catch(e){}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;} -return style[name];}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);} -if(val===undefined){val=curCSS(elem,name,styles);} -if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];} -if(extra===""||extra){num=parseFloat(val);return extra===true||jQuery.isNumeric(num)?num||0:val;} -return val;}});if(window.getComputedStyle){getStyles=function(elem){return window.getComputedStyle(elem,null);};curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;if(computed){if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name);} -if(rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}} -return ret;};}else if(document.documentElement.currentStyle){getStyles=function(elem){return elem.currentStyle;};curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;if(ret==null&&style&&style[name]){ret=style[name];} -if(rnumnonpx.test(ret)&&!rposition.test(name)){left=style.left;rs=elem.runtimeStyle;rsLeft=rs&&rs.left;if(rsLeft){rs.left=elem.currentStyle.left;} -style.left=name==="fontSize"?"1em":ret;ret=style.pixelLeft+"px";style.left=left;if(rsLeft){rs.left=rsLeft;}} -return ret===""?"auto":ret;};} -function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value;} -function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles);} +return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}} +elem[dataPriv.expando]=undefined;} +if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}} +return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;} +if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i").css("cssText","display:block !important")).appendTo(doc.documentElement);doc=(iframe[0].contentWindow||iframe[0].contentDocument).document;doc.write("");doc.close();display=actualDisplay(nodeName,doc);iframe.detach();} -elemdisplay[nodeName]=display;} -return display;} -function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");elem.remove();return display;} -jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return elem.offsetWidth===0&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra);}):getWidthOrHeight(elem,name,extra);}},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles):0);}};});if(!jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":computed?"1":"";},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+value*100+")":"",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1;if((value>=1||value==="")&&jQuery.trim(filter.replace(ralpha,""))===""&&style.removeAttribute){style.removeAttribute("filter");if(value===""||currentStyle&&!currentStyle.filter){return;}} -style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity;}};} -jQuery(function(){if(!jQuery.support.reliableMarginRight){jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed){return jQuery.swap(elem,{"display":"inline-block"},curCSS,[elem,"marginRight"]);}}};} -if(!jQuery.support.pixelPosition&&jQuery.fn.position){jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}}};});}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||(!jQuery.support.reliableHiddenOffsets&&((elem.style&&elem.style.display)||jQuery.css(elem,"display"))==="none");};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};} -jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];} -return expanded;}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():(value==null?"":value);s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional;} -if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}} -return s.join("&").replace(r20,"+");};function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"?i:"")+"]",v,traditional,add);}});}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} -jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);},bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);}});var -ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href;}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;} -ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} -var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};} +jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"animationIterationCount":true,"columnCount":true,"fillOpacity":true,"flexGrow":true,"flexShrink":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":"cssFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;} +var ret,type,hooks,origName=jQuery.camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName);} +hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number";} +if(value==null||value!==value){return;} +if(type==="number"){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");} +if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";} +if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){style.setProperty(name,value);}else{style[name]=value;}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;} +return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=jQuery.camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName);} +hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);} +if(val===undefined){val=curCSS(elem,name,styles);} +if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];} +if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;} +return val;}});jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects().length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra);}):getWidthOrHeight(elem,name,extra);}},set:function(elem,value,extra){var matches,styles=extra&&getStyles(elem),subtract=extra&&augmentWidthOrHeight(elem,name,extra,jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles);if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[name]=value;value=jQuery.css(elem,name);} +return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left- +swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left;}))+"px";}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];} +return expanded;}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i1);}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);} +jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;} +this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);} +if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);} +return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];} +result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var +fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule);}else{window.setTimeout(schedule,jQuery.fx.interval);} +jQuery.fx.tick();}} +function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=jQuery.now());} +function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;} +if(includeWidth){attrs.opacity=attrs.width=type;} +return attrs;} +function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} +if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);} +if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);} +if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;} +if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} +elem.setAttribute(name,value+"");return value;} +if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} +ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;} +return value;}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);} +return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName]=handle;} +return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} +if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];} +if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} +return(elem[name]=value);} +if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} +return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10);} +if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0;} +return-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;} +return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};} +jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(" ");} +function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";} +jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});} +if(typeof value==="string"&&value){classes=value.match(rnothtmlwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}} +finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} +return this;},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});} +if(!arguments.length){return this.attr("class","");} +if(typeof value==="string"&&value){classes=value.match(rnothtmlwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(" "+clazz+" "," ");}} +finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} +return this;},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value);} +if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});} +return this.each(function(){var className,i,self,classNames;if(type==="string"){i=0;self=jQuery(this);classNames=value.match(rnothtmlwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);} +if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return true;}} +return false;}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} +ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"");} +return ret==null?"":ret;} +return;} +isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;} +if(isFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;} +if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});} +hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem));}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max;}else{i=one?index:0;} +for(;i-1){optionSet=true;}} +if(!optionSet){elem.selectedIndex=-1;} +return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;} +if(rfocusMorph.test(type+jQuery.event.triggered)){return;} +if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} +ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;} +data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;} +if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;} +for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;} +if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}} +i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);} +handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}} +event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;} +jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}} +return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});jQuery.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});support.focusin="onfocusin"in window;if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);} +dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}else{dataPriv.access(doc,fix,attaches);}}};});} +var location=window.location;var nonce=jQuery.now();var rquery=(/\?/);jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null;} +try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){xml=undefined;} +if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);} +return xml;};var +rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} +jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=jQuery.isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+ +encodeURIComponent(value==null?"":value);};if(Array.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}} +return s.join("&");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();if(val==null){return null;} +if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};});} +return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});var +r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} +var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};} function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;} return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");} -function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}} +function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}} if(deep){jQuery.extend(true,target,deep);} return target;} -jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments);} -var selector,response,type,self=this,off=url.indexOf(" ");if(off>=0){selector=url.slice(off,url.length);url=url.slice(0,off);} -if(jQuery.isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";} -if(self.length>0){jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("
").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR]);});} -return this;};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} -options=options||{};var -parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} +function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}} +if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} +if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} +if(!firstDataType){firstDataType=type;}} +finalDataType=finalDataType||firstDataType;} +if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} +return responses[finalDataType];}} +function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}} +current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} +if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);} +prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);} +break;}}}} +if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}} +return{state:"success",data:response};} +jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} +options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} match=responseHeaders[key.toLowerCase()];} -return match==null?null:match;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;} -return this;},overrideMimeType:function(type){if(!state){s.mimeType=type;} -return this;},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]];}}else{jqXHR.always(map[jqXHR.status]);}} +return match==null?null:match;},getAllResponseHeaders:function(){return completed?responseHeadersString:null;},setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value;} +return this;},overrideMimeType:function(type){if(completed==null){s.mimeType=type;} +return this;},statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status]);}else{for(code in map){statusCode[code]=[statusCode[code],map[code]];}}} return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);} -done(0,finalText);return this;}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""];if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!==ajaxLocParts[1]||parts[2]!==ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?"80":"443"))!==(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443"))));} +done(0,finalText);return this;}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}} if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);} -inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR;} -fireGlobals=s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");} -s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=(s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data);delete s.data;} -if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++;}} +inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR;} +fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");} +s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(s.data){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data;} +if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce++)+uncached;} +s.url=cacheURL+uncached;}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+");} if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);} if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}} if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);} -jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} -if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort();} -strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);} -transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} -if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} -try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}} -function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return;} -state=2;if(timeoutTimer){clearTimeout(timeoutTimer);} +jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+ +(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} +if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort();} +strAbort="abort";completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} +if(completed){return jqXHR;} +if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} +try{completed=false;transport.send(requestHeaders,done);}catch(e){if(completed){throw e;} +done(-1,e);}} +function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return;} +completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer);} transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);} response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;} modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}} @@ -546,106 +608,52 @@ jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSucc jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);} completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}} return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;} -return jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback});};});function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}} -if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} -if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} -if(!firstDataType){firstDataType=type;}} -finalDataType=finalDataType||firstDataType;} -if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} -return responses[finalDataType];}} -function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}} -current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} -if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);} -prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);} -break;}}}} -if(conv!==true){if(conv&&s["throws"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}} -return{state:"success",data:response};} -jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;} -if(s.crossDomain){s.type="GET";s.global=false;}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script");script.async=true;if(s.scriptCharset){script.charset=s.scriptCharset;} -script.src=s.url;script.onload=script.onreadystatechange=function(_,isAbort){if(isAbort||!script.readyState||/loaded|complete/.test(script.readyState)){script.onload=script.onreadystatechange=null;if(script.parentNode){script.parentNode.removeChild(script);} -script=null;if(!isAbort){callback(200,"success");}}};head.insertBefore(script,head.firstChild);},abort:function(){if(script){script.onload(undefined,true);}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(ajax_nonce++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;} +return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:true,async:false,global:false,"throws":true});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(this[0]){if(jQuery.isFunction(html)){html=html.call(this[0]);} +wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);} +wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;} +return elem;}).append(this);} +return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});} +return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(selector){this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes);});return this;}});jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem);};jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length);};jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}} +if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);} +if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";} +for(i in headers){xhr.setRequestHeader(i,headers[i]);} +callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};} +callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){s.contents.script=false;}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;} +if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery(" + From aa4eea153b96537383af336fccfb0cd9beee3ceb Mon Sep 17 00:00:00 2001 From: Til Boerner Date: Sat, 16 Sep 2017 23:10:36 +0200 Subject: [PATCH 05/11] Fix pypy tests (#676) Explicitly close all db cursors in sqlitecache.py, so we can commit to db even if the cursor objects have not been garbage collected and thus been implicitly closed. (Other Python implementations like PyPy do not mimic CPython's behavior of immmediately garbage collecting stale objects, as it's just an implementation detail and not part of the language spec.) --- cherrymusicserver/sqlitecache.py | 57 +++++++++++++++++++------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/cherrymusicserver/sqlitecache.py b/cherrymusicserver/sqlitecache.py index 26440af4..0ab2b999 100644 --- a/cherrymusicserver/sqlitecache.py +++ b/cherrymusicserver/sqlitecache.py @@ -39,6 +39,7 @@ import traceback from backport.collections import deque, Counter +from contextlib import closing from operator import itemgetter import cherrymusicserver as cherry @@ -92,8 +93,10 @@ def __init__(self, connector=None): self.db = self.conn.cursor() #I don't care about journaling! - self.conn.execute('PRAGMA synchronous = OFF') - self.conn.execute('PRAGMA journal_mode = MEMORY') + with closing(self.conn.execute('PRAGMA synchronous = OFF')): + pass + with closing(self.conn.execute('PRAGMA journal_mode = MEMORY')): + pass self.load_db_to_memory() def file_db_in_memory(self): @@ -310,8 +313,8 @@ def register_file_with_db(self, fileobj): def add_to_file_table(self, fileobj): - cursor = self.conn.execute('INSERT INTO files (parent, filename, filetype, isdir) VALUES (?,?,?,?)', (fileobj.parent.uid if fileobj.parent else -1, fileobj.name, fileobj.ext, 1 if fileobj.isdir else 0)) - rowid = cursor.lastrowid + with closing(self.conn.execute('INSERT INTO files (parent, filename, filetype, isdir) VALUES (?,?,?,?)', (fileobj.parent.uid if fileobj.parent else -1, fileobj.name, fileobj.ext, 1 if fileobj.isdir else 0))) as cursor: + rowid = cursor.lastrowid fileobj.uid = rowid return fileobj @@ -319,9 +322,11 @@ def add_to_file_table(self, fileobj): def add_to_dictionary_table(self, filename): word_ids = [] for word in set(SQLiteCache.searchterms(filename)): - wordrowid = self.conn.execute('''SELECT rowid FROM dictionary WHERE word = ? LIMIT 0,1''', (word,)).fetchone() + with closing(self.conn.execute('''SELECT rowid FROM dictionary WHERE word = ? LIMIT 0,1''', (word,))) as cursor: + wordrowid = cursor.fetchone() if wordrowid is None: - wordrowid = self.conn.execute('''INSERT INTO dictionary (word) VALUES (?)''', (word,)).lastrowid + with closing(self.conn.execute('''INSERT INTO dictionary (word) VALUES (?)''', (word,))) as cursor: + wordrowid = cursor.lastrowid else: wordrowid = wordrowid[0] word_ids.append(wordrowid) @@ -329,8 +334,10 @@ def add_to_dictionary_table(self, filename): def add_to_search_table(self, file_id, word_id_seq): - self.conn.executemany('INSERT INTO search (drowid, frowid) VALUES (?,?)', - ((wid, file_id) for wid in word_id_seq)) + with closing( + self.conn.executemany('INSERT INTO search (drowid, frowid) VALUES (?,?)', + ((wid, file_id) for wid in word_id_seq))): + pass def remove_recursive(self, fileobj, progress=None): @@ -385,18 +392,19 @@ def remove_from_search(self, fileid): '''remove all references to the given fileid from the search table. returns a list of all wordids which had their last search references deleted during this operation.''' - foundlist = self.conn.execute( + with closing(self.conn.execute( 'SELECT drowid FROM search' \ - ' WHERE frowid=?', (fileid,)) \ - .fetchall() + ' WHERE frowid=?', (fileid,))) as cursor: + foundlist = cursor.fetchall() wordset = set([t[0] for t in foundlist]) - self.conn.execute('DELETE FROM search WHERE frowid=?', (fileid,)) + with closing(self.conn.execute('DELETE FROM search WHERE frowid=?', (fileid,))): + pass for wid in set(wordset): - count = self.conn.execute('SELECT count(*) FROM search' - ' WHERE drowid=?', (wid,)) \ - .fetchone()[0] + with closing(self.conn.execute('SELECT count(*) FROM search' + ' WHERE drowid=?', (wid,))) as cursor: + count = cursor.fetchone()[0] if count: wordset.remove(wid) return wordset @@ -407,12 +415,14 @@ def remove_all_from_dictionary(self, wordids): if not wordids: return args = list(zip(wordids)) - self.conn.executemany('DELETE FROM dictionary WHERE rowid=(?)', args) + with closing(self.conn.executemany('DELETE FROM dictionary WHERE rowid=(?)', args)): + pass def remove_from_files(self, fileid): '''deletes the given file id from the files table''' - self.conn.execute('DELETE FROM files WHERE rowid=?', (fileid,)) + with closing(self.conn.execute('DELETE FROM files WHERE rowid=?', (fileid,))): + pass def db_recursive_filelister(self, fileobj, factory=None): @@ -437,10 +447,10 @@ def db_recursive_filelister(self, fileobj, factory=None): def fetch_child_files(self, fileobj, sort=True, reverse=False): '''fetches from files table a list of all File objects that have the argument fileobj as their parent.''' - id_tuples = self.conn.execute( - 'SELECT rowid, filename, filetype, isdir' \ - ' FROM files where parent=?', (fileobj.uid,)) \ - .fetchall() + with closing(self.conn.execute( + 'SELECT rowid, filename, filetype, isdir' \ + ' FROM files where parent=?', (fileobj.uid,))) as cursor: + id_tuples = cursor.fetchall() if sort: id_tuples = sorted(id_tuples, key=lambda t: t[1], reverse=reverse) return (File(name + ext, @@ -556,9 +566,10 @@ def factory(fs, db, parent): def update_word_occurrences(self): log.i(_('updating word occurrences...')) - self.conn.execute('''UPDATE dictionary SET occurrences = ( + with closing(self.conn.execute('''UPDATE dictionary SET occurrences = ( select count(*) from search WHERE search.drowid = dictionary.rowid - )''') + )''')): + pass def enumerate_fs_with_db(self, startpath, itemfactory=None): ''' From 6662b5641a6647641a1e599df42fad809c065adb Mon Sep 17 00:00:00 2001 From: rjsberry Date: Fri, 6 Oct 2017 23:48:59 +0100 Subject: [PATCH 06/11] Removed cherrymusic server imports from setup.py --- setup.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 6480f6fb..f902ccaa 100755 --- a/setup.py +++ b/setup.py @@ -7,15 +7,26 @@ import os import sys import codecs -import cherrymusicserver -from cherrymusicserver import pathprovider try: import py2exe except ImportError: pass +import re here = os.path.abspath(os.path.dirname(__file__)) +def get_global_str_from_file(rel_filepath, var): + prog = re.compile(r'^{} = ("|\')(.*?)("|\')'.format(var)) + with open(os.path.join(here, rel_filepath), 'r') as f: + for line in f.readlines(): + res = prog.match(line) + if res is not None: + return str(res.group(2)) + +initFile = 'cherrymusicserver/__init__.py' +VERSION = get_global_str_from_file(initFile, 'VERSION') +DESCRIPTION = get_global_str_from_file(initFile, 'DESCRIPTION') + import gzip def gzipManPages(): localManPagePath = 'doc/man' @@ -76,7 +87,10 @@ def packagedata(pkgfolder, childpath=''): #setup preparations: gzipManPages() -shareFolder = os.path.join('share',pathprovider.sharedFolderName) +pathproviderFile = os.path.join('cherrymusicserver/pathprovider.py') +shareFolder = os.path.join( + 'share', get_global_str_from_file(pathproviderFile, 'sharedFolderName') +) # files to put in /usr/share data_files = list_files_in_dir( @@ -103,8 +117,8 @@ def packagedata(pkgfolder, childpath=''): setup_options = { 'name': 'CherryMusic', - 'version': cherrymusicserver.VERSION, - 'description': cherrymusicserver.DESCRIPTION, + 'version': VERSION, + 'description': DESCRIPTION, 'long_description': long_description, 'author': 'Tom Wallroth & Tilman Boerner', 'author_email': 'tomwallroth@gmail.com, tilman.boerner@gmx.net', From 8f43b64874b99a40dd354f767463cedbf276c723 Mon Sep 17 00:00:00 2001 From: rjsberry Date: Sat, 7 Oct 2017 00:16:56 +0100 Subject: [PATCH 07/11] Fixed 2.6.9 build fail (zero length format field) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f902ccaa..b473cd90 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ here = os.path.abspath(os.path.dirname(__file__)) def get_global_str_from_file(rel_filepath, var): - prog = re.compile(r'^{} = ("|\')(.*?)("|\')'.format(var)) + prog = re.compile(r'^{0} = ("|\')(.*?)("|\')'.format(var)) with open(os.path.join(here, rel_filepath), 'r') as f: for line in f.readlines(): res = prog.match(line) From 86886437c2dc2266311ad78c14679deb04b21a4b Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Mon, 9 Oct 2017 10:48:06 +0000 Subject: [PATCH 08/11] cmbootstrap: made more clear whats the default option for downloading cherrypy --- cmbootstrap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmbootstrap/__init__.py b/cmbootstrap/__init__.py index 01b464d2..204693c2 100644 --- a/cmbootstrap/__init__.py +++ b/cmbootstrap/__init__.py @@ -97,7 +97,7 @@ def bootstrap(): download it for you and put it in the folder in which currently CherryMusic resides. ''') - if input("Download cherrypy now? (y/n)") == 'y': + if input("Download cherrypy now? (y/N)\n") in ('y', 'yes'): inst = DependencyInstaller() inst.install_cherrypy() print('Successfully installed cherrymusic dependencies! You can now start cherrymusic.') From b02c38d2b8b7c34f31e3ce3982441f7f0c09d197 Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Mon, 9 Oct 2017 10:58:26 +0000 Subject: [PATCH 09/11] updated jPlayer to version 2.9.2 --- res/js/ext/Jplayer.swf | Bin 14170 -> 0 bytes res/js/ext/jplayer.playlist.js | 403 +++++++-------- res/js/ext/jquery.jplayer.inspector.js | 669 +++++++++++++------------ res/js/ext/jquery.jplayer.js | 422 +++++++++++++--- res/js/ext/jquery.jplayer.swf | Bin 0 -> 13714 bytes 5 files changed, 886 insertions(+), 608 deletions(-) delete mode 100644 res/js/ext/Jplayer.swf create mode 100644 res/js/ext/jquery.jplayer.swf diff --git a/res/js/ext/Jplayer.swf b/res/js/ext/Jplayer.swf deleted file mode 100644 index 103a729071893d9d6e94d583103d2f0cccc0ebb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14170 zcma*NQ*b2=6D=A{l8H01GqF9fCbn(cwkDd`wr$(CZSH9AiFTa({ip8Jc{(q>x~r?Y zx>momL^V}Wuv{P@ytZ2X;r-NBAHTZ6y_tNn=;3H&-67#(PFiX@wpCW4-_S`zwDqz> zC(WoZa?OrrD1LMO5Z@GY5*Ay5xUJ{_`r7X5t{f_Xw&f7{~U9cU>^*dsw-P zbz(d=)T!c0lec%9&FRdBg0?Tt%_jezHpg?EhTxme3HjbOOf5}DW=5v!%#227>P8aH z?@yo*MIw!QiupEwT-~V%EZ|>B=c#E})NEnTFl_B|Lf|7jLoRI;p~&&=?jsWEL( z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rp{hK`m-*2hv z4@(si+Sk{Ic%`3Ahd3)WI}3sQW0m_^OA|uwHoawZd2b~ocjla0kBT{*h7zbT%Jrrz zu&<31r73zN7c$gvl<-roQbs*b(3`VhyH))T26#3&&bgOL{_|sin<}Y%HJur^fd}ME zKFma_Le3W5=tJcz=WKzn3`f9|<;u{94Kop?E=+5aoXx5n6Ol+b_=Wk;?XKM1BCKgD zB*z74x2}~J349^PE#R4};U T>B;x}&)h$EU(kA}RDS;-56>)h diff --git a/res/js/ext/jplayer.playlist.js b/res/js/ext/jplayer.playlist.js index 86d604ba..725caf06 100644 --- a/res/js/ext/jplayer.playlist.js +++ b/res/js/ext/jplayer.playlist.js @@ -2,33 +2,57 @@ * Playlist Object for the jPlayer Plugin * http://www.jplayer.org * - * Copyright (c) 2009 - 2011 Happyworm Ltd - * Dual licensed under the MIT and GPL licenses. - * - http://www.opensource.org/licenses/mit-license.php - * - http://www.gnu.org/copyleft/gpl.html + * Copyright (c) 2009 - 2014 Happyworm Ltd + * Licensed under the MIT license. + * http://www.opensource.org/licenses/MIT * * Author: Mark J Panaghiston - * Version: 2.1.0 (jPlayer 2.1.0) - * Date: 1st September 2011 + * Version: 2.4.1 + * Date: 19th November 2014 + * + * Requires: + * - jQuery 1.7.0+ + * - jPlayer 2.8.2+ */ -/* Code verified using http://www.jshint.com/ */ -/*jshint asi:false, bitwise:false, boss:false, browser:true, curly:true, debug:false, eqeqeq:true, eqnull:false, evil:false, forin:false, immed:false, jquery:true, laxbreak:false, newcap:true, noarg:true, noempty:true, nonew:true, nomem:false, onevar:false, passfail:false, plusplus:false, regexp:false, undef:true, sub:false, strict:false, white:false */ -/*global jPlayerPlaylist: true, jQuery:false, alert:false */ +/*global jPlayerPlaylist:true */ (function($, undefined) { jPlayerPlaylist = function(cssSelector, playlist, options) { var self = this; - this.active = false; this.current = 0; this.loop = false; // Flag used with the jPlayer repeat event this.shuffled = false; this.removing = false; // Flag is true during remove animation, disabling the remove() method until complete. this.cssSelector = $.extend({}, this._cssSelector, cssSelector); // Object: Containing the css selectors for jPlayer and its cssSelectorAncestor - this.options = $.extend(true, {}, this._options, options); // Object: The jPlayer constructor options for this playlist and the playlist options + this.options = $.extend(true, { + keyBindings: { + next: { + key: 221, // ] + fn: function() { + self.next(); + } + }, + previous: { + key: 219, // [ + fn: function() { + self.previous(); + } + }, + shuffle: { + key: 83, // s + fn: function() { + self.shuffle(); + } + } + }, + stateClass: { + shuffled: "jp-state-shuffled" + } + }, this._options, options); // Object: The jPlayer constructor options for this playlist and the playlist options this.playlist = []; // Array of Objects: The current playlist displayed (Un-shuffled or Shuffled) this.original = []; // Array of Objects: The original playlist @@ -36,12 +60,8 @@ this._initPlaylist(playlist); // Copies playlist to this.original. Then mirrors this.original to this.playlist. Creating two arrays, where the element pointers match. (Enables pointer comparison.) // Setup the css selectors for the extra interface items used by the playlist. - this.cssSelector.title = this.cssSelector.cssSelectorAncestor + " .jp-title"; // Note that the text is written to the decendant li node. - if(this.options.playlistOptions.playlistSelector) { - this.cssSelector.playlist = this.options.playlistOptions.playlistSelector; - } else { - this.cssSelector.playlist = this.cssSelector.cssSelectorAncestor + " .jp-playlist"; - } + this.cssSelector.details = this.cssSelector.cssSelectorAncestor + " .jp-details"; // Note that jPlayer controls the text in the title element. + this.cssSelector.playlist = this.cssSelector.cssSelectorAncestor + " .jp-playlist"; this.cssSelector.next = this.cssSelector.cssSelectorAncestor + " .jp-next"; this.cssSelector.previous = this.cssSelector.cssSelectorAncestor + " .jp-previous"; this.cssSelector.shuffle = this.cssSelector.cssSelectorAncestor + " .jp-shuffle"; @@ -56,44 +76,70 @@ }; // Create a ready event handler to initialize the playlist - // is now handled by cherrymusic - /*$(this.cssSelector.jPlayer).bind($.jPlayer.event.ready, function(event) { + $(this.cssSelector.jPlayer).bind($.jPlayer.event.ready, function() { self._init(); - });*/ + }); // Create an ended event handler to move to the next item - /*$(this.cssSelector.jPlayer).bind($.jPlayer.event.ended, function(event) { - if(self.active){ - self.next(); - } - });*/ + $(this.cssSelector.jPlayer).bind($.jPlayer.event.ended, function() { + self.next(); + }); // Create a play event handler to pause other instances - $(this.cssSelector.jPlayer).bind($.jPlayer.event.play, function(event) { + $(this.cssSelector.jPlayer).bind($.jPlayer.event.play, function() { $(this).jPlayer("pauseOthers"); }); // Create a resize event handler to show the title in full screen mode. $(this.cssSelector.jPlayer).bind($.jPlayer.event.resize, function(event) { if(event.jPlayer.options.fullScreen) { - $(self.cssSelector.title).show(); + $(self.cssSelector.details).show(); } else { - $(self.cssSelector.title).hide(); + $(self.cssSelector.details).hide(); } }); + // Create click handlers for the extra buttons that do playlist functions. + $(this.cssSelector.previous).click(function(e) { + e.preventDefault(); + self.previous(); + self.blur(this); + }); + + $(this.cssSelector.next).click(function(e) { + e.preventDefault(); + self.next(); + self.blur(this); + }); + + $(this.cssSelector.shuffle).click(function(e) { + e.preventDefault(); + if(self.shuffled && $(self.cssSelector.jPlayer).jPlayer("option", "useStateClassSkin")) { + self.shuffle(false); + } else { + self.shuffle(true); + } + self.blur(this); + }); + $(this.cssSelector.shuffleOff).click(function(e) { + e.preventDefault(); + self.shuffle(false); + self.blur(this); + }).hide(); + // Put the title in its initial display state if(!this.options.fullScreen) { - $(this.cssSelector.title).hide(); + $(this.cssSelector.details).hide(); } // Remove the empty
  • from the page HTML. Allows page to be valid HTML, while not interfereing with display animations - $(this.cssSelector.playlist + " ul.playlist-container-list").empty(); + $(this.cssSelector.playlist + " ul").empty(); - // Create .live() handlers for the playlist items along with the free media and remove controls. + // Create .on() handlers for the playlist items along with the free media and remove controls. this._createItemHandlers(); - + // Instance jPlayer + $(this.cssSelector.jPlayer).jPlayer(this.options); }; jPlayerPlaylist.prototype = { @@ -114,16 +160,8 @@ itemClass: "jp-playlist-item", freeGroupClass: "jp-free-media", freeItemClass: "jp-playlist-item-free", - removeItemClass: "jp-playlist-item-remove", - actionItemClass: "jp-playlist-item-action", - parentFolderItemClass: "jp-playlist-item-show-parent-folder", - playlistSelector: false, - playtimeClass: "jp-playlist-playtime", - }, - hooks: { - //can transform track before playing in jPlayer - "setMedia" : function(track){return track}, - }, + removeItemClass: "jp-playlist-item-remove" + } }, option: function(option, value) { // For changing playlist options only if(value === undefined) { @@ -151,15 +189,12 @@ this._refresh(function() { if(self.options.playlistOptions.autoPlay) { self.play(self.current); + } else { + self.select(self.current); } }); }, _initPlaylist: function(playlist) { - for(var i=0; i ul > li:last"); - litem.attr('name', litem.index()); + $(this.cssSelector.playlist + " ul").empty(); + $.each(this.playlist, function(i) { + $(self.cssSelector.playlist + " ul").append(self._createListItem(self.playlist[i])); }); this._updateControls(); } else { - var displayTime = $(this.cssSelector.playlist + " ul.playlist-container-list").children().length ? this.options.playlistOptions.displayTime : 0; + var displayTime = $(this.cssSelector.playlist + " ul").children().length ? this.options.playlistOptions.displayTime : 0; - $(this.cssSelector.playlist + " ul.playlist-container-list").slideUp(displayTime, function() { + $(this.cssSelector.playlist + " ul").slideUp(displayTime, function() { var $this = $(this); $(this).empty(); - $.each(self.playlist, function(i,v) { - $this.append(self._createListItem(self.playlist[i])); - var litem = $(self.cssSelector.playlist + " > ul.playlist-container-list > li:last"); - litem.attr('name', litem.index()); + $.each(self.playlist, function(i) { + $this.append(self._createListItem(self.playlist[i])); }); self._updateControls(); if($.isFunction(instant)) { @@ -213,35 +244,6 @@ } }); } - this._updatePlaytime(); - this._highlight(this.current); - this._createItemHandlers(); - }, - _updatePlaytime: function(){ - var self = this; - var playtimeSum = 0; - $.each(this.playlist, function(i,v) { - if(self.playlist[i].duration){ - playtimeSum += self.playlist[i].duration; - } - }); - if(playtimeSum){ - $(self.cssSelector.playlist+"-playtime-sum").html("
    "+self._formatTime(playtimeSum)+"
    "); - } else { - $(self.cssSelector.playlist+"-playtime-sum").html(""); - } - }, - _formatTime: function(secs) { - secs = Math.floor(secs); - var mins = Math.floor(secs/60); - var hours = Math.floor(mins/60); - - var s = secs%60; - if(s<10){ s='0'+s; } - var m = mins%60; - if(m<10){ m='0'+m; } - var h = hours>0 ? hours+':' : ''; - return h+m+':'+s; }, _createListItem: function(media) { var self = this; @@ -249,23 +251,8 @@ // Wrap the
  • contents in a
    var listItem = "
  • "; - // create track action menu - listItem += '
    '+ - ' '+ - ' '+ - '
    '; - - // Create Playtime - if(media.duration){ - listItem += ""+self._formatTime(media.duration)+""; - } // Create remove control listItem += "×"; - // Create links to free media if(media.free) { @@ -278,62 +265,46 @@ } else { listItem += " | "; } - listItem += "" + property + ""; + listItem += "" + property + ""; } }); listItem += ")"; } // The title is given next in the HTML otherwise the float:right on the free media corrupts in IE6/7 - listItem += "" + media.title + (media.artist ? " " : "") + ""; + listItem += "" + media.title + (media.artist ? " " : "") + ""; listItem += "
  • "; return listItem; }, _createItemHandlers: function() { var self = this; - // Create .live() handlers for the playlist items - $(this.cssSelector.playlist + " a." + this.options.playlistOptions.itemClass).off("click").on("click", function() { - $(self.options.playlistOptions.playlistSelector).trigger('requestPlay', [self.options.playlistOptions.playlistSelector]); + // Create live handlers for the playlist items + $(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.itemClass).on("click", "a." + this.options.playlistOptions.itemClass, function(e) { + e.preventDefault(); var index = $(this).parent().parent().index(); - //if(self.current !== index) { + if(self.current !== index) { self.play(index); - //} else { - // $(self.cssSelector.jPlayer).jPlayer("play"); - //} - $(this).blur(); - return false; + } else { + $(self.cssSelector.jPlayer).jPlayer("play"); + } + self.blur(this); }); - // Create .live() handlers that disable free media links to force access via right click - $(self.cssSelector.playlist + " a." + this.options.playlistOptions.freeItemClass).off("click").on("click", function(event) { + // Create live handlers that disable free media links to force access via right click + $(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.freeItemClass).on("click", "a." + this.options.playlistOptions.freeItemClass, function(e) { + e.preventDefault(); $(this).parent().parent().find("." + self.options.playlistOptions.itemClass).click(); - $(this).blur(); - return false; + self.blur(this); }); - // Create .live() handlers for the remove controls - $(self.cssSelector.playlist + " a." + this.options.playlistOptions.removeItemClass).off("click").on("click", function(event) { - event.stopPropagation(); + // Create live handlers for the remove controls + $(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.removeItemClass).on("click", "a." + this.options.playlistOptions.removeItemClass, function(e) { + e.preventDefault(); var index = $(this).parent().parent().index(); self.remove(index); - $(this).blur(); - return false; + self.blur(this); }); - - // create handlers for showing the parent folder of a file - $(self.cssSelector.playlist + " a." + this.options.playlistOptions.parentFolderItemClass).off('click').on("click", function(event) { - var index = $(this).parent().parent().parent().parent().parent().index(); - var folder = decodeURIComponent(self.playlist[index].url); - lastFolderSeparator = folder.lastIndexOf('/'); - if(lastFolderSeparator == -1){ - // if there is no "/" in the path it is the basedir - folder = ''; - } else { - folder = folder.slice(0, lastFolderSeparator); - } - loadBrowser(folder, folder); - }); }, _updateControls: function() { if(this.options.playlistOptions.enableRemoveControls) { @@ -341,58 +312,54 @@ } else { $(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).hide(); } + if(this.shuffled) { - $(this.cssSelector.shuffleOff).show(); - $(this.cssSelector.shuffle).hide(); + $(this.cssSelector.jPlayer).jPlayer("addStateClass", "shuffled"); } else { - $(this.cssSelector.shuffleOff).hide(); - $(this.cssSelector.shuffle).show(); + $(this.cssSelector.jPlayer).jPlayer("removeStateClass", "shuffled"); + } + if($(this.cssSelector.shuffle).length && $(this.cssSelector.shuffleOff).length) { + if(this.shuffled) { + $(this.cssSelector.shuffleOff).show(); + $(this.cssSelector.shuffle).hide(); + } else { + $(this.cssSelector.shuffleOff).hide(); + $(this.cssSelector.shuffle).show(); + } } }, _highlight: function(index) { if(this.playlist.length && index !== undefined) { $(this.cssSelector.playlist + " .jp-playlist-current").removeClass("jp-playlist-current"); - $(this.cssSelector.playlist + ">ul>li:nth-child(" + (index + 1) + ")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"); - $(this.cssSelector.title + " li").html(this.playlist[index].title + (this.playlist[index].artist ? " " : "")); + $(this.cssSelector.playlist + " li:nth-child(" + (index + 1) + ")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"); + // $(this.cssSelector.details + " li").html("" + (this.playlist[index].artist ? " " : "")); } }, setPlaylist: function(playlist) { this._initPlaylist(playlist); this._init(); }, - add: function(media, playNow, animate) { - var self = this; - if(typeof animate === 'undefined'){ - animate = true; - } - if(animate){ - $(this.cssSelector.playlist + " ul.playlist-container-list").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime); - } else { - $(this.cssSelector.playlist + " ul.playlist-container-list").append(this._createListItem(media)); - } + add: function(media, playNow) { + $(this.cssSelector.playlist + " ul").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime); this._updateControls(); - this._createItemHandlers(); this.original.push(media); this.playlist.push(media); // Both array elements share the same object pointer. Comforms with _initPlaylist(p) system. if(playNow) { this.play(this.playlist.length - 1); - } /*else { + } else { if(this.original.length === 1) { this.select(0); } - }*/ - $(self.options.playlistOptions.playlistSelector).trigger('addedItem', [self.options.playlistOptions.playlistSelector]); + } }, remove: function(index) { var self = this; - $(self.options.playlistOptions.playlistSelector).trigger('removedItem', [self.options.playlistOptions.playlistSelector]); + if(index === undefined) { this._initPlaylist([]); this._refresh(function() { - if(self.active){ - $(self.cssSelector.jPlayer).jPlayer("clearMedia"); - } + $(self.cssSelector.jPlayer).jPlayer("clearMedia"); }); return true; } else { @@ -404,12 +371,12 @@ if(0 <= index && index < this.playlist.length) { this.removing = true; - $(this.cssSelector.playlist + ">ul>li:nth-child(" + (index + 1) + ")").slideUp(this.options.playlistOptions.removeTime, function() { + $(this.cssSelector.playlist + " li:nth-child(" + (index + 1) + ")").slideUp(this.options.playlistOptions.removeTime, function() { $(this).remove(); if(self.shuffled) { var item = self.playlist[index]; - $.each(self.original, function(i,v) { + $.each(self.original, function(i) { if(self.original[i] === item) { self.original.splice(i, 1); return false; // Exit $.each @@ -434,10 +401,8 @@ self.shuffled = false; self._updateControls(); } - self._updatePlaytime(); + self.removing = false; - //make sure all "name" attributes are correctly numbered - self._refresh(true); }); } return true; @@ -449,11 +414,7 @@ if(0 <= index && index < this.playlist.length) { this.current = index; this._highlight(index); - this.playlist[this.current].wasPlayed += 1; - var self = this; - $(this.cssSelector.jPlayer).jPlayer("setMedia", - self.options.hooks["setMedia"](this.playlist[this.current]) - ); + $(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current]); } else { this.current = 0; } @@ -473,61 +434,63 @@ $(this.cssSelector.jPlayer).jPlayer("pause"); }, next: function() { - if(this.shuffled){ - playRandomTrack(); - } else { - var index = (this.current + 1 < this.playlist.length) ? this.current + 1 : 0; - // The index will be zero if it just looped round - if(this.loop || index > 0) { + var index = (this.current + 1 < this.playlist.length) ? this.current + 1 : 0; + + if(this.loop) { + // See if we need to shuffle before looping to start, and only shuffle if more than 1 item. + if(index === 0 && this.shuffled && this.options.playlistOptions.shuffleOnLoop && this.playlist.length > 1) { + this.shuffle(true, true); // playNow + } else { + this.play(index); + } + } else { + // The index will be zero if it just looped round + if(index > 0) { this.play(index); } - } + } }, - playRandomTrack: function(){ - var weighted = []; - for(var i=0; i= 0) ? this.current - 1 : this.playlist.length - 1; - if(this.loop && this.options.playlistOptions.loopOnPrevious || index < this.playlist.length - 1) { - this.play(index); - } - } + var index = (this.current - 1 >= 0) ? this.current - 1 : this.playlist.length - 1; + + if(this.loop && this.options.playlistOptions.loopOnPrevious || index < this.playlist.length - 1) { + this.play(index); + } }, shuffle: function(shuffled, playNow) { - this.shuffled = !this.shuffled; - this._updateControls(); + var self = this; + + if(shuffled === undefined) { + shuffled = !this.shuffled; + } + + if(shuffled || shuffled !== this.shuffled) { + + $(this.cssSelector.playlist + " ul").slideUp(this.options.playlistOptions.shuffleTime, function() { + self.shuffled = shuffled; + if(shuffled) { + self.playlist.sort(function() { + return 0.5 - Math.random(); + }); + } else { + self._originalPlaylist(); + } + self._refresh(true); // Instant + + if(playNow || !$(self.cssSelector.jPlayer).data("jPlayer").status.paused) { + self.play(0); + } else { + self.select(0); + } + + $(this).slideDown(self.options.playlistOptions.shuffleTime); + }); + } }, - scan: function() { - var self = this; - var isAdjusted = false; - - var replace = []; - $.each($(this.cssSelector.playlist + " > ul.playlist-container-list > li"), function(index, value) { - replace[index] = self.original[$(value).attr('name')]; - if(!isAdjusted && self.current === parseInt($(value).attr('name'), 10)) { - self.current = index; - isAdjusted = true; - } - $(value).attr('name', index); - }); - this.original = replace; - this._originalPlaylist(); - $(self.options.playlistOptions.playlistSelector).trigger('sortedItems', [self.options.playlistOptions.playlistSelector]); - } + blur: function(that) { + if($(this.cssSelector.jPlayer).jPlayer("option", "autoBlur")) { + $(that).blur(); + } + } }; })(jQuery); diff --git a/res/js/ext/jquery.jplayer.inspector.js b/res/js/ext/jquery.jplayer.inspector.js index 46c090a1..e7a6cf89 100644 --- a/res/js/ext/jquery.jplayer.inspector.js +++ b/res/js/ext/jquery.jplayer.inspector.js @@ -1,331 +1,338 @@ -/* - * jPlayerInspector Plugin for jPlayer (2.0.0+) Plugin for jQuery JavaScript Library - * http://www.happyworm.com/jquery/jplayer - * - * Copyright (c) 2009 - 2011 Happyworm Ltd - * Dual licensed under the MIT and GPL licenses. - * - http://www.opensource.org/licenses/mit-license.php - * - http://www.gnu.org/copyleft/gpl.html - * - * Author: Mark J Panaghiston - * Version: 1.0.3 - * Date: 7th August 2011 - * - * For use with jPlayer Version: 2.0.29 - * - * Note: Declare inspector instances after jPlayer instances. ie., Otherwise the jPlayer instance is nonsense. - */ - -(function($, undefined) { - $.jPlayerInspector = {}; - $.jPlayerInspector.i = 0; - $.jPlayerInspector.defaults = { - jPlayer: undefined, // The jQuery selector of the jPlayer instance to inspect. - idPrefix: "jplayer_inspector_", - visible: false - }; - - var methods = { - init: function(options) { - var self = this; - var $this = $(this); - - var config = $.extend({}, $.jPlayerInspector.defaults, options); - $(this).data("jPlayerInspector", config); - - config.id = $(this).attr("id"); - config.jPlayerId = config.jPlayer.attr("id"); - - config.windowId = config.idPrefix + "window_" + $.jPlayerInspector.i; - config.statusId = config.idPrefix + "status_" + $.jPlayerInspector.i; - config.configId = config.idPrefix + "config_" + $.jPlayerInspector.i; - config.toggleId = config.idPrefix + "toggle_" + $.jPlayerInspector.i; - config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i; - config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i; - config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i; - - config.eventId = {}; - config.eventJq = {}; - config.eventTimeout = {}; - config.eventOccurrence = {}; - - $.each($.jPlayer.event, function(eventName,eventType) { - config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i; - config.eventOccurrence[eventType] = 0; - }); - - var structure = - '

    ' + (config.visible ? "Hide" : "Show") + ' jPlayer Inspector

    ' - + '
    ' - + '
    ' - + '
    ' - + '

    jPlayer events that have occurred over the past 1 second:' - + '
    (Backgrounds: Never occurred Occurred before Occurred Multiple occurrences reset)

    '; - - // MJP: Would use the next 3 lines for ease, but the events are just slapped on the page. - // $.each($.jPlayer.event, function(eventName,eventType) { - // structure += '
    ' + eventName + '
    '; - // }); - - var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;"; - // MJP: Doing it longhand so order and layout easier to control. - structure += - '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - - + '
    ' - + '
    ' - + '
    ' - + '
    ' - - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - - + '
    ' - + '
    ' - + '
    ' - + '
    ' - - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - + '
    ' - - + '
    '; - - // MJP: Would like a check here in case we missed an event. - - // MJP: Check fails, since it is not on the page yet. -/* $.each($.jPlayer.event, function(eventName,eventType) { - if($("#" + config.eventId[eventType])[0] === undefined) { - structure += '
    ' + eventName + '
    '; - } - }); -*/ - structure += - '
    ' - + '

    Update jPlayer Inspector

    ' - + '
    ' - + '
    '; - $(this).html(structure); - - config.windowJq = $("#" + config.windowId); - config.statusJq = $("#" + config.statusId); - config.configJq = $("#" + config.configId); - config.toggleJq = $("#" + config.toggleId); - config.eventResetJq = $("#" + config.eventResetId); - config.updateJq = $("#" + config.updateId); - - $.each($.jPlayer.event, function(eventName,eventType) { - config.eventJq[eventType] = $("#" + config.eventId[eventType]); - config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0); - - config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) { - config.eventOccurrence[e.type]++; - if(config.eventOccurrence[e.type] > 1) { - config.eventJq[e.type].css("background-color","#ff9"); - } else { - config.eventJq[e.type].css("background-color","#9f9"); - } - config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")"); - // The timer to handle the color - clearTimeout(config.eventTimeout[e.type]); - config.eventTimeout[e.type] = setTimeout(function() { - config.eventJq[e.type].css("background-color","#fff"); - }, 1000); - // The timer to handle the occurences. - setTimeout(function() { - config.eventOccurrence[e.type]--; - config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")"); - }, 1000); - if(config.visible) { // Update the status, if inspector open. - $this.jPlayerInspector("updateStatus"); - } - }); - }); - - config.jPlayer.bind($.jPlayer.event.ready + ".jPlayerInspector", function(e) { - $this.jPlayerInspector("updateConfig"); - }); - - config.toggleJq.click(function() { - if(config.visible) { - $(this).text("Show"); - config.windowJq.hide(); - config.statusJq.empty(); - config.configJq.empty(); - } else { - $(this).text("Hide"); - config.windowJq.show(); - config.updateJq.click(); - } - config.visible = !config.visible; - $(this).blur(); - return false; - }); - - config.eventResetJq.click(function() { - $.each($.jPlayer.event, function(eventName,eventType) { - config.eventJq[eventType].css("background-color","#eee"); - }); - $(this).blur(); - return false; - }); - - config.updateJq.click(function() { - $this.jPlayerInspector("updateStatus"); - $this.jPlayerInspector("updateConfig"); - return false; - }); - - if(!config.visible) { - config.windowJq.hide(); - } else { - // config.updateJq.click(); - } - - $.jPlayerInspector.i++; - - return this; - }, - destroy: function() { - $(this).data("jPlayerInspector") && $(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector"); - $(this).empty(); - }, - updateConfig: function() { // This displays information about jPlayer's configuration in inspector - - var jPlayerInfo = "

    This jPlayer instance is running in your browser where:
    " - - for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) { - var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i]; - jPlayerInfo += " jPlayer's " + solution + " solution is"; - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) { - jPlayerInfo += " being used and will support:"; - for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) { - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) { - jPlayerInfo += " " + format; - } - } - jPlayerInfo += "
    "; - } else { - jPlayerInfo += " not required
    "; - } - } - jPlayerInfo += "

    "; - - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active) { - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) { - jPlayerInfo += "Problem with jPlayer since both HTML5 and Flash are active."; - } else { - jPlayerInfo += "The HTML5 is active."; - } - } else { - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) { - jPlayerInfo += "The Flash is active."; - } else { - jPlayerInfo += "No solution is currently active. jPlayer needs a setMedia()."; - } - } - jPlayerInfo += "

    "; - - var formatType = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType; - jPlayerInfo += "

    status.formatType = '" + formatType + "'
    "; - if(formatType) { - jPlayerInfo += "Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')"; - } else { - jPlayerInfo += "

    "; - } - - jPlayerInfo += "

    status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'

    "; - - jPlayerInfo += "

    status.media = {
    "; - for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) { - jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "
    "; // Some are strings - } - jPlayerInfo += "};

    " - - + "

    Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
    "; - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) { - jPlayerInfo += "htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"
    " - } - if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) { - jPlayerInfo += "htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +""; - } - jPlayerInfo += "

    "; - - jPlayerInfo += "

    This instance is using the constructor options:
    " - + "$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({
    " - - + " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',
    " - - + " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',
    " - - + " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',
    " - - + " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',
    " - - + " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",
    " - - + " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",
    " - - + " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',
    " - - + " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',
    " - - + " cssSelector: {"; - - var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector"); - for(prop in cssSelector) { - - // jPlayerInfo += "
      " + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys. - jPlayerInfo += "
      " + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "'," - } - - jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me. - - jPlayerInfo += "
     },
    " - - + " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",
    " - - + " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "
    " - - + "});

    "; - $(this).data("jPlayerInspector").configJq.html(jPlayerInfo); - return this; - }, - updateStatus: function() { // This displays information about jPlayer's status in the inspector - $(this).data("jPlayerInspector").statusJq.html( - "

    jPlayer is " + - ($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") + - " at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." + - " (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" + - ", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" + - ", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" + - ", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)

    " - ); - return this; - } - }; - $.fn.jPlayerInspector = function( method ) { - // Method calling logic - if ( methods[method] ) { - return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); - } else if ( typeof method === 'object' || ! method ) { - return methods.init.apply( this, arguments ); - } else { - $.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' ); - } - }; -})(jQuery); +/* + * jPlayerInspector Plugin for jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2014 Happyworm Ltd + * Licensed under the MIT license. + * http://www.opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 1.0.5 + * Date: 1st April 2014 + * + * For use with jPlayer Version: 2.6.0+ + * + * Note: Declare inspector instances after jPlayer instances. ie., Otherwise the jPlayer instance is nonsense. + */ + +(function($, undefined) { + $.jPlayerInspector = {}; + $.jPlayerInspector.i = 0; + $.jPlayerInspector.defaults = { + jPlayer: undefined, // The jQuery selector of the jPlayer instance to inspect. + idPrefix: "jplayer_inspector_", + visible: false + }; + + var methods = { + init: function(options) { + var self = this; + var $this = $(this); + + var config = $.extend({}, $.jPlayerInspector.defaults, options); + $(this).data("jPlayerInspector", config); + + config.id = $(this).attr("id"); + config.jPlayerId = config.jPlayer.attr("id"); + + config.windowId = config.idPrefix + "window_" + $.jPlayerInspector.i; + config.statusId = config.idPrefix + "status_" + $.jPlayerInspector.i; + config.configId = config.idPrefix + "config_" + $.jPlayerInspector.i; + config.toggleId = config.idPrefix + "toggle_" + $.jPlayerInspector.i; + config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i; + config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i; + config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i; + + config.eventId = {}; + config.eventJq = {}; + config.eventTimeout = {}; + config.eventOccurrence = {}; + + $.each($.jPlayer.event, function(eventName,eventType) { + config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i; + config.eventOccurrence[eventType] = 0; + }); + + var structure = + '

    ' + (config.visible ? "Hide" : "Show") + ' jPlayer Inspector

    ' + + '
    ' + + '
    ' + + '
    ' + + '

    jPlayer events that have occurred over the past 1 second:' + + '
    (Backgrounds: Never occurred Occurred before Occurred Multiple occurrences reset)

    '; + + // MJP: Would use the next 3 lines for ease, but the events are just slapped on the page. + // $.each($.jPlayer.event, function(eventName,eventType) { + // structure += '
    ' + eventName + '
    '; + // }); + + var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;"; + // MJP: Doing it longhand so order and layout easier to control. + structure += + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + + '
    '; + + // MJP: Would like a check here in case we missed an event. + + // MJP: Check fails, since it is not on the page yet. +/* $.each($.jPlayer.event, function(eventName,eventType) { + if($("#" + config.eventId[eventType])[0] === undefined) { + structure += '
    ' + eventName + '
    '; + } + }); +*/ + structure += + '
    ' + + '

    Update jPlayer Inspector

    ' + + '
    ' + + '
    '; + $(this).html(structure); + + config.windowJq = $("#" + config.windowId); + config.statusJq = $("#" + config.statusId); + config.configJq = $("#" + config.configId); + config.toggleJq = $("#" + config.toggleId); + config.eventResetJq = $("#" + config.eventResetId); + config.updateJq = $("#" + config.updateId); + + $.each($.jPlayer.event, function(eventName,eventType) { + config.eventJq[eventType] = $("#" + config.eventId[eventType]); + config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0); + + config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) { + config.eventOccurrence[e.type]++; + if(config.eventOccurrence[e.type] > 1) { + config.eventJq[e.type].css("background-color","#ff9"); + } else { + config.eventJq[e.type].css("background-color","#9f9"); + } + config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")"); + // The timer to handle the color + clearTimeout(config.eventTimeout[e.type]); + config.eventTimeout[e.type] = setTimeout(function() { + config.eventJq[e.type].css("background-color","#fff"); + }, 1000); + // The timer to handle the occurences. + setTimeout(function() { + config.eventOccurrence[e.type]--; + config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")"); + }, 1000); + if(config.visible) { // Update the status, if inspector open. + $this.jPlayerInspector("updateStatus"); + } + }); + }); + + config.jPlayer.bind($.jPlayer.event.ready + ".jPlayerInspector", function(e) { + $this.jPlayerInspector("updateConfig"); + }); + + config.toggleJq.click(function() { + if(config.visible) { + $(this).text("Show"); + config.windowJq.hide(); + config.statusJq.empty(); + config.configJq.empty(); + } else { + $(this).text("Hide"); + config.windowJq.show(); + config.updateJq.click(); + } + config.visible = !config.visible; + $(this).blur(); + return false; + }); + + config.eventResetJq.click(function() { + $.each($.jPlayer.event, function(eventName,eventType) { + config.eventJq[eventType].css("background-color","#eee"); + }); + $(this).blur(); + return false; + }); + + config.updateJq.click(function() { + $this.jPlayerInspector("updateStatus"); + $this.jPlayerInspector("updateConfig"); + return false; + }); + + if(!config.visible) { + config.windowJq.hide(); + } else { + // config.updateJq.click(); + } + + $.jPlayerInspector.i++; + + return this; + }, + destroy: function() { + $(this).data("jPlayerInspector") && $(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector"); + $(this).empty(); + }, + updateConfig: function() { // This displays information about jPlayer's configuration in inspector + + var jPlayerInfo = "

    This jPlayer instance is running in your browser where:
    " + + for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) { + var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i]; + jPlayerInfo += " jPlayer's " + solution + " solution is"; + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) { + jPlayerInfo += " being used and will support:"; + for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) { + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) { + jPlayerInfo += " " + format; + } + } + jPlayerInfo += "
    "; + } else { + jPlayerInfo += " not required
    "; + } + } + jPlayerInfo += "

    "; + + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active) { + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) { + jPlayerInfo += "Problem with jPlayer since both HTML5 and Flash are active."; + } else { + jPlayerInfo += "The HTML5 is active."; + } + } else { + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) { + jPlayerInfo += "The Flash is active."; + } else { + jPlayerInfo += "No solution is currently active. jPlayer needs a setMedia()."; + } + } + jPlayerInfo += "

    "; + + var formatType = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType; + jPlayerInfo += "

    status.formatType = '" + formatType + "'
    "; + if(formatType) { + jPlayerInfo += "Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')"; + } else { + jPlayerInfo += "

    "; + } + + jPlayerInfo += "

    status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'

    "; + + jPlayerInfo += "

    status.media = {
    "; + for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) { + jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "
    "; // Some are strings + } + jPlayerInfo += "};

    " + + jPlayerInfo += "

    "; + jPlayerInfo += "status.videoWidth = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoWidth + "'"; + jPlayerInfo += " | status.videoHeight = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoHeight + "'"; + jPlayerInfo += "
    status.width = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.width + "'"; + jPlayerInfo += " | status.height = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.height + "'"; + jPlayerInfo += "

    "; + + + "

    Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
    "; + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) { + jPlayerInfo += "htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"
    " + } + if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) { + jPlayerInfo += "htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +""; + } + jPlayerInfo += "

    "; + + jPlayerInfo += "

    This instance is using the constructor options:
    " + + "$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({
    " + + + " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',
    " + + + " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',
    " + + + " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',
    " + + + " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',
    " + + + " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",
    " + + + " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",
    " + + + " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',
    " + + + " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',
    " + + + " cssSelector: {"; + + var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector"); + for(prop in cssSelector) { + + // jPlayerInfo += "
      " + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys. + jPlayerInfo += "
      " + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "'," + } + + jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me. + + jPlayerInfo += "
     },
    " + + + " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",
    " + + + " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "
    " + + + "});

    "; + $(this).data("jPlayerInspector").configJq.html(jPlayerInfo); + return this; + }, + updateStatus: function() { // This displays information about jPlayer's status in the inspector + $(this).data("jPlayerInspector").statusJq.html( + "

    jPlayer is " + + ($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") + + " at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." + + " (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" + + ", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" + + ", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" + + ", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)

    " + ); + return this; + } + }; + $.fn.jPlayerInspector = function( method ) { + // Method calling logic + if ( methods[method] ) { + return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' ); + } + }; +})(jQuery); diff --git a/res/js/ext/jquery.jplayer.js b/res/js/ext/jquery.jplayer.js index 0aea04da..842f31b6 100644 --- a/res/js/ext/jquery.jplayer.js +++ b/res/js/ext/jquery.jplayer.js @@ -7,16 +7,12 @@ * http://opensource.org/licenses/MIT * * Author: Mark J Panaghiston - * Version: 2.7.1 - * Date: 19th September 2014 + * Version: 2.9.2 + * Date: 14th December 2014 */ -/* Code verified using http://www.jshint.com/ */ -/*jshint asi:false, bitwise:false, boss:false, browser:true, curly:true, debug:false, eqeqeq:true, eqnull:false, evil:false, forin:false, immed:false, jquery:true, laxbreak:false, newcap:true, noarg:true, noempty:true, nonew:true, onevar:false, passfail:false, plusplus:false, regexp:false, undef:true, sub:false, strict:false, white:false, smarttabs:true */ -/*global define:false, ActiveXObject:false, alert:false */ - /* Support for Zepto 1.0 compiled with optional data module. - * For AMD support, you will need to manually switch the 2 lines in the code below. + * For AMD or NODE/CommonJS support, you will need to manually switch the related 2 lines in the code below. * Search terms: "jQuery Switch" and "Zepto Switch" */ @@ -25,6 +21,10 @@ // AMD. Register as an anonymous module. define(['jquery'], factory); // jQuery Switch // define(['zepto'], factory); // Zepto Switch + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); // jQuery Switch + //factory(require('zepto')); // Zepto Switch } else { // Browser globals if(root.jQuery) { // Use jQuery if available @@ -175,6 +175,7 @@ ]; $.jPlayer.pause = function() { + $.jPlayer.prototype.destroyRemoved(); $.each($.jPlayer.prototype.instances, function(i, element) { if(element.data("jPlayer").status.srcSet) { // Check that media is set otherwise would cause error event. element.jPlayer("pause"); @@ -353,13 +354,22 @@ 'webkitExitFullscreen', '', '' + ], + ms: [ + '', + 'msFullscreenElement', + 'msRequestFullscreen', + 'msExitFullscreen', + 'MSFullscreenChange', + 'MSFullscreenError' ] }, specOrder = [ 'w3c', 'moz', 'webkit', - 'webkitVideo' + 'webkitVideo', + 'ms' ], fs, i, il; @@ -368,7 +378,8 @@ w3c: !!d[spec.w3c[0]], moz: !!d[spec.moz[0]], webkit: typeof d[spec.webkit[3]] === 'function', - webkitVideo: typeof v[spec.webkitVideo[2]] === 'function' + webkitVideo: typeof v[spec.webkitVideo[2]] === 'function', + ms: typeof v[spec.ms[2]] === 'function' }, used: {} }; @@ -392,7 +403,7 @@ return elem[s[1]]; }, requestFullscreen: function(elem) { - return elem[s[2]](); + return elem[s[2]](); // Chrome and Opera want parameter (Element.ALLOW_KEYBOARD_INPUT) but Safari fails if flag used. }, exitFullscreen: function(elem) { elem = elem ? elem : d; // Video element required for webkitVideo @@ -423,38 +434,33 @@ // The current jPlayer instance in focus. $.jPlayer.focus = null; - // (fallback) The list of element node names to ignore with key controls. + // The list of element node names to ignore with key controls. $.jPlayer.keyIgnoreElementNames = "A INPUT TEXTAREA SELECT BUTTON"; // The function that deals with key presses. var keyBindings = function(event) { - var f = $.jPlayer.focus, - pageFocus = document.activeElement, ignoreKey; // A jPlayer instance must be in focus. ie., keyEnabled and the last one played. if(f) { // What generated the key press? - if(typeof pageFocus !== 'undefined') { - if(pageFocus !== null && pageFocus.nodeName.toUpperCase() !== "BODY") { + $.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) { + // The strings should already be uppercase. + if(event.target.nodeName.toUpperCase() === name.toUpperCase()) { ignoreKey = true; + return false; // exit each. } - } else { - // Fallback for no document.activeElement support. - $.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) { - // The strings should already be uppercase. - if(event.target.nodeName.toUpperCase() === name.toUpperCase()) { - ignoreKey = true; - return false; // exit each. - } - }); - } + }); if(!ignoreKey) { // See if the key pressed matches any of the bindings. $.each(f.options.keyBindings, function(action, binding) { // The binding could be a null when the default has been disabled. ie., 1st clause in if() - if(binding && event.which === binding.key && $.isFunction(binding.fn)) { + if( + (binding && $.isFunction(binding.fn)) && + ((typeof binding.key === 'number' && event.which === binding.key) || + (typeof binding.key === 'string' && event.key === binding.key)) + ) { event.preventDefault(); // Key being used by jPlayer, so prevent default operation. binding.fn(f); return false; // exit each. @@ -479,14 +485,15 @@ $.jPlayer.prototype = { count: 0, // Static Variable: Change it via prototype. version: { // Static Object - script: "2.7.1", - needFlash: "2.7.0", + script: "2.9.2", + needFlash: "2.9.0", flash: "unknown" }, options: { // Instanced in $.jPlayer() constructor - swfPath: "js", // Path to Jplayer.swf. Can be relative, absolute or server root relative. - solution: "html, flash", // Valid solutions: html, flash. Order defines priority. 1st is highest, + swfPath: "js", // Path to jquery.jplayer.swf. Can be relative, absolute or server root relative. + solution: "html, flash", // Valid solutions: html, flash, aurora. Order defines priority. 1st is highest, supplied: "mp3", // Defines which formats jPlayer will try and support and the priority by the order. 1st is highest, + auroraFormats: "wav", // List the aurora.js codecs being loaded externally. Its core supports "wav". Specify format in jPlayer context. EG., The aac.js codec gives the "m4a" format. preload: 'metadata', // HTML5 Spec values: none, metadata, auto. volume: 0.8, // The volume. Number 0 to 1. muted: false, @@ -529,7 +536,8 @@ seeking: "jp-state-seeking", muted: "jp-state-muted", looped: "jp-state-looped", - fullScreen: "jp-state-full-screen" + fullScreen: "jp-state-full-screen", + noVolume: "jp-state-no-volume" }, useStateClassSkin: false, // A state class skin relies on the state classes to change the visual appearance. The single control toggles the effect, for example: play then pause, mute then unmute. autoBlur: true, // GUI control handlers will drop focus after clicks. @@ -563,7 +571,7 @@ iphone: /iphone/, ipod: /ipod/, android_pad: /android [0-3]\.(?!.*?mobile)/, - android_phone: /android.*?mobile/, + android_phone: /(?=.*android)(?!.*chrome)(?=.*mobile)/, blackberry: /blackberry/, windows_ce: /windows ce/, iemobile: /iemobile/, @@ -591,7 +599,7 @@ // The parameter, f = $.jPlayer.focus, will be checked truethy before attempting to call any of these functions. // Properties may be added to this object, in key/fn pairs, to enable other key controls. EG, for the playlist add-on. play: { - key: 32, // space + key: 80, // p fn: function(f) { if(f.status.paused) { f.play(); @@ -601,7 +609,7 @@ } }, fullScreen: { - key: 13, // enter + key: 70, // f fn: function(f) { if(f.status.video || f.options.audioFullScreen) { f._setOption("fullScreen", !f.options.fullScreen); @@ -609,22 +617,28 @@ } }, muted: { - key: 8, // backspace + key: 77, // m fn: function(f) { f._muted(!f.options.muted); } }, volumeUp: { - key: 38, // UP + key: 190, // . fn: function(f) { f.volume(f.options.volume + 0.1); } }, volumeDown: { - key: 40, // DOWN + key: 188, // , fn: function(f) { f.volume(f.options.volume - 0.1); } + }, + loop: { + key: 76, // l + fn: function(f) { + f._loop(!f.options.loop); + } } }, verticalVolume: false, // Calculate volume from the bottom of the volume bar. Default is from the left. Also volume affects either width or height. @@ -702,10 +716,12 @@ // domNode: undefined // htmlDlyCmdId: undefined // autohideId: undefined + // mouse: undefined // cmdsIgnored }, solution: { // Static Object: Defines the solutions built in jPlayer. html: true, + aurora: true, flash: true }, // 'MPEG-4 support' : canPlayType('video/mp4; codecs="mp4v.20.8"') @@ -836,6 +852,9 @@ this.html = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. this.html.audio = {}; this.html.video = {}; + this.aurora = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. + this.aurora.formats = []; + this.aurora.properties = []; this.flash = {}; // In _init()'s this.desired code and setmedia(): Accessed via this[solution], where solution from this.solutions array. this.css = {}; @@ -879,6 +898,23 @@ } } }); + + // Create Aurora.js formats array + $.each(this.options.auroraFormats.toLowerCase().split(","), function(index1, value1) { + var format = value1.replace(/^\s+|\s+$/g, ""); //trim + if(self.format[format]) { // Check format is valid. + var dupFound = false; + $.each(self.aurora.formats, function(index2, value2) { // Check for duplicates + if(format === value2) { + dupFound = true; + return false; + } + }); + if(!dupFound) { + self.aurora.formats.push(format); + } + } + }); this.internal.instance = "jp_" + this.count; this.instances[this.internal.instance] = this.element; @@ -903,7 +939,7 @@ this.internal.flash = $.extend({}, { id: this.options.idPrefix + "_flash_" + this.count, jq: undefined, - swf: this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? (this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "Jplayer.swf" : "") + swf: this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? (this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "") + "jquery.jplayer.swf" : "") }); this.internal.poster = $.extend({}, { id: this.options.idPrefix + "_poster_" + this.count, @@ -985,12 +1021,15 @@ this.flash.available = this._checkForFlash(10.1); this.html.canPlay = {}; + this.aurora.canPlay = {}; this.flash.canPlay = {}; $.each(this.formats, function(priority, format) { self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec); + self.aurora.canPlay[format] = ($.inArray(format, self.aurora.formats) > -1); self.flash.canPlay[format] = self.format[format].flashCanPlay && self.flash.available; }); this.html.desired = false; + this.aurora.desired = false; this.flash.desired = false; $.each(this.solutions, function(solutionPriority, solution) { if(solutionPriority === 0) { @@ -1012,13 +1051,16 @@ }); // This is what jPlayer will support, based on solution and supplied. this.html.support = {}; + this.aurora.support = {}; this.flash.support = {}; $.each(this.formats, function(priority, format) { self.html.support[format] = self.html.canPlay[format] && self.html.desired; + self.aurora.support[format] = self.aurora.canPlay[format] && self.aurora.desired; self.flash.support[format] = self.flash.canPlay[format] && self.flash.desired; }); // If jPlayer is supporting any format in a solution, then the solution is used. this.html.used = false; + this.aurora.used = false; this.flash.used = false; $.each(this.solutions, function(solutionPriority, solution) { $.each(self.formats, function(formatPriority, format) { @@ -1036,8 +1078,8 @@ // Set up the css selectors for the control and feedback entities. this._cssSelectorAncestor(this.options.cssSelectorAncestor); - // If neither html nor flash are being used by this browser, then media playback is not possible. Trigger an error event. - if(!(this.html.used || this.flash.used)) { + // If neither html nor aurora nor flash are being used by this browser, then media playback is not possible. Trigger an error event. + if(!(this.html.used || this.aurora.used || this.flash.used)) { this._error( { type: $.jPlayer.error.NO_SOLUTION, context: "{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}", @@ -1137,13 +1179,18 @@ }); } } + + // Add the Aurora.js solution if being used. + if(this.aurora.used) { + // Aurora.js player need to be created for each media, see setMedia function. + } // Create the bridge that emulates the HTML Media element on the jPlayer DIV if( this.options.emulateHtml ) { this._emulateHtmlBridge(); } - if(this.html.used && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms. + if((this.html.used || this.aurora.used) && !this.flash.used) { // If only HTML, then emulate flash ready() call after 100ms. setTimeout( function() { self.internal.ready = true; self.version.flash = "n/a"; @@ -1204,6 +1251,17 @@ delete this.instances[this.internal.instance]; // Clear the instance on the static instance object }, + destroyRemoved: function() { // Destroy any instances that have gone away. + var self = this; + $.each(this.instances, function(i, element) { + if(self.element !== element) { // Do not destroy this instance. + if(!element.data("jPlayer")) { // Check that element is a real jPlayer. + element.jPlayer("destroy"); + delete self.instances[i]; + } + } + }); + }, enable: function() { // Plan to implement // options.disabled = false }, @@ -1440,6 +1498,77 @@ }, false); }); }, + _addAuroraEventListeners : function(player, entity) { + var self = this; + //player.preload = this.options.preload; + //player.muted = this.options.muted; + player.volume = this.options.volume * 100; + + // Create the event listeners + // Only want the active entity to affect jPlayer and bubble events. + // Using entity.gate so that object is referenced and gate property always current + + player.on("progress", function() { + if(entity.gate) { + if(self.internal.cmdsIgnored && this.readyState > 0) { // Detect iOS executed the command + self.internal.cmdsIgnored = false; + } + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.progress); + // Progress with song duration, we estimate timeupdate need to be triggered too. + if (player.duration > 0) { + self._trigger($.jPlayer.event.timeupdate); + } + } + }, false); + player.on("ready", function() { + if(entity.gate) { + self._trigger($.jPlayer.event.loadeddata); + } + }, false); + player.on("duration", function() { + if(entity.gate) { + self._getAuroraStatus(player); + self._updateInterface(); + self._trigger($.jPlayer.event.durationchange); + } + }, false); + player.on("end", function() { + if(entity.gate) { + // Order of the next few commands are important. Change the time and then pause. + self._updateButtons(false); + self._getAuroraStatus(player, true); + self._updateInterface(); + self._trigger($.jPlayer.event.ended); + } + }, false); + player.on("error", function() { + if(entity.gate) { + self._updateButtons(false); + self._seeked(); + if(self.status.srcSet) { // Deals with case of clearMedia() causing an error event. + self.status.waitForLoad = true; // Allows the load operation to try again. + self.status.waitForPlay = true; // Reset since a play was captured. + if(self.status.video && !self.status.nativeVideoControls) { + self.internal.video.jq.css({'width':'0px', 'height':'0px'}); + } + if(self._validString(self.status.media.poster) && !self.status.nativeVideoControls) { + self.internal.poster.jq.show(); + } + if(self.css.jq.videoPlay.length) { + self.css.jq.videoPlay.show(); + } + self._error( { + type: $.jPlayer.error.URL, + context: self.status.src, // this.src shows absolute urls. Want context to show the url given. + message: $.jPlayer.errorMsg.URL, + hint: $.jPlayer.errorHint.URL + }); + } + } + }, false); + }, _getHtmlStatus: function(media, override) { var ct = 0, cpa = 0, sp = 0, cpr = 0; @@ -1480,6 +1609,39 @@ this.status.playbackRate = media.playbackRate; this.status.ended = media.ended; }, + _getAuroraStatus: function(player, override) { + var ct = 0, cpa = 0, sp = 0, cpr = 0; + + this.status.duration = player.duration / 1000; + + ct = player.currentTime / 1000; + cpa = (this.status.duration > 0) ? 100 * ct / this.status.duration : 0; + if(player.buffered > 0) { + sp = (this.status.duration > 0) ? (player.buffered * this.status.duration) / this.status.duration : 100; + cpr = (this.status.duration > 0) ? ct / (player.buffered * this.status.duration) : 0; + } else { + sp = 100; + cpr = cpa; + } + + if(override) { + ct = 0; + cpr = 0; + cpa = 0; + } + + this.status.seekPercent = sp; + this.status.currentPercentRelative = cpr; + this.status.currentPercentAbsolute = cpa; + this.status.currentTime = ct; + + this.status.remaining = this.status.duration - this.status.currentTime; + + this.status.readyState = 4; // status.readyState; + this.status.networkState = 0; // status.networkState; + this.status.playbackRate = 1; // status.playbackRate; + this.status.ended = false; // status.ended; + }, _resetStatus: function() { this.status = $.extend({}, this.status, $.jPlayer.prototype.status); // Maintains the status properties that persist through a reset. }, @@ -1490,6 +1652,7 @@ event.jPlayer.options = $.extend(true, {}, this.options); // Deep copy event.jPlayer.status = $.extend(true, {}, this.status); // Deep copy event.jPlayer.html = $.extend(true, {}, this.html); // Deep copy + event.jPlayer.aurora = $.extend(true, {}, this.aurora); // Deep copy event.jPlayer.flash = $.extend(true, {}, this.flash); // Deep copy if(error) { event.jPlayer.error = $.extend({}, error); @@ -1744,10 +1907,12 @@ _resetGate: function() { this.html.audio.gate = false; this.html.video.gate = false; + this.aurora.gate = false; this.flash.gate = false; }, _resetActive: function() { this.html.active = false; + this.aurora.active = false; this.flash.active = false; }, _escapeHtml: function(s) { @@ -1761,7 +1926,7 @@ _absoluteMediaUrls: function(media) { var self = this; $.each(media, function(type, url) { - if(url && self.format[type]) { + if(url && self.format[type] && url.substr(0, 5) !== "data:") { media[type] = self._qualifyURL(url); } }); @@ -1806,6 +1971,7 @@ $.each(self.solutions, function(solutionPriority, solution) { if(self[solution].support[format] && self._validString(media[format])) { // Format supported in solution and url given for format. var isHtml = solution === 'html'; + var isAurora = solution === 'aurora'; if(isVideo) { if(isHtml) { @@ -1831,6 +1997,10 @@ if($.jPlayer.platform.android) { self.androidFix.setMedia = true; } + } else if(isAurora) { + self.aurora.gate = true; + self._aurora_setAudio(media); + self.aurora.active = true; } else { self.flash.gate = true; self._flash_setAudio(media); @@ -1864,15 +2034,15 @@ } } } - if(this.css.jq.title.length) { - if(typeof media.title === 'string') { + if(typeof media.title === 'string') { + if(this.css.jq.title.length) { this.css.jq.title.html(media.title); - if(this.htmlElement.audio) { - this.htmlElement.audio.setAttribute('title', media.title); - } - if(this.htmlElement.video) { - this.htmlElement.video.setAttribute('title', media.title); - } + } + if(this.htmlElement.audio) { + this.htmlElement.audio.setAttribute('title', media.title); + } + if(this.htmlElement.video) { + this.htmlElement.video.setAttribute('title', media.title); } } this.status.srcSet = true; @@ -1901,6 +2071,8 @@ if(this.html.active) { this._html_resetMedia(); + } else if(this.aurora.active) { + this._aurora_resetMedia(); } else if(this.flash.active) { this._flash_resetMedia(); } @@ -1910,6 +2082,8 @@ if(this.html.active) { this._html_clearMedia(); + } else if(this.aurora.active) { + this._aurora_clearMedia(); } else if(this.flash.active) { this._flash_clearMedia(); } @@ -1921,6 +2095,8 @@ if(this.status.srcSet) { if(this.html.active) { this._html_load(); + } else if(this.aurora.active) { + this._aurora_load(); } else if(this.flash.active) { this._flash_load(); } @@ -1943,6 +2119,8 @@ this.focus(); if(this.html.active) { this._html_play(time); + } else if(this.aurora.active) { + this._aurora_play(time); } else if(this.flash.active) { this._flash_play(time); } @@ -1959,6 +2137,8 @@ if(this.status.srcSet) { if(this.html.active) { this._html_pause(time); + } else if(this.aurora.active) { + this._aurora_pause(time); } else if(this.flash.active) { this._flash_pause(time); } @@ -1978,6 +2158,7 @@ args.splice(1, 1); // Remove the conditions from the arguments } + $.jPlayer.prototype.destroyRemoved(); $.each(this.instances, function() { // Remember that "this" is the instance's "element" in the $.each() loop. if(self.element !== this) { // Do not tell my instance. @@ -1997,6 +2178,8 @@ if(this.status.srcSet) { if(this.html.active) { this._html_pause(0); + } else if(this.aurora.active) { + this._aurora_pause(0); } else if(this.flash.active) { this._flash_pause(0); } @@ -2009,6 +2192,8 @@ if(this.status.srcSet) { if(this.html.active) { this._html_playHead(p); + } else if(this.aurora.active) { + this._aurora_playHead(p); } else if(this.flash.active) { this._flash_playHead(p); } @@ -2030,6 +2215,9 @@ if(this.html.used) { this._html_setProperty('muted', muted); } + if(this.aurora.used) { + this._aurora_mute(muted); + } if(this.flash.used) { this._flash_mute(muted); } @@ -2092,6 +2280,9 @@ if(this.html.used) { this._html_setProperty('volume', v); } + if(this.aurora.used) { + this._aurora_volume(v); + } if(this.flash.used) { this._flash_volume(v); } @@ -2128,6 +2319,7 @@ v = this.options.muted ? 0 : v; if(this.status.noVolume) { + this.addStateClass('noVolume'); if(this.css.jq.volumeBar.length) { this.css.jq.volumeBar.hide(); } @@ -2138,6 +2330,7 @@ this.css.jq.volumeMax.hide(); } } else { + this.removeStateClass('noVolume'); if(this.css.jq.volumeBar.length) { this.css.jq.volumeBar.show(); } @@ -2203,6 +2396,8 @@ self[fn](e); if(self.options.autoBlur) { $(this).blur(); + } else { + $(this).focus(); // Force focus for ARIA. } }; this.css.jq[fn].bind("click.jPlayer", handler); // Using jPlayer namespace @@ -2577,13 +2772,31 @@ event = "mousemove.jPlayer", namespace = ".jPlayerAutohide", eventType = event + namespace, - handler = function() { - self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() { - clearTimeout(self.internal.autohideId); - self.internal.autohideId = setTimeout( function() { - self.css.jq.gui.fadeOut(self.options.autohide.fadeOut); - }, self.options.autohide.hold); - }); + handler = function(event) { + var moved = false, + deltaX, deltaY; + if(typeof self.internal.mouse !== "undefined") { + //get the change from last position to this position + deltaX = self.internal.mouse.x - event.pageX; + deltaY = self.internal.mouse.y - event.pageY; + moved = (Math.floor(deltaX) > 0) || (Math.floor(deltaY)>0); + } else { + moved = true; + } + // store current position for next method execution + self.internal.mouse = { + x : event.pageX, + y : event.pageY + }; + // if mouse has been actually moved, do the gui fadeIn/fadeOut + if (moved) { + self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() { + clearTimeout(self.internal.autohideId); + self.internal.autohideId = setTimeout( function() { + self.css.jq.gui.fadeOut(self.options.autohide.fadeOut); + }, self.options.autohide.hold); + }); + } }; if(this.css.jq.gui.length) { @@ -2594,6 +2807,8 @@ // Removes the fadeOut operation from the fadeIn callback. clearTimeout(this.internal.autohideId); + // undefine mouse + delete this.internal.mouse; this.element.unbind(namespace); this.css.jq.gui.unbind(namespace); @@ -2879,6 +3094,99 @@ this.htmlElement.video[property] = value; } }, + _aurora_setAudio: function(media) { + var self = this; + + // Always finds a format due to checks in setMedia() + $.each(this.formats, function(priority, format) { + if(self.aurora.support[format] && media[format]) { + self.status.src = media[format]; + self.status.format[format] = true; + self.status.formatType = format; + + return false; + } + }); + + this.aurora.player = new AV.Player.fromURL(this.status.src); + this._addAuroraEventListeners(this.aurora.player, this.aurora); + + if(this.options.preload === 'auto') { + this._aurora_load(); + this.status.waitForLoad = false; + } + }, + _aurora_resetMedia: function() { + if (this.aurora.player) { + this.aurora.player.stop(); + } + }, + _aurora_clearMedia: function() { + // Nothing to clear. + }, + _aurora_load: function() { + if(this.status.waitForLoad) { + this.status.waitForLoad = false; + this.aurora.player.preload(); + } + }, + _aurora_play: function(time) { + if (!this.status.waitForLoad) { + if (!isNaN(time)) { + this.aurora.player.seek(time); + } + } + if (!this.aurora.player.playing) { + this.aurora.player.play(); + } + this.status.waitForLoad = false; + this._aurora_checkWaitForPlay(); + + // No event from the player, update UI now. + this._updateButtons(true); + this._trigger($.jPlayer.event.play); + }, + _aurora_pause: function(time) { + if (!isNaN(time)) { + this.aurora.player.seek(time * 1000); + } + this.aurora.player.pause(); + + if(time > 0) { // Avoids a setMedia() followed by stop() or pause(0) hiding the video play button. + this._aurora_checkWaitForPlay(); + } + + // No event from the player, update UI now. + this._updateButtons(false); + this._trigger($.jPlayer.event.pause); + }, + _aurora_playHead: function(percent) { + if(this.aurora.player.duration > 0) { + // The seek() sould be in milliseconds, but the only codec that works with seek (aac.js) uses seconds. + this.aurora.player.seek(percent * this.aurora.player.duration / 100); // Using seconds + } + + if(!this.status.waitForLoad) { + this._aurora_checkWaitForPlay(); + } + }, + _aurora_checkWaitForPlay: function() { + if(this.status.waitForPlay) { + this.status.waitForPlay = false; + } + }, + _aurora_volume: function(v) { + this.aurora.player.volume = v * 100; + }, + _aurora_mute: function(m) { + if (m) { + this.aurora.properties.lastvolume = this.aurora.player.volume; + this.aurora.player.volume = 0; + } else { + this.aurora.player.volume = this.aurora.properties.lastvolume; + } + this.aurora.properties.muted = m; + }, _flash_setAudio: function(media) { var self = this; try { diff --git a/res/js/ext/jquery.jplayer.swf b/res/js/ext/jquery.jplayer.swf new file mode 100644 index 0000000000000000000000000000000000000000..340f7f98d0d363bafa787e2bcc7422e15fb7f41c GIT binary patch literal 13714 zcmZ{JV{9f2&~3Z5ZQHhO+qP|cYukEi+uGXR@~OGCecvzl-$imV{C6gqN#=-YsUfa9 zf`E8$wgtfW>y6(1Yz3rfMqN!zg}8B}?ENLDRt!duApxaoidHa%*aH34Mxc{HkFvp< zk{4EbgeVhC4nB-$3E29s;eJWdP2KIKHkw-c+9n&ZK*LYV4eUeYDhJL@L(PgcEfk#O2iy& z3+q_1kYMcFE5~Xn$==SB&4Wt|Y0mUXark^3z@+!Gk}7R$O9!o9wxhblhz!39Kf8x7 z3%fcPj_WBl-WKC*&F{t}q({|Hy6*98XURU8xHdmUpuo*o}EHc@Ak-&tqY zQKbKV_QaA|RgcO@5zMb!EKn{=lP z#auZl!)`V$PZcFiWg4ZAwOK%~a7qTTFkq(^yKH7Rgj= zie)l!b|2SPI&>z*i&#f#$`3J$p=tDBfHKHv8QXRHGl_5~PMk`&`>76InkMv?i)a^}heVtZB=p%n~- z-`C19+E_(n2O*48GS;3`V9d>=`3op85Z%Ub1agN>--H|e6+#%at5@3fTALy?f5c$d z-TA1JVB?myW{}E%h0h~AdX9=lABa=q2+)<8N#JU($FkW;s34F3MeVa>pPTx|%*!51 zQ#@aQ!te1?a15(z@_u2iDteoA?DPDK8en(!+S%7`rm#CGJ|C0e9psehm@GifP*cY3 zt0|oO7pjRg`Vu;sWBE?{p8q#n+JX%8`kHtVm&~bGbnRU6**ZRNi%^<84;JVAa_op| z<5xt0`|G5Ea@<1~9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>Ag5HL{0>|T z^8IS}qs&7T-9{^Sx@UQ)YcCtQ5$W%!>F1yh9E4QSpZG#@=IpEsdLd384muyM=uvV~U;K!kZ!K6zEj9(lnp&QYOX`A=E5^og{OYK|h5U9u-7B04%A9&o zXSjG>N4~hd-6;xm0LW62J1YfFFi(Z}DR@^g|%cOof`4iC{{NJrGnKN&{ zYwnMfsuiOPOM&*@nLl*gR zze?&Lr_TH$oN_~4UlxU#IF-|X=>R>!+B)~CNT8Qh>=<*JC#|O}I}&%&W;b&NrX>fa z9g~BY-WdHxy*3nmj-^mwP&2RWq7|I!YOa?0MhQ0%Jcd|Gd+F Kh=yOW5&svT>H|gq literal 0 HcmV?d00001 From b4fd2d17b11c2912fc39cf83a2d3a05a3b13dba1 Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Mon, 9 Oct 2017 11:13:32 +0000 Subject: [PATCH 10/11] recompiled js --- res/dist/cherrymusic.dist.js | 106 +++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/res/dist/cherrymusic.dist.js b/res/dist/cherrymusic.dist.js index 50477a01..ae1bbfaa 100644 --- a/res/dist/cherrymusic.dist.js +++ b/res/dist/cherrymusic.dist.js @@ -653,38 +653,38 @@ var _jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;} if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;} return jQuery;};if(!noGlobal){window.jQuery=window.$=jQuery;} -return jQuery;});;var JSON;if(!JSON){JSON={}}(function(){function f(a){return a<10?"0"+a:a}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];if(i&&typeof i==="object"&&typeof i.toJSON==="function"){i=i.toJSON(a)}if(typeof rep==="function"){i=rep.call(b,a,i)}switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i){return"null"}gap+=indent;h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c-1);self.flash.canPlay[format]=self.format[format].flashCanPlay&&self.flash.available;});this.html.desired=false;this.aurora.desired=false;this.flash.desired=false;$.each(this.solutions,function(solutionPriority,solution){if(solutionPriority===0){self[solution].desired=true;}else{var audioCanPlay=false;var videoCanPlay=false;$.each(self.formats,function(formatPriority,format){if(self[self.solutions[0]].canPlay[format]){if(self.format[format].media==='video'){videoCanPlay=true;}else{audioCanPlay=true;}}});self[solution].desired=(self.require.audio&&!audioCanPlay)||(self.require.video&&!videoCanPlay);}});this.html.support={};this.aurora.support={};this.flash.support={};$.each(this.formats,function(priority,format){self.html.support[format]=self.html.canPlay[format]&&self.html.desired;self.aurora.support[format]=self.aurora.canPlay[format]&&self.aurora.desired;self.flash.support[format]=self.flash.canPlay[format]&&self.flash.desired;});this.html.used=false;this.aurora.used=false;this.flash.used=false;$.each(this.solutions,function(solutionPriority,solution){$.each(self.formats,function(formatPriority,format){if(self[solution].support[format]){self[solution].used=true;return false;}});});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);if(!(this.html.used||this.aurora.used||this.flash.used)){this._error({type:$.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SOLUTION,hint:$.jPlayer.errorHint.NO_SOLUTION});if(this.css.jq.noSolution.length){this.css.jq.noSolution.show();}}else{if(this.css.jq.noSolution.length){this.css.jq.noSolution.hide();}} if(this.flash.used){var htmlObj,flashVars='jQuery='+encodeURI(this.options.noConflict)+'&id='+encodeURI(this.internal.self.id)+'&vol='+this.options.volume+'&muted='+this.options.muted;if($.jPlayer.browser.msie&&(Number($.jPlayer.browser.version)<9||$.jPlayer.browser.documentMode<9)){var objStr='';var paramStr=['','','','',''];htmlObj=document.createElement(objStr);for(var i=0;i0){self.internal.cmdsIgnored=false;} self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.progress);}},false);mediaElement.addEventListener("loadeddata",function(){if(entity.gate){self.androidFix.setMedia=false;if(self.androidFix.play){self.androidFix.play=false;self.play(self.androidFix.time);} if(self.androidFix.pause){self.androidFix.pause=false;self.pause(self.androidFix.time);} @@ -692,10 +692,16 @@ self._trigger($.jPlayer.event.loadeddata);}},false);mediaElement.addEventListene self.htmlElement.media.pause();self._updateButtons(false);self._getHtmlStatus(mediaElement,true);self._updateInterface();self._trigger($.jPlayer.event.ended);}},false);mediaElement.addEventListener("error",function(){if(entity.gate){self._updateButtons(false);self._seeked();if(self.status.srcSet){clearTimeout(self.internal.htmlDlyCmdId);self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video&&!self.status.nativeVideoControls){self.internal.video.jq.css({'width':'0px','height':'0px'});} if(self._validString(self.status.media.poster)&&!self.status.nativeVideoControls){self.internal.poster.jq.show();} if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();} -self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});}}},false);$.each($.jPlayer.htmlEvent,function(i,eventType){mediaElement.addEventListener(this,function(){if(entity.gate){self._trigger($.jPlayer.event[eventType]);}},false);});},_getHtmlStatus:function(media,override){var ct=0,cpa=0,sp=0,cpr=0;if(isFinite(media.duration)){this.status.duration=media.duration;} +self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});}}},false);$.each($.jPlayer.htmlEvent,function(i,eventType){mediaElement.addEventListener(this,function(){if(entity.gate){self._trigger($.jPlayer.event[eventType]);}},false);});},_addAuroraEventListeners:function(player,entity){var self=this;player.volume=this.options.volume*100;player.on("progress",function(){if(entity.gate){if(self.internal.cmdsIgnored&&this.readyState>0){self.internal.cmdsIgnored=false;} +self._getAuroraStatus(player);self._updateInterface();self._trigger($.jPlayer.event.progress);if(player.duration>0){self._trigger($.jPlayer.event.timeupdate);}}},false);player.on("ready",function(){if(entity.gate){self._trigger($.jPlayer.event.loadeddata);}},false);player.on("duration",function(){if(entity.gate){self._getAuroraStatus(player);self._updateInterface();self._trigger($.jPlayer.event.durationchange);}},false);player.on("end",function(){if(entity.gate){self._updateButtons(false);self._getAuroraStatus(player,true);self._updateInterface();self._trigger($.jPlayer.event.ended);}},false);player.on("error",function(){if(entity.gate){self._updateButtons(false);self._seeked();if(self.status.srcSet){self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video&&!self.status.nativeVideoControls){self.internal.video.jq.css({'width':'0px','height':'0px'});} +if(self._validString(self.status.media.poster)&&!self.status.nativeVideoControls){self.internal.poster.jq.show();} +if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();} +self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});}}},false);},_getHtmlStatus:function(media,override){var ct=0,cpa=0,sp=0,cpr=0;if(isFinite(media.duration)){this.status.duration=media.duration;} ct=media.currentTime;cpa=(this.status.duration>0)?100*ct/this.status.duration:0;if((typeof media.seekable==="object")&&(media.seekable.length>0)){sp=(this.status.duration>0)?100*media.seekable.end(media.seekable.length-1)/this.status.duration:100;cpr=(this.status.duration>0)?100*media.currentTime/media.seekable.end(media.seekable.length-1):0;}else{sp=100;cpr=cpa;} if(override){ct=0;cpr=0;cpa=0;} -this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=media.videoWidth;this.status.videoHeight=media.videoHeight;this.status.readyState=media.readyState;this.status.networkState=media.networkState;this.status.playbackRate=media.playbackRate;this.status.ended=media.ended;},_resetStatus:function(){this.status=$.extend({},this.status,$.jPlayer.prototype.status);},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.options=$.extend(true,{},this.options);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.flash=$.extend(true,{},this.flash);if(error){event.jPlayer.error=$.extend({},error);} +this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=media.videoWidth;this.status.videoHeight=media.videoHeight;this.status.readyState=media.readyState;this.status.networkState=media.networkState;this.status.playbackRate=media.playbackRate;this.status.ended=media.ended;},_getAuroraStatus:function(player,override){var ct=0,cpa=0,sp=0,cpr=0;this.status.duration=player.duration/1000;ct=player.currentTime/1000;cpa=(this.status.duration>0)?100*ct/this.status.duration:0;if(player.buffered>0){sp=(this.status.duration>0)?(player.buffered*this.status.duration)/this.status.duration:100;cpr=(this.status.duration>0)?ct/(player.buffered*this.status.duration):0;}else{sp=100;cpr=cpa;} +if(override){ct=0;cpr=0;cpa=0;} +this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=false;},_resetStatus:function(){this.status=$.extend({},this.status,$.jPlayer.prototype.status);},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.options=$.extend(true,{},this.options);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.aurora=$.extend(true,{},this.aurora);event.jPlayer.flash=$.extend(true,{},this.flash);if(error){event.jPlayer.error=$.extend({},error);} if(warning){event.jPlayer.warning=$.extend({},warning);} this.element.trigger(event);},jPlayerFlashEvent:function(eventType,status){if(eventType===$.jPlayer.event.ready){if(!this.internal.ready){this.internal.ready=true;this.internal.flash.jq.css({'width':'0px','height':'0px'});this.version.flash=status.version;if(this.version.needFlash!==this.version.flash){this._error({type:$.jPlayer.error.VERSION,context:this.version.flash,message:$.jPlayer.errorMsg.VERSION+this.version.flash,hint:$.jPlayer.errorHint.VERSION});} this._trigger($.jPlayer.event.repeat);this._trigger(eventType);}else{if(this.flash.gate){if(this.status.srcSet){var currentTime=this.status.currentTime,paused=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);if(currentTime>0){if(paused){this.pause(currentTime);}else{this.play(currentTime);}}} @@ -718,33 +724,36 @@ var durationText='',duration=this.status.duration,remaining=this.status.remainin if(this.options.remainingDuration){durationText=(remaining>0?'-':'')+this._convertTime(remaining);}else{durationText=this._convertTime(duration);}} if(durationText!==this.css.jq.duration.text()){this.css.jq.duration.text(durationText);}}},_convertTime:ConvertTime.prototype.time,_seeking:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.addClass("jp-seeking-bg");} this.addStateClass('seeking');},_seeked:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.removeClass("jp-seeking-bg");} -this.removeStateClass('seeking');},_resetGate:function(){this.html.audio.gate=false;this.html.video.gate=false;this.flash.gate=false;},_resetActive:function(){this.html.active=false;this.flash.active=false;},_escapeHtml:function(s){return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"');},_qualifyURL:function(url){var el=document.createElement('div');el.innerHTML='x';return el.firstChild.href;},_absoluteMediaUrls:function(media){var self=this;$.each(media,function(type,url){if(url&&self.format[type]){media[type]=self._qualifyURL(url);}});return media;},addStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.addClass(this.options.stateClass[state]);}},removeStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.options.stateClass[state]);}},setMedia:function(media){var self=this,supported=false,posterChanged=this.status.media.poster!==media.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=false;this.androidFix.play=false;this.androidFix.pause=false;media=this._absoluteMediaUrls(media);$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==='video';$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==='html';if(isVideo){if(isHtml){self.html.video.gate=true;self._html_setVideo(media);self.html.active=true;}else{self.flash.gate=true;self._flash_setVideo(media);self.flash.active=true;} +this.removeStateClass('seeking');},_resetGate:function(){this.html.audio.gate=false;this.html.video.gate=false;this.aurora.gate=false;this.flash.gate=false;},_resetActive:function(){this.html.active=false;this.aurora.active=false;this.flash.active=false;},_escapeHtml:function(s){return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"');},_qualifyURL:function(url){var el=document.createElement('div');el.innerHTML='x';return el.firstChild.href;},_absoluteMediaUrls:function(media){var self=this;$.each(media,function(type,url){if(url&&self.format[type]&&url.substr(0,5)!=="data:"){media[type]=self._qualifyURL(url);}});return media;},addStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.addClass(this.options.stateClass[state]);}},removeStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.options.stateClass[state]);}},setMedia:function(media){var self=this,supported=false,posterChanged=this.status.media.poster!==media.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=false;this.androidFix.play=false;this.androidFix.pause=false;media=this._absoluteMediaUrls(media);$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==='video';$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==='html';var isAurora=solution==='aurora';if(isVideo){if(isHtml){self.html.video.gate=true;self._html_setVideo(media);self.html.active=true;}else{self.flash.gate=true;self._flash_setVideo(media);self.flash.active=true;} if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();} -self.status.video=true;}else{if(isHtml){self.html.audio.gate=true;self._html_setAudio(media);self.html.active=true;if($.jPlayer.platform.android){self.androidFix.setMedia=true;}}else{self.flash.gate=true;self._flash_setAudio(media);self.flash.active=true;} +self.status.video=true;}else{if(isHtml){self.html.audio.gate=true;self._html_setAudio(media);self.html.active=true;if($.jPlayer.platform.android){self.androidFix.setMedia=true;}}else if(isAurora){self.aurora.gate=true;self._aurora_setAudio(media);self.aurora.active=true;}else{self.flash.gate=true;self._flash_setAudio(media);self.flash.active=true;} if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.hide();} self.status.video=false;} supported=true;return false;}});if(supported){return false;}});if(supported){if(!(this.status.nativeVideoControls&&this.html.video.gate)){if(this._validString(media.poster)){if(posterChanged){this.htmlElement.poster.src=media.poster;}else{this.internal.poster.jq.show();}}} -if(this.css.jq.title.length){if(typeof media.title==='string'){this.css.jq.title.html(media.title);if(this.htmlElement.audio){this.htmlElement.audio.setAttribute('title',media.title);} -if(this.htmlElement.video){this.htmlElement.video.setAttribute('title',media.title);}}} -this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface();this._trigger($.jPlayer.event.setmedia);}else{this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT});}},_resetMedia:function(){this._resetStatus();this._updateButtons(false);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_resetMedia();}else if(this.flash.active){this._flash_resetMedia();}},clearMedia:function(){this._resetMedia();if(this.html.active){this._html_clearMedia();}else if(this.flash.active){this._flash_clearMedia();} -this._resetGate();this._resetActive();},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load();}else if(this.flash.active){this._flash_load();}}else{this._urlNotSetError("load");}},focus:function(){if(this.options.keyEnabled){$.jPlayer.focus=this;}},play:function(time){var guiAction=typeof time==="object";if(guiAction&&this.options.useStateClassSkin&&!this.status.paused){this.pause(time);}else{time=(typeof time==="number")?time:NaN;if(this.status.srcSet){this.focus();if(this.html.active){this._html_play(time);}else if(this.flash.active){this._flash_play(time);}}else{this._urlNotSetError("play");}}},videoPlay:function(){this.play();},pause:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time);}else if(this.flash.active){this._flash_pause(time);}}else{this._urlNotSetError("pause");}},tellOthers:function(command,conditions){var self=this,hasConditions=typeof conditions==='function',args=Array.prototype.slice.call(arguments);if(typeof command!=='string'){return;} +if(typeof media.title==='string'){if(this.css.jq.title.length){this.css.jq.title.html(media.title);} +if(this.htmlElement.audio){this.htmlElement.audio.setAttribute('title',media.title);} +if(this.htmlElement.video){this.htmlElement.video.setAttribute('title',media.title);}} +this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface();this._trigger($.jPlayer.event.setmedia);}else{this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT});}},_resetMedia:function(){this._resetStatus();this._updateButtons(false);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_resetMedia();}else if(this.aurora.active){this._aurora_resetMedia();}else if(this.flash.active){this._flash_resetMedia();}},clearMedia:function(){this._resetMedia();if(this.html.active){this._html_clearMedia();}else if(this.aurora.active){this._aurora_clearMedia();}else if(this.flash.active){this._flash_clearMedia();} +this._resetGate();this._resetActive();},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load();}else if(this.aurora.active){this._aurora_load();}else if(this.flash.active){this._flash_load();}}else{this._urlNotSetError("load");}},focus:function(){if(this.options.keyEnabled){$.jPlayer.focus=this;}},play:function(time){var guiAction=typeof time==="object";if(guiAction&&this.options.useStateClassSkin&&!this.status.paused){this.pause(time);}else{time=(typeof time==="number")?time:NaN;if(this.status.srcSet){this.focus();if(this.html.active){this._html_play(time);}else if(this.aurora.active){this._aurora_play(time);}else if(this.flash.active){this._flash_play(time);}}else{this._urlNotSetError("play");}}},videoPlay:function(){this.play();},pause:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time);}else if(this.aurora.active){this._aurora_pause(time);}else if(this.flash.active){this._flash_pause(time);}}else{this._urlNotSetError("pause");}},tellOthers:function(command,conditions){var self=this,hasConditions=typeof conditions==='function',args=Array.prototype.slice.call(arguments);if(typeof command!=='string'){return;} if(hasConditions){args.splice(1,1);} -$.each(this.instances,function(){if(self.element!==this){if(!hasConditions||conditions.call(this.data("jPlayer"),self)){this.jPlayer.apply(this,args);}}});},pauseOthers:function(time){this.tellOthers("pause",function(){return this.status.srcSet;},time);},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0);}else if(this.flash.active){this._flash_pause(0);}}else{this._urlNotSetError("stop");}},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p);}else if(this.flash.active){this._flash_playHead(p);}}else{this._urlNotSetError("playHead");}},_muted:function(muted){this.mutedWorker(muted);if(this.options.globalVolume){this.tellOthers("mutedWorker",function(){return this.options.globalVolume;},muted);}},mutedWorker:function(muted){this.options.muted=muted;if(this.html.used){this._html_setProperty('muted',muted);} +$.jPlayer.prototype.destroyRemoved();$.each(this.instances,function(){if(self.element!==this){if(!hasConditions||conditions.call(this.data("jPlayer"),self)){this.jPlayer.apply(this,args);}}});},pauseOthers:function(time){this.tellOthers("pause",function(){return this.status.srcSet;},time);},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0);}else if(this.aurora.active){this._aurora_pause(0);}else if(this.flash.active){this._flash_pause(0);}}else{this._urlNotSetError("stop");}},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p);}else if(this.aurora.active){this._aurora_playHead(p);}else if(this.flash.active){this._flash_playHead(p);}}else{this._urlNotSetError("playHead");}},_muted:function(muted){this.mutedWorker(muted);if(this.options.globalVolume){this.tellOthers("mutedWorker",function(){return this.options.globalVolume;},muted);}},mutedWorker:function(muted){this.options.muted=muted;if(this.html.used){this._html_setProperty('muted',muted);} +if(this.aurora.used){this._aurora_mute(muted);} if(this.flash.used){this._flash_mute(muted);} if(!this.html.video.gate&&!this.html.audio.gate){this._updateMute(muted);this._updateVolume(this.options.volume);this._trigger($.jPlayer.event.volumechange);}},mute:function(mute){var guiAction=typeof mute==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.muted){this._muted(false);}else{mute=mute===undefined?true:!!mute;this._muted(mute);}},unmute:function(unmute){unmute=unmute===undefined?true:!!unmute;this._muted(!unmute);},_updateMute:function(mute){if(mute===undefined){mute=this.options.muted;} if(mute){this.addStateClass('muted');}else{this.removeStateClass('muted');} if(this.css.jq.mute.length&&this.css.jq.unmute.length){if(this.status.noVolume){this.css.jq.mute.hide();this.css.jq.unmute.hide();}else if(mute){this.css.jq.mute.hide();this.css.jq.unmute.show();}else{this.css.jq.mute.show();this.css.jq.unmute.hide();}}},volume:function(v){this.volumeWorker(v);if(this.options.globalVolume){this.tellOthers("volumeWorker",function(){return this.options.globalVolume;},v);}},volumeWorker:function(v){v=this._limitValue(v,0,1);this.options.volume=v;if(this.html.used){this._html_setProperty('volume',v);} +if(this.aurora.used){this._aurora_volume(v);} if(this.flash.used){this._flash_volume(v);} if(!this.html.video.gate&&!this.html.audio.gate){this._updateVolume(v);this._trigger($.jPlayer.event.volumechange);}},volumeBar:function(e){if(this.css.jq.volumeBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height();if(this.options.verticalVolume){this.volume(y/h);}else{this.volume(x/w);}} if(this.options.muted){this._muted(false);}},_updateVolume:function(v){if(v===undefined){v=this.options.volume;} -v=this.options.muted?0:v;if(this.status.noVolume){if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.hide();} +v=this.options.muted?0:v;if(this.status.noVolume){this.addStateClass('noVolume');if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.hide();} if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.hide();} -if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.hide();}}else{if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.show();} +if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.hide();}}else{this.removeStateClass('noVolume');if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.show();} if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.show();this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"]((v*100)+"%");} if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.show();}}},volumeMax:function(){this.volume(1);if(this.options.muted){this._muted(false);}},_cssSelectorAncestor:function(ancestor){var self=this;this.options.cssSelectorAncestor=ancestor;this._removeUiClass();this.ancestorJq=ancestor?$(ancestor):[];if(ancestor&&this.ancestorJq.length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:ancestor,message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});} this._addUiClass();$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel);});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();this._updateMute();},_cssSelector:function(fn,cssSel){var self=this;if(typeof cssSel==='string'){if($.jPlayer.prototype.options.cssSelector[fn]){if(this.css.jq[fn]&&this.css.jq[fn].length){this.css.jq[fn].unbind(".jPlayer");} this.options.cssSelector[fn]=cssSel;this.css.cs[fn]=this.options.cssSelectorAncestor+" "+cssSel;if(cssSel){this.css.jq[fn]=$(this.css.cs[fn]);}else{this.css.jq[fn]=[];} -if(this.css.jq[fn].length&&this[fn]){var handler=function(e){e.preventDefault();self[fn](e);if(self.options.autoBlur){$(this).blur();}};this.css.jq[fn].bind("click.jPlayer",handler);} +if(this.css.jq[fn].length&&this[fn]){var handler=function(e){e.preventDefault();self[fn](e);if(self.options.autoBlur){$(this).blur();}else{$(this).focus();}};this.css.jq[fn].bind("click.jPlayer",handler);} if(cssSel&&this.css.jq[fn].length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[fn],message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[fn].length+" found for "+fn+" method.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_METHOD,context:fn,message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_STRING,context:cssSel,message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING});}},duration:function(e){if(this.options.toggleDuration){if(this.options.captureDuration){e.stopPropagation();} this._setOption("remainingDuration",!this.options.remainingDuration);}},seekBar:function(e){if(this.css.jq.seekBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),p=100*x/w;this.playHead(p);}},playbackRate:function(pbr){this._setOption("playbackRate",pbr);},playbackRateBar:function(e){if(this.css.jq.playbackRateBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height(),ratio,pbr;if(this.options.verticalPlaybackRate){ratio=y/h;}else{ratio=x/w;} pbr=ratio*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate;this.playbackRate(pbr);}},_updatePlaybackRate:function(){var pbr=this.options.playbackRate,ratio=(pbr-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);if(this.status.playbackRateEnabled){if(this.css.jq.playbackRateBar.length){this.css.jq.playbackRateBar.show();} @@ -766,7 +775,8 @@ break;case"timeFormat":this.options[key]=$.extend({},this.options[key],value);br break;case"keyBindings":this.options[key]=$.extend(true,{},this.options[key],value);break;case"audioFullScreen":this.options[key]=value;break;case"autoBlur":this.options[key]=value;break;} return this;},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger($.jPlayer.event.resize);},_setSize:function(){if(this.options.fullWindow){this.status.width=this.options.sizeFull.width;this.status.height=this.options.sizeFull.height;this.status.cssClass=this.options.sizeFull.cssClass;}else{this.status.width=this.options.size.width;this.status.height=this.options.size.height;this.status.cssClass=this.options.size.cssClass;} this.element.css({'width':this.status.width,'height':this.status.height});},_addUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.addClass(this.status.cssClass);}},_removeUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.status.cssClass);}},_updateSize:function(){this.internal.poster.jq.css({'width':this.status.width,'height':this.status.height});if(!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls){this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});} -else if(!this.status.waitForPlay&&this.flash.active&&this.status.video){this.internal.flash.jq.css({'width':this.status.width,'height':this.status.height});}},_updateAutohide:function(){var self=this,event="mousemove.jPlayer",namespace=".jPlayerAutohide",eventType=event+namespace,handler=function(){self.css.jq.gui.fadeIn(self.options.autohide.fadeIn,function(){clearTimeout(self.internal.autohideId);self.internal.autohideId=setTimeout(function(){self.css.jq.gui.fadeOut(self.options.autohide.fadeOut);},self.options.autohide.hold);});};if(this.css.jq.gui.length){this.css.jq.gui.stop(true,true);clearTimeout(this.internal.autohideId);this.element.unbind(namespace);this.css.jq.gui.unbind(namespace);if(!this.status.nativeVideoControls){if(this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored){this.element.bind(eventType,handler);this.css.jq.gui.bind(eventType,handler);this.css.jq.gui.hide();}else{this.css.jq.gui.show();}}else{this.css.jq.gui.hide();}}},fullScreen:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.fullScreen){this._setOption("fullScreen",false);}else{this._setOption("fullScreen",true);}},restoreScreen:function(){this._setOption("fullScreen",false);},_fullscreenAddEventListeners:function(){var self=this,fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.api.fullscreenEnabled){if(fs.event.fullscreenchange){if(typeof this.internal.fullscreenchangeHandler!=='function'){this.internal.fullscreenchangeHandler=function(){self._fullscreenchange();};} +else if(!this.status.waitForPlay&&this.flash.active&&this.status.video){this.internal.flash.jq.css({'width':this.status.width,'height':this.status.height});}},_updateAutohide:function(){var self=this,event="mousemove.jPlayer",namespace=".jPlayerAutohide",eventType=event+namespace,handler=function(event){var moved=false,deltaX,deltaY;if(typeof self.internal.mouse!=="undefined"){deltaX=self.internal.mouse.x-event.pageX;deltaY=self.internal.mouse.y-event.pageY;moved=(Math.floor(deltaX)>0)||(Math.floor(deltaY)>0);}else{moved=true;} +self.internal.mouse={x:event.pageX,y:event.pageY};if(moved){self.css.jq.gui.fadeIn(self.options.autohide.fadeIn,function(){clearTimeout(self.internal.autohideId);self.internal.autohideId=setTimeout(function(){self.css.jq.gui.fadeOut(self.options.autohide.fadeOut);},self.options.autohide.hold);});}};if(this.css.jq.gui.length){this.css.jq.gui.stop(true,true);clearTimeout(this.internal.autohideId);delete this.internal.mouse;this.element.unbind(namespace);this.css.jq.gui.unbind(namespace);if(!this.status.nativeVideoControls){if(this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored){this.element.bind(eventType,handler);this.css.jq.gui.bind(eventType,handler);this.css.jq.gui.hide();}else{this.css.jq.gui.show();}}else{this.css.jq.gui.hide();}}},fullScreen:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.fullScreen){this._setOption("fullScreen",false);}else{this._setOption("fullScreen",true);}},restoreScreen:function(){this._setOption("fullScreen",false);},_fullscreenAddEventListeners:function(){var self=this,fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.api.fullscreenEnabled){if(fs.event.fullscreenchange){if(typeof this.internal.fullscreenchangeHandler!=='function'){this.internal.fullscreenchangeHandler=function(){self._fullscreenchange();};} document.addEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false);}}},_fullscreenRemoveEventListeners:function(){var fs=$.jPlayer.nativeFeatures.fullscreen;if(this.internal.fullscreenchangeHandler){document.removeEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false);}},_fullscreenchange:function(){if(this.options.fullScreen&&!$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()){this._setOption("fullScreen",false);}},_requestFullscreen:function(){var e=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.used.webkitVideo){e=this.htmlElement.video;} if(fs.api.fullscreenEnabled){fs.api.requestFullscreen(e);}},_exitFullscreen:function(){var fs=$.jPlayer.nativeFeatures.fullscreen,e;if(fs.used.webkitVideo){e=this.htmlElement.video;} if(fs.api.fullscreenEnabled){fs.api.exitFullscreen(e);}},_html_initMedia:function(media){var $media=$(this.htmlElement.media).empty();$.each(media.track||[],function(i,v){var track=document.createElement('track');track.setAttribute("kind",v.kind?v.kind:"");track.setAttribute("src",v.src?v.src:"");track.setAttribute("srclang",v.srclang?v.srclang:"");track.setAttribute("label",v.label?v.label:"");if(v.def){track.setAttribute("default",v.def);} @@ -781,7 +791,13 @@ media.pause();if(this.androidFix.setMedia){this.androidFix.pause=true;this.andro if(time>0){this._html_checkWaitForPlay();}},_html_playHead:function(percent){var self=this,media=this.htmlElement.media;this._html_load();try{if(typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=percent*media.seekable.end(media.seekable.length-1)/100;}else if(media.duration>0&&!isNaN(media.duration)){media.currentTime=percent*media.duration/100;}else{throw"e";}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.playHead(percent);},250);return;} if(!this.status.waitForLoad){this._html_checkWaitForPlay();}},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();} if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}}},_html_setProperty:function(property,value){if(this.html.audio.available){this.htmlElement.audio[property]=value;} -if(this.html.video.available){this.htmlElement.video[property]=value;}},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":case"fla":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break;case"rtmpa":self._getMovie().fl_setAudio_rtmp(media[format]);break;} +if(this.html.video.available){this.htmlElement.video[property]=value;}},_aurora_setAudio:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.aurora.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});this.aurora.player=new AV.Player.fromURL(this.status.src);this._addAuroraEventListeners(this.aurora.player,this.aurora);if(this.options.preload==='auto'){this._aurora_load();this.status.waitForLoad=false;}},_aurora_resetMedia:function(){if(this.aurora.player){this.aurora.player.stop();}},_aurora_clearMedia:function(){},_aurora_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.aurora.player.preload();}},_aurora_play:function(time){if(!this.status.waitForLoad){if(!isNaN(time)){this.aurora.player.seek(time);}} +if(!this.aurora.player.playing){this.aurora.player.play();} +this.status.waitForLoad=false;this._aurora_checkWaitForPlay();this._updateButtons(true);this._trigger($.jPlayer.event.play);},_aurora_pause:function(time){if(!isNaN(time)){this.aurora.player.seek(time*1000);} +this.aurora.player.pause();if(time>0){this._aurora_checkWaitForPlay();} +this._updateButtons(false);this._trigger($.jPlayer.event.pause);},_aurora_playHead:function(percent){if(this.aurora.player.duration>0){this.aurora.player.seek(percent*this.aurora.player.duration/100);} +if(!this.status.waitForLoad){this._aurora_checkWaitForPlay();}},_aurora_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;}},_aurora_volume:function(v){this.aurora.player.volume=v*100;},_aurora_mute:function(m){if(m){this.aurora.properties.lastvolume=this.aurora.player.volume;this.aurora.player.volume=0;}else{this.aurora.player.volume=this.aurora.properties.lastvolume;} +this.aurora.properties.muted=m;},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":case"fla":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break;case"rtmpa":self._getMovie().fl_setAudio_rtmp(media[format]);break;} self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_setVideo:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4v":case"flv":self._getMovie().fl_setVideo_m4v(media[format]);break;case"rtmpv":self._getMovie().fl_setVideo_rtmp(media[format]);break;} self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_resetMedia:function(){this.internal.flash.jq.css({'width':'0px','height':'0px'});this._flash_pause(NaN);},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia();}catch(err){this._flashError(err);}},_flash_load:function(){try{this._getMovie().fl_load();}catch(err){this._flashError(err);} this.status.waitForLoad=false;},_flash_play:function(time){try{this._getMovie().fl_play(time);}catch(err){this._flashError(err);} @@ -792,45 +808,39 @@ if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css( else if(navigator.plugins&&navigator.mimeTypes.length>0){flash=navigator.plugins["Shockwave Flash"];if(flash){version=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1");}} return version*1;},_checkForFlash:function(version){var flashOk=false;if(this._getFlashPluginVersion()>=version){flashOk=true;} return flashOk;},_validString:function(url){return(url&&typeof url==="string");},_limitValue:function(value,min,max){return(valuemax)?max:value);},_urlNotSetError:function(context){this._error({type:$.jPlayer.error.URL_NOT_SET,context:context,message:$.jPlayer.errorMsg.URL_NOT_SET,hint:$.jPlayer.errorHint.URL_NOT_SET});},_flashError:function(error){var errorType;if(!this.internal.ready){errorType="FLASH";}else{errorType="FLASH_DISABLED";} -this._error({type:$.jPlayer.error[errorType],context:this.internal.flash.swf,message:$.jPlayer.errorMsg[errorType]+error.message,hint:$.jPlayer.errorHint[errorType]});this.internal.flash.jq.css({'width':'1px','height':'1px'});},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts){this._alert("Error!"+(error.message?"\n"+error.message:"")+(error.hint?"\n"+error.hint:"")+"\nContext: "+error.context);}},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts){this._alert("Warning!"+(warning.message?"\n"+warning.message:"")+(warning.hint?"\n"+warning.hint:"")+"\nContext: "+warning.context);}},_alert:function(message){var msg="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message;if(!this.options.consoleAlerts){alert(msg);}else if(window.console&&window.console.log){window.console.log(msg);}},_emulateHtmlBridge:function(){var self=this;$.each($.jPlayer.emulateMethods.split(/\s+/g),function(i,name){self.internal.domNode[name]=function(arg){self[name](arg);};});$.each($.jPlayer.event,function(eventName,eventType){var nativeEvent=true;$.each($.jPlayer.reservedEvent.split(/\s+/g),function(i,name){if(name===eventName){nativeEvent=false;return false;}});if(nativeEvent){self.element.bind(eventType+".jPlayer.jPlayerHtml",function(){self._emulateHtmlUpdate();var domEvent=document.createEvent("Event");domEvent.initEvent(eventName,false,true);self.internal.domNode.dispatchEvent(domEvent);});}});},_emulateHtmlUpdate:function(){var self=this;$.each($.jPlayer.emulateStatus.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.status[name];});$.each($.jPlayer.emulateOptions.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.options[name];});},_destroyHtmlBridge:function(){var self=this;this.element.unbind(".jPlayerHtml");var emulated=$.jPlayer.emulateMethods+" "+$.jPlayer.emulateStatus+" "+$.jPlayer.emulateOptions;$.each(emulated.split(/\s+/g),function(i,name){delete self.internal.domNode[name];});}};$.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."};}));;(function($,undefined){jPlayerPlaylist=function(cssSelector,playlist,options){var self=this;this.active=false;this.current=0;this.loop=false;this.shuffled=false;this.removing=false;this.cssSelector=$.extend({},this._cssSelector,cssSelector);this.options=$.extend(true,{},this._options,options);this.playlist=[];this.original=[];this._initPlaylist(playlist);this.cssSelector.title=this.cssSelector.cssSelectorAncestor+" .jp-title";if(this.options.playlistOptions.playlistSelector){this.cssSelector.playlist=this.options.playlistOptions.playlistSelector;}else{this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";} -this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(event){self.loop=event.jPlayer.options.loop;};$(this.cssSelector.jPlayer).bind($.jPlayer.event.play,function(event){$(this).jPlayer("pauseOthers");});$(this.cssSelector.jPlayer).bind($.jPlayer.event.resize,function(event){if(event.jPlayer.options.fullScreen){$(self.cssSelector.title).show();}else{$(self.cssSelector.title).hide();}});if(!this.options.fullScreen){$(this.cssSelector.title).hide();} -$(this.cssSelector.playlist+" ul.playlist-container-list").empty();this._createItemHandlers();};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:false,loopOnPrevious:false,shuffleOnLoop:true,enableRemoveControls:false,displayTime:'slow',addTime:'fast',removeTime:'fast',shuffleTime:'slow',itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove",actionItemClass:"jp-playlist-item-action",parentFolderItemClass:"jp-playlist-item-show-parent-folder",playlistSelector:false,playtimeClass:"jp-playlist-playtime",},hooks:{"setMedia":function(track){return track},},},option:function(option,value){if(value===undefined){return this.options.playlistOptions[option];} +this._error({type:$.jPlayer.error[errorType],context:this.internal.flash.swf,message:$.jPlayer.errorMsg[errorType]+error.message,hint:$.jPlayer.errorHint[errorType]});this.internal.flash.jq.css({'width':'1px','height':'1px'});},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts){this._alert("Error!"+(error.message?"\n"+error.message:"")+(error.hint?"\n"+error.hint:"")+"\nContext: "+error.context);}},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts){this._alert("Warning!"+(warning.message?"\n"+warning.message:"")+(warning.hint?"\n"+warning.hint:"")+"\nContext: "+warning.context);}},_alert:function(message){var msg="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message;if(!this.options.consoleAlerts){alert(msg);}else if(window.console&&window.console.log){window.console.log(msg);}},_emulateHtmlBridge:function(){var self=this;$.each($.jPlayer.emulateMethods.split(/\s+/g),function(i,name){self.internal.domNode[name]=function(arg){self[name](arg);};});$.each($.jPlayer.event,function(eventName,eventType){var nativeEvent=true;$.each($.jPlayer.reservedEvent.split(/\s+/g),function(i,name){if(name===eventName){nativeEvent=false;return false;}});if(nativeEvent){self.element.bind(eventType+".jPlayer.jPlayerHtml",function(){self._emulateHtmlUpdate();var domEvent=document.createEvent("Event");domEvent.initEvent(eventName,false,true);self.internal.domNode.dispatchEvent(domEvent);});}});},_emulateHtmlUpdate:function(){var self=this;$.each($.jPlayer.emulateStatus.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.status[name];});$.each($.jPlayer.emulateOptions.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.options[name];});},_destroyHtmlBridge:function(){var self=this;this.element.unbind(".jPlayerHtml");var emulated=$.jPlayer.emulateMethods+" "+$.jPlayer.emulateStatus+" "+$.jPlayer.emulateOptions;$.each(emulated.split(/\s+/g),function(i,name){delete self.internal.domNode[name];});}};$.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."};}));;(function($,undefined){jPlayerPlaylist=function(cssSelector,playlist,options){var self=this;this.current=0;this.loop=false;this.shuffled=false;this.removing=false;this.cssSelector=$.extend({},this._cssSelector,cssSelector);this.options=$.extend(true,{keyBindings:{next:{key:221,fn:function(){self.next();}},previous:{key:219,fn:function(){self.previous();}},shuffle:{key:83,fn:function(){self.shuffle();}}},stateClass:{shuffled:"jp-state-shuffled"}},this._options,options);this.playlist=[];this.original=[];this._initPlaylist(playlist);this.cssSelector.details=this.cssSelector.cssSelectorAncestor+" .jp-details";this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(event){self.loop=event.jPlayer.options.loop;};$(this.cssSelector.jPlayer).bind($.jPlayer.event.ready,function(){self._init();});$(this.cssSelector.jPlayer).bind($.jPlayer.event.ended,function(){self.next();});$(this.cssSelector.jPlayer).bind($.jPlayer.event.play,function(){$(this).jPlayer("pauseOthers");});$(this.cssSelector.jPlayer).bind($.jPlayer.event.resize,function(event){if(event.jPlayer.options.fullScreen){$(self.cssSelector.details).show();}else{$(self.cssSelector.details).hide();}});$(this.cssSelector.previous).click(function(e){e.preventDefault();self.previous();self.blur(this);});$(this.cssSelector.next).click(function(e){e.preventDefault();self.next();self.blur(this);});$(this.cssSelector.shuffle).click(function(e){e.preventDefault();if(self.shuffled&&$(self.cssSelector.jPlayer).jPlayer("option","useStateClassSkin")){self.shuffle(false);}else{self.shuffle(true);} +self.blur(this);});$(this.cssSelector.shuffleOff).click(function(e){e.preventDefault();self.shuffle(false);self.blur(this);}).hide();if(!this.options.fullScreen){$(this.cssSelector.details).hide();} +$(this.cssSelector.playlist+" ul").empty();this._createItemHandlers();$(this.cssSelector.jPlayer).jPlayer(this.options);};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:false,loopOnPrevious:false,shuffleOnLoop:true,enableRemoveControls:false,displayTime:'slow',addTime:'fast',removeTime:'fast',shuffleTime:'slow',itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove"}},option:function(option,value){if(value===undefined){return this.options.playlistOptions[option];} this.options.playlistOptions[option]=value;switch(option){case"enableRemoveControls":this._updateControls();break;case"itemClass":case"freeGroupClass":case"freeItemClass":case"removeItemClass":this._refresh(true);this._createItemHandlers();break;} -return this;},_init:function(){var self=this;this._refresh(function(){if(self.options.playlistOptions.autoPlay){self.play(self.current);}});},_initPlaylist:function(playlist){for(var i=0;i ul > li:last");litem.attr('name',litem.index());});this._updateControls();}else{var displayTime=$(this.cssSelector.playlist+" ul.playlist-container-list").children().length?this.options.playlistOptions.displayTime:0;$(this.cssSelector.playlist+" ul.playlist-container-list").slideUp(displayTime,function(){var $this=$(this);$(this).empty();$.each(self.playlist,function(i,v){$this.append(self._createListItem(self.playlist[i]));var litem=$(self.cssSelector.playlist+" > ul.playlist-container-list > li:last");litem.attr('name',litem.index());});self._updateControls();if($.isFunction(instant)){instant();} -if(self.playlist.length){$(this).slideDown(self.options.playlistOptions.displayTime);}else{$(this).show();}});} -this._updatePlaytime();this._highlight(this.current);this._createItemHandlers();},_updatePlaytime:function(){var self=this;var playtimeSum=0;$.each(this.playlist,function(i,v){if(self.playlist[i].duration){playtimeSum+=self.playlist[i].duration;}});if(playtimeSum){$(self.cssSelector.playlist+"-playtime-sum").html("
    "+self._formatTime(playtimeSum)+"
    ");}else{$(self.cssSelector.playlist+"-playtime-sum").html("");}},_formatTime:function(secs){secs=Math.floor(secs);var mins=Math.floor(secs/60);var hours=Math.floor(mins/60);var s=secs%60;if(s<10){s='0'+s;} -var m=mins%60;if(m<10){m='0'+m;} -var h=hours>0?hours+':':'';return h+m+':'+s;},_createListItem:function(media){var self=this;var listItem="
  • ";listItem+='
    '+' '+' '+'
    ';if(media.duration){listItem+=""+self._formatTime(media.duration)+"";} -listItem+="×";if(media.free){var first=true;listItem+="(";$.each(media,function(property,value){if($.jPlayer.prototype.format[property]){if(first){first=false;}else{listItem+=" | ";} -listItem+=""+property+"";}});listItem+=")";} -listItem+=""+media.title+(media.artist?" ":"")+"";listItem+="
  • ";return listItem;},_createItemHandlers:function(){var self=this;$(this.cssSelector.playlist+" a."+this.options.playlistOptions.itemClass).off("click").on("click",function(){$(self.options.playlistOptions.playlistSelector).trigger('requestPlay',[self.options.playlistOptions.playlistSelector]);var index=$(this).parent().parent().index();self.play(index);$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.freeItemClass).off("click").on("click",function(event){$(this).parent().parent().find("."+self.options.playlistOptions.itemClass).click();$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.removeItemClass).off("click").on("click",function(event){event.stopPropagation();var index=$(this).parent().parent().index();self.remove(index);$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.parentFolderItemClass).off('click').on("click",function(event){var index=$(this).parent().parent().parent().parent().parent().index();var folder=decodeURIComponent(self.playlist[index].url);lastFolderSeparator=folder.lastIndexOf('/');if(lastFolderSeparator==-1){folder='';}else{folder=folder.slice(0,lastFolderSeparator);} -loadBrowser(folder,folder);});},_updateControls:function(){if(this.options.playlistOptions.enableRemoveControls){$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show();}else{$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();} -if(this.shuffled){$(this.cssSelector.shuffleOff).show();$(this.cssSelector.shuffle).hide();}else{$(this.cssSelector.shuffleOff).hide();$(this.cssSelector.shuffle).show();}},_highlight:function(index){if(this.playlist.length&&index!==undefined){$(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current");$(this.cssSelector.playlist+">ul>li:nth-child("+(index+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current");$(this.cssSelector.title+" li").html(this.playlist[index].title+(this.playlist[index].artist?" ":""));}},setPlaylist:function(playlist){this._initPlaylist(playlist);this._init();},add:function(media,playNow,animate){var self=this;if(typeof animate==='undefined'){animate=true;} -if(animate){$(this.cssSelector.playlist+" ul.playlist-container-list").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);}else{$(this.cssSelector.playlist+" ul.playlist-container-list").append(this._createListItem(media));} -this._updateControls();this._createItemHandlers();this.original.push(media);this.playlist.push(media);if(playNow){this.play(this.playlist.length-1);} -$(self.options.playlistOptions.playlistSelector).trigger('addedItem',[self.options.playlistOptions.playlistSelector]);},remove:function(index){var self=this;$(self.options.playlistOptions.playlistSelector).trigger('removedItem',[self.options.playlistOptions.playlistSelector]);if(index===undefined){this._initPlaylist([]);this._refresh(function(){if(self.active){$(self.cssSelector.jPlayer).jPlayer("clearMedia");}});return true;}else{if(this.removing){return false;}else{index=(index<0)?self.original.length+index:index;if(0<=index&&indexul>li:nth-child("+(index+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){$(this).remove();if(self.shuffled){var item=self.playlist[index];$.each(self.original,function(i,v){if(self.original[i]===item){self.original.splice(i,1);return false;}});self.playlist.splice(index,1);}else{self.original.splice(index,1);self.playlist.splice(index,1);} +return this;},_init:function(){var self=this;this._refresh(function(){if(self.options.playlistOptions.autoPlay){self.play(self.current);}else{self.select(self.current);}});},_initPlaylist:function(playlist){this.current=0;this.shuffled=false;this.removing=false;this.original=$.extend(true,[],playlist);this._originalPlaylist();},_originalPlaylist:function(){var self=this;this.playlist=[];$.each(this.original,function(i){self.playlist[i]=self.original[i];});},_refresh:function(instant){var self=this;if(instant&&!$.isFunction(instant)){$(this.cssSelector.playlist+" ul").empty();$.each(this.playlist,function(i){$(self.cssSelector.playlist+" ul").append(self._createListItem(self.playlist[i]));});this._updateControls();}else{var displayTime=$(this.cssSelector.playlist+" ul").children().length?this.options.playlistOptions.displayTime:0;$(this.cssSelector.playlist+" ul").slideUp(displayTime,function(){var $this=$(this);$(this).empty();$.each(self.playlist,function(i){$this.append(self._createListItem(self.playlist[i]));});self._updateControls();if($.isFunction(instant)){instant();} +if(self.playlist.length){$(this).slideDown(self.options.playlistOptions.displayTime);}else{$(this).show();}});}},_createListItem:function(media){var self=this;var listItem="
  • ";listItem+="×";if(media.free){var first=true;listItem+="(";$.each(media,function(property,value){if($.jPlayer.prototype.format[property]){if(first){first=false;}else{listItem+=" | ";} +listItem+=""+property+"";}});listItem+=")";} +listItem+=""+media.title+(media.artist?" ":"")+"";listItem+="
  • ";return listItem;},_createItemHandlers:function(){var self=this;$(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.itemClass).on("click","a."+this.options.playlistOptions.itemClass,function(e){e.preventDefault();var index=$(this).parent().parent().index();if(self.current!==index){self.play(index);}else{$(self.cssSelector.jPlayer).jPlayer("play");} +self.blur(this);});$(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.freeItemClass).on("click","a."+this.options.playlistOptions.freeItemClass,function(e){e.preventDefault();$(this).parent().parent().find("."+self.options.playlistOptions.itemClass).click();self.blur(this);});$(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.removeItemClass).on("click","a."+this.options.playlistOptions.removeItemClass,function(e){e.preventDefault();var index=$(this).parent().parent().index();self.remove(index);self.blur(this);});},_updateControls:function(){if(this.options.playlistOptions.enableRemoveControls){$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show();}else{$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();} +if(this.shuffled){$(this.cssSelector.jPlayer).jPlayer("addStateClass","shuffled");}else{$(this.cssSelector.jPlayer).jPlayer("removeStateClass","shuffled");} +if($(this.cssSelector.shuffle).length&&$(this.cssSelector.shuffleOff).length){if(this.shuffled){$(this.cssSelector.shuffleOff).show();$(this.cssSelector.shuffle).hide();}else{$(this.cssSelector.shuffleOff).hide();$(this.cssSelector.shuffle).show();}}},_highlight:function(index){if(this.playlist.length&&index!==undefined){$(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current");$(this.cssSelector.playlist+" li:nth-child("+(index+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current");}},setPlaylist:function(playlist){this._initPlaylist(playlist);this._init();},add:function(media,playNow){$(this.cssSelector.playlist+" ul").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);this._updateControls();this.original.push(media);this.playlist.push(media);if(playNow){this.play(this.playlist.length-1);}else{if(this.original.length===1){this.select(0);}}},remove:function(index){var self=this;if(index===undefined){this._initPlaylist([]);this._refresh(function(){$(self.cssSelector.jPlayer).jPlayer("clearMedia");});return true;}else{if(this.removing){return false;}else{index=(index<0)?self.original.length+index:index;if(0<=index&&index0){this.play(index);}}},playRandomTrack:function(){var weighted=[];for(var i=0;i=0)?this.current-1:this.playlist.length-1;if(this.loop&&this.options.playlistOptions.loopOnPrevious||index ul.playlist-container-list > li"),function(index,value){replace[index]=self.original[$(value).attr('name')];if(!isAdjusted&&self.current===parseInt($(value).attr('name'),10)){self.current=index;isAdjusted=true;} -$(value).attr('name',index);});this.original=replace;this._originalPlaylist();$(self.options.playlistOptions.playlistSelector).trigger('sortedItems',[self.options.playlistOptions.playlistSelector]);}};})(jQuery);;(function($,undefined){$.jPlayerInspector={};$.jPlayerInspector.i=0;$.jPlayerInspector.defaults={jPlayer:undefined,idPrefix:"jplayer_inspector_",visible:false};var methods={init:function(options){var self=this;var $this=$(this);var config=$.extend({},$.jPlayerInspector.defaults,options);$(this).data("jPlayerInspector",config);config.id=$(this).attr("id");config.jPlayerId=config.jPlayer.attr("id");config.windowId=config.idPrefix+"window_"+$.jPlayerInspector.i;config.statusId=config.idPrefix+"status_"+$.jPlayerInspector.i;config.configId=config.idPrefix+"config_"+$.jPlayerInspector.i;config.toggleId=config.idPrefix+"toggle_"+$.jPlayerInspector.i;config.eventResetId=config.idPrefix+"event_reset_"+$.jPlayerInspector.i;config.updateId=config.idPrefix+"update_"+$.jPlayerInspector.i;config.eventWindowId=config.idPrefix+"event_window_"+$.jPlayerInspector.i;config.eventId={};config.eventJq={};config.eventTimeout={};config.eventOccurrence={};$.each($.jPlayer.event,function(eventName,eventType){config.eventId[eventType]=config.idPrefix+"event_"+eventName+"_"+$.jPlayerInspector.i;config.eventOccurrence[eventType]=0;});var structure='

    '+(config.visible?"Hide":"Show")+' jPlayer Inspector

    ' +self.removing=false;});} +return true;}}},select:function(index){index=(index<0)?this.original.length+index:index;if(0<=index&&index1){this.shuffle(true,true);}else{this.play(index);}}else{if(index>0){this.play(index);}}},previous:function(){var index=(this.current-1>=0)?this.current-1:this.playlist.length-1;if(this.loop&&this.options.playlistOptions.loopOnPrevious||index'+(config.visible?"Hide":"Show")+' jPlayer Inspector

    ' +'
    ' +'
    ' +'
    ' +'

    jPlayer events that have occurred over the past 1 second:' +'
    (Backgrounds: Never occurred Occurred before Occurred Multiple occurrences reset)

    ';var eventStyle="float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";structure+='
    ' ++'
    ' +'
    ' +'
    ' +'
    ' +'
    ' -+'
    ' +'
    ' +'
    ' +'
    ' +'
    ' +'
    ' ++'
    ' +'
    ' +'
    ' +'
    ' @@ -861,7 +871,7 @@ jPlayerInfo+="

    ";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer"). jPlayerInfo+="

    ";var formatType=$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType;jPlayerInfo+="

    status.formatType = '"+formatType+"'
    ";if(formatType){jPlayerInfo+="Browser canPlay('"+$.jPlayer.prototype.format[formatType].codec+"')";}else{jPlayerInfo+="

    ";} jPlayerInfo+="

    status.src = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src+"'

    ";jPlayerInfo+="

    status.media = {
    ";for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media){jPlayerInfo+=" "+prop+": "+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop]+"
    ";} jPlayerInfo+="};

    " -+"

    Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
    ";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available){jPlayerInfo+="htmlElement.audio.canPlayType = "+(typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType)+"
    "} +jPlayerInfo+="

    ";jPlayerInfo+="status.videoWidth = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoWidth+"'";jPlayerInfo+=" | status.videoHeight = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoHeight+"'";jPlayerInfo+="
    status.width = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.width+"'";jPlayerInfo+=" | status.height = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.height+"'";jPlayerInfo+="

    ";+"

    Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
    ";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available){jPlayerInfo+="htmlElement.audio.canPlayType = "+(typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType)+"
    "} if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available){jPlayerInfo+="htmlElement.video.canPlayType = "+(typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType)+"";} jPlayerInfo+="

    ";jPlayerInfo+="

    This instance is using the constructor options:
    " +"$('#"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id+"').jPlayer({
    " From 494a066724bb91b27372417ac5ed84f66d640249 Mon Sep 17 00:00:00 2001 From: Tom Wallroth Date: Mon, 9 Oct 2017 11:20:58 +0000 Subject: [PATCH 11/11] "release 0.41.0" --- CHANGES | 7 +++++++ cherrymusicserver/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c36da290..4871af7b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ Changelog --------- +0.41.0 (2017-10-09) + - FIXED: Installing CherryMusic via pip (thanks to rjsberry) + - IMPROVEMENT: updated jPlayer to 2.9.2, improved mobile compatibility (thansk to Max Leiter) + - IMPROVEMENT: Increased List Directory Item Size (thansk to Max Leiter) + - IMPROVEMENT: Made usernames case-insensitive (thanks to Max Leiter) + - IMPROVEMENT: Changed download zip archive name (thanks to Max Leiter) + 0.40.0 (2017-04-08) - FEATURE: Added option to select Album Art Source for manual searches - FIXED: Server refused to start when not able to detect cherrypy version diff --git a/cherrymusicserver/__init__.py b/cherrymusicserver/__init__.py index b9e4d755..8b3fb3d6 100644 --- a/cherrymusicserver/__init__.py +++ b/cherrymusicserver/__init__.py @@ -32,7 +32,7 @@ #python 2.6+ backward compability from __future__ import unicode_literals -VERSION = "0.40.0" +VERSION = "0.41.0" __version__ = VERSION DESCRIPTION = "an mp3 server for your browser" LONG_DESCRIPTION = """CherryMusic is a music streaming