├── .gitignore
├── Gruntfile.js
├── LICENSE
├── README.md
├── package.json
└── src
├── album
└── .gitkeep
├── blessing.php
├── config.php
├── css
├── inline-home.css
├── inline-invitation.css
├── inline-map.css
└── magnific-popup.css
├── img
├── baidumap_location.png
├── banner.png
├── banner@2x.png
├── bg
│ ├── noisy_net.png
│ └── noisy_net@2x.png
├── header.png
├── header@2x.png
├── home
│ ├── banner_date.png
│ ├── banner_logo.png
│ ├── banner_name.png
│ ├── bg.png
│ ├── click_tip.png
│ ├── follow.png
│ ├── photo_frame.png
│ ├── pic_1.jpg
│ ├── pic_2.jpg
│ ├── pic_3.jpg
│ ├── pic_4.jpg
│ ├── pic_5.jpg
│ ├── pic_6.jpg
│ ├── pic_7.jpg
│ ├── pyq.png
│ └── share.png
├── invitation.jpg
├── load.png
├── load@2x.png
├── qrcode_8cm.png
├── share_arrow.png
└── touch-icon-iphone.png
├── index.php
├── invitation.php
├── js
├── inline-home.js
├── inline-invitation.js
├── inline-map.js
├── magnific-popup.min.js
└── plugins
│ ├── WeixinApi.js
│ ├── preloadjs-0.4.1.combined.js
│ ├── preloadjs-0.4.1.min.js
│ ├── zepto-touch.js
│ ├── zepto.js
│ └── zepto.min.js
├── map.php
├── public
├── fun.php
└── invitees.php
├── sign.php
├── wechat-img
└── .gitkeep
├── wechat-log
└── .gitkeep
├── wechat-photo
└── .gitkeep
├── wechat-php-sdk
├── errCode.php
├── qyerrCode.php
├── qywechat.class.php
├── snoopy.class.php
├── wechat.class.php
├── wechat.js
├── wechatauth.class.php
└── wechatext.class.php
├── wechat-push.php
└── wechat.php
/.gitignore:
--------------------------------------------------------------------------------
1 | # Image PSD file
2 | *.psd
3 |
4 | # Private file
5 | *.ciaoca.*
6 | data/
7 | src/album/*/*.jpg
8 | src/wechat-img/*.jpg
9 | src/wechat-img/*.png
10 |
11 | # Other files and folders
12 | .tmp/
13 | dist/
14 | node_modules/
15 | _*/
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | grunt.initConfig({
3 | pkg: grunt.file.readJSON('package.json'),
4 |
5 | project: {
6 | name: 'wedding',
7 | srcPath: 'src',
8 | distPath: 'dist'
9 | },
10 |
11 | watch: {
12 | bower: {
13 | options: {
14 | livereload: true
15 | },
16 | files: ['<%=project.srcPath%>/**.html', '<%=project.srcPath%>/css/**.css', '<%=project.srcPath%>/js/**.js']
17 | }
18 | },
19 | clean: {
20 | start: ['<%=project.distPath%>/'],
21 | end: [
22 | '<%=project.distPath%>/js/plugins/',
23 | '<%=project.distPath%>/js/_**',
24 | '<%=project.distPath%>/js/inline-*.js',
25 | '<%=project.distPath%>/css/_**',
26 | '<%=project.distPath%>/css/inline-*.css',
27 | '<%=project.distPath%>/img/_**',
28 | '<%=project.distPath%>/img/**/**.psd'
29 | ]
30 | },
31 | copy: {
32 | page: {
33 | files: [
34 | {
35 | expand: true,
36 | filter: 'isFile',
37 | cwd: '<%=project.srcPath%>/',
38 | src: ['*.html', '*.php'],
39 | dest: '<%=project.distPath%>/'
40 | }
41 | ]
42 | },
43 | css: {
44 | expand: true,
45 | cwd: '<%=project.srcPath%>/css/',
46 | src: '**',
47 | dest: '<%=project.distPath%>/css/'
48 | },
49 | js: {
50 | expand: true,
51 | cwd: '<%=project.srcPath%>/js/',
52 | src: '**',
53 | dest: '<%=project.distPath%>/js/'
54 | },
55 | img: {
56 | expand: true,
57 | cwd: '<%=project.srcPath%>/img/',
58 | src: '**',
59 | dest: '<%=project.distPath%>/img/'
60 | },
61 | album: {
62 | files: [
63 | {
64 | expand: true,
65 | cwd: '<%=project.srcPath%>/album/',
66 | src: '**',
67 | dest: '<%=project.distPath%>/album/'
68 | }
69 | ]
70 | },
71 | php: {
72 | files: [
73 | {
74 | expand: true,
75 | cwd: '<%=project.srcPath%>/public/',
76 | src: '**',
77 | dest: '<%=project.distPath%>/public/'
78 | }
79 | ]
80 | },
81 | wechat: {
82 | files: [
83 | {
84 | expand: true,
85 | cwd: '<%=project.srcPath%>/wechat-img/',
86 | src: '**',
87 | dest: '<%=project.distPath%>/wechat-img/'
88 | }, {
89 | expand: true,
90 | cwd: '<%=project.srcPath%>/wechat-log/',
91 | src: '**',
92 | dest: '<%=project.distPath%>/wechat-log/'
93 | }, {
94 | expand: true,
95 | cwd: '<%=project.srcPath%>/wechat-photo/',
96 | src: '**',
97 | dest: '<%=project.distPath%>/wechat-photo/'
98 | }, {
99 | expand: true,
100 | cwd: '<%=project.srcPath%>/wechat-php-sdk/',
101 | src: '**',
102 | dest: '<%=project.distPath%>/wechat-php-sdk/'
103 | }
104 | ]
105 | }
106 | },
107 | useminPrepare: {
108 | html: ['<%=project.distPath%>/*.html', '<%=project.distPath%>/*.php']
109 | },
110 | usemin: {
111 | html: ['<%=project.distPath%>/*.html', '<%=project.distPath%>/*.php']
112 | },
113 | inline: {
114 | dist: {
115 | options:{
116 | cssmin: true,
117 | uglify: true,
118 | exts: ['php']
119 | },
120 | src: ['<%=project.distPath%>/*.html', '<%=project.distPath%>/*.php']
121 | }
122 | }
123 | });
124 |
125 | require('load-grunt-tasks')(grunt);
126 |
127 | grunt.registerTask('default', ['watch']);
128 | grunt.registerTask('build', [
129 | 'clean:start',
130 | 'copy:page',
131 | 'copy:css',
132 | 'copy:js',
133 | 'copy:img',
134 | 'copy:album',
135 | 'copy:php',
136 | 'copy:wechat',
137 | 'useminPrepare',
138 | 'concat:generated',
139 | 'uglify:generated',
140 | 'usemin',
141 | 'inline:dist',
142 | 'clean:end'
143 | ]);
144 | };
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 小叉
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #wedding
2 | Wu & Xiong's Wedding 基于微信公众号开发的微婚礼
3 |
4 | 没有使用任何数据库,所有涉及到的数据都使用文件保存,或在文件中手动设置。
5 |
6 | ##微信公众号:fensalir
7 |
8 | 
9 |
10 | ##体验
11 | 使用移动设备访问:http://wedding.ciaoca.com/
12 |
13 | 
14 |
15 |
16 | ##初始化
17 | ```
18 | npm install
19 | ```
20 |
21 | ##项目打包
22 | ```
23 | grunt build
24 | ```
25 |
26 | ##目录结构
27 | ```
28 | src
29 | ├─album // 首页相册的大图
30 | │ ├─name1
31 | │ │ ├─1.jpg
32 | │ │ ├─2.jpg
33 | │ │ └─N.jpg
34 | │ ├─name2
35 | │ └─nameN
36 | │
37 | ├─public
38 | │ └─invitees.php // 被邀请人名单
39 | │
40 | ├─wechat-img // 微信消息推送使用的图片
41 | ├─wechat-log // 微信消息日志
42 | ├─wechat-photo // 微信接收到的图片
43 | │
44 | ├─blessing.php // 祝福墙
45 | ├─index.php // 首页
46 | ├─invitation.php // 喜帖
47 | ├─map.php // 婚宴酒店地图
48 | ├─sign.php // 现场签到
49 | ├─wechat-push.php // 微信推送消息
50 | └─wechat.php // 微信接收消息
51 | ```
52 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wedding",
3 | "version": "1.0.0",
4 | "devDependencies": {
5 | "grunt": "^0.4.5",
6 | "grunt-contrib-clean": "^0.6.0",
7 | "grunt-contrib-concat": "^0.5.0",
8 | "grunt-contrib-copy": "^0.7.0",
9 | "grunt-contrib-cssmin": "^0.10.0",
10 | "grunt-contrib-uglify": "^0.6.0",
11 | "grunt-contrib-watch": "^0.6.1",
12 | "grunt-filerev": "^2.1.0",
13 | "grunt-inline": "^0.3.2",
14 | "grunt-usemin": "^2.4.0",
15 | "load-grunt-tasks": "^1.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/album/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciaoca/wedding/7a4fd5b51ce639908f290839506476f3569faebf/src/album/.gitkeep
--------------------------------------------------------------------------------
/src/blessing.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | ");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'
',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('
![]()
').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto);
--------------------------------------------------------------------------------
/src/js/plugins/WeixinApi.js:
--------------------------------------------------------------------------------
1 | /**!
2 | * 微信内置浏览器的Javascript API,功能包括:
3 | *
4 | * 1、分享到微信朋友圈
5 | * 2、分享给微信好友
6 | * 3、分享到腾讯微博
7 | * 4、新的分享接口,包含朋友圈、好友、微博的分享(for iOS)
8 | * 5、隐藏/显示右上角的菜单入口
9 | * 6、隐藏/显示底部浏览器工具栏
10 | * 7、获取当前的网络状态
11 | * 8、调起微信客户端的图片播放组件
12 | * 9、关闭公众平台Web页面
13 | * 10、判断当前网页是否在微信内置浏览器中打开
14 | * 11、增加打开扫描二维码
15 | * 12、支持WeixinApi的错误监控
16 | * 13、检测应用程序是否已经安装(需要官方开通权限)
17 | *
18 | * @author zhaoxianlie(http://www.baidufe.com)
19 | */
20 | var WeixinApi = (function () {
21 |
22 | "use strict";
23 |
24 | /**
25 | * 分享到微信朋友圈
26 | * @param {Object} data 待分享的信息
27 | * @p-config {String} appId 公众平台的appId(服务号可用)
28 | * @p-config {String} imgUrl 图片地址
29 | * @p-config {String} link 链接地址
30 | * @p-config {String} desc 描述
31 | * @p-config {String} title 分享的标题
32 | *
33 | * @param {Object} callbacks 相关回调方法
34 | * @p-config {Boolean} async ready方法是否需要异步执行,默认false
35 | * @p-config {Function} ready(argv) 就绪状态
36 | * @p-config {Function} dataLoaded(data) 数据加载完成后调用,async为true时有用,也可以为空
37 | * @p-config {Function} cancel(resp) 取消
38 | * @p-config {Function} fail(resp) 失败
39 | * @p-config {Function} confirm(resp) 成功
40 | * @p-config {Function} all(resp) 无论成功失败都会执行的回调
41 | */
42 | function weixinShareTimeline(data, callbacks) {
43 | callbacks = callbacks || {};
44 | var shareTimeline = function (theData) {
45 | WeixinJSBridge.invoke('shareTimeline', {
46 | "appid":theData.appId ? theData.appId : '',
47 | "img_url":theData.imgUrl,
48 | "link":theData.link,
49 | "desc":theData.title,
50 | "title":theData.desc, // 注意这里要分享出去的内容是desc
51 | "img_width":"640",
52 | "img_height":"640"
53 | }, function (resp) {
54 | switch (resp.err_msg) {
55 | // share_timeline:cancel 用户取消
56 | case 'share_timeline:cancel':
57 | callbacks.cancel && callbacks.cancel(resp);
58 | break;
59 | // share_timeline:confirm 发送成功
60 | case 'share_timeline:confirm':
61 | case 'share_timeline:ok':
62 | callbacks.confirm && callbacks.confirm(resp);
63 | break;
64 | // share_timeline:fail 发送失败
65 | case 'share_timeline:fail':
66 | default:
67 | callbacks.fail && callbacks.fail(resp);
68 | break;
69 | }
70 | // 无论成功失败都会执行的回调
71 | callbacks.all && callbacks.all(resp);
72 | });
73 | };
74 | WeixinJSBridge.on('menu:share:timeline', function (argv) {
75 | if (callbacks.async && callbacks.ready) {
76 | window["_wx_loadedCb_"] = callbacks.dataLoaded || new Function();
77 | if(window["_wx_loadedCb_"].toString().indexOf("_wx_loadedCb_") > 0) {
78 | window["_wx_loadedCb_"] = new Function();
79 | }
80 | callbacks.dataLoaded = function (newData) {
81 | window["_wx_loadedCb_"](newData);
82 | shareTimeline(newData);
83 | };
84 | // 然后就绪
85 | callbacks.ready && callbacks.ready(argv);
86 | } else {
87 | // 就绪状态
88 | callbacks.ready && callbacks.ready(argv);
89 | shareTimeline(data);
90 | }
91 | });
92 | }
93 |
94 | /**
95 | * 发送给微信上的好友
96 | * @param {Object} data 待分享的信息
97 | * @p-config {String} appId 公众平台的appId(服务号可用)
98 | * @p-config {String} imgUrl 图片地址
99 | * @p-config {String} link 链接地址
100 | * @p-config {String} desc 描述
101 | * @p-config {String} title 分享的标题
102 | *
103 | * @param {Object} callbacks 相关回调方法
104 | * @p-config {Boolean} async ready方法是否需要异步执行,默认false
105 | * @p-config {Function} ready(argv) 就绪状态
106 | * @p-config {Function} dataLoaded(data) 数据加载完成后调用,async为true时有用,也可以为空
107 | * @p-config {Function} cancel(resp) 取消
108 | * @p-config {Function} fail(resp) 失败
109 | * @p-config {Function} confirm(resp) 成功
110 | * @p-config {Function} all(resp) 无论成功失败都会执行的回调
111 | */
112 | function weixinSendAppMessage(data, callbacks) {
113 | callbacks = callbacks || {};
114 | var sendAppMessage = function (theData) {
115 | WeixinJSBridge.invoke('sendAppMessage', {
116 | "appid":theData.appId ? theData.appId : '',
117 | "img_url":theData.imgUrl,
118 | "link":theData.link,
119 | "desc":theData.desc,
120 | "title":theData.title,
121 | "img_width":"640",
122 | "img_height":"640"
123 | }, function (resp) {
124 | switch (resp.err_msg) {
125 | // send_app_msg:cancel 用户取消
126 | case 'send_app_msg:cancel':
127 | callbacks.cancel && callbacks.cancel(resp);
128 | break;
129 | // send_app_msg:confirm 发送成功
130 | case 'send_app_msg:confirm':
131 | case 'send_app_msg:ok':
132 | callbacks.confirm && callbacks.confirm(resp);
133 | break;
134 | // send_app_msg:fail 发送失败
135 | case 'send_app_msg:fail':
136 | default:
137 | callbacks.fail && callbacks.fail(resp);
138 | break;
139 | }
140 | // 无论成功失败都会执行的回调
141 | callbacks.all && callbacks.all(resp);
142 | });
143 | };
144 | WeixinJSBridge.on('menu:share:appmessage', function (argv) {
145 | if (callbacks.async && callbacks.ready) {
146 | window["_wx_loadedCb_"] = callbacks.dataLoaded || new Function();
147 | if(window["_wx_loadedCb_"].toString().indexOf("_wx_loadedCb_") > 0) {
148 | window["_wx_loadedCb_"] = new Function();
149 | }
150 | callbacks.dataLoaded = function (newData) {
151 | window["_wx_loadedCb_"](newData);
152 | sendAppMessage(newData);
153 | };
154 | // 然后就绪
155 | callbacks.ready && callbacks.ready(argv);
156 | } else {
157 | // 就绪状态
158 | callbacks.ready && callbacks.ready(argv);
159 | sendAppMessage(data);
160 | }
161 | });
162 | }
163 |
164 | /**
165 | * 分享到腾讯微博
166 | * @param {Object} data 待分享的信息
167 | * @p-config {String} link 链接地址
168 | * @p-config {String} desc 描述
169 | *
170 | * @param {Object} callbacks 相关回调方法
171 | * @p-config {Boolean} async ready方法是否需要异步执行,默认false
172 | * @p-config {Function} ready(argv) 就绪状态
173 | * @p-config {Function} dataLoaded(data) 数据加载完成后调用,async为true时有用,也可以为空
174 | * @p-config {Function} cancel(resp) 取消
175 | * @p-config {Function} fail(resp) 失败
176 | * @p-config {Function} confirm(resp) 成功
177 | * @p-config {Function} all(resp) 无论成功失败都会执行的回调
178 | */
179 | function weixinShareWeibo(data, callbacks) {
180 | callbacks = callbacks || {};
181 | var shareWeibo = function (theData) {
182 | WeixinJSBridge.invoke('shareWeibo', {
183 | "content":theData.desc,
184 | "url":theData.link
185 | }, function (resp) {
186 | switch (resp.err_msg) {
187 | // share_weibo:cancel 用户取消
188 | case 'share_weibo:cancel':
189 | callbacks.cancel && callbacks.cancel(resp);
190 | break;
191 | // share_weibo:confirm 发送成功
192 | case 'share_weibo:confirm':
193 | case 'share_weibo:ok':
194 | callbacks.confirm && callbacks.confirm(resp);
195 | break;
196 | // share_weibo:fail 发送失败
197 | case 'share_weibo:fail':
198 | default:
199 | callbacks.fail && callbacks.fail(resp);
200 | break;
201 | }
202 | // 无论成功失败都会执行的回调
203 | callbacks.all && callbacks.all(resp);
204 | });
205 | };
206 | WeixinJSBridge.on('menu:share:weibo', function (argv) {
207 | if (callbacks.async && callbacks.ready) {
208 | window["_wx_loadedCb_"] = callbacks.dataLoaded || new Function();
209 | if(window["_wx_loadedCb_"].toString().indexOf("_wx_loadedCb_") > 0) {
210 | window["_wx_loadedCb_"] = new Function();
211 | }
212 | callbacks.dataLoaded = function (newData) {
213 | window["_wx_loadedCb_"](newData);
214 | shareWeibo(newData);
215 | };
216 | // 然后就绪
217 | callbacks.ready && callbacks.ready(argv);
218 | } else {
219 | // 就绪状态
220 | callbacks.ready && callbacks.ready(argv);
221 | shareWeibo(data);
222 | }
223 | });
224 | }
225 |
226 |
227 | /**
228 | * 新的分享接口
229 | * @param {Object} data 待分享的信息
230 | * @p-config {String} appId 公众平台的appId(服务号可用)
231 | * @p-config {String} imgUrl 图片地址
232 | * @p-config {String} link 链接地址
233 | * @p-config {String} desc 描述
234 | * @p-config {String} title 分享的标题
235 | *
236 | * @param {Object} callbacks 相关回调方法
237 | * @p-config {Boolean} async ready方法是否需要异步执行,默认false
238 | * @p-config {Function} ready(argv,shareTo) 就绪状态
239 | * @p-config {Function} dataLoaded(data) 数据加载完成后调用,async为true时有用,也可以为空
240 | * @p-config {Function} cancel(resp,shareTo) 取消
241 | * @p-config {Function} fail(resp,shareTo) 失败
242 | * @p-config {Function} confirm(resp,shareTo) 成功
243 | * @p-config {Function} all(resp,shareTo) 无论成功失败都会执行的回调
244 | */
245 | function weixinGeneralShare(data, callbacks) {
246 | callbacks = callbacks || {};
247 | var generalShare = function (general,theData) {
248 |
249 | // 如果是分享到朋友圈,则需要把title和desc交换一下
250 | if(general.shareTo == 'timeline') {
251 | var title = theData.title;
252 | theData.title = theData.desc || title;
253 | theData.desc = title;
254 | }
255 |
256 | // 分享出去
257 | general.generalShare({
258 | "appid":theData.appId ? theData.appId : '',
259 | "img_url":theData.imgUrl,
260 | "link":theData.link,
261 | "desc":theData.desc,
262 | "title":theData.title,
263 | "img_width":"640",
264 | "img_height":"640"
265 | }, function (resp) {
266 | switch (resp.err_msg) {
267 | // general_share:cancel 用户取消
268 | case 'general_share:cancel':
269 | callbacks.cancel && callbacks.cancel(resp ,general.shareTo);
270 | break;
271 | // general_share:confirm 发送成功
272 | case 'general_share:confirm':
273 | case 'general_share:ok':
274 | callbacks.confirm && callbacks.confirm(resp ,general.shareTo);
275 | break;
276 | // general_share:fail 发送失败
277 | case 'general_share:fail':
278 | default:
279 | callbacks.fail && callbacks.fail(resp ,general.shareTo);
280 | break;
281 | }
282 | // 无论成功失败都会执行的回调
283 | callbacks.all && callbacks.all(resp ,general.shareTo);
284 | });
285 | };
286 | WeixinJSBridge.on('menu:general:share', function (general) {
287 | if (callbacks.async && callbacks.ready) {
288 | window["_wx_loadedCb_"] = callbacks.dataLoaded || new Function();
289 | if(window["_wx_loadedCb_"].toString().indexOf("_wx_loadedCb_") > 0) {
290 | window["_wx_loadedCb_"] = new Function();
291 | }
292 | callbacks.dataLoaded = function (newData) {
293 | window["_wx_loadedCb_"](newData);
294 | generalShare(general,newData);
295 | };
296 | // 然后就绪
297 | callbacks.ready && callbacks.ready(general,general.shareTo);
298 | } else {
299 | // 就绪状态
300 | callbacks.ready && callbacks.ready(general,general.shareTo);
301 | generalShare(general,data);
302 | }
303 | });
304 | }
305 |
306 | /**
307 | * 加关注(此功能只是暂时先加上,不过因为权限限制问题,不能用,如果你的站点是部署在*.qq.com下,也许可行)
308 | * @param {String} appWeixinId 微信公众号ID
309 | * @param {Object} callbacks 回调方法
310 | * @p-config {Function} fail(resp) 失败
311 | * @p-config {Function} confirm(resp) 成功
312 | */
313 | function addContact(appWeixinId,callbacks){
314 | callbacks = callbacks || {};
315 | WeixinJSBridge.invoke("addContact", {
316 | webtype: "1",
317 | username: appWeixinId
318 | }, function (resp) {
319 | var success = !resp.err_msg || "add_contact:ok" == resp.err_msg || "add_contact:added" == resp.err_msg;
320 | if(success) {
321 | callbacks.success && callbacks.success(resp);
322 | }else{
323 | callbacks.fail && callbacks.fail(resp);
324 | }
325 | })
326 | }
327 |
328 | /**
329 | * 调起微信Native的图片播放组件。
330 | * 这里必须对参数进行强检测,如果参数不合法,直接会导致微信客户端crash
331 | *
332 | * @param {String} curSrc 当前播放的图片地址
333 | * @param {Array} srcList 图片地址列表
334 | */
335 | function imagePreview(curSrc,srcList) {
336 | if(!curSrc || !srcList || srcList.length == 0) {
337 | return;
338 | }
339 | WeixinJSBridge.invoke('imagePreview', {
340 | 'current' : curSrc,
341 | 'urls' : srcList
342 | });
343 | }
344 |
345 | /**
346 | * 显示网页右上角的按钮
347 | */
348 | function showOptionMenu() {
349 | WeixinJSBridge.call('showOptionMenu');
350 | }
351 |
352 |
353 | /**
354 | * 隐藏网页右上角的按钮
355 | */
356 | function hideOptionMenu() {
357 | WeixinJSBridge.call('hideOptionMenu');
358 | }
359 |
360 | /**
361 | * 显示底部工具栏
362 | */
363 | function showToolbar() {
364 | WeixinJSBridge.call('showToolbar');
365 | }
366 |
367 | /**
368 | * 隐藏底部工具栏
369 | */
370 | function hideToolbar() {
371 | WeixinJSBridge.call('hideToolbar');
372 | }
373 |
374 | /**
375 | * 返回如下几种类型:
376 | *
377 | * network_type:wifi wifi网络
378 | * network_type:edge 非wifi,包含3G/2G
379 | * network_type:fail 网络断开连接
380 | * network_type:wwan 2g或者3g
381 | *
382 | * 使用方法:
383 | * WeixinApi.getNetworkType(function(networkType){
384 | *
385 | * });
386 | *
387 | * @param callback
388 | */
389 | function getNetworkType(callback) {
390 | if (callback && typeof callback == 'function') {
391 | WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
392 | // 在这里拿到e.err_msg,这里面就包含了所有的网络类型
393 | callback(e.err_msg);
394 | });
395 | }
396 | }
397 |
398 | /**
399 | * 关闭当前微信公众平台页面
400 | * @param {Object} callbacks 回调方法
401 | * @p-config {Function} fail(resp) 失败
402 | * @p-config {Function} success(resp) 成功
403 | */
404 | function closeWindow(callbacks) {
405 | callbacks = callbacks || {};
406 | WeixinJSBridge.invoke("closeWindow",{},function(resp){
407 | switch (resp.err_msg) {
408 | // 关闭成功
409 | case 'close_window:ok':
410 | callbacks.success && callbacks.success(resp);
411 | break;
412 |
413 | // 关闭失败
414 | default :
415 | callbacks.fail && callbacks.fail(resp);
416 | break;
417 | }
418 | });
419 | }
420 |
421 | /**
422 | * 当页面加载完毕后执行,使用方法:
423 | * WeixinApi.ready(function(Api){
424 | * // 从这里只用Api即是WeixinApi
425 | * });
426 | * @param readyCallback
427 | */
428 | function wxJsBridgeReady(readyCallback) {
429 | if (readyCallback && typeof readyCallback == 'function') {
430 | var Api = this;
431 | var wxReadyFunc = function () {
432 | readyCallback(Api);
433 | };
434 | if (typeof window.WeixinJSBridge == "undefined"){
435 | if (document.addEventListener) {
436 | document.addEventListener('WeixinJSBridgeReady', wxReadyFunc, false);
437 | } else if (document.attachEvent) {
438 | document.attachEvent('WeixinJSBridgeReady', wxReadyFunc);
439 | document.attachEvent('onWeixinJSBridgeReady', wxReadyFunc);
440 | }
441 | }else{
442 | wxReadyFunc();
443 | }
444 | }
445 | }
446 |
447 | /**
448 | * 判断当前网页是否在微信内置浏览器中打开
449 | */
450 | function openInWeixin(){
451 | return /MicroMessenger/i.test(navigator.userAgent);
452 | }
453 |
454 | /*
455 | * 打开扫描二维码
456 | * @param {Object} callbacks 回调方法
457 | * @p-config {Function} fail(resp) 失败
458 | * @p-config {Function} success(resp) 成功
459 | */
460 | function scanQRCode (callbacks) {
461 | callbacks = callbacks || {};
462 | WeixinJSBridge.invoke("scanQRCode",{},function(resp){
463 | switch (resp.err_msg) {
464 | // 打开扫描器成功
465 | case 'scan_qrcode:ok':
466 | callbacks.success && callbacks.success(resp);
467 | break;
468 |
469 | // 打开扫描器失败
470 | default :
471 | callbacks.fail && callbacks.fail(resp);
472 | break;
473 | }
474 | });
475 | }
476 |
477 |
478 | /**
479 | * 检测应用程序是否已安装
480 | * by mingcheng 2014-10-17
481 | *
482 | * @param {Object} data 应用程序的信息
483 | * @p-config {String} packageUrl 应用注册的自定义前缀,如 xxx:// 就取 xxx
484 | * @p-config {String} packageName 应用的包名
485 | *
486 | * @param {Object} callbacks 相关回调方法
487 | * @p-config {Function} fail(resp) 失败
488 | * @p-config {Function} success(resp) 成功,如果有对应的版本信息,则写入到 resp.version 中
489 | * @p-config {Function} all(resp) 无论成功失败都会执行的回调
490 | */
491 | function getInstallState(data, callbacks) {
492 | callbacks = callbacks || {};
493 |
494 | WeixinJSBridge.invoke("getInstallState", {
495 | "packageUrl": data.packageUrl || "",
496 | "packageName": data.packageName || ""
497 | }, function(resp) {
498 | var msg = resp.err_msg, match = msg.match(/state:yes_?(.*)$/);
499 | if (match) {
500 | resp.version = match[1] || "";
501 | callbacks.success && callbacks.success(resp);
502 | } else {
503 | callbacks.fail && callbacks.fail(resp);
504 | }
505 |
506 | callbacks.all && callbacks.all(resp);
507 | });
508 | }
509 |
510 |
511 | /**
512 | * 开启Api的debug模式,比如出了个什么错误,能alert告诉你,而不是一直很苦逼的在想哪儿出问题了
513 | * @param {Function} callback(error) 出错后的回调,默认是alert
514 | */
515 | function enableDebugMode(callback){
516 | /**
517 | * @param {String} errorMessage 错误信息
518 | * @param {String} scriptURI 出错的文件
519 | * @param {Long} lineNumber 出错代码的行号
520 | * @param {Long} columnNumber 出错代码的列号
521 | */
522 | window.onerror = function(errorMessage, scriptURI, lineNumber,columnNumber) {
523 |
524 | // 有callback的情况下,将错误信息传递到options.callback中
525 | if(typeof callback === 'function'){
526 | callback({
527 | message : errorMessage,
528 | script : scriptURI,
529 | line : lineNumber,
530 | column : columnNumber
531 | });
532 | }else{
533 | // 其他情况,都以alert方式直接提示错误信息
534 | var msgs = [];
535 | msgs.push("额,代码有错。。。");
536 | msgs.push("\n错误信息:" , errorMessage);
537 | msgs.push("\n出错文件:" , scriptURI);
538 | msgs.push("\n出错位置:" , lineNumber + '行,' + columnNumber + '列');
539 | alert(msgs.join(''));
540 | }
541 | }
542 | }
543 |
544 | return {
545 | version :"2.5",
546 | enableDebugMode :enableDebugMode,
547 | ready :wxJsBridgeReady,
548 | shareToTimeline :weixinShareTimeline,
549 | shareToWeibo :weixinShareWeibo,
550 | shareToFriend :weixinSendAppMessage,
551 | generalShare :weixinGeneralShare,
552 | addContact :addContact,
553 | showOptionMenu :showOptionMenu,
554 | hideOptionMenu :hideOptionMenu,
555 | showToolbar :showToolbar,
556 | hideToolbar :hideToolbar,
557 | getNetworkType :getNetworkType,
558 | imagePreview :imagePreview,
559 | closeWindow :closeWindow,
560 | openInWeixin :openInWeixin,
561 | getInstallState :getInstallState,
562 | scanQRCode :scanQRCode
563 | };
564 | })();
565 |
--------------------------------------------------------------------------------
/src/js/plugins/preloadjs-0.4.1.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * @license PreloadJS
3 | * Visit http://createjs.com/ for documentation, updates and examples.
4 | *
5 | * Copyright (c) 2011-2013 gskinner.com, inc.
6 | *
7 | * Distributed under the terms of the MIT license.
8 | * http://www.opensource.org/licenses/mit-license.html
9 | *
10 | * This notice shall be included in all copies or substantial portions of the Software.
11 | */
12 | this.createjs=this.createjs||{},function(){"use strict";var a=createjs.PreloadJS=createjs.PreloadJS||{};a.version="0.4.1",a.buildDate="Thu, 12 Dec 2013 23:33:38 GMT"}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype;b.type=null,b.target=null,b.currentTarget=null,b.eventPhase=0,b.bubbles=!1,b.cancelable=!1,b.timeStamp=0,b.defaultPrevented=!1,b.propagationStopped=!1,b.immediatePropagationStopped=!1,b.removed=!1,b.initialize=function(a,b,c){this.type=a,this.bubbles=b,this.cancelable=c,this.timeStamp=(new Date).getTime()},b.preventDefault=function(){this.defaultPrevented=!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent,a.willTrigger=b.willTrigger},b._listeners=null,b._captureListeners=null,b.initialize=function(){},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b){if("string"==typeof a){var c=this._listeners;if(!c||!c[a])return!1;a=new createjs.Event(a)}if(a.target=b||this,a.bubbles&&this.parent){for(var d=this,e=[d];d.parent;)e.push(d=d.parent);var f,g=e.length;for(f=g-1;f>=0&&!a.propagationStopped;f--)e[f]._dispatchEvent(a,1+(0==f));for(f=1;g>f&&!a.propagationStopped;f++)e[f]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;a.currentTarget=this,a.eventPhase=b,a.removed=!1,e=e.slice();for(var f=0;c>f&&!a.immediatePropagationStopped;f++){var g=e[f];g.handleEvent?g.handleEvent(a):g(a),a.removed&&(this.off(a.type,g,1==b),a.removed=!1)}}},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";createjs.indexOf=function(a,b){for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1}}(),this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){this.init()};a.prototype=new createjs.EventDispatcher;var b=a.prototype,c=a;c.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?)|(.{0,2}\/{1}))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/,c.PATH_PATTERN=/^(?:(\w+:)\/{2})|(.{0,2}\/{1})?([/.]*?(?:[^?]+)?\/?)?$/,b.loaded=!1,b.canceled=!1,b.progress=0,b._item=null,b.getItem=function(){return this._item},b.init=function(){},b.load=function(){},b.close=function(){},b._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},b._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.Event("progress"),b.loaded=this.progress,b.total=1):(b=a,this.progress=a.loaded/a.total,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),b.progress=this.progress,this.hasEventListener("progress")&&this.dispatchEvent(b)}},b._sendComplete=function(){this._isCanceled()||this.dispatchEvent("complete")},b._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.Event("error")),this.dispatchEvent(a))},b._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},b._parseURI=function(a){return a?a.match(c.FILE_PATTERN):null},b._parsePath=function(a){return a?a.match(c.PATH_PATTERN):null},b._formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},b.buildPath=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this._formatQueryString(b,c):a+"?"+this._formatQueryString(b,c)},b._isCrossDomain=function(a){var b=document.createElement("a");b.href=a.src;var c=document.createElement("a");c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},b._isLocal=function(a){var b=document.createElement("a");return b.href=a.src,""==b.hostname&&"file:"==b.protocol},b.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.init(a,b,c)},b=a.prototype=new createjs.AbstractLoader,c=a;c.loadTimeout=8e3,c.LOAD_TIMEOUT=0,c.BINARY="binary",c.CSS="css",c.IMAGE="image",c.JAVASCRIPT="javascript",c.JSON="json",c.JSONP="jsonp",c.MANIFEST="manifest",c.SOUND="sound",c.SVG="svg",c.TEXT="text",c.XML="xml",c.POST="POST",c.GET="GET",b._basePath=null,b._crossOrigin="",b.useXHR=!0,b.stopOnError=!1,b.maintainScriptOrder=!0,b.next=null,b._typeCallbacks=null,b._extensionCallbacks=null,b._loadStartWasDispatched=!1,b._maxConnections=1,b._currentlyLoadingScript=null,b._currentLoads=null,b._loadQueue=null,b._loadQueueBackup=null,b._loadItemsById=null,b._loadItemsBySrc=null,b._loadedResults=null,b._loadedRawResults=null,b._numItems=0,b._numItemsLoaded=0,b._scriptOrder=null,b._loadedScripts=null,b.init=function(a,b,c){this._numItems=this._numItemsLoaded=0,this._paused=!1,this._loadStartWasDispatched=!1,this._currentLoads=[],this._loadQueue=[],this._loadQueueBackup=[],this._scriptOrder=[],this._loadedScripts=[],this._loadItemsById={},this._loadItemsBySrc={},this._loadedResults={},this._loadedRawResults={},this._typeCallbacks={},this._extensionCallbacks={},this._basePath=b,this.setUseXHR(a),this._crossOrigin=c===!0?"Anonymous":c===!1||null==c?"":c},b.setUseXHR=function(a){return this.useXHR=0!=a&&null!=window.XMLHttpRequest,this.useXHR},b.removeAll=function(){this.remove()},b.remove=function(a){var b=null;if(!a||a instanceof Array){if(a)b=a;else if(arguments.length>0)return}else b=[a];var c=!1;if(b){for(;b.length;){var d=b.pop(),e=this.getResult(d);for(f=this._loadQueue.length-1;f>=0;f--)if(g=this._loadQueue[f].getItem(),g.id==d||g.src==d){this._loadQueue.splice(f,1)[0].cancel();break}for(f=this._loadQueueBackup.length-1;f>=0;f--)if(g=this._loadQueueBackup[f].getItem(),g.id==d||g.src==d){this._loadQueueBackup.splice(f,1)[0].cancel();break}if(e)delete this._loadItemsById[e.id],delete this._loadItemsBySrc[e.src],this._disposeItem(e);else for(var f=this._currentLoads.length-1;f>=0;f--){var g=this._currentLoads[f].getItem();if(g.id==d||g.src==d){this._currentLoads.splice(f,1)[0].cancel(),c=!0;break}}}c&&this._loadNext()}else{this.close();for(var h in this._loadItemsById)this._disposeItem(this._loadItemsById[h]);this.init(this.useXHR)}},b.reset=function(){this.close();for(var a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);for(var b=[],c=0,d=this._loadQueueBackup.length;d>c;c++)b.push(this._loadQueueBackup[c].getItem());this.loadManifest(b,!1)},c.isBinary=function(a){switch(a){case createjs.LoadQueue.IMAGE:case createjs.LoadQueue.BINARY:return!0;default:return!1}},c.isText=function(a){switch(a){case createjs.LoadQueue.TEXT:case createjs.LoadQueue.JSON:case createjs.LoadQueue.MANIFEST:case createjs.LoadQueue.XML:case createjs.LoadQueue.HTML:case createjs.LoadQueue.CSS:case createjs.LoadQueue.SVG:case createjs.LoadQueue.JAVASCRIPT:return!0;default:return!1}},b.installPlugin=function(a){if(null!=a&&null!=a.getPreloadHandlers){var b=a.getPreloadHandlers();if(b.scope=a,null!=b.types)for(var c=0,d=b.types.length;d>c;c++)this._typeCallbacks[b.types[c]]=b;if(null!=b.extensions)for(c=0,d=b.extensions.length;d>c;c++)this._extensionCallbacks[b.extensions[c]]=b}},b.setMaxConnections=function(a){this._maxConnections=a,!this._paused&&this._loadQueue.length>0&&this._loadNext()},b.loadFile=function(a,b,c){if(null==a){var d=new createjs.Event("error");return d.text="PRELOAD_NO_FILE",this._sendError(d),void 0}this._addItem(a,null,c),b!==!1?this.setPaused(!1):this.setPaused(!0)},b.loadManifest=function(a,b,d){var e=null,f=null;if(a instanceof Array){if(0==a.length){var g=new createjs.Event("error");return g.text="PRELOAD_MANIFEST_EMPTY",this._sendError(g),void 0}e=a}else if("string"==typeof a)e=[{src:a,type:c.MANIFEST}];else{if("object"!=typeof a){var g=new createjs.Event("error");return g.text="PRELOAD_MANIFEST_NULL",this._sendError(g),void 0}if(void 0!==a.src){if(null==a.type)a.type=c.MANIFEST;else if(a.type!=c.MANIFEST){var g=new createjs.Event("error");g.text="PRELOAD_MANIFEST_ERROR",this._sendError(g)}e=[a]}else void 0!==a.manifest&&(e=a.manifest,f=a.path)}for(var h=0,i=e.length;i>h;h++)this._addItem(e[h],f,d);b!==!1?this.setPaused(!1):this.setPaused(!0)},b.load=function(){this.setPaused(!1)},b.getItem=function(a){return this._loadItemsById[a]||this._loadItemsBySrc[a]},b.getResult=function(a,b){var c=this._loadItemsById[a]||this._loadItemsBySrc[a];if(null==c)return null;var d=c.id;return b&&this._loadedRawResults[d]?this._loadedRawResults[d]:this._loadedResults[d]},b.setPaused=function(a){this._paused=a,this._paused||this._loadNext()},b.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0,this._loadedScripts.length=0,this.loadStartWasDispatched=!1},b._addItem=function(a,b,c){var d=this._createLoadItem(a,b,c);if(null!=d){var e=this._createLoader(d);null!=e&&(this._loadQueue.push(e),this._loadQueueBackup.push(e),this._numItems++,this._updateProgress(),this.maintainScriptOrder&&d.type==createjs.LoadQueue.JAVASCRIPT&&e instanceof createjs.XHRLoader&&(this._scriptOrder.push(d),this._loadedScripts.push(null)))}},b._createLoadItem=function(a,b,c){var d=null;switch(typeof a){case"string":d={src:a};break;case"object":d=window.HTMLAudioElement&&a instanceof window.HTMLAudioElement?{tag:a,src:d.tag.src,type:createjs.LoadQueue.SOUND}:a;break;default:return null}var e=this._parseURI(d.src);null!=e&&(d.ext=e[6]),null==d.type&&(d.type=this._getTypeByExtension(d.ext));var f="",g=c||this._basePath,h=d.src;if(e&&null==e[1]&&null==e[3])if(b){f=b;var i=this._parsePath(b);h=b+h,null!=g&&i&&null==i[1]&&null==i[2]&&(f=g+f)}else null!=g&&(f=g);if(d.src=f+d.src,d.path=f,(d.type==createjs.LoadQueue.JSON||d.type==createjs.LoadQueue.MANIFEST)&&(d._loadAsJSONP=null!=d.callback),d.type==createjs.LoadQueue.JSONP&&null==d.callback)throw new Error("callback is required for loading JSONP requests.");(void 0===d.tag||null===d.tag)&&(d.tag=this._createTag(d)),(void 0===d.id||null===d.id||""===d.id)&&(d.id=h);var j=this._typeCallbacks[d.type]||this._extensionCallbacks[d.ext];if(j){var k=j.callback.call(j.scope,d.src,d.type,d.id,d.data,f,this);if(k===!1)return null;k===!0||(null!=k.src&&(d.src=k.src),null!=k.id&&(d.id=k.id),null!=k.tag&&(d.tag=k.tag),null!=k.completeHandler&&(d.completeHandler=k.completeHandler),k.type&&(d.type=k.type),e=this._parseURI(d.src),null!=e&&null!=e[6]&&(d.ext=e[6].toLowerCase()))}return this._loadItemsById[d.id]=d,this._loadItemsBySrc[d.src]=d,d},b._createLoader=function(a){var b=this.useXHR;switch(a.type){case createjs.LoadQueue.JSON:case createjs.LoadQueue.MANIFEST:b=!a._loadAsJSONP;break;case createjs.LoadQueue.XML:case createjs.LoadQueue.TEXT:b=!0;break;case createjs.LoadQueue.SOUND:case createjs.LoadQueue.JSONP:b=!1;break;case null:return null}return b?new createjs.XHRLoader(a,this._crossOrigin):new createjs.TagLoader(a)},b._loadNext=function(){if(!this._paused){this._loadStartWasDispatched||(this._sendLoadStart(),this._loadStartWasDispatched=!0),this._numItems==this._numItemsLoaded?(this.loaded=!0,this._sendComplete(),this.next&&this.next.load&&this.next.load()):this.loaded=!1;for(var a=0;a
=this._maxConnections);a++){var b=this._loadQueue[a];if(this.maintainScriptOrder&&b instanceof createjs.TagLoader&&b.getItem().type==createjs.LoadQueue.JAVASCRIPT){if(this._currentlyLoadingScript)continue;this._currentlyLoadingScript=!0}this._loadQueue.splice(a,1),a--,this._loadItem(b)}}},b._loadItem=function(a){a.on("progress",this._handleProgress,this),a.on("complete",this._handleFileComplete,this),a.on("error",this._handleFileError,this),this._currentLoads.push(a),this._sendFileStart(a.getItem()),a.load()},b._handleFileError=function(a){var b=a.target;this._numItemsLoaded++,this._updateProgress();var c=new createjs.Event("error");c.text="FILE_LOAD_ERROR",c.item=b.getItem(),this._sendError(c),this.stopOnError||(this._removeLoadItem(b),this._loadNext())},b._handleFileComplete=function(a){var b=a.target,c=b.getItem();if(this._loadedResults[c.id]=b.getResult(),b instanceof createjs.XHRLoader&&(this._loadedRawResults[c.id]=b.getResult(!0)),this._removeLoadItem(b),this.maintainScriptOrder&&c.type==createjs.LoadQueue.JAVASCRIPT){if(!(b instanceof createjs.TagLoader))return this._loadedScripts[createjs.indexOf(this._scriptOrder,c)]=c,this._checkScriptLoadOrder(b),void 0;this._currentlyLoadingScript=!1}if(delete c._loadAsJSONP,c.type==createjs.LoadQueue.MANIFEST){var d=b.getResult();null!=d&&void 0!==d.manifest&&this.loadManifest(d,!0)}this._processFinishedLoad(c,b)},b._processFinishedLoad=function(a,b){this._numItemsLoaded++,this._updateProgress(),this._sendFileComplete(a,b),this._loadNext()},b._checkScriptLoadOrder=function(){for(var a=this._loadedScripts.length,b=0;a>b;b++){var c=this._loadedScripts[b];if(null===c)break;if(c!==!0){var d=this._loadedResults[c.id];(document.body||document.getElementsByTagName("body")[0]).appendChild(d),this._processFinishedLoad(c),this._loadedScripts[b]=!0}}},b._removeLoadItem=function(a){for(var b=this._currentLoads.length,c=0;b>c;c++)if(this._currentLoads[c]==a){this._currentLoads.splice(c,1);break}},b._handleProgress=function(a){var b=a.target;this._sendFileProgress(b.getItem(),b.progress),this._updateProgress()},b._updateProgress=function(){var a=this._numItemsLoaded/this._numItems,b=this._numItems-this._numItemsLoaded;if(b>0){for(var c=0,d=0,e=this._currentLoads.length;e>d;d++)c+=this._currentLoads[d].progress;a+=c/b*(b/this._numItems)}this._sendProgress(a)},b._disposeItem=function(a){delete this._loadedResults[a.id],delete this._loadedRawResults[a.id],delete this._loadItemsById[a.id],delete this._loadItemsBySrc[a.src]},b._createTag=function(a){var b=null;switch(a.type){case createjs.LoadQueue.IMAGE:return b=document.createElement("img"),""==this._crossOrigin||this._isLocal(a)||(b.crossOrigin=this._crossOrigin),b;case createjs.LoadQueue.SOUND:return b=document.createElement("audio"),b.autoplay=!1,b;case createjs.LoadQueue.JSON:case createjs.LoadQueue.JSONP:case createjs.LoadQueue.JAVASCRIPT:case createjs.LoadQueue.MANIFEST:return b=document.createElement("script"),b.type="text/javascript",b;case createjs.LoadQueue.CSS:return b=this.useXHR?document.createElement("style"):document.createElement("link"),b.rel="stylesheet",b.type="text/css",b;case createjs.LoadQueue.SVG:return this.useXHR?b=document.createElement("svg"):(b=document.createElement("object"),b.type="image/svg+xml"),b}return null},b._getTypeByExtension=function(a){if(null==a)return createjs.LoadQueue.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.LoadQueue.IMAGE;case"ogg":case"mp3":case"wav":return createjs.LoadQueue.SOUND;case"json":return createjs.LoadQueue.JSON;case"xml":return createjs.LoadQueue.XML;case"css":return createjs.LoadQueue.CSS;case"js":return createjs.LoadQueue.JAVASCRIPT;case"svg":return createjs.LoadQueue.SVG;default:return createjs.LoadQueue.TEXT}},b._sendFileProgress=function(a,b){if(this._isCanceled())return this._cleanUp(),void 0;if(this.hasEventListener("fileprogress")){var c=new createjs.Event("fileprogress");c.progress=b,c.loaded=b,c.total=1,c.item=a,this.dispatchEvent(c)}},b._sendFileComplete=function(a,b){if(!this._isCanceled()){var c=new createjs.Event("fileload");c.loader=b,c.item=a,c.result=this._loadedResults[a.id],c.rawResult=this._loadedRawResults[a.id],a.completeHandler&&a.completeHandler(c),this.hasEventListener("fileload")&&this.dispatchEvent(c)}},b._sendFileStart=function(a){var b=new createjs.Event("filestart");b.item=a,this.hasEventListener("filestart")&&this.dispatchEvent(b)},b.toString=function(){return"[PreloadJS LoadQueue]"},createjs.LoadQueue=a;var d=function(){};d.init=function(){var a=navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1,d.isOpera=null!=window.opera,d.isChrome=a.indexOf("Chrome")>-1,d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1},d.init(),createjs.LoadQueue.BrowserDetect=d}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.init(a)},b=a.prototype=new createjs.AbstractLoader;b._loadTimeout=null,b._tagCompleteProxy=null,b._isAudio=!1,b._tag=null,b._jsonResult=null,b.init=function(a){this._item=a,this._tag=a.tag,this._isAudio=window.HTMLAudioElement&&a.tag instanceof window.HTMLAudioElement,this._tagCompleteProxy=createjs.proxy(this._handleLoad,this)},b.getResult=function(){return this._item.type==createjs.LoadQueue.JSONP||this._item.type==createjs.LoadQueue.MANIFEST?this._jsonResult:this._tag},b.cancel=function(){this.canceled=!0,this._clean()},b.load=function(){var a=this._item,b=this._tag;clearTimeout(this._loadTimeout);var c=createjs.LoadQueue.LOAD_TIMEOUT;0==c&&(c=createjs.LoadQueue.loadTimeout),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),c),this._isAudio&&(b.src=null,b.preload="auto"),b.onerror=createjs.proxy(this._handleError,this),this._isAudio?(b.onstalled=createjs.proxy(this._handleStalled,this),b.addEventListener("canplaythrough",this._tagCompleteProxy,!1)):(b.onload=createjs.proxy(this._handleLoad,this),b.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this));var d=this.buildPath(a.src,a.values);switch(a.type){case createjs.LoadQueue.CSS:b.href=d;break;case createjs.LoadQueue.SVG:b.data=d;break;default:b.src=d}if(a.type==createjs.LoadQueue.JSONP||a.type==createjs.LoadQueue.JSON||a.type==createjs.LoadQueue.MANIFEST){if(null==a.callback)throw new Error("callback is required for loading JSONP requests.");if(null!=window[a.callback])throw new Error('JSONP callback "'+a.callback+'" already exists on window. You need to specify a different callback. Or re-name the current one.');window[a.callback]=createjs.proxy(this._handleJSONPLoad,this)}(a.type==createjs.LoadQueue.SVG||a.type==createjs.LoadQueue.JSONP||a.type==createjs.LoadQueue.JSON||a.type==createjs.LoadQueue.MANIFEST||a.type==createjs.LoadQueue.JAVASCRIPT||a.type==createjs.LoadQueue.CSS)&&(this._startTagVisibility=b.style.visibility,b.style.visibility="hidden",(document.body||document.getElementsByTagName("body")[0]).appendChild(b)),null!=b.load&&b.load()},b._handleJSONPLoad=function(a){this._jsonResult=a},b._handleTimeout=function(){this._clean();var a=new createjs.Event("error");a.text="PRELOAD_TIMEOUT",this._sendError(a)},b._handleStalled=function(){},b._handleError=function(){this._clean();var a=new createjs.Event("error");this._sendError(a)},b._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleLoad()},b._handleLoad=function(){if(!this._isCanceled()){var a=this.getItem(),b=a.tag;if(!(this.loaded||this._isAudio&&4!==b.readyState)){switch(this.loaded=!0,a.type){case createjs.LoadQueue.SVG:case createjs.LoadQueue.JSON:case createjs.LoadQueue.JSONP:case createjs.LoadQueue.MANIFEST:case createjs.LoadQueue.CSS:b.style.visibility=this._startTagVisibility,(document.body||document.getElementsByTagName("body")[0]).removeChild(b)}this._clean(),this._sendComplete()}}},b._clean=function(){clearTimeout(this._loadTimeout);var a=this.getItem(),b=a.tag;null!=b&&(b.onload=null,b.removeEventListener&&b.removeEventListener("canplaythrough",this._tagCompleteProxy,!1),b.onstalled=null,b.onprogress=null,b.onerror=null,null!=b.parentNode&&a.type==createjs.LoadQueue.SVG&&a.type==createjs.LoadQueue.JSON&&a.type==createjs.LoadQueue.MANIFEST&&a.type==createjs.LoadQueue.CSS&&a.type==createjs.LoadQueue.JSONP&&b.parentNode.removeChild(b));var a=this.getItem();(a.type==createjs.LoadQueue.JSONP||a.type==createjs.LoadQueue.MANIFEST)&&(window[a.callback]=null)},b.toString=function(){return"[PreloadJS TagLoader]"},createjs.TagLoader=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b){this.init(a,b)},b=a.prototype=new createjs.AbstractLoader;b._request=null,b._loadTimeout=null,b._xhrLevel=1,b._response=null,b._rawResponse=null,b._crossOrigin="",b.init=function(a,b){this._item=a,this._crossOrigin=b,!this._createXHR(a)},b.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},b.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},b.load=function(){if(null==this._request)return this._handleError(),void 0;if(this._request.onloadstart=createjs.proxy(this._handleLoadStart,this),this._request.onprogress=createjs.proxy(this._handleProgress,this),this._request.onabort=createjs.proxy(this._handleAbort,this),this._request.onerror=createjs.proxy(this._handleError,this),this._request.ontimeout=createjs.proxy(this._handleTimeout,this),1==this._xhrLevel){var a=createjs.LoadQueue.LOAD_TIMEOUT;if(0==a)a=createjs.LoadQueue.loadTimeout;else try{console.warn("LoadQueue.LOAD_TIMEOUT has been deprecated in favor of LoadQueue.loadTimeout")}catch(b){}this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),a)}this._request.onload=createjs.proxy(this._handleLoad,this),this._request.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this);try{this._item.values&&this._item.method!=createjs.LoadQueue.GET?this._item.method==createjs.LoadQueue.POST&&this._request.send(this._formatQueryString(this._item.values)):this._request.send()}catch(c){var d=new createjs.Event("error");d.error=c,this._sendError(d)}},b.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},b.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},b._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.Event("progress");b.loaded=a.loaded,b.total=a.total,this._sendProgress(b)}},b._handleLoadStart=function(){clearTimeout(this._loadTimeout),this._sendLoadStart()},b._handleAbort=function(){this._clean();var a=new createjs.Event("error");a.text="XHR_ABORTED",this._sendError(a)},b._handleError=function(){this._clean();var a=new createjs.Event("error");this._sendError(a)},b._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},b._handleLoad=function(){if(!this.loaded){if(this.loaded=!0,!this._checkError())return this._handleError(),void 0;this._response=this._getResponse(),this._clean();var a=this._generateTag();a&&this._sendComplete()}},b._handleTimeout=function(a){this._clean();var b=new createjs.Event("error");b.text="PRELOAD_TIMEOUT",this._sendError(a)},b._checkError=function(){var a=parseInt(this._request.status);switch(a){case 404:case 0:return!1}return!0},b._getResponse=function(){if(null!=this._response)return this._response;if(null!=this._request.response)return this._request.response;try{if(null!=this._request.responseText)return this._request.responseText}catch(a){}try{if(null!=this._request.responseXML)return this._request.responseXML}catch(a){}return null},b._createXHR=function(a){var b=this._isCrossDomain(a),c=null;if(b&&window.XDomainRequest)c=new XDomainRequest;else if(window.XMLHttpRequest)c=new XMLHttpRequest;else try{c=new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(d){try{c=new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(d){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){return!1}}}createjs.LoadQueue.isText(a.type)&&c.overrideMimeType&&c.overrideMimeType("text/plain; charset=utf-8"),this._xhrLevel="string"==typeof c.responseType?2:1;var e=null;return e=a.method==createjs.LoadQueue.GET?this.buildPath(a.src,a.values):a.src,c.open(a.method||createjs.LoadQueue.GET,e,!0),b&&c instanceof XMLHttpRequest&&1==this._xhrLevel&&c.setRequestHeader("Origin",location.origin),a.values&&a.method==createjs.LoadQueue.POST&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),createjs.LoadQueue.isBinary(a.type)&&(c.responseType="arraybuffer"),this._request=c,!0},b._clean=function(){clearTimeout(this._loadTimeout);var a=this._request;a.onloadstart=null,a.onprogress=null,a.onabort=null,a.onerror=null,a.onload=null,a.ontimeout=null,a.onloadend=null,a.onreadystatechange=null},b._generateTag=function(){var a=this._item.type,b=this._item.tag;switch(a){case createjs.LoadQueue.IMAGE:return b.onload=createjs.proxy(this._handleTagReady,this),""!=this._crossOrigin&&(b.crossOrigin="Anonymous"),b.src=this.buildPath(this._item.src,this._item.values),this._rawResponse=this._response,this._response=b,!1;case createjs.LoadQueue.JAVASCRIPT:return b=document.createElement("script"),b.text=this._response,this._rawResponse=this._response,this._response=b,!0;case createjs.LoadQueue.CSS:var c=document.getElementsByTagName("head")[0];if(c.appendChild(b),b.styleSheet)b.styleSheet.cssText=this._response;else{var d=document.createTextNode(this._response);b.appendChild(d)}return this._rawResponse=this._response,this._response=b,!0;case createjs.LoadQueue.XML:var e=this._parseXML(this._response,"text/xml");return this._rawResponse=this._response,this._response=e,!0;case createjs.LoadQueue.SVG:var e=this._parseXML(this._response,"image/svg+xml");return this._rawResponse=this._response,null!=e.documentElement?(b.appendChild(e.documentElement),this._response=b):this._response=e,!0;case createjs.LoadQueue.JSON:case createjs.LoadQueue.MANIFEST:var f={};try{f=JSON.parse(this._response)}catch(g){f=g}return this._rawResponse=this._response,this._response=f,!0}return!0},b._parseXML=function(a,b){var c=null;try{if(window.DOMParser){var d=new DOMParser;c=d.parseFromString(a,b)}else c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a)}catch(e){}return c},b._handleTagReady=function(){this._sendComplete()},b.toString=function(){return"[PreloadJS XHRLoader]"},createjs.XHRLoader=a}(),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();
--------------------------------------------------------------------------------
/src/js/plugins/zepto-touch.js:
--------------------------------------------------------------------------------
1 | // Zepto.js
2 | // (c) 2010-2014 Thomas Fuchs
3 | // Zepto.js may be freely distributed under the MIT license.
4 |
5 | ;(function($){
6 | var touch = {},
7 | touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
8 | longTapDelay = 750,
9 | gesture
10 |
11 | function swipeDirection(x1, x2, y1, y2) {
12 | return Math.abs(x1 - x2) >=
13 | Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
14 | }
15 |
16 | function longTap() {
17 | longTapTimeout = null
18 | if (touch.last) {
19 | touch.el.trigger('longTap')
20 | touch = {}
21 | }
22 | }
23 |
24 | function cancelLongTap() {
25 | if (longTapTimeout) clearTimeout(longTapTimeout)
26 | longTapTimeout = null
27 | }
28 |
29 | function cancelAll() {
30 | if (touchTimeout) clearTimeout(touchTimeout)
31 | if (tapTimeout) clearTimeout(tapTimeout)
32 | if (swipeTimeout) clearTimeout(swipeTimeout)
33 | if (longTapTimeout) clearTimeout(longTapTimeout)
34 | touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null
35 | touch = {}
36 | }
37 |
38 | function isPrimaryTouch(event){
39 | return (event.pointerType == 'touch' ||
40 | event.pointerType == event.MSPOINTER_TYPE_TOUCH)
41 | && event.isPrimary
42 | }
43 |
44 | function isPointerEventType(e, type){
45 | return (e.type == 'pointer'+type ||
46 | e.type.toLowerCase() == 'mspointer'+type)
47 | }
48 |
49 | $(document).ready(function(){
50 | var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType
51 |
52 | if ('MSGesture' in window) {
53 | gesture = new MSGesture()
54 | gesture.target = document.body
55 | }
56 |
57 | $(document)
58 | .bind('MSGestureEnd', function(e){
59 | var swipeDirectionFromVelocity =
60 | e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null;
61 | if (swipeDirectionFromVelocity) {
62 | touch.el.trigger('swipe')
63 | touch.el.trigger('swipe'+ swipeDirectionFromVelocity)
64 | }
65 | })
66 | .on('touchstart MSPointerDown pointerdown', function(e){
67 | if((_isPointerType = isPointerEventType(e, 'down')) &&
68 | !isPrimaryTouch(e)) return
69 | firstTouch = _isPointerType ? e : e.touches[0]
70 | if (e.touches && e.touches.length === 1 && touch.x2) {
71 | // Clear out touch movement data if we have it sticking around
72 | // This can occur if touchcancel doesn't fire due to preventDefault, etc.
73 | touch.x2 = undefined
74 | touch.y2 = undefined
75 | }
76 | now = Date.now()
77 | delta = now - (touch.last || now)
78 | touch.el = $('tagName' in firstTouch.target ?
79 | firstTouch.target : firstTouch.target.parentNode)
80 | touchTimeout && clearTimeout(touchTimeout)
81 | touch.x1 = firstTouch.pageX
82 | touch.y1 = firstTouch.pageY
83 | if (delta > 0 && delta <= 250) touch.isDoubleTap = true
84 | touch.last = now
85 | longTapTimeout = setTimeout(longTap, longTapDelay)
86 | // adds the current touch contact for IE gesture recognition
87 | if (gesture && _isPointerType) gesture.addPointer(e.pointerId);
88 | })
89 | .on('touchmove MSPointerMove pointermove', function(e){
90 | if((_isPointerType = isPointerEventType(e, 'move')) &&
91 | !isPrimaryTouch(e)) return
92 | firstTouch = _isPointerType ? e : e.touches[0]
93 | cancelLongTap()
94 | touch.x2 = firstTouch.pageX
95 | touch.y2 = firstTouch.pageY
96 |
97 | deltaX += Math.abs(touch.x1 - touch.x2)
98 | deltaY += Math.abs(touch.y1 - touch.y2)
99 | })
100 | .on('touchend MSPointerUp pointerup', function(e){
101 | if((_isPointerType = isPointerEventType(e, 'up')) &&
102 | !isPrimaryTouch(e)) return
103 | cancelLongTap()
104 |
105 | // swipe
106 | if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) ||
107 | (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))
108 |
109 | swipeTimeout = setTimeout(function() {
110 | touch.el.trigger('swipe')
111 | touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
112 | touch = {}
113 | }, 0)
114 |
115 | // normal tap
116 | else if ('last' in touch)
117 | // don't fire tap when delta position changed by more than 30 pixels,
118 | // for instance when moving to a point and back to origin
119 | if (deltaX < 30 && deltaY < 30) {
120 | // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
121 | // ('tap' fires before 'scroll')
122 | tapTimeout = setTimeout(function() {
123 |
124 | // trigger universal 'tap' with the option to cancelTouch()
125 | // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
126 | var event = $.Event('tap')
127 | event.cancelTouch = cancelAll
128 | touch.el.trigger(event)
129 |
130 | // trigger double tap immediately
131 | if (touch.isDoubleTap) {
132 | if (touch.el) touch.el.trigger('doubleTap')
133 | touch = {}
134 | }
135 |
136 | // trigger single tap after 250ms of inactivity
137 | else {
138 | touchTimeout = setTimeout(function(){
139 | touchTimeout = null
140 | if (touch.el) touch.el.trigger('singleTap')
141 | touch = {}
142 | }, 250)
143 | }
144 | }, 0)
145 | } else {
146 | touch = {}
147 | }
148 | deltaX = deltaY = 0
149 |
150 | })
151 | // when the browser window loses focus,
152 | // for example when a modal dialog is shown,
153 | // cancel all ongoing events
154 | .on('touchcancel MSPointerCancel pointercancel', cancelAll)
155 |
156 | // scrolling the window indicates intention of the user
157 | // to scroll, not tap or swipe, so cancel all ongoing events
158 | $(window).on('scroll', cancelAll)
159 | })
160 |
161 | ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown',
162 | 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
163 | $.fn[eventName] = function(callback){ return this.on(eventName, callback) }
164 | })
165 | })(Zepto)
166 |
--------------------------------------------------------------------------------
/src/js/plugins/zepto.min.js:
--------------------------------------------------------------------------------
1 | /* Zepto v1.1.4 - zepto event ajax form ie - zeptojs.com/license */
2 | var Zepto=function(){function L(t){return null==t?String(t):j[S.call(t)]||"object"}function Z(t){return"function"==L(t)}function $(t){return null!=t&&t==t.window}function _(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function D(t){return"object"==L(t)}function R(t){return D(t)&&!$(t)&&Object.getPrototypeOf(t)==Object.prototype}function M(t){return"number"==typeof t.length}function k(t){return s.call(t,function(t){return null!=t})}function z(t){return t.length>0?n.fn.concat.apply([],t):t}function F(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function q(t){return t in f?f[t]:f[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function H(t,e){return"number"!=typeof e||c[F(t)]?e:e+"px"}function I(t){var e,n;return u[t]||(e=a.createElement(t),a.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),u[t]=n),u[t]}function V(t){return"children"in t?o.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function B(n,i,r){for(e in i)r&&(R(i[e])||A(i[e]))?(R(i[e])&&!R(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),B(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function U(t,e){return null==e?n(t):n(t).filter(e)}function J(t,e,n,i){return Z(e)?e.call(t,n,i):e}function X(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function W(e,n){var i=e.className,r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function Y(t){var e;try{return t?"true"==t||("false"==t?!1:"null"==t?null:/^0/.test(t)||isNaN(e=Number(t))?/^[\[\{]/.test(t)?n.parseJSON(t):t:e):t}catch(i){return t}}function G(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)G(t.childNodes[n],e)}var t,e,n,i,C,N,r=[],o=r.slice,s=r.filter,a=window.document,u={},f={},c={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,h=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,p=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,d=/^(?:body|html)$/i,m=/([A-Z])/g,g=["val","css","html","text","data","width","height","offset"],v=["after","prepend","before","append"],y=a.createElement("table"),x=a.createElement("tr"),b={tr:a.createElement("tbody"),tbody:y,thead:y,tfoot:y,td:x,th:x,"*":a.createElement("div")},w=/complete|loaded|interactive/,E=/^[\w-]*$/,j={},S=j.toString,T={},O=a.createElement("div"),P={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},A=Array.isArray||function(t){return t instanceof Array};return T.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~T.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},T.fragment=function(e,i,r){var s,u,f;return h.test(e)&&(s=n(a.createElement(RegExp.$1))),s||(e.replace&&(e=e.replace(p,"<$1>$2>")),i===t&&(i=l.test(e)&&RegExp.$1),i in b||(i="*"),f=b[i],f.innerHTML=""+e,s=n.each(o.call(f.childNodes),function(){f.removeChild(this)})),R(r)&&(u=n(s),n.each(r,function(t,e){g.indexOf(t)>-1?u[t](e):u.attr(t,e)})),s},T.Z=function(t,e){return t=t||[],t.__proto__=n.fn,t.selector=e||"",t},T.isZ=function(t){return t instanceof T.Z},T.init=function(e,i){var r;if(!e)return T.Z();if("string"==typeof e)if(e=e.trim(),"<"==e[0]&&l.test(e))r=T.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=T.qsa(a,e)}else{if(Z(e))return n(a).ready(e);if(T.isZ(e))return e;if(A(e))r=k(e);else if(D(e))r=[e],e=null;else if(l.test(e))r=T.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=T.qsa(a,e)}}return T.Z(r,e)},n=function(t,e){return T.init(t,e)},n.extend=function(t){var e,n=o.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){B(t,n,e)}),t},T.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],s=i||r?e.slice(1):e,a=E.test(s);return _(t)&&a&&i?(n=t.getElementById(s))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:o.call(a&&!i?r?t.getElementsByClassName(s):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=a.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},n.type=L,n.isFunction=Z,n.isWindow=$,n.isArray=A,n.isPlainObject=R,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=C,n.trim=function(t){return null==t?"":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.map=function(t,e){var n,r,o,i=[];if(M(t))for(r=0;r=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return Z(t)?this.not(this.not(t)):n(s.call(this,function(e){return T.matches(e,t)}))},add:function(t,e){return n(N(this.concat(n(t,e))))},is:function(t){return this.length>0&&T.matches(this[0],t)},not:function(e){var i=[];if(Z(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r="string"==typeof e?this.filter(e):M(e)&&Z(e.item)?o.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return D(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!D(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!D(t)?t:n(t)},find:function(t){var e,i=this;return e=t?"object"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(T.qsa(this[0],t)):this.map(function(){return T.qsa(this,t)}):[]},closest:function(t,e){var i=this[0],r=!1;for("object"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:T.matches(i,t));)i=i!==e&&!_(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!_(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return U(e,t)},parent:function(t){return U(N(this.pluck("parentNode")),t)},children:function(t){return U(this.map(function(){return V(this)}),t)},contents:function(){return this.map(function(){return o.call(this.childNodes)})},siblings:function(t){return U(this.map(function(t,e){return s.call(V(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=Z(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=Z(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?"none"==i.css("display"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return n(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;n(this).empty().append(J(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=J(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(n,i){var r;return"string"!=typeof n||1 in arguments?this.each(function(t){if(1===this.nodeType)if(D(n))for(e in n)X(this,e,n[e]);else X(this,n,J(this,i,t,this.getAttribute(n)))}):this.length&&1===this[0].nodeType?!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:t},removeAttr:function(t){return this.each(function(){1===this.nodeType&&X(this,t)})},prop:function(t,e){return t=P[t]||t,1 in arguments?this.each(function(n){this[t]=J(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(e,n){var i="data-"+e.replace(m,"-$1").toLowerCase(),r=1 in arguments?this.attr(i,n):this.attr(i);return null!==r?Y(r):t},val:function(t){return 0 in arguments?this.each(function(e){this.value=J(this,t,e,this.value)}):this[0]&&(this[0].multiple?n(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=J(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(!this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r=this[0],o=getComputedStyle(r,"");if(!r)return;if("string"==typeof t)return r.style[C(t)]||o.getPropertyValue(t);if(A(t)){var s={};return n.each(A(t)?t:[t],function(t,e){s[e]=r.style[C(e)]||o.getPropertyValue(e)}),s}}var a="";if("string"==L(t))i||0===i?a=F(t)+":"+H(t,i):this.each(function(){this.style.removeProperty(F(t))});else for(e in t)t[e]||0===t[e]?a+=F(e)+":"+H(e,t[e])+";":this.each(function(){this.style.removeProperty(F(e))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(W(t))},q(t)):!1},addClass:function(t){return t?this.each(function(e){i=[];var r=W(this),o=J(this,t,e,r);o.split(/\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&W(this,r+(r?" ":"")+i.join(" "))}):this},removeClass:function(e){return this.each(function(n){return e===t?W(this,""):(i=W(this),J(this,e,n,i).split(/\s+/g).forEach(function(t){i=i.replace(q(t)," ")}),void W(this,i.trim()))})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=J(this,e,r,W(this));s.split(/\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=d.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css("margin-top"))||0,i.left-=parseFloat(n(t).css("margin-left"))||0,r.top+=parseFloat(n(e[0]).css("border-top-width"))||0,r.left+=parseFloat(n(e[0]).css("border-left-width"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||a.body;t&&!d.test(t.nodeName)&&"static"==n(t).css("position");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,["width","height"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?$(s)?s["inner"+i]:_(s)?s.documentElement["scroll"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,J(this,r,t,s[e]()))})}}),v.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=L(e),"object"==t||"array"==t||null==e?e:T.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,u){o=i?u:u.parentNode,u=0==e?u.nextSibling:1==e?u.firstChild:2==e?u:null;var f=n.contains(a.documentElement,o);r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();o.insertBefore(t,u),f&&G(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+"To":"insert"+(e?"Before":"After")]=function(e){return n(e)[t](this),this}}),T.Z.prototype=n.fn,T.uniq=N,T.deserializeValue=Y,n.zepto=T,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function d(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\s/).forEach(function(i){if("ready"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=j(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),"addEventListener"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||"").split(/\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],"removeEventListener"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function j(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=x,r&&r.apply(i,arguments)},e[n]=b}),(i.defaultPrevented!==n?i.defaultPrevented:"returnValue"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=x)),e}function S(t){var e,i={originalEvent:t};for(e in t)w.test(e)||t[e]===n||(i[e]=t[e]);return j(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return"string"==typeof t},s={},a={},u="onfocusin"in window,f={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){var s=2 in arguments&&i.call(arguments,2);if(r(e)){var a=function(){return e.apply(n,s?s.concat(i.call(arguments)):arguments)};return a._zid=l(e),a}if(o(n))return s?(s.unshift(e[n],e),t.proxy.apply(null,s)):t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var x=function(){return!0},b=function(){return!1},w=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(r(a)||a===!1)&&(u=a,a=n),u===!1&&(u=b),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(S(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=b),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):j(e),e._args=n,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=S(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.trigger(e)}}),["focus","blur"].forEach(function(e){t.fn[e]=function(t){return t?this.bind(e,t):this.each(function(){try{this[e]()}catch(t){}}),this}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),j(n)}}(Zepto),function(t){function l(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function h(t,e,i,r){return t.global?l(e||n,i,r):void 0}function p(e){e.global&&0===t.active++&&h(e,null,"ajaxStart")}function d(e){e.global&&!--t.active&&h(e,null,"ajaxStop")}function m(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||h(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void h(e,n,"ajaxSend",[t,e])}function g(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),h(n,r,"ajaxSuccess",[e,n,t]),y(o,e,n)}function v(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),h(i,o,"ajaxError",[n,i,t||e]),y(e,n,i)}function y(t,e,n){var i=n.context;n.complete.call(i,e,t),h(n,i,"ajaxComplete",[e,n]),d(n)}function x(){}function b(t){return t&&(t=t.split(";",2)[0]),t&&(t==f?"html":t==u?"json":s.test(t)?"script":a.test(t)&&"xml")||"text"}function w(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function E(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=w(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function T(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(a||"object"==o||"array"==o?n:"")+"]"),!r&&s?e.add(u.name,u.value):"array"==o||!i&&"object"==o?T(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |