diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..89c9cb0 Binary files /dev/null and b/.DS_Store differ diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/.DS_Store" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/.DS_Store" new file mode 100644 index 0000000..b3b176e Binary files /dev/null and "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/.DS_Store" differ diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/_config.yml" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/_config.yml" new file mode 100644 index 0000000..c741881 --- /dev/null +++ "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/_config.yml" @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/css/jquery-ui-1.7.2.custom.css" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/css/jquery-ui-1.7.2.custom.css" new file mode 100644 index 0000000..20dfc88 --- /dev/null +++ "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/css/jquery-ui-1.7.2.custom.css" @@ -0,0 +1,52 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #dddddd; font-weight: bold; color: #0073ea; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #0073ea; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #0073ea; font-weight: bold; color: #ff0084; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #ff0084; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #dddddd; font-weight: bold; color: #ff0084; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ff0084; outline: none; text-decoration: none; } + + + +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/.DS_Store" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/.DS_Store" differ diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/1.jpg" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/1.jpg" new file mode 100644 index 0000000..c15d201 Binary files /dev/null and "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/1.jpg" differ diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/2.jpg" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/2.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/images/2.jpg" differ diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/index.html" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/index.html" new file mode 100644 index 0000000..5b69887 --- /dev/null +++ "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/index.html" @@ -0,0 +1,671 @@ + + + + + + 健耕在线抽题 + + + + + + + + + + + + + +
+
+

健耕半年会考题

+
+
一个简单的健耕在线在线抽题, 可用于公司年会抽奖, 电视台抽奖等,可以自己设定抽奖名单、抽奖人数、每次出奖人数,有防止重复得奖的功能。
+ + + +
+ + +
+ + +
+

抽题活动

+ +
+
+ + + + +
+
+ + +
+ +
+ + +
每行一个奖项, 格式为竖线分隔的: 奖项名|数量|每次抽几个|奖品
+ + + +
每行一人, 或半角逗号分隔
+ + + +
ms
+ + +
可以输入图片链接使用网络上的图片, 也可以把图片拷贝到当前目录, 把图片文件名填入即可.
+
+ + +

+
+ + +
+

一等奖

员工L  
+

二等奖

员工M  员工H  
+

三等奖

员工E  员工A  员工I  员工B  
+ + +
+

抽奖软件

+

在浏览器上运行的抽奖程序

+ +

操作方便

+

抽奖过程全键盘操作, 只需要按回车(Enter)键即可, 类似播放PPT幻灯片, 非常简单.

+ +

配置灵活

+

可配置的选项有: 活动标题, 奖项, 候选人, 摇奖时的跳转速度, 背景图片. 其中, 每一个奖项, 可以一次开完, 也可以一次只开一部分. 例如, 三等奖一共6个, 每次只开2个, 需要开3次才能开完三等奖, 增加娱乐性. 图片可以更换为带自己公司Logo的图片, 以便适应当前节日, 所以, 本抽奖程序任何节日的任何类似的抽奖节目都可使用.

+ +

抽奖流程

+
+等待开始
+开场(open): 奖项介绍
+奖项循环: 如果多于一个奖项, 则循环
+	奖项开场(step_open)
+	摇奖循环: 如果不是一次开完一个奖项, 则循环
+		摇奖开始(rotate_start)
+		摇奖结束(rotate_stop)
+	奖项结束(step_close): 单项中奖名单
+闭场(close)
+                        
+
+ +
+ + + +
+ +
+
+ + + diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery-ui-1.7.2.custom.min.js" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery-ui-1.7.2.custom.min.js" new file mode 100644 index 0000000..100452a --- /dev/null +++ "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery-ui-1.7.2.custom.min.js" @@ -0,0 +1,68 @@ +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Tabs 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git "a/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery.js" "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery.js" new file mode 100644 index 0000000..55c2e6d --- /dev/null +++ "b/\345\201\245\350\200\225\345\215\212\345\271\264\344\274\232\350\200\203\351\242\230/js/jquery.js" @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.DS_Store" new file mode 100644 index 0000000..7c108d3 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.gitignore" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.gitignore" new file mode 100644 index 0000000..7a1537b --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/.gitignore" @@ -0,0 +1,2 @@ +.idea +node_modules diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/member.js" new file mode 100644 index 0000000..d55708e --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/member.js" @@ -0,0 +1,118 @@ +var member = [ + { + "phone": "中东大区", + "name": "李兴辉" + }, + { + "phone": "中东大区", + "name": "陈隽超" + }, + { + "phone": "中东大区", + "name": "潘绵宝" + }, + { + "phone": "中东大区", + "name": "王亚军" + }, + { + "phone": "中东大区", + "name": "刘锋" + }, + { + "phone": "西北大区", + "name": "袁立娟" + }, + { + "phone": "西北大区", + "name": "李小鸥" + }, + { + "phone": "西北大区", + "name": "郭凤怡" + }, + { + "phone": "西北大区", + "name": "王倩影" + }, + { + "phone": "西北大区", + "name": "刘鸿祥" + }, + { + "phone": "西北大区", + "name": "李烈艳" + }, + { + "phone": "西北大区", + "name": "李喆" + }, + { + "phone": "南区", + "name": "周丽荣" + }, + { + "phone": "南区", + "name": "尚应富" + }, + { + "phone": "南区", + "name": "曾丽莎" + }, + { + "phone": "南区", + "name": "陈琴" + }, + { + "phone": "南区", + "name": "韦惠妙" + }, + { + "phone": "南区", + "name": "苗培松" + }, + { + "phone": "中一区", + "name": "冯莲" + }, + { + "phone": "中一区", + "name": "高育良" + }, + { + "phone": "中一区", + "name": "刘莉桃" + }, + { + "phone": "中一区", + "name": "张东梅" + }, + { + "phone": "中一区", + "name": "李哲康" + }, + { + "phone": "中一区", + "name": "徐宏伟" + }, + { + "phone": "商务部", + "name": "杨德莲" + }, + { + "phone": "商务部", + "name": "张伟彬" + }, + { + "phone": "商务部", + "name": "彭耐" + }, + { + "phone": "商务部", + "name": "白利平" + }, + { + "phone": "商务部", + "name": "丁圣" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/result.html" new file mode 100755 index 0000000..06cb832 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/result.html" @@ -0,0 +1,90 @@ + + + + + + + 健耕销售抽奖 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/.DS_Store" new file mode 100644 index 0000000..09bbd47 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/member.js" new file mode 100644 index 0000000..80c2741 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/member.js" @@ -0,0 +1,26 @@ +var member = [ + { + "phone": "中一区", + "name": "冯莲" + }, + { + "phone": "中一区", + "name": "高育良" + }, + { + "phone": "中一区", + "name": "刘莉桃" + }, + { + "phone": "中一区", + "name": "张东梅" + }, + { + "phone": "中一区", + "name": "李哲康" + }, + { + "phone": "中一区", + "name": "徐宏伟" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/result.html" new file mode 100755 index 0000000..9f35db2 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\200\345\214\272/result.html" @@ -0,0 +1,90 @@ + + + + + + + 年会抽奖小程序 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/.DS_Store" new file mode 100644 index 0000000..09bbd47 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/member.js" new file mode 100644 index 0000000..cb60c9b --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/member.js" @@ -0,0 +1,22 @@ +var member = [ + { + "phone": "中东大区", + "name": "李兴辉" + }, + { + "phone": "中东大区", + "name": "陈隽超" + }, + { + "phone": "中东大区", + "name": "潘绵宝" + }, + { + "phone": "中东大区", + "name": "王亚军" + }, + { + "phone": "中东大区", + "name": "刘锋" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/result.html" new file mode 100755 index 0000000..9f35db2 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\344\270\255\344\270\234\345\244\247\345\214\272/result.html" @@ -0,0 +1,90 @@ + + + + + + + 年会抽奖小程序 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/.DS_Store" new file mode 100644 index 0000000..e18ac00 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/member.js" new file mode 100644 index 0000000..e8869e3 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/member.js" @@ -0,0 +1,26 @@ +var member = [ + { + "phone": "南区", + "name": "周丽荣" + }, + { + "phone": "南区", + "name": "尚应富" + }, + { + "phone": "南区", + "name": "曾丽莎" + }, + { + "phone": "南区", + "name": "陈琴" + }, + { + "phone": "南区", + "name": "韦惠妙" + }, + { + "phone": "南区", + "name": "苗培松" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/result.html" new file mode 100755 index 0000000..9f35db2 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\215\227\345\214\272/result.html" @@ -0,0 +1,90 @@ + + + + + + + 年会抽奖小程序 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/.DS_Store" new file mode 100644 index 0000000..09bbd47 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/member.js" new file mode 100644 index 0000000..c6d6f78 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/member.js" @@ -0,0 +1,22 @@ +var member = [ + { + "phone": "商务部", + "name": "杨德莲" + }, + { + "phone": "商务部", + "name": "张伟彬" + }, + { + "phone": "商务部", + "name": "彭耐" + }, + { + "phone": "商务部", + "name": "白利平" + }, + { + "phone": "商务部", + "name": "丁圣" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/result.html" new file mode 100755 index 0000000..9f35db2 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\345\225\206\345\212\241\351\203\250/result.html" @@ -0,0 +1,90 @@ + + + + + + + 年会抽奖小程序 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/.DS_Store" new file mode 100644 index 0000000..09bbd47 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/reset.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/reset.css" new file mode 100644 index 0000000..bb9d34f --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/reset.css" @@ -0,0 +1,57 @@ +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; +} + +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, +form, fieldset, input, textarea, p, blockquote, th, td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, img { + border: 0; +} + +address, caption, cite, code, dfn, em, strong, th, var { + font-weight: normal; + font-style: normal; +} + +ol, ul { + list-style: none; +} + +caption, th { + text-align: left; +} + +h1, h2, h3, h4, h5, h6, i { + font-weight: normal; + font-style: normal; + font-size: 100%; +} + +q:before, q:after { + content:''; +} + +abbr, acronym { + border: 0; +} + +body { + font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/wall.css" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/wall.css" new file mode 100644 index 0000000..0ce63f4 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/css/wall.css" @@ -0,0 +1,140 @@ +html, body {width: 100%; height: 100%;} +.wall {width: 100%; height: 100%; + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100% ; + background-position: center center; + background-repeat: no-repeat;} +.photos-wall {width:100%; height:100%;} +.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} + + +/*照片墙*/ +.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} +.wall .photo-title { + position: absolute; + top: -280px; left: 50%; + background: url(../img/title.png) no-repeat 0 0; + background-size: 100% auto; + width: 800px; height: 350px; + margin-left: -350px; +} +/* +.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; + background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ +.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} +.wall .photo {position: absolute;} +.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} +.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} +.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} +.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} +.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} +@-webkit-keyframes show_photo{ + 0% {opacity:0;-webkit-transform:scale(0, 0);} + 100% { opacity:1;-webkit-transform:scale(1, 1);} +} +@-webkit-keyframes hide_photo{ + 0% {opacity:1;} + 100% { opacity:0;} +} +/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ +/*.wall .photo .photo-inner .show{opacity: 1;}*/ +/*.wall .photo .photo-inner .hide{opacity: 0;}*/ + +.wall .photo img { + width: 100%; height: 100%; + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); +} + +.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} +.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} +.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} +.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} +.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} +.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} +.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} +.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} + +.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} +.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} +.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} +.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} +.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} +.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} +.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} + +.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} + +.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} +.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} + +.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} + +.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} +.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} +.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} +.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} +.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} +.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} +.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} +.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} +.wall .pos-27{ + top: 15px; +left: 685px; +width: 65px; +height: 65px;} +.wall .pos-28{top: -67px; +left: 685px; +width: 75px; +height: 75px;} + + + +.wall .pos-29{top: 103px; +left: -44px; +width: 75px; +height: 75px;} +.wall .pos-30{top: -45px; +left: -81px; +width: 75px; +height: 75px;} + +.wall .pos-31 { +top: 295px; +left: 105px; +width: 60px; +height: 60px; +} + +.wall .pos-32 { +top: 240px; +left: 675px; +width: 65px; +height: 65px; +} + +.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} +/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ +/*.wall .message { margin: 25px 35px 25px 10px;}*/ +.wall .message {margin: 25px 35px 25px 50px;} +.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} + +.wall .message{height: auto;overflow: hidden;opacity: 1;} +.wall .message.newMsg {-webkit-animation: change_height .7s linear;} + @-webkit-keyframes change_height{ + 0% {opacity:0;height: 0;} + 100% { opacity:1;height:32px;} + } + +.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} + +.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} + +#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} +#qrcode img{width:100%;} +#qrcode {background: white; padding: 5px;} + +.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/.DS_Store" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/.DS_Store" new file mode 100644 index 0000000..5008ddf Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/.DS_Store" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/btn_exit.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/btn_exit.png" new file mode 100644 index 0000000..4b56159 Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/btn_exit.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/icon-wall.jpg" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/icon-wall.jpg" new file mode 100644 index 0000000..b55eede Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/icon-wall.jpg" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/title.png" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/title.png" new file mode 100644 index 0000000..297ee2c Binary files /dev/null and "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/img/title.png" differ diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/index.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/index.html" new file mode 100755 index 0000000..86b2231 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/index.html" @@ -0,0 +1,279 @@ + + + + + + + 健耕销售抽奖 + + + + + + +
    +
    +
    + + + +
    + + + + + + + diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/member.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/member.js" new file mode 100644 index 0000000..db78cbb --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/member.js" @@ -0,0 +1,30 @@ +var member = [ + { + "phone": "西北大区", + "name": "袁立娟" + }, + { + "phone": "西北大区", + "name": "李小鸥" + }, + { + "phone": "西北大区", + "name": "郭凤怡" + }, + { + "phone": "西北大区", + "name": "王倩影" + }, + { + "phone": "西北大区", + "name": "刘鸿祥" + }, + { + "phone": "西北大区", + "name": "李烈艳" + }, + { + "phone": "西北大区", + "name": "李喆" + }, +] \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/tagcanvas.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/tagcanvas.js" new file mode 100644 index 0000000..24523e6 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/tagcanvas.js" @@ -0,0 +1,2102 @@ +/** + * Copyright (C) 2010-2015 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.7 + * For more information, please contact + */ +(function(){ +"use strict"; +var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, + min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, + hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { + 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", + 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", + b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", + e:"238,", E:"238,", f:"255,", F:"255," + }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, + doc = document, ocanvas, handlers = {}; +for(i = 0; i < 256; ++i) { + j = i.toString(16); + if(i < 16) + j = '0' + j; + hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; +} +function Defined(d) { + return typeof d != 'undefined'; +} +function IsObject(o) { + return typeof o == 'object' && o != null; +} +function Clamp(v, mn, mx) { + return isNaN(v) ? mx : min(mx, max(mn, v)); +} +function Nop() { + return false; +} +function TimeNow() { + return new Date().valueOf(); +} +function SortList(l, f) { + var nl = [], tl = l.length, i; + for(i = 0; i < tl; ++i) + nl.push(l[i]); + nl.sort(f); + return nl; +} +function Shuffle(a) { + var i = a.length-1, t, p; + while(i) { + p = ~~(Math.random()*i); + t = a[i]; + a[i] = a[p]; + a[p] = t; + --i; + } +} +function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; +} +Vproto = Vector.prototype; +Vproto.length = function() { + return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); +}; +Vproto.dot = function(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; +}; +Vproto.cross = function(v) { + var x = this.y * v.z - this.z * v.y, + y = this.z * v.x - this.x * v.z, + z = this.x * v.y - this.y * v.x; + return new Vector(x, y, z); +}; +Vproto.angle = function(v) { + var dot = this.dot(v), ac; + if(dot == 0) + return Math.PI / 2.0; + ac = dot / (this.length() * v.length()); + if(ac >= 1) + return 0; + if(ac <= -1) + return Math.PI; + return Math.acos(ac); +}; +Vproto.unit = function() { + var l = this.length(); + return new Vector(this.x / l, this.y / l, this.z / l); +}; +function MakeVector(lg, lt) { + lt = lt * Math.PI / 180; + lg = lg * Math.PI / 180; + var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); + return new Vector(x, y, z); +} +function Matrix(a) { + this[1] = {1: a[0], 2: a[1], 3: a[2]}; + this[2] = {1: a[3], 2: a[4], 3: a[5]}; + this[3] = {1: a[6], 2: a[7], 3: a[8]}; +} +Mproto = Matrix.prototype; +Matrix.Identity = function() { + return new Matrix([1,0,0, 0,1,0, 0,0,1]); +}; +Matrix.Rotation = function(angle, u) { + var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; + return new Matrix([ + cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, + u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, + u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos + ]); +} +Mproto.mul = function(m) { + var a = [], i, j, mmatrix = (m.xform ? 1 : 0); + for(i = 1; i <= 3; ++i) + for(j = 1; j <= 3; ++j) { + if(mmatrix) + a.push(this[i][1] * m[1][j] + + this[i][2] * m[2][j] + + this[i][3] * m[3][j]); + else + a.push(this[i][j] * m); + } + return new Matrix(a); +}; +Mproto.xform = function(p) { + var a = {}, x = p.x, y = p.y, z = p.z; + a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; + a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; + a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; + return a; +}; +function PointsOnSphere(n,xr,yr,zr) { + var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; + for(i = 0; i < n; ++i) { + y = i * off - 1 + (off / 2); + r = sqrt(1 - y*y); + phi = i * inc; + pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); + } + return pts; +} +function Cylinder(n,o,xr,yr,zr) { + var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; + for(i = 0; i < n; ++i) { + j = i * off - 1 + (off / 2); + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function Ring(o, n, xr, yr, zr, j) { + var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; + for(i = 0; i < n; ++i) { + phi = i * inc; + k = cos(phi); + l = sin(phi); + pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); + } + return pts; +} +function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } +function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } +function PointsOnRingV(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(0, n, xr, yr, zr, offset); +} +function PointsOnRingH(n, xr, yr, zr, offset) { + offset = isNaN(offset) ? 0 : offset * 1; + return Ring(1, n, xr, yr, zr, offset); +} +function CentreImage(t) { + var i = new Image; + i.onload = function() { + var dx = i.width / 2, dy = i.height / 2; + t.centreFunc = function(c, w, h, cx, cy) { + c.setTransform(1, 0, 0, 1, 0, 0); + c.globalAlpha = 1; + c.drawImage(i, cx - dx, cy - dy); + }; + }; + i.src = t.centreImage; +} +function SetAlpha(c,a) { + var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; + if(c[0] === '#') { + if(!hexlookup3[c]) + if(c.length === 4) + hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; + else + hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; + d = hexlookup3[c] + ae; + } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { + d = (c.replace('(','a(').replace(')', ',' + ae)); + } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { + p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); + a *= parseFloat(c.substring(p1,p2)); + d = c.substr(0,p1) + a.toPrecision(3) + ')'; + } + return d; +} +function NewCanvas(w,h) { + // if using excanvas, give up now + if(window.G_vmlCanvasManager) + return null; + var c = doc.createElement('canvas'); + c.width = w; + c.height = h; + return c; +} +// I think all browsers pass this test now... +function ShadowAlphaBroken() { + var cv = NewCanvas(3,3), c, i; + if(!cv) + return false; + c = cv.getContext('2d'); + c.strokeStyle = '#000'; + c.shadowColor = '#fff'; + c.shadowBlur = 3; + c.globalAlpha = 0; + c.strokeRect(2,2,2,2); + c.globalAlpha = 1; + i = c.getImageData(2,2,1,1); + cv = null; + return (i.data[0] > 0); +} +function SetGradient(c, l, o, g) { + var gd = c.createLinearGradient(0, 0, l, 0), i; + for(i in g) + gd.addColorStop(1 - i, g[i]); + c.fillStyle = gd; + c.fillRect(0, o, l, 1); +} +function FindGradientColour(tc, p, r) { + var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; + if(tc.gCanvas) { + c = tc.gCanvas.getContext('2d'); + h = tc.gCanvas.height; + } else { + if(IsObject(gl[0])) + h = gl.length; + else + gl = [gl]; + tc.gCanvas = cv = NewCanvas(l, h); + if(!cv) + return null; + c = cv.getContext('2d'); + for(i = 0; i < h; ++i) + SetGradient(c, l, i, gl[i]); + } + r = max(min(r || 0, h - 1), 0); + d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; + return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; +} +function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, + shadowBlur, shadowOffsets, maxWidth, widths, align) { + var xo = padx + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), + yo = pady + (shadowBlur || 0) + + (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; + ctxt.font = font; + ctxt.textBaseline = 'top'; + ctxt.fillStyle = colour; + shadowColour && (ctxt.shadowColor = shadowColour); + shadowBlur && (ctxt.shadowBlur = shadowBlur); + shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], + ctxt.shadowOffsetY = shadowOffsets[1]); + for(i = 0; i < strings.length; ++i) { + xc = 0; + if(widths) { + if('right' == align) { + xc = maxWidth - widths[i]; + } else if('centre' == align) { + xc = (maxWidth - widths[i]) / 2; + } + } + ctxt.fillText(strings[i], xo + xc, yo); + yo += parseInt(font); + } +} +function RRect(c, x, y, w, h, r, s) { + if(r) { + c.beginPath(); + c.moveTo(x, y + h - r); + c.arcTo(x, y, x + r, y, r); + c.arcTo(x + w, y, x + w, y + r, r); + c.arcTo(x + w, y + h, x + w - r, y + h, r); + c.arcTo(x, y + h, x, y + h - r, r); + c.closePath(); + c[s ? 'stroke' : 'fill'](); + } else { + c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); + } +} +function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, + scale) { + this.strings = strings; + this.font = font; + this.width = w; + this.height = h; + this.maxWidth = maxWidth; + this.stringWidths = stringWidths; + this.align = align; + this.valign = valign; + this.scale = scale; +} +TCVproto = TextCanvas.prototype; +TCVproto.SetImage = function(image, w, h, position, padding, align, valign, + scale) { + this.image = image; + this.iwidth = w * this.scale; + this.iheight = h * this.scale; + this.ipos = position; + this.ipad = padding * this.scale; + this.iscale = scale; + this.ialign = align; + this.ivalign = valign; +}; +TCVproto.Align = function(size, space, a) { + var pos = 0; + if(a == 'right' || a == 'bottom') + pos = space - size; + else if(a != 'left' && a != 'top') + pos = (space - size) / 2; + return pos; +}; +TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, + shadowColour, shadowBlur, shadowOffsets, padding, radius) { + var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, + sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; + padding = max(padding, sox + shadowBlur, soy + shadowBlur); + x1 = 2 * (padding + bgOutlineThickness); + y1 = 2 * (padding + bgOutlineThickness); + cw = this.width + x1; + ch = this.height + y1; + offx = offy = padding + bgOutlineThickness; + + if(this.image) { + ix = iy = padding + bgOutlineThickness; + iw = this.iwidth; + ih = this.iheight; + if(this.ipos == 'top' || this.ipos == 'bottom') { + if(iw < this.width) + ix += this.Align(iw, this.width, this.ialign); + else + offx += this.Align(this.width, iw, this.align); + if(this.ipos == 'top') + offy += ih + this.ipad; + else + iy += this.height + this.ipad; + cw = max(cw, iw + x1); + ch += ih + this.ipad; + } else { + if(ih < this.height) + iy += this.Align(ih, this.height, this.ivalign); + else + offy += this.Align(this.height, ih, this.valign); + if(this.ipos == 'right') + ix += this.width + this.ipad; + else + offx += iw + this.ipad; + cw += iw + this.ipad; + ch = max(ch, ih + y1); + } + } + + cv = NewCanvas(cw, ch); + if(!cv) + return null; + x1 = y1 = bgOutlineThickness / 2; + x2 = cw - bgOutlineThickness; + y2 = ch - bgOutlineThickness; + c = cv.getContext('2d'); + if(bgColour) { + c.fillStyle = bgColour; + RRect(c, x1, y1, x2, y2, radius); + } + if(bgOutlineThickness) { + c.strokeStyle = bgOutline; + c.lineWidth = bgOutlineThickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + if(shadowBlur || sox || soy) { + // use a transparent canvas to draw on + shadowcv = NewCanvas(cw, ch); + if(shadowcv) { + shadowc = c; + c = shadowcv.getContext('2d'); + } + } + + // don't use TextSet shadow support because it adds space for shadow + TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], + this.maxWidth, this.stringWidths, this.align); + + if(this.image) + c.drawImage(this.image, ix, iy, iw, ih); + + if(shadowc) { + // draw the text and image with the added shadow + c = shadowc; + shadowColour && (c.shadowColor = shadowColour); + shadowBlur && (c.shadowBlur = shadowBlur); + c.shadowOffsetX = shadowOffsets[0]; + c.shadowOffsetY = shadowOffsets[1]; + c.drawImage(shadowcv, 0, 0); + } + return cv; +}; +function ExpandImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); + return cv; +} +function ScaleImage(i, w, h) { + var cv = NewCanvas(w, h), c; + if(!cv) + return null; + c = cv.getContext('2d'); + c.drawImage(i, 0, 0, w, h); + return cv; +} +function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, + padding, radius, ofill) { + var cw = w + ((2 * padding) + othickness) * scale, + ch = h + ((2 * padding) + othickness) * scale, + cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; + if(!cv) + return null; + othickness *= scale; + radius *= scale; + x1 = y1 = othickness / 2; + x2 = cw - othickness; + y2 = ch - othickness; + padding = (padding * scale) + x1; // add space for outline + c = cv.getContext('2d'); + if(colour) { + c.fillStyle = colour; + RRect(c, x1, y1, x2, y2, radius); + } + if(othickness) { + c.strokeStyle = ocolour; + c.lineWidth = othickness; + RRect(c, x1, y1, x2, y2, radius, true); + } + + if(ofill) { + // use compositing to colour in the image and border + ocanvas = NewCanvas(cw, ch); + cc = ocanvas.getContext('2d'); + cc.drawImage(i, padding, padding, w, h); + cc.globalCompositeOperation = 'source-in'; + cc.fillStyle = ocolour; + cc.fillRect(0, 0, cw, ch); + cc.globalCompositeOperation = 'destination-over'; + cc.drawImage(cv, 0, 0); + cc.globalCompositeOperation = 'source-over'; + c.drawImage(ocanvas, 0, 0); + } else { + c.drawImage(i, padding, padding, i.width, i.height); + } + return {image: cv, width: cw / scale, height: ch / scale}; +} +/** + * Creates a new canvas containing the image and its shadow + * Returns an object containing the image and its dimensions at z=0 + */ +function AddShadowToImage(i, w, h, scale, sc, sb, so) { + var sw = abs(so[0]), sh = abs(so[1]), + cw = w + (sw > sb ? sw + sb : sb * 2) * scale, + ch = h + (sh > sb ? sh + sb : sb * 2) * scale, + xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), + yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; + cv = NewCanvas(cw, ch); + if(!cv) + return null; + c = cv.getContext('2d'); + sc && (c.shadowColor = sc); + sb && (c.shadowBlur = sb * scale); + so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); + c.drawImage(i, xo, yo, w, h); + return {image: cv, width: cw / scale, height: ch / scale}; +} +function FindTextBoundingBox(s,f,ht) { + var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), + cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; + if(!cv) + return null; + c = cv.getContext('2d'); + c.fillStyle = '#000'; + c.fillRect(0,0,w,h); + TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') + + idata = c.getImageData(0,0,w,h); + w1 = idata.width; h1 = idata.height; + ex = { + min: { x: w1, y: h1 }, + max: { x: -1, y: -1 } + }; + for(y = 0; y < h1; ++y) { + for(x = 0; x < w1; ++x) { + i = (y * w1 + x) * 4; + if(idata.data[i+1] > 0) { + if(x < ex.min.x) ex.min.x = x; + if(x > ex.max.x) ex.max.x = x; + if(y < ex.min.y) ex.min.y = y; + if(y > ex.max.y) ex.max.y = y; + } + } + } + // device pixels might not be css pixels + if(w1 != w) { + ex.min.x *= (w / w1); + ex.max.x *= (w / w1); + } + if(h1 != h) { + ex.min.y *= (w / h1); + ex.max.y *= (w / h1); + } + + cv = null; + return ex; +} +function FixFont(f) { + return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; +} +function AddHandler(h,f,e) { + e = e || doc; + if(e.addEventListener) + e.addEventListener(h,f,false); + else + e.attachEvent('on' + h, f); +} +function RemoveHandler(h,f,e) { + e = e || doc; + if(e.removeEventListener) + e.removeEventListener(h, f); + else + e.detachEvent('on' + h, f); +} +function AddImage(i, o, t, tc) { + var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; + // image not loaded, wait for image onload + if(!o.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); + if(!i.complete) + return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); + + // Yes, this does look like nonsense, but it makes sure that both the + // width and height are actually set and not just calculated. This is + // required to keep proportional sizes when the images are hidden, so + // the images can be used again for another cloud. + o.width = o.width; + o.height = o.height; + + if(s) { + i.width = o.width * s; + i.height = o.height * s; + } + // the standard width of the image, with imageScale applied + t.iw = i.width; + t.ih = i.height; + if(tc.txtOpt) { + ic = i; + mscale = tc.zoomMax * tc.txtScale; + iw = t.iw * mscale; + ih = t.ih * mscale; + if(iw < o.naturalWidth || ih < o.naturalHeight) { + ic = ScaleImage(i, iw, ih); + if(ic) + t.fimage = ic; + } else { + iw = t.iw; + ih = t.ih; + mscale = 1; + } + if(!t.HasText()) { + if(tc.shadow) { + ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, + tc.shadowOffset); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.bgColour || tc.bgOutlineThickness) { + bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : + tc.bgColour; + oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : + (tc.bgOutline || tc.textColour); + iw = t.fimage.width; + ih = t.fimage.height; + if(tc.outlineMethod == 'colour') { + // create the outline version first, using the current image state + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); + if(ic) + t.oimage = ic.image; + } + ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, + tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); + if(ic) { + t.fimage = ic.image; + t.w = ic.width; + t.h = ic.height; + } + } + if(tc.outlineMethod == 'size') { + if(tc.outlineIncrease > 0) { + t.iw += 2 * tc.outlineIncrease; + t.ih += 2 * tc.outlineIncrease; + iw = mscale * t.iw; + ih = mscale * t.ih; + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ic; + t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); + } else { + iw = mscale * (t.iw + (2 * tc.outlineIncrease)); + ih = mscale * (t.ih + (2 * tc.outlineIncrease)); + ic = ScaleImage(t.fimage, iw, ih); + t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); + } + } + } + } + t.Init(); +} +function GetProperty(e,p) { + var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); + return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || + (e.currentStyle && e.currentStyle[pc]); +} +function FindWeight(a, wFrom, tHeight) { + var w = 1, p; + if(wFrom) { + w = 1 * (a.getAttribute(wFrom) || tHeight); + } else if(p = GetProperty(a,'font-size')) { + w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || + (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || + p * 3.3; + } + return w; +} +function EventToCanvasId(e) { + return e.target && Defined(e.target.id) ? e.target.id : + e.srcElement.parentNode.id; +} +function EventXY(e, c) { + var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, + ymul = parseInt(GetProperty(c, 'height')) / c.height; + if(Defined(e.offsetX)) { + xy = {x: e.offsetX, y: e.offsetY}; + } else { + p = AbsPos(c.id); + if(Defined(e.changedTouches)) + e = e.changedTouches[0]; + if(e.pageX) + xy = {x: e.pageX - p.x, y: e.pageY - p.y}; + } + if(xy && xmul && ymul) { + xy.x /= xmul; + xy.y /= ymul; + } + return xy; +} +function MouseOut(e) { + var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; + if(tc) { + tc.mx = tc.my = -1; + tc.UnFreeze(); + tc.EndDrag(); + } +} +function MouseMove(e) { + return; + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + if(tg && t.tc[tg]) { + tc = t.tc[tg]; + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.Drag(e, p); + } + tc.drawn = 0; + } +} +function MouseDown(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e); + if(tg && e.button == cb && t.tc[tg]) { + t.tc[tg].BeginDrag(e); + } +} +function MouseUp(e) { + var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, + tg = EventToCanvasId(e), tc; + if(tg && e.button == cb && t.tc[tg]) { + tc = t.tc[tg]; + MouseMove(e); + if(!tc.EndDrag() && !tc.touchState) + tc.Clicked(e); + } +} +function TouchDown(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; + if(tc && e.changedTouches) { + if(e.touches.length == 1 && tc.touchState == 0) { + tc.touchState = 1; + tc.BeginDrag(e); + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + tc.drawn = 0; + } + } else if(e.targetTouches.length == 2 && tc.pinchZoom) { + tc.touchState = 3; + tc.EndDrag(); + tc.BeginPinch(e); + } else { + tc.EndDrag(); + tc.EndPinch(); + tc.touchState = 0; + } + } +} +function TouchUp(e) { + var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); + if(tc && e.changedTouches) { + switch(tc.touchState) { + case 1: + tc.Draw(); + tc.Clicked(); + break; + case 2: + tc.EndDrag(); + break; + case 3: + tc.EndPinch(); + } + tc.touchState = 0; + } +} +function TouchMove(e) { + var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); + for(i in t.tc) { + tc = t.tc[i]; + if(tc.tttimer) { + clearTimeout(tc.tttimer); + tc.tttimer = null; + } + } + tc = (tg && t.tc[tg]); + if(tc && e.changedTouches && tc.touchState) { + switch(tc.touchState) { + case 1: + case 2: + if(p = EventXY(e, tc.canvas)) { + tc.mx = p.x; + tc.my = p.y; + if(tc.Drag(e, p)) + tc.touchState = 2; + } + break; + case 3: + tc.Pinch(e); + } + tc.drawn = 0; + } +} +function MouseWheel(e) { + var t = TagCanvas, tg = EventToCanvasId(e); + if(tg && t.tc[tg]) { + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); + t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); + } +} +function DrawCanvas() { + DrawCanvasRAF(TimeNow()); +} +function DrawCanvasRAF(t) { + var tc = TagCanvas.tc, i; + TagCanvas.NextFrame(TagCanvas.interval); + t = t || TimeNow(); + for(i in tc) + tc[i].Draw(t); +} +function AbsPos(id) { + var e = doc.getElementById(id), r = e.getBoundingClientRect(), + dd = doc.documentElement, b = doc.body, w = window, + xs = w.pageXOffset || dd.scrollLeft, + ys = w.pageYOffset || dd.scrollTop, + xo = dd.clientLeft || b.clientLeft, + yo = dd.clientTop || b.clientTop; + return { x: r.left + xs - xo, y: r.top + ys - yo }; +} +function Project(tc,p1,sx,sy) { + var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); + return { + x: p1.x * m * sx, + y: p1.y * m * sy, + z: p1.z, + w: (tc.z1 - p1.z) / tc.z2 + }; +} +/** + * @constructor + * for recursively splitting tag contents on
    tags + */ +function TextSplitter(e) { + this.e = e; + this.br = 0; + this.line = []; + this.text = []; + this.original = e.innerText || e.textContent; +} +TSproto = TextSplitter.prototype; +TSproto.Empty = function() { + for(var i = 0; i < this.text.length; ++i) + if(this.text[i].length) + return false; + return true; +}; +TSproto.Lines = function(e) { + var r = e ? 1 : 0, cn, cl, i; + e = e || this.e; + cn = e.childNodes; + cl = cn.length; + + for(i = 0; i < cl; ++i) { + if(cn[i].nodeName == 'BR') { + this.text.push(this.line.join(' ')); + this.br = 1; + } else if(cn[i].nodeType == 3) { + if(this.br) { + this.line = [cn[i].nodeValue]; + this.br = 0; + } else { + this.line.push(cn[i].nodeValue); + } + } else { + this.Lines(cn[i]); + } + } + r || this.br || this.text.push(this.line.join(' ')); + return this.text; +}; +TSproto.SplitWidth = function(w, c, f, h) { + var i, j, words, text = []; + c.font = h + 'px ' + f; + for(i = 0; i < this.text.length; ++i) { + words = this.text[i].split(/\s+/); + this.line = [words[0]]; + for(j = 1; j < words.length; ++j) { + if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { + text.push(this.line.join(' ')); + this.line = [words[j]]; + } else { + this.line.push(words[j]); + } + } + text.push(this.line.join(' ')); + } + return this.text = text; +}; +/** + * @constructor + */ +function Outline(tc,t) { + this.ts = TimeNow(); + this.tc = tc; + this.tag = t; + this.x = this.y = this.w = this.h = this.sc = 1; + this.z = 0; + this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? + this.DrawPulsate : this.DrawSimple; + this.radius = tc.outlineRadius | 0; + this.SetMethod(tc.outlineMethod); +} +Oproto = Outline.prototype; +Oproto.SetMethod = function(om) { + var methods = { + block: ['PreDraw','DrawBlock'], + colour: ['PreDraw','DrawColour'], + outline: ['PostDraw','DrawOutline'], + classic: ['LastDraw','DrawOutline'], + size: ['PreDraw','DrawColour'], + none: ['LastDraw'] + }, funcs = methods[om] || methods.outline; + if(om == 'none') { + this.Draw = function() { return 1; } + } else { + this.drawFunc = this[funcs[1]]; + } + this[funcs[0]] = this.Draw; +}; +Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { + var o = this.tc.outlineOffset, o2 = 2 * o; + this.x = sc * x + xo - o; + this.y = sc * y + yo - o; + this.w = sc * w + o2; + this.h = sc * h + o2; + this.sc = sc; // used to determine frontmost + this.z = z; +}; +Oproto.DrawOutline = function(c,x,y,w,h,colour) { + c.strokeStyle = colour; + RRect(c, x, y, w, h, this.radius, true); +}; +Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { + if(tag.oimage) { + tag.alpha = 1; + tag.Draw(c, x1, y1, tag.oimage); + return 1; + } + return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); +}; +Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { + var normal = tag.colour; + tag.colour = colour; + tag.alpha = 1; + tag.Draw(c,x1,y1); + tag.colour = normal; + return 1; +}; +Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { + var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), + fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; + if(ocanvas) + ocanvas.width = fw, ocanvas.height = fh; + else + ocanvas = NewCanvas(fw, fh); + if(!ocanvas) + return this.SetMethod('outline'); // if using IE and images, give up! + cc = ocanvas.getContext('2d'); + + cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); + c.clearRect(fx,fy,fw,fh); + tag.alpha = 1; + tag.Draw(c,x1,y1); + c.setTransform(1,0,0,1,0,0); + c.save(); + c.beginPath(); + c.rect(fx,fy,fw,fh); + c.clip(); + c.globalCompositeOperation = 'source-in'; + c.fillStyle = colour; + c.fillRect(fx,fy,fw,fh); + c.restore(); + c.globalCompositeOperation = 'destination-over'; + c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); + c.globalCompositeOperation = 'source-over'; + return 1; +}; +Oproto.DrawBlock = function(c,x,y,w,h,colour) { + c.fillStyle = colour; + RRect(c, x, y, w, h, this.radius); +}; +Oproto.DrawSimple = function(c, tag, x1, y1) { + var t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = 1; + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.DrawPulsate = function(c, tag, x1, y1) { + var diff = TimeNow() - this.ts, t = this.tc; + c.setTransform(1,0,0,1,0,0); + c.strokeStyle = t.outlineColour; + c.lineWidth = t.outlineThickness; + c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; + c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * + (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); + return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); +}; +Oproto.Active = function(c,x,y) { + return (x >= this.x && y >= this.y && + x <= this.x + this.w && y <= this.y + this.h); +}; +Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; +/** + * @constructor + */ +function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, + font, padding, original) { + this.tc = tc; + this.image = null; + this.text = text; + this.text_original = original; + this.line_widths = []; + this.title = a.title || null; + this.a = a; + this.position = new Vector(v[0], v[1], v[2]); + this.x = this.y = this.z = 0; + this.w = w; + this.h = h; + this.colour = col || tc.textColour; + this.bgColour = bcol || tc.bgColour; + this.bgRadius = bradius | 0; + this.bgOutline = boutline || this.colour; + this.bgOutlineThickness = bothickness | 0; + this.textFont = font || tc.textFont; + this.padding = padding | 0; + this.sc = this.alpha = 1; + this.weighted = !tc.weight; +} +Tproto = Tag.prototype; +Tproto.Init = function(e) { + var tc = this.tc; + this.outline = new Outline(tc,this); + this.textHeight = tc.textHeight; + if(this.HasText()) { + this.Measure(tc.ctxt,tc); + } else { + this.w = this.iw; + this.h = this.ih; + } + + this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; + this.SetDraw(tc); +}; +Tproto.Draw = Nop; +Tproto.HasText = function() { + return this.text && this.text[0].length > 0; +}; +Tproto.EqualTo = function(e) { + var i = e.getElementsByTagName('img'); + if(this.a.href != e.href) + return 0; + if(i.length) + return this.image.src == i[0].src; + return (e.innerText || e.textContent) == this.text_original; +}; +Tproto.SetImage = function(i) { + this.image = this.fimage = i; +}; +Tproto.SetDraw = function(t) { + this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; + t.noSelect && (this.CheckActive = Nop); +}; +Tproto.MeasureText = function(c) { + var i, l = this.text.length, w = 0, wl; + for(i = 0; i < l; ++i) { + this.line_widths[i] = wl = c.measureText(this.text[i]).width; + w = max(w, wl); + } + return w; +}; +Tproto.Measure = function(c,t) { + var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), + s, th, f, soff, cw, twidth, theight, img, tcv; + // add the gap at the top to the height to make equal gap at bottom + theight = extents ? extents.max.y + extents.min.y : this.textHeight; + c.font = this.font = this.textHeight + 'px ' + this.textFont; + twidth = this.MeasureText(c); + if(t.txtOpt) { + s = t.txtScale; + th = s * this.textHeight; + f = th + 'px ' + this.textFont; + soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; + c.font = f; + cw = this.MeasureText(c); + tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + + if(this.image) + tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + img = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + // add outline image using highlight colour + if(t.outlineMethod == 'colour') { + this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + } else if(t.outlineMethod == 'size') { + extents = FindTextBoundingBox(this.text, this.textFont, + this.textHeight + t.outlineIncrease); + th = extents.max.y + extents.min.y; + f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; + c.font = f; + cw = this.MeasureText(c); + + tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, + this.line_widths, t.textAlign, t.textVAlign, s); + if(this.image) + tcv.SetImage(this.image, this.iw + t.outlineIncrease, + this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, + t.imageAlign, t.imageVAlign, t.imageScale); + + this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, + s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, + s * this.padding, s * this.bgRadius); + + if(t.outlineIncrease > 0) + img = ExpandImage(img, this.oimage.width, this.oimage.height); + else + this.oimage = ExpandImage(this.oimage, img.width, img.height); + } + if(img) { + this.fimage = img; + twidth = this.fimage.width / s; + theight = this.fimage.height / s; + } + this.SetDraw(t); + t.txtOpt = !!this.fimage; + } + this.h = theight; + this.w = twidth; +}; +Tproto.SetFont = function(f, c, bc, boc) { + this.textFont = f; + this.colour = c; + this.bgColour = bc; + this.bgOutline = boc; + this.Measure(this.tc.ctxt, this.tc); +}; +Tproto.SetWeight = function(w) { + var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; + if(!this.HasText()) + return; + this.weighted = true; + for(s = 0; s < wl; ++s) { + m = modes[s] || 'size'; + if('both' == m) { + this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], + tc.max_weight[s], s); + this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], + tc.max_weight[s], s); + } else { + this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); + } + } + this.Measure(tc.ctxt, tc); +}; +Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { + w = isNaN(w) ? 1 : w; + var nweight = (w - wmin) / (wmax - wmin); + if('colour' == m) + this.colour = FindGradientColour(t, nweight, wnum); + else if('bgcolour' == m) + this.bgColour = FindGradientColour(t, nweight, wnum); + else if('bgoutline' == m) + this.bgOutline = FindGradientColour(t, nweight, wnum); + else if('size' == m) { + if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { + this.textHeight = t.weightSize * + (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); + } else { + // min textHeight of 1 + this.textHeight = max(1, w * t.weightSize); + } + } +}; +Tproto.SetShadowColourFixed = function(c,s,a) { + c.shadowColor = s; +}; +Tproto.SetShadowColourAlpha = function(c,s,a) { + c.shadowColor = SetAlpha(s, a); +}; +Tproto.DrawText = function(c,xoff,yoff) { + var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; + c.globalAlpha = this.alpha; + c.fillStyle = this.colour; + t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); + c.font = this.font; + x += xoff / s; + y += (yoff / s) - (this.h / 2); + for(i = 0; i < this.text.length; ++i) { + xl = x; + if('right' == t.textAlign) { + xl += this.w / 2 - this.line_widths[i]; + } else if('centre' == t.textAlign) { + xl -= this.line_widths[i] / 2; + } else { + xl -= this.w / 2; + } + c.setTransform(s, 0, 0, s, s * xl, s * y); + c.fillText(this.text[i], 0, 0); + y += this.textHeight; + } +}; +Tproto.DrawImage = function(c,xoff,yoff,im) { + var x = this.x, y = this.y, s = this.sc, + i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, + shadow = this.shadow; + c.globalAlpha = a; + shadow && this.SetShadowColour(c,shadow,a); + x += (xoff / s) - (w / 2); + y += (yoff / s) - (h / 2); + c.setTransform(s, 0, 0, s, s * x, s * y); + c.drawImage(i, 0, 0, w, h); +}; +Tproto.DrawImageIE = function(c,xoff,yoff) { + var i = this.fimage, s = this.sc, + w = i.width = this.w*s, h = i.height = this.h * s, + x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); + c.setTransform(1,0,0,1,0,0); + c.globalAlpha = this.alpha; + c.drawImage(i, x, y); +}; +Tproto.Calc = function(m,a) { + var pp, t = this.tc, mnb = t.minBrightness, + mxb = t.maxBrightness, r = t.max_radius; + pp = m.xform(this.position); + this.xformed = pp; + pp = Project(t, pp, t.stretchX, t.stretchY); + this.x = pp.x; + this.y = pp.y; + this.z = pp.z; + this.sc = pp.w; + this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); +}; +Tproto.UpdateActive = function(c, xoff, yoff) { + var o = this.outline, w = this.w, h = this.h, + x = this.x - w/2, y = this.y - h/2; + o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); + return o; +}; +Tproto.CheckActive = function(c,xoff,yoff) { + var t = this.tc, o = this.UpdateActive(c, xoff, yoff); + return o.Active(c, t.mx, t.my) ? o : null; +}; +Tproto.Clicked = function(e) { + var a = this.a, t = a.target, h = a.href, evt; + if(t != '' && t != '_self') { + if(self.frames[t]) { + self.frames[t].document.location = h; + } else{ + try { + if(top.frames[t]) { + top.frames[t].document.location = h; + return; + } + } catch(err) { + // different domain/port/protocol? + } + window.open(h, t); + } + return; + } + if(doc.createEvent) { + evt = doc.createEvent('MouseEvents'); + evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); + if(!a.dispatchEvent(evt)) + return; + } else if(a.fireEvent) { + if(!a.fireEvent('onclick')) + return; + } + doc.location = h; +}; +/** + * @constructor + */ +function TagCanvas(cid,lctr,opt) { + var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; + + if(!c) throw 0; + if(Defined(window.G_vmlCanvasManager)) { + c = window.G_vmlCanvasManager.initElement(c); + this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); + } + if(c && (!c.getContext || !c.getContext('2d').fillText)) { + p = doc.createElement('DIV'); + for(i = 0; i < cp.length; ++i) + p[cp[i]] = c[cp[i]]; + c.parentNode.insertBefore(p,c); + c.parentNode.removeChild(c); + throw 0; + } + for(i in TagCanvas.options) + this[i] = opt && Defined(opt[i]) ? opt[i] : + (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); + + this.canvas = c; + this.ctxt = c.getContext('2d'); + this.z1 = 250 / max(this.depth, 0.001); + this.z2 = this.z1 / this.zoom; + this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas + this.max_radius = 100; + this.max_weight = []; + this.min_weight = []; + this.textFont = this.textFont && FixFont(this.textFont); + this.textHeight *= 1; + this.pulsateTo = Clamp(this.pulsateTo, 0, 1); + this.minBrightness = Clamp(this.minBrightness, 0, 1); + this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); + this.ctxt.textBaseline = 'top'; + this.lx = (this.lock + '').indexOf('x') + 1; + this.ly = (this.lock + '').indexOf('y') + 1; + this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; + this.fixedAlpha = 1; + this.source = lctr || cid; + this.repeatTags = min(64, ~~this.repeatTags); + this.minTags = min(200, ~~this.minTags); + if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) + this.repeatTags = ceil(this.minTags / i) - 1; + this.transform = Matrix.Identity(); + this.startTime = this.time = TimeNow(); + this.mx = this.my = -1; + this.centreImage && CentreImage(this); + this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; + this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? + TagCanvas[this.animTiming] : TagCanvas.Smooth); + if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { + // let the browser translate "red" into "#ff0000" + this.ctxt.shadowColor = this.shadow; + this.shadow = this.ctxt.shadowColor; + this.shadowAlpha = ShadowAlphaBroken(); + } else { + delete this.shadow; + } + this.Load(); + if(lctr && this.hideTags) { + (function(t) { + if(TagCanvas.loaded) + t.HideTags(); + else + AddHandler('load', function() { t.HideTags(); }, window); + })(this); + } + + this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; + this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; + if(this.tooltip) { + this.ctitle = c.title; + c.title = ''; + if(this.tooltip == 'native') { + this.Tooltip = this.TooltipNative; + } else { + this.Tooltip = this.TooltipDiv; + if(!this.ttdiv) { + this.ttdiv = doc.createElement('div'); + this.ttdiv.className = this.tooltipClass; + this.ttdiv.style.position = 'absolute'; + this.ttdiv.style.zIndex = c.style.zIndex + 1; + AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); + doc.body.appendChild(this.ttdiv); + } + } + } else { + this.Tooltip = this.TooltipNone; + } + if(!this.noMouse && !handlers[cid]) { + handlers[cid] = [ + ['mousemove', MouseMove], + ['mouseout', MouseOut], + ['mouseup', MouseUp], + ['touchstart', TouchDown], + ['touchend', TouchUp], + ['touchcancel', TouchUp], + ['touchmove', TouchMove] + ]; + if(this.dragControl) { + handlers[cid].push(['mousedown', MouseDown]); + handlers[cid].push(['selectstart', Nop]); + } + if(this.wheelZoom) { + handlers[cid].push(['mousewheel', MouseWheel]); + handlers[cid].push(['DOMMouseScroll', MouseWheel]); + } + for(i = 0; i < handlers[cid].length; ++i) + AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); + } + if(!TagCanvas.started) { + raf = window.requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame; + TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : + TagCanvas.NextFrameTimeout; + TagCanvas.interval = this.interval; + TagCanvas.NextFrame(this.interval); + TagCanvas.started = 1; + } +} +TCproto = TagCanvas.prototype; +TCproto.SourceElements = function() { + if(doc.querySelectorAll) + return doc.querySelectorAll('#' + this.source); + return [doc.getElementById(this.source)]; +}; +TCproto.HideTags = function() { + var el = this.SourceElements(), i; + for(i = 0; i < el.length; ++i) + el[i].style.display = 'none'; +}; +TCproto.GetTags = function() { + var el = this.SourceElements(), etl, tl = [], i, j, k; + for(k = 0; k <= this.repeatTags; ++k) { + for(i = 0; i < el.length; ++i) { + etl = el[i].getElementsByTagName('a'); + for(j = 0; j < etl.length; ++j) { + tl.push(etl[j]); + } + } + } + return tl; +}; +TCproto.Message = function(text) { + var tl = [], i, p, tc = text.split(''), a, t, x, z; + for(i = 0; i < tc.length; ++i) { + if(tc[i] != ' ') { + p = i - tc.length / 2; + a = doc.createElement('A'); + a.href = '#'; + a.innerText = tc[i]; + x = 100 * sin(p / 9); + z = -100 * cos(p / 9); + t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, + 'monospace', 2, tc[i]); + t.Init(); + tl.push(t); + } + } + return tl; +}; +TCproto.CreateTag = function(e) { + var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; + if('text' != this.imageMode) { + im = e.getElementsByTagName('img'); + if(im.length) { + i = new Image; + i.src = im[0].src; + + if(!this.imageMode) { + t = new Tag(this, "", e, p, 0, 0); + t.SetImage(i); + //t.Init(); + AddImage(i, im[0], t, this); + return t; + } + } + } + if('image' != this.imageMode) { + ts = new TextSplitter(e); + txt = ts.Lines(); + if(!ts.Empty()) { + font = this.textFont || FixFont(GetProperty(e,'font-family')); + if(this.splitWidth) + txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); + + bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : + this.bgColour; + boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; + } else { + ts = null; + } + } + if(ts || i) { + t = new Tag(this, txt, e, p, 2, this.textHeight + 2, + this.textColour || GetProperty(e,'color'), bc, this.bgRadius, + boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); + if(i) { + t.SetImage(i); + AddImage(i, im[0], t, this); + } else { + t.Init(); + } + return t; + } +}; +TCproto.UpdateTag = function(t, a) { + var colour = this.textColour || GetProperty(a, 'color'), + font = this.textFont || FixFont(GetProperty(a, 'font-family')), + bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : + this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : + this.bgOutline; + t.a = a; + t.title = a.title; + if(t.colour != colour || t.textFont != font || t.bgColour != bc || + t.bgOutline != boc) + t.SetFont(font, colour, bc, boc); +}; +TCproto.Weight = function(tl) { + var ll = tl.length, w, i, s, weights = [], valid, + wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + wl = wfrom.length; + for(i = 0; i < ll; ++i) { + weights[i] = []; + for(s = 0; s < wl; ++s) { + w = FindWeight(tl[i].a, wfrom[s], this.textHeight); + if(!this.max_weight[s] || w > this.max_weight[s]) + this.max_weight[s] = w; + if(!this.min_weight[s] || w < this.min_weight[s]) + this.min_weight[s] = w; + weights[i][s] = w; + } + } + for(s = 0; s < wl; ++s) { + if(this.max_weight[s] > this.min_weight[s]) + valid = 1; + } + if(valid) { + for(i = 0; i < ll; ++i) { + tl[i].SetWeight(weights[i]); + } + } +}; +TCproto.Load = function() { + var tl = this.GetTags(), taglist = [], shape, t, + shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { + sphere: PointsOnSphere, + vcylinder: PointsOnCylinderV, + hcylinder: PointsOnCylinderH, + vring: PointsOnRingV, + hring: PointsOnRingH + }; + + if(tl.length) { + tagmap.length = tl.length; + for(i = 0; i < tl.length; ++i) + tagmap[i] = i; + this.shuffleTags && Shuffle(tagmap); + rx = 100 * this.radiusX; + ry = 100 * this.radiusY; + rz = 100 * this.radiusZ; + this.max_radius = max(rx, max(ry, rz)); + + for(i = 0; i < tl.length; ++i) { + t = this.CreateTag(tl[tagmap[i]]); + if(t) + taglist.push(t); + } + this.weight && this.Weight(taglist, true); + + if(this.shapeArgs) { + this.shapeArgs[0] = taglist.length; + } else { + shapeArgs = this.shape.toString().split(/[(),]/); + shape = shapeArgs.shift(); + if(typeof window[shape] === 'function') + this.shape = window[shape]; + else + this.shape = pfuncs[shape] || pfuncs.sphere; + this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); + } + vl = this.shape.apply(this, this.shapeArgs); + this.listLength = taglist.length; + for(i = 0; i < taglist.length; ++i) + taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + } + if(this.noTagsMessage && !taglist.length) + taglist = this.Message('No tags'); + this.taglist = taglist; +}; +TCproto.Update = function() { + var tl = this.GetTags(), newlist = [], + taglist = this.taglist, found, + added = [], removed = [], vl, ol, nl, i, j; + + if(!this.shapeArgs) + return this.Load(); + + if(tl.length) { + nl = this.listLength = tl.length; + ol = taglist.length; + + // copy existing list, populate "removed" + for(i = 0; i < ol; ++i) { + newlist.push(taglist[i]); + removed.push(i); + } + + // find added and removed tags + for(i = 0; i < nl; ++i) { + for(j = 0, found = 0; j < ol; ++j) { + if(taglist[j].EqualTo(tl[i])) { + this.UpdateTag(newlist[j], tl[i]); + found = removed[j] = -1; + } + } + if(!found) + added.push(i); + } + + // clean out found tags from removed list + for(i = 0, j = 0; i < ol; ++i) { + if(removed[j] == -1) + removed.splice(j,1); + else + ++j; + } + + // insert new tags in gaps where old tags removed + if(removed.length) { + Shuffle(removed); + while(removed.length && added.length) { + i = removed.shift(); + j = added.shift(); + newlist[i] = this.CreateTag(tl[j]); + } + + // remove any more (in reverse order) + removed.sort(function(a,b) {return a-b}); + while(removed.length) { + newlist.splice(removed.pop(), 1); + } + } + + // add any extra tags + j = newlist.length / (added.length + 1); + i = 0; + while(added.length) { + newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); + } + + // assign correct positions to tags + this.shapeArgs[0] = nl = newlist.length; + vl = this.shape.apply(this, this.shapeArgs); + for(i = 0; i < nl; ++i) + newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); + + // reweight tags + this.weight && this.Weight(newlist); + } + this.taglist = newlist; +}; +TCproto.SetShadow = function(c) { + c.shadowBlur = this.shadowBlur; + c.shadowOffsetX = this.shadowOffset[0]; + c.shadowOffsetY = this.shadowOffset[1]; +}; +TCproto.Draw = function(t) { + if(this.paused) + return; + var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, + tdelta = (t - this.time) * TagCanvas.interval / 1000, + x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, + active, a, i, aindex = -1, tl = this.taglist, l = tl.length, + frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; + this.time = t; + if(this.frozen && this.drawn) + return this.Animate(cw,ch,tdelta); + fixed = this.AnimateFixed(); + c.setTransform(1,0,0,1,0,0); + for(i = 0; i < l; ++i) + tl[i].Calc(this.transform, this.fixedAlpha); + tl = SortList(tl, function(a,b) {return b.z-a.z}); + + if(fixed && this.fixedAnim.active) { + active = this.fixedAnim.tag.UpdateActive(c, x, y); + } else { + this.active = null; + for(i = 0; i < l; ++i) { + a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); + if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { + active = a; + aindex = i; + active.tag = this.taglist[i]; + max_sc = a.sc; + } + } + this.active = active; + } + + this.txtOpt || (this.shadow && this.SetShadow(c)); + c.clearRect(0,0,cw,ch); + for(i = 0; i < l; ++i) { + if(!centreDrawn && tl[i].z <= 0) { + // run the centreFunc if the next tag is at the front + try { this.centreFunc(c, cw, ch, x, y); } + catch(e) { + alert(e); + // don't run it again + this.centreFunc = Nop; + } + centreDrawn = true; + } + + if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) + tl[i].Draw(c, x, y); + active && active.tag == tl[i] && active.PostDraw(c); + } + if(this.freezeActive && active) { + this.Freeze(); + } else { + this.UnFreeze(); + this.drawn = (l == this.listLength); + } + if(this.fixedCallback) { + this.fixedCallback(this,this.fixedCallbackTag); + this.fixedCallback = null; + } + fixed || this.Animate(cw, ch, tdelta); + active && active.LastDraw(c); + cv.style.cursor = active ? this.activeCursor : ''; + this.Tooltip(active,this.taglist[aindex]); +}; +TCproto.TooltipNone = function() { }; +TCproto.TooltipNative = function(active,tag) { + if(active) + this.canvas.title = tag && tag.title ? tag.title : ''; + else + this.canvas.title = this.ctitle; +}; +TCproto.SetTTDiv = function(title, tag) { + var tc = this, s = tc.ttdiv.style; + if(title != tc.ttdiv.innerHTML) + s.display = 'none'; + tc.ttdiv.innerHTML = title; + tag && (tag.title = tc.ttdiv.innerHTML); + if(s.display == 'none' && ! tc.tttimer) { + tc.tttimer = setTimeout(function() { + var p = AbsPos(tc.canvas.id); + s.display = 'block'; + s.left = p.x + tc.mx + 'px'; + s.top = p.y + tc.my + 24 + 'px'; + tc.tttimer = null; + }, tc.tooltipDelay); + } +}; +TCproto.TooltipDiv = function(active,tag) { + if(active && tag && tag.title) { + this.SetTTDiv(tag.title, tag); + } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { + this.SetTTDiv(this.ctitle); + } else { + this.ttdiv.style.display = 'none'; + } +}; +TCproto.Transform = function(tc, p, y) { + if(p || y) { + var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), + ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), + pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); + tc.transform = tc.transform.mul(ym.mul(pm)); + } +}; +TCproto.AnimateFixed = function() { + var fa, t1, angle, m, d; + if(this.fadeIn) { + t1 = TimeNow() - this.startTime; + if(t1 >= this.fadeIn) { + this.fadeIn = 0; + this.fixedAlpha = 1; + } else { + this.fixedAlpha = t1 / this.fadeIn; + } + } + if(this.fixedAnim) { + if(!this.fixedAnim.transform) + this.fixedAnim.transform = this.transform; + fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, + m, d = this.animTiming(fa.t, t1); + this.transform = fa.transform; + if(t1 >= fa.t) { + this.fixedCallbackTag = fa.tag; + this.fixedCallback = fa.cb; + this.fixedAnim = this.yaw = this.pitch = 0; + } else { + angle *= d; + } + m = Matrix.Rotation(angle, fa.axis); + this.transform = this.transform.mul(m); + return (this.fixedAnim != 0); + } + return false; +}; +TCproto.AnimatePosition = function(w, h, t) { + var tc = this, x = tc.mx, y = tc.my, s, r; + if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { + s = tc.maxSpeed, r = tc.reverse ? -1 : 1; + tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); + tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); + tc.initial = null; + } else if(!tc.initial) { + if(tc.frozen && !tc.freezeDecel) + tc.yaw = tc.pitch = 0; + else + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.AnimateDrag = function(w, h, t) { + var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; + if(tc.dx || tc.dy) { + tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); + tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); + tc.dx = tc.dy = 0; + tc.initial = null; + } else if(!tc.initial) { + tc.Decel(tc); + } + this.Transform(tc, tc.pitch, tc.yaw); +}; +TCproto.Freeze = function() { + if(!this.frozen) { + this.preFreeze = [this.yaw, this.pitch]; + this.frozen = 1; + this.drawn = 0; + } +}; +TCproto.UnFreeze = function() { + if(this.frozen) { + this.yaw = this.preFreeze[0]; + this.pitch = this.preFreeze[1]; + this.frozen = 0; + } +}; +TCproto.Decel = function(tc) { + var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); + if(!tc.lx && ay > s) + tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; + if(!tc.ly && ap > s) + tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; +}; +TCproto.Zoom = function(r) { + this.z2 = this.z1 * (1/r); + this.drawn = 0; +}; +TCproto.Clicked = function(e) { + var a = this.active; + try { + if(a && a.tag) + if(this.clickToFront === false || this.clickToFront === null) + a.tag.Clicked(e); + else + this.TagToFront(a.tag, this.clickToFront, function() { + a.tag.Clicked(e); + }, true); + } catch(ex) { + } +}; +TCproto.Wheel = function(i) { + var z = this.zoom + this.zoomStep * (i ? 1 : -1); + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.BeginDrag = function(e) { + this.down = EventXY(e, this.canvas); + e.cancelBubble = true; + e.returnValue = false; + e.preventDefault && e.preventDefault(); +}; +TCproto.Drag = function(e, p) { + if(this.dragControl && this.down) { + var t2 = this.dragThreshold * this.dragThreshold, + dx = p.x - this.down.x, dy = p.y - this.down.y; + if(this.dragging || dx * dx + dy * dy > t2) { + this.dx = dx; + this.dy = dy; + this.dragging = 1; + this.down = p; + } + } + return this.dragging; +}; +TCproto.EndDrag = function() { + var res = this.dragging; + this.dragging = this.down = null; + return res; +}; +function PinchDistance(e) { + var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; + return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); +} +TCproto.BeginPinch = function(e) { + this.pinched = [PinchDistance(e), this.zoom]; + e.preventDefault && e.preventDefault(); +}; +TCproto.Pinch = function(e) { + var z, d, p = this.pinched; + if(!p) + return; + d = PinchDistance(e); + z = p[1] * d / p[0]; + this.zoom = min(this.zoomMax,max(this.zoomMin,z)); + this.Zoom(this.zoom); +}; +TCproto.EndPinch = function(e) { + this.pinched = null; +}; +TCproto.Pause = function() { this.paused = true; }; +TCproto.Resume = function() { this.paused = false; }; +TCproto.SetSpeed = function(i) { + this.initial = i; + this.yaw = i[0] * this.maxSpeed; + this.pitch = i[1] * this.maxSpeed; +}; +TCproto.FindTag = function(t) { + if(!Defined(t)) + return null; + Defined(t.index) && (t = t.index); + if(!IsObject(t)) + return this.taglist[t]; + var srch, tgt, i; + if(Defined(t.id)) + srch = 'id', tgt = t.id; + else if(Defined(t.text)) + srch = 'innerText', tgt = t.text; + + for(i = 0; i < this.taglist.length; ++i) + if(this.taglist[i].a[srch] == tgt) + return this.taglist[i]; +}; +TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { + var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), + v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); + if(angle == 0) { + this.fixedCallbackTag = tag; + this.fixedCallback = callback; + } else { + this.fixedAnim = { + angle: -angle, + axis: u, + t: time, + t0: TimeNow(), + cb: callback, + tag: tag, + active: active + }; + } +}; +TCproto.TagToFront = function(tag, time, callback, active) { + this.RotateTag(tag, 0, 0, time, callback, active); +}; +TagCanvas.Start = function(id,l,o) { + TagCanvas.Delete(id); + TagCanvas.tc[id] = new TagCanvas(id,l,o); +}; +function tccall(f,id) { + TagCanvas.tc[id] && TagCanvas.tc[id][f](); +} +TagCanvas.Linear = function(t, t0) { return t0 / t; } +TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } +TagCanvas.Pause = function(id) { tccall('Pause',id); }; +TagCanvas.Resume = function(id) { tccall('Resume',id); }; +TagCanvas.Reload = function(id) { tccall('Load',id); }; +TagCanvas.Update = function(id) { tccall('Update',id); }; +TagCanvas.SetSpeed = function(id, speed) { + if(IsObject(speed) && TagCanvas.tc[id] && + !isNaN(speed[0]) && !isNaN(speed[1])) { + TagCanvas.tc[id].SetSpeed(speed); + return true; + } + return false; +}; +TagCanvas.TagToFront = function(id, options) { + if(!IsObject(options)) + return false; + options.lat = options.lng = 0; + return TagCanvas.RotateTag(id, options); +}; +TagCanvas.RotateTag = function(id, options) { + if(IsObject(options) && TagCanvas.tc[id]) { + if(isNaN(options.time)) + options.time = 500; + var tt = TagCanvas.tc[id].FindTag(options); + if(tt) { + TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, + options.time, options.callback, options.active); + return true; + } + } + return false; +}; +TagCanvas.Delete = function(id) { + var i, c; + if(handlers[id]) { + c = doc.getElementById(id); + if(c) { + for(i = 0; i < handlers[id].length; ++i) + RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); + } + } + delete handlers[id]; + delete TagCanvas.tc[id]; +}; +TagCanvas.NextFrameRAF = function() { + requestAnimationFrame(DrawCanvasRAF); +}; +TagCanvas.NextFrameTimeout = function(iv) { + setTimeout(DrawCanvas, iv); +}; +TagCanvas.tc = {}; +TagCanvas.options = { +z1: 20000, +z2: 20000, +z0: 0.0002, +freezeActive: false, +freezeDecel: false, +activeCursor: 'pointer', +pulsateTo: 1, +pulsateTime: 3, +reverse: false, +depth: 0.5, +maxSpeed: 0.05, +minSpeed: 0, +decel: 0.95, +interval: 20, +minBrightness: 0.1, +maxBrightness: 1, +outlineColour: '#ffff99', +outlineThickness: 2, +outlineOffset: 5, +outlineMethod: 'outline', +outlineRadius: 0, +textColour: '#ff99ff', +textHeight: 15, +textFont: 'Helvetica, Arial, sans-serif', +shadow: '#000', +shadowBlur: 0, +shadowOffset: [0,0], +initial: null, +hideTags: true, +zoom: 1, +weight: false, +weightMode: 'size', +weightFrom: null, +weightSize: 1, +weightSizeMin: null, +weightSizeMax: null, +weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, +txtOpt: true, +txtScale: 2, +frontSelect: false, +wheelZoom: true, +zoomMin: 0.3, +zoomMax: 3, +zoomStep: 0.05, +shape: 'sphere', +lock: null, +tooltip: null, +tooltipDelay: 300, +tooltipClass: 'tctooltip', +radiusX: 1, +radiusY: 1, +radiusZ: 1, +stretchX: 1, +stretchY: 1, +offsetX: 0, +offsetY: 0, +shuffleTags: false, +noSelect: false, +noMouse: false, +imageScale: 1, +paused: false, +dragControl: false, +dragThreshold: 4, +centreFunc: Nop, +splitWidth: 0, +animTiming: 'Smooth', +clickToFront: false, +fadeIn: 0, +padding: 0, +bgColour: null, +bgRadius: 0, +bgOutline: null, +bgOutlineThickness: 0, +outlineIncrease: 4, +textAlign: 'centre', +textVAlign: 'middle', +imageMode: null, +imagePosition: null, +imagePadding: 2, +imageAlign: 'centre', +imageVAlign: 'middle', +noTagsMessage: true, +centreImage: null, +pinchZoom: false, +repeatTags: 0, +minTags: 0 +}; +for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; +window.TagCanvas = TagCanvas; +// set a flag for when the window has loaded +AddHandler('load',function(){TagCanvas.loaded=1},window); +})(); diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/vue.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/vue.js" new file mode 100644 index 0000000..5ebe420 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/vue.js" @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.22 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
    ',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/zepto.js" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/zepto.js" new file mode 100644 index 0000000..3b450a8 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/js/zepto.js" @@ -0,0 +1,1909 @@ +/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + classSelectorRE = /^\.([\w-]+)$/, + idSelectorRE = /^#([\w-]*)$/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || + element.oMatchesSelector || element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + function isArray(value) { return value instanceof Array } + function likeArray(obj) { return typeof obj.length == 'number' } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overriden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. Note that `__proto__` is not supported on Internet + // Explorer. This method can be overriden in plugins. + zepto.Z = function(dom, selector) { + dom = dom || [] + dom.__proto__ = $.fn + dom.selector = selector || '' + return dom + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overriden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overriden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overriden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (isDocument(element) && isSimple && maybeID) ? + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + slice.call( + isSimple && !maybeID ? + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = function(parent, node) { + return parent !== node && parent.contains(node) + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className, + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + var num + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + indexOf: emptyArray.indexOf, + concat: emptyArray.concat, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var node = this[0], collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].innerHTML : null) : + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) + }, + text: function(text){ + return arguments.length === 0 ? + (this.length > 0 ? this[0].textContent : null) : + this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && value === undefined) ? + (this.length == 0 || this[0].nodeType !== 1 ? undefined : + (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : + (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result + ) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) + }, + prop: function(name, value){ + name = propMap[name] || name + return (value === undefined) ? + (this[0] && this[0][name]) : + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) + }, + data: function(name, value){ + var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + return arguments.length === 0 ? + (this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + ) : + this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (this.length==0) return null + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0], computedStyle = getComputedStyle(element, '') + if(!element) return + if (typeof property == 'string') + return element.style[camelize(property)] || computedStyle.getPropertyValue(property) + else if (isArray(property)) { + var props = {} + $.each(isArray(property) ? property: [property], function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + traverseNode(parent.insertBefore(node, target), function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src) + window['eval'].call(window, el.innerHTML) + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = 0, + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/ + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/=\?/, '=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred() + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && + RegExp.$2 != window.location.host + + if (!settings.url) settings.url = window.location.toString() + serializeData(settings) + if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) + + var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) + if (dataType == 'jsonp' || hasPlaceholder) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) + else ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + var hasData = !$.isFunction(data) + return { + url: url, + data: hasData ? data : undefined, + success: !hasData ? data : $.isFunction(success) ? success : undefined, + dataType: hasData ? dataType || success : success + } + } + + $.get = function(url, data, success, dataType){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(url, data, success, dataType){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(url, data, success){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
    ').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + var $$ = $.zepto.qsa, _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + return $.proxy(fn[context], fn) + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (isFunction(data) || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // items in the collection might not be DOM elements + if('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('focusin focusout load resize scroll unload click dblclick '+ + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(callback) { + return callback ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + ;['focus', 'blur'].forEach(function(name) { + $.fn[name] = function(callback) { + if (callback) this.bind(name, callback) + else this.each(function(){ + try { this[name]() } + catch(e) {} + }) + return this + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function($, undefined){ + var prefix = '', eventPrefix, endEventName, endAnimationName, + vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, + document = window.document, testEl = document.createElement('div'), + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform, + transitionProperty, transitionDuration, transitionTiming, transitionDelay, + animationName, animationDuration, animationTiming, animationDelay, + cssReset = {} + + function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } + function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } + + $.each(vendors, function(vendor, event){ + if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { + prefix = '-' + vendor.toLowerCase() + '-' + eventPrefix = event + return false + } + }) + + transform = prefix + 'transform' + cssReset[transitionProperty = prefix + 'transition-property'] = + cssReset[transitionDuration = prefix + 'transition-duration'] = + cssReset[transitionDelay = prefix + 'transition-delay'] = + cssReset[transitionTiming = prefix + 'transition-timing-function'] = + cssReset[animationName = prefix + 'animation-name'] = + cssReset[animationDuration = prefix + 'animation-duration'] = + cssReset[animationDelay = prefix + 'animation-delay'] = + cssReset[animationTiming = prefix + 'animation-timing-function'] = '' + + $.fx = { + off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), + speeds: { _default: 400, fast: 200, slow: 600 }, + cssPrefix: prefix, + transitionEnd: normalizeEvent('TransitionEnd'), + animationEnd: normalizeEvent('AnimationEnd') + } + + $.fn.animate = function(properties, duration, ease, callback, delay){ + if ($.isFunction(duration)) + callback = duration, ease = undefined, duration = undefined + if ($.isFunction(ease)) + callback = ease, ease = undefined + if ($.isPlainObject(duration)) + ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration + if (duration) duration = (typeof duration == 'number' ? duration : + ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 + if (delay) delay = parseFloat(delay) / 1000 + return this.anim(properties, duration, ease, callback, delay) + } + + $.fn.anim = function(properties, duration, ease, callback, delay){ + var key, cssValues = {}, cssProperties, transforms = '', + that = this, wrappedCallback, endEvent = $.fx.transitionEnd, + fired = false + + if (duration === undefined) duration = $.fx.speeds._default / 1000 + if (delay === undefined) delay = 0 + if ($.fx.off) duration = 0 + + if (typeof properties == 'string') { + // keyframe animation + cssValues[animationName] = properties + cssValues[animationDuration] = duration + 's' + cssValues[animationDelay] = delay + 's' + cssValues[animationTiming] = (ease || 'linear') + endEvent = $.fx.animationEnd + } else { + cssProperties = [] + // CSS transitions + for (key in properties) + if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' + else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) + + if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) + if (duration > 0 && typeof properties === 'object') { + cssValues[transitionProperty] = cssProperties.join(', ') + cssValues[transitionDuration] = duration + 's' + cssValues[transitionDelay] = delay + 's' + cssValues[transitionTiming] = (ease || 'linear') + } + } + + wrappedCallback = function(event){ + if (typeof event !== 'undefined') { + if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" + $(event.target).unbind(endEvent, wrappedCallback) + } else + $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout + + fired = true + $(this).css(cssReset) + callback && callback.call(this) + } + if (duration > 0){ + this.bind(endEvent, wrappedCallback) + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + setTimeout(function(){ + if (fired) return + wrappedCallback.call(that) + }, (duration * 1000) + 25) + } + + // trigger page reflow so new elements can animate + this.size() && this.get(0).clientLeft + + this.css(cssValues) + + if (duration <= 0) setTimeout(function() { + that.each(function(){ wrappedCallback.call(this) }) + }, 0) + + return this + } + + testEl = null +})(Zepto) + +;(function($, undefined){ + var document = window.document, docElem = document.documentElement, + origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle + + function anim(el, speed, opacity, scale, callback) { + if (typeof speed == 'function' && !callback) callback = speed, speed = undefined + var props = { opacity: opacity } + if (scale) { + props.scale = scale + el.css($.fx.cssPrefix + 'transform-origin', '0 0') + } + return el.animate(props, speed, null, callback) + } + + function hide(el, speed, scale, callback) { + return anim(el, speed, 0, scale, function(){ + origHide.call($(this)) + callback && callback.call(this) + }) + } + + $.fn.show = function(speed, callback) { + origShow.call(this) + if (speed === undefined) speed = 0 + else this.css('opacity', 0) + return anim(this, speed, 1, '1,1', callback) + } + + $.fn.hide = function(speed, callback) { + if (speed === undefined) return origHide.call(this) + else return hide(this, speed, '0,0', callback) + } + + $.fn.toggle = function(speed, callback) { + if (speed === undefined || typeof speed == 'boolean') + return origToggle.call(this, speed) + else return this.each(function(){ + var el = $(this) + el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) + }) + } + + $.fn.fadeTo = function(speed, opacity, callback) { + return anim(this, speed, opacity, null, callback) + } + + $.fn.fadeIn = function(speed, callback) { + var target = this.css('opacity') + if (target > 0) this.css('opacity', 0) + else target = 1 + return origShow.call(this).fadeTo(speed, target, callback) + } + + $.fn.fadeOut = function(speed, callback) { + return hide(this, speed, null, callback) + } + + $.fn.fadeToggle = function(speed, callback) { + return this.each(function(){ + var el = $(this) + el[ + (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' + ](speed, callback) + }) + } + +})(Zepto) + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) + +;(function($){ + var touch = {}, + touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, + longTapDelay = 750, + gesture + + function swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= + Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') + } + + function longTap() { + longTapTimeout = null + if (touch.last) { + touch.el.trigger('longTap') + touch = {} + } + } + + function cancelLongTap() { + if (longTapTimeout) clearTimeout(longTapTimeout) + longTapTimeout = null + } + + function cancelAll() { + if (touchTimeout) clearTimeout(touchTimeout) + if (tapTimeout) clearTimeout(tapTimeout) + if (swipeTimeout) clearTimeout(swipeTimeout) + if (longTapTimeout) clearTimeout(longTapTimeout) + touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null + touch = {} + } + + function isPrimaryTouch(event){ + return (event.pointerType == 'touch' || + event.pointerType == event.MSPOINTER_TYPE_TOUCH) + && event.isPrimary + } + + function isPointerEventType(e, type){ + return (e.type == 'pointer'+type || + e.type.toLowerCase() == 'mspointer'+type) + } + + $(document).ready(function(){ + var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType + + if ('MSGesture' in window) { + gesture = new MSGesture() + gesture.target = document.body + } + + $(document) + .bind('MSGestureEnd', function(e){ + var swipeDirectionFromVelocity = + e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; + if (swipeDirectionFromVelocity) { + touch.el.trigger('swipe') + touch.el.trigger('swipe'+ swipeDirectionFromVelocity) + } + }) + .on('touchstart MSPointerDown pointerdown', function(e){ + if((_isPointerType = isPointerEventType(e, 'down')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + if (e.touches && e.touches.length === 1 && touch.x2) { + // Clear out touch movement data if we have it sticking around + // This can occur if touchcancel doesn't fire due to preventDefault, etc. + touch.x2 = undefined + touch.y2 = undefined + } + now = Date.now() + delta = now - (touch.last || now) + touch.el = $('tagName' in firstTouch.target ? + firstTouch.target : firstTouch.target.parentNode) + touchTimeout && clearTimeout(touchTimeout) + touch.x1 = firstTouch.pageX + touch.y1 = firstTouch.pageY + if (delta > 0 && delta <= 250) touch.isDoubleTap = true + touch.last = now + longTapTimeout = setTimeout(longTap, longTapDelay) + // adds the current touch contact for IE gesture recognition + if (gesture && _isPointerType) gesture.addPointer(e.pointerId); + }) + .on('touchmove MSPointerMove pointermove', function(e){ + if((_isPointerType = isPointerEventType(e, 'move')) && + !isPrimaryTouch(e)) return + firstTouch = _isPointerType ? e : e.touches[0] + cancelLongTap() + touch.x2 = firstTouch.pageX + touch.y2 = firstTouch.pageY + + deltaX += Math.abs(touch.x1 - touch.x2) + deltaY += Math.abs(touch.y1 - touch.y2) + }) + .on('touchend MSPointerUp pointerup', function(e){ + if((_isPointerType = isPointerEventType(e, 'up')) && + !isPrimaryTouch(e)) return + cancelLongTap() + + // swipe + if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || + (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) + + swipeTimeout = setTimeout(function() { + touch.el.trigger('swipe') + touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) + touch = {} + }, 0) + + // normal tap + else if ('last' in touch) + // don't fire tap when delta position changed by more than 30 pixels, + // for instance when moving to a point and back to origin + if (deltaX < 30 && deltaY < 30) { + // delay by one tick so we can cancel the 'tap' event if 'scroll' fires + // ('tap' fires before 'scroll') + tapTimeout = setTimeout(function() { + + // trigger universal 'tap' with the option to cancelTouch() + // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) + var event = $.Event('tap') + event.cancelTouch = cancelAll + touch.el.trigger(event) + + // trigger double tap immediately + if (touch.isDoubleTap) { + if (touch.el) touch.el.trigger('doubleTap') + touch = {} + } + + // trigger single tap after 250ms of inactivity + else { + touchTimeout = setTimeout(function(){ + touchTimeout = null + if (touch.el) touch.el.trigger('singleTap') + touch = {} + }, 250) + } + }, 0) + } else { + touch = {} + } + deltaX = deltaY = 0 + + }) + // when the browser window loses focus, + // for example when a modal dialog is shown, + // cancel all ongoing events + .on('touchcancel MSPointerCancel pointercancel', cancelAll) + + // scrolling the window indicates intention of the user + // to scroll, not tap or swipe, so cancel all ongoing events + $(window).on('scroll', cancelAll) + }) + + ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', + 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ + $.fn[eventName] = function(callback){ return this.on(eventName, callback) } + }) +})(Zepto) diff --git "a/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/result.html" "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/result.html" new file mode 100755 index 0000000..9f35db2 --- /dev/null +++ "b/\351\232\217\346\234\272\346\212\275\345\217\226\345\214\272\345\237\237\344\272\272\345\221\230/\350\245\277\345\214\227\345\244\247\345\214\272/result.html" @@ -0,0 +1,90 @@ + + + + + + + 年会抽奖小程序 + + + + + +
    +
    获奖名单
    +
    +
    + {{item}} +
    +
    +
    + + + + \ No newline at end of file