mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-07 06:51:43 +00:00
add meitu
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>meitu</name>
|
||||||
|
<comment>Create By HBuilder</comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.aptana.ide.core.unifiedBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.aptana.projects.webnature</nature>
|
||||||
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1438740721445</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.orFilterMatcher</id>
|
||||||
|
<arguments>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-projectRelativePath-matches-false-false-bin</arguments>
|
||||||
|
</matcher>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-projectRelativePath-matches-false-false-setting</arguments>
|
||||||
|
</matcher>
|
||||||
|
</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
|
</projectDescription>
|
||||||
Vendored
+2025
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,200 @@
|
|||||||
|
html body {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: "times new roman", "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
||||||
|
}
|
||||||
|
/*-----------媒体查询---------------------*/
|
||||||
|
|
||||||
|
@media screen and (min-width: 480px) and (max-width: 639px) {
|
||||||
|
html {
|
||||||
|
font-size: 15px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 640px) and (max-width: 719px) {
|
||||||
|
html {
|
||||||
|
font-size: 20px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 720px) and (max-width: 749px) {
|
||||||
|
html {
|
||||||
|
font-size: 22.5px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 750px) and (max-width: 799px) {
|
||||||
|
html {
|
||||||
|
font-size: 23.5px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 800px) and (max-width: 959px) {
|
||||||
|
html {
|
||||||
|
font-size: 25px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 960px) and (max-width: 1079px) {
|
||||||
|
html {
|
||||||
|
font-size: 30px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 1080px) {
|
||||||
|
html {
|
||||||
|
font-size: 32px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.fl {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.fr {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.sh {
|
||||||
|
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .2), 0 2px 6px 0 rgba(0, 0, 0, .19);
|
||||||
|
-webkit-box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .2), 0 2px 6px 0 rgba(0, 0, 0, .19);
|
||||||
|
}
|
||||||
|
/*------------------------搜索---------------------------*/
|
||||||
|
|
||||||
|
.search {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .2), 0 2px 6px 0 rgba(0, 0, 0, .19);
|
||||||
|
-webkit-box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .2), 0 2px 6px 0 rgba(0, 0, 0, .19);
|
||||||
|
}
|
||||||
|
.search img {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
.search_input {
|
||||||
|
position: absolute;
|
||||||
|
left: 40px;
|
||||||
|
right: 8px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.search_input input {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
outline: none;
|
||||||
|
padding-left: 5px;
|
||||||
|
-webkit-tap-highlight-color: #FFFFFF;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
font-size: 16px;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
margin-top: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.search_btn {
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 0 3px 3px 0;
|
||||||
|
background-color: #0091ff;
|
||||||
|
border: 0;
|
||||||
|
top: 4px;
|
||||||
|
width: 50px;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
/*--------------------工具集-----------------------*/
|
||||||
|
|
||||||
|
.tools {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 60px;
|
||||||
|
width: 50px;
|
||||||
|
min-height: 100px;
|
||||||
|
}
|
||||||
|
.tools>div {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border: 1px solid #CCCAC9;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #676768;
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tools_items>div:first-child {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
.tools_items>div:last-child {
|
||||||
|
margin-top: -4px;
|
||||||
|
}
|
||||||
|
.tools_items i {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
/*--------------------仪表盘---------------------------*/
|
||||||
|
|
||||||
|
.e_charts {
|
||||||
|
position: absolute;
|
||||||
|
left: 10px;
|
||||||
|
top: 60px;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 25px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.e_charts>div {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 5px;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 15px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #999999;
|
||||||
|
}
|
||||||
|
.e_charts_arrow {
|
||||||
|
width: 2px;
|
||||||
|
height: 16px;
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
background-color:#0091FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.e_charts_0{
|
||||||
|
position:relative;
|
||||||
|
left:-10px;
|
||||||
|
top:-11px;
|
||||||
|
color:#E60079;
|
||||||
|
width: 18px;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.e_charts_120{
|
||||||
|
position:relative;
|
||||||
|
right:-18px;
|
||||||
|
top:-24px;
|
||||||
|
color:#E60079;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
width: 22px;
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="width:100%;height:100%;">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="format-detection" content="telephone=no" searchtype="map">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,minimal-ui">
|
||||||
|
<meta name="misapplication-tap-highlight" content="no"/>
|
||||||
|
<title>美途</title>
|
||||||
|
<link type="text/css" rel="stylesheet" href="css/main.css"/>
|
||||||
|
<link type="text/css" rel="stylesheet" href="css/font-awesome.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--描述:地图模块-->
|
||||||
|
<div id="map"></div>
|
||||||
|
<!--描述:搜索-->
|
||||||
|
<div class="search">
|
||||||
|
<div class="fl">
|
||||||
|
<img src="img/logo.png"/>
|
||||||
|
</div>
|
||||||
|
<div class="fl search_input">
|
||||||
|
<input placeholder="请输入产品路线"/>
|
||||||
|
</div>
|
||||||
|
<button class="fl search_btn">
|
||||||
|
<i class="fa fa-search" style="font-size:20px;color:#FFFFFF;"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!--描述:其他功能-->
|
||||||
|
<div class="tools">
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div style="width:30px;height:30px;">
|
||||||
|
<i class="fa fa-windows" style="color:#999999;margin-top:13px;font-size:20px;"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div>
|
||||||
|
<i class="fa fa-weixin" style="color:#999999;"></i>
|
||||||
|
</div>
|
||||||
|
<div>吐槽</div>
|
||||||
|
</div>
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div>
|
||||||
|
<i class="fa fa-hand-paper-o" style="color:#999999;"></i>
|
||||||
|
</div>
|
||||||
|
<div>活动</div>
|
||||||
|
</div>
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div>
|
||||||
|
<i class="fa fa-microphone" style="color:#999999;"></i>
|
||||||
|
</div>
|
||||||
|
<div>上报</div>
|
||||||
|
</div>
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div>
|
||||||
|
<i class="fa fa-share-alt" style="color:#999999;"></i>
|
||||||
|
</div>
|
||||||
|
<div>分享</div>
|
||||||
|
</div>
|
||||||
|
<div class="sh tools_items">
|
||||||
|
<div>
|
||||||
|
<i class="fa fa-refresh" style="color:#999999;"></i>
|
||||||
|
</div>
|
||||||
|
<div>刷新</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="charts" class="e_charts sh">
|
||||||
|
<div>
|
||||||
|
<div class="e_charts_arrow"></div>
|
||||||
|
<div class="e_charts_0">0</div>
|
||||||
|
<div class="e_charts_120">120</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=6a1180467b5f36714645d22044535ab7"></script>
|
||||||
|
<script type="text/javascript" data-main="js/main" src="js/lib/require.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,628 @@
|
|||||||
|
;(function(){
|
||||||
|
//① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩
|
||||||
|
var S = {
|
||||||
|
init: function () {
|
||||||
|
var _body = document.createElement("div");
|
||||||
|
_body.setAttribute("id","_body")
|
||||||
|
_body.style.zIndex=9999;
|
||||||
|
_body.style.background="#80d0cd";
|
||||||
|
_body.style.position="absolute";
|
||||||
|
_body.style.top="0px";
|
||||||
|
_body.style.right="0px";
|
||||||
|
_body.style.left="0px";
|
||||||
|
_body.style.bottom="0px";
|
||||||
|
_body.style.margin="0px";
|
||||||
|
_body.style.padding="0px";
|
||||||
|
_body.innerHTML ='<canvas class="canvas"></canvas>'
|
||||||
|
document.body.appendChild(_body);
|
||||||
|
setTimeout(function(){
|
||||||
|
var msg = '|美|丽|旅|途|'
|
||||||
|
S.Drawing.init('.canvas');
|
||||||
|
//document.body.classList.add('body--ready');
|
||||||
|
S.UI.simulate(msg);
|
||||||
|
S.Drawing.loop(function () {
|
||||||
|
S.Shape.render();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
S.Drawing = (function () {
|
||||||
|
var canvas,
|
||||||
|
context,
|
||||||
|
renderFn
|
||||||
|
requestFrame = window.requestAnimationFrame ||
|
||||||
|
window.webkitRequestAnimationFrame ||
|
||||||
|
window.mozRequestAnimationFrame ||
|
||||||
|
window.oRequestAnimationFrame ||
|
||||||
|
window.msRequestAnimationFrame ||
|
||||||
|
function(callback) {
|
||||||
|
window.setTimeout(callback, 1000 / 60);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: function (el) {
|
||||||
|
canvas = document.querySelector('.canvas'),
|
||||||
|
context = canvas.getContext('2d');
|
||||||
|
this.adjustCanvas();
|
||||||
|
|
||||||
|
window.addEventListener('resize', function (e) {
|
||||||
|
S.Drawing.adjustCanvas();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
loop: function (fn) {
|
||||||
|
renderFn = !renderFn ? fn : renderFn;
|
||||||
|
this.clearFrame();
|
||||||
|
renderFn();
|
||||||
|
requestFrame.call(window, this.loop.bind(this));
|
||||||
|
},
|
||||||
|
|
||||||
|
adjustCanvas: function () {
|
||||||
|
canvas.width = window.innerWidth;
|
||||||
|
canvas.height = window.innerHeight;
|
||||||
|
},
|
||||||
|
|
||||||
|
clearFrame: function () {
|
||||||
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
},
|
||||||
|
|
||||||
|
getArea: function () {
|
||||||
|
return { w: canvas.width, h: canvas.height };
|
||||||
|
},
|
||||||
|
|
||||||
|
drawCircle: function (p, c) {
|
||||||
|
context.fillStyle = c.render();
|
||||||
|
context.beginPath();
|
||||||
|
context.arc(p.x, p.y, p.z, 0, 2 * Math.PI, true);
|
||||||
|
context.closePath();
|
||||||
|
context.fill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
S.UI = (function () {
|
||||||
|
var canvas = document.querySelector('.canvas'),
|
||||||
|
interval,
|
||||||
|
isTouch = false, //('ontouchstart' in window || navigator.msMaxTouchPoints),
|
||||||
|
currentAction,
|
||||||
|
resizeTimer,
|
||||||
|
time,
|
||||||
|
maxShapeSize = 30,
|
||||||
|
firstAction = true,
|
||||||
|
sequence = [],
|
||||||
|
cmd = '#';
|
||||||
|
|
||||||
|
function formatTime(date) {
|
||||||
|
var h = date.getHours(),
|
||||||
|
m = date.getMinutes(),
|
||||||
|
m = m < 10 ? '0' + m : m;
|
||||||
|
return h + ':' + m;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getValue(value) {
|
||||||
|
return value && value.split(' ')[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAction(value) {
|
||||||
|
value = value && value.split(' ')[0];
|
||||||
|
return value && value[0] === cmd && value.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function timedAction(fn, delay, max, reverse) {
|
||||||
|
clearInterval(interval);
|
||||||
|
currentAction = reverse ? max : 1;
|
||||||
|
fn(currentAction);
|
||||||
|
|
||||||
|
if (!max || (!reverse && currentAction < max) || (reverse && currentAction > 0)) {
|
||||||
|
interval = setInterval(function () {
|
||||||
|
currentAction = reverse ? currentAction - 1 : currentAction + 1;
|
||||||
|
fn(currentAction);
|
||||||
|
|
||||||
|
if ((!reverse && max && currentAction === max) || (reverse && currentAction === 0)) {
|
||||||
|
clearInterval(interval);
|
||||||
|
document.querySelector('#_body').style.display="none";
|
||||||
|
}
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset(destroy) {
|
||||||
|
clearInterval(interval);
|
||||||
|
sequence = [];
|
||||||
|
time = null;
|
||||||
|
destroy && S.Shape.switchShape(S.ShapeBuilder.letter(''));
|
||||||
|
}
|
||||||
|
|
||||||
|
function performAction(value) {
|
||||||
|
var action,
|
||||||
|
value,
|
||||||
|
current;
|
||||||
|
sequence = typeof(value) === 'object' ? value : sequence.concat(value.split('|'));
|
||||||
|
timedAction(function (index) {
|
||||||
|
current = sequence.shift();
|
||||||
|
action = getAction(current);
|
||||||
|
value = getValue(current);
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case 'countdown':
|
||||||
|
value = parseInt(value) || 10;
|
||||||
|
value = value > 0 ? value : 10;
|
||||||
|
|
||||||
|
timedAction(function (index) {
|
||||||
|
if (index === 0) {
|
||||||
|
if (sequence.length === 0) {
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.letter(''));
|
||||||
|
} else {
|
||||||
|
performAction(sequence);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.letter(index), true);
|
||||||
|
}
|
||||||
|
}, 1000, value, true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'rectangle':
|
||||||
|
value = value && value.split('x');
|
||||||
|
value = (value && value.length === 2) ? value : [maxShapeSize, maxShapeSize / 2];
|
||||||
|
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.rectangle(Math.min(maxShapeSize, parseInt(value[0])), Math.min(maxShapeSize, parseInt(value[1]))));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'circle':
|
||||||
|
value = parseInt(value) || maxShapeSize;
|
||||||
|
value = Math.min(value, maxShapeSize);
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.circle(value));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'time':
|
||||||
|
var t = formatTime(new Date());
|
||||||
|
|
||||||
|
if (sequence.length > 0) {
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.letter(t));
|
||||||
|
} else {
|
||||||
|
timedAction(function () {
|
||||||
|
t = formatTime(new Date());
|
||||||
|
if (t !== time) {
|
||||||
|
time = t;
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.letter(time));
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
S.Shape.switchShape(S.ShapeBuilder.letter(current[0] === cmd ? 'What?' : current));
|
||||||
|
}
|
||||||
|
}, 1500, sequence.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
simulate: function (action) {
|
||||||
|
performAction(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
S.UI.Tabs = (function () {
|
||||||
|
var tabs = document.querySelector('.tabs'),
|
||||||
|
labels = document.querySelector('.tabs-labels'),
|
||||||
|
triggers = document.querySelectorAll('.tabs-label'),
|
||||||
|
panels = document.querySelectorAll('.tabs-panel');
|
||||||
|
|
||||||
|
function activate(i) {
|
||||||
|
triggers[i].classList.add('tabs-label--active');
|
||||||
|
panels[i].classList.add('tabs-panel--active');
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindEvents() {
|
||||||
|
labels.addEventListener('click', function (e) {
|
||||||
|
var el = e.target,
|
||||||
|
index;
|
||||||
|
|
||||||
|
if (el.classList.contains('tabs-label')) {
|
||||||
|
for (var t = 0; t < triggers.length; t++) {
|
||||||
|
triggers[t].classList.remove('tabs-label--active');
|
||||||
|
panels[t].classList.remove('tabs-panel--active');
|
||||||
|
|
||||||
|
if (el === triggers[t]) {
|
||||||
|
index = t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
activate(index);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
activate(0);
|
||||||
|
bindEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Init
|
||||||
|
//init();
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
S.Point = function (args) {
|
||||||
|
this.x = args.x;
|
||||||
|
this.y = args.y;
|
||||||
|
this.z = args.z;
|
||||||
|
this.a = args.a;
|
||||||
|
this.h = args.h;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
S.Color = function (r, g, b, a) {
|
||||||
|
this.r = r;
|
||||||
|
this.g = g;
|
||||||
|
this.b = b;
|
||||||
|
this.a = a;
|
||||||
|
};
|
||||||
|
|
||||||
|
S.Color.prototype = {
|
||||||
|
render: function () {
|
||||||
|
return 'rgba(' + this.r + ',' + + this.g + ',' + this.b + ',' + this.a + ')';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
S.Dot = function (x, y) {
|
||||||
|
this.p = new S.Point({
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
z: 5,
|
||||||
|
a: 1,
|
||||||
|
h: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
this.e = 0.07;
|
||||||
|
this.s = true;
|
||||||
|
|
||||||
|
this.c = new S.Color(255, 255, 255, this.p.a);
|
||||||
|
|
||||||
|
this.t = this.clone();
|
||||||
|
this.q = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
S.Dot.prototype = {
|
||||||
|
clone: function () {
|
||||||
|
return new S.Point({
|
||||||
|
x: this.x,
|
||||||
|
y: this.y,
|
||||||
|
z: this.z,
|
||||||
|
a: this.a,
|
||||||
|
h: this.h
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_draw: function () {
|
||||||
|
this.c.a = this.p.a;
|
||||||
|
S.Drawing.drawCircle(this.p, this.c);
|
||||||
|
},
|
||||||
|
|
||||||
|
_moveTowards: function (n) {
|
||||||
|
var details = this.distanceTo(n, true),
|
||||||
|
dx = details[0],
|
||||||
|
dy = details[1],
|
||||||
|
d = details[2],
|
||||||
|
e = this.e * d;
|
||||||
|
|
||||||
|
if (this.p.h === -1) {
|
||||||
|
this.p.x = n.x;
|
||||||
|
this.p.y = n.y;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d > 1) {
|
||||||
|
this.p.x -= ((dx / d) * e);
|
||||||
|
this.p.y -= ((dy / d) * e);
|
||||||
|
} else {
|
||||||
|
if (this.p.h > 0) {
|
||||||
|
this.p.h--;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
_update: function () {
|
||||||
|
if (this._moveTowards(this.t)) {
|
||||||
|
var p = this.q.shift();
|
||||||
|
|
||||||
|
if (p) {
|
||||||
|
this.t.x = p.x || this.p.x;
|
||||||
|
this.t.y = p.y || this.p.y;
|
||||||
|
this.t.z = p.z || this.p.z;
|
||||||
|
this.t.a = p.a || this.p.a;
|
||||||
|
this.p.h = p.h || 0;
|
||||||
|
} else {
|
||||||
|
if (this.s) {
|
||||||
|
this.p.x -= Math.sin(Math.random() * 3.142);
|
||||||
|
this.p.y -= Math.sin(Math.random() * 3.142);
|
||||||
|
} else {
|
||||||
|
this.move(new S.Point({
|
||||||
|
x: this.p.x + (Math.random() * 50) - 25,
|
||||||
|
y: this.p.y + (Math.random() * 50) - 25,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
d = this.p.a - this.t.a;
|
||||||
|
this.p.a = Math.max(0.1, this.p.a - (d * 0.05));
|
||||||
|
d = this.p.z - this.t.z;
|
||||||
|
this.p.z = Math.max(1, this.p.z - (d * 0.05));
|
||||||
|
},
|
||||||
|
|
||||||
|
distanceTo: function (n, details) {
|
||||||
|
var dx = this.p.x - n.x,
|
||||||
|
dy = this.p.y - n.y,
|
||||||
|
d = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
|
||||||
|
return details ? [dx, dy, d] : d;
|
||||||
|
},
|
||||||
|
|
||||||
|
move: function (p, avoidStatic) {
|
||||||
|
if (!avoidStatic || (avoidStatic && this.distanceTo(p) > 1)) {
|
||||||
|
this.q.push(p);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
this._update();
|
||||||
|
this._draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
S.ShapeBuilder = (function () {
|
||||||
|
var gap = 13,
|
||||||
|
shapeCanvas = document.createElement('canvas'),
|
||||||
|
shapeContext = shapeCanvas.getContext('2d'),
|
||||||
|
fontSize = 500,
|
||||||
|
fontFamily = 'Avenir, Helvetica Neue, Helvetica, Arial, sans-serif';
|
||||||
|
|
||||||
|
function fit() {
|
||||||
|
shapeCanvas.width = Math.floor(window.innerWidth / gap) * gap;
|
||||||
|
shapeCanvas.height = Math.floor(window.innerHeight / gap) * gap;
|
||||||
|
shapeContext.fillStyle = 'red';
|
||||||
|
shapeContext.textBaseline = 'middle';
|
||||||
|
shapeContext.textAlign = 'center';
|
||||||
|
}
|
||||||
|
|
||||||
|
function processCanvas() {
|
||||||
|
var pixels = shapeContext.getImageData(0, 0, shapeCanvas.width, shapeCanvas.height).data;
|
||||||
|
dots = [],
|
||||||
|
pixels,
|
||||||
|
x = 0,
|
||||||
|
y = 0,
|
||||||
|
fx = shapeCanvas.width,
|
||||||
|
fy = shapeCanvas.height,
|
||||||
|
w = 0,
|
||||||
|
h = 0;
|
||||||
|
|
||||||
|
for (var p = 0; p < pixels.length; p += (4 * gap)) {
|
||||||
|
if (pixels[p + 3] > 0) {
|
||||||
|
dots.push(new S.Point({
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
}));
|
||||||
|
|
||||||
|
w = x > w ? x : w;
|
||||||
|
h = y > h ? y : h;
|
||||||
|
fx = x < fx ? x : fx;
|
||||||
|
fy = y < fy ? y : fy;
|
||||||
|
}
|
||||||
|
|
||||||
|
x += gap;
|
||||||
|
|
||||||
|
if (x >= shapeCanvas.width) {
|
||||||
|
x = 0;
|
||||||
|
y += gap;
|
||||||
|
p += gap * 4 * shapeCanvas.width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { dots: dots, w: w + fx, h: h + fy };
|
||||||
|
}
|
||||||
|
|
||||||
|
function setFontSize(s) {
|
||||||
|
shapeContext.font = 'bold ' + s + 'px ' + fontFamily;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isNumber(n) {
|
||||||
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
fit();
|
||||||
|
window.addEventListener('resize', fit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Init
|
||||||
|
init();
|
||||||
|
|
||||||
|
return {
|
||||||
|
imageFile: function (url, callback) {
|
||||||
|
var image = new Image(),
|
||||||
|
a = S.Drawing.getArea();
|
||||||
|
|
||||||
|
image.onload = function () {
|
||||||
|
shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
|
||||||
|
shapeContext.drawImage(this, 0, 0, a.h * 0.6, a.h * 0.6);
|
||||||
|
callback(processCanvas());
|
||||||
|
};
|
||||||
|
|
||||||
|
image.onerror = function () {
|
||||||
|
callback(S.ShapeBuilder.letter('What?'));
|
||||||
|
}
|
||||||
|
|
||||||
|
image.src = url;
|
||||||
|
},
|
||||||
|
|
||||||
|
circle: function (d) {
|
||||||
|
var r = Math.max(0, d) / 2;
|
||||||
|
shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
|
||||||
|
shapeContext.beginPath();
|
||||||
|
shapeContext.arc(r * gap, r * gap, r * gap, 0, 2 * Math.PI, false);
|
||||||
|
shapeContext.fill();
|
||||||
|
shapeContext.closePath();
|
||||||
|
|
||||||
|
return processCanvas();
|
||||||
|
},
|
||||||
|
|
||||||
|
letter: function (l) {
|
||||||
|
var s = 0;
|
||||||
|
|
||||||
|
setFontSize(fontSize);
|
||||||
|
s = Math.min(fontSize,
|
||||||
|
(shapeCanvas.width / shapeContext.measureText(l).width) * 0.8 * fontSize,
|
||||||
|
(shapeCanvas.height / fontSize) * (isNumber(l) ? 1 : 0.45) * fontSize);
|
||||||
|
setFontSize(s);
|
||||||
|
|
||||||
|
shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
|
||||||
|
shapeContext.fillText(l, shapeCanvas.width / 2, shapeCanvas.height / 2);
|
||||||
|
|
||||||
|
return processCanvas();
|
||||||
|
},
|
||||||
|
|
||||||
|
rectangle: function (w, h) {
|
||||||
|
var dots = [],
|
||||||
|
width = gap * w,
|
||||||
|
height = gap * h;
|
||||||
|
|
||||||
|
for (var y = 0; y < height; y += gap) {
|
||||||
|
for (var x = 0; x < width; x += gap) {
|
||||||
|
dots.push(new S.Point({
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { dots: dots, w: width, h: height };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
S.Shape = (function () {
|
||||||
|
var dots = [],
|
||||||
|
width = 0,
|
||||||
|
height = 0,
|
||||||
|
cx = 0,
|
||||||
|
cy = 0;
|
||||||
|
|
||||||
|
function compensate() {
|
||||||
|
var a = S.Drawing.getArea();
|
||||||
|
|
||||||
|
cx = a.w / 2 - width / 2;
|
||||||
|
cy = a.h / 2 - height / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
shuffleIdle: function () {
|
||||||
|
var a = S.Drawing.getArea();
|
||||||
|
|
||||||
|
for (var d = 0; d < dots.length; d++) {
|
||||||
|
if (!dots[d].s) {
|
||||||
|
dots[d].move({
|
||||||
|
x: Math.random() * a.w,
|
||||||
|
y: Math.random() * a.h
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
switchShape: function (n, fast) {
|
||||||
|
var size,
|
||||||
|
a = S.Drawing.getArea();
|
||||||
|
|
||||||
|
width = n.w;
|
||||||
|
height = n.h;
|
||||||
|
|
||||||
|
compensate();
|
||||||
|
|
||||||
|
if (n.dots.length > dots.length) {
|
||||||
|
size = n.dots.length - dots.length;
|
||||||
|
for (var d = 1; d <= size; d++) {
|
||||||
|
dots.push(new S.Dot(a.w / 2, a.h / 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var d = 0,
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while (n.dots.length > 0) {
|
||||||
|
i = Math.floor(Math.random() * n.dots.length);
|
||||||
|
dots[d].e = fast ? 0.25 : (dots[d].s ? 0.14 : 0.11);
|
||||||
|
|
||||||
|
if (dots[d].s) {
|
||||||
|
dots[d].move(new S.Point({
|
||||||
|
z: Math.random() * 20 + 10,
|
||||||
|
a: Math.random(),
|
||||||
|
h: 18
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
dots[d].move(new S.Point({
|
||||||
|
z: Math.random() * 5 + 5,
|
||||||
|
h: fast ? 18 : 30
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
dots[d].s = true;
|
||||||
|
dots[d].move(new S.Point({
|
||||||
|
x: n.dots[i].x + cx,
|
||||||
|
y: n.dots[i].y + cy,
|
||||||
|
a: 1,
|
||||||
|
z: 5,
|
||||||
|
h: 0
|
||||||
|
}));
|
||||||
|
|
||||||
|
n.dots = n.dots.slice(0, i).concat(n.dots.slice(i + 1));
|
||||||
|
d++;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = d; i < dots.length; i++) {
|
||||||
|
if (dots[i].s) {
|
||||||
|
dots[i].move(new S.Point({
|
||||||
|
z: Math.random() * 20 + 10,
|
||||||
|
a: Math.random(),
|
||||||
|
h: 20
|
||||||
|
}));
|
||||||
|
|
||||||
|
dots[i].s = false;
|
||||||
|
dots[i].e = 0.04;
|
||||||
|
dots[i].move(new S.Point({
|
||||||
|
x: Math.random() * a.w,
|
||||||
|
y: Math.random() * a.h,
|
||||||
|
a: 0.3, //.4
|
||||||
|
z: Math.random() * 4,
|
||||||
|
h: 0
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
for (var d = 0; d < dots.length; d++) {
|
||||||
|
dots[d].render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
S.init();
|
||||||
|
|
||||||
|
})();
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
define('common/data', function() {
|
||||||
|
var data = {};
|
||||||
|
//路线
|
||||||
|
data.router = [];
|
||||||
|
data.router.push([{
|
||||||
|
x: 121.352921,
|
||||||
|
y: 31.252139,
|
||||||
|
content: '上海',
|
||||||
|
startTime: '8:00'
|
||||||
|
}, {
|
||||||
|
x: 120.986375,
|
||||||
|
y: 31.335728,
|
||||||
|
content: '昆山'
|
||||||
|
}, {
|
||||||
|
x: 120.594682,
|
||||||
|
y: 31.34791,
|
||||||
|
content: '苏州'
|
||||||
|
}, {
|
||||||
|
x: 120.333252,
|
||||||
|
y: 31.632337,
|
||||||
|
content: '无锡'
|
||||||
|
}, {
|
||||||
|
x: 119.946671,
|
||||||
|
y: 31.853648,
|
||||||
|
content: '常州'
|
||||||
|
}, {
|
||||||
|
x: 119.53331,
|
||||||
|
y: 32.044169,
|
||||||
|
content: '丹阳'
|
||||||
|
}, {
|
||||||
|
x: 119.373322,
|
||||||
|
y: 32.198276,
|
||||||
|
content: '镇江'
|
||||||
|
}, {
|
||||||
|
x: 119.4104,
|
||||||
|
y: 32.393298,
|
||||||
|
content: '扬州'
|
||||||
|
}]);
|
||||||
|
|
||||||
|
window.routes2 = [{
|
||||||
|
x: 121.406822,
|
||||||
|
y: 31.28794,
|
||||||
|
content: '上海',
|
||||||
|
startTime: '9:00'
|
||||||
|
}, {
|
||||||
|
x: 120.651855,
|
||||||
|
y: 31.333698,
|
||||||
|
content: '苏州'
|
||||||
|
}, {
|
||||||
|
x: 120.344238,
|
||||||
|
y: 31.619474,
|
||||||
|
content: '无锡'
|
||||||
|
}, {
|
||||||
|
x: 119.932251,
|
||||||
|
y: 31.858897,
|
||||||
|
content: '常州'
|
||||||
|
}];
|
||||||
|
|
||||||
|
data.router.push([{
|
||||||
|
x: 121.433945,
|
||||||
|
y: 31.16816,
|
||||||
|
content: '上海',
|
||||||
|
startTime: '6:00'
|
||||||
|
}, {
|
||||||
|
x: 120.772705,
|
||||||
|
y: 30.674534,
|
||||||
|
content: '嘉兴'
|
||||||
|
}, {
|
||||||
|
x: 120.260468,
|
||||||
|
y: 30.353916,
|
||||||
|
content: '杭州'
|
||||||
|
}, {
|
||||||
|
x: 119.687805,
|
||||||
|
y: 29.150962,
|
||||||
|
content: '金华'
|
||||||
|
}, {
|
||||||
|
x: 118.834991,
|
||||||
|
y: 28.984718,
|
||||||
|
content: '衢州'
|
||||||
|
}]);
|
||||||
|
|
||||||
|
//链接
|
||||||
|
data.urls = [
|
||||||
|
'http://m.ctrip.com/webapp/you/appshare/bargain/18484.html?from=http%3A%2F%2Fm.ctrip.com%2Fwebapp%2Fyou%2Fplace%2F12.html',
|
||||||
|
'http://m.ctrip.com/webapp/you/sight/zhenjiang13.html?from=http%3A%2F%2Fm.ctrip.com%2Fwebapp%2Fyou%2Fplace%2F13.html',
|
||||||
|
'http://m.ctrip.com/webapp/hotel/hoteldetail/485097.html?days=1&atime=20150801&contrl=2&num=1&biz=1',
|
||||||
|
'http://m.ctrip.com/webapp/hotel/hoteldetail/436337.html?days=1&atime=20150801&contrl=2&num=1&biz=1',
|
||||||
|
'http://m.douban.com/note/510096555/?refer=home',
|
||||||
|
];
|
||||||
|
|
||||||
|
//图片数据
|
||||||
|
data.pics = [
|
||||||
|
'img/city.jpg',
|
||||||
|
'img/2.jpg',
|
||||||
|
'img/3.jpeg',
|
||||||
|
'img/4.jpg',
|
||||||
|
'img/5.jpeg'
|
||||||
|
];
|
||||||
|
|
||||||
|
return data;
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
define('home/dashboard', function(require, exports, module) {
|
||||||
|
|
||||||
|
var mapInstance = require('home/map');
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
/*地图相关的基础数据*/
|
||||||
|
define('home/map', function(require, exports, module){
|
||||||
|
|
||||||
|
//获取路线数据
|
||||||
|
var router = require('common/data').router;
|
||||||
|
|
||||||
|
//初始化地图
|
||||||
|
var map = new AMap.Map('map', {
|
||||||
|
mapStyle: 'fresh',
|
||||||
|
resizeEnable: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
//途经点
|
||||||
|
var wayPoints = [];
|
||||||
|
//起点
|
||||||
|
var origin = null;
|
||||||
|
//终点
|
||||||
|
var destination = null;
|
||||||
|
//默认路线
|
||||||
|
var routes = router[0];
|
||||||
|
|
||||||
|
//
|
||||||
|
var hasRoutes = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
var contents = [];
|
||||||
|
|
||||||
|
return {
|
||||||
|
map: map,
|
||||||
|
wayPointer: wayPoints,
|
||||||
|
origin: origin,
|
||||||
|
destination: destination,
|
||||||
|
routes: routes,
|
||||||
|
hasRoutes: hasRoutes,
|
||||||
|
contents: contents
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
define('home/tools', function(require, exports, module){
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,387 @@
|
|||||||
|
define('lib/LAB', function() {
|
||||||
|
var o = window;
|
||||||
|
var K = o.$LAB,
|
||||||
|
y = "UseLocalXHR",
|
||||||
|
z = "AlwaysPreserveOrder",
|
||||||
|
u = "AllowDuplicates",
|
||||||
|
A = "CacheBust",
|
||||||
|
B = "BasePath",
|
||||||
|
C = /^[^?#]*\//.exec(location.href)[0],
|
||||||
|
D = /^\w+\:\/\/\/?[^\/]+/.exec(C)[0],
|
||||||
|
i = document.head || document.getElementsByTagName("head"),
|
||||||
|
L = (o.opera && Object.prototype.toString.call(o.opera) == "[object Opera]") || ("MozAppearance" in document.documentElement.style),
|
||||||
|
q = document.createElement("script"),
|
||||||
|
E = typeof q.preload == "boolean",
|
||||||
|
r = E || (q.readyState && q.readyState == "uninitialized"),
|
||||||
|
F = !r && q.async === true,
|
||||||
|
M = !r && !F && !L;
|
||||||
|
|
||||||
|
function G(a) {
|
||||||
|
return Object.prototype.toString.call(a) == "[object Function]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function H(a) {
|
||||||
|
return Object.prototype.toString.call(a) == "[object Array]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function N(a, c) {
|
||||||
|
var b = /^\w+\:\/\//;
|
||||||
|
if (/^\/\/\/?/.test(a)) {
|
||||||
|
a = location.protocol + a
|
||||||
|
} else if (!b.test(a) && a.charAt(0) != "/") {
|
||||||
|
a = (c || "") + a
|
||||||
|
}
|
||||||
|
return b.test(a) ? a : ((a.charAt(0) == "/" ? D : C) + a)
|
||||||
|
}
|
||||||
|
|
||||||
|
function s(a, c) {
|
||||||
|
for (var b in a) {
|
||||||
|
if (a.hasOwnProperty(b)) {
|
||||||
|
c[b] = a[b]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
function O(a) {
|
||||||
|
var c = false;
|
||||||
|
for (var b = 0; b < a.scripts.length; b++) {
|
||||||
|
if (a.scripts[b].ready && a.scripts[b].exec_trigger) {
|
||||||
|
c = true;
|
||||||
|
a.scripts[b].exec_trigger();
|
||||||
|
a.scripts[b].exec_trigger = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
function t(a, c, b, d) {
|
||||||
|
a.onload = a.onreadystatechange = function() {
|
||||||
|
if ((a.readyState && a.readyState != "complete" && a.readyState != "loaded") || c[b]) return;
|
||||||
|
a.onload = a.onreadystatechange = null;
|
||||||
|
d()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function I(a) {
|
||||||
|
a.ready = a.finished = true;
|
||||||
|
for (var c = 0; c < a.finished_listeners.length; c++) {
|
||||||
|
a.finished_listeners[c]()
|
||||||
|
}
|
||||||
|
a.ready_listeners = [];
|
||||||
|
a.finished_listeners = []
|
||||||
|
}
|
||||||
|
|
||||||
|
function P(d, f, e, g, h) {
|
||||||
|
setTimeout(function() {
|
||||||
|
var a, c = f.real_src,
|
||||||
|
b;
|
||||||
|
if ("item" in i) {
|
||||||
|
if (!i[0]) {
|
||||||
|
setTimeout(arguments.callee, 25);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
i = i[0]
|
||||||
|
}
|
||||||
|
a = document.createElement("script");
|
||||||
|
if (f.type) a.type = f.type;
|
||||||
|
if (f.charset) a.charset = f.charset;
|
||||||
|
if (h) {
|
||||||
|
if (r) {
|
||||||
|
e.elem = a;
|
||||||
|
if (E) {
|
||||||
|
a.preload = true;
|
||||||
|
a.onpreload = g
|
||||||
|
} else {
|
||||||
|
a.onreadystatechange = function() {
|
||||||
|
if (a.readyState == "loaded") g()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.src = c
|
||||||
|
} else if (h && c.indexOf(D) == 0 && d[y]) {
|
||||||
|
b = new XMLHttpRequest();
|
||||||
|
b.onreadystatechange = function() {
|
||||||
|
if (b.readyState == 4) {
|
||||||
|
b.onreadystatechange = function() {};
|
||||||
|
e.text = b.responseText + "\n//@ sourceURL=" + c;
|
||||||
|
g()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
b.open("GET", c);
|
||||||
|
b.send()
|
||||||
|
} else {
|
||||||
|
a.type = "text/cache-script";
|
||||||
|
t(a, e, "ready", function() {
|
||||||
|
i.removeChild(a);
|
||||||
|
g()
|
||||||
|
});
|
||||||
|
a.src = c;
|
||||||
|
i.insertBefore(a, i.firstChild)
|
||||||
|
}
|
||||||
|
} else if (F) {
|
||||||
|
a.async = false;
|
||||||
|
t(a, e, "finished", g);
|
||||||
|
a.src = c;
|
||||||
|
i.insertBefore(a, i.firstChild)
|
||||||
|
} else {
|
||||||
|
t(a, e, "finished", g);
|
||||||
|
a.src = c;
|
||||||
|
i.insertBefore(a, i.firstChild)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function J() {
|
||||||
|
var l = {},
|
||||||
|
Q = r || M,
|
||||||
|
n = [],
|
||||||
|
p = {},
|
||||||
|
m;
|
||||||
|
l[y] = true;
|
||||||
|
l[z] = false;
|
||||||
|
l[u] = false;
|
||||||
|
l[A] = false;
|
||||||
|
l[B] = "";
|
||||||
|
|
||||||
|
function R(a, c, b) {
|
||||||
|
var d;
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
if (d != null) {
|
||||||
|
d = null;
|
||||||
|
I(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p[c.src].finished) return;
|
||||||
|
if (!a[u]) p[c.src].finished = true;
|
||||||
|
d = b.elem || document.createElement("script");
|
||||||
|
if (c.type) d.type = c.type;
|
||||||
|
if (c.charset) d.charset = c.charset;
|
||||||
|
t(d, b, "finished", f);
|
||||||
|
if (b.elem) {
|
||||||
|
b.elem = null
|
||||||
|
} else if (b.text) {
|
||||||
|
d.onload = d.onreadystatechange = null;
|
||||||
|
d.text = b.text
|
||||||
|
} else {
|
||||||
|
d.src = c.real_src
|
||||||
|
}
|
||||||
|
i.insertBefore(d, i.firstChild);
|
||||||
|
if (b.text) {
|
||||||
|
f()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function S(c, b, d, f) {
|
||||||
|
var e, g, h = function() {
|
||||||
|
b.ready_cb(b, function() {
|
||||||
|
R(c, b, e)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
j = function() {
|
||||||
|
b.finished_cb(b, d)
|
||||||
|
};
|
||||||
|
b.src = N(b.src, c[B]);
|
||||||
|
b.real_src = b.src + (c[A] ? ((/\?.*$/.test(b.src) ? "&_" : "?_") + ~~(Math.random() * 1E9) + "=") : "");
|
||||||
|
if (!p[b.src]) p[b.src] = {
|
||||||
|
items: [],
|
||||||
|
finished: false
|
||||||
|
};
|
||||||
|
g = p[b.src].items;
|
||||||
|
if (c[u] || g.length == 0) {
|
||||||
|
e = g[g.length] = {
|
||||||
|
ready: false,
|
||||||
|
finished: false,
|
||||||
|
ready_listeners: [h],
|
||||||
|
finished_listeners: [j]
|
||||||
|
};
|
||||||
|
P(c, b, e, ((f) ? function() {
|
||||||
|
e.ready = true;
|
||||||
|
for (var a = 0; a < e.ready_listeners.length; a++) {
|
||||||
|
e.ready_listeners[a]()
|
||||||
|
}
|
||||||
|
e.ready_listeners = []
|
||||||
|
} : function() {
|
||||||
|
I(e)
|
||||||
|
}), f)
|
||||||
|
} else {
|
||||||
|
e = g[0];
|
||||||
|
if (e.finished) {
|
||||||
|
j()
|
||||||
|
} else {
|
||||||
|
e.finished_listeners.push(j)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function v() {
|
||||||
|
var e, g = s(l, {}),
|
||||||
|
h = [],
|
||||||
|
j = 0,
|
||||||
|
w = false,
|
||||||
|
k;
|
||||||
|
|
||||||
|
function T(a, c) {
|
||||||
|
a.ready = true;
|
||||||
|
a.exec_trigger = c;
|
||||||
|
x()
|
||||||
|
}
|
||||||
|
|
||||||
|
function U(a, c) {
|
||||||
|
a.ready = a.finished = true;
|
||||||
|
a.exec_trigger = null;
|
||||||
|
for (var b = 0; b < c.scripts.length; b++) {
|
||||||
|
if (!c.scripts[b].finished) return
|
||||||
|
}
|
||||||
|
c.finished = true;
|
||||||
|
x()
|
||||||
|
}
|
||||||
|
|
||||||
|
function x() {
|
||||||
|
while (j < h.length) {
|
||||||
|
if (G(h[j])) {
|
||||||
|
try {
|
||||||
|
h[j++]()
|
||||||
|
} catch (err) {}
|
||||||
|
continue
|
||||||
|
} else if (!h[j].finished) {
|
||||||
|
if (O(h[j])) continue;
|
||||||
|
break
|
||||||
|
}
|
||||||
|
j++
|
||||||
|
}
|
||||||
|
if (j == h.length) {
|
||||||
|
w = false;
|
||||||
|
k = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function V() {
|
||||||
|
if (!k || !k.scripts) {
|
||||||
|
h.push(k = {
|
||||||
|
scripts: [],
|
||||||
|
finished: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e = {
|
||||||
|
script: function() {
|
||||||
|
for (var f = 0; f < arguments.length; f++) {
|
||||||
|
(function(a, c) {
|
||||||
|
var b;
|
||||||
|
if (!H(a)) {
|
||||||
|
c = [a]
|
||||||
|
}
|
||||||
|
for (var d = 0; d < c.length; d++) {
|
||||||
|
V();
|
||||||
|
a = c[d];
|
||||||
|
if (G(a)) a = a();
|
||||||
|
if (!a) continue;
|
||||||
|
if (H(a)) {
|
||||||
|
b = [].slice.call(a);
|
||||||
|
b.unshift(d, 1);
|
||||||
|
[].splice.apply(c, b);
|
||||||
|
d--;
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (typeof a == "string") a = {
|
||||||
|
src: a
|
||||||
|
};
|
||||||
|
a = s(a, {
|
||||||
|
ready: false,
|
||||||
|
ready_cb: T,
|
||||||
|
finished: false,
|
||||||
|
finished_cb: U
|
||||||
|
});
|
||||||
|
k.finished = false;
|
||||||
|
k.scripts.push(a);
|
||||||
|
S(g, a, k, (Q && w));
|
||||||
|
w = true;
|
||||||
|
if (g[z]) e.wait()
|
||||||
|
}
|
||||||
|
})(arguments[f], arguments[f])
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
},
|
||||||
|
wait: function() {
|
||||||
|
if (arguments.length > 0) {
|
||||||
|
for (var a = 0; a < arguments.length; a++) {
|
||||||
|
h.push(arguments[a])
|
||||||
|
}
|
||||||
|
k = h[h.length - 1]
|
||||||
|
} else k = false;
|
||||||
|
x();
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
script: e.script,
|
||||||
|
wait: e.wait,
|
||||||
|
setOptions: function(a) {
|
||||||
|
s(a, g);
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m = {
|
||||||
|
setGlobalDefaults: function(a) {
|
||||||
|
s(a, l);
|
||||||
|
return m
|
||||||
|
},
|
||||||
|
setOptions: function() {
|
||||||
|
return v().setOptions.apply(null, arguments)
|
||||||
|
},
|
||||||
|
script: function() {
|
||||||
|
return v().script.apply(null, arguments)
|
||||||
|
},
|
||||||
|
wait: function() {
|
||||||
|
return v().wait.apply(null, arguments)
|
||||||
|
},
|
||||||
|
queueScript: function() {
|
||||||
|
n[n.length] = {
|
||||||
|
type: "script",
|
||||||
|
args: [].slice.call(arguments)
|
||||||
|
};
|
||||||
|
return m
|
||||||
|
},
|
||||||
|
queueWait: function() {
|
||||||
|
n[n.length] = {
|
||||||
|
type: "wait",
|
||||||
|
args: [].slice.call(arguments)
|
||||||
|
};
|
||||||
|
return m
|
||||||
|
},
|
||||||
|
runQueue: function() {
|
||||||
|
var a = m,
|
||||||
|
c = n.length,
|
||||||
|
b = c,
|
||||||
|
d;
|
||||||
|
for (; --b >= 0;) {
|
||||||
|
d = n.shift();
|
||||||
|
a = a[d.type].apply(null, d.args)
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
},
|
||||||
|
noConflict: function() {
|
||||||
|
o.$LAB = K;
|
||||||
|
return m
|
||||||
|
},
|
||||||
|
sandbox: function() {
|
||||||
|
return J()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
o.$LAB = J();
|
||||||
|
(function(a, c, b) {
|
||||||
|
if (document.readyState == null && document[a]) {
|
||||||
|
document.readyState = "loading";
|
||||||
|
document[a](c, b = function() {
|
||||||
|
document.removeEventListener(c, b, false);
|
||||||
|
document.readyState = "complete"
|
||||||
|
}, false)
|
||||||
|
}
|
||||||
|
})("addEventListener", "DOMContentLoaded")
|
||||||
|
|
||||||
|
return o.$LAB;
|
||||||
|
});
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,164 @@
|
|||||||
|
define('lib/events', function (require, exports, module) {
|
||||||
|
var eventSplitter = /\s+/;
|
||||||
|
function Events() {}
|
||||||
|
Events.prototype.on = function (events, callback, context) {
|
||||||
|
var cache, event, list;
|
||||||
|
if (!callback) return this;
|
||||||
|
|
||||||
|
cache = this.__events || (this.__events = {});
|
||||||
|
events = events.split(eventSplitter);
|
||||||
|
|
||||||
|
while (event = events.shift()) {
|
||||||
|
list = cache[event] || (cache[event] = []);
|
||||||
|
list.push(callback, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
Events.prototype.once = function (events, callback, context) {
|
||||||
|
var that = this;
|
||||||
|
var cb = function () {
|
||||||
|
that.off(events, cb);
|
||||||
|
callback.apply(this, arguments);
|
||||||
|
};
|
||||||
|
this.on(events, cb, context);
|
||||||
|
};
|
||||||
|
Events.prototype.off = function (events, callback, context) {
|
||||||
|
var cache, event, list, i;
|
||||||
|
if (!(cache = this.__events)) return this;
|
||||||
|
if (!(events || callback || context)) {
|
||||||
|
delete this.__events;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
events = events ? events.split(eventSplitter) : keys(cache);
|
||||||
|
|
||||||
|
while (event = events.shift()) {
|
||||||
|
list = cache[event];
|
||||||
|
if (!list) continue;
|
||||||
|
|
||||||
|
if (!(callback || context)) {
|
||||||
|
delete cache[event];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = list.length - 2; i >= 0; i -= 2) {
|
||||||
|
if (!(callback && list[i] !== callback ||
|
||||||
|
context && list[i + 1] !== context)) {
|
||||||
|
list.splice(i, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
Events.prototype.trigger = function (events) {
|
||||||
|
var cache, event, all, list, i, len, rest = [],
|
||||||
|
args, returned = true;
|
||||||
|
if (!(cache = this.__events)) return this;
|
||||||
|
|
||||||
|
events = events.split(eventSplitter);
|
||||||
|
|
||||||
|
for (i = 1, len = arguments.length; i < len; i++) {
|
||||||
|
rest[i - 1] = arguments[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
while (event = events.shift()) {
|
||||||
|
// Copy callback lists to prevent modification.
|
||||||
|
if (all = cache.all) all = all.slice();
|
||||||
|
if (list = cache[event]) list = list.slice();
|
||||||
|
|
||||||
|
// Execute event callbacks.
|
||||||
|
returned = triggerEvents(list, rest, this) && returned;
|
||||||
|
|
||||||
|
// Execute "all" callbacks.
|
||||||
|
returned = triggerEvents(all, [event].concat(rest), this) && returned;
|
||||||
|
}
|
||||||
|
|
||||||
|
return returned;
|
||||||
|
};
|
||||||
|
|
||||||
|
Events.prototype.emit = Events.prototype.trigger;
|
||||||
|
|
||||||
|
// Mix `Events` to object instance or Class function.
|
||||||
|
Events.mixTo = function (receiver) {
|
||||||
|
receiver = isFunction(receiver) ? receiver.prototype : receiver;
|
||||||
|
var proto = Events.prototype;
|
||||||
|
|
||||||
|
for (var p in proto) {
|
||||||
|
if (proto.hasOwnProperty(p)) {
|
||||||
|
receiver[p] = proto[p];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
// -------
|
||||||
|
|
||||||
|
var keys = Object.keys;
|
||||||
|
|
||||||
|
if (!keys) {
|
||||||
|
keys = function (o) {
|
||||||
|
var result = [];
|
||||||
|
|
||||||
|
for (var name in o) {
|
||||||
|
if (o.hasOwnProperty(name)) {
|
||||||
|
result.push(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute callbacks
|
||||||
|
function triggerEvents(list, args, context) {
|
||||||
|
var pass = true;
|
||||||
|
|
||||||
|
if (list) {
|
||||||
|
var i = 0,
|
||||||
|
l = list.length,
|
||||||
|
a1 = args[0],
|
||||||
|
a2 = args[1],
|
||||||
|
a3 = args[2];
|
||||||
|
// call is faster than apply, optimize less than 3 argu
|
||||||
|
// http://blog.csdn.net/zhengyinhui100/article/details/7837127
|
||||||
|
switch (args.length) {
|
||||||
|
case 0:
|
||||||
|
for (; i < l; i += 2) {
|
||||||
|
pass = list[i].call(list[i + 1] || context) !== false && pass;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
for (; i < l; i += 2) {
|
||||||
|
pass = list[i].call(list[i + 1] || context, a1) !== false && pass;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
for (; i < l; i += 2) {
|
||||||
|
pass = list[i].call(list[i + 1] || context, a1, a2) !== false && pass;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
for (; i < l; i += 2) {
|
||||||
|
pass = list[i].call(list[i + 1] || context, a1, a2, a3) !== false && pass;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
for (; i < l; i += 2) {
|
||||||
|
pass = list[i].apply(list[i + 1] || context, args) !== false && pass;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// trigger will return false if one of the callbacks return false
|
||||||
|
return pass;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isFunction(func) {
|
||||||
|
return Object.prototype.toString.call(func) === '[object Function]';
|
||||||
|
}
|
||||||
|
|
||||||
|
return Events;
|
||||||
|
});
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
RequireJS 2.1.20 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
|
||||||
|
Available via the MIT or new BSD license.
|
||||||
|
see: http://github.com/jrburke/requirejs for details
|
||||||
|
*/
|
||||||
|
var requirejs,require,define;
|
||||||
|
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function n(b,c){return t(b,c)&&b[c]}function A(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&A(c,function(c,i){if(d||!t(b,i))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
|
||||||
|
RegExp)?(b[i]||(b[i]={}),U(b[i],c,d,e)):b[i]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function B(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,j,b){var f,l,c,d,h,e,g,i,j=j&&j.split("/"),p=k.map,m=p&&p["*"];if(a){a=a.split("/");l=a.length-1;k.nodeIdCompat&&
|
||||||
|
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&j&&(l=j.slice(0,j.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1===c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&p&&(j||m)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){h=l.slice(0,c).join("/");if(j)for(d=j.length;0<d;d-=1)if(b=n(p,j.slice(0,d).join("/")))if(b=n(b,h)){f=b;e=c;break a}!g&&(m&&n(m,h))&&(g=n(m,h),i=c)}!f&&g&&(f=g,e=i);f&&(l.splice(0,
|
||||||
|
e,f),a=l.join("/"))}return(f=n(k.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(j){if(j.getAttribute("data-requiremodule")===a&&j.getAttribute("data-requirecontext")===h.contextName)return j.parentNode.removeChild(j),!0})}function p(a){var j=n(k.paths,a);if(j&&H(j)&&1<j.length)return j.shift(),h.require.undef(a),h.makeRequire(null,{skipMap:!0})([a]),!0}function g(a){var j,c=a?a.indexOf("!"):-1;-1<c&&(j=a.substring(0,c),a=a.substring(c+1,a.length));return[j,a]}function i(a,
|
||||||
|
j,b,f){var l,d,e=null,i=j?j.name:null,k=a,p=!0,m="";a||(p=!1,a="_@r"+(K+=1));a=g(a);e=a[0];a=a[1];e&&(e=c(e,i,f),d=n(q,e));a&&(e?m=d&&d.normalize?d.normalize(a,function(a){return c(a,i,f)}):-1===a.indexOf("!")?c(a,i,f):a:(m=c(a,i,f),a=g(m),e=a[0],m=a[1],b=!0,l=h.nameToUrl(m)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:m,parentMap:j,unnormalized:!!b,url:l,originalName:k,isDefine:p,id:(e?e+"!"+m:m)+b}}function r(a){var j=a.id,b=n(m,j);b||(b=m[j]=new h.Module(a));return b}function s(a,
|
||||||
|
j,b){var f=a.id,c=n(m,f);if(t(q,f)&&(!c||c.defineEmitComplete))"defined"===j&&b(q[f]);else if(c=r(a),c.error&&"error"===j)b(c.error);else c.on(j,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=n(m,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)e.onError(a)}function x(){R.length&&(v(R,function(a){var b=a[0];"string"===typeof b&&(h.defQueueMap[b]=!0);C.push(a)}),R=[])}function y(a){delete m[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",
|
||||||
|
a.error):(b[f]=!0,v(a.depMaps,function(f,d){var e=f.id,h=n(m,e);h&&(!a.depMatched[d]&&!c[e])&&(n(b,e)?(a.defineDep(d,q[e]),a.check()):F(h,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*k.waitSeconds)&&h.startTime+a<(new Date).getTime(),f=[],l=[],e=!1,i=!0;if(!W){W=!0;A(V,function(a){var h=a.map,g=h.id;if(a.enabled&&(h.isDefine||l.push(a),!a.error))if(!a.inited&&c)p(g)?e=b=!0:(f.push(g),d(g));else if(!a.inited&&(a.fetched&&h.isDefine)&&(e=!0,!h.prefix))return i=!1});if(c&&f.length)return a=B("timeout",
|
||||||
|
"Load timeout for modules: "+f,null,f),a.contextName=h.contextName,w(a);i&&v(l,function(a){F(a,{},{})});if((!c||b)&&e)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(q,a[0])||r(i(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=h.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=h.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}
|
||||||
|
function J(){var a;for(x();C.length;){a=C.shift();if(null===a[0])return w(B("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}h.defQueueMap={}}var W,Z,h,L,X,k={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},m={},V={},$={},C=[],q={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=h.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?q[a.map.id]=a.exports:a.exports=q[a.map.id]={}},
|
||||||
|
module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return n(k.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=n($,a.id)||{};this.map=a;this.shim=n(k.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));
|
||||||
|
this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;h.startTime=(new Date).getTime();var a=this.map;if(this.shim)h.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?
|
||||||
|
this.callPlugin():this.load()}},load:function(){var a=this.map.url;S[a]||(S[a]=!0,h.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||e.onError!==ca)try{f=h.execCb(c,l,b,f)}catch(d){a=d}else f=h.execCb(c,l,b,f);this.map.isDefine&&
|
||||||
|
void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(q[c]=f,e.onResourceLoad))e.onResourceLoad(h,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=
|
||||||
|
!0)}}else t(h.defQueueMap,c)||this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=i(a.prefix);this.depMaps.push(d);s(d,"defined",u(this,function(f){var l,d;d=n(aa,this.map.id);var g=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,p=h.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(g=f.normalize(g,function(a){return c(a,P,!0)})||""),f=i(a.prefix+"!"+g,this.map.parentMap),s(f,"defined",u(this,function(a){this.init([],function(){return a},
|
||||||
|
null,{enabled:!0,ignore:!0})})),d=n(m,f.id)){this.depMaps.push(f);if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=h.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];A(m,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,g=i(d),P=M;c&&(f=c);P&&
|
||||||
|
(M=!1);r(g);t(k.config,b)&&(k.config[d]=k.config[b]);try{e.exec(f)}catch(m){return w(B("fromtexteval","fromText eval for "+b+" failed: "+m,m,[b]))}P&&(M=!0);this.depMaps.push(g);h.completeLoad(d);p([d],l)}),f.load(a.name,p,l,k))}));h.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=i(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=
|
||||||
|
n(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",u(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?s(a,"error",u(this,this.errback)):this.events.error&&s(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=m[c];!t(L,c)&&(f&&!f.enabled)&&h.enable(a,this)}));A(this.pluginMaps,u(this,function(a){var b=n(m,a.id);b&&!b.enabled&&h.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=
|
||||||
|
[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};h={config:k,contextName:b,registry:m,defined:q,urlFetched:S,defQueue:C,defQueueMap:{},Module:Z,makeModuleMap:i,nextTick:e.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=k.shim,c={paths:!0,bundles:!0,config:!0,map:!0};A(a,function(a,b){c[b]?(k[b]||(k[b]={}),U(k[b],a,!0,!0)):k[b]=a});a.bundles&&A(a.bundles,function(a,b){v(a,
|
||||||
|
function(a){a!==b&&(aa[a]=b)})});a.shim&&(A(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=h.makeShimExports(a);b[c]=a}),k.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(k.paths[b]=a.location);k.pkgs[b]=a.name+"/"+(a.main||"main").replace(ha,"").replace(Q,"")});A(m,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=i(b,null,!0))});if(a.deps||a.callback)h.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;
|
||||||
|
a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,j){function g(c,d,p){var k,n;j.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(B("requireargs","Invalid require call"),p);if(a&&t(L,c))return L[c](m[a.id]);if(e.get)return e.get(h,c,a,g);k=i(c,a,!1,!0);k=k.id;return!t(q,k)?w(B("notloaded",'Module name "'+k+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):q[k]}J();h.nextTick(function(){J();
|
||||||
|
n=r(i(null,a));n.skipMap=j.skipMap;n.init(c,d,p,{enabled:!0});D()});return g}j=j||{};U(g,{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),j=b.split("/")[0];if(-1!==e&&(!("."===j||".."===j)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return h.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(q,i(b,a,!1,!0).id)},specified:function(b){b=i(b,a,!1,!0).id;return t(q,b)||t(m,b)}});a||(g.undef=function(b){x();var c=i(b,a,!0),e=n(m,b);e.undefed=!0;d(b);delete q[b];delete S[c.url];
|
||||||
|
delete $[b];T(C,function(a,c){a[0]===b&&C.splice(c,1)});delete h.defQueueMap[b];e&&(e.events.defined&&($[b]=e.events),y(b))});return g},enable:function(a){n(m,a.id)&&r(a).enable()},completeLoad:function(a){var b,c,d=n(k.shim,a)||{},e=d.exports;for(x();C.length;){c=C.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}h.defQueueMap={};c=n(m,a);if(!b&&!t(q,a)&&c&&!c.inited){if(k.enforceDefine&&(!e||!da(e)))return p(a)?void 0:w(B("nodefine","No define call for "+a,null,[a]));E([a,
|
||||||
|
d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,g,i;(d=n(k.pkgs,a))&&(a=d);if(d=n(aa,a))return h.nameToUrl(d,b,c);if(e.jsExtRegExp.test(a))d=a+(b||"");else{d=k.paths;a=a.split("/");for(g=a.length;0<g;g-=1)if(i=a.slice(0,g).join("/"),i=n(d,i)){H(i)&&(i=i[0]);a.splice(0,g,i);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":k.baseUrl)+d}return k.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+k.urlArgs):d},load:function(a,b){e.load(h,
|
||||||
|
a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ia.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),h.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!p(b.id))return w(B("scripterror","Script error for: "+b.id,a,[b.id]))}};h.require=h.makeRequire();return h}var e,x,y,D,I,E,N,J,r,O,ja=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ka=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ha=/^\.\//;x=Object.prototype;var K=
|
||||||
|
x.toString,fa=x.hasOwnProperty,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ia=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},s={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;s=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(s=require,require=
|
||||||
|
void 0);e=requirejs=function(b,c,d,p){var g,i="_";!H(b)&&"string"!==typeof b&&(g=b,H(c)?(b=c,c=d,d=p):b=[]);g&&g.context&&(i=g.context);(p=n(F,i))||(p=F[i]=e.s.newContext(i));g&&p.configure(g);return p.require(b,c,d)};e.config=function(b){return e(b)};e.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=e);e.version="2.1.20";e.jsExtRegExp=/^\/|:|\?|\.js$/;e.isBrowser=z;x=e.s={contexts:F,newContext:ga};e({});v(["toUrl","undef","defined","specified"],
|
||||||
|
function(b){e[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;e.onError=ca;e.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};e.load=function(b,c,d){var p=b&&b.config||{},g;if(z){g=e.createNode(p,
|
||||||
|
c,d);if(p.onNodeCreated)p.onNodeCreated(g,p,c,d);g.setAttribute("data-requirecontext",b.contextName);g.setAttribute("data-requiremodule",c);g.attachEvent&&!(g.attachEvent.toString&&0>g.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1));g.src=d;J=g;D?y.insertBefore(g,D):y.appendChild(g);J=null;return g}if(ea)try{importScripts(d),b.completeLoad(c)}catch(i){b.onError(B("importscripts",
|
||||||
|
"importScripts failed for "+c+" at "+d,i,[c]))}};z&&!s.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return r=I,s.baseUrl||(E=r.split("/"),r=E.pop(),O=E.length?E.join("/")+"/":"./",s.baseUrl=O),r=r.replace(Q,""),e.jsExtRegExp.test(r)&&(r=I),s.deps=s.deps?s.deps.concat(r):[r],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ja,"").replace(ka,
|
||||||
|
function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):R.push([b,c,d])};define.amd={jQuery:!0};e.exec=function(b){return eval(b)};e(s)}})(this);
|
||||||
@@ -0,0 +1,674 @@
|
|||||||
|
define('lib/underscore', function() {
|
||||||
|
function n(n) {
|
||||||
|
function t(t, r, e, u, i, o) {
|
||||||
|
for (; i >= 0 && o > i; i += n) {
|
||||||
|
var a = u ? u[i] : i;
|
||||||
|
e = r(e, t[a], a, t)
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
return function(r, e, u, i) {
|
||||||
|
e = d(e, i, 4);
|
||||||
|
var o = !w(r) && m.keys(r),
|
||||||
|
a = (o || r).length,
|
||||||
|
c = n > 0 ? 0 : a - 1;
|
||||||
|
return arguments.length < 3 && (u = r[o ? o[c] : c], c += n), t(r, e, u, o, c, a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function t(n) {
|
||||||
|
return function(t, r, e) {
|
||||||
|
r = b(r, e);
|
||||||
|
for (var u = null != t && t.length, i = n > 0 ? 0 : u - 1; i >= 0 && u > i; i += n)
|
||||||
|
if (r(t[i], i, t)) return i;
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function r(n, t) {
|
||||||
|
var r = S.length,
|
||||||
|
e = n.constructor,
|
||||||
|
u = m.isFunction(e) && e.prototype || o,
|
||||||
|
i = "constructor";
|
||||||
|
for (m.has(n, i) && !m.contains(t, i) && t.push(i); r--;) i = S[r], i in n && n[i] !== u[i] && !m.contains(t, i) && t.push(i)
|
||||||
|
}
|
||||||
|
var e = this,
|
||||||
|
u = e._,
|
||||||
|
i = Array.prototype,
|
||||||
|
o = Object.prototype,
|
||||||
|
a = Function.prototype,
|
||||||
|
c = i.push,
|
||||||
|
l = i.slice,
|
||||||
|
f = o.toString,
|
||||||
|
s = o.hasOwnProperty,
|
||||||
|
p = Array.isArray,
|
||||||
|
h = Object.keys,
|
||||||
|
v = a.bind,
|
||||||
|
g = Object.create,
|
||||||
|
y = function() {},
|
||||||
|
m = function(n) {
|
||||||
|
return n instanceof m ? n : this instanceof m ? void(this._wrapped = n) : new m(n)
|
||||||
|
};
|
||||||
|
"undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = m), exports._ = m) : e._ = m, m.VERSION = "1.8.2";
|
||||||
|
var d = function(n, t, r) {
|
||||||
|
if (t === void 0) return n;
|
||||||
|
switch (null == r ? 3 : r) {
|
||||||
|
case 1:
|
||||||
|
return function(r) {
|
||||||
|
return n.call(t, r)
|
||||||
|
};
|
||||||
|
case 2:
|
||||||
|
return function(r, e) {
|
||||||
|
return n.call(t, r, e)
|
||||||
|
};
|
||||||
|
case 3:
|
||||||
|
return function(r, e, u) {
|
||||||
|
return n.call(t, r, e, u)
|
||||||
|
};
|
||||||
|
case 4:
|
||||||
|
return function(r, e, u, i) {
|
||||||
|
return n.call(t, r, e, u, i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return function() {
|
||||||
|
return n.apply(t, arguments)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
b = function(n, t, r) {
|
||||||
|
return null == n ? m.identity : m.isFunction(n) ? d(n, t, r) : m.isObject(n) ? m.matcher(n) : m.property(n)
|
||||||
|
};
|
||||||
|
m.iteratee = function(n, t) {
|
||||||
|
return b(n, t, 1 / 0)
|
||||||
|
};
|
||||||
|
var x = function(n, t) {
|
||||||
|
return function(r) {
|
||||||
|
var e = arguments.length;
|
||||||
|
if (2 > e || null == r) return r;
|
||||||
|
for (var u = 1; e > u; u++)
|
||||||
|
for (var i = arguments[u], o = n(i), a = o.length, c = 0; a > c; c++) {
|
||||||
|
var l = o[c];
|
||||||
|
t && r[l] !== void 0 || (r[l] = i[l])
|
||||||
|
}
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ = function(n) {
|
||||||
|
if (!m.isObject(n)) return {};
|
||||||
|
if (g) return g(n);
|
||||||
|
y.prototype = n;
|
||||||
|
var t = new y;
|
||||||
|
return y.prototype = null, t
|
||||||
|
},
|
||||||
|
j = Math.pow(2, 53) - 1,
|
||||||
|
w = function(n) {
|
||||||
|
var t = n && n.length;
|
||||||
|
return "number" == typeof t && t >= 0 && j >= t
|
||||||
|
};
|
||||||
|
m.each = m.forEach = function(n, t, r) {
|
||||||
|
t = d(t, r);
|
||||||
|
var e, u;
|
||||||
|
if (w(n))
|
||||||
|
for (e = 0, u = n.length; u > e; e++) t(n[e], e, n);
|
||||||
|
else {
|
||||||
|
var i = m.keys(n);
|
||||||
|
for (e = 0, u = i.length; u > e; e++) t(n[i[e]], i[e], n)
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}, m.map = m.collect = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
for (var e = !w(n) && m.keys(n), u = (e || n).length, i = Array(u), o = 0; u > o; o++) {
|
||||||
|
var a = e ? e[o] : o;
|
||||||
|
i[o] = t(n[a], a, n)
|
||||||
|
}
|
||||||
|
return i
|
||||||
|
}, m.reduce = m.foldl = m.inject = n(1), m.reduceRight = m.foldr = n(-1), m.find = m.detect = function(n, t, r) {
|
||||||
|
var e;
|
||||||
|
return e = w(n) ? m.findIndex(n, t, r) : m.findKey(n, t, r), e !== void 0 && e !== -1 ? n[e] : void 0
|
||||||
|
}, m.filter = m.select = function(n, t, r) {
|
||||||
|
var e = [];
|
||||||
|
return t = b(t, r), m.each(n, function(n, r, u) {
|
||||||
|
t(n, r, u) && e.push(n)
|
||||||
|
}), e
|
||||||
|
}, m.reject = function(n, t, r) {
|
||||||
|
return m.filter(n, m.negate(b(t)), r)
|
||||||
|
}, m.every = m.all = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
for (var e = !w(n) && m.keys(n), u = (e || n).length, i = 0; u > i; i++) {
|
||||||
|
var o = e ? e[i] : i;
|
||||||
|
if (!t(n[o], o, n)) return !1
|
||||||
|
}
|
||||||
|
return !0
|
||||||
|
}, m.some = m.any = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
for (var e = !w(n) && m.keys(n), u = (e || n).length, i = 0; u > i; i++) {
|
||||||
|
var o = e ? e[i] : i;
|
||||||
|
if (t(n[o], o, n)) return !0
|
||||||
|
}
|
||||||
|
return !1
|
||||||
|
}, m.contains = m.includes = m.include = function(n, t, r) {
|
||||||
|
return w(n) || (n = m.values(n)), m.indexOf(n, t, "number" == typeof r && r) >= 0
|
||||||
|
}, m.invoke = function(n, t) {
|
||||||
|
var r = l.call(arguments, 2),
|
||||||
|
e = m.isFunction(t);
|
||||||
|
return m.map(n, function(n) {
|
||||||
|
var u = e ? t : n[t];
|
||||||
|
return null == u ? u : u.apply(n, r)
|
||||||
|
})
|
||||||
|
}, m.pluck = function(n, t) {
|
||||||
|
return m.map(n, m.property(t))
|
||||||
|
}, m.where = function(n, t) {
|
||||||
|
return m.filter(n, m.matcher(t))
|
||||||
|
}, m.findWhere = function(n, t) {
|
||||||
|
return m.find(n, m.matcher(t))
|
||||||
|
}, m.max = function(n, t, r) {
|
||||||
|
var e, u, i = -1 / 0,
|
||||||
|
o = -1 / 0;
|
||||||
|
if (null == t && null != n) {
|
||||||
|
n = w(n) ? n : m.values(n);
|
||||||
|
for (var a = 0, c = n.length; c > a; a++) e = n[a], e > i && (i = e)
|
||||||
|
} else t = b(t, r), m.each(n, function(n, r, e) {
|
||||||
|
u = t(n, r, e), (u > o || u === -1 / 0 && i === -1 / 0) && (i = n, o = u)
|
||||||
|
});
|
||||||
|
return i
|
||||||
|
}, m.min = function(n, t, r) {
|
||||||
|
var e, u, i = 1 / 0,
|
||||||
|
o = 1 / 0;
|
||||||
|
if (null == t && null != n) {
|
||||||
|
n = w(n) ? n : m.values(n);
|
||||||
|
for (var a = 0, c = n.length; c > a; a++) e = n[a], i > e && (i = e)
|
||||||
|
} else t = b(t, r), m.each(n, function(n, r, e) {
|
||||||
|
u = t(n, r, e), (o > u || 1 / 0 === u && 1 / 0 === i) && (i = n, o = u)
|
||||||
|
});
|
||||||
|
return i
|
||||||
|
}, m.shuffle = function(n) {
|
||||||
|
for (var t, r = w(n) ? n : m.values(n), e = r.length, u = Array(e), i = 0; e > i; i++) t = m.random(0, i), t !== i && (u[i] = u[t]), u[t] = r[i];
|
||||||
|
return u
|
||||||
|
}, m.sample = function(n, t, r) {
|
||||||
|
return null == t || r ? (w(n) || (n = m.values(n)), n[m.random(n.length - 1)]) : m.shuffle(n).slice(0, Math.max(0, t))
|
||||||
|
}, m.sortBy = function(n, t, r) {
|
||||||
|
return t = b(t, r), m.pluck(m.map(n, function(n, r, e) {
|
||||||
|
return {
|
||||||
|
value: n,
|
||||||
|
index: r,
|
||||||
|
criteria: t(n, r, e)
|
||||||
|
}
|
||||||
|
}).sort(function(n, t) {
|
||||||
|
var r = n.criteria,
|
||||||
|
e = t.criteria;
|
||||||
|
if (r !== e) {
|
||||||
|
if (r > e || r === void 0) return 1;
|
||||||
|
if (e > r || e === void 0) return -1
|
||||||
|
}
|
||||||
|
return n.index - t.index
|
||||||
|
}), "value")
|
||||||
|
};
|
||||||
|
var A = function(n) {
|
||||||
|
return function(t, r, e) {
|
||||||
|
var u = {};
|
||||||
|
return r = b(r, e), m.each(t, function(e, i) {
|
||||||
|
var o = r(e, i, t);
|
||||||
|
n(u, e, o)
|
||||||
|
}), u
|
||||||
|
}
|
||||||
|
};
|
||||||
|
m.groupBy = A(function(n, t, r) {
|
||||||
|
m.has(n, r) ? n[r].push(t) : n[r] = [t]
|
||||||
|
}), m.indexBy = A(function(n, t, r) {
|
||||||
|
n[r] = t
|
||||||
|
}), m.countBy = A(function(n, t, r) {
|
||||||
|
m.has(n, r) ? n[r] ++ : n[r] = 1
|
||||||
|
}), m.toArray = function(n) {
|
||||||
|
return n ? m.isArray(n) ? l.call(n) : w(n) ? m.map(n, m.identity) : m.values(n) : []
|
||||||
|
}, m.size = function(n) {
|
||||||
|
return null == n ? 0 : w(n) ? n.length : m.keys(n).length
|
||||||
|
}, m.partition = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
var e = [],
|
||||||
|
u = [];
|
||||||
|
return m.each(n, function(n, r, i) {
|
||||||
|
(t(n, r, i) ? e : u).push(n)
|
||||||
|
}), [e, u]
|
||||||
|
}, m.first = m.head = m.take = function(n, t, r) {
|
||||||
|
return null == n ? void 0 : null == t || r ? n[0] : m.initial(n, n.length - t)
|
||||||
|
}, m.initial = function(n, t, r) {
|
||||||
|
return l.call(n, 0, Math.max(0, n.length - (null == t || r ? 1 : t)))
|
||||||
|
}, m.last = function(n, t, r) {
|
||||||
|
return null == n ? void 0 : null == t || r ? n[n.length - 1] : m.rest(n, Math.max(0, n.length - t))
|
||||||
|
}, m.rest = m.tail = m.drop = function(n, t, r) {
|
||||||
|
return l.call(n, null == t || r ? 1 : t)
|
||||||
|
}, m.compact = function(n) {
|
||||||
|
return m.filter(n, m.identity)
|
||||||
|
};
|
||||||
|
var k = function(n, t, r, e) {
|
||||||
|
for (var u = [], i = 0, o = e || 0, a = n && n.length; a > o; o++) {
|
||||||
|
var c = n[o];
|
||||||
|
if (w(c) && (m.isArray(c) || m.isArguments(c))) {
|
||||||
|
t || (c = k(c, t, r));
|
||||||
|
var l = 0,
|
||||||
|
f = c.length;
|
||||||
|
for (u.length += f; f > l;) u[i++] = c[l++]
|
||||||
|
} else r || (u[i++] = c)
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
};
|
||||||
|
m.flatten = function(n, t) {
|
||||||
|
return k(n, t, !1)
|
||||||
|
}, m.without = function(n) {
|
||||||
|
return m.difference(n, l.call(arguments, 1))
|
||||||
|
}, m.uniq = m.unique = function(n, t, r, e) {
|
||||||
|
if (null == n) return [];
|
||||||
|
m.isBoolean(t) || (e = r, r = t, t = !1), null != r && (r = b(r, e));
|
||||||
|
for (var u = [], i = [], o = 0, a = n.length; a > o; o++) {
|
||||||
|
var c = n[o],
|
||||||
|
l = r ? r(c, o, n) : c;
|
||||||
|
t ? (o && i === l || u.push(c), i = l) : r ? m.contains(i, l) || (i.push(l), u.push(c)) : m.contains(u, c) || u.push(c)
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}, m.union = function() {
|
||||||
|
return m.uniq(k(arguments, !0, !0))
|
||||||
|
}, m.intersection = function(n) {
|
||||||
|
if (null == n) return [];
|
||||||
|
for (var t = [], r = arguments.length, e = 0, u = n.length; u > e; e++) {
|
||||||
|
var i = n[e];
|
||||||
|
if (!m.contains(t, i)) {
|
||||||
|
for (var o = 1; r > o && m.contains(arguments[o], i); o++);
|
||||||
|
o === r && t.push(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t
|
||||||
|
}, m.difference = function(n) {
|
||||||
|
var t = k(arguments, !0, !0, 1);
|
||||||
|
return m.filter(n, function(n) {
|
||||||
|
return !m.contains(t, n)
|
||||||
|
})
|
||||||
|
}, m.zip = function() {
|
||||||
|
return m.unzip(arguments)
|
||||||
|
}, m.unzip = function(n) {
|
||||||
|
for (var t = n && m.max(n, "length").length || 0, r = Array(t), e = 0; t > e; e++) r[e] = m.pluck(n, e);
|
||||||
|
return r
|
||||||
|
}, m.object = function(n, t) {
|
||||||
|
for (var r = {}, e = 0, u = n && n.length; u > e; e++) t ? r[n[e]] = t[e] : r[n[e][0]] = n[e][1];
|
||||||
|
return r
|
||||||
|
}, m.indexOf = function(n, t, r) {
|
||||||
|
var e = 0,
|
||||||
|
u = n && n.length;
|
||||||
|
if ("number" == typeof r) e = 0 > r ? Math.max(0, u + r) : r;
|
||||||
|
else if (r && u) return e = m.sortedIndex(n, t), n[e] === t ? e : -1;
|
||||||
|
if (t !== t) return m.findIndex(l.call(n, e), m.isNaN);
|
||||||
|
for (; u > e; e++)
|
||||||
|
if (n[e] === t) return e;
|
||||||
|
return -1
|
||||||
|
}, m.lastIndexOf = function(n, t, r) {
|
||||||
|
var e = n ? n.length : 0;
|
||||||
|
if ("number" == typeof r && (e = 0 > r ? e + r + 1 : Math.min(e, r + 1)), t !== t) return m.findLastIndex(l.call(n, 0, e), m.isNaN);
|
||||||
|
for (; --e >= 0;)
|
||||||
|
if (n[e] === t) return e;
|
||||||
|
return -1
|
||||||
|
}, m.findIndex = t(1), m.findLastIndex = t(-1), m.sortedIndex = function(n, t, r, e) {
|
||||||
|
r = b(r, e, 1);
|
||||||
|
for (var u = r(t), i = 0, o = n.length; o > i;) {
|
||||||
|
var a = Math.floor((i + o) / 2);
|
||||||
|
r(n[a]) < u ? i = a + 1 : o = a
|
||||||
|
}
|
||||||
|
return i
|
||||||
|
}, m.range = function(n, t, r) {
|
||||||
|
arguments.length <= 1 && (t = n || 0, n = 0), r = r || 1;
|
||||||
|
for (var e = Math.max(Math.ceil((t - n) / r), 0), u = Array(e), i = 0; e > i; i++, n += r) u[i] = n;
|
||||||
|
return u
|
||||||
|
};
|
||||||
|
var O = function(n, t, r, e, u) {
|
||||||
|
if (!(e instanceof t)) return n.apply(r, u);
|
||||||
|
var i = _(n.prototype),
|
||||||
|
o = n.apply(i, u);
|
||||||
|
return m.isObject(o) ? o : i
|
||||||
|
};
|
||||||
|
m.bind = function(n, t) {
|
||||||
|
if (v && n.bind === v) return v.apply(n, l.call(arguments, 1));
|
||||||
|
if (!m.isFunction(n)) throw new TypeError("Bind must be called on a function");
|
||||||
|
var r = l.call(arguments, 2),
|
||||||
|
e = function() {
|
||||||
|
return O(n, e, t, this, r.concat(l.call(arguments)))
|
||||||
|
};
|
||||||
|
return e
|
||||||
|
}, m.partial = function(n) {
|
||||||
|
var t = l.call(arguments, 1),
|
||||||
|
r = function() {
|
||||||
|
for (var e = 0, u = t.length, i = Array(u), o = 0; u > o; o++) i[o] = t[o] === m ? arguments[e++] : t[o];
|
||||||
|
for (; e < arguments.length;) i.push(arguments[e++]);
|
||||||
|
return O(n, r, this, this, i)
|
||||||
|
};
|
||||||
|
return r
|
||||||
|
}, m.bindAll = function(n) {
|
||||||
|
var t, r, e = arguments.length;
|
||||||
|
if (1 >= e) throw new Error("bindAll must be passed function names");
|
||||||
|
for (t = 1; e > t; t++) r = arguments[t], n[r] = m.bind(n[r], n);
|
||||||
|
return n
|
||||||
|
}, m.memoize = function(n, t) {
|
||||||
|
var r = function(e) {
|
||||||
|
var u = r.cache,
|
||||||
|
i = "" + (t ? t.apply(this, arguments) : e);
|
||||||
|
return m.has(u, i) || (u[i] = n.apply(this, arguments)), u[i]
|
||||||
|
};
|
||||||
|
return r.cache = {}, r
|
||||||
|
}, m.delay = function(n, t) {
|
||||||
|
var r = l.call(arguments, 2);
|
||||||
|
return setTimeout(function() {
|
||||||
|
return n.apply(null, r)
|
||||||
|
}, t)
|
||||||
|
}, m.defer = m.partial(m.delay, m, 1), m.throttle = function(n, t, r) {
|
||||||
|
var e, u, i, o = null,
|
||||||
|
a = 0;
|
||||||
|
r || (r = {});
|
||||||
|
var c = function() {
|
||||||
|
a = r.leading === !1 ? 0 : m.now(), o = null, i = n.apply(e, u), o || (e = u = null)
|
||||||
|
};
|
||||||
|
return function() {
|
||||||
|
var l = m.now();
|
||||||
|
a || r.leading !== !1 || (a = l);
|
||||||
|
var f = t - (l - a);
|
||||||
|
return e = this, u = arguments, 0 >= f || f > t ? (o && (clearTimeout(o), o = null), a = l, i = n.apply(e, u), o || (e = u = null)) : o || r.trailing === !1 || (o = setTimeout(c, f)), i
|
||||||
|
}
|
||||||
|
}, m.debounce = function(n, t, r) {
|
||||||
|
var e, u, i, o, a, c = function() {
|
||||||
|
var l = m.now() - o;
|
||||||
|
t > l && l >= 0 ? e = setTimeout(c, t - l) : (e = null, r || (a = n.apply(i, u), e || (i = u = null)))
|
||||||
|
};
|
||||||
|
return function() {
|
||||||
|
i = this, u = arguments, o = m.now();
|
||||||
|
var l = r && !e;
|
||||||
|
return e || (e = setTimeout(c, t)), l && (a = n.apply(i, u), i = u = null), a
|
||||||
|
}
|
||||||
|
}, m.wrap = function(n, t) {
|
||||||
|
return m.partial(t, n)
|
||||||
|
}, m.negate = function(n) {
|
||||||
|
return function() {
|
||||||
|
return !n.apply(this, arguments)
|
||||||
|
}
|
||||||
|
}, m.compose = function() {
|
||||||
|
var n = arguments,
|
||||||
|
t = n.length - 1;
|
||||||
|
return function() {
|
||||||
|
for (var r = t, e = n[t].apply(this, arguments); r--;) e = n[r].call(this, e);
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}, m.after = function(n, t) {
|
||||||
|
return function() {
|
||||||
|
return --n < 1 ? t.apply(this, arguments) : void 0
|
||||||
|
}
|
||||||
|
}, m.before = function(n, t) {
|
||||||
|
var r;
|
||||||
|
return function() {
|
||||||
|
return --n > 0 && (r = t.apply(this, arguments)), 1 >= n && (t = null), r
|
||||||
|
}
|
||||||
|
}, m.once = m.partial(m.before, 2);
|
||||||
|
var F = !{
|
||||||
|
toString: null
|
||||||
|
}.propertyIsEnumerable("toString"),
|
||||||
|
S = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
|
||||||
|
m.keys = function(n) {
|
||||||
|
if (!m.isObject(n)) return [];
|
||||||
|
if (h) return h(n);
|
||||||
|
var t = [];
|
||||||
|
for (var e in n) m.has(n, e) && t.push(e);
|
||||||
|
return F && r(n, t), t
|
||||||
|
}, m.allKeys = function(n) {
|
||||||
|
if (!m.isObject(n)) return [];
|
||||||
|
var t = [];
|
||||||
|
for (var e in n) t.push(e);
|
||||||
|
return F && r(n, t), t
|
||||||
|
}, m.values = function(n) {
|
||||||
|
for (var t = m.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = n[t[u]];
|
||||||
|
return e
|
||||||
|
}, m.mapObject = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
for (var e, u = m.keys(n), i = u.length, o = {}, a = 0; i > a; a++) e = u[a], o[e] = t(n[e], e, n);
|
||||||
|
return o
|
||||||
|
}, m.pairs = function(n) {
|
||||||
|
for (var t = m.keys(n), r = t.length, e = Array(r), u = 0; r > u; u++) e[u] = [t[u], n[t[u]]];
|
||||||
|
return e
|
||||||
|
}, m.invert = function(n) {
|
||||||
|
for (var t = {}, r = m.keys(n), e = 0, u = r.length; u > e; e++) t[n[r[e]]] = r[e];
|
||||||
|
return t
|
||||||
|
}, m.functions = m.methods = function(n) {
|
||||||
|
var t = [];
|
||||||
|
for (var r in n) m.isFunction(n[r]) && t.push(r);
|
||||||
|
return t.sort()
|
||||||
|
}, m.extend = x(m.allKeys), m.extendOwn = m.assign = x(m.keys), m.findKey = function(n, t, r) {
|
||||||
|
t = b(t, r);
|
||||||
|
for (var e, u = m.keys(n), i = 0, o = u.length; o > i; i++)
|
||||||
|
if (e = u[i], t(n[e], e, n)) return e
|
||||||
|
}, m.pick = function(n, t, r) {
|
||||||
|
var e, u, i = {},
|
||||||
|
o = n;
|
||||||
|
if (null == o) return i;
|
||||||
|
m.isFunction(t) ? (u = m.allKeys(o), e = d(t, r)) : (u = k(arguments, !1, !1, 1), e = function(n, t, r) {
|
||||||
|
return t in r
|
||||||
|
}, o = Object(o));
|
||||||
|
for (var a = 0, c = u.length; c > a; a++) {
|
||||||
|
var l = u[a],
|
||||||
|
f = o[l];
|
||||||
|
e(f, l, o) && (i[l] = f)
|
||||||
|
}
|
||||||
|
return i
|
||||||
|
}, m.omit = function(n, t, r) {
|
||||||
|
if (m.isFunction(t)) t = m.negate(t);
|
||||||
|
else {
|
||||||
|
var e = m.map(k(arguments, !1, !1, 1), String);
|
||||||
|
t = function(n, t) {
|
||||||
|
return !m.contains(e, t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m.pick(n, t, r)
|
||||||
|
}, m.defaults = x(m.allKeys, !0), m.clone = function(n) {
|
||||||
|
return m.isObject(n) ? m.isArray(n) ? n.slice() : m.extend({}, n) : n
|
||||||
|
}, m.tap = function(n, t) {
|
||||||
|
return t(n), n
|
||||||
|
}, m.isMatch = function(n, t) {
|
||||||
|
var r = m.keys(t),
|
||||||
|
e = r.length;
|
||||||
|
if (null == n) return !e;
|
||||||
|
for (var u = Object(n), i = 0; e > i; i++) {
|
||||||
|
var o = r[i];
|
||||||
|
if (t[o] !== u[o] || !(o in u)) return !1
|
||||||
|
}
|
||||||
|
return !0
|
||||||
|
};
|
||||||
|
var E = function(n, t, r, e) {
|
||||||
|
if (n === t) return 0 !== n || 1 / n === 1 / t;
|
||||||
|
if (null == n || null == t) return n === t;
|
||||||
|
n instanceof m && (n = n._wrapped), t instanceof m && (t = t._wrapped);
|
||||||
|
var u = f.call(n);
|
||||||
|
if (u !== f.call(t)) return !1;
|
||||||
|
switch (u) {
|
||||||
|
case "[object RegExp]":
|
||||||
|
case "[object String]":
|
||||||
|
return "" + n == "" + t;
|
||||||
|
case "[object Number]":
|
||||||
|
return +n !== +n ? +t !== +t : 0 === +n ? 1 / +n === 1 / t : +n === +t;
|
||||||
|
case "[object Date]":
|
||||||
|
case "[object Boolean]":
|
||||||
|
return +n === +t
|
||||||
|
}
|
||||||
|
var i = "[object Array]" === u;
|
||||||
|
if (!i) {
|
||||||
|
if ("object" != typeof n || "object" != typeof t) return !1;
|
||||||
|
var o = n.constructor,
|
||||||
|
a = t.constructor;
|
||||||
|
if (o !== a && !(m.isFunction(o) && o instanceof o && m.isFunction(a) && a instanceof a) && "constructor" in n && "constructor" in t) return !1
|
||||||
|
}
|
||||||
|
r = r || [], e = e || [];
|
||||||
|
for (var c = r.length; c--;)
|
||||||
|
if (r[c] === n) return e[c] === t;
|
||||||
|
if (r.push(n), e.push(t), i) {
|
||||||
|
if (c = n.length, c !== t.length) return !1;
|
||||||
|
for (; c--;)
|
||||||
|
if (!E(n[c], t[c], r, e)) return !1
|
||||||
|
} else {
|
||||||
|
var l, s = m.keys(n);
|
||||||
|
if (c = s.length, m.keys(t).length !== c) return !1;
|
||||||
|
for (; c--;)
|
||||||
|
if (l = s[c], !m.has(t, l) || !E(n[l], t[l], r, e)) return !1
|
||||||
|
}
|
||||||
|
return r.pop(), e.pop(), !0
|
||||||
|
};
|
||||||
|
m.isEqual = function(n, t) {
|
||||||
|
return E(n, t)
|
||||||
|
}, m.isEmpty = function(n) {
|
||||||
|
return null == n ? !0 : w(n) && (m.isArray(n) || m.isString(n) || m.isArguments(n)) ? 0 === n.length : 0 === m.keys(n).length
|
||||||
|
}, m.isElement = function(n) {
|
||||||
|
return !(!n || 1 !== n.nodeType)
|
||||||
|
}, m.isArray = p || function(n) {
|
||||||
|
return "[object Array]" === f.call(n)
|
||||||
|
}, m.isObject = function(n) {
|
||||||
|
var t = typeof n;
|
||||||
|
return "function" === t || "object" === t && !!n
|
||||||
|
}, m.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(n) {
|
||||||
|
m["is" + n] = function(t) {
|
||||||
|
return f.call(t) === "[object " + n + "]"
|
||||||
|
}
|
||||||
|
}), m.isArguments(arguments) || (m.isArguments = function(n) {
|
||||||
|
return m.has(n, "callee")
|
||||||
|
}), "function" != typeof / . / && "object" != typeof Int8Array && (m.isFunction = function(n) {
|
||||||
|
return "function" == typeof n || !1
|
||||||
|
}), m.isFinite = function(n) {
|
||||||
|
return isFinite(n) && !isNaN(parseFloat(n))
|
||||||
|
}, m.isNaN = function(n) {
|
||||||
|
return m.isNumber(n) && n !== +n
|
||||||
|
}, m.isBoolean = function(n) {
|
||||||
|
return n === !0 || n === !1 || "[object Boolean]" === f.call(n)
|
||||||
|
}, m.isNull = function(n) {
|
||||||
|
return null === n
|
||||||
|
}, m.isUndefined = function(n) {
|
||||||
|
return n === void 0
|
||||||
|
}, m.has = function(n, t) {
|
||||||
|
return null != n && s.call(n, t)
|
||||||
|
}, m.noConflict = function() {
|
||||||
|
return e._ = u, this
|
||||||
|
}, m.identity = function(n) {
|
||||||
|
return n
|
||||||
|
}, m.constant = function(n) {
|
||||||
|
return function() {
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
}, m.noop = function() {}, m.property = function(n) {
|
||||||
|
return function(t) {
|
||||||
|
return null == t ? void 0 : t[n]
|
||||||
|
}
|
||||||
|
}, m.propertyOf = function(n) {
|
||||||
|
return null == n ? function() {} : function(t) {
|
||||||
|
return n[t]
|
||||||
|
}
|
||||||
|
}, m.matcher = m.matches = function(n) {
|
||||||
|
return n = m.extendOwn({}, n),
|
||||||
|
function(t) {
|
||||||
|
return m.isMatch(t, n)
|
||||||
|
}
|
||||||
|
}, m.times = function(n, t, r) {
|
||||||
|
var e = Array(Math.max(0, n));
|
||||||
|
t = d(t, r, 1);
|
||||||
|
for (var u = 0; n > u; u++) e[u] = t(u);
|
||||||
|
return e
|
||||||
|
}, m.random = function(n, t) {
|
||||||
|
return null == t && (t = n, n = 0), n + Math.floor(Math.random() * (t - n + 1))
|
||||||
|
}, m.now = Date.now || function() {
|
||||||
|
return (new Date).getTime()
|
||||||
|
};
|
||||||
|
var M = {
|
||||||
|
"&": "&",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
'"': """,
|
||||||
|
"'": "'",
|
||||||
|
"`": "`"
|
||||||
|
},
|
||||||
|
N = m.invert(M),
|
||||||
|
I = function(n) {
|
||||||
|
var t = function(t) {
|
||||||
|
return n[t]
|
||||||
|
},
|
||||||
|
r = "(?:" + m.keys(n).join("|") + ")",
|
||||||
|
e = RegExp(r),
|
||||||
|
u = RegExp(r, "g");
|
||||||
|
return function(n) {
|
||||||
|
return n = null == n ? "" : "" + n, e.test(n) ? n.replace(u, t) : n
|
||||||
|
}
|
||||||
|
};
|
||||||
|
m.escape = I(M), m.unescape = I(N), m.result = function(n, t, r) {
|
||||||
|
var e = null == n ? void 0 : n[t];
|
||||||
|
return e === void 0 && (e = r), m.isFunction(e) ? e.call(n) : e
|
||||||
|
};
|
||||||
|
var B = 0;
|
||||||
|
m.uniqueId = function(n) {
|
||||||
|
var t = ++B + "";
|
||||||
|
return n ? n + t : t
|
||||||
|
}, m.templateSettings = {
|
||||||
|
evaluate: /<%([\s\S]+?)%>/g,
|
||||||
|
interpolate: /<%=([\s\S]+?)%>/g,
|
||||||
|
escape: /<%-([\s\S]+?)%>/g
|
||||||
|
};
|
||||||
|
var T = /(.)^/,
|
||||||
|
R = {
|
||||||
|
"'": "'",
|
||||||
|
"\\": "\\",
|
||||||
|
"\r": "r",
|
||||||
|
"\n": "n",
|
||||||
|
"\u2028": "u2028",
|
||||||
|
"\u2029": "u2029"
|
||||||
|
},
|
||||||
|
q = /\\|'|\r|\n|\u2028|\u2029/g,
|
||||||
|
K = function(n) {
|
||||||
|
return "\\" + R[n]
|
||||||
|
};
|
||||||
|
m.template = function(n, t, r) {
|
||||||
|
!t && r && (t = r), t = m.defaults({}, t, m.templateSettings);
|
||||||
|
var e = RegExp([(t.escape || T).source, (t.interpolate || T).source, (t.evaluate || T).source].join("|") + "|$", "g"),
|
||||||
|
u = 0,
|
||||||
|
i = "__p+='";
|
||||||
|
n.replace(e, function(t, r, e, o, a) {
|
||||||
|
return i += n.slice(u, a).replace(q, K), u = a + t.length, r ? i += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'" : e ? i += "'+\n((__t=(" + e + "))==null?'':__t)+\n'" : o && (i += "';\n" + o + "\n__p+='"), t
|
||||||
|
}), i += "';\n", t.variable || (i = "with(obj||{}){\n" + i + "}\n"), i = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + i + "return __p;\n";
|
||||||
|
try {
|
||||||
|
var o = new Function(t.variable || "obj", "_", i)
|
||||||
|
} catch (a) {
|
||||||
|
throw a.source = i, a
|
||||||
|
}
|
||||||
|
var c = function(n) {
|
||||||
|
return o.call(this, n, m)
|
||||||
|
},
|
||||||
|
l = t.variable || "obj";
|
||||||
|
return c.source = "function(" + l + "){\n" + i + "}", c
|
||||||
|
}, m.chain = function(n) {
|
||||||
|
var t = m(n);
|
||||||
|
return t._chain = !0, t
|
||||||
|
};
|
||||||
|
var z = function(n, t) {
|
||||||
|
return n._chain ? m(t).chain() : t
|
||||||
|
};
|
||||||
|
m.mixin = function(n) {
|
||||||
|
m.each(m.functions(n), function(t) {
|
||||||
|
var r = m[t] = n[t];
|
||||||
|
m.prototype[t] = function() {
|
||||||
|
var n = [this._wrapped];
|
||||||
|
return c.apply(n, arguments), z(this, r.apply(m, n))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, m.mixin(m), m.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(n) {
|
||||||
|
var t = i[n];
|
||||||
|
m.prototype[n] = function() {
|
||||||
|
var r = this._wrapped;
|
||||||
|
return t.apply(r, arguments), "shift" !== n && "splice" !== n || 0 !== r.length || delete r[0], z(this, r)
|
||||||
|
}
|
||||||
|
}), m.each(["concat", "join", "slice"], function(n) {
|
||||||
|
var t = i[n];
|
||||||
|
m.prototype[n] = function() {
|
||||||
|
return z(this, t.apply(this._wrapped, arguments))
|
||||||
|
}
|
||||||
|
}), m.prototype.value = function() {
|
||||||
|
return this._wrapped
|
||||||
|
}, m.prototype.valueOf = m.prototype.toJSON = m.prototype.value, m.prototype.toString = function() {
|
||||||
|
return "" + this._wrapped
|
||||||
|
}, "function" == typeof define && define.amd && define("underscore", [], function() {
|
||||||
|
return m
|
||||||
|
})
|
||||||
|
return m;
|
||||||
|
});
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
|||||||
|
define('lib/zepto_pj', function(require, exports, module) {
|
||||||
|
var $ = require('lib/zepto');
|
||||||
|
var document = window.document;
|
||||||
|
var docElem = document.documentElement;
|
||||||
|
var origShow = $.fn.show;
|
||||||
|
var origHide = $.fn.hide;
|
||||||
|
var origToggle = $.fn.toggle;
|
||||||
|
|
||||||
|
function anim(el, speed, opacity, scale, callback) {
|
||||||
|
if (typeof speed == 'function' && !callback) callback = speed, speed = undefined
|
||||||
|
var props = {
|
||||||
|
opacity: opacity
|
||||||
|
}
|
||||||
|
if (scale) {
|
||||||
|
props.scale = scale
|
||||||
|
el.css($.fx.cssPrefix + 'transform-origin', '0 0')
|
||||||
|
}
|
||||||
|
return el.animate(props, speed, null, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
function hide(el, speed, scale, callback) {
|
||||||
|
return anim(el, speed, 0, scale, function() {
|
||||||
|
origHide.call($(this))
|
||||||
|
callback && callback.call(this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.show = function(speed, callback) {
|
||||||
|
origShow.call(this)
|
||||||
|
if (speed === undefined) speed = 0
|
||||||
|
else this.css('opacity', 0)
|
||||||
|
return anim(this, speed, 1, '1,1', callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.hide = function(speed, callback) {
|
||||||
|
if (speed === undefined) return origHide.call(this)
|
||||||
|
else return hide(this, speed, '0,0', callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.toggle = function(speed, callback) {
|
||||||
|
if (speed === undefined || typeof speed == 'boolean')
|
||||||
|
return origToggle.call(this, speed)
|
||||||
|
else return this.each(function() {
|
||||||
|
var el = $(this)
|
||||||
|
el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.fadeTo = function(speed, opacity, callback) {
|
||||||
|
return anim(this, speed, opacity, null, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.fadeIn = function(speed, callback) {
|
||||||
|
var target = this.css('opacity')
|
||||||
|
if (target > 0) this.css('opacity', 0)
|
||||||
|
else target = 1
|
||||||
|
return origShow.call(this).fadeTo(speed, target, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.fadeOut = function(speed, callback) {
|
||||||
|
return hide(this, speed, null, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.fadeToggle = function(speed, callback) {
|
||||||
|
return this.each(function() {
|
||||||
|
var el = $(this)
|
||||||
|
el[
|
||||||
|
(el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut'
|
||||||
|
](speed, callback)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return $;
|
||||||
|
});
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
requirejs.config({
|
||||||
|
baseUrl: 'js'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
requirejs([
|
||||||
|
'lib/zepto_pj',
|
||||||
|
'home/map',
|
||||||
|
'lib/underscore',
|
||||||
|
'home/dashboard'
|
||||||
|
],
|
||||||
|
function(zepto_pj, map, underscore) {
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user