diff --git a/css/Mexam.css b/css/Mexam.css
new file mode 100644
index 0000000..dc78648
--- /dev/null
+++ b/css/Mexam.css
@@ -0,0 +1,373 @@
+/**
+ * @name Mexam
+ * @desc 移动端题库做题插件,只支持,单选题,多选题,判断题
+ * @depend Zepto
+ * @author M.J
+ * @date 2015-07-09
+ * @URL http://webjyh.com
+ * @reutn {Mexam}
+ * @version 1.0.0
+ * @license MIT
+ *
+ * @PS If you have any questions, please don't look for me, I don't know anything. thank you.
+ */
+@font-face {
+ font-family: "Mexam";
+ src: url('../fonts/Mexam.eot'); /* IE9*/
+ src: url('../fonts/Mexam.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
+ url('../fonts/Mexam.woff') format('woff'), /* chrome、firefox */
+ url('../fonts/Mexam.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
+ url('../fonts/Mexam.svg#iconfont') format('svg'); /* iOS 4.1- */
+}
+.Mexam-icon {
+ font-family: "Mexam" !important;
+ font-size: 16px;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -webkit-text-stroke-width: 0.2px;
+ -moz-osx-font-smoothing: grayscale;
+}
+.Mexam-liebiao:before { content: "\e602"; }
+.Mexam-shijian:before { content: "\e600"; }
+.Mexam-loading:before { content: "\e603"; }
+
+.ui-Mexam-wrapper {
+ background-color: #FFF;
+ font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 10000;
+ visibility: visible;
+ -webkit-text-size-adjust: none;
+ text-size-adjust: none;
+}
+
+.ui-Mexam-wrapper > header {
+ position: absolute;
+ top: 0px;
+ left: 0;
+ width: 100%;
+ height: 44px;
+ background-color: #31bcc1;
+}
+
+.ui-Mexam-back,
+.ui-Mexam-preview {
+ height: 44px;
+ line-height: 44px;
+ left: 0;
+ position: absolute;
+ top: 0;
+ width: 44px;
+}
+
+.ui-Mexam-preview {
+ left: auto;
+ right: 0px;
+}
+
+.ui-Mexam-back > a,
+.ui-Mexam-preview > a {
+ display: block;
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ color: #FFF;
+ text-decoration: none;
+ text-indent: -12px;
+ font-size: 24px;
+ -webkit-transition: background .3s;
+ transition: background .3s;
+}
+
+.ui-Mexam-preview > a {
+ text-indent: 0;
+}
+
+.ui-Mexam-back a:active,
+.ui-Mexam-preview a:active {
+ background-color: rgba(0, 0, 0, 0.2);
+}
+
+.ui-Mexam-time {
+ position: absolute;
+ top: 0;
+ left: 40px;
+ right: 40px;
+ height: 44px;
+ line-height: 44px;
+ height: 100%;
+ text-align: center;
+ margin: 0;
+ padding: 0;
+ font-size: 24px;
+ color: #FFF;
+ font-weight: normal;
+}
+.ui-Mexam-time > .Mexam-icon {
+ font-size: 24px;
+}
+
+.ui-Mexam-title {
+ position: absolute;
+ top: 44px;
+ left: 0px;
+ right: 0px;
+ padding: 0px 10px;
+ height: 40px;
+ font-size: 16px;
+ border-bottom: 3px solid #e0e0e0;
+ overflow: hidden;
+}
+
+.ui-Mexam-title > h3 {
+ margin: 0;
+ padding: 0;
+ font-weight: normal;
+ font-size: 16px;
+ line-height: 40px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.ui-Mexam-title > span {
+ float: right;
+ display: block;
+ height: 40px;
+ line-height: 40px;
+}
+
+.ui-Mexam-title > span > em {
+ color: #31bcc1;
+ font-size: 20px;
+ font-style: normal;
+ padding-right: 5px;
+}
+.ui-Mexam-title > span i {
+ padding-left: 5px;
+}
+
+.ui-Mexam-main,
+.ui-Mexam-loading {
+ position: absolute;
+ top: 87px;
+ left: 0px;
+ right: 0px;
+ bottom: 0px;
+ z-index: 10;
+ overflow: hidden;
+}
+
+.ui-Mexam-loading {
+ z-index: 20;
+ background: #FFF;
+ opacity: 0;
+ visibility: hidden;
+ -webkit-transition: all .3s;
+ transition: all .3s;
+}
+
+.ui-Mexam-loading.ui-Mexam-show {
+ opacity: 1;
+ visibility: visible;
+}
+
+.ui-Mexam-loading > span {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 36px;
+ height: 36px;
+ line-height: 36px;
+ text-align: center;
+ font-size: 36px;
+ margin: -18px 0px 0px -18px;
+ color: #666;
+ -webkit-animation: MexamRotate .8s linear infinite;
+ animation: doRotate .8s linear infinite;
+}
+
+.ui-Mexam-view,
+.ui-Mexam-list {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.ui-Mexam-list {
+ position: absolute;
+ top: 0;
+ left: 0;
+ overflow: hidden;
+}
+
+.ui-Mexam-list > li {
+ padding: 0px;
+ width: 100%;
+ height: 100%;
+ display: inline-block;
+ overflow: hidden;
+ vertical-align: top;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+.ui-Mexam-list > li > div > h2 {
+ font-weight: normal;
+ padding: 15px 15px 0px;
+ margin: 0 0 20px 0;
+ font-size: 18px;
+ line-height: 1.6;
+}
+
+.ui-Mexam-list > li > div > ol {
+ list-style: none;
+ padding: 0 0 20px 0;
+ margin: 0;
+ -webkit-transition: background 0.3s;
+ transition: background 0.3s;
+}
+
+.ui-Mexam-list > li > div > ol > li {
+ padding: 10px 15px;
+}
+
+.ui-Mexam-list > li > div > ol > li + li {
+ margin-top: 10px;
+}
+
+.ui-Mexam-list > li > div > ol > li:active {
+ background-color: rgba(0, 0, 0, 0.05);
+}
+
+.ui-Mexam-list > li > div > ol > li > span {
+ display: block;
+ float: left;
+ width: 35px;
+ height: 35px;
+ border-radius: 50%;
+ text-align: center;
+ line-height: 35px;
+ border: 1px solid #31bcc1;
+ color: #31bcc1;
+}
+
+.ui-Mexam-list > li > div > ol > li.active > span {
+ background-color: #31bcc1;
+ color: #FFF;
+}
+
+.ui-Mexam-list > li > div > ol > li > p {
+ margin: 0 0 0 45px;
+ font-size: 16px;
+ display: table;
+ min-height: 35px;
+ color: #666;
+ line-height: 1.6;
+}
+
+.ui-Mexam-list > li > div > ol > li > p > span {
+ display: table-cell;
+ vertical-align: middle;
+}
+
+.ui-Mexam-buttom {
+ padding: 0px 0px 20px;
+}
+
+.ui-Mexam-buttom a {
+ display: block;
+ width: 200px;
+ margin: 0px auto;
+ text-align: center;
+ height: 45px;
+ line-height: 45px;
+ border-radius: 5px;
+ background-color: #31bcc1;
+ color: #FFF;
+ text-decoration: none;
+}
+.ui-Mexam-buttom a:active {
+ box-shadow: inset 0px 5px 20px rgba(0, 0, 0, 0.15);
+}
+
+.ui-Mexam-card {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 10;
+ background-color: #FFF;
+ -webkit-transition: -webkit-transform 500ms ease-in-out 0s;
+ transition: -webkit-transform 500ms ease-in-out 0s;
+}
+
+.ui-Mexam-card.ui-Mexam-show {
+ -webkit-transform: translate3d(0px, -100%, 0px);
+ transform: translate3d(0px, -100%, 0px);
+}
+
+.ui-Mexam-card > ul {
+ margin: 0;
+ padding: 20px 0px;
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+.ui-Mexam-card > ul:after {
+ clear: both;
+ display: table;
+ content: '';
+}
+
+.ui-Mexam-card > ul > li {
+ float: left;
+ width: 20%;
+ text-align: center;
+ list-style: none;
+ margin-bottom: 20px;
+}
+.ui-Mexam-card > ul > li a {
+ display: block;
+ margin: 0px auto;
+ color: #31bcc1;
+ width: 35px;
+ height: 35px;
+ line-height: 35px;
+ border-radius: 50%;
+ border: 1px solid #31bcc1;
+ -webkit-transition: background 0.3s;
+ transition: background 0.3s;
+ text-decoration: none;
+}
+
+.ui-Mexam-card > ul > li.active a,
+.ui-Mexam-card > ul > li a:active {
+ background: #31bcc1;
+ color: #FFF;
+}
+
+/* doRotate */
+@-webkit-keyframes MexamRotate {
+ 0% { -webkit-transform: rotateZ(0); }
+ 100% { -webkit-transform: rotateZ(360deg); }
+}
+@-moz-keyframes MexamRotate {
+ 0% { -moz-transform: rotateZ(0); }
+ 100% { -moz-transform: rotateZ(360deg); }
+}
+@-o-keyframes MexamRotate {
+ 0% { -o-transform: rotateZ(0); }
+ 100% { -o-transform: rotateZ(360deg); }
+}
+@keyframes MexamRotate {
+ 0% { transform: rotateZ(0); }
+ 100% { transform: rotateZ(360deg); }
+}
\ No newline at end of file
diff --git a/css/normalize.css b/css/normalize.css
new file mode 100644
index 0000000..5e5e3c8
--- /dev/null
+++ b/css/normalize.css
@@ -0,0 +1,424 @@
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS and IE text size adjust after device orientation change,
+ * without disabling user zoom.
+ */
+
+html {
+ font-family: sans-serif; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+ margin: 0;
+}
+
+/* HTML5 display definitions
+ ========================================================================== */
+
+/**
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11
+ * and Firefox.
+ * Correct `block` display not defined for `main` in IE 11.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/**
+ * 1. Correct `inline-block` display not defined in IE 8/9.
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
+ */
+
+audio,
+canvas,
+progress,
+video {
+ display: inline-block; /* 1 */
+ vertical-align: baseline; /* 2 */
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9/10.
+ * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+ display: none;
+}
+
+/* Links
+ ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+ background-color: transparent;
+}
+
+/**
+ * Improve readability of focused elements when they are also in an
+ * active/hover state.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari, and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9/10.
+ */
+
+img {
+ border: 0;
+}
+
+/**
+ * Correct overflow not hidden in IE 9/10/11.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari.
+ */
+
+figure {
+ margin: 1em 40px;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+ box-sizing: content-box;
+ height: 0;
+}
+
+/**
+ * Contain overflow in all browsers.
+ */
+
+pre {
+ overflow: auto;
+}
+
+/**
+ * Address odd `em`-unit font size rendering in all browsers.
+ */
+
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
+ * styling of `select`, unless a `border` property is set.
+ */
+
+/**
+ * 1. Correct color not being inherited.
+ * Known issue: affects color of disabled elements.
+ * 2. Correct font properties not being inherited.
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit; /* 1 */
+ font: inherit; /* 2 */
+ margin: 0; /* 3 */
+}
+
+/**
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
+ */
+
+button {
+ overflow: visible;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
+ * Correct `select` style inheritance in Firefox.
+ */
+
+button,
+select {
+ text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ * `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+input {
+ line-height: normal;
+}
+
+/**
+ * It's recommended that you don't attempt to style these elements.
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
+ *
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
+ * `font-size` values of the `input`, it causes the cursor style of the
+ * decrement button to change from `default` to `text`.
+ */
+
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ box-sizing: content-box; /* 2 */
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
+ * Safari (but not Chrome) clips the cancel button when the search input has
+ * padding (and `textfield` appearance).
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Remove default vertical scrollbar in IE 8/9/10/11.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * Don't inherit the `font-weight` (applied by a rule above).
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
+ */
+
+optgroup {
+ font-weight: bold;
+}
+
+/* Tables
+ ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+td,
+th {
+ padding: 0;
+}
diff --git a/fonts/Mexam.eot b/fonts/Mexam.eot
new file mode 100644
index 0000000..1864b6c
Binary files /dev/null and b/fonts/Mexam.eot differ
diff --git a/fonts/Mexam.svg b/fonts/Mexam.svg
new file mode 100644
index 0000000..890921e
--- /dev/null
+++ b/fonts/Mexam.svg
@@ -0,0 +1,55 @@
+
+
+
diff --git a/fonts/Mexam.ttf b/fonts/Mexam.ttf
new file mode 100644
index 0000000..27a8dbd
Binary files /dev/null and b/fonts/Mexam.ttf differ
diff --git a/fonts/Mexam.woff b/fonts/Mexam.woff
new file mode 100644
index 0000000..22263e1
Binary files /dev/null and b/fonts/Mexam.woff differ
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 0000000..a931ef9
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,22 @@
+var gulp = require('gulp'),
+ jshint = require('gulp-jshint'),
+ concat = require('gulp-concat'),
+ uglify = require('gulp-uglify');
+
+// 语法检查
+gulp.task('jshint', function () {
+ return gulp.src('js/Mexam.js')
+ .pipe(jshint())
+ .pipe(jshint.reporter('default'));
+});
+
+// 合并文件之后压缩代码
+gulp.task('minify', function (){
+ return gulp.src(['js/Mexam.js'])
+ .pipe(concat('Mexam.min.js'))
+ .pipe(gulp.dest('js'))
+ .pipe(uglify())
+ .pipe(gulp.dest('js'));
+});
+
+gulp.task('default', ['jshint', 'minify']);
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..d9e3722
--- /dev/null
+++ b/index.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+ Mexam 移动端在线做题组件,现只支持单选,多选,判断题类型。
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Mexam 移动端在线做题组件
+
+
+ - 本页面只适用于手机端查看
+ - 点击按钮答题
+ - GitHub地址 [这里]
+ - 作者Blog http://webjyh.com
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/Mexam.js b/js/Mexam.js
new file mode 100644
index 0000000..e6d421f
--- /dev/null
+++ b/js/Mexam.js
@@ -0,0 +1,721 @@
+/**
+ * @name Mexam
+ * @desc 移动端题库做题插件,只支持,单选题,多选题,判断题
+ * @depend Zepto
+ * @author M.J
+ * @date 2015-07-09
+ * @URL http://webjyh.com
+ * @reutn {Mexam}
+ * @version 1.0.0
+ * @license MIT
+ *
+ * @PS If you have any questions, please don't look for me, I don't know anything. thank you.
+ */
+(function(root, factory) {
+ "use strict";
+ if (typeof define === 'function' && define.amd) {
+ //AMD.
+ define(['zepto'], factory);
+ } else if (typeof exports === 'object') {
+ //CMD.
+ module.exports = factory(require('zepto'));
+ } else {
+ // Browser globals (root is window)
+ root.Mexam = factory(root.Zepto);
+ }
+}(this, function($) {
+
+ "use strict";
+
+ var scaleReg = /scale(?:3d)?\(([^\)]+)\)/,
+ translateReg = /translate(?:3d)?\(([^\)]+)\)/,
+ letter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
+ config = {
+ title: '',
+ data: null,
+ wrap: 'body',
+ send: function() {},
+ init: null,
+ close: null
+ },
+ innerHTML = ['',
+ '
',
+ ' ',
+ ' 00:00
',
+ ' ',
+ ' ',
+ '
',
+ ' 01/{{pageCoumt}}',
+ '
{{title}}
',
+ ' ',
+ '
',
+ '
',
+ '
'].join("");
+
+ /**
+ * 构造函数
+ * @param 用户配置项
+ * @returns {Mexam}
+ * @constructor {Mexam}
+ */
+ var Mexam = function(options) {
+ return new Mexam.fn.init(options);
+ };
+
+ Mexam.fn = Mexam.prototype = {
+ constructor: Mexam,
+ init: function(options) {
+ if (!options.data || !options.data.length) return;
+
+ this.config = $.extend(config, options); //默认配置项
+ this.index = 0; //当前题目
+ this.DOM = {}; //组件DOM
+ this.topics = {}; //存放当前订阅内容
+ this.titleHeight = null; //存放当前Title高度
+ this.next = false; //是否为 next 预加载下一题
+ this.time = 0; //记录当前做题时间
+ this.answer = new Array(this.config.data.length); //已答题的题目
+ this.resize = typeof window.orientation == 'number' ? 'orientationchange.mexam' : 'resize.mexam'; //支持旋转的事件名
+ this.screen = {
+ width: window.innerWidth,
+ height: window.innerHeight
+ };
+
+ if ($.isFunction(this.config.init)) {
+ this.config.init();
+ }
+
+ //载入订阅
+ this.loadTopics()
+ .publish('init')
+ .publish('touch')
+ .publish('answer')
+ .publish('topicJump')
+ .publish('events')
+ .publish('time');
+ },
+
+ /**
+ * @name 格式化当前页的数字
+ * @param val {Number} 默认用户的参数
+ * @return {String}
+ */
+ formatNumber: function(val) {
+ return val.toString().length < 2 ? '0' + val : val;
+ },
+
+ /**
+ * @name 订阅发布
+ * @type {Function}
+ * @parmas {key} 订阅的名称
+ * @params {val} 订阅的内容
+ * @return this
+ */
+ subscribe: function(key, val) {
+ if (!this.topics[key]) {
+ this.topics[key] = [];
+ }
+ this.topics[key].push(val);
+ return this;
+ },
+
+ /**
+ * @name 退订发布
+ * @type {Function}
+ * @params {key} 要退订的名称
+ * @return this
+ */
+ unsubscribe: function(key) {
+ if (this.topics[key]) {
+ delete this.topics[key];
+ }
+ return this;
+ },
+
+ /**
+ * @name 发布订阅的
+ * @type {Function}
+ * @return this
+ */
+ publish: function(key) {
+ if (!this.topics[key]) {
+ return false;
+ }
+
+ var subscribers = this.topics[key],
+ len = subscribers ? subscribers.length : 0,
+ args = [].slice.call(arguments);
+
+ args.shift();
+ for (var i = 0; i < len; i++) {
+ subscribers[i].apply(this, args);
+ }
+
+ return this;
+ },
+
+ /**
+ * 创建 HTML
+ * @params {Number} start 从当前第几个开始创建,包含 start
+ * @params {length} len 要创建的个数
+ * @returns {string}
+ */
+ create: function(start, len) {
+ var html = '',
+ tpl = '{{title}}
',
+ olStart = '
',
+ list = '- {{key}}
{{item}}
',
+ olEnd = '
',
+ button = '
';
+
+ for (var i = 0; i < len; i++) {
+ var answer = this.answer[start + i] || [],
+ data = this.config.data[start + i];
+ if (!data.content) break;
+
+ var temp = tpl.replace('{{title}}', data.title) + olStart;
+ $.each(data.content, function (index, item) {
+ var active = '', key = letter[index];
+ if ($.inArray(key, answer) > -1) active = 'active';
+ temp += list.replace(/{{key}}/g, key).replace('{{item}}', item).replace('{{active}}', active);
+ });
+ temp += olEnd;
+ if (data.type == 2) temp += button;
+ html += temp + '
';
+ }
+
+ return html;
+ },
+
+ /**
+ * 获取当前元素 CSS3 属性值
+ * @param {Elements} elem
+ * @param {String} name
+ * @return {Object}
+ */
+ getTransform: function(e, name) {
+ e = $(e);
+
+ var val = e.css("transform") || e.css("-webkit-transform"),
+ has = val === 'none',
+ arr, x, y, reg;
+
+ if (name === 'translate') {
+ reg = translateReg;
+ if (has || !val || val.indexOf(name) == -1) {
+ has = true;
+ x = y = 0;
+ }
+ } else if(name === "scale") {
+ reg = scaleReg;
+ if (has || !val || val.indexOf(name) == -1) {
+ has = true;
+ x = y = 1;
+ }
+ }
+
+ if (!has) {
+ arr = val.match(reg);
+ arr = arr[1].split(',');
+ x = parseFloat(arr[0]);
+ y = parseFloat(arr[1]);
+ }
+
+ return {
+ x: x,
+ y: y
+ };
+ },
+
+ /**
+ * 设置当前元素 CSS3 属性值
+ * @param {Elements} elem
+ * @param {Object} val
+ * @return this;
+ */
+ setTransform: function(elem, val) {
+ if (!elem) return;
+
+ var css = '',
+ style = elem.style,
+ key,
+ value;
+
+ for (key in val) {
+ value = val[key];
+ if (key === 'translate') {
+ css += " translate3d(" + value.x + "px, " + value.y + "px, 0)";
+ } else if (key === 'scale') {
+ css += " scale3d(" + value.x + ", " + value.y + ", 1)";
+ } else {
+ css += value;
+ }
+ }
+
+ style.transform = style.webkitTransform = $.trim(css);
+ },
+
+ /**
+ * 设置当前元素 CSS3 属性值
+ * @param {Elements} elem
+ * @param {Object} val
+ * @return this;
+ */
+ setTransition: function(elem, val) {
+ if (!elem) return;
+ var style = elem.style,
+ key,
+ value;
+ for (key in val) {
+ value = val[key];
+ value.easing = value.easing || "ease";
+ if (key === 'transform') {
+ style.transition = style.webkitTransition = '-webkit-' + key + ' ' + value.duration + ' ' + value.easing;
+ }
+ style.transition = style.webkitTransition = key + ' ' + value.duration + ' ' + value.easing;
+ }
+ },
+
+ /**
+ * 销毁组件并执行关闭毁掉
+ * @return null
+ */
+ destroy: function() {
+ if ($.isFunction(this.config.close)) {
+ var has = this.config.close.apply(this);
+ if (has === false) return false;
+ }
+
+ $(this.config.wrap).empty();
+ $(document).off('touchstart.mexam');
+ $(window).off(this.resize);
+ },
+ /**
+ * 默认载入已订阅的主题
+ * @return null
+ */
+ loadTopics: function() {
+
+ // 创建DOM
+ this.subscribe('init', function() {
+ var _this = this,
+ $wrap = $(this.config.wrap),
+ html = innerHTML.replace('{{pageCoumt}}', this.formatNumber(this.config.data.length))
+ .replace('{{title}}', this.config.title);
+ // 写入元素
+ $wrap.html(html);
+ var $elem = $wrap.find('*');
+ $elem.each(function(index, item) {
+ if (item.className.indexOf('ui-Mexam-') > -1) {
+ var key = $.trim(item.className.replace('ui-Mexam-', '').replace('ui-Mexam-show', ''));
+ _this.DOM[key] = $(item);
+ }
+ });
+
+ this.titleHeight = this.DOM.title.height() + this.DOM.time.height();
+ $(document).on('touchstart.mexam', function(e) { e.preventDefault(); });
+ });
+
+ // 构建题库列表
+ this.subscribe('init', function() {
+ var DOM = this.DOM,
+ len = this.config.data.length > 2 ? 3 : this.config.data.length,
+ html = this.create(0, len);
+
+ DOM.list.css({width: this.screen.width * len, left: 0}).html(html);
+ this.setTransition(DOM.list[0], {transform: {duration: '0ms'}});
+ this.setTransform(DOM.list[0], {translate: {x: 0, y: 0}});
+
+ setTimeout(function() {
+ DOM.loading.removeClass('ui-Mexam-show');
+ }, 200);
+ });
+
+ // 构建答题卡列表
+ this.subscribe('init', function() {
+ var DOM = this.DOM.cardList,
+ html = '',
+ tpl = '{{i}}',
+ len = this.config.data.length;
+
+ for (var i = 0; i < len; i++) {
+ html += tpl.replace('{{index}}', i).replace('{{i}}', i+1);
+ }
+
+ DOM.html(html);
+ });
+
+ // 加载当前题目的 上一题或下一题
+ this.subscribe('preloading', function(direction) {
+ var DOM = this.DOM,
+ MaxLen = this.config.data.length - 1,
+ index = direction == 'next' ? (this.index + 1) : (this.index - 1),
+ $elem = DOM.list.children();
+
+ // 判断是否为头或尾
+ if (index < 0 || index > MaxLen) return;
+ if (direction == 'next' && this.index === 1) return;
+ if (direction == 'prev' && this.index === MaxLen - 1) return;
+
+ // 移除DOM 创建DOM
+ var html = this.create(index, 1);
+ $elem[direction == 'next' ? 'first' : 'last']().remove();
+ DOM.list[direction == 'next' ? 'append' : 'prepend'](html);
+ });
+
+ // 设置当前题目数
+ this.subscribe('setPage', function() {
+ this.DOM.title.find('em').text(this.formatNumber(this.index+1));
+ });
+
+ // 跳转到下一题
+ this.subscribe('next', function() {
+ var elem = this.DOM.list[0],
+ len = this.config.data.length - 1,
+ isShowCard = this.index === len,
+ index = (this.index + 1 > len) ? len : (this.index + 1),
+ scroll= -(index * this.screen.width);
+
+ // 进行预加载下一题
+ this.next = true;
+ this.index = index;
+ this.publish('setPage');
+
+ // 到最后题提交完,跳转到答题卡;
+ if (isShowCard) this.publish('showCard', true);
+
+ // 下一题,
+ this.setTransition(elem, {transform: {duration: '300ms', easing: 'ease-out'}});
+ this.setTransform(elem, {translate: {x: scroll, y: 0}});
+ });
+
+ // 手势滑动 上一题,下一题
+ this.subscribe('touch', function(){
+ var _this = this,
+ DOM = this.DOM,
+ len = this.config.data.length - 1,
+ minTx = parseInt(this.screen.width / 3, 10),
+ $elem, startTx, startTy, defaultXY, listX, has, direction, height;
+
+ // 滑动开始
+ DOM.list.on('touchstart', function(e) {
+ e.preventDefault();
+ $elem = $(e.target).parents('li > div');
+ startTx = e.touches[0].clientX;
+ startTy = e.touches[0].clientY;
+ if ($elem.length) {
+ height = $elem.height() - _this.screen.height + _this.titleHeight;
+ defaultXY = _this.getTransform($elem[0], 'translate');
+ listX = _this.getTransform(this, 'translate').x;
+ }
+ });
+ // 滑动中
+ DOM.list.on('touchmove', function(e) {
+ e.preventDefault();
+ var scroll,
+ currentTx = e.touches[0].clientX,
+ currentTy = e.touches[0].clientY,
+ diff = startTx - currentTx,
+ distanceX = startTx - currentTx,
+ distanceY = startTy - currentTy,
+ fix = _this.index * _this.screen.width;
+
+ //横向滚动 上一题下一题
+ if (Math.abs(distanceX) >= Math.abs(distanceY)) {
+ // 滚动差值
+ direction = diff > 0 ? true : false;
+ if (!direction && _this.index === 0) {
+ scroll = Math.abs(diff);
+ } else {
+ scroll = direction ? -(Math.abs(diff) + fix) : -(fix - Math.abs(diff));
+ }
+ // 拖动时滚动
+ _this.setTransition(this, {transform: {duration: '0ms'}});
+ _this.setTransform(this, {translate: {x: scroll, y: 0}});
+ } else {
+ if (!$elem.length || $elem.height() < (_this.screen.height - _this.titleHeight)) return;
+ diff = defaultXY.y - distanceY;
+ _this.setTransform(this, {translate: {x: listX, y: 0}});
+ _this.setTransition($elem[0], {transform: {duration: '0ms'}});
+ _this.setTransform($elem[0], {translate: {x: 0, y: diff}});
+ }
+ });
+ // 滑动结束
+ DOM.list.on('touchend', function(e) {
+ e.preventDefault();
+ var endTx = e.changedTouches[0].clientX,
+ endTy = e.changedTouches[0].clientY,
+ distanceX = startTx - endTx,
+ distanceY = startTy - endTy;
+ has = Math.abs(startTx - endTx) > minTx;
+
+ if (Math.abs(distanceX) >= Math.abs(distanceY)) {
+ // 设置 _this.index
+ if (has) {
+ direction ? (_this.index++) : (_this.index--);
+ }
+ if (_this.index < 0) _this.index = 0;
+ if (_this.index > len) _this.index = len;
+
+ // 设置滚动
+ var scroll = -(_this.index * _this.screen.width);
+ _this.setTransition(this, {transform: {duration: '300ms', easing: 'ease-out'}});
+ _this.setTransform(this, {translate: {x: scroll, y: 0}});
+
+ if (has) _this.publish('setPage');
+ } else {
+ if (!$elem.length || $elem.height() < (_this.screen.height - _this.titleHeight)) return;
+ var y = _this.getTransform($elem[0], 'translate').y;
+ _this.setTransition($elem[0], {transform: {duration: '300ms', easing: 'ease-out'}});
+ if ( y > 0 && Math.abs(y) > 0) _this.setTransform($elem[0], {translate: {x: 0, y: 0}});
+ if (y < 0 && Math.abs(y) > height) _this.setTransform($elem[0], {translate: {x: 0, y: -height}});
+ }
+ });
+
+ // 动画结束回调
+ DOM.list.on('webkitTransitionEnd transtionend', function() {
+ if (has || _this.next) {
+ if (_this.next) direction = 'next';
+ _this.publish('preloading', direction ? 'next' : 'prev');
+ var diff = _this.index * _this.screen.width - _this.screen.width;
+ if (_this.index === 0) diff = 0;
+ if (_this.index === _this.config.data.length - 1) diff = diff - _this.screen.width;
+ $(this).css('left', diff < 0 ? 0 : diff);
+ has = false;
+ _this.next = false;
+ }
+ });
+ });
+
+ // 做题
+ this.subscribe('answer', function() {
+ var isExec = false,
+ isBtn = false,
+ DOM = this.DOM,
+ _this = this;
+
+ // 答题事件
+ DOM.list.on('tap', 'ol > li', function(e) {
+ e.preventDefault();
+ var $elem = $(this),
+ type = _this.config.data[_this.index].type;
+
+ if (isExec) return;
+ isExec = true;
+
+ setTimeout(function() { isExec = false; }, 100);
+ switch (type) {
+ case 1:
+ case 4: single($elem); break;
+ case 2: multi($elem); break;
+ default: single($elem); break;
+ }
+ });
+
+ // 下一题按钮事件
+ DOM.list.on('tap', '.ui-Mexam-buttom > a', function(e) {
+ e.preventDefault();
+ if (isBtn) return;
+
+ isBtn = true;
+ setTimeout(function() {
+ isBtn = false;
+ _this.publish('next');
+ }, 200);
+ });
+
+ // 同步答题卡
+ function setAnswerCard(val) {
+ DOM.cardList.find('li').eq(_this.index)[val ? 'addClass' : 'removeClass']('active');
+ };
+
+ // 单选题
+ function single(elem) {
+ var $elem = elem,
+ answer = $elem.attr('data-answer');
+
+ // 设置答案,添加选中,设置答题卡
+ _this.answer[_this.index] = answer;
+ $elem.addClass('active').siblings().removeClass('active');
+ if (_this.answer) setAnswerCard(true);
+
+ setTimeout(function() {
+ _this.publish('next');
+ }, 200);
+ }
+
+ // 多选题
+ function multi(elem) {
+ var $elem = elem,
+ select = _this.answer[_this.index] || [],
+ answer = $elem.attr('data-answer'),
+ index = $.inArray(answer, select);
+
+ index > -1 ?
+ (select.splice(index, 1))
+ :
+ (select.push(answer));
+
+ // 设置答案,添加选中,设置答题卡
+ select.sort(); //按字母排序
+ _this.answer[_this.index] = select;
+ $elem[index > -1 ? 'removeClass' : 'addClass']('active');
+ setAnswerCard(select.length ? true : false);
+ }
+ });
+
+ // 答题卡跳转
+ this.subscribe('topicJump', function() {
+ var DOM = this.DOM,
+ _this = this,
+ isExec = false,
+ len = this.config.data.length;
+
+ DOM.cardList.on('tap', 'li', function(e) {
+ e.preventDefault();
+ var html, scroll, left, length = len < 3 ? len : 3,
+ $elem = $(this),
+ defaultIndex = parseInt($elem.text(), 10),
+ index = defaultIndex;
+
+ if (isExec) return;
+
+ if (len <= 3) {
+ index = 0;
+ } else {
+ index = index - 2;
+ if (index < 1 || len === 1) index = 0;
+ if (index >= len-2) index = (len-1) - 2;
+ }
+
+ // 获取TPL
+ html = _this.create(index, length);
+ _this.index = defaultIndex - 1;
+ left = _this.index * _this.screen.width - _this.screen.width;
+ scroll= -(_this.index * _this.screen.width);
+ if (_this.index === 0) left = 0;
+ if (_this.index === len - 1) left = left - _this.screen.width;
+
+ //设置DOM
+ DOM.card.removeClass('ui-Mexam-show');
+ DOM.list.css('left', left < 0 ? 0 : left).html(html);
+ _this.setTransition(DOM.list[0], {transform: {duration: '300ms', easing: 'ease-out'}});
+ _this.setTransform(DOM.list[0], {translate: {x: scroll, y: 0}});
+ _this.publish('setPage');
+
+ setTimeout(function() { isExec = false; }, 100);
+ });
+
+ });
+
+ // 显示答题卡
+ this.subscribe('showCard', function(val) {
+ var DOM = this.DOM;
+ DOM.card[val ? 'addClass' : 'removeClass']('ui-Mexam-show');
+ });
+
+ // 组件事件
+ this.subscribe('events', function() {
+ var cle, DOM = this.DOM,
+ _this = this;
+
+ // 展现答题卡
+ DOM.preview.on('touchstart', function(e) {
+ e.preventDefault();
+ var has = DOM.card.hasClass('ui-Mexam-show');
+ DOM.card[has ? 'removeClass' : 'addClass']('ui-Mexam-show');
+ });
+
+ // 提交答题卡
+ DOM.card.on('touchstart', '.ui-Mexam-buttom > a', function(e) {
+ e.preventDefault();
+
+ var answer = [];
+ $.each(_this.answer, function(i, item) {
+ answer.push({
+ id: _this.config.data[i].id,
+ answer: item
+ });
+ });
+
+ if ($.isFunction(_this.config.send)) {
+ var send = _this.config.send.apply(_this, [answer, _this.time]);
+ if (send === false) {
+ return false;
+ }
+ _this.destroy();
+ }
+ });
+
+ // 返回按钮事件
+ DOM.back.on('touchstart', function(e) {
+ e.preventDefault();
+ _this.destroy();
+ });
+
+ $(window).on(this.resize, function() {
+ clearInterval(cle);
+ cle = setTimeout(function() {
+ _this.publish('resize');
+ }, 300);
+ });
+ });
+
+ // 页面计时器
+ this.subscribe('time', function() {
+ var time, _this = this,
+ minute = 0,
+ second = 0,
+ DOM = this.DOM.time.find('span');
+ var timing = function() {
+ second++;
+ if (second == 60) {
+ second = 0;
+ minute++;
+ }
+ _this.time = (minute * 60) + second;
+ DOM.text(_this.formatNumber(minute) + ':' + _this.formatNumber(second));
+ };
+ setInterval(timing, 1000);
+ });
+
+ // Resize
+ this.subscribe('resize', function() {
+ this.next = false;
+ this.screen = {
+ width: window.innerWidth,
+ height: window.innerHeight
+ };
+
+ var DOM = this.DOM,
+ len = this.config.data.length > 2 ? 3 : this.config.data.length,
+ left = this.index * this.screen.width - this.screen.width,
+ translate = -(this.index * this.screen.width);
+ if (this.index === 0) left = 0;
+ if (this.index === len - 1) left = left - this.screen.width;
+
+ this.setTransition(DOM.list[0], {transform: {duration: '0ms'}});
+ this.setTransform(DOM.list[0], {translate: {x: translate, y: 0}});
+ DOM.list.css({ width: this.screen.width * len, left: left })
+ .children()
+ .css({width: this.screen.width, height: this.screen.height})
+ .children()
+ .removeAttr('style');
+ });
+
+ return this;
+ }
+ };
+
+ // 将 init.prototype 指向 Mexam.prototype
+ Mexam.fn.init.prototype = Mexam.fn;
+
+ // 扩展至全局
+ return Mexam;
+}));
\ No newline at end of file
diff --git a/js/Mexam.min.js b/js/Mexam.min.js
new file mode 100644
index 0000000..e5e84d4
--- /dev/null
+++ b/js/Mexam.min.js
@@ -0,0 +1,14 @@
+/**
+ * @name Mexam
+ * @desc 移动端题库做题插件,只支持,单选题,多选题,判断题
+ * @depend Zepto
+ * @author M.J
+ * @date 2015-07-09
+ * @URL http://webjyh.com
+ * @reutn {Mexam}
+ * @version 1.0.0
+ * @license MIT
+ *
+ * @PS If you have any questions, please don't look for me, I don't know anything. thank you.
+ */
+!function(t,i){"use strict";"function"==typeof define&&define.amd?define(["zepto"],i):"object"==typeof exports?module.exports=i(require("zepto")):t.Mexam=i(t.Zepto)}(this,function(t){"use strict";var i=/scale(?:3d)?\(([^\)]+)\)/,e=/translate(?:3d)?\(([^\)]+)\)/,s=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n={title:"",data:null,wrap:"body",send:function(){},init:null,close:null},a=['',"
",'
'," 01/{{pageCoumt}}","
{{title}}
"," ",'
",'
',"
"].join(""),r=function(t){return new r.fn.init(t)};return r.fn=r.prototype={constructor:r,init:function(i){i.data&&i.data.length&&(this.config=t.extend(n,i),this.index=0,this.DOM={},this.topics={},this.titleHeight=null,this.next=!1,this.time=0,this.answer=new Array(this.config.data.length),this.resize="number"==typeof window.orientation?"orientationchange.mexam":"resize.mexam",this.screen={width:window.innerWidth,height:window.innerHeight},t.isFunction(this.config.init)&&this.config.init(),this.loadTopics().publish("init").publish("touch").publish("answer").publish("topicJump").publish("events").publish("time"))},formatNumber:function(t){return t.toString().length<2?"0"+t:t},subscribe:function(t,i){return this.topics[t]||(this.topics[t]=[]),this.topics[t].push(i),this},unsubscribe:function(t){return this.topics[t]&&delete this.topics[t],this},publish:function(t){if(!this.topics[t])return!1;var i=this.topics[t],e=i?i.length:0,s=[].slice.call(arguments);s.shift();for(var n=0;e>n;n++)i[n].apply(this,s);return this},create:function(i,e){for(var n="",a='{{title}}
',r="
",h='- {{key}}
{{item}}
',o="
",c='
',l=0;e>l;l++){var u=this.answer[i+l]||[],d=this.config.data[i+l];if(!d.content)break;var f=a.replace("{{title}}",d.title)+r;t.each(d.content,function(i,e){var n="",a=s[i];t.inArray(a,u)>-1&&(n="active"),f+=h.replace(/{{key}}/g,a).replace("{{item}}",e).replace("{{active}}",n)}),f+=o,2==d.type&&(f+=c),n+=f+"
"}return n},getTransform:function(s,n){s=t(s);var a,r,h,o,c=s.css("transform")||s.css("-webkit-transform"),l="none"===c;return"translate"===n?(o=e,(l||!c||-1==c.indexOf(n))&&(l=!0,r=h=0)):"scale"===n&&(o=i,(l||!c||-1==c.indexOf(n))&&(l=!0,r=h=1)),l||(a=c.match(o),a=a[1].split(","),r=parseFloat(a[0]),h=parseFloat(a[1])),{x:r,y:h}},setTransform:function(i,e){if(i){var s,n,a="",r=i.style;for(s in e)n=e[s],a+="translate"===s?" translate3d("+n.x+"px, "+n.y+"px, 0)":"scale"===s?" scale3d("+n.x+", "+n.y+", 1)":n;r.transform=r.webkitTransform=t.trim(a)}},setTransition:function(t,i){if(t){var e,s,n=t.style;for(e in i)s=i[e],s.easing=s.easing||"ease","transform"===e&&(n.transition=n.webkitTransition="-webkit-"+e+" "+s.duration+" "+s.easing),n.transition=n.webkitTransition=e+" "+s.duration+" "+s.easing}},destroy:function(){if(t.isFunction(this.config.close)){var i=this.config.close.apply(this);if(i===!1)return!1}t(this.config.wrap).empty(),t(document).off("touchstart.mexam"),t(window).off(this.resize)},loadTopics:function(){return this.subscribe("init",function(){var i=this,e=t(this.config.wrap),s=a.replace("{{pageCoumt}}",this.formatNumber(this.config.data.length)).replace("{{title}}",this.config.title);e.html(s);var n=e.find("*");n.each(function(e,s){if(s.className.indexOf("ui-Mexam-")>-1){var n=t.trim(s.className.replace("ui-Mexam-","").replace("ui-Mexam-show",""));i.DOM[n]=t(s)}}),this.titleHeight=this.DOM.title.height()+this.DOM.time.height(),t(document).on("touchstart.mexam",function(t){t.preventDefault()})}),this.subscribe("init",function(){var t=this.DOM,i=this.config.data.length>2?3:this.config.data.length,e=this.create(0,i);t.list.css({width:this.screen.width*i,left:0}).html(e),this.setTransition(t.list[0],{transform:{duration:"0ms"}}),this.setTransform(t.list[0],{translate:{x:0,y:0}}),setTimeout(function(){t.loading.removeClass("ui-Mexam-show")},200)}),this.subscribe("init",function(){for(var t=this.DOM.cardList,i="",e='{{i}}',s=this.config.data.length,n=0;s>n;n++)i+=e.replace("{{index}}",n).replace("{{i}}",n+1);t.html(i)}),this.subscribe("preloading",function(t){var i=this.DOM,e=this.config.data.length-1,s="next"==t?this.index+1:this.index-1,n=i.list.children();if(!(0>s||s>e||"next"==t&&1===this.index||"prev"==t&&this.index===e-1)){var a=this.create(s,1);n["next"==t?"first":"last"]().remove(),i.list["next"==t?"append":"prepend"](a)}}),this.subscribe("setPage",function(){this.DOM.title.find("em").text(this.formatNumber(this.index+1))}),this.subscribe("next",function(){var t=this.DOM.list[0],i=this.config.data.length-1,e=this.index===i,s=this.index+1>i?i:this.index+1,n=-(s*this.screen.width);this.next=!0,this.index=s,this.publish("setPage"),e&&this.publish("showCard",!0),this.setTransition(t,{transform:{duration:"300ms",easing:"ease-out"}}),this.setTransform(t,{translate:{x:n,y:0}})}),this.subscribe("touch",function(){var i,e,s,n,a,r,h,o,c=this,l=this.DOM,u=this.config.data.length-1,d=parseInt(this.screen.width/3,10);l.list.on("touchstart",function(r){r.preventDefault(),i=t(r.target).parents("li > div"),e=r.touches[0].clientX,s=r.touches[0].clientY,i.length&&(o=i.height()-c.screen.height+c.titleHeight,n=c.getTransform(i[0],"translate"),a=c.getTransform(this,"translate").x)}),l.list.on("touchmove",function(t){t.preventDefault();var r,o=t.touches[0].clientX,l=t.touches[0].clientY,u=e-o,d=e-o,f=s-l,m=c.index*c.screen.width;if(Math.abs(d)>=Math.abs(f))h=u>0?!0:!1,r=h||0!==c.index?h?-(Math.abs(u)+m):-(m-Math.abs(u)):Math.abs(u),c.setTransition(this,{transform:{duration:"0ms"}}),c.setTransform(this,{translate:{x:r,y:0}});else{if(!i.length||i.height()d,Math.abs(l)>=Math.abs(f)){r&&(h?c.index++:c.index--),c.index<0&&(c.index=0),c.index>u&&(c.index=u);var m=-(c.index*c.screen.width);c.setTransition(this,{transform:{duration:"300ms",easing:"ease-out"}}),c.setTransform(this,{translate:{x:m,y:0}}),r&&c.publish("setPage")}else{if(!i.length||i.height()0&&Math.abs(p)>0&&c.setTransform(i[0],{translate:{x:0,y:0}}),0>p&&Math.abs(p)>o&&c.setTransform(i[0],{translate:{x:0,y:-o}})}}),l.list.on("webkitTransitionEnd transtionend",function(){if(r||c.next){c.next&&(h="next"),c.publish("preloading",h?"next":"prev");var i=c.index*c.screen.width-c.screen.width;0===c.index&&(i=0),c.index===c.config.data.length-1&&(i-=c.screen.width),t(this).css("left",0>i?0:i),r=!1,c.next=!1}})}),this.subscribe("answer",function(){function i(t){r.cardList.find("li").eq(h.index)[t?"addClass":"removeClass"]("active")}function e(t){var e=t,s=e.attr("data-answer");h.answer[h.index]=s,e.addClass("active").siblings().removeClass("active"),h.answer&&i(!0),setTimeout(function(){h.publish("next")},200)}function s(e){var s=e,n=h.answer[h.index]||[],a=s.attr("data-answer"),r=t.inArray(a,n);r>-1?n.splice(r,1):n.push(a),n.sort(),h.answer[h.index]=n,s[r>-1?"removeClass":"addClass"]("active"),i(n.length?!0:!1)}var n=!1,a=!1,r=this.DOM,h=this;r.list.on("tap","ol > li",function(i){i.preventDefault();var a=t(this),r=h.config.data[h.index].type;if(!n)switch(n=!0,setTimeout(function(){n=!1},100),r){case 1:case 4:e(a);break;case 2:s(a);break;default:e(a)}}),r.list.on("tap",".ui-Mexam-buttom > a",function(t){t.preventDefault(),a||(a=!0,setTimeout(function(){a=!1,h.publish("next")},200))})}),this.subscribe("topicJump",function(){var i=this.DOM,e=this,s=!1,n=this.config.data.length;i.cardList.on("tap","li",function(a){a.preventDefault();var r,h,o,c=3>n?n:3,l=t(this),u=parseInt(l.text(),10),d=u;s||(3>=n?d=0:(d-=2,(1>d||1===n)&&(d=0),d>=n-2&&(d=n-1-2)),r=e.create(d,c),e.index=u-1,o=e.index*e.screen.width-e.screen.width,h=-(e.index*e.screen.width),0===e.index&&(o=0),e.index===n-1&&(o-=e.screen.width),i.card.removeClass("ui-Mexam-show"),i.list.css("left",0>o?0:o).html(r),e.setTransition(i.list[0],{transform:{duration:"300ms",easing:"ease-out"}}),e.setTransform(i.list[0],{translate:{x:h,y:0}}),e.publish("setPage"),setTimeout(function(){s=!1},100))})}),this.subscribe("showCard",function(t){var i=this.DOM;i.card[t?"addClass":"removeClass"]("ui-Mexam-show")}),this.subscribe("events",function(){var i,e=this.DOM,s=this;e.preview.on("touchstart",function(t){t.preventDefault();var i=e.card.hasClass("ui-Mexam-show");e.card[i?"removeClass":"addClass"]("ui-Mexam-show")}),e.card.on("touchstart",".ui-Mexam-buttom > a",function(i){i.preventDefault();var e=[];if(t.each(s.answer,function(t,i){e.push({id:s.config.data[t].id,answer:i})}),t.isFunction(s.config.send)){var n=s.config.send.apply(s,[e,s.time]);if(n===!1)return!1;s.destroy()}}),e.back.on("touchstart",function(t){t.preventDefault(),s.destroy()}),t(window).on(this.resize,function(){clearInterval(i),i=setTimeout(function(){s.publish("resize")},300)})}),this.subscribe("time",function(){var t=this,i=0,e=0,s=this.DOM.time.find("span"),n=function(){e++,60==e&&(e=0,i++),t.time=60*i+e,s.text(t.formatNumber(i)+":"+t.formatNumber(e))};setInterval(n,1e3)}),this.subscribe("resize",function(){this.next=!1,this.screen={width:window.innerWidth,height:window.innerHeight};var t=this.DOM,i=this.config.data.length>2?3:this.config.data.length,e=this.index*this.screen.width-this.screen.width,s=-(this.index*this.screen.width);0===this.index&&(e=0),this.index===i-1&&(e-=this.screen.width),this.setTransition(t.list[0],{transform:{duration:"0ms"}}),this.setTransform(t.list[0],{translate:{x:s,y:0}}),t.list.css({width:this.screen.width*i,left:e}).children().css({width:this.screen.width,height:this.screen.height}).children().removeAttr("style")}),this}},r.fn.init.prototype=r.fn,r});
\ No newline at end of file
diff --git a/js/zepto.min.js b/js/zepto.min.js
new file mode 100644
index 0000000..9e680a8
--- /dev/null
+++ b/js/zepto.min.js
@@ -0,0 +1,2 @@
+/* Zepto v1.1.6 - zepto event ajax form ie touch fx - zeptojs.com/license */
+var Zepto=function(){function t(t){return null==t?String(t):V[Y.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(e){return"object"==t(e)}function o(t){return r(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function a(t){return"number"==typeof t.length}function s(t){return O.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(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 l(t){return t in A?A[t]:A[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||D[c(t)]?e:e+"px"}function h(t){var e,n;return L[t]||(e=M.createElement(t),M.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),L[t]=n),L[t]}function p(t){return"children"in t?N.call(t.children):T.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function d(t,e,n){for(E in e)n&&(o(e[E])||G(e[E]))?(o(e[E])&&!o(t[E])&&(t[E]={}),G(e[E])&&!G(t[E])&&(t[E]=[]),d(t[E],e[E],n)):e[E]!==b&&(t[E]=e[E])}function m(t,e){return null==e?T(t):T(t).filter(e)}function g(t,n,i,r){return e(n)?n.call(t,i,r):n}function v(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function y(t,e){var n=t.className||"",i=n&&n.baseVal!==b;return e===b?i?n.baseVal:n:void(i?n.baseVal=e:t.className=e)}function x(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?T.parseJSON(t):t):t}catch(e){return t}}function w(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)w(t.childNodes[n],e)}var b,E,T,j,S,C,P=[],N=P.slice,O=P.filter,M=window.document,L={},A={},D={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},_=/^\s*<(\w+|!)[^>]*>/,Z=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,R=/^(?:body|html)$/i,k=/([A-Z])/g,z=["val","css","html","text","data","width","height","offset"],F=["after","prepend","before","append"],q=M.createElement("table"),H=M.createElement("tr"),U={tr:M.createElement("tbody"),tbody:q,thead:q,tfoot:q,td:H,th:H,"*":M.createElement("div")},X=/complete|loaded|interactive/,I=/^[\w-]*$/,V={},Y=V.toString,B={},J=M.createElement("div"),W={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},G=Array.isArray||function(t){return t instanceof Array};return B.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=J).appendChild(t),i=~B.qsa(r,e).indexOf(t),o&&J.removeChild(t),i},S=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},C=function(t){return O.call(t,function(e,n){return t.indexOf(e)==n})},B.fragment=function(t,e,n){var i,r,a;return Z.test(t)&&(i=T(M.createElement(RegExp.$1))),i||(t.replace&&(t=t.replace($,"<$1>$2>")),e===b&&(e=_.test(t)&&RegExp.$1),e in U||(e="*"),a=U[e],a.innerHTML=""+t,i=T.each(N.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(r=T(i),T.each(n,function(t,e){z.indexOf(t)>-1?r[t](e):r.attr(t,e)})),i},B.Z=function(t,e){return t=t||[],t.__proto__=T.fn,t.selector=e||"",t},B.isZ=function(t){return t instanceof B.Z},B.init=function(t,n){var i;if(!t)return B.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&_.test(t))i=B.fragment(t,RegExp.$1,n),t=null;else{if(n!==b)return T(n).find(t);i=B.qsa(M,t)}else{if(e(t))return T(M).ready(t);if(B.isZ(t))return t;if(G(t))i=s(t);else if(r(t))i=[t],t=null;else if(_.test(t))i=B.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==b)return T(n).find(t);i=B.qsa(M,t)}}return B.Z(i,t)},T=function(t,e){return B.init(t,e)},T.extend=function(t){var e,n=N.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},B.qsa=function(t,e){var n,r="#"==e[0],o=!r&&"."==e[0],a=r||o?e.slice(1):e,s=I.test(a);return i(t)&&s&&r?(n=t.getElementById(a))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:N.call(s&&!r?o?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=M.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},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=G,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.inArray=function(t,e,n){return P.indexOf.call(e,t,n)},T.camelCase=S,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.map=function(t,e){var n,i,r,o=[];if(a(t))for(i=0;i=0?t:t+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 P.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(O.call(this,function(e){return B.matches(e,t)}))},add:function(t,e){return T(C(this.concat(T(t,e))))},is:function(t){return this.length>0&&B.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==b)this.each(function(e){t.call(this,e)||n.push(this)});else{var i="string"==typeof t?this.filter(t):a(t)&&e(t.item)?N.call(t):T(t);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return r(t)?T.contains(this,t):T(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&&!r(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return P.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(B.qsa(this[0],t)):this.map(function(){return B.qsa(this,t)}):T()},closest:function(t,e){var n=this[0],r=!1;for("object"==typeof t&&(r=T(t));n&&!(r?r.indexOf(n)>=0:B.matches(n,t));)n=n!==e&&!i(n)&&n.parentNode;return T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){return(t=t.parentNode)&&!i(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return m(e,t)},parent:function(t){return m(C(this.pluck("parentNode")),t)},children:function(t){return m(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return N.call(this.childNodes)})},siblings:function(t){return m(this.map(function(t,e){return O.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.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=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var i=T(t).get(0),r=i.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var i=T(this),r=i.contents(),o=n?t.call(this,e):t;r.length?r.wrapAll(o):i.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===b?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(r(t))for(E in t)v(this,E,t[E]);else v(this,t,g(this,e,n,this.getAttribute(t)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:b},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){v(this,t)},this)})},prop:function(t,e){return t=W[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(k,"-$1").toLowerCase(),i=1 in arguments?this.attr(n,e):this.attr(n);return null!==i?x(i):b},val:function(t){return 0 in arguments?this.each(function(e){this.value=g(this,t,e,this.value)}):this[0]&&(this[0].multiple?T(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 n=T(this),i=g(this,t,e,n.offset()),r=n.offsetParent().offset(),o={top:i.top-r.top,left:i.left-r.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});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(e,n){if(arguments.length<2){var i,r=this[0];if(!r)return;if(i=getComputedStyle(r,""),"string"==typeof e)return r.style[S(e)]||i.getPropertyValue(e);if(G(e)){var o={};return T.each(e,function(t,e){o[e]=r.style[S(e)]||i.getPropertyValue(e)}),o}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(E in e)e[E]||0===e[E]?a+=c(E)+":"+f(E,e[E])+";":this.each(function(){this.style.removeProperty(c(E))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?P.some.call(this,function(t){return this.test(y(t))},l(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){j=[];var n=y(this),i=g(this,t,e,n);i.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||j.push(t)},this),j.length&&y(this,n+(n?" ":"")+j.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===b)return y(this,"");j=y(this),g(this,t,e,j).split(/\s+/g).forEach(function(t){j=j.replace(l(t)," ")}),y(this,j.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var i=T(this),r=g(this,t,n,y(this));r.split(/\s+/g).forEach(function(t){(e===b?!i.hasClass(t):e)?i.addClass(t):i.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===b?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===b?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=R.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,i.top+=parseFloat(T(e[0]).css("border-top-width"))||0,i.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||M.body;t&&!R.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(r){var o,a=this[0];return r===b?n(a)?a["inner"+e]:i(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,r,e,a[t]()))})}}),F.forEach(function(e,n){var i=n%2;T.fn[e]=function(){var e,r,o=T.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:B.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){r=i?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(M.documentElement,r);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!r)return T(t).remove();r.insertBefore(t,e),s&&w(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},T.fn[i?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),B.Z.prototype=T.fn,B.uniq=C,B.deserializeValue=x,T.zepto=B,T}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=i(n),n.ns)var s=r(n.ns);return(g[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!s.test(t.ns)||o&&e(t.fn)!==e(o)||a&&t.sel!=a)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function r(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return w[t]||y&&x[t]||t}function s(n,r,s,u,l,h,p){var d=e(n),m=g[d]||(g[d]=[]);r.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var r=i(e);r.fn=s,r.sel=l,r.e in w&&(s=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?r.fn.apply(this,arguments):void 0}),r.del=h;var d=h||s;r.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},r.i=m.length,m.push(r),"addEventListener"in n&&n.addEventListener(a(r.e),r.proxy,o(r,p))})}function u(t,i,r,s,u){var c=e(t);(i||"").split(/\s/).forEach(function(e){n(t,e,r,s).forEach(function(e){delete g[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return(n||!e.isDefaultPrevented)&&(n||(n=e),t.each(j,function(t,i){var r=n[t];e[t]=function(){return this[i]=b,r&&r.apply(n,arguments)},e[i]=E}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=b)),e}function l(t){var e,n={originalEvent:t};for(e in t)T.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},g={},v={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},w={mouseenter:"mouseover",mouseleave:"mouseout"};v.click=v.mousedown=v.mouseup=v.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,i){var r=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(i,r?r.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(i))return r?(r.unshift(n[i],n),t.proxy.apply(null,r)):t.proxy(n[i],n);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 b=function(){return!0},E=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$)/,j={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,n,i,r,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,i,e,o)}),h):(m(n)||d(r)||r===!1||(r=i,i=n,n=f),(d(i)||i===!1)&&(r=i,i=f),r===!1&&(r=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,r),r.apply(this,arguments)}),n&&(c=function(e){var i,o=t(e.target).closest(n,h).get(0);return o&&o!==h?(i=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||r).apply(o,[i].concat(p.call(arguments,1)))):void 0}),s(h,e,r,i,n,c||a)}))},t.fn.off=function(e,n,i){var r=this;return e&&!m(e)?(t.each(e,function(t,e){r.off(t,n,e)}),r):(m(n)||d(i)||i===!1||(i=n,n=f),i===!1&&(i=E),r.each(function(){u(this,e,i,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,i){var r,o;return this.each(function(a,s){r=l(m(e)?t.Event(e):e),r._args=i,r.target=s,t.each(n(s,e.type||e),function(t,e){return o=e.proxy(r),r.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout focus blur 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 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(v[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),c(n)}}(Zepto),function(t){function e(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function n(t,n,i,r){return t.global?e(n||y,i,r):void 0}function i(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function r(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var i=e.context;return e.beforeSend.call(i,t,e)===!1||n(e,i,"ajaxBeforeSend",[t,e])===!1?!1:void n(e,i,"ajaxSend",[t,e])}function a(t,e,i,r){var o=i.context,a="success";i.success.call(o,t,a,e),r&&r.resolveWith(o,[t,a,e]),n(i,o,"ajaxSuccess",[e,i,t]),u(a,e,i)}function s(t,e,i,r,o){var a=r.context;r.error.call(a,i,e,t),o&&o.rejectWith(a,[i,e,t]),n(r,a,"ajaxError",[i,r,t||e]),u(e,i,r)}function u(t,e,i){var o=i.context;i.complete.call(o,e,t),n(i,o,"ajaxComplete",[e,i]),r(i)}function c(){}function l(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==E?"json":w.test(t)?"script":b.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function h(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=f(e.url,e.data),e.data=void 0)}function p(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 d(e,n,i,r){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(s||"object"==o||"array"==o?n:"")+"]"),!r&&a?e.add(u.name,u.value):"array"==o||!i&&"object"==o?d(e,u,i,n):e.add(n,u)})}var m,g,v=0,y=window.document,x=/