This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Lockable = function () { | |
var exports = {}; | |
var _locks = {}; | |
exports.lock = function (name) { | |
_locks[name] = true; | |
}; | |
exports.unlock = function (name) { | |
_locks[name] = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lockable = function (func) { | |
var isLocking = false; | |
var unlock = function () { | |
isLocking = false; | |
}; | |
return function () { | |
var args = arguments; | |
if (isLocking) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
var exports = {}; | |
var _store = {}; | |
var _isReady = false; | |
var _callback = []; | |
var doReady = function () { | |
var i, len; | |
if (_isReady) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require, exports, module) { | |
// Debug: | |
// print: | |
// Debug(name, [withTrace])(obj, [obj, ...]) | |
// enable: | |
// Debug.enable() | |
// disable: | |
// Debug.disable() | |
// Debug.disable(name, [name, ...]) | |
// only: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function () { | |
var loadScript = (function () { | |
var debug = typeof debug !== 'function' ? function (text) { | |
console.log(text); | |
} : debug; | |
var wrapAsync = function (url, doc, win) { | |
debug('load script: (safe and async) ' + url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wait = function (name, context) { | |
context = context || window; | |
var isReady = false; | |
var tasks = []; | |
var when = function (callback) { | |
if (isReady) { | |
return callback(); | |
} | |
return tasks.push(callback); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.whenWechatReady = (function () { | |
var isReady = false; | |
var tasks = []; | |
var when = function (callback) { | |
if (isReady) { | |
return callback(); | |
} | |
return tasks.push(callback); | |
}; | |
document.addEventListener('WeixinJSBridgeReady', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = (function () { | |
var exports = {}; | |
exports.isArray = function (obj) { | |
return obj instanceof Array; | |
}; | |
exports.each = function (list, func) { | |
var i, len; | |
if (exports.isArray(list)) { | |
for (i = 0, len = list.length; i < len; i++) { | |
func(list[i], i, list); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createPullabledScroll = function (iScroll, elem, options) { | |
var scroll, pullDownReady, pullUpReady; | |
// scope variable | |
pullDownReady = false; | |
pullUpReady = false; | |
// setup the scroll object | |
options.probeType = options.probeType || 2; | |
scroll = new iScroll(elem, options); | |
// pullDown | |
if (typeof options.pullDownOffset === 'number') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function (name, definition) { | |
// Check define | |
var hasDefine = typeof define === 'function', | |
// Check exports | |
hasExports = typeof module !== 'undefined' && module.exports; | |
if (hasDefine) { | |
// AMD Module or CMD Module | |
define(definition); | |
} else if (hasExports) { |