diff --git a/libs/skylarkjs/0.9.8/skylarkjs.js b/libs/skylarkjs/0.9.8/skylarkjs.js new file mode 100644 index 000000000..dc43e0895 --- /dev/null +++ b/libs/skylarkjs/0.9.8/skylarkjs.js @@ -0,0 +1,9197 @@ +/** + * skylarkjs - An Elegant JavaScript Library and HTML5 Application Framework. + * @author Hudaokeji Co.,Ltd + * @version v0.9.8 + * @link www.skylarkjs.org + * @license MIT + */ +(function(factory,globals) { + var define = globals.define, + require = globals.require, + isAmd = (typeof define === 'function' && define.amd), + isCmd = (!isAmd && typeof exports !== 'undefined'); + + if (!isAmd && !define) { + var map = {}; + function absolute(relative, base) { + if (relative[0]!==".") { + return relative; + } + var stack = base.split("/"), + parts = relative.split("/"); + stack.pop(); + for (var i=0; i 1) { + return callback ? callback(valueOrPromise) : valueOrPromise; + } else { + return new Deferred().resolve(valueOrPromise); + } + } else if (!nativePromise) { + var deferred = new Deferred(valueOrPromise.cancel); + valueOrPromise.then(deferred.resolve, deferred.reject, deferred.progress); + valueOrPromise = deferred.promise; + } + + if (callback || errback || progback) { + return valueOrPromise.then(callback, errback, progback); + } + return valueOrPromise; + }; + + Deferred.reject = function(err) { + var d = new Deferred(); + d.reject(err); + return d.promise; + }; + + Deferred.resolve = function(data) { + var d = new Deferred(); + d.resolve(data); + return d.promise; + }; + + Deferred.immediate = Deferred.resolve; + + var Evented = createClass({ + on: function(events, selector, data, callback, ctx, /*used internally*/ one) { + var self = this, + _hub = this._hub || (this._hub = {}); + + if (isPlainObject(events)) { + ctx = callback; + each(events, function(type, fn) { + self.on(type, selector, data, fn, ctx, one); + }); + return this; + } + + if (!isString(selector) && !isFunction(callback)) { + ctx = callback; + callback = data; + data = selector; + selector = undefined; + } + + if (isFunction(data)) { + ctx = callback; + callback = data; + data = null; + } + + if (isString(events)) { + events = events.split(/\s/) + } + + events.forEach(function(name) { + (_hub[name] || (_hub[name] = [])).push({ + fn: callback, + selector: selector, + data: data, + ctx: ctx, + one: one + }); + }); + + return this; + }, + + one: function(events, selector, data, callback, ctx) { + return this.on(events, selector, data, callback, ctx, 1); + }, + + trigger: function(e /*,argument list*/ ) { + if (!this._hub) { + return this; + } + + var self = this; + + if (isString(e)) { + e = new CustomEvent(e); + } + + e.target = this; + + var args = slice.call(arguments, 1); + if (isDefined(args)) { + args = [e].concat(args); + } else { + args = [e]; + } + [e.type || e.name, "all"].forEach(function(eventName) { + var listeners = self._hub[eventName]; + if (!listeners) { + return; + } + + var len = listeners.length, + reCompact = false; + + for (var i = 0; i < len; i++) { + var listener = listeners[i]; + if (e.data) { + if (listener.data) { + e.data = mixin({}, listener.data, e.data); + } + } else { + e.data = listener.data || null; + } + listener.fn.apply(listener.ctx, args); + if (listener.one) { + listeners[i] = null; + reCompact = true; + } + } + + if (reCompact) { + self._hub[eventName] = compact(listeners); + } + + }); + return this; + }, + + listened: function(event) { + var evtArr = ((this._hub || (this._events = {}))[event] || []); + return evtArr.length > 0; + }, + + listenTo: function(obj, event, callback, /*used internally*/ one) { + if (!obj) { + return this; + } + + // Bind callbacks on obj, + if (isString(callback)) { + callback = this[callback]; + } + + if (one) { + obj.one(event, callback, this); + } else { + obj.on(event, callback, this); + } + + //keep track of them on listening. + var listeningTo = this._listeningTo || (this._listeningTo = []), + listening; + + for (var i = 0; i < listeningTo.length; i++) { + if (listeningTo[i].obj == obj) { + listening = listeningTo[i]; + break; + } + } + if (!listening) { + listeningTo.push( + listening = { + obj: obj, + events: {} + } + ); + } + var listeningEvents = listening.events, + listeningEvent = listeningEvents[event] = listeningEvents[event] || []; + if (listeningEvent.indexOf(callback) == -1) { + listeningEvent.push(callback); + } + + return this; + }, + + listenToOnce: function(obj, event, callback) { + return this.listenTo(obj, event, callback, 1); + }, + + off: function(events, callback) { + var _hub = this._hub || (this._hub = {}); + if (isString(events)) { + events = events.split(/\s/) + } + + events.forEach(function(name) { + var evts = _hub[name]; + var liveEvents = []; + + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) + liveEvents.push(evts[i]); + } + } + + if (liveEvents.length) { + _hub[name] = liveEvents; + } else { + delete _hub[name]; + } + }); + + return this; + }, + unlistenTo: function(obj, event, callback) { + var listeningTo = this._listeningTo; + if (!listeningTo) { + return this; + } + for (var i = 0; i < listeningTo.length; i++) { + var listening = listeningTo[i]; + + if (obj && obj != listening.obj) { + continue; + } + + var listeningEvents = listening.events; + for (var eventName in listeningEvents) { + if (event && event != eventName) { + continue; + } + + listeningEvent = listeningEvents[eventName]; + + for (var j = 0; j < listeningEvent.length; j++) { + if (!callback || callback == listeningEvent[i]) { + listening.obj.off(eventName, listeningEvent[i], this); + listeningEvent[i] = null; + } + } + + listeningEvent = listeningEvents[eventName] = compact(listeningEvent); + + if (isEmptyObject(listeningEvent)) { + listeningEvents[eventName] = null; + } + + } + + if (isEmptyObject(listeningEvents)) { + listeningTo[i] = null; + } + } + + listeningTo = this._listeningTo = compact(listeningTo); + if (isEmptyObject(listeningTo)) { + this._listeningTo = null; + } + + return this; + } + }); + + + function compact(array) { + return filter.call(array, function(item) { + return item != null; + }); + } + + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase(); + } + + function deserializeValue(value) { + try { + return value ? + value == "true" || + (value == "false" ? false : + value == "null" ? null : + +value + "" == value ? +value : + /^[\[\{]/.test(value) ? JSON.parse(value) : + value) : value; + } catch (e) { + return value; + } + } + + function each(obj, callback) { + var length, key, i, undef, value; + + if (obj) { + length = obj.length; + + if (length === undef) { + // Loop object items + for (key in obj) { + if (obj.hasOwnProperty(key)) { + value = obj[key]; + if (callback.call(value, key, value) === false) { + break; + } + } + } + } else { + // Loop array items + for (i = 0; i < length; i++) { + value = obj[i]; + if (callback.call(value, i, value) === false) { + break; + } + } + } + } + + return this; + } + + function flatten(array) { + if (isArrayLike(array)) { + var result = []; + for (var i = 0; i < array.length; i++) { + var item = array[i]; + if (isArrayLike(item)) { + for (var j = 0; j < item.length; j++) { + result.push(item[j]); + } + } else { + result.push(item); + } + } + return result; + } else { + return array; + } + //return array.length > 0 ? concat.apply([], array) : array; + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg; + } + + var getAbsoluteUrl = (function() { + var a; + + return function(url) { + if (!a) a = document.createElement('a'); + a.href = url; + + return a.href; + }; + })(); + + function getQueryParams(url) { + var url = url || window.location.href, + segs = url.split("?"), + params = {}; + + if (segs.length > 1) { + segs[1].split("&").forEach(function(queryParam) { + var nv = queryParam.split('='); + params[nv[0]] = nv[1]; + }); + } + return params; + } + + function grep(array, callback) { + var out = []; + + each(array, function(i, item) { + if (callback(item, i)) { + out.push(item); + } + }); + + return out; + } + + function inArray(item, array) { + if (!array) { + return -1; + } + var i; + + if (array.indexOf) { + return array.indexOf(item); + } + + i = array.length; + while (i--) { + if (array[i] === item) { + return i; + } + } + + return -1; + } + + function inherit(ctor, base) { + var f = function() {}; + f.prototype = base.prototype; + + ctor.prototype = new f(); + } + + function isArray(object) { + return object && object.constructor === Array; + } + + function isArrayLike(obj) { + return !isString(obj) && !isHtmlNode(obj) && typeof obj.length == 'number'; + } + + function isBoolean(obj) { + return typeof(obj) === "boolean"; + } + + function isDocument(obj) { + return obj != null && obj.nodeType == obj.DOCUMENT_NODE; + } + + + // Internal recursive comparison function for `isEqual`. + var eq, deepEq; + var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; + + eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); + }; + + // Internal recursive comparison function for `isEqual`. + deepEq = function(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + //if (a instanceof _) a = a._wrapped; + //if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + case '[object Symbol]': + return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); + } + + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && + isFunction(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var keys = Object.keys(a), key; + length = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (Object.keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = keys[length]; + if (!(b[key]!==undefined && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + }; + + // Perform a deep comparison to check if two objects are equal. + function isEqual(a, b) { + return eq(a, b); + } + + function isFunction(value) { + return type(value) == "function"; + } + + function isObject(obj) { + return type(obj) == "object"; + } + + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype; + } + + function isString(obj) { + return typeof obj === 'string'; + } + + function isWindow(obj) { + return obj && obj == obj.window; + } + + function isDefined(obj) { + return typeof obj !== 'undefined'; + } + + function isHtmlNode(obj) { + return obj && (obj instanceof Node); + } + + function isNumber(obj) { + return typeof obj == 'number'; + } + + function isSameOrigin(href) { + if (href) { + var origin = location.protocol + '//' + location.hostname; + if (location.port) { + origin += ':' + location.port; + } + return href.startsWith(origin); + } + } + + + function isEmptyObject(obj) { + var name; + for (name in obj) { + if (obj[name] !== null) { + return false; + } + } + return true; + } + + function makeArray(obj, offset, startWith) { + if (isArrayLike(obj) ) { + return (startWith || []).concat(Array.prototype.slice.call(obj, offset || 0)); + } + + // array of single index + return [ obj ]; + } + + function map(elements, callback) { + var value, values = [], + i, key + if (isArrayLike(elements)) + for (i = 0; i < elements.length; i++) { + value = callback.call(elements[i], elements[i], i); + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback.call(elements[key], elements[key], key); + if (value != null) values.push(value) + } + return flatten(values) + } + + function nextTick(fn) { + requestAnimationFrame(fn); + return this; + } + + function proxy(fn, context) { + var args = (2 in arguments) && slice.call(arguments, 2) + if (isFunction(fn)) { + var proxyFn = function() { + return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments); + } + return proxyFn; + } else if (isString(context)) { + if (args) { + args.unshift(fn[context], fn) + return proxy.apply(null, args) + } else { + return proxy(fn[context], fn); + } + } else { + throw new TypeError("expected function"); + } + } + + + function toPixel(value) { + // style values can be floats, client code may want + // to round for integer pixels. + return parseFloat(value) || 0; + } + + var type = (function() { + var class2type = {}; + + // Populate the class2type map + each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type["[object " + name + "]"] = name.toLowerCase(); + }); + + return function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object"; + }; + })(); + + function trim(str) { + return str == null ? "" : String.prototype.trim.call(str); + } + + function removeItem(items, item) { + if (isArray(items)) { + var idx = items.indexOf(item); + if (idx != -1) { + items.splice(idx, 1); + } + } else if (isPlainObject(items)) { + for (var key in items) { + if (items[key] == item) { + delete items[key]; + break; + } + } + } + + return this; + } + + function _mixin(target, source, deep, safe) { + for (var key in source) { + if (!source.hasOwnProperty(key)) { + continue; + } + if (safe && target[key] !== undefined) { + continue; + } + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) { + target[key] = {}; + } + if (isArray(source[key]) && !isArray(target[key])) { + target[key] = []; + } + _mixin(target[key], source[key], deep, safe); + } else if (source[key] !== undefined) { + target[key] = source[key] + } + } + return target; + } + + function _parseMixinArgs(args) { + var params = slice.call(arguments, 0); + target = params.shift(), + deep = false; + if (isBoolean(params[params.length - 1])) { + deep = params.pop(); + } + + return { + target: target, + sources: params, + deep: deep + }; + } + + function mixin() { + var args = _parseMixinArgs.apply(this, arguments); + + args.sources.forEach(function(source) { + _mixin(args.target, source, args.deep, false); + }); + return args.target; + } + + function result(obj, path, fallback) { + if (!isArray(path)) { + path = [path] + }; + var length = path.length; + if (!length) { + return isFunction(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction(prop) ? prop.call(obj) : prop; + } + + return obj; + } + + function safeMixin() { + var args = _parseMixinArgs.apply(this, arguments); + + args.sources.forEach(function(source) { + _mixin(args.target, source, args.deep, true); + }); + return args.target; + } + + function substitute( /*String*/ template, + /*Object|Array*/ + map, + /*Function?*/ + transform, + /*Object?*/ + thisObject) { + // summary: + // Performs parameterized substitutions on a string. Throws an + // exception if any parameter is unmatched. + // template: + // a string with expressions in the form `${key}` to be replaced or + // `${key:format}` which specifies a format function. keys are case-sensitive. + // map: + // hash to search for substitutions + // transform: + // a function to process all parameters before substitution takes + + + thisObject = thisObject || window; + transform = transform ? + proxy(thisObject, transform) : function(v) { + return v; + }; + + function getObject(key, map) { + if (key.match(/\./)) { + var retVal, + getValue = function(keys, obj) { + var _k = keys.pop(); + if (_k) { + if (!obj[_k]) return null; + return getValue(keys, retVal = obj[_k]); + } else { + return retVal; + } + }; + return getValue(key.split(".").reverse(), map); + } else { + return map[key]; + } + } + + return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g, + function(match, key, format) { + var value = getObject(key, map); + if (format) { + value = getObject(format, thisObject).call(thisObject, value, key); + } + return transform(value, key).toString(); + }); // String + } + + + var Stateful = Evented.inherit({ + init : function(attributes, options) { + var attrs = attributes || {}; + options || (options = {}); + this.cid = uniqueId(this.cidPrefix); + this.attributes = {}; + if (options.collection) this.collection = options.collection; + if (options.parse) attrs = this.parse(attrs, options) || {}; + var defaults = result(this, 'defaults'); + attrs = mixin({}, defaults, attrs); + this.set(attrs, options); + this.changed = {}; + }, + + // A hash of attributes whose current and previous value differ. + changed: null, + + // The value returned during the last failed validation. + validationError: null, + + // The default name for the JSON `id` attribute is `"id"`. MongoDB and + // CouchDB users may want to set this to `"_id"`. + idAttribute: 'id', + + // The prefix is used to create the client id which is used to identify models locally. + // You may want to override this if you're experiencing name clashes with model ids. + cidPrefix: 'c', + + + // Return a copy of the model's `attributes` object. + toJSON: function(options) { + return clone(this.attributes); + }, + + + // Get the value of an attribute. + get: function(attr) { + return this.attributes[attr]; + }, + + // Returns `true` if the attribute contains a value that is not null + // or undefined. + has: function(attr) { + return this.get(attr) != null; + }, + + // Set a hash of model attributes on the object, firing `"change"`. This is + // the core primitive operation of a model, updating the data and notifying + // anyone who needs to know about the change in state. The heart of the beast. + set: function(key, val, options) { + if (key == null) return this; + + // Handle both `"key", value` and `{key: value}` -style arguments. + var attrs; + if (typeof key === 'object') { + attrs = key; + options = val; + } else { + (attrs = {})[key] = val; + } + + options || (options = {}); + + // Run validation. + if (!this._validate(attrs, options)) return false; + + // Extract attributes and options. + var unset = options.unset; + var silent = options.silent; + var changes = []; + var changing = this._changing; + this._changing = true; + + if (!changing) { + this._previousAttributes = clone(this.attributes); + this.changed = {}; + } + + var current = this.attributes; + var changed = this.changed; + var prev = this._previousAttributes; + + // For each `set` attribute, update or delete the current value. + for (var attr in attrs) { + val = attrs[attr]; + if (!isEqual(current[attr], val)) changes.push(attr); + if (!isEqual(prev[attr], val)) { + changed[attr] = val; + } else { + delete changed[attr]; + } + unset ? delete current[attr] : current[attr] = val; + } + + // Update the `id`. + if (this.idAttribute in attrs) this.id = this.get(this.idAttribute); + + // Trigger all relevant attribute changes. + if (!silent) { + if (changes.length) this._pending = options; + for (var i = 0; i < changes.length; i++) { + this.trigger('change:' + changes[i], this, current[changes[i]], options); + } + } + + // You might be wondering why there's a `while` loop here. Changes can + // be recursively nested within `"change"` events. + if (changing) return this; + if (!silent) { + while (this._pending) { + options = this._pending; + this._pending = false; + this.trigger('change', this, options); + } + } + this._pending = false; + this._changing = false; + return this; + }, + + // Remove an attribute from the model, firing `"change"`. `unset` is a noop + // if the attribute doesn't exist. + unset: function(attr, options) { + return this.set(attr, void 0, mixin({}, options, {unset: true})); + }, + + // Clear all attributes on the model, firing `"change"`. + clear: function(options) { + var attrs = {}; + for (var key in this.attributes) attrs[key] = void 0; + return this.set(attrs, mixin({}, options, {unset: true})); + }, + + // Determine if the model has changed since the last `"change"` event. + // If you specify an attribute name, determine if that attribute has changed. + hasChanged: function(attr) { + if (attr == null) return !isEmptyObject(this.changed); + return this.changed[attr] !== undefined; + }, + + // Return an object containing all the attributes that have changed, or + // false if there are no changed attributes. Useful for determining what + // parts of a view need to be updated and/or what attributes need to be + // persisted to the server. Unset attributes will be set to undefined. + // You can also pass an attributes object to diff against the model, + // determining if there *would be* a change. + changedAttributes: function(diff) { + if (!diff) return this.hasChanged() ? clone(this.changed) : false; + var old = this._changing ? this._previousAttributes : this.attributes; + var changed = {}; + for (var attr in diff) { + var val = diff[attr]; + if (isEqual(old[attr], val)) continue; + changed[attr] = val; + } + return !isEmptyObject(changed) ? changed : false; + }, + + // Get the previous value of an attribute, recorded at the time the last + // `"change"` event was fired. + previous: function(attr) { + if (attr == null || !this._previousAttributes) return null; + return this._previousAttributes[attr]; + }, + + // Get all of the attributes of the model at the time of the previous + // `"change"` event. + previousAttributes: function() { + return clone(this._previousAttributes); + }, + + // Create a new model with identical attributes to this one. + clone: function() { + return new this.constructor(this.attributes); + }, + + // A model is new if it has never been saved to the server, and lacks an id. + isNew: function() { + return !this.has(this.idAttribute); + }, + + // Check if the model is currently in a valid state. + isValid: function(options) { + return this._validate({}, mixin({}, options, {validate: true})); + }, + + // Run validation against the next complete set of model attributes, + // returning `true` if all is well. Otherwise, fire an `"invalid"` event. + _validate: function(attrs, options) { + if (!options.validate || !this.validate) return true; + attrs = mixin({}, this.attributes, attrs); + var error = this.validationError = this.validate(attrs, options) || null; + if (!error) return true; + this.trigger('invalid', this, error, mixin(options, {validationError: error})); + return false; + } + }); + + var _uid = 1; + + function uid(obj) { + return obj._uid || (obj._uid = _uid++); + } + + function uniq(array) { + return filter.call(array, function(item, idx) { + return array.indexOf(item) == idx; + }) + } + + var idCounter = 0; + function uniqueId (prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + } + + function langx() { + return langx; + } + + mixin(langx, { + after: aspect("after"), + + around: aspect("around"), + + before: aspect("before"), + + camelCase: function(str) { + return str.replace(/-([\da-z])/g, function(a) { + return a.toUpperCase().replace('-', ''); + }); + }, + clone: clone, + + compact: compact, + + createEvent : createEvent, + + dasherize: dasherize, + + debounce: debounce, + + delegate: delegate, + + Deferred: Deferred, + + Evented: Evented, + + deserializeValue: deserializeValue, + + each: each, + + flatten: flatten, + + funcArg: funcArg, + + getQueryParams: getQueryParams, + + inArray: inArray, + + isArray: isArray, + + isArrayLike: isArrayLike, + + isBoolean: isBoolean, + + isDefined: function(v) { + return v !== undefined; + }, + + isDocument: isDocument, + + isEmptyObject: isEmptyObject, + + isEqual: isEqual, + + isFunction: isFunction, + + isHtmlNode: isHtmlNode, + + isObject: isObject, + + isPlainObject: isPlainObject, + + isNumber: isNumber, + + isString: isString, + + isSameOrigin: isSameOrigin, + + isWindow: isWindow, + + klass: function(props, parent, options) { + return createClass(props, parent, options); + }, + + lowerFirst: function(str) { + return str.charAt(0).toLowerCase() + str.slice(1); + }, + + makeArray: makeArray, + + map: map, + + mixin: mixin, + + nextTick: nextTick, + + proxy: proxy, + + removeItem: removeItem, + + result : result, + + returnTrue: function() { + return true; + }, + + returnFalse: function() { + return false; + }, + + safeMixin: safeMixin, + + serializeValue: function(value) { + return JSON.stringify(value) + }, + + Stateful: Stateful, + + substitute: substitute, + + toPixel: toPixel, + + trim: trim, + + type: type, + + uid: uid, + + uniq: uniq, + + uniqueId: uniqueId, + + upperFirst: function(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }, + + URL: window.URL || window.webkitURL + + }); + + return skylark.langx = langx; +}); +/** + * skylark-router - An Elegant HTML5 Routing Framework. + * @author Hudaokeji Co.,Ltd + * @version v0.9.6-beta + * @link www.skylarkjs.org + * @license MIT + */ +define('skylark-router/router',[ + "skylark-langx/skylark", + "skylark-langx/langx" +], function(skylark, langx) { + + var _curCtx, + _prevCtx, + _baseUrl, + _homePath, + _routes = {}, + _cache = {}, + _hub = new langx.Evented(); + + function createEvent(type,props) { + var e = new CustomEvent(type,props); + return langx.safeMixin(e, props); + } + + var Route = langx.Evented.inherit({ + klassName: "Route", + init: function(name, setting) { + setting = langx.mixin({}, setting); + var pathto = setting.pathto || "", + pattern = pathto, + paramNames = pattern.match(/\:([a-zA-Z0-9_]+)/g); + if (paramNames !== null) { + paramNames = paramNames.map(function(paramName) { + return paramName.substring(1); + }); + pattern = pattern.replace(/\:([a-zA-Z0-9_]+)/g, '(.*?)'); + } else { + paramNames = []; + } + if (pattern === "*") { + pattern = "(.*)"; + } else { + pattern = pattern.replace("/", "\\/"); + } + + this._setting = setting; + this.name = name; + this.pathto = pathto; + this.paramNames = paramNames; + this.params = pattern; + this.regex = new RegExp("^" + pattern + "$", ""); + + var self = this; + ["entering", "entered", "exiting", "exited"].forEach(function(eventName) { + if (langx.isFunction(setting[eventName])) { + self.on(eventName, setting[eventName]); + } + }); + }, + + enter: function(ctx,query) { + if (query) { + var r = this._entering(ctx), + self = this; + + return langx.Deferred.when(r).then(function(){ + var e = createEvent("entering", { + route: self, + result: true + }); + + self.trigger(e); + + return e.result; + }); + } else { + this._entered(ctx); + + this.trigger(createEvent("entered", langx.safeMixin({ + route: this + }, ctx))); + return this; + } + }, + + exit: function(ctx, query) { + if (query) { + var ok = this._exiting(ctx); + if (!ok) { + return false; + } + + var e = createEvent("exiting", { + route: this, + result: true + }); + + this.trigger(e); + + return e.result; + } else { + this._exited(ctx); + this.trigger(createEvent("exited", langx.safeMixin({ + route: this + }, ctx))); + + return this; + } + }, + + match: function(path) { + var names = this.paramNames, + x = path.indexOf('?'), + path = ~x ? path.slice(0, x) : decodeURIComponent(path), + m = this.regex.exec(path); + + if (!m) { + return false + }; + + var params = {}; + for (var i = 1, len = m.length; i < len; ++i) { + var name = names[i - 1], + val = decodeURIComponent(m[i]); + params[name] = val; + } + + return params; + }, + + path: function(params) { + var path = this.pathto; + if (params) { + path = path.replace(/:([a-zA-Z0-9_]+)/g, function(match, paramName) { + return params[paramName]; + }); + } + return path; + }, + + _entering: function(ctx) { + return true; + }, + _entered: function(ctx) { + return true; + }, + _exiting: function(ctx) { + return true; + }, + _exited: function(ctx) { + return true; + }, + }); + + function current() { + return _curCtx; + } + + // refresh the current route + function dispatch(ctx) { + + if (_curCtx) { + var ret = _curCtx.route.exit({ + path: _curCtx.path, + params: _curCtx.params + }, true); + if (!ret) { + return; + } + } + + _prevCtx = _curCtx; + _curCtx = ctx; + if (!_curCtx.route) { + var m = map(_curCtx.path); + _curCtx.route = m.route; + _curCtx.params = m.params; + } + + var r = _curCtx.route.enter({ + force: _curCtx.force, + path: _curCtx.path, + params: _curCtx.params + },true); + + langx.Deferred.when(r).then(function() { + _hub.trigger(createEvent("routing", { + current: _curCtx, + previous: _prevCtx + })); + + _curCtx.route.enter({ + path: _curCtx.path, + params: _curCtx.params + },false); + + if (_prevCtx) { + _prevCtx.route.exit({ + path: _prevCtx.path, + params: _prevCtx.params + }, false); + } + + _hub.trigger(createEvent("routed", { + current: _curCtx, + previous: _prevCtx + })); + }); + } + + function go(path, force) { + if (!force && _curCtx && _curCtx.path == path) { + return false; + } + var ctx = map(path); + if (ctx) { + ctx.path = path; + + if (router.useHistoryApi) { + var state = { + force: force, + path: path + } + + window.history.pushState(state, document.title, (_baseUrl + path).replace("//", "/")); + window.dispatchEvent(createEvent("popstate", { + state: state + })); + } else if (router.useHashbang) { + var newHash = "#!" + path; + if (window.location.hash !== newHash) { + window.location.hash = newHash; + } else { + dispatch(ctx); + }; + } else { + dispatch(ctx); + } + } + return true; + } + + function map(path, noCache) { + var finded = false; + if (!noCache) { + finded = _cache[path]; + if (finded) { + return finded; + } + } + langx.each(_routes, function(name, route) { + var ret = route.match(path); + if (ret) { + finded = { + route: route, + params: ret + } + return false; + } + return true; + }); + if (finded && !noCache) { + _cache[path] = finded; + } + return finded; + } + + function path(routeName, params) { + var route = _routes[routeName], + path; + if (route) { + path = route.path(params); + } + return path; + } + + function previous() { + return _prevCtx; + } + + function baseUrl(path) { + if (langx.isDefined(path)) { + _baseUrl = path; + return this; + } else { + return _baseUrl; + } + } + + function hub(){ + return _hub; + } + + function homePath(path) { + if (langx.isDefined(path)) { + _homePath = path; + return this; + } else { + return _homePath; + } + } + + function route(name, setting) { + if (langx.isDefined(setting)) { + var settings = {}; + settings[name] = setting; + routes(settings); + return this; + } else { + return _routes[name]; + } + } + + function routes(settings) { + if (!langx.isDefined(settings)) { + return langx.mixin({}, _routes); + } else { + for (var name in settings) { + _routes[name] = new router.Route(name, settings[name]); + } + } + } + + //starts routing urls + function start() { + if (router.useHashbang == null && router.useHistoryApi == null) { + if (window.location.host && window.history.pushState) { + //web access + router.useHistoryApi = true; + } else { + // local access + router.useHashbang = true; + } + } + + var initPath = ""; + + if (router.useHistoryApi) { + initPath = window.location.pathname; + if (_baseUrl === undefined) { + _baseUrl = initPath.replace(/\/$/, ""); + } + initPath = initPath.replace(_baseUrl, "") || _homePath || "/"; + } else if (router.useHashbang) { + initPath = window.location.hash.replace("#!", "") || _homePath || "/"; + } else { + initPath = "/"; + } + + if (!initPath.startsWith("/")) { + initPath = "/" + initPath; + } + /* + eventer.on(document.body, "click", "a[href]", function(e) { + var elm = e.currentTarget, + url = elm.getAttribute("href"); + + if (url == "#") { + return; + } + if (url && langx.isSameOrigin(elm.href)) { + if (url.indexOf(_baseUrl) === 0) { + url = url.substr(_baseUrl.length); + eventer.stop(e); + url = url.replace('#!', ''); + go(url); + } + } + }); + */ + if (router.useHistoryApi) { + window.addEventListener("popstate", function(e) { + if(e.state) dispatch(e.state); + e.preventDefault(); + }); + } else if (router.useHashbang) { + window.addEventListener("hashchange", function(e) { + dispatch({ + path: window.location.hash.replace(/^#!/, "") + }); + e.preventDefault(); + }); + } + + go(initPath); + } + + var router = function() { + return router; + }; + + langx.mixin(router, { + "Route": Route, + + // Current path being processed + "current": current, + + // Changes the current path + "go": go, + + "map": map, + + "hub": hub, + + "off": function() { + _hub.off.apply(_hub, arguments); + }, + + "on": function() { + _hub.on.apply(_hub, arguments); + }, + + "one": function() { + _hub.one.apply(_hub, arguments); + }, + + // Returns the path of the named route + "path": path, + + "previous": previous, + + "baseUrl": baseUrl, + + "homePath": homePath, + + "route": route, + + "routes": routes, + + //starts routing urls + "start": start, + + "trigger": function(e) { + _hub.trigger(e); + return this; + }, + + "useHistoryApi": null, + "useHashbang": null + }); + + return skylark.router = router; +}); + +define('skylarkjs/router',[ + "skylark-router/router" +], function(router) { + return router; +}); + +define('skylark-spa/spa',[ + "skylark-langx/skylark", + "skylark-langx/langx", + "skylark-router/router" +], function(skylark, langx, router) { + var Deferred = langx.Deferred; + + function createEvent(type, props) { + var e = new CustomEvent(type, props); + return langx.safeMixin(e, props); + } + + var Route = router.Route = router.Route.inherit({ + klassName: "SpaRoute", + + init: function(name, setting) { + this.overrided(name, setting); + this.content = setting.content; + this.forceRefresh = setting.forceRefresh; + this.data = setting.data; + //this.lazy = !!setting.lazy; + var self = this; + ["preparing", "rendering", "rendered"].forEach(function(eventName) { + if (langx.isFunction(setting[eventName])) { + self.on(eventName, setting[eventName]); + } + }); + }, + + _entering: function(ctx) { + if (this.forceRefresh || ctx.force || !this._prepared) { + return this.prepare(); + } + return this; + }, + + getConfigData: function(key) { + return key ? this.data[key] : this.data; + }, + + getNamedValue: function() { + return window.location.pathname.match(this.regex); + }, + + prepare: function() { + var d = new Deferred(), + setting = this._setting, + controllerSetting = setting.controller, + controller = this.controller, + + self = this, + content = setting.content, + contentPath = setting.contentPath; + + require([controllerSetting.type], function(type) { + controller = self.controller = new type(controllerSetting); + d.resolve(); + }); + + return d.then(function() { + var e = createEvent("preparing", { + route: self, + result: true + }); + self.trigger(e); + return Deferred.when(e.result).then(function() { + self._prepared = true; + }); + }); + }, + + render: function(ctx) { + var e = createEvent("rendering", { + route: this, + context: ctx, + content: this.content + }); + this.trigger(e); + return e.content; + }, + + trigger: function(e) { + var controller = this.controller; + if (controller) { + return controller.perform(e); + } else { + return this.overrided(e); + } + } + }); + + var RouteController = langx.Evented.inherit({ + klassName: "SpaRouteController", + + init: function(route, setting) { + setting = setting || {}; + this.content = setting.content; + this.data = setting.data; + }, + + getConfigData: function(key) { + return key ? this.data[key] : this.data; + }, + + perform: function(e) { + var eventName = e.type; + if (this[eventName]) { + return this[eventName].call(this, e); + } + + } + }); + + var Page = langx.Evented.inherit({ + klassName: "SpaPage", + + init: function(params) { + params = langx.mixin({ + "routeViewer": "body" + }, params); + + this._params = params; + this._rvc = document.querySelector(params.routeViewer); + this._router = router; + + router.on("routed", langx.proxy(this, "refresh")); + }, + + prepare: function() { + + }, + + //Refreshes the route + refresh: function() { + var curCtx = router.current(), + prevCtx = router.previous(); + var content = curCtx.route.render(curCtx); + if (content===undefined || content===null) { + return; + } + if (langx.isString(content)) { + this._rvc.innerHTML = content; + } else { + this._rvc.innerHTML = ""; + this._rvc.appendChild(content); + } + curCtx.route.trigger(createEvent("rendered", { + route: curCtx.route, + content: content + })); + } + }); + + var Plugin = langx.Evented.inherit({ + klassName: "SpaPlugin", + + init: function(name, setting) { + this.name = name; + + if (langx.isString(setting.hookers)) { + setting.hookers = setting.hookers.split(" "); + } + this._setting = setting; + }, + + isHooked: function(eventName) { + var hookers = this._setting.hookers || []; + return hookers.indexOf(eventName) > -1; + }, + + prepare: function() { + var d = new Deferred(), + setting = this._setting, + controllerSetting = setting.controller, + controller = this.controller, + self = this; + require([controllerSetting.type], function(type) { + controller = self.controller = new type(controllerSetting); + router.on(setting.hookers, { + plugin: self + }, langx.proxy(controller.perform, controller)); + d.resolve(); + }); + return d.then(function() { + var e = createEvent("preparing", { + plugin: self, + result: true + }); + self.trigger(e); + return Deferred.when(e.result).then(function() { + self._prepared = true; + }); + }); + }, + + trigger: function(e) { + var controller = this.controller; + if (controller) { + return controller.perform(e); + } else { + return this.overrided(e); + } + } + }); + + var PluginController = langx.Evented.inherit({ + klassName: "SpaPluginController", + + init: function(plugin) { + this.plugin = plugin; + }, + + perform: function(e) { + var eventName = e.type; + if (this[eventName]) { + return this[eventName].call(this, e); + } + + } + }); + + var Application = langx.Evented.inherit({ + klassName: "SpaApplication", + + init: function(config) { + if (app) { + return app; + } + var plugins = this._plugins = {}; + + config = this._config = langx.mixin({ + plugins: {} + }, config, true); + + langx.each(config.plugins, function(pluginName, setting) { + plugins[pluginName] = new Plugin(pluginName, setting); + }); + + router.routes(config.routes); + + this._router = router; + + this._page = new spa.Page(config.page); + + document.title = config.title; + var baseUrl = config.baseUrl; + if (baseUrl === undefined) { + baseUrl = config.baseUrl = (new langx.URL(document.baseURI)).pathname; + } + router.baseUrl(baseUrl); + + if (config.homePath) { + router.homePath(config.homePath); + } + + app = this; + }, + + getConfig: function(key) { + return key ? this._config[key] : this._config; + }, + + go: function(path, force) { + router.go(path, force); + return this; + }, + + page: function() { + return this._page; + }, + + prepare: function() { + if (this._prepared) { + return Deferred.resolve(); + } + var self = this; + + var promises0 = langx.map(this._plugins, function(plugin, name) { + if (plugin.isHooked("starting")) { + return plugin.prepare(); + } + }); + + return Deferred.all(promises0).then(function() { + router.trigger(createEvent("starting", { + spa: self + })); + var promises1 = langx.map(router.routes(), function(route, name) { + if (route.lazy === false) { + return route.prepare(); + } + }), + promises2 = langx.map(self._plugins, function(plugin, name) { + if (!plugin.isHooked("starting")) { + return plugin.prepare(); + } + }); + + + return Deferred.all(promises1.concat(promises2)).then(function() { + self._prepared = true; + }); + }); + }, + + run: function() { + this._router.start(); + router.trigger(createEvent("started", { + spa: this + })); + } + }); + + var app; + var spa = function(config) { + if (!app) { + window[config.name || "app"] = app = new spa.Application(config); + } + + return app; + } + + langx.mixin(spa, { + "Application": Application, + + "Page": Page, + + "Plugin": Plugin, + "PluginController": PluginController, + + "Route": Route, + "RouteController": RouteController + + }); + + return skylark.spa = spa; +}); + +define('skylarkjs/spa',[ + "skylark-spa/spa" +], function(spa) { + return spa; +}); + +define('skylarkjs/langx',[ + "skylark-langx/langx" +], function(langx) { + return langx; +}); + +define('skylarkjs/core',[ + "./skylark", + "./router", + "./spa", + "./langx" +], function(skylark) { + return skylark; +}) +; +define('skylark-utils/langx',[ + "skylark-langx/langx" +], function(langx) { + return langx; +}); + +define('skylark-utils/browser',[ + "./skylark", + "./langx" +], function(skylark,langx) { + var checkedCssProperties = { + "transitionproperty": "TransitionProperty", + }; + + var css3PropPrefix = "", + css3StylePrefix = "", + css3EventPrefix = "", + + cssStyles = {}, + cssProps = {}, + + vendorPrefix, + vendorPrefixRE, + vendorPrefixesRE = /^(Webkit|webkit|O|Moz|moz|ms)(.*)$/, + + document = window.document, + testEl = document.createElement("div"), + + matchesSelector = testEl.webkitMatchesSelector || + testEl.mozMatchesSelector || + testEl.oMatchesSelector || + testEl.matchesSelector, + + testStyle = testEl.style; + + for (var name in testStyle) { + var matched = name.match(vendorPrefixRE || vendorPrefixesRE); + if (matched) { + if (!vendorPrefixRE) { + vendorPrefix = matched[1]; + vendorPrefixRE = new RegExp("^(" + vendorPrefix + ")(.*)$"); + + css3StylePrefix = vendorPrefix; + css3PropPrefix = '-' + vendorPrefix.toLowerCase() + '-'; + css3EventPrefix = vendorPrefix.toLowerCase(); + } + + cssStyles[langx.lowerFirst(matched[2])] = name; + var cssPropName = langx.dasherize(matched[2]); + cssProps[cssPropName] = css3PropPrefix + cssPropName; + + } + } + + + function normalizeCssEvent(name) { + return css3EventPrefix ? css3EventPrefix + name : name.toLowerCase(); + } + + function normalizeCssProperty(name) { + return cssProps[name] || name; + } + + function normalizeStyleProperty(name) { + return cssStyles[name] || name; + } + + function browser() { + return browser; + } + + langx.mixin(browser, { + css3PropPrefix: css3PropPrefix, + + normalizeStyleProperty: normalizeStyleProperty, + + normalizeCssProperty: normalizeCssProperty, + + normalizeCssEvent: normalizeCssEvent, + + matchesSelector: matchesSelector, + + location: function() { + return window.location; + }, + + support : {} + + }); + + testEl = null; + + return skylark.browser = browser; +}); + +define('skylarkjs/browser',[ + "skylark-utils/browser" +], function(browser) { + return browser; +}); + +define('skylark-utils/styler',[ + "./skylark", + "./langx" +], function(skylark, langx) { + var every = Array.prototype.every, + forEach = Array.prototype.forEach, + camelCase = langx.camelCase, + dasherize = langx.dasherize; + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + var cssNumber = { + 'column-count': 1, + 'columns': 1, + 'font-weight': 1, + 'line-height': 1, + 'opacity': 1, + 'z-index': 1, + 'zoom': 1 + }, + classReCache = { + + }; + + function classRE(name) { + return name in classReCache ? + classReCache[name] : (classReCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')); + } + + // access className property while respecting SVGAnimatedString + function className(node, value) { + var klass = node.className || '', + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + + var elementDisplay = {}; + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function show(elm) { + styler.css(elm, "display", ""); + if (styler.css(elm, "display") == "none") { + styler.css(elm, "display", defaultDisplay(elm.nodeName)); + } + return this; + } + + function isInvisible(elm) { + return styler.css(elm, "display") == "none" || styler.css(elm, "opacity") == 0; + } + + function hide(elm) { + styler.css(elm, "display", "none"); + return this; + } + + function addClass(elm, name) { + if (!name) return this + var cls = className(elm), + names; + if (langx.isString(name)) { + names = name.split(/\s+/g); + } else { + names = name; + } + names.forEach(function(klass) { + var re = classRE(klass); + if (!cls.match(re)) { + cls += (cls ? " " : "") + klass; + } + }); + + className(elm, cls); + + return this; + } + + function css(elm, property, value) { + if (arguments.length < 3) { + var computedStyle, + computedStyle = getComputedStyle(elm, '') + if (langx.isString(property)) { + return elm.style[camelCase(property)] || computedStyle.getPropertyValue(property) + } else if (langx.isArrayLike(property)) { + var props = {} + forEach.call(property, function(prop) { + props[prop] = (elm.style[camelCase(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = ''; + if (typeof(property) == 'string') { + if (!value && value !== 0) { + elm.style.removeProperty(dasherize(property)); + } else { + css = dasherize(property) + ":" + maybeAddPx(property, value) + } + } else { + for (key in property) { + if (property[key] === undefined) { + continue; + } + if (!property[key] && property[key] !== 0) { + elm.style.removeProperty(dasherize(key)); + } else { + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + } + } + + elm.style.cssText += ';' + css; + return this; + } + + + function hasClass(elm, name) { + var re = classRE(name); + return elm.className && elm.className.match(re); + } + + function removeClass(elm, name) { + if (name) { + var cls = className(elm), + names; + + if (langx.isString(name)) { + names = name.split(/\s+/g); + } else { + names = name; + } + + names.forEach(function(klass) { + var re = classRE(klass); + if (cls.match(re)) { + cls = cls.replace(re, " "); + } + }); + + className(elm, cls.trim()); + } else { + className(elm,""); + } + + return this; + } + + function toggleClass(elm, name, when) { + var self = this; + name.split(/\s+/g).forEach(function(klass) { + if (when === undefined) { + when = !self.hasClass(elm, klass); + } + if (when) { + self.addClass(elm, klass); + } else { + self.removeClass(elm, klass) + } + }); + + return self; + } + + var styler = function() { + return styler; + }; + + langx.mixin(styler, { + autocssfix: true, + cssHooks : { + + }, + + addClass: addClass, + className: className, + css: css, + hasClass: hasClass, + hide: hide, + isInvisible: isInvisible, + removeClass: removeClass, + show: show, + toggleClass: toggleClass + }); + + return skylark.styler = styler; +}); + +define('skylark-utils/noder',[ + "./skylark", + "./langx", + "./styler" +], function(skylark, langx, styler) { + var isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g), + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + div = document.createElement("div"), + table = document.createElement('table'), + tableBody = document.createElement('tbody'), + tableRow = document.createElement('tr'), + containers = { + 'tr': tableBody, + 'tbody': table, + 'thead': table, + 'tfoot': table, + 'td': tableRow, + 'th': tableRow, + '*': div + }, + rootNodeRE = /^(?:body|html)$/i, + map = Array.prototype.map, + slice = Array.prototype.slice; + + function ensureNodes(nodes, copyByClone) { + if (!langx.isArrayLike(nodes)) { + nodes = [nodes]; + } + if (copyByClone) { + nodes = map.call(nodes, function(node) { + return node.cloneNode(true); + }); + } + return langx.flatten(nodes); + } + + function nodeName(elm, chkName) { + var name = elm.nodeName && elm.nodeName.toLowerCase(); + if (chkName !== undefined) { + return name === chkName.toLowerCase(); + } + return name; + }; + + function contents(elm) { + if (nodeName(elm, "iframe")) { + return elm.contentDocument; + } + return elm.childNodes; + } + + function html(node, html) { + if (html === undefined) { + return node.innerHTML; + } else { + this.empty(node); + html = html || ""; + if (langx.isString(html) || langx.isNumber(html)) { + node.innerHTML = html; + } else if (langx.isArrayLike(html)) { + for (var i = 0; i < html.length; i++) { + node.appendChild(html[i]); + } + } else { + node.appendChild(html); + } + } + } + + function clone(node, deep) { + var self = this, + clone; + + // TODO: Add feature detection here in the future + if (!isIE || node.nodeType !== 1 || deep) { + return node.cloneNode(deep); + } + + // Make a HTML5 safe shallow copy + if (!deep) { + clone = document.createElement(node.nodeName); + + // Copy attribs + each(self.getAttribs(node), function(attr) { + self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName)); + }); + + return clone; + } + } + + function createElement(tag, props,parent) { + var node = document.createElement(tag); + if (props) { + for (var name in props) { + node.setAttribute(name, props[name]); + } + } + if (parent) { + append(parent,node); + } + return node; + } + + function createFragment(html) { + // A special case optimization for a single tag + html = langx.trim(html); + if (singleTagRE.test(html)) { + return [createElement(RegExp.$1)]; + } + + var name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) { + name = "*" + } + var container = containers[name]; + container.innerHTML = "" + html; + dom = slice.call(container.childNodes); + + dom.forEach(function(node) { + container.removeChild(node); + }) + + return dom; + } + + function contains(node, child) { + return isChildOf(child, node); + } + + function createTextNode(text) { + return document.createTextNode(text); + } + + function doc() { + return document; + } + + function empty(node) { + while (node.hasChildNodes()) { + var child = node.firstChild; + node.removeChild(child); + } + return this; + } + + function isChildOf(node, parent,directly) { + if (directly) { + return node.parentNode === parent; + } + if (document.documentElement.contains) { + return parent.contains(node); + } + while (node) { + if (parent === node) { + return true; + } + + node = node.parentNode; + } + + return false; + } + + function isDoc(node) { + return node != null && node.nodeType == node.DOCUMENT_NODE + } + + function ownerDoc(elm) { + if (!elm) { + return document; + } + + if (elm.nodeType == 9) { + return elm; + } + + return elm.ownerDocument; + } + + function ownerWindow(elm) { + var doc = ownerDoc(elm); + return doc.defaultView || doc.parentWindow; + } + + function after(node, placing, copyByClone) { + var refNode = node, + parent = refNode.parentNode; + if (parent) { + var nodes = ensureNodes(placing, copyByClone), + refNode = refNode.nextSibling; + + for (var i = 0; i < nodes.length; i++) { + if (refNode) { + parent.insertBefore(nodes[i], refNode); + } else { + parent.appendChild(nodes[i]); + } + } + } + return this; + } + + function before(node, placing, copyByClone) { + var refNode = node, + parent = refNode.parentNode; + if (parent) { + var nodes = ensureNodes(placing, copyByClone); + for (var i = 0; i < nodes.length; i++) { + parent.insertBefore(nodes[i], refNode); + } + } + return this; + } + + function prepend(node, placing, copyByClone) { + var parentNode = node, + refNode = parentNode.firstChild, + nodes = ensureNodes(placing, copyByClone); + for (var i = 0; i < nodes.length; i++) { + if (refNode) { + parentNode.insertBefore(nodes[i], refNode); + } else { + parentNode.appendChild(nodes[i]); + } + } + return this; + } + + function append(node, placing, copyByClone) { + var parentNode = node, + nodes = ensureNodes(placing, copyByClone); + for (var i = 0; i < nodes.length; i++) { + parentNode.appendChild(nodes[i]); + } + return this; + } + + function overlay(elm, params) { + var overlayDiv = createElement("div", params); + styler.css(overlayDiv, { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + zIndex: 0x7FFFFFFF, + opacity: 0.7 + }); + elm.appendChild(overlayDiv); + return overlayDiv; + + } + + + + function remove(node) { + if (node && node.parentNode) { + try { + node.parentNode.removeChild(node); + } catch (e) { + console.warn("The node is already removed",e); + } + } + return this; + } + + function replace(node, oldNode) { + oldNode.parentNode.replaceChild(node, oldNode); + return this; + } + + function throb(elm, params) { + params = params || {}; + var self = this, + text = params.text, + style = params.style, + time = params.time, + callback = params.callback, + timer, + throbber = this.createElement("div", { + className: params.className || "throbber", + style: style + }), + _overlay = overlay(throbber, { + className: 'overlay fade' + }), + throb = this.createElement("div", { + className: "throb" + }), + textNode = this.createTextNode(text || ""), + remove = function() { + if (timer) { + clearTimeout(timer); + timer = null; + } + if (throbber) { + self.remove(throbber); + throbber = null; + } + }, + update = function(params) { + if (params && params.text && throbber) { + textNode.nodeValue = params.text; + } + }; + throb.appendChild(textNode); + throbber.appendChild(throb); + elm.appendChild(throbber); + var end = function() { + remove(); + if (callback) callback(); + }; + if (time) { + timer = setTimeout(end, time); + } + + return { + remove: remove, + update: update + }; + } + + function traverse(node, fn) { + fn(node) + for (var i = 0, len = node.childNodes.length; i < len; i++) { + traverse(node.childNodes[i], fn); + } + return this; + } + + function reverse(node) { + var firstChild = node.firstChild; + for (var i = node.children.length - 1; i > 0; i--) { + if (i > 0) { + var child = node.children[i]; + node.insertBefore(child, firstChild); + } + } + } + + function wrapper(node, wrapperNode) { + if (langx.isString(wrapperNode)) { + wrapperNode = this.createFragment(wrapperNode).firstChild; + } + node.parentNode.insertBefore(wrapperNode, node); + wrapperNode.appendChild(node); + } + + function wrapperInner(node, wrapperNode) { + var childNodes = slice.call(node.childNodes); + node.appendChild(wrapperNode); + for (var i = 0; i < childNodes.length; i++) { + wrapperNode.appendChild(childNodes[i]); + } + return this; + } + + function unwrap(node) { + var child, parent = node.parentNode; + if (parent) { + if (this.isDoc(parent.parentNode)) return; + parent.parentNode.insertBefore(node, parent); + } + } + + function noder() { + return noder; + } + + langx.mixin(noder, { + clone: clone, + contents: contents, + + createElement: createElement, + + createFragment: createFragment, + + contains: contains, + + createTextNode: createTextNode, + + doc: doc, + + empty: empty, + + html: html, + + isChildOf: isChildOf, + + isDoc: isDoc, + + ownerDoc: ownerDoc, + + ownerWindow : ownerWindow, + + after: after, + + before: before, + + prepend: prepend, + + append: append, + + remove: remove, + + replace: replace, + + throb: throb, + + traverse: traverse, + + reverse: reverse, + + wrapper: wrapper, + + wrapperInner: wrapperInner, + + unwrap: unwrap + }); + + return skylark.noder = noder; +}); + +define('skylark-utils/css',[ + "./skylark", + "./langx", + "./noder" +], function(skylark, langx, construct) { + + var head = document.getElementsByTagName("head")[0], + count = 0, + sheetsByUrl = {}, + sheetElementsById = {}, + defaultSheetId = _createStyleSheet(), + defaultSheet = sheetElementsById[defaultSheetId], + rulesPropName = ("cssRules" in defaultSheet) ? "cssRules" : "rules", + insertRuleFunc, + deleteRuleFunc = defaultSheet.deleteRule || defaultSheet.removeRule; + + if (defaultSheet.insertRule) { + var _insertRule = defaultSheet.insertRule; + insertRuleFunc = function(selector, css, index) { + _insertRule.call(this, selector + "{" + css + "}", index); + }; + } else { + insertRuleFunc = defaultSheet.addRule; + } + + function normalizeSelector(selectorText) { + var selector = [], + last, len; + last = defaultSheet[rulesPropName].length; + insertRuleFunc.call(defaultSheet, selectorText, ';'); + len = defaultSheet[rulesPropName].length; + for (var i = len - 1; i >= last; i--) { + selector.push(_sheet[_rules][i].selectorText); + deleteRuleFunc.call(defaultSheet, i); + } + return selector.reverse().join(', '); + } + + function _createStyleSheet() { + var link = document.createElement("link"), + id = (count++); + + link.rel = "stylesheet"; + link.type = "text/css"; + link.async = false; + link.defer = false; + + head.appendChild(link); + sheetElementsById[id] = link; + + return id; + } + + function css() { + return css; + } + + langx.mixin(css, { + createStyleSheet: function(cssText) { + return _createStyleSheet(); + }, + + loadStyleSheet: function(url, loadedCallback, errorCallback) { + var sheet = sheetsByUrl[url]; + if (!sheet) { + sheet = sheetsByUrl[url] = { + state: 0, //0:unload,1:loaded,-1:loaderror + loadedCallbacks: [], + errorCallbacks: [] + }; + } + + sheet.loadedCallbacks.push(loadedCallback); + sheet.errorCallbacks.push(errorCallback); + + if (sheet.state === 1) { + sheet.node.onload(); + } else if (sheet.state === -1) { + sheet.node.onerror(); + } else { + sheet.id = _createStyleSheet(); + var node = sheet.node = sheetElementsById[sheet.id]; + + startTime = new Date().getTime(); + + node.onload = function() { + sheet.state = 1; + sheet.state = -1; + var callbacks = sheet.loadedCallbacks, + i = callbacks.length; + + while (i--) { + callbacks[i](); + } + sheet.loadedCallbacks = []; + sheet.errorCallbacks = []; + }, + node.onerror = function() { + sheet.state = -1; + var callbacks = sheet.errorCallbacks, + i = callbacks.length; + + while (i--) { + callbacks[i](); + } + sheet.loadedCallbacks = []; + sheet.errorCallbacks = []; + }; + + node.href = sheet.url = url; + + sheetsByUrl[node.url] = sheet; + + } + return sheet.id; + }, + + deleteSheetRule: function(sheetId, rule) { + var sheet = sheetElementsById[sheetId]; + if (langx.isNumber(rule)) { + deleteRuleFunc.call(sheet, rule); + } else { + langx.each(sheet[rulesPropName], function(i, _rule) { + if (rule === _rule) { + deleteRuleFunc.call(sheet, i); + return false; + } + }); + } + }, + + deleteRule: function(rule) { + this.deleteSheetRule(defaultSheetId, rule); + return this; + }, + + removeStyleSheet: function(sheetId) { + if (sheetId === defaultSheetId) { + throw new Error("The default stylesheet can not be deleted"); + } + var sheet = sheetElementsById[sheetId]; + delete sheetElementsById[sheetId]; + + + construct.remove(sheet); + return this; + }, + + findRules: function(selector, sheetId) { + //return array of CSSStyleRule objects that match the selector text + var rules = [], + filters = parseSelector(selector); + $(document.styleSheets).each(function(i, styleSheet) { + if (filterStyleSheet(filters.styleSheet, styleSheet)) { + $.merge(rules, $(styleSheet[_rules]).filter(function() { + return matchSelector(this, filters.selectorText, filters.styleSheet === "*"); + }).map(function() { + return normalizeRule($.support.nativeCSSStyleRule ? this : new CSSStyleRule(this), styleSheet); + })); + } + }); + return rules.reverse(); + }, + + insertRule: function(selector, css, index) { + return this.insertSheetRule(defaultSheetId, selector, css, index); + }, + + insertSheetRule: function(sheetId, selector, css, index) { + if (!selector || !css) { + return -1; + } + + var sheet = sheetElementsById[sheetId]; + index = index || sheet[rulesPropName].length; + + return insertRuleFunc.call(sheet, selector, css, index); + + } + }); + + return skylark.css = css; +}); + +define('skylarkjs/css',[ + "skylark-utils/css" +], function(css) { + return css; +}); + +define('skylark-utils/finder',[ + "./skylark", + "./langx", + "./browser", + "./noder" +], function(skylark, langx, browser, noder, velm) { + var local = {}, + filter = Array.prototype.filter, + slice = Array.prototype.slice, + nativeMatchesSelector = browser.matchesSelector; + + /* + --- + name: Slick.Parser + description: Standalone CSS3 Selector parser + provides: Slick.Parser + ... + */ + ; + (function() { + + var parsed, + separatorIndex, + combinatorIndex, + reversed, + cache = {}, + reverseCache = {}, + reUnescape = /\\/g; + + var parse = function(expression, isReversed) { + if (expression == null) return null; + if (expression.Slick === true) return expression; + expression = ('' + expression).replace(/^\s+|\s+$/g, ''); + reversed = !!isReversed; + var currentCache = (reversed) ? reverseCache : cache; + if (currentCache[expression]) return currentCache[expression]; + parsed = { + Slick: true, + expressions: [], + raw: expression, + reverse: function() { + return parse(this.raw, true); + } + }; + separatorIndex = -1; + while (expression != (expression = expression.replace(regexp, parser))); + parsed.length = parsed.expressions.length; + return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed; + }; + + var reverseCombinator = function(combinator) { + if (combinator === '!') return ' '; + else if (combinator === ' ') return '!'; + else if ((/^!/).test(combinator)) return combinator.replace(/^!/, ''); + else return '!' + combinator; + }; + + var reverse = function(expression) { + var expressions = expression.expressions; + for (var i = 0; i < expressions.length; i++) { + var exp = expressions[i]; + var last = { + parts: [], + tag: '*', + combinator: reverseCombinator(exp[0].combinator) + }; + + for (var j = 0; j < exp.length; j++) { + var cexp = exp[j]; + if (!cexp.reverseCombinator) cexp.reverseCombinator = ' '; + cexp.combinator = cexp.reverseCombinator; + delete cexp.reverseCombinator; + } + + exp.reverse().push(last); + } + return expression; + }; + + var escapeRegExp = (function() { + // Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan MIT License + var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g, + to = '\\'; + return function(string) { + return string.replace(from, to) + } + }()) + + var regexp = new RegExp( + "^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)" + .replace(//, '[' + escapeRegExp(">+~`!@$%^&={}\\;/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') + .replace(//g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') + ); + + function parser( + rawMatch, + + separator, + combinator, + combinatorChildren, + + tagName, + id, + className, + + attributeKey, + attributeOperator, + attributeQuote, + attributeValue, + + pseudoMarker, + pseudoClass, + pseudoQuote, + pseudoClassQuotedValue, + pseudoClassValue + ) { + if (separator || separatorIndex === -1) { + parsed.expressions[++separatorIndex] = []; + combinatorIndex = -1; + if (separator) return ''; + } + + if (combinator || combinatorChildren || combinatorIndex === -1) { + combinator = combinator || ' '; + var currentSeparator = parsed.expressions[separatorIndex]; + if (reversed && currentSeparator[combinatorIndex]) + currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator); + currentSeparator[++combinatorIndex] = { + combinator: combinator, + tag: '*' + }; + } + + var currentParsed = parsed.expressions[separatorIndex][combinatorIndex]; + + if (tagName) { + currentParsed.tag = tagName.replace(reUnescape, ''); + + } else if (id) { + currentParsed.id = id.replace(reUnescape, ''); + + } else if (className) { + className = className.replace(reUnescape, ''); + + if (!currentParsed.classList) currentParsed.classList = []; + if (!currentParsed.classes) currentParsed.classes = []; + currentParsed.classList.push(className); + currentParsed.classes.push({ + value: className, + regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)') + }); + + } else if (pseudoClass) { + pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue; + pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null; + + if (!currentParsed.pseudos) currentParsed.pseudos = []; + currentParsed.pseudos.push({ + key: pseudoClass.replace(reUnescape, ''), + value: pseudoClassValue, + type: pseudoMarker.length == 1 ? 'class' : 'element' + }); + + } else if (attributeKey) { + attributeKey = attributeKey.replace(reUnescape, ''); + attributeValue = (attributeValue || '').replace(reUnescape, ''); + + var test, regexp; + + switch (attributeOperator) { + case '^=': + regexp = new RegExp('^' + escapeRegExp(attributeValue)); + break; + case '$=': + regexp = new RegExp(escapeRegExp(attributeValue) + '$'); + break; + case '~=': + regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)'); + break; + case '|=': + regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)'); + break; + case '=': + test = function(value) { + return attributeValue == value; + }; + break; + case '*=': + test = function(value) { + return value && value.indexOf(attributeValue) > -1; + }; + break; + case '!=': + test = function(value) { + return attributeValue != value; + }; + break; + default: + test = function(value) { + return !!value; + }; + } + + if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function() { + return false; + }; + + if (!test) test = function(value) { + return value && regexp.test(value); + }; + + if (!currentParsed.attributes) currentParsed.attributes = []; + currentParsed.attributes.push({ + key: attributeKey, + operator: attributeOperator, + value: attributeValue, + test: test + }); + + } + + return ''; + }; + + // Slick NS + + var Slick = (this.Slick || {}); + + Slick.parse = function(expression) { + return parse(expression); + }; + + Slick.escapeRegExp = escapeRegExp; + + if (!this.Slick) this.Slick = Slick; + + }).apply(local); + + + var simpleClassSelectorRE = /^\.([\w-]*)$/, + simpleIdSelectorRE = /^#([\w-]*)$/, + slice = Array.prototype.slice; + + + local.parseSelector = local.Slick.parse; + + + local.pseudos = { + // custom pseudos + 'checkbox': function(elm){ + return elm.type === "checkbox"; + }, + 'checked': function(elm) { + return !!elm.checked; + }, + + 'contains': function(elm, idx, nodes, text) { + if ($(this).text().indexOf(text) > -1) return this + }, + + 'disabled': function(elm) { + return !!elm.disabled; + }, + + 'enabled': function(elm) { + return !elm.disabled; + }, + + 'eq': function(elm, idx, nodes, value) { + return (idx == value); + }, + + 'focus': function(elm) { + return document.activeElement === elm && (elm.href || elm.type || elm.tabindex); + }, + + 'first': function(elm, idx) { + return (idx === 0); + }, + + 'gt': function(elm, idx, nodes, value) { + return (idx > value); + }, + + 'has': function(elm, idx, nodes, sel) { + return matches(elm, sel); + }, + + + 'hidden': function(elm) { + return !local.pseudos["visible"](elm); + }, + + 'last': function(elm, idx, nodes) { + return (idx === nodes.length - 1); + }, + + 'lt': function(elm, idx, nodes, value) { + return (idx < value); + }, + + 'not': function(elm, idx, nodes, sel) { + return !matches(elm, sel); + }, + + 'parent': function(elm) { + return !!elm.parentNode; + }, + + 'radio': function(elm){ + return elm.type === "radio"; + }, + + 'selected': function(elm) { + return !!elm.selected; + }, + + 'text': function(elm){ + return elm.type === "text"; + }, + + 'visible': function(elm) { + return elm.offsetWidth && elm.offsetWidth + } + }; + + ["first","eq","last"].forEach(function(item){ + local.pseudos[item].isArrayFilter = true; + }); + + local.divide = function(cond) { + var nativeSelector = "", + customPseudos = [], + tag, + id, + classes, + attributes, + pseudos; + + + if (id = cond.id) { + nativeSelector += ("#" + id); + } + if (classes = cond.classes) { + for (var i = classes.length; i--;) { + nativeSelector += ("." + classes[i].value); + } + } + if (attributes = cond.attributes) { + for (var i = 0; i < attributes.length; i++) { + if (attributes[i].operator) { + nativeSelector += ("[" + attributes[i].key + attributes[i].operator + JSON.stringify(attributes[i].value) +"]"); + } else { + nativeSelector += ("[" + attributes[i].key + "]"); + } + } + } + if (pseudos = cond.pseudos) { + for (i = pseudos.length; i--;) { + part = pseudos[i]; + if (this.pseudos[part.key]) { + customPseudos.push(part); + } else { + if (part.value !== undefined) { + nativeSelector += (":" + part.key + "(" + JSON.stringify(part)) + } + } + } + } + + if (tag = cond.tag) { + nativeSelector = tag.toUpperCase() + nativeSelector; + } + + if (!nativeSelector) { + nativeSelector = "*"; + } + + return { + nativeSelector: nativeSelector, + customPseudos: customPseudos + } + + }; + + local.check = function(node, cond, idx, nodes,arrayFilte) { + var tag, + id, + classes, + attributes, + pseudos, + + i, part, cls, pseudo; + + if (!arrayFilte) { + if (tag = cond.tag) { + var nodeName = node.nodeName.toUpperCase(); + if (tag == '*') { + if (nodeName < '@') return false; // Fix for comment nodes and closed nodes + } else { + if (nodeName != (tag || "").toUpperCase()) return false; + } + } + + if (id = cond.id) { + if (node.getAttribute('id') != id) { + return false; + } + } + + + if (classes = cond.classes) { + for (i = classes.length; i--;) { + cls = node.getAttribute('class'); + if (!(cls && classes[i].regexp.test(cls))) return false; + } + } + + if (attributes) { + for (i = attributes.length; i--;) { + part = attributes[i]; + if (part.operator ? !part.test(node.getAttribute(part.key)) : !node.hasAttribute(part.key)) return false; + } + + } + + } + if (pseudos = cond.pseudos) { + for (i = pseudos.length; i--;) { + part = pseudos[i]; + if (pseudo = this.pseudos[part.key]) { + if ((arrayFilte && pseudo.isArrayFilter) || (!arrayFilte && !pseudo.isArrayFilter)) { + if (!pseudo(node, idx, nodes, part.value)) { + return false; + } + } + } else { + if (!arrayFilte && !nativeMatchesSelector.call(node, part.key)) { + return false; + } + } + } + } + return true; + } + + local.match = function(node, selector) { + + var parsed ; + + if (langx.isString(selector)) { + parsed = local.Slick.parse(selector); + } else { + parsed = selector; + } + + if (!parsed) { + return true; + } + + // simple (single) selectors + var expressions = parsed.expressions, + simpleExpCounter = 0, + i, + currentExpression; + for (i = 0; + (currentExpression = expressions[i]); i++) { + if (currentExpression.length == 1) { + var exp = currentExpression[0]; + if (this.check(node,exp)) { + return true; + } + simpleExpCounter++; + } + } + + if (simpleExpCounter == parsed.length) { + return false; + } + + var nodes = this.query(document, parsed), + item; + for (i = 0; item = nodes[i++];) { + if (item === node) { + return true; + } + } + return false; + }; + + + local.filterSingle = function(nodes, exp){ + var matchs = filter.call(nodes, function(node, idx) { + return local.check(node, exp, idx, nodes,false); + }); + + matchs = filter.call(matchs, function(node, idx) { + return local.check(node, exp, idx, matchs,true); + }); + return matchs; + }; + + local.filter = function(nodes, selector) { + var parsed; + + if (langx.isString(selector)) { + parsed = local.Slick.parse(selector); + } else { + return local.filterSingle(nodes,selector); + } + + // simple (single) selectors + var expressions = parsed.expressions, + i, + currentExpression, + ret = []; + for (i = 0; + (currentExpression = expressions[i]); i++) { + if (currentExpression.length == 1) { + var exp = currentExpression[0]; + + var matchs = local.filterSingle(nodes,exp); + + ret = langx.uniq(ret.concat(matchs)); + } else { + throw new Error("not supported selector:" + selector); + } + } + + return ret; + + }; + + local.combine = function(elm, bit) { + var op = bit.combinator, + cond = bit, + node1, + nodes = []; + + switch (op) { + case '>': // direct children + nodes = children(elm, cond); + break; + case '+': // next sibling + node1 = nextSibling(elm, cond, true); + if (node1) { + nodes.push(node1); + } + break; + case '^': // first child + node1 = firstChild(elm, cond, true); + if (node1) { + nodes.push(node1); + } + break; + case '~': // next siblings + nodes = nextSiblings(elm, cond); + break; + case '++': // next sibling and previous sibling + var prev = previousSibling(elm, cond, true), + next = nextSibling(elm, cond, true); + if (prev) { + nodes.push(prev); + } + if (next) { + nodes.push(next); + } + break; + case '~~': // next siblings and previous siblings + nodes = siblings(elm, cond); + break; + case '!': // all parent nodes up to document + nodes = ancestors(elm, cond); + break; + case '!>': // direct parent (one level) + node1 = parent(elm, cond); + if (node1) { + nodes.push(node1); + } + break; + case '!+': // previous sibling + nodes = previousSibling(elm, cond, true); + break; + case '!^': // last child + node1 = lastChild(elm, cond, true); + if (node1) { + nodes.push(node1); + } + break; + case '!~': // previous siblings + nodes = previousSiblings(elm, cond); + break; + default: + var divided = this.divide(bit); + nodes = slice.call(elm.querySelectorAll(divided.nativeSelector)); + if (divided.customPseudos) { + for (var i = divided.customPseudos.length - 1; i >= 0; i--) { + nodes = filter.call(nodes, function(item, idx) { + return local.check(item, { + pseudos: [divided.customPseudos[i]] + }, idx, nodes,false) + }); + + nodes = filter.call(nodes, function(item, idx) { + return local.check(item, { + pseudos: [divided.customPseudos[i]] + }, idx, nodes,true) + }); + } + } + break; + + } + return nodes; + } + + local.query = function(node, selector, single) { + + + var parsed = this.Slick.parse(selector); + + var + founds = [], + currentExpression, currentBit, + expressions = parsed.expressions; + + for (var i = 0; + (currentExpression = expressions[i]); i++) { + var currentItems = [node], + found; + for (var j = 0; + (currentBit = currentExpression[j]); j++) { + found = langx.map(currentItems, function(item, i) { + return local.combine(item, currentBit) + }); + if (found) { + currentItems = found; + } + } + if (found) { + founds = founds.concat(found); + } + } + + return founds; + } + + + function ancestor(node, selector, root) { + var rootIsSelector = root && langx.isString(root); + while (node = node.parentNode) { + if (matches(node, selector)) { + return node; + } + if (root) { + if (rootIsSelector) { + if (matches(node,root)) { + break; + } + } else if (node == root) { + break; + } + } + } + return null; + } + + function ancestors(node, selector,root) { + var ret = [], + rootIsSelector = root && langx.isString(root); + while (node = node.parentNode) { + ret.push(node); + if (root) { + if (rootIsSelector) { + if (matches(node,root)) { + break; + } + } else if (node == root) { + break; + } + } + + } + + if (selector) { + ret = local.filter(ret,selector); + } + return ret; + } + + function byId(id, doc) { + doc = doc || noder.doc(); + return doc.getElementById(id); + } + + function children(node, selector) { + var childNodes = node.childNodes, + ret = []; + for (var i = 0; i < childNodes.length; i++) { + var node = childNodes[i]; + if (node.nodeType == 1) { + ret.push(node); + } + } + if (selector) { + ret = local.filter(ret,selector); + } + return ret; + } + + function closest(node, selector) { + while (node && !(matches(node, selector))) { + node = node.parentNode; + } + + return node; + } + + function descendants(elm, selector) { + // Selector + try { + return slice.call(elm.querySelectorAll(selector)); + } catch (matchError) { + //console.log(matchError); + } + return local.query(elm, selector); + } + + function descendant(elm, selector) { + // Selector + try { + return elm.querySelector(selector); + } catch (matchError) { + //console.log(matchError); + } + var nodes = local.query(elm, selector); + if (nodes.length > 0) { + return nodes[0]; + } else { + return null; + } + } + + function find(elm,selector) { + if (!selector) { + selector = elm; + elm = document.body; + } + if (matches(elm,selector)) { + return elm; + } else { + return descendant(elm, selector); + } + } + + function findAll(elm,selector) { + if (!selector) { + selector = elm; + elm = document.body; + } + return descendants(elm, selector); + } + + function firstChild(elm, selector, first) { + var childNodes = elm.childNodes, + node = childNodes[0]; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + return node; + } + if (first) { + break; + } + } + node = node.nextSibling; + } + + return null; + } + + function lastChild(elm, selector, last) { + var childNodes = elm.childNodes, + node = childNodes[childNodes.length - 1]; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + return node; + } + if (last) { + break; + } + } + node = node.previousSibling; + } + + return null; + } + + function matches(elm, selector) { + if (!selector || !elm || elm.nodeType !== 1) { + return false + } + + if (langx.isString(selector)) { + try { + return nativeMatchesSelector.call(elm, selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g, '[$1="$2"]')); + } catch (matchError) { + //console.log(matchError); + } + return local.match(elm, selector); + } else if (langx.isArrayLike(selector)) { + return langx.inArray(elm,selector) > -1; + } else if (langx.isPlainObject(selector)){ + return local.check(elm, selector); + } else { + return elm === selector; + } + + } + + function nextSibling(elm, selector, adjacent) { + var node = elm.nextSibling; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + return node; + } + if (adjacent) { + break; + } + } + node = node.nextSibling; + } + return null; + } + + function nextSiblings(elm, selector) { + var node = elm.nextSibling, + ret = []; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + ret.push(node); + } + } + node = node.nextSibling; + } + return ret; + } + + + function parent(elm, selector) { + var node = elm.parentNode; + if (node && (!selector || matches(node, selector))) { + return node; + } + + return null; + } + + function previousSibling(elm, selector, adjacent) { + var node = elm.previousSibling; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + return node; + } + if (adjacent) { + break; + } + } + node = node.previousSibling; + } + return null; + } + + function previousSiblings(elm, selector) { + var node = elm.previousSibling, + ret = []; + while (node) { + if (node.nodeType == 1) { + if (!selector || matches(node, selector)) { + ret.push(node); + } + } + node = node.previousSibling; + } + return ret; + } + + function siblings(elm, selector) { + var node = elm.parentNode.firstChild, + ret = []; + while (node) { + if (node.nodeType == 1 && node !== elm) { + if (!selector || matches(node, selector)) { + ret.push(node); + } + } + node = node.nextSibling; + } + return ret; + } + + var finder = function() { + return finder; + }; + + langx.mixin(finder, { + + ancestor: ancestor, + + ancestors: ancestors, + + byId: byId, + + children: children, + + closest: closest, + + descendant: descendant, + + descendants: descendants, + + find: find, + + findAll: findAll, + + firstChild: firstChild, + + lastChild: lastChild, + + matches: matches, + + nextSibling: nextSibling, + + nextSiblings: nextSiblings, + + parent: parent, + + previousSibling: previousSibling, + + previousSiblings: previousSiblings, + + pseudos: local.pseudos, + + siblings: siblings + }); + + return skylark.finder = finder; +}); + +define('skylark-utils/datax',[ + "./skylark", + "./langx", + "./finder" +], function(skylark, langx, finder) { + var map = Array.prototype.map, + filter = Array.prototype.filter, + camelCase = langx.camelCase, + deserializeValue = langx.deserializeValue, + + capitalRE = /([A-Z])/g, + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + }; + + function setAttribute(elm, name, value) { + if (value == null) { + elm.removeAttribute(name); + } else { + elm.setAttribute(name, value); + } + } + + function attr(elm, name, value) { + if (value === undefined) { + if (typeof name === "object") { + for (var attrName in name) { + attr(elm, attrName, name[attrName]); + } + return this; + } else { + if (elm.hasAttribute(name)) { + return elm.getAttribute(name); + } + } + } else { + elm.setAttribute(name, value); + return this; + } + } + + // Read all "data-*" attributes from a node + function _attributeData(elm) { + var store = {} + langx.each(elm.attributes || [], function(i, attr) { + if (attr.name.indexOf('data-') == 0) { + store[camelCase(attr.name.replace('data-', ''))] = deserializeValue(attr.value); + } + }) + return store; + } + + function _store(elm, confirm) { + var store = elm["_$_store"]; + if (!store && confirm) { + store = elm["_$_store"] = _attributeData(elm); + } + return store; + } + + function _getData(elm, name) { + if (name === undefined) { + return _store(elm, true); + } else { + var store = _store(elm); + if (store) { + if (name in store) { + return store[name]; + } + var camelName = camelCase(name); + if (camelName in store) { + return store[camelName]; + } + } + var attrName = 'data-' + name.replace(capitalRE, "-$1").toLowerCase() + return attr(elm, attrName); + } + + } + + function _setData(elm, name, value) { + var store = _store(elm, true); + store[camelCase(name)] = value; + } + + + function data(elm, name, value) { + + if (value === undefined) { + if (typeof name === "object") { + for (var dataAttrName in name) { + _setData(elm, dataAttrName, name[dataAttrName]); + } + return this; + } else { + return _getData(elm, name); + } + } else { + _setData(elm, name, value); + return this; + } + } + + function removeData(elm, names) { + if (langx.isString(names)) { + names = names.split(/\s+/); + } + var store = _store(elm, true); + names.forEach(function(name) { + delete store[name]; + }); + return this; + } + + function pluck(nodes, property) { + return map.call(nodes, function(elm) { + return elm[property]; + }); + } + + function prop(elm, name, value) { + name = propMap[name] || name; + if (value === undefined) { + return elm[name]; + } else { + elm[name] = value; + return this; + } + } + + function removeAttr(elm, name) { + name.split(' ').forEach(function(attr) { + setAttribute(elm, attr); + }); + return this; + } + + function removeProp(elm, name) { + name.split(' ').forEach(function(prop) { + delete elm[prop]; + }); + return this; + } + + function text(elm, txt) { + if (txt === undefined) { + return elm.textContent; + } else { + elm.textContent = txt == null ? '' : '' + txt; + return this; + } + } + + function val(elm, value) { + if (value === undefined) { + if (elm.multiple) { + // select multiple values + var selectedOptions = filter.call(finder.find(elm, "option"), (function(option) { + return option.selected; + })); + return pluck(selectedOptions, "value"); + } else { + return elm.value; + } + } else { + elm.value = value; + return this; + } + } + + function datax() { + return datax; + } + + langx.mixin(datax, { + attr: attr, + + data: data, + + pluck: pluck, + + prop: prop, + + removeAttr: removeAttr, + + removeData: removeData, + + removeProp: removeProp, + + text: text, + + val: val + }); + + return skylark.datax = datax; +}); + +define('skylarkjs/datax',[ + "skylark-utils/datax" +], function(datax) { + return datax; +}); + +define('skylark-utils/geom',[ + "./skylark", + "./langx", + "./styler" +], function(skylark, langx, styler) { + var rootNodeRE = /^(?:body|html)$/i, + px = langx.toPixel; + + function offsetParent(elm) { + var parent = elm.offsetParent || document.body; + while (parent && !rootNodeRE.test(parent.nodeName) && styler.css(parent, "position") == "static") { + parent = parent.offsetParent; + } + return parent; + } + + + function borderExtents(elm) { + var s = getComputedStyle(elm); + return { + left: px(s.borderLeftWidth , elm), + top: px(s.borderTopWidth, elm), + right: px(s.borderRightWidth, elm), + bottom: px(s.borderBottomWidth, elm) + } + } + + //viewport coordinate + function boundingPosition(elm, coords) { + if (coords === undefined) { + return rootNodeRE.test(elm.nodeName) ? { top: 0, left: 0 } : elm.getBoundingClientRect(); + } else { + var // Get *real* offsetParent + parent = offsetParent(elm), + // Get correct offsets + parentOffset = boundingPosition(parent), + mex = marginExtents(elm), + pbex = borderExtents(parent); + + relativePosition(elm, { + top: coords.top - parentOffset.top - mex.top - pbex.top, + left: coords.left - parentOffset.left - mex.left - pbex.left + }); + return this; + } + } + + function boundingRect(elm, coords) { + if (coords === undefined) { + return elm.getBoundingClientRect() + } else { + boundingPosition(elm, coords); + size(elm, coords); + return this; + } + } + + function clientHeight(elm, value) { + if (value == undefined) { + return clientSize(elm).height; + } else { + return clientSize(elm, { + height: value + }); + } + } + + function clientSize(elm, dimension) { + if (dimension == undefined) { + return { + width: elm.clientWidth, + height: elm.clientHeight + } + } else { + var isBorderBox = (styler.css(elm, "box-sizing") === "border-box"), + props = { + width: dimension.width, + height: dimension.height + }; + if (!isBorderBox) { + var pex = paddingExtents(elm); + + if (props.width !== undefined) { + props.width = props.width - pex.left - pex.right; + } + + if (props.height !== undefined) { + props.height = props.height - pex.top - pex.bottom; + } + } else { + var bex = borderExtents(elm); + + if (props.width !== undefined) { + props.width = props.width + bex.left + bex.right; + } + + if (props.height !== undefined) { + props.height = props.height + bex.top + bex.bottom; + } + + } + styler.css(elm, props); + return this; + } + return { + width: elm.clientWidth, + height: elm.clientHeight + }; + } + + function clientWidth(elm, value) { + if (value == undefined) { + return clientSize(elm).width; + } else { + clientSize(elm, { + width: value + }); + return this; + } + } + + function contentRect(elm) { + var cs = clientSize(elm), + pex = paddingExtents(elm); + + + //// On Opera, offsetLeft includes the parent's border + //if(has("opera")){ + // pe.l += be.l; + // pe.t += be.t; + //} + return { + left: pex.left, + top: pex.top, + width: cs.width - pex.left - pex.right, + height: cs.height - pex.top - pex.bottom + }; + } + + function getDocumentSize(doc) { + var documentElement = doc.documentElement, + body = doc.body, + max = Math.max, + scrollWidth = max(documentElement.scrollWidth, body.scrollWidth), + clientWidth = max(documentElement.clientWidth, body.clientWidth), + offsetWidth = max(documentElement.offsetWidth, body.offsetWidth), + scrollHeight = max(documentElement.scrollHeight, body.scrollHeight), + clientHeight = max(documentElement.clientHeight, body.clientHeight), + offsetHeight = max(documentElement.offsetHeight, body.offsetHeight); + + return { + width: scrollWidth < offsetWidth ? clientWidth : scrollWidth, + height: scrollHeight < offsetHeight ? clientHeight : scrollHeight + }; + } + + function height(elm, value) { + if (value == undefined) { + return size(elm).height; + } else { + size(elm, { + height: value + }); + return this; + } + } + + function marginExtents(elm) { + var s = getComputedStyle(elm); + return { + left: px(s.marginLeft), + top: px(s.marginTop), + right: px(s.marginRight), + bottom: px(s.marginBottom), + } + } + + + function paddingExtents(elm) { + var s = getComputedStyle(elm); + return { + left: px(s.paddingLeft), + top: px(s.paddingTop), + right: px(s.paddingRight), + bottom: px(s.paddingBottom), + } + } + + //coordinate to the document + function pagePosition(elm, coords) { + if (coords === undefined) { + var obj = elm.getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset + } + } else { + var // Get *real* offsetParent + parent = offsetParent(elm), + // Get correct offsets + parentOffset = pagePosition(parent), + mex = marginExtents(elm), + pbex = borderExtents(parent); + + relativePosition(elm, { + top: coords.top - parentOffset.top - mex.top - pbex.top, + left: coords.left - parentOffset.left - mex.left - pbex.left + }); + return this; + } + } + + function pageRect(elm, coords) { + if (coords === undefined) { + var obj = elm.getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + } else { + pagePosition(elm, coords); + size(elm, coords); + return this; + } + } + + // coordinate relative to it's parent + function relativePosition(elm, coords) { + if (coords == undefined) { + var // Get *real* offsetParent + parent = offsetParent(elm), + // Get correct offsets + offset = boundingPosition(elm), + parentOffset = boundingPosition(parent), + mex = marginExtents(elm), + pbex = borderExtents(parent); + + // Subtract parent offsets and element margins + return { + top: offset.top - parentOffset.top - pbex.top - mex.top, + left: offset.left - parentOffset.left - pbex.left - mex.left + } + } else { + var props = { + top: coords.top, + left: coords.left + } + + if (styler.css(elm, "position") == "static") { + props['position'] = "relative"; + } + styler.css(elm, props); + return this; + } + } + + function relativeRect(elm, coords) { + if (coords === undefined) { + var // Get *real* offsetParent + parent = offsetParent(elm), + // Get correct offsets + offset = boundingRect(elm), + parentOffset = boundingPosition(parent), + mex = marginExtents(elm), + pbex = borderExtents(parent); + + // Subtract parent offsets and element margins + return { + top: offset.top - parentOffset.top - pbex.top - mex.top, + left: offset.left - parentOffset.left - pbex.left - mex.left, + width: offset.width, + height: offset.height + } + } else { + relativePosition(elm, coords); + size(elm, coords); + return this; + } + } + + function scrollIntoView(elm, align) { + function getOffset(elm, rootElm) { + var x, y, parent = elm; + + x = y = 0; + while (parent && parent != rootElm && parent.nodeType) { + x += parent.offsetLeft || 0; + y += parent.offsetTop || 0; + parent = parent.offsetParent; + } + + return { x: x, y: y }; + } + + var parentElm = elm.parentNode; + var x, y, width, height, parentWidth, parentHeight; + var pos = getOffset(elm, parentElm); + + x = pos.x; + y = pos.y; + width = elm.offsetWidth; + height = elm.offsetHeight; + parentWidth = parentElm.clientWidth; + parentHeight = parentElm.clientHeight; + + if (align == "end") { + x -= parentWidth - width; + y -= parentHeight - height; + } else if (align == "center") { + x -= (parentWidth / 2) - (width / 2); + y -= (parentHeight / 2) - (height / 2); + } + + parentElm.scrollLeft = x; + parentElm.scrollTop = y; + + return this; + } + + function scrollLeft(elm, value) { + var hasScrollLeft = "scrollLeft" in elm; + if (value === undefined) { + return hasScrollLeft ? elm.scrollLeft : elm.pageXOffset + } else { + if (hasScrollLeft) { + elm.scrollLeft = value; + } else { + elm.scrollTo(value, elm.scrollY); + } + return this; + } + } + + function scrollTop(elm, value) { + var hasScrollTop = "scrollTop" in elm; + + if (value === undefined) { + return hasScrollTop ? elm.scrollTop : elm.pageYOffset + } else { + if (hasScrollTop) { + elm.scrollTop = value; + } else { + elm.scrollTo(elm.scrollX, value); + } + return this; + } + } + + function size(elm, dimension) { + if (dimension == undefined) { + if (langx.isWindow(elm)) { + return { + width: elm.innerWidth, + height: elm.innerHeight + } + + } else if (langx.isDocument(elm)) { + return getDocumentSize(document); + } else { + return { + width: elm.offsetWidth, + height: elm.offsetHeight + } + } + } else { + var isBorderBox = (styler.css(elm, "box-sizing") === "border-box"), + props = { + width: dimension.width, + height: dimension.height + }; + if (!isBorderBox) { + var pex = paddingExtents(elm), + bex = borderExtents(elm); + + if (props.width !== undefined && props.width !== "" && props.width !== null) { + props.width = props.width - pex.left - pex.right - bex.left - bex.right; + } + + if (props.height !== undefined && props.height !== "" && props.height !== null) { + props.height = props.height - pex.top - pex.bottom - bex.top - bex.bottom; + } + } + styler.css(elm, props); + return this; + } + } + + function width(elm, value) { + if (value == undefined) { + return size(elm).width; + } else { + size(elm, { + width: value + }); + return this; + } + } + + function geom() { + return geom; + } + + langx.mixin(geom, { + borderExtents: borderExtents, + //viewport coordinate + boundingPosition: boundingPosition, + + boundingRect: boundingRect, + + clientHeight: clientHeight, + + clientSize: clientSize, + + clientWidth: clientWidth, + + contentRect: contentRect, + + getDocumentSize: getDocumentSize, + + height: height, + + marginExtents: marginExtents, + + offsetParent: offsetParent, + + paddingExtents: paddingExtents, + + //coordinate to the document + pagePosition: pagePosition, + + pageRect: pageRect, + + // coordinate relative to it's parent + relativePosition: relativePosition, + + relativeRect: relativeRect, + + scrollIntoView: scrollIntoView, + + scrollLeft: scrollLeft, + + scrollTop: scrollTop, + + size: size, + + width: width + }); + + return skylark.geom = geom; +}); + +define('skylark-utils/eventer',[ + "./skylark", + "./langx", + "./browser", + "./finder", + "./noder", + "./datax" +], function(skylark, langx, browser, finder, noder, datax) { + var mixin = langx.mixin, + each = langx.each, + slice = Array.prototype.slice, + uid = langx.uid, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, + eventMethods = { + preventDefault: "isDefaultPrevented", + stopImmediatePropagation: "isImmediatePropagationStopped", + stopPropagation: "isPropagationStopped" + }, + readyRE = /complete|loaded|interactive/; + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + if (!source) { + source = event; + } + + langx.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name]; + event[name] = function() { + this[predicate] = langx.returnTrue; + return sourceMethod && sourceMethod.apply(source, arguments); + } + event[predicate] = langx.returnFalse; + }); + } + return event; + } + + function parse(event) { + var segs = ("" + event).split("."); + return { + type: segs[0], + ns: segs.slice(1).sort().join(" ") + }; + } + + //create a custom dom event + var createEvent = (function() { + var EventCtors = [ + window["CustomEvent"], // 0 default + window["CompositionEvent"], // 1 + window["DragEvent"], // 2 + window["Event"], // 3 + window["FocusEvent"], // 4 + window["KeyboardEvent"], // 5 + window["MessageEvent"], // 6 + window["MouseEvent"], // 7 + window["MouseScrollEvent"], // 8 + window["MouseWheelEvent"], // 9 + window["MutationEvent"], // 10 + window["ProgressEvent"], // 11 + window["TextEvent"], // 12 + window["TouchEvent"], // 13 + window["UIEvent"], // 14 + window["WheelEvent"] // 15 + ], + NativeEvents = { + "compositionstart": 1, // CompositionEvent + "compositionend": 1, // CompositionEvent + "compositionupdate": 1, // CompositionEvent + + "beforecopy": 2, // DragEvent + "beforecut": 2, // DragEvent + "beforepaste": 2, // DragEvent + "copy": 2, // DragEvent + "cut": 2, // DragEvent + "paste": 2, // DragEvent + + "drag": 2, // DragEvent + "dragend": 2, // DragEvent + "dragenter": 2, // DragEvent + "dragexit": 2, // DragEvent + "dragleave": 2, // DragEvent + "dragover": 2, // DragEvent + "dragstart": 2, // DragEvent + "drop": 2, // DragEvent + + "abort": 3, // Event + "change": 3, // Event + "error": 3, // Event + "selectionchange": 3, // Event + "submit": 3, // Event + "reset": 3, // Event + + "focus": 4, // FocusEvent + "blur": 4, // FocusEvent + "focusin": 4, // FocusEvent + "focusout": 4, // FocusEvent + + "keydown": 5, // KeyboardEvent + "keypress": 5, // KeyboardEvent + "keyup": 5, // KeyboardEvent + + "message": 6, // MessageEvent + + "click": 7, // MouseEvent + "contextmenu": 7, // MouseEvent + "dblclick": 7, // MouseEvent + "mousedown": 7, // MouseEvent + "mouseup": 7, // MouseEvent + "mousemove": 7, // MouseEvent + "mouseover": 7, // MouseEvent + "mouseout": 7, // MouseEvent + "mouseenter": 7, // MouseEvent + "mouseleave": 7, // MouseEvent + + + "textInput": 12, // TextEvent + + "touchstart": 13, // TouchEvent + "touchmove": 13, // TouchEvent + "touchend": 13, // TouchEvent + + "load": 14, // UIEvent + "resize": 14, // UIEvent + "select": 14, // UIEvent + "scroll": 14, // UIEvent + "unload": 14, // UIEvent, + + "wheel": 15 // WheelEvent + } + ; + + function getEventCtor(type) { + var idx = NativeEvents[type]; + if (!idx) { + idx = 0; + } + return EventCtors[idx]; + } + + return function(type, props) { + //create a custom dom event + + if (langx.isString(type)) { + props = props || {}; + } else { + props = type || {}; + type = props.type || ""; + } + var parsed = parse(type); + type = parsed.type; + + props = langx.mixin({ + bubbles: true, + cancelable: true + }, props); + + if (parsed.ns) { + props.namespace = parsed.ns; + } + + var ctor = getEventCtor(type), + e = new ctor(type, props); + + langx.safeMixin(e, props); + + return compatible(e); + }; + })(); + + function createProxy(event) { + var key, + proxy = { + originalEvent: event + }; + for (key in event) { + if (key !== "keyIdentifier" && !ignoreProperties.test(key) && event[key] !== undefined) { + proxy[key] = event[key]; + } + } + return compatible(proxy, event); + } + + var + specialEvents = {}, + focusinSupported = "onfocusin" in window, + focus = { focus: "focusin", blur: "focusout" }, + hover = { mouseenter: "mouseover", mouseleave: "mouseout" }, + realEvent = function(type) { + return hover[type] || (focusinSupported && focus[type]) || type; + }, + handlers = {}, + EventBindings = langx.klass({ + init: function(target, event) { + this._target = target; + this._event = event; + this._bindings = []; + }, + + add: function(fn, options) { + var bindings = this._bindings, + binding = { + fn: fn, + options: langx.mixin({}, options) + }; + + bindings.push(binding); + + var self = this; + if (!self._listener) { + self._listener = function(domEvt) { + var elm = this, + e = createProxy(domEvt), + args = domEvt._args, + bindings = self._bindings, + ns = e.namespace; + + if (langx.isDefined(args)) { + args = [e].concat(args); + } else { + args = [e]; + } + + langx.each(bindings,function(idx,binding) { + var match = elm; + if (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped()) { + return false; + } + var fn = binding.fn, + options = binding.options || {}, + selector = options.selector, + one = options.one, + data = options.data; + + if (ns && ns != options.ns && options.ns.indexOf(ns)===-1) { + return ; + } + if (selector) { + match = finder.closest(e.target, selector); + if (match && match !== elm) { + langx.mixin(e, { + currentTarget: match, + liveFired: elm + }); + } else { + return ; + } + } + + if (langx.isDefined(data)) { + e.data = data; + } + + if (one) { + self.remove(fn, options); + } + + var result = fn.apply(match, args); + + if (result === false) { + e.preventDefault(); + e.stopPropagation(); + } + });; + }; + + var event = self._event; + if (event in hover) { + var l = self._listener; + self._listener = function(e) { + var related = e.relatedTarget; + if (!related || (related !== this && !noder.contains(this, related))) { + return l.apply(this, arguments); + } + } + } + + if (self._target.addEventListener) { + self._target.addEventListener(realEvent(event), self._listener, false); + } else { + console.warn("invalid eventer object", self._target); + } + } + + }, + remove: function(fn, options) { + options = langx.mixin({}, options); + + function matcherFor(ns) { + return new RegExp("(?:^| )" + ns.replace(" ", " .* ?") + "(?: |$)"); + } + var matcher; + if (options.ns) { + matcher = matcherFor(options.ns); + } + + this._bindings = this._bindings.filter(function(binding) { + var removing = (!fn || fn === binding.fn) && + (!matcher || matcher.test(binding.options.ns)) && + (!options.selector || options.selector == binding.options.selector); + + return !removing; + }); + if (this._bindings.length == 0) { + if (this._target.removeEventListener) { + this._target.removeEventListener(realEvent(this._event), this._listener, false); + } + this._listener = null; + } + } + }), + EventsHandler = langx.klass({ + init: function(elm) { + this._target = elm; + this._handler = {}; + }, + + // add a event listener + // selector Optional + register: function(event, callback, options) { + // Seperate the event from the namespace + var parsed = parse(event), + event = parsed.type, + specialEvent = specialEvents[event], + bindingEvent = specialEvent && (specialEvent.bindType || specialEvent.bindEventName); + + var events = this._handler; + + // Check if there is already a handler for this event + if (events[event] === undefined) { + events[event] = new EventBindings(this._target, bindingEvent || event); + } + + // Register the new callback function + events[event].add(callback, langx.mixin({ + ns: parsed.ns + }, options)); // options:{selector:xxx} + }, + + // remove a event listener + unregister: function(event, fn, options) { + // Check for parameter validtiy + var events = this._handler, + parsed = parse(event); + event = parsed.type; + + var listener = events[event]; + + if (listener) { + listener.remove(fn, langx.mixin({ + ns: parsed.ns + }, options)); + } + } + }), + + findHandler = function(elm) { + var id = uid(elm), + handler = handlers[id]; + if (!handler) { + handler = handlers[id] = new EventsHandler(elm); + } + return handler; + }; + + function off(elm, events, selector, callback) { + var $this = this + if (langx.isPlainObject(events)) { + langx.each(events, function(type, fn) { + off(elm, type, selector, fn); + }) + return $this; + } + + if (!langx.isString(selector) && !langx.isFunction(callback) && callback !== false) { + callback = selector; + selector = undefined; + } + + if (callback === false) { + callback = langx.returnFalse; + } + + if (typeof events == "string") { + if (events.indexOf(",") > -1) { + events = events.split(","); + } else { + events = events.split(/\s/); + } + } + + var handler = findHandler(elm); + + if (events) events.forEach(function(event) { + + handler.unregister(event, callback, { + selector: selector, + }); + }); + return this; + } + + function on(elm, events, selector, data, callback, one) { + + var autoRemove, delegator; + if (langx.isPlainObject(events)) { + langx.each(events, function(type, fn) { + on(elm, type, selector, data, fn, one); + }); + return this; + } + + if (!langx.isString(selector) && !langx.isFunction(callback)) { + callback = data; + data = selector; + selector = undefined; + } + + if (langx.isFunction(data)) { + callback = data; + data = undefined; + } + + if (callback === false) { + callback = langx.returnFalse; + } + + if (typeof events == "string") { + if (events.indexOf(",") > -1) { + events = events.split(","); + } else { + events = events.split(/\s/); + } + } + + var handler = findHandler(elm); + + events.forEach(function(event) { + if (event == "ready") { + return ready(callback); + } + handler.register(event, callback, { + data: data, + selector: selector, + one: !!one + }); + }); + return this; + } + + function one(elm, events, selector, data, callback) { + on(elm, events, selector, data, callback, 1); + + return this; + } + + function stop(event) { + if (window.document.all) { + event.keyCode = 0; + } + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } + return this; + } + + function trigger(evented, type, args) { + var e; + if (type instanceof Event) { + e = type; + } else { + e = createEvent(type, args); + } + e._args = args; + + var fn = (evented.dispatchEvent || evented.trigger); + if (fn) { + fn.call(evented, e); + } else { + console.warn("The evented parameter is not a eventable object"); + } + + return this; + } + + function ready(callback) { + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body elm + if (readyRE.test(document.readyState) && document.body) { + callback() + } else { + document.addEventListener('DOMContentLoaded', callback, false); + } + + return this; + } + + var keyCodeLookup = { + "delete": 46 + }; + //example: + //shortcuts(elm).add("CTRL+ALT+SHIFT+X",function(){console.log("test!")}); + function shortcuts(elm) { + + var registry = datax.data(elm, "shortcuts"); + if (!registry) { + registry = {}; + datax.data(elm, "shortcuts", registry); + var run = function(shortcut, event) { + var n = event.metaKey || event.ctrlKey; + if (shortcut.ctrl == n && shortcut.alt == event.altKey && shortcut.shift == event.shiftKey) { + if (event.keyCode == shortcut.keyCode || event.charCode && event.charCode == shortcut.charCode) { + event.preventDefault(); + if ("keydown" == event.type) { + shortcut.fn(event); + } + return true; + } + } + }; + on(elm, "keyup keypress keydown", function(event) { + if (!(/INPUT|TEXTAREA/.test(event.target.nodeName))) { + for (var key in registry) { + run(registry[key], event); + } + } + }); + + } + + return { + add: function(pattern, fn) { + var shortcutKeys; + if (pattern.indexOf(",") > -1) { + shortcutKeys = pattern.toLowerCase().split(","); + } else { + shortcutKeys = pattern.toLowerCase().split(" "); + } + shortcutKeys.forEach(function(shortcutKey) { + var setting = { + fn: fn, + alt: false, + ctrl: false, + shift: false + }; + shortcutKey.split("+").forEach(function(key) { + switch (key) { + case "alt": + case "ctrl": + case "shift": + setting[key] = true; + break; + default: + setting.charCode = key.charCodeAt(0); + setting.keyCode = keyCodeLookup[key] || key.toUpperCase().charCodeAt(0); + } + }); + var regKey = (setting.ctrl ? "ctrl" : "") + "," + (setting.alt ? "alt" : "") + "," + (setting.shift ? "shift" : "") + "," + setting.keyCode; + registry[regKey] = setting; + }) + } + + }; + + } + + function eventer() { + return eventer; + } + + langx.mixin(eventer, { + create: createEvent, + + off: off, + + on: on, + + one: one, + + proxy: createProxy, + + ready: ready, + + shortcuts: shortcuts, + + special : specialEvents, + + stop: stop, + + trigger: trigger + + }); + + return skylark.eventer = eventer; +}); + +define('skylark-utils/dnd',[ + "./skylark", + "./langx", + "./noder", + "./datax", + "./finder", + "./geom", + "./eventer", + "./styler" +],function(skylark, langx,noder,datax,finder,geom,eventer,styler){ + var on = eventer.on, + off = eventer.off, + attr = datax.attr, + removeAttr = datax.removeAttr, + offset = geom.pagePosition, + addClass = styler.addClass, + height = geom.height; + + + var DndManager = langx.Evented.inherit({ + klassName : "DndManager", + + init : function() { + + }, + + prepare : function(draggable) { + var e = eventer.create("preparing",{ + dragSource : draggable.elm, + handleElm : draggable.handleElm + }); + draggable.trigger(e); + draggable.dragSource = e.dragSource; + }, + + start : function(draggable,event) { + + var p = geom.pagePosition(draggable.elm); + this.draggingOffsetX = parseInt(event.pageX - p.left); + this.draggingOffsetY = parseInt(event.pageY - p.top) + + var e = eventer.create("started",{ + elm : draggable.elm, + dragSource : draggable.dragSource, + handleElm : draggable.handleElm, + ghost : null, + + transfer : { + } + }); + + draggable.trigger(e); + + + this.dragging = draggable; + + if (draggable.draggingClass) { + styler.addClass(draggable.dragSource,draggable.draggingClass); + } + + this.draggingGhost = e.ghost; + if (!this.draggingGhost) { + this.draggingGhost = draggable.elm; + } + + this.draggingTransfer = e.transfer; + if (this.draggingTransfer) { + + langx.each(this.draggingTransfer,function(key,value){ + event.dataTransfer.setData(key, value); + }); + } + + event.dataTransfer.setDragImage(this.draggingGhost, this.draggingOffsetX, this.draggingOffsetY); + + event.dataTransfer.effectAllowed = "copyMove"; + + this.trigger(e); + }, + + over : function() { + + }, + + end : function(dropped) { + var dragging = this.dragging; + if (dragging) { + if (dragging.draggingClass) { + styler.removeClass(dragging.dragSource,dragging.draggingClass); + } + } + + var e = eventer.create("ended",{ + }); + this.trigger(e); + + + this.dragging = null; + this.draggingTransfer = null; + this.draggingGhost = null; + this.draggingOffsetX = null; + this.draggingOffsetY = null; + } + }); + + var manager = new DndManager(), + draggingHeight, + placeholders = []; + + + + var Draggable = langx.Evented.inherit({ + klassName : "Draggable", + + init : function (elm,params) { + var self = this; + + self.elm = elm; + self.draggingClass = params.draggingClass || "dragging", + self._params = params; + + ["preparing","started", "ended", "moving"].forEach(function(eventName) { + if (langx.isFunction(params[eventName])) { + self.on(eventName, params[eventName]); + } + }); + + + eventer.on(elm,{ + "mousedown" : function(e) { + if (params.handle) { + self.handleElm = finder.closest(e.target,params.handle); + if (!self.handleElm) { + return; + } + } + manager.prepare(self); + if (self.dragSource) { + datax.prop(self.dragSource, "draggable", true); + } + }, + + "mouseup" : function(e) { + if (self.dragSource) { + datax.prop(self.dragSource, "draggable", false); + self.dragSource = null; + self.handleElm = null; + } + }, + + "dragstart": function(e) { + datax.prop(self.dragSource, "draggable", false); + manager.start(self, e); + }, + + "dragend": function(e){ + eventer.stop(e); + + if (!manager.dragging) { + return; + } + + manager.end(false); + } + }); + + } + + }); + + + var Droppable = langx.Evented.inherit({ + klassName : "Droppable", + + init : function(elm,params) { + var self = this, + draggingClass = params.draggingClass || "dragging", + hoverClass, + activeClass, + acceptable = true; + + self.elm = elm; + self._params = params; + + ["started","entered", "leaved", "dropped","overing"].forEach(function(eventName) { + if (langx.isFunction(params[eventName])) { + self.on(eventName, params[eventName]); + } + }); + + eventer.on(elm,{ + "dragover" : function(e) { + e.stopPropagation() + + if (!acceptable) { + return + } + + var e2 = eventer.create("overing",{ + overElm : e.target, + transfer : manager.draggingTransfer, + acceptable : true + }); + self.trigger(e2); + + if (e2.acceptable) { + e.preventDefault() // allow drop + + e.dataTransfer.dropEffect = "copyMove"; + } + + }, + + "dragenter" : function(e) { + var params = self._params, + elm = self.elm; + + var e2 = eventer.create("entered",{ + transfer : manager.draggingTransfer + }); + + self.trigger(e2); + + e.stopPropagation() + + if (hoverClass && acceptable) { + styler.addClass(elm,hoverClass) + } + }, + + "dragleave": function(e) { + var params = self._params, + elm = self.elm; + if (!acceptable) return false + + var e2 = eventer.create("leaved",{ + transfer : manager.draggingTransfer + }); + + self.trigger(e2); + + e.stopPropagation() + + if (hoverClass && acceptable) { + styler.removeClass(elm,hoverClass); + } + }, + + "drop": function(e){ + var params = self._params, + elm = self.elm; + + eventer.stop(e); // stops the browser from redirecting. + + if (!manager.dragging) return + + // manager.dragging.elm.removeClass('dragging'); + + if (hoverClass && acceptable) { + styler.addClass(elm,hoverClass) + } + + var e2 = eventer.create("dropped",{ + transfer : manager.draggingTransfer + }); + + self.trigger(e2); + + manager.end(true) + } + }); + + manager.on("started",function(e){ + var e2 = eventer.create("started",{ + transfer : manager.draggingTransfer, + acceptable : false + }); + + self.trigger(e2); + + acceptable = e2.acceptable; + hoverClass = e2.hoverClass; + activeClass = e2.activeClass; + + if (activeClass && acceptable) { + styler.addClass(elm,activeClass); + } + + }).on("ended" , function(e){ + var e2 = eventer.create("ended",{ + transfer : manager.draggingTransfer, + acceptable : false + }); + + self.trigger(e2); + + if (hoverClass && acceptable) { + styler.removeClass(elm,hoverClass); + } + if (activeClass && acceptable) { + styler.removeClass(elm,activeClass); + } + + acceptable = false; + activeClass = null; + hoverClass = null; + }); + + } + }); + + + function draggable(elm, params) { + return new Draggable(elm,params); + } + + function droppable(elm, params) { + return new Droppable(elm,params); + } + + function dnd(){ + return dnd; + } + + langx.mixin(dnd, { + //params : { + // target : Element or string or function + // handle : Element + // copy : boolean + // placeHolder : "div" + // hoverClass : "hover" + // start : function + // enter : function + // over : function + // leave : function + // drop : function + // end : function + // + // + //} + draggable : draggable, + + //params : { + // accept : string or function + // placeHolder + // + // + // + //} + droppable : droppable, + + manager : manager + + + }); + + return skylark.dnd = dnd; +}); + +define('skylarkjs/dnd',[ + "skylark-utils/dnd" +], function(dnd) { + return dnd; +}); + +define('skylarkjs/eventer',[ + "skylark-utils/eventer" +], function(eventer) { + return eventer; +}); + +define('skylark-utils/filer',[ + "./skylark", + "./langx", + "./eventer", + "./styler" +], function(skylark, langx, eventer,styler) { + var on = eventer.on, + attr = eventer.attr, + Deferred = langx.Deferred, + + fileInput, + fileInputForm, + fileSelected, + maxFileSize = 1 / 0; + + function dataURLtoBlob(dataurl) { + var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], + bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); + while(n--){ + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], {type:mime}); + } + + function selectFile(callback) { + fileSelected = callback; + if (!fileInput) { + var input = fileInput = document.createElement("input"); + + function selectFiles(pickedFiles) { + for (var i = pickedFiles.length; i--;) { + if (pickedFiles[i].size > maxFileSize) { + pickedFiles.splice(i, 1); + } + } + fileSelected(pickedFiles); + } + + input.type = "file"; + input.style.position = "fixed", + input.style.left = 0, + input.style.top = 0, + input.style.opacity = .001, + document.body.appendChild(input); + + input.onchange = function(e) { + selectFiles(Array.prototype.slice.call(e.target.files)); + // reset to "", so selecting the same file next time still trigger the change handler + input.value = ""; + }; + } + fileInput.click(); + } + + function upload(files, url, params) { + params = params || {}; + var chunkSize = params.chunkSize || 0, + maxSize = params.maxSize || 0, + progressCallback = params.progress, + errorCallback = params.error, + completedCallback = params.completed, + uploadedCallback = params.uploaded; + + + function uploadOneFile(fileItem,oneFileloadedSize, fileItems) { + function handleProcess(nowLoadedSize) { + var t; + speed = Math.ceil(oneFileloadedSize + nowLoadedSize / ((now() - uploadStartedTime) / 1e3)), + percent = Math.round((oneFileloadedSize + nowLoadedSize) / file.size * 100); + if (progressCallback) { + progressCallback({ + name: file.name, + loaded: oneFileloadedSize + nowLoadedSize, + total: file.size, + percent: percent, + bytesPerSecond: speed, + global: { + loaded: allLoadedSize + oneFileloadedSize + nowLoadedSize, + total: totalSize + } + }); + } + } + var file = fileItem.file, + uploadChunkSize = chunkSize || file.size, + chunk = file.slice(oneFileloadedSize, oneFileloadedSize + uploadChunkSize); + + xhr = createXmlHttpRequest(); + //xhr.open("POST", url + + // "?action=upload&path=" + + // encodeURIComponent(path) + + // "&name=" + encodeURIComponent(file.name) + + // "&loaded=" + oneFileloadedSize + + // "&total=" + file.size + + // "&id=" + id + + // "&csrf=" + encodeURIComponent(token) + + // "&resolution=" + + // encodeURIComponent(fileItem.type)); + xhr.upload.onprogress = function(event) { + handleProcess(event.loaded - (event.total - h.size)) + }; + xhr.onload = function() { + var response, i; + xhr.upload.onprogress({ + loaded: h.size, + total: h.size + }); + try { + response = JSON.parse(xhr.responseText); + } catch (e) { + i = { + code: -1, + message: "Error response is not proper JSON\n\nResponse:\n" + xhr.responseText, + data: { + fileName: file.name, + fileSize: file.size, + maxSize: uploadMaxSize, + extensions: extensions.join(", ") + }, + extra: extra + }; + errorFileInfos.push(i); + if (errorCallback) { + errorCallback(i); + } + return uploadFiles(fileItems) + } + if (response.error) { + + i = { + code: response.error.code, + message: response.error.message, + data: { + fileName: file.name, + fileSize: file.size, + maxSize: uploadMaxSize, + extensions: extensions.join(", ") + }, + extra: extra + }; + errorFileInfos.push(i); + if (errorCallback) { + errorCallback(i); + } + uploadFiles(fileItems); + } else { + if (!response.error && oneFileloadedSize + uploadChunkSize < file.size) { + uploadOneFile(fileItem, oneFileloadedSize + uploadChunkSize, fileItems); + } else { + if (response.result) { + utils.each(response.result, function(e) { + e = File.fromJSON(e); + uploadFileItems.push(e); + + if (uploadedCallback) { + uploadedCallback({ + file: e + }); + } + }); + + } + allLoadedSize += file.size; + response.result && k.push(response.result); + uploadFiles(fileItems); + } + } + + }; + handleProcess(0); + xhr.send(createFormData(h)); + } + + function uploadFiles(fileItems) { + var fileItem = fileItems.shift(); + processedFilesCount++; + if (fileItem && fileItem.file.error) { + uploadFiles(fileItem); + } else { + if (uploadingFile) { + uploadOneFile(fileItem, null, 0, fileItems); + } else { + + if (completedCallback) { + completedCallback({ + files: new FileCollection(uploadFileItems), + bytesPerSecond: I, + errors: E(D), + extra: extra + }); + } + } + } + } + + var self = this, + fileItems = [], + processedFilesCount = -1, + xhr, + totalSize = 0, + allLoadedSize = 0, + k = [], + errorFileInfos = [], + startedTime = now(), + I = 0, + uploadFileItems = []; + + for ( var i = 0; i < files.length; i++) { + totalSize += files[i].size; + fileItems.push({ + file : files[i] + }); + } + + uploadFiles(fileItems); + } + + + var filer = function() { + return filer; + }; + + langx.mixin(filer , { + dropzone: function(elm, params) { + params = params || {}; + var hoverClass = params.hoverClass || "dropzone", + droppedCallback = params.dropped; + + var enterdCount = 0; + on(elm, "dragenter", function(e) { + if (e.dataTransfer && e.dataTransfer.types.indexOf("Files")>-1) { + eventer.stop(e); + enterdCount ++; + styler.addClass(elm,hoverClass) + } + }); + + on(elm, "dragover", function(e) { + if (e.dataTransfer && e.dataTransfer.types.indexOf("Files")>-1) { + eventer.stop(e); + } + }); + + + on(elm, "dragleave", function(e) { + if (e.dataTransfer && e.dataTransfer.types.indexOf("Files")>-1) { + enterdCount-- + if (enterdCount==0) { + styler.removeClass(elm,hoverClass); + } + } + }); + + on(elm, "drop", function(e) { + if (e.dataTransfer && e.dataTransfer.types.indexOf("Files")>-1) { + styler.removeClass(elm,hoverClass) + eventer.stop(e); + if (droppedCallback) { + droppedCallback(e.dataTransfer.files); + } + } + }); + + + return this; + }, + + picker: function(elm, params) { + params = params || {}; + + var pickedCallback = params.picked; + + on(elm, "click", function(e) { + e.preventDefault(); + selectFile(pickedCallback); + }); + return this; + }, + + readFile : function(file,params) { + params = params || {}; + var d = new Deferred, + reader = new FileReader(); + + reader.onload = function(evt) { + d.resolve(evt.target.result); + }; + reader.onerror = function(e) { + var code = e.target.error.code; + if (code === 2) { + alert('please don\'t open this page using protocol fill:///'); + } else { + alert('error code: ' + code); + } + }; + + if (params.asArrayBuffer){ + reader.readAsArrayBuffer(file); + } else if (params.asDataUrl) { + reader.readAsDataURL(file); + } else if (params.asText) { + reader.readAsText(file); + } else { + reader.readAsArrayBuffer(file); + } + + return d.promise; + }, + + writeFile : function(data,name) { + if (window.navigator.msSaveBlob) { + if (langx.isString(data)) { + data = dataURItoBlob(data); + } + window.navigator.msSaveBlob(data, name); + } else { + var a = document.createElement('a'); + if (data instanceof Blob) { + data = langx.URL.createObjectURL(data); + } + a.href = data; + a.setAttribute('download', name || 'noname'); + a.dispatchEvent(new CustomEvent('click')); + } + } + + + }); + + return skylark.filer = filer; +}); + +define('skylarkjs/filer',[ + "skylark-utils/filer" +], function(filer) { + return filer; +}); + +define('skylarkjs/finder',[ + "skylark-utils/finder" +], function(finder) { + return finder; +}); + +define('skylark-utils/fx',[ + "./skylark", + "./langx", + "./browser", + "./geom", + "./styler", + "./eventer" +], function(skylark, langx, browser, geom, styler, eventer) { + var animationName, + animationDuration, + animationTiming, + animationDelay, + transitionProperty, + transitionDuration, + transitionTiming, + transitionDelay, + + animationEnd = browser.normalizeCssEvent('AnimationEnd'), + transitionEnd = browser.normalizeCssEvent('TransitionEnd'), + + supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, + transform = browser.css3PropPrefix + "transform", + cssReset = {}; + + + cssReset[animationName = browser.normalizeCssProperty("animation-name")] = + cssReset[animationDuration = browser.normalizeCssProperty("animation-duration")] = + cssReset[animationDelay = browser.normalizeCssProperty("animation-delay")] = + cssReset[animationTiming = browser.normalizeCssProperty("animation-timing-function")] = ""; + + cssReset[transitionProperty = browser.normalizeCssProperty("transition-property")] = + cssReset[transitionDuration = browser.normalizeCssProperty("transition-duration")] = + cssReset[transitionDelay = browser.normalizeCssProperty("transition-delay")] = + cssReset[transitionTiming = browser.normalizeCssProperty("transition-timing-function")] = ""; + + + + function animate(elm, properties, duration, ease, callback, delay) { + var key, + cssValues = {}, + cssProperties = [], + transforms = "", + that = this, + endEvent, + wrappedCallback, + fired = false, + hasScrollTop = false; + + if (langx.isPlainObject(duration)) { + ease = duration.easing; + callback = duration.complete; + delay = duration.delay; + duration = duration.duration; + } + + if (langx.isString(duration)) { + duration = fx.speeds[duration]; + } + if (duration === undefined) { + duration = fx.speeds.normal; + } + duration = duration / 1000; + if (fx.off) { + duration = 0; + } + + if (langx.isFunction(ease)) { + callback = ease; + eace = "swing"; + } else { + ease = ease || "swing"; + } + + if (delay) { + delay = delay / 1000; + } else { + delay = 0; + } + + if (langx.isString(properties)) { + // keyframe animation + cssValues[animationName] = properties; + cssValues[animationDuration] = duration + "s"; + cssValues[animationTiming] = ease; + endEvent = animationEnd; + } else { + // CSS transitions + for (key in properties) { + if (supportedTransforms.test(key)) { + transforms += key + "(" + properties[key] + ") "; + } else { + if (key === "scrollTop") { + hasScrollTop = true; + } + cssValues[key] = properties[key]; + cssProperties.push(langx.dasherize(key)); + } + } + endEvent = transitionEnd; + } + + if (transforms) { + cssValues[transform] = transforms; + cssProperties.push(transform); + } + + if (duration > 0 && langx.isPlainObject(properties)) { + cssValues[transitionProperty] = cssProperties.join(", "); + cssValues[transitionDuration] = duration + "s"; + cssValues[transitionDelay] = delay + "s"; + cssValues[transitionTiming] = ease; + } + + wrappedCallback = function(event) { + fired = true; + if (event) { + if (event.target !== event.currentTarget) { + return // makes sure the event didn't bubble from "below" + } + eventer.off(event.target, endEvent, wrappedCallback) + } else { + eventer.off(elm, animationEnd, wrappedCallback) // triggered by setTimeout + } + styler.css(elm, cssReset); + callback && callback.call(this); + }; + + if (duration > 0) { + eventer.on(elm, endEvent, wrappedCallback); + // transitionEnd is not always firing on older Android phones + // so make sure it gets fired + langx.debounce(function() { + if (fired) { + return; + } + wrappedCallback.call(that); + }, ((duration + delay) * 1000) + 25)(); + } + + // trigger page reflow so new elements can animate + elm.clientLeft; + + styler.css(elm, cssValues); + + if (duration <= 0) { + langx.debounce(function() { + if (fired) { + return; + } + wrappedCallback.call(that); + }, 0)(); + } + + if (hasScrollTop) { + scrollToTop(elm, properties["scrollTop"], duration, callback); + } + + return this; + } + + function show(elm, speed, callback) { + styler.show(elm); + if (speed) { + if (!callback && langx.isFunction(speed)) { + callback = speed; + speed = "normal"; + } + styler.css(elm, "opacity", 0) + animate(elm, { opacity: 1, scale: "1,1" }, speed, callback); + } + return this; + } + + + function hide(elm, speed, callback) { + if (speed) { + if (!callback && langx.isFunction(speed)) { + callback = speed; + speed = "normal"; + } + animate(elm, { opacity: 0, scale: "0,0" }, speed, function() { + styler.hide(elm); + if (callback) { + callback.call(elm); + } + }); + } else { + styler.hide(elm); + } + return this; + } + + function scrollToTop(elm, pos, speed, callback) { + var scrollFrom = parseInt(elm.scrollTop), + i = 0, + runEvery = 5, // run every 5ms + freq = speed * 1000 / runEvery, + scrollTo = parseInt(pos); + + var interval = setInterval(function() { + i++; + + if (i <= freq) elm.scrollTop = (scrollTo - scrollFrom) / freq * i + scrollFrom; + + if (i >= freq + 1) { + clearInterval(interval); + if (callback) langx.debounce(callback, 1000)(); + } + }, runEvery); + } + + function toggle(elm, speed, callback) { + if (styler.isInvisible(elm)) { + show(elm, speed, callback); + } else { + hide(elm, speed, callback); + } + return this; + } + + function fadeTo(elm, speed, opacity, easing, callback) { + animate(elm, { opacity: opacity }, speed, easing, callback); + return this; + } + + function fadeIn(elm, speed, easing, callback) { + var target = styler.css(elm, "opacity"); + if (target > 0) { + styler.css(elm, "opacity", 0); + } else { + target = 1; + } + styler.show(elm); + + fadeTo(elm, speed, target, easing, callback); + + return this; + } + + function fadeOut(elm, speed, easing, callback) { + var _elm = elm, + complete, + options = {}; + + if (langx.isPlainObject(speed)) { + options.easing = speed.easing; + options.duration = speed.duration; + complete = speed.complete; + } else { + options.duration = speed; + if (callback) { + complete = callback; + options.easing = easing; + } else { + complete = easing; + } + } + options.complete = function() { + styler.hide(elm); + if (complete) { + complete.call(elm); + } + } + + fadeTo(elm, options, 0); + + return this; + } + + function fadeToggle(elm, speed, ceasing, allback) { + if (styler.isInvisible(elm)) { + fadeIn(elm, speed, easing, callback); + } else { + fadeOut(elm, speed, easing, callback); + } + return this; + } + + function slideDown(elm,duration,callback) { + + // get the element position to restore it then + var position = styler.css(elm,'position'); + + // show element if it is hidden + show(elm); + + // place it so it displays as usually but hidden + styler.css(elm,{ + position: 'absolute', + visibility: 'hidden' + }); + + // get naturally height, margin, padding + var marginTop = styler.css(elm,'margin-top'); + var marginBottom = styler.css(elm,'margin-bottom'); + var paddingTop = styler.css(elm,'padding-top'); + var paddingBottom = styler.css(elm,'padding-bottom'); + var height = styler.css(elm,'height'); + + // set initial css for animation + styler.css(elm,{ + position: position, + visibility: 'visible', + overflow: 'hidden', + height: 0, + marginTop: 0, + marginBottom: 0, + paddingTop: 0, + paddingBottom: 0 + }); + + // animate to gotten height, margin and padding + animate(elm,{ + height: height, + marginTop: marginTop, + marginBottom: marginBottom, + paddingTop: paddingTop, + paddingBottom: paddingBottom + }, { + duration : duration, + complete: function(){ + if (callback) { + callback.apply(elm); + } + } + } + ); + + return this; + }; + + function slideUp(elm,duration,callback) { + // active the function only if the element is visible + if (geom.height(elm) > 0) { + + // get the element position to restore it then + var position = styler.css(elm,'position'); + + // get the element height, margin and padding to restore them then + var height = styler.css(elm,'height'); + var marginTop = styler.css(elm,'margin-top'); + var marginBottom = styler.css(elm,'margin-bottom'); + var paddingTop = styler.css(elm,'padding-top'); + var paddingBottom = styler.css(elm,'padding-bottom'); + + // set initial css for animation + styler.css(elm,{ + visibility: 'visible', + overflow: 'hidden', + height: height, + marginTop: marginTop, + marginBottom: marginBottom, + paddingTop: paddingTop, + paddingBottom: paddingBottom + }); + + // animate element height, margin and padding to zero + animate(elm,{ + height: 0, + marginTop: 0, + marginBottom: 0, + paddingTop: 0, + paddingBottom: 0 + }, { + // callback : restore the element position, height, margin and padding to original values + duration: duration, + queue: false, + complete: function(){ + hide(elm); + styler.css(elm,{ + visibility: 'visible', + overflow: 'hidden', + height: height, + marginTop: marginTop, + marginBottom: marginBottom, + paddingTop: paddingTop, + paddingBottom: paddingBottom + }); + if (callback) { + callback.apply(elm); + } + } + }); + } + return this; + }; + + /* SlideToggle */ + function slideToggle(elm,duration,callback) { + + // if the element is hidden, slideDown ! + if (geom.height(elm) == 0) { + slideDown(elm,duration,callback); + } + // if the element is visible, slideUp ! + else { + slideUp(elm,duration,callback); + } + return this; + }; + + + function fx() { + return fx; + } + + langx.mixin(fx, { + off: false, + + speeds: { + normal: 400, + fast: 200, + slow: 600 + }, + + animate: animate, + fadeIn: fadeIn, + fadeOut: fadeOut, + fadeTo: fadeTo, + fadeToggle: fadeToggle, + hide: hide, + scrollToTop: scrollToTop, + + slideDown : slideDown, + slideToggle : slideToggle, + slideUp : slideUp, + show: show, + toggle: toggle + }); + + return skylark.fx = fx; +}); +define('skylarkjs/fx',[ + "skylark-utils/fx" +], function(fx) { + return fx; +}); + +define('skylarkjs/geom',[ + "skylark-utils/geom" +], function(geom) { + return geom; +}); + +define('skylark-utils/http',[ + "./skylark", + "./langx" +],function(skylark, langx){ + var Deferred = langx.Deferred, + blankRE = /^\s*$/, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i; + + + function empty() {} + + var ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function() { + return new window.XMLHttpRequest(); + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: 'application/json', + xml: 'application/xml, text/xml', + html: 'text/html', + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true + } + + function mimeToDataType(mime) { + if (mime) { + mime = mime.split(';', 2)[0]; + } + return mime && (mime == 'text/html' ? 'html' : + mime == 'application/json' ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml') || 'text'; + } + + function appendQuery(url, query) { + if (query == '') { + return url; + } + return (url + '&' + query).replace(/[&?]{1,2}/, '?'); + } + + function serialize(params, obj, traditional, scope) { + var type, array = langx.isArray(obj), + hash = langx.isPlainObject(obj) + langx.each(obj, function(key, value) { + type = langx.type(value); + if (scope) { + key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' ; + } + // handle data in serializeArray() format + if (!scope && array) { + params.add(value.name, value.value); + // recurse into nested objects + } else if (type == "array" || (!traditional && type == "object")) { + serialize(params, value, traditional, key); + } else { + params.add(key, value); + } + }) + } + + function param(obj, traditional) { + var params = [] + params.add = function(key, value) { + if (langx.isFunction(value)) { + value = value(); + } + if (value == null) { + value = ""; + } + this.push(escape(key) + '=' + escape(value)); + } + + serialize(params, obj, traditional); + + return params.join('&').replace(/%20/g, '+') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && !langx.isString(options.data)) { + options.data = $.param(options.data, options.traditional) + } + if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) { + options.url = appendQuery(options.url, options.data); + options.data = undefined; + } + } + + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, + status = 'success' + settings.success.call(context, data, status, xhr) + //if (deferred) deferred.resolveWith(context, [data, status, xhr]) + //triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + //if (deferred) deferred.rejectWith(context, [xhr, type, error]) + //triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + //triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + //ajaxStop(settings) + } + + function ajax(options) { + var settings = langx.mixin({}, options), + deferred = new Deferred(); + + langx.safeMixin(settings,ajaxSettings); + + //ajaxStart(settings) + if (!settings.crossDomain) { + // settings.crossDomain = !langx.isSameOrigin(settings.url); + } + + serializeData(settings); + var dataType = settings.dataType; + + var mime = settings.accepts[dataType], + headers = {}, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout; + + //if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) { + setHeader('X-Requested-With', 'XMLHttpRequest'); + } + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) { + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + } + + if (settings.headers) { + for (name in settings.headers) { + setHeader(name, settings.headers[name]); + } + } + xhr.setRequestHeader = setHeader; + + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType == 'script') { + (1, eval)(result); + } else if (dataType == 'xml') { + result = xhr.responseXML + } else if (dataType == 'json') { + result = blankRE.test(result) ? null : JSON.parse(result); + } + } catch (e) { + error = e + } + + if (error) { + ajaxError(error, 'parsererror', xhr, settings, deferred); + } else { + ajaxSuccess(result, xhr, settings, deferred); + } + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred); + } + } + } + + /* + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + if (settings.xhrFields) + for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + */ + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + for (name in headers) { + nativeSetHeader.apply(xhr, headers[name]); + } + + if (settings.timeout > 0) { + abortTimeout = setTimeout(function() { + xhr.onreadystatechange = empty; + xhr.abort(); + ajaxError(null, 'timeout', xhr, settings, deferred); + }, settings.timeout); + } + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr; + } + + + function get( /* url, data, success, dataType */ ) { + return ajax(parseArguments.apply(null, arguments)) + } + + function post( /* url, data, success, dataType */ ) { + var options = parseArguments.apply(null, arguments); + options.type = 'POST'; + return ajax(options); + } + + function getJSON( /* url, data, success */ ) { + var options = parseArguments.apply(null, arguments); + options.dataType = 'json'; + return ajax(options); + } + + + function http(){ + return http; + } + + langx.mixin(http, { + ajax: ajax, + + get: get, + + gtJSON: getJSON, + + post: post + + }); + + return skylark.http = http; +}); + +define('skylarkjs/http',[ + "skylark-utils/http" +], function(http) { + return http; +}); + +define('skylark-utils/images',[ + "./skylark", + "./langx" +], function(skylark,langx) { + + var elementNodeTypes = { + 1: true, + 9: true, + 11: true + }; + + var ImagesLoaded = langx.Evented.inherit({ + /** + * @param {Array, Element, NodeList, String} elem + * @param {Object or Function} options - if function, use as callback + * @param {Function} onAlways - callback function + */ + init : function(elem, options, onAlways) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + if ( typeof elem == 'string' ) { + elem = document.querySelectorAll( elem ); + } + + this.elements = langx.makeArray( elem ); + this.options = langx.mixin( {}, this.options ); + + if ( typeof options == 'function' ) { + onAlways = options; + } else { + langx.mixin( this.options, options ); + } + + if ( onAlways ) { + this.on( 'always', onAlways ); + } + + this.getImages(); + + // HACK check async to allow time to bind listeners + setTimeout( function() { + this.check(); + }.bind( this )); + + }, + + options : {}, + + getImages : function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); + }, + + /** + * @param {Node} element + */ + addElementImages : function( elem ) { + // filter siblings + if ( elem.nodeName == 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + var nodeType = elem.nodeType; + if ( !nodeType || !elementNodeTypes[ nodeType ] ) { + return; + } + var childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( var i=0; i < childImgs.length; i++ ) { + var img = childImgs[i]; + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + var children = elem.querySelectorAll( this.options.background ); + for ( i=0; i < children.length; i++ ) { + var child = children[i]; + this.addElementBackgroundImages( child ); + } + } + }, + + addElementBackgroundImages : function( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + return; + } + // get url inside url("...") + var reURL = /url\((['"])?(.*?)\1\)/gi; + var matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + var url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } + }, + + /** + * @param {Image} img + */ + addImage : function( img ) { + var loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); + }, + + addBackground : function( url, elem ) { + var background = new Background( url, elem ); + this.images.push( background ); + }, + + check : function() { + var _this = this; + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + function onProgress( e ) { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( function() { + _this.progress( e ); + }); + } + + this.images.forEach( function( loadingImage ) { + loadingImage.one( 'progress', onProgress ); + loadingImage.check(); + }); + }, + + progress : function( e ) { + + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded; + // progress event + this.trigger( langx.createEvent('progress', { + img : e.img, + element : e.element, + message : e.message, + isLoaded : e.isLoaded + })); + + // check if completed + if ( this.progressedCount == this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( 'progress: ' + message, e.target, e.element ); + } + }, + + complete : function() { + var eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.trigger( eventName); + this.trigger( 'always'); + + } + + }); + + + // -------------------------- -------------------------- // + + var LoadingImage = langx.Evented.inherit({ + init: function( img ) { + this.img = img; + }, + check : function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.src; + }, + + getIsImageComplete : function() { + return this.img.complete && this.img.naturalWidth !== undefined; + }, + + confirm : function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.trigger( langx.createEvent('progress', { + img : this.img, + element : this.img, + message : message , + isLoaded : isLoaded + })); + }, + + // ----- events ----- // + + // trigger specified handler for event type + handleEvent : function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } + }, + + onload : function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); + }, + + onerror : function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); + }, + + unbindEvents : function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); + }, + + }); + + + // -------------------------- Background -------------------------- // + var Background = LoadingImage.inherit({ + + init : function( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); + }, + + check : function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } + }, + + unbindEvents : function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); + }, + + confirm : function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.trigger( langx.createEvent('progress', { + img : this.img, + element : this.element, + message : message, + isLoaded : isLoaded + })); + } + }); + + + function images() { + return images; + } + + langx.mixin(images, { + loaded : ImagesLoaded + }); + + return skylark.images = images; +}); + +define('skylarkjs/images',[ + "skylark-utils/images" +], function(images) { + return images; +}); + +define('skylark-utils/mover',[ + "./skylark", + "./langx", + "./noder", + "./datax", + "./geom", + "./eventer", + "./styler" +],function(skylark, langx,noder,datax,geom,eventer,styler){ + var on = eventer.on, + off = eventer.off, + attr = datax.attr, + removeAttr = datax.removeAttr, + offset = geom.pagePosition, + addClass = styler.addClass, + height = geom.height, + some = Array.prototype.some, + map = Array.prototype.map; + + function _place(/*DomNode*/ node, choices, layoutNode, aroundNodeCoords){ + // summary: + // Given a list of spots to put node, put it at the first spot where it fits, + // of if it doesn't fit anywhere then the place with the least overflow + // choices: Array + // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} } + // Above example says to put the top-left corner of the node at (10,20) + // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size) + // for things like tooltip, they are displayed differently (and have different dimensions) + // based on their orientation relative to the parent. This adjusts the popup based on orientation. + // It also passes in the available size for the popup, which is useful for tooltips to + // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing + // how much the popup had to be modified to fit into the available space. This is used to determine + // what the best placement is. + // aroundNodeCoords: Object + // Size of aroundNode, ex: {w: 200, h: 50} + + // get {x: 10, y: 10, w: 100, h:100} type obj representing position of + // viewport over document + + var doc = noder.ownerDoc(node), + win = noder.ownerWindow(doc), + view = geom.size(win); + + view.left = 0; + view.top = 0; + + if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ + doc.body.appendChild(node); + } + + var best = null; + + some.apply(choices, function(choice){ + var corner = choice.corner; + var pos = choice.pos; + var overflow = 0; + + // calculate amount of space available given specified position of node + var spaceAvailable = { + w: { + 'L': view.left + view.width - pos.x, + 'R': pos.x - view.left, + 'M': view.width + }[corner.charAt(1)], + + h: { + 'T': view.top + view.height - pos.y, + 'B': pos.y - view.top, + 'M': view.height + }[corner.charAt(0)] + }; + + if(layoutNode){ + var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords); + overflow = typeof res == "undefined" ? 0 : res; + } + + var bb = geom.size(node); + + // coordinates and size of node with specified corner placed at pos, + // and clipped by viewport + var + startXpos = { + 'L': pos.x, + 'R': pos.x - bb.width, + 'M': Math.max(view.left, Math.min(view.left + view.width, pos.x + (bb.width >> 1)) - bb.width) // M orientation is more flexible + }[corner.charAt(1)], + + startYpos = { + 'T': pos.y, + 'B': pos.y - bb.height, + 'M': Math.max(view.top, Math.min(view.top + view.height, pos.y + (bb.height >> 1)) - bb.height) + }[corner.charAt(0)], + + startX = Math.max(view.left, startXpos), + startY = Math.max(view.top, startYpos), + endX = Math.min(view.left + view.width, startXpos + bb.width), + endY = Math.min(view.top + view.height, startYpos + bb.height), + width = endX - startX, + height = endY - startY; + + overflow += (bb.width - width) + (bb.height - height); + + if(best == null || overflow < best.overflow){ + best = { + corner: corner, + aroundCorner: choice.aroundCorner, + left: startX, + top: startY, + width: width, + height: height, + overflow: overflow, + spaceAvailable: spaceAvailable + }; + } + + return !overflow; + }); + + // In case the best position is not the last one we checked, need to call + // layoutNode() again. + if(best.overflow && layoutNode){ + layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords); + } + + + geom.boundingPosition(node,best); + + return best; + } + + function at(node, pos, corners, padding, layoutNode){ + var choices = map.apply(corners, function(corner){ + var c = { + corner: corner, + aroundCorner: reverse[corner], // so TooltipDialog.orient() gets aroundCorner argument set + pos: {x: pos.x,y: pos.y} + }; + if(padding){ + c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x; + c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y; + } + return c; + }); + + return _place(node, choices, layoutNode); + } + + function around( + /*DomNode*/ node, + /*DomNode|__Rectangle*/ anchor, + /*String[]*/ positions, + /*Boolean*/ leftToRight, + /*Function?*/ layoutNode){ + + // summary: + // Position node adjacent or kitty-corner to anchor + // such that it's fully visible in viewport. + // description: + // Place node such that corner of node touches a corner of + // aroundNode, and that node is fully visible. + // anchor: + // Either a DOMNode or a rectangle (object with x, y, width, height). + // positions: + // Ordered list of positions to try matching up. + // + // - before: places drop down to the left of the anchor node/widget, or to the right in the case + // of RTL scripts like Hebrew and Arabic; aligns either the top of the drop down + // with the top of the anchor, or the bottom of the drop down with bottom of the anchor. + // - after: places drop down to the right of the anchor node/widget, or to the left in the case + // of RTL scripts like Hebrew and Arabic; aligns either the top of the drop down + // with the top of the anchor, or the bottom of the drop down with bottom of the anchor. + // - before-centered: centers drop down to the left of the anchor node/widget, or to the right + // in the case of RTL scripts like Hebrew and Arabic + // - after-centered: centers drop down to the right of the anchor node/widget, or to the left + // in the case of RTL scripts like Hebrew and Arabic + // - above-centered: drop down is centered above anchor node + // - above: drop down goes above anchor node, left sides aligned + // - above-alt: drop down goes above anchor node, right sides aligned + // - below-centered: drop down is centered above anchor node + // - below: drop down goes below anchor node + // - below-alt: drop down goes below anchor node, right sides aligned + // layoutNode: Function(node, aroundNodeCorner, nodeCorner) + // For things like tooltip, they are displayed differently (and have different dimensions) + // based on their orientation relative to the parent. This adjusts the popup based on orientation. + // leftToRight: + // True if widget is LTR, false if widget is RTL. Affects the behavior of "above" and "below" + // positions slightly. + // example: + // | placeAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'}); + // This will try to position node such that node's top-left corner is at the same position + // as the bottom left corner of the aroundNode (ie, put node below + // aroundNode, with left edges aligned). If that fails it will try to put + // the bottom-right corner of node where the top right corner of aroundNode is + // (ie, put node above aroundNode, with right edges aligned) + // + + // If around is a DOMNode (or DOMNode id), convert to coordinates. + var aroundNodePos; + if(typeof anchor == "string" || "offsetWidth" in anchor || "ownerSVGElement" in anchor){ + aroundNodePos = domGeometry.position(anchor, true); + + // For above and below dropdowns, subtract width of border so that popup and aroundNode borders + // overlap, preventing a double-border effect. Unfortunately, difficult to measure the border + // width of either anchor or popup because in both cases the border may be on an inner node. + if(/^(above|below)/.test(positions[0])){ + var anchorBorder = domGeometry.getBorderExtents(anchor), + anchorChildBorder = anchor.firstChild ? domGeometry.getBorderExtents(anchor.firstChild) : {t:0,l:0,b:0,r:0}, + nodeBorder = domGeometry.getBorderExtents(node), + nodeChildBorder = node.firstChild ? domGeometry.getBorderExtents(node.firstChild) : {t:0,l:0,b:0,r:0}; + aroundNodePos.y += Math.min(anchorBorder.t + anchorChildBorder.t, nodeBorder.t + nodeChildBorder.t); + aroundNodePos.h -= Math.min(anchorBorder.t + anchorChildBorder.t, nodeBorder.t+ nodeChildBorder.t) + + Math.min(anchorBorder.b + anchorChildBorder.b, nodeBorder.b + nodeChildBorder.b); + } + }else{ + aroundNodePos = anchor; + } + + // Compute position and size of visible part of anchor (it may be partially hidden by ancestor nodes w/scrollbars) + if(anchor.parentNode){ + // ignore nodes between position:relative and position:absolute + var sawPosAbsolute = domStyle.getComputedStyle(anchor).position == "absolute"; + var parent = anchor.parentNode; + while(parent && parent.nodeType == 1 && parent.nodeName != "BODY"){ //ignoring the body will help performance + var parentPos = domGeometry.position(parent, true), + pcs = domStyle.getComputedStyle(parent); + if(/relative|absolute/.test(pcs.position)){ + sawPosAbsolute = false; + } + if(!sawPosAbsolute && /hidden|auto|scroll/.test(pcs.overflow)){ + var bottomYCoord = Math.min(aroundNodePos.y + aroundNodePos.h, parentPos.y + parentPos.h); + var rightXCoord = Math.min(aroundNodePos.x + aroundNodePos.w, parentPos.x + parentPos.w); + aroundNodePos.x = Math.max(aroundNodePos.x, parentPos.x); + aroundNodePos.y = Math.max(aroundNodePos.y, parentPos.y); + aroundNodePos.h = bottomYCoord - aroundNodePos.y; + aroundNodePos.w = rightXCoord - aroundNodePos.x; + } + if(pcs.position == "absolute"){ + sawPosAbsolute = true; + } + parent = parent.parentNode; + } + } + + var x = aroundNodePos.x, + y = aroundNodePos.y, + width = "w" in aroundNodePos ? aroundNodePos.w : (aroundNodePos.w = aroundNodePos.width), + height = "h" in aroundNodePos ? aroundNodePos.h : (kernel.deprecated("place.around: dijit/place.__Rectangle: { x:"+x+", y:"+y+", height:"+aroundNodePos.height+", width:"+width+" } has been deprecated. Please use { x:"+x+", y:"+y+", h:"+aroundNodePos.height+", w:"+width+" }", "", "2.0"), aroundNodePos.h = aroundNodePos.height); + + // Convert positions arguments into choices argument for _place() + var choices = []; + function push(aroundCorner, corner){ + choices.push({ + aroundCorner: aroundCorner, + corner: corner, + pos: { + x: { + 'L': x, + 'R': x + width, + 'M': x + (width >> 1) + }[aroundCorner.charAt(1)], + y: { + 'T': y, + 'B': y + height, + 'M': y + (height >> 1) + }[aroundCorner.charAt(0)] + } + }) + } + array.forEach(positions, function(pos){ + var ltr = leftToRight; + switch(pos){ + case "above-centered": + push("TM", "BM"); + break; + case "below-centered": + push("BM", "TM"); + break; + case "after-centered": + ltr = !ltr; + // fall through + case "before-centered": + push(ltr ? "ML" : "MR", ltr ? "MR" : "ML"); + break; + case "after": + ltr = !ltr; + // fall through + case "before": + push(ltr ? "TL" : "TR", ltr ? "TR" : "TL"); + push(ltr ? "BL" : "BR", ltr ? "BR" : "BL"); + break; + case "below-alt": + ltr = !ltr; + // fall through + case "below": + // first try to align left borders, next try to align right borders (or reverse for RTL mode) + push(ltr ? "BL" : "BR", ltr ? "TL" : "TR"); + push(ltr ? "BR" : "BL", ltr ? "TR" : "TL"); + break; + case "above-alt": + ltr = !ltr; + // fall through + case "above": + // first try to align left borders, next try to align right borders (or reverse for RTL mode) + push(ltr ? "TL" : "TR", ltr ? "BL" : "BR"); + push(ltr ? "TR" : "TL", ltr ? "BR" : "BL"); + break; + default: + // To assist dijit/_base/place, accept arguments of type {aroundCorner: "BL", corner: "TL"}. + // Not meant to be used directly. Remove for 2.0. + push(pos.aroundCorner, pos.corner); + } + }); + + var position = _place(node, choices, layoutNode, {w: width, h: height}); + position.aroundNodePos = aroundNodePos; + + return position; + } + + function movable(elm, params) { + function updateWithTouchData(e) { + var keys, i; + + if (e.changedTouches) { + keys = "screenX screenY pageX pageY clientX clientY".split(' '); + for (i = 0; i < keys.length; i++) { + e[keys[i]] = e.changedTouches[0][keys[i]]; + } + } + } + + params = params || {}; + var handleEl = params.handle || elm, + constraints = params.constraints, + overlayDiv, + doc = params.document || document, + downButton, + start, + stop, + drag, + startX, + startY, + originalPos, + size, + startedCallback = params.started, + movingCallback = params.moving, + stoppedCallback = params.stopped, + + start = function(e) { + var docSize = geom.getDocumentSize(doc), + cursor; + + updateWithTouchData(e); + + e.preventDefault(); + downButton = e.button; + //handleEl = getHandleEl(); + startX = e.screenX; + startY = e.screenY; + + originalPos = geom.relativePosition(elm); + size = geom.size(elm); + + // Grab cursor from handle so we can place it on overlay + cursor = styler.css(handleEl, "curosr"); + + overlayDiv = noder.createElement("div"); + styler.css(overlayDiv, { + position: "absolute", + top: 0, + left: 0, + width: docSize.width, + height: docSize.height, + zIndex: 0x7FFFFFFF, + opacity: 0.0001, + cursor: cursor + }); + noder.append(doc.body, overlayDiv); + + eventer.on(doc, "mousemove touchmove", move).on(doc, "mouseup touchend", stop); + + if (startedCallback) { + startedCallback(e); + } + }, + + move = function(e) { + updateWithTouchData(e); + + if (e.button !== 0) { + return stop(e); + } + + e.deltaX = e.screenX - startX; + e.deltaY = e.screenY - startY; + + var l = originalPos.left + e.deltaX, + t = originalPos.top + e.deltaY; + if (constraints) { + + if (l < constraints.minX) { + l = constraints.minX; + } + + if (l > constraints.maxX) { + l = constraints.maxX; + } + + if (t < constraints.minY) { + t = constraints.minY; + } + + if (t > constraints.maxY) { + t = constraints.maxY; + } + } + geom.relativePosition(elm, { + left: l, + top: t + }) + + e.preventDefault(); + if (movingCallback) { + movingCallback(e); + } + }, + + stop = function(e) { + updateWithTouchData(e); + + eventer.off(doc, "mousemove touchmove", move).off(doc, "mouseup touchend", stop); + + noder.remove(overlayDiv); + + if (stoppedCallback) { + stoppedCallback(e); + } + }; + + eventer.on(handleEl, "mousedown touchstart", start); + + return { + // destroys the dragger. + remove: function() { + eventer.off(handleEl); + } + } + } + + function mover(){ + return mover; + } + + langx.mixin(mover, { + around : around, + + at: at, + + movable: movable + + }); + + return skylark.mover = mover; +}); + +define('skylarkjs/mover',[ + "skylark-utils/mover" +], function(mover) { + return mover; +}); + +define('skylarkjs/noder',[ + "skylark-utils/noder" +], function(noder) { + return noder; +}); + +define('skylark-utils/query',[ + "./skylark", + "./langx", + "./noder", + "./datax", + "./eventer", + "./finder", + "./geom", + "./styler", + "./fx" +], function(skylark, langx, noder, datax, eventer, finder, geom, styler, fx) { + var some = Array.prototype.some, + push = Array.prototype.push, + every = Array.prototype.every, + concat = Array.prototype.concat, + slice = Array.prototype.slice, + map = Array.prototype.map, + filter = Array.prototype.filter, + forEach = Array.prototype.forEach, + isQ; + + var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/; + + var funcArg = langx.funcArg, + isArrayLike = langx.isArrayLike, + isString = langx.isString, + uniq = langx.uniq, + isFunction = langx.isFunction; + + var type = langx.type, + isArray = langx.isArray, + + isWindow = langx.isWindow, + + isDocument = langx.isDocument, + + isObject = langx.isObject, + + isPlainObject = langx.isPlainObject, + + compact = langx.compact, + + flatten = langx.flatten, + + camelCase = langx.camelCase, + + dasherize = langx.dasherize, + children = finder.children; + + function wrapper_map(func, context) { + return function() { + var self = this, + params = slice.call(arguments); + var result = $.map(self, function(elem, idx) { + return func.apply(context, [elem].concat(params)); + }); + return $(uniq(result)); + } + } + + function wrapper_selector(func, context, last) { + return function(selector) { + var self = this, + params = slice.call(arguments); + var result = this.map(function(idx, elem) { + // if (elem.nodeType == 1) { + if (elem.querySelector) { + return func.apply(context, last ? [elem] : [elem, selector]); + } + }); + if (last && selector) { + return result.filter(selector); + } else { + return result; + } + } + } + + function wrapper_selector_until(func, context, last) { + return function(util, selector) { + var self = this, + params = slice.call(arguments); + if (selector === undefined) { + selector = util; + util = undefined; + } + var result = this.map(function(idx, elem) { + // if (elem.nodeType == 1) { + if (elem.querySelector) { + return func.apply(context, last ? [elem, util] : [elem, selector, util]); + } + }); + if (last && selector) { + return result.filter(selector); + } else { + return result; + } + } + } + + + function wrapper_every_act(func, context) { + return function() { + var self = this, + params = slice.call(arguments); + this.each(function(idx) { + func.apply(context, [this].concat(params)); + }); + return self; + } + } + + function wrapper_every_act_firstArgFunc(func, context, oldValueFunc) { + return function(arg1) { + var self = this, + params = slice.call(arguments); + forEach.call(self, function(elem, idx) { + var newArg1 = funcArg(elem, arg1, idx, oldValueFunc(elem)); + func.apply(context, [elem, arg1].concat(params.slice(1))); + }); + return self; + } + } + + function wrapper_some_chk(func, context) { + return function() { + var self = this, + params = slice.call(arguments); + return some.call(self, function(elem) { + return func.apply(context, [elem].concat(params)); + }); + } + } + + function wrapper_name_value(func, context, oldValueFunc) { + return function(name, value) { + var self = this, + params = slice.call(arguments); + + if (langx.isPlainObject(name) || langx.isDefined(value)) { + forEach.call(self, function(elem, idx) { + var newValue; + if (oldValueFunc) { + newValue = funcArg(elem, value, idx, oldValueFunc(elem, name)); + } else { + newValue = value + } + func.apply(context, [elem].concat(params)); + }); + return self; + } else { + if (self[0]) { + return func.apply(context, [self[0], name]); + } + } + + } + } + + function wrapper_value(func, context, oldValueFunc) { + return function(value) { + var self = this; + + if (langx.isDefined(value)) { + forEach.call(self, function(elem, idx) { + var newValue; + if (oldValueFunc) { + newValue = funcArg(elem, value, idx, oldValueFunc(elem)); + } else { + newValue = value + } + func.apply(context, [elem, newValue]); + }); + return self; + } else { + if (self[0]) { + return func.apply(context, [self[0]]); + } + } + + } + } + + var NodeList = langx.klass({ + klassName: "SkNodeList", + init: function(selector, context) { + var self = this, + match, nodes, node, props; + + if (selector) { + self.context = context = context || noder.doc(); + + if (isString(selector)) { + // a html string or a css selector is expected + self.selector = selector; + + if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { + match = [null, selector, null]; + } else { + match = rquickExpr.exec(selector); + } + + if (match) { + if (match[1]) { + // if selector is html + nodes = noder.createFragment(selector); + + if (langx.isPlainObject(context)) { + props = context; + } + + } else { + node = finder.byId(match[2], noder.ownerDoc(context)); + + if (node) { + // if selector is id + nodes = [node]; + } + + } + } else { + // if selector is css selector + nodes = finder.descendants(context, selector); + } + } else { + if (isArray(selector)) { + // a dom node array is expected + nodes = selector; + } else { + // a dom node is expected + nodes = [selector]; + } + //self.add(selector, false); + } + } + + + if (nodes) { + + push.apply(self, nodes); + + if (props) { + for ( var name in props ) { + // Properties of context are called as methods if possible + if ( langx.isFunction( this[ name ] ) ) { + this[ name ]( props[ name ] ); + } else { + this.attr( name, props[ name ] ); + } + } + } + } + + return self; + } + }, Array); + + var query = (function() { + isQ = function(object) { + return object instanceof NodeList; + } + init = function(selector, context) { + return new NodeList(selector, context); + } + + var $ = function(selector, context) { + if (isFunction(selector)) { + eventer.ready(function() { + selector($); + }); + } else if (isQ(selector)) { + return selector; + } else { + if (context && isQ(context) && isString(selector)) { + return context.find(selector); + } + return init(selector, context); + } + }; + + $.fn = NodeList.prototype; + langx.mixin($.fn, { + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + + map: function(fn) { + return $(uniq(langx.map(this, function(el, i) { + return fn.call(el, i, el) + }))); + }, + + slice: function() { + return $(slice.apply(this, arguments)) + }, + + get: function(idx) { + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + + toArray: function() { + return slice.call(this); + }, + + size: function() { + return this.length + }, + + remove: wrapper_every_act(noder.remove, noder), + + each: function(callback) { + langx.each(this, callback); + return this; + }, + + filter: function(selector) { + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element) { + return finder.matches(element, selector) + })) + }, + + add: function(selector, context) { + return $(uniq(this.toArray().concat($(selector, context).toArray()))); + }, + + is: function(selector) { + return this.length > 0 && finder.matches(this[0], selector) + }, + + not: function(selector) { + var nodes = [] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx) { + if (!selector.call(this, idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (isArrayLike(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el) { + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + + has: function(selector) { + return this.filter(function() { + return isObject(selector) ? + noder.contains(this, selector) : + $(this).find(selector).size() + }) + }, + + eq: function(idx) { + return idx === -1 ? this.slice(idx) : this.slice(idx, +idx + 1); + }, + + first: function() { + return this.eq(0); + }, + + last: function() { + return this.eq(-1); + }, + + find: wrapper_selector(finder.descendants, finder), + + closest: wrapper_selector(finder.closest, finder), + /* + closest: function(selector, context) { + var node = this[0], + collection = false + if (typeof selector == 'object') collection = $(selector) + while (node && !(collection ? collection.indexOf(node) >= 0 : finder.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + return $(node) + }, + */ + + + parents: wrapper_selector(finder.ancestors, finder), + + parentsUntil: wrapper_selector_until(finder.ancestors, finder), + + + parent: wrapper_selector(finder.parent, finder), + + children: wrapper_selector(finder.children, finder), + + contents: wrapper_map(noder.contents, noder), + + empty: wrapper_every_act(noder.empty, noder), + + // `pluck` is borrowed from Prototype.js + pluck: function(property) { + return langx.map(this, function(el) { + return el[property] + }) + }, + + show: wrapper_every_act(fx.show, fx), + + replaceWith: function(newContent) { + return this.before(newContent).remove(); + }, + + wrap: function(structure) { + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index) { + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + + wrapAll: function(wrappingElement) { + if (this[0]) { + $(this[0]).before(wrappingElement = $(wrappingElement)); + var children; + // drill down to the inmost element + while ((children = wrappingElement.children()).length) { + wrappingElement = children.first(); + } + $(wrappingElement).append(this); + } + return this + }, + + wrapInner: function(wrappingElement) { + var func = isFunction(wrappingElement) + return this.each(function(index) { + var self = $(this), + contents = self.contents(), + dom = func ? wrappingElement.call(this, index) : wrappingElement + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + + unwrap: function(selector) { + if (this.parent().children().length === 0) { + // remove dom without text + this.parent(selector).not("body").each(function() { + $(this).replaceWith(document.createTextNode(this.childNodes[0].textContent)); + }); + } else { + this.parent().each(function() { + $(this).replaceWith($(this).children()) + }); + } + return this + }, + + clone: function() { + return this.map(function() { + return this.cloneNode(true) + }) + }, + + hide: wrapper_every_act(fx.hide, fx), + + toggle: function(setting) { + return this.each(function() { + var el = $(this); + (setting === undefined ? el.css("display") == "none" : setting) ? el.show(): el.hide() + }) + }, + + prev: function(selector) { + return $(this.pluck('previousElementSibling')).filter(selector || '*') + }, + + prevAll: wrapper_selector(finder.previousSibling, finder), + + next: function(selector) { + return $(this.pluck('nextElementSibling')).filter(selector || '*') + }, + + nextAll: wrapper_selector(finder.nextSiblings, finder), + + siblings: wrapper_selector(finder.siblings, finder), + + html: wrapper_value(noder.html, noder, noder.html), + + text: wrapper_value(datax.text, datax, datax.text), + + attr: wrapper_name_value(datax.attr, datax, datax.attr), + + removeAttr: wrapper_every_act(datax.removeAttr, datax), + + prop: wrapper_name_value(datax.prop, datax, datax.prop), + + removeProp: wrapper_every_act(datax.removeProp, datax), + + data: wrapper_name_value(datax.data, datax, datax.data), + + removeData: wrapper_every_act(datax.removeData, datax), + + val: wrapper_value(datax.val, datax, datax.val), + + offset: wrapper_value(geom.pageRect, geom, geom.pageRect), + + style: wrapper_name_value(styler.css, styler), + + css: wrapper_name_value(styler.css, styler), + + index: function(elem) { + if (elem) { + return this.indexOf($(elem)[0]); + } else { + return this.parent().children().indexOf(this[0]); + } + }, + + //hasClass(name) + hasClass: wrapper_some_chk(styler.hasClass, styler), + + //addClass(name) + addClass: wrapper_every_act_firstArgFunc(styler.addClass, styler, styler.className), + + //removeClass(name) + removeClass: wrapper_every_act_firstArgFunc(styler.removeClass, styler, styler.className), + + //toogleClass(name,when) + toggleClass: wrapper_every_act_firstArgFunc(styler.toggleClass, styler, styler.className), + + scrollTop: wrapper_value(geom.scrollTop, geom), + + scrollLeft: wrapper_value(geom.scrollLeft, geom), + + position: function() { + if (!this.length) return + + var elem = this[0]; + + return geom.relativePosition(elem); + }, + + offsetParent: wrapper_map(geom.offsetParent, geom), + }); + + // for now + $.fn.detach = $.fn.remove; + + + $.fn.size = wrapper_value(geom.size, geom); + + $.fn.width = wrapper_value(geom.width, geom, geom.width); + + $.fn.height = wrapper_value(geom.height, geom, geom.height); + + ['width', 'height'].forEach(function(dimension) { + var offset, Dimension = dimension.replace(/./, function(m) { + return m[0].toUpperCase() + }); + + $.fn['outer' + Dimension] = function(margin, value) { + if (arguments.length) { + if (typeof margin !== 'boolean') { + value = margin; + margin = false; + } + } else { + margin = false; + value = undefined; + } + + if (value === undefined) { + var el = this[0]; + if (!el) { + return undefined; + } + var cb = geom.size(el); + if (margin) { + var me = geom.marginExtents(el); + cb.width = cb.width + me.left + me.right; + cb.height = cb.height + me.top + me.bottom; + } + return dimension === "width" ? cb.width : cb.height; + } else { + return this.each(function(idx, el) { + var mb = {}; + var me = geom.marginExtents(el); + if (dimension === "width") { + mb.width = value; + if (margin) { + mb.width = mb.width - me.left - me.right + } + } else { + mb.height = value; + if (margin) { + mb.height = mb.height - me.top - me.bottom; + } + } + geom.size(el, mb); + }) + + } + }; + }) + + $.fn.innerWidth = wrapper_value(geom.width, geom, geom.width); + + $.fn.innerHeight = wrapper_value(geom.height, geom, geom.height); + + + var traverseNode = noder.traverse; + + function wrapper_node_operation(func, context, oldValueFunc) { + return function(html) { + var argType, nodes = langx.map(arguments, function(arg) { + argType = type(arg) + return argType == "object" || argType == "array" || arg == null ? + arg : noder.createFragment(arg) + }); + if (nodes.length < 1) { + return this + } + this.each(function(idx) { + func.apply(context, [this, nodes, idx > 0]); + }); + return this; + } + } + + + $.fn.after = wrapper_node_operation(noder.after, noder); + + $.fn.prepend = wrapper_node_operation(noder.prepend, noder); + + $.fn.before = wrapper_node_operation(noder.before, noder); + + $.fn.append = wrapper_node_operation(noder.append, noder); + + $.fn.insertAfter = function(html) { + $(html).after(this); + return this; + }; + + $.fn.insertBefore = function(html) { + $(html).before(this); + return this; + }; + + $.fn.appendTo = function(html) { + $(html).append(this); + return this; + }; + + $.fn.prependTo = function(html) { + $(html).prepend(this); + return this; + }; + + return $ + })(); + + (function($) { + $.fn.on = wrapper_every_act(eventer.on, eventer); + + $.fn.off = wrapper_every_act(eventer.off, eventer); + + $.fn.trigger = wrapper_every_act(eventer.trigger, eventer); + + + ('focusin focusout focus blur load resize scroll unload click dblclick ' + + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave ' + + 'change select keydown keypress keyup error').split(' ').forEach(function(event) { + $.fn[event] = function(data, callback) { + return (0 in arguments) ? + this.on(event, data, callback) : + this.trigger(event) + } + }); + + + $.fn.one = function(event, selector, data, callback) { + if (!langx.isString(selector) && !langx.isFunction(callback)) { + callback = data; + data = selector; + selector = null; + } + + if (langx.isFunction(data)) { + callback = data; + data = null; + } + + return this.on(event, selector, data, callback, 1) + }; + + $.fn.animate = wrapper_every_act(fx.animate, fx); + + $.fn.show = wrapper_every_act(fx.show, fx); + $.fn.hide = wrapper_every_act(fx.hide, fx); + $.fn.toogle = wrapper_every_act(fx.toogle, fx); + $.fn.fadeTo = wrapper_every_act(fx.fadeTo, fx); + $.fn.fadeIn = wrapper_every_act(fx.fadeIn, fx); + $.fn.fadeOut = wrapper_every_act(fx.fadeOut, fx); + $.fn.fadeToggle = wrapper_every_act(fx.fadeToggle, fx); + + $.fn.slideDown = wrapper_every_act(fx.slideDown, fx); + $.fn.slideToggle = wrapper_every_act(fx.slideToggle, fx); + $.fn.slideUp = wrapper_every_act(fx.slideUp, fx); + })(query); + + + (function($) { + $.fn.end = function() { + return this.prevObject || $() + } + + $.fn.andSelf = function() { + return this.add(this.prevObject || $()) + } + + $.fn.addBack = function(selector) { + if (this.prevObject) { + if (selector) { + return this.add(this.prevObject.filter(selector)); + } else { + return this.add(this.prevObject); + } + } else { + return this; + } + } + + 'filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings'.split(',').forEach(function(property) { + var fn = $.fn[property] + $.fn[property] = function() { + var ret = fn.apply(this, arguments) + ret.prevObject = this + return ret + } + }) + })(query); + + + (function($) { + $.fn.query = $.fn.find; + + $.fn.place = function(refNode, position) { + // summary: + // places elements of this node list relative to the first element matched + // by queryOrNode. Returns the original NodeList. See: `dojo/dom-construct.place` + // queryOrNode: + // may be a string representing any valid CSS3 selector or a DOM node. + // In the selector case, only the first matching element will be used + // for relative positioning. + // position: + // can be one of: + // + // - "last" (default) + // - "first" + // - "before" + // - "after" + // - "only" + // - "replace" + // + // or an offset in the childNodes + if (langx.isString(refNode)) { + refNode = finder.descendant(refNode); + } else if (isQ(refNode)) { + refNode = refNode[0]; + } + return this.each(function(i, node) { + switch (position) { + case "before": + noder.before(refNode, node); + break; + case "after": + noder.after(refNode, node); + break; + case "replace": + noder.replace(refNode, node); + break; + case "only": + noder.empty(refNode); + noder.append(refNode, node); + break; + case "first": + noder.prepend(refNode, node); + break; + // else fallthrough... + default: // aka: last + noder.append(refNode, node); + } + }); + }; + + $.fn.addContent = function(content, position) { + if (content.template) { + content = langx.substitute(content.template, content); + } + return this.append(content); + }; + + $.fn.replaceClass = function(newClass, oldClass) { + this.removeClass(oldClass); + this.addClass(newClass); + return this; + }; + + })(query); + + + return skylark.query = query; +}); +define('skylarkjs/query',[ + "skylark-utils/query" +], function(query) { + return query; +}); + +define('skylark-utils/scripter',[ + "./skylark", + "./langx", + "./noder", + "./finder" +], function(skylark, langx, noder, finder) { + + var head = document.getElementsByTagName('head')[0], + scriptsByUrl = {}, + scriptElementsById = {}, + count = 0; + + function scripter() { + return scripter; + } + + langx.mixin(scripter, { + + loadJavaScript: function(url, loadedCallback, errorCallback) { + var script = scriptsByUrl[url]; + if (!script) { + script = scriptsByUrl[url] = { + state: 0, //0:unload,1:loaded,-1:loaderror + loadedCallbacks: [], + errorCallbacks: [] + } + } + + script.loadedCallbacks.push(loadedCallback); + script.errorCallbacks.push(errorCallback); + + if (script.state === 1) { + script.node.onload(); + } else if (script.state === -1) { + script.node.onerror(); + } else { + var node = script.node = document.createElement("script"), + id = script.id = (count++); + + node.type = "text/javascript"; + node.async = false; + node.defer = false; + startTime = new Date().getTime(); + head.appendChild(node); + + node.onload = function() { + script.state = 1; + + var callbacks = script.loadedCallbacks, + i = callbacks.length; + + while (i--) { + callbacks[i](); + } + script.loadedCallbacks = []; + script.errorCallbacks = []; + }, + node.onerror = function() { + script.state = -1; + var callbacks = script.errorCallbacks, + i = callbacks.length; + + while (i--) { + callbacks[i](); + } + script.loadedCallbacks = []; + script.errorCallbacks = []; + }; + node.src = url; + + scriptElementsById[id] = node; + } + return script.id; + }, + + deleteJavaScript: function(id) { + var node = scriptElementsById[id]; + if (node) { + var url = node.src; + noder.remove(node); + delete scriptElementsById[id]; + delete scriptsByUrl[url]; + } + } + }); + + return skylark.scripter = scripter; +}); + +define('skylarkjs/scripter',[ + "skylark-utils/scripter" +], function(scripter) { + return scripter; +}); + +define('skylarkjs/styler',[ + "skylark-utils/styler" +], function(styler) { + return styler; +}); + +define('skylark-utils/velm',[ + "./skylark", + "./langx", + "./datax", + "./dnd", + "./eventer", + "./filer", + "./finder", + "./fx", + "./geom", + "./mover", + "./noder", + "./styler" +], function(skylark, langx, datax, dnd, eventer, filer, finder, fx, geom, mover, noder, styler) { + var map = Array.prototype.map, + slice = Array.prototype.slice; + + var VisualElement = langx.klass({ + klassName: "VisualElement", + + "init": function(node) { + if (langx.isString(node)) { + node = document.getElementById(node); + } + this.domNode = node; + } + }); + + var root = new VisualElement(document.body), + velm = function(node) { + if (node) { + return new VisualElement(node); + } else { + return root; + } + }; + + function _delegator(fn, context) { + return function() { + var self = this, + elem = self.domNode, + ret = fn.apply(context, [elem].concat(slice.call(arguments))); + + if (ret) { + if (ret === context) { + return self; + } else { + if (ret instanceof HTMLElement) { + ret = new VisualElement(ret); + } else if (langx.isArrayLike(ret)) { + ret = map.call(ret, function(el) { + if (el instanceof HTMLElement) { + return new VisualElement(ret); + } else { + return el; + } + }) + } + } + } + return ret; + }; + } + + langx.mixin(velm, { + batch: function(nodes, action, args) { + nodes.forEach(function(node) { + var elm = (node instanceof VisualElement) ? node : velm(node); + elm[action].apply(elm, args); + }); + + return this; + }, + + root: new VisualElement(document.body), + + VisualElement: VisualElement, + + partial : function(name,fn) { + var props = {}; + + props[name] = fn; + + VisualElement.partial(props); + }, + + delegate: function(names, context) { + var props = {}; + + names.forEach(function(name) { + props[name] = _delegator(context[name], context); + }); + + VisualElement.partial(props); + } + }); + + // from ./datax + velm.delegate([ + "attr", + "data", + "prop", + "removeAttr", + "removeData", + "text", + "val" + ], datax); + + // from ./dnd + velm.delegate([ + "draggable", + "droppable" + ], dnd); + + + // from ./eventer + velm.delegate([ + "off", + "on", + "one", + "shortcuts", + "trigger" + ], eventer); + + // from ./filer + velm.delegate([ + "picker", + "dropzone" + ], filer); + + // from ./finder + velm.delegate([ + "ancestor", + "ancestors", + "children", + "descendant", + "find", + "findAll", + "firstChild", + "lastChild", + "matches", + "nextSibling", + "nextSiblings", + "parent", + "previousSibling", + "previousSiblings", + "siblings" + ], finder); + + velm.find = function(selector) { + if (selector === "body") { + return this.root; + } else { + return this.root.descendant(selector); + } + }; + + // from ./fx + velm.delegate([ + "animate", + "fadeIn", + "fadeOut", + "fadeTo", + "fadeToggle", + "hide", + "scrollToTop", + "show", + "toggle" + ], fx); + + + // from ./geom + velm.delegate([ + "borderExtents", + "boundingPosition", + "boundingRect", + "clientHeight", + "clientSize", + "clientWidth", + "contentRect", + "height", + "marginExtents", + "offsetParent", + "paddingExtents", + "pagePosition", + "pageRect", + "relativePosition", + "relativeRect", + "scrollIntoView", + "scrollLeft", + "scrollTop", + "size", + "width" + ], geom); + + // from ./mover + velm.delegate([ + "movable" + ], dnd); + + + // from ./noder + velm.delegate([ + "after", + "append", + "before", + "clone", + "contains", + "contents", + "empty", + "html", + "isChildOf", + "ownerDoc", + "prepend", + "remove", + "replace", + "reverse", + "throb", + "traverse", + "wrapper", + "wrapperInner", + "unwrap" + ], noder); + + // from ./styler + velm.delegate([ + "addClass", + "className", + "css", + "hasClass", + "hide", + "isInvisible", + "removeClass", + "show", + "toggleClass" + ], styler); + + return skylark.velm = velm; +}); + +define('skylarkjs/velm',[ + "skylark-utils/velm" +], function(velm) { + return velm; +}); + +define('skylark-utils/widget',[ + "./skylark", + "./langx", + "./noder", + "./styler", + "./geom", + "./eventer", + "./query" +], function(skylark,langx,noder,styler,geom,eventer,query) { + // Cached regex to split keys for `delegate`. + var delegateEventSplitter = /^(\S+)\s*(.*)$/; + + function widget() { + return widget; + } + + var Widget = langx.Evented.inherit({ + init :function(el,options) { + if (!langx.isHtmlNode(el)) { + options = el; + el = null; + } + this.el = el; + if (options) { + langx.mixin(this,options); + } + if (!this.cid) { + this.cid = langx.uniqueId('w'); + } + this._ensureElement(); + }, + + // The default `tagName` of a View's element is `"div"`. + tagName: 'div', + + // jQuery delegate for element lookup, scoped to DOM elements within the + // current view. This should be preferred to global lookups where possible. + $: function(selector) { + return this.$el.find(selector); + }, + + // **render** is the core function that your view should override, in order + // to populate its element (`this.el`), with the appropriate HTML. The + // convention is for **render** to always return `this`. + render: function() { + return this; + }, + + // Remove this view by taking the element out of the DOM, and removing any + // applicable Backbone.Events listeners. + remove: function() { + this._removeElement(); + this.unlistenTo(); + return this; + }, + + // Remove this view's element from the document and all event listeners + // attached to it. Exposed for subclasses using an alternative DOM + // manipulation API. + _removeElement: function() { + this.$el.remove(); + }, + + // Change the view's element (`this.el` property) and re-delegate the + // view's events on the new element. + setElement: function(element) { + this.undelegateEvents(); + this._setElement(element); + this.delegateEvents(); + return this; + }, + + // Creates the `this.el` and `this.$el` references for this view using the + // given `el`. `el` can be a CSS selector or an HTML string, a jQuery + // context or an element. Subclasses can override this to utilize an + // alternative DOM manipulation API and are only required to set the + // `this.el` property. + _setElement: function(el) { + this.$el = widget.$(el); + this.el = this.$el[0]; + }, + + // Set callbacks, where `this.events` is a hash of + // + // *{"event selector": "callback"}* + // + // { + // 'mousedown .title': 'edit', + // 'click .button': 'save', + // 'click .open': function(e) { ... } + // } + // + // pairs. Callbacks will be bound to the view, with `this` set properly. + // Uses event delegation for efficiency. + // Omitting the selector binds the event to `this.el`. + delegateEvents: function(events) { + events || (events = langx.result(this, 'events')); + if (!events) return this; + this.undelegateEvents(); + for (var key in events) { + var method = events[key]; + if (!langx.isFunction(method)) method = this[method]; + if (!method) continue; + var match = key.match(delegateEventSplitter); + this.delegate(match[1], match[2], langx.proxy(method, this)); + } + return this; + }, + + // Add a single event listener to the view's element (or a child element + // using `selector`). This only works for delegate-able events: not `focus`, + // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer. + delegate: function(eventName, selector, listener) { + this.$el.on(eventName + '.delegateEvents' + this.uid, selector, listener); + return this; + }, + + // Clears all callbacks previously bound to the view by `delegateEvents`. + // You usually don't need to use this, but may wish to if you have multiple + // Backbone views attached to the same DOM element. + undelegateEvents: function() { + if (this.$el) this.$el.off('.delegateEvents' + this.uid); + return this; + }, + + // A finer-grained `undelegateEvents` for removing a single delegated event. + // `selector` and `listener` are both optional. + undelegate: function(eventName, selector, listener) { + this.$el.off(eventName + '.delegateEvents' + this.uid, selector, listener); + return this; + }, + + // Produces a DOM element to be assigned to your view. Exposed for + // subclasses using an alternative DOM manipulation API. + _createElement: function(tagName,attrs) { + return noder.createElement(tagName,attrs); + }, + + // Ensure that the View has a DOM element to render into. + // If `this.el` is a string, pass it through `$()`, take the first + // matching element, and re-assign it to `el`. Otherwise, create + // an element from the `id`, `className` and `tagName` properties. + _ensureElement: function() { + if (!this.el) { + var attrs = langx.mixin({}, langx.result(this, 'attributes')); + if (this.id) attrs.id = langx.result(this, 'id'); + if (this.className) attrs['class'] = langx.result(this, 'className'); + this.setElement(this._createElement(langx.result(this, 'tagName'),attrs)); + this._setAttributes(attrs); + } else { + this.setElement(langx.result(this, 'el')); + } + }, + + // Set attributes from a hash on this view's element. Exposed for + // subclasses using an alternative DOM manipulation API. + _setAttributes: function(attributes) { + this.$el.attr(attributes); + } + }); + + + langx.mixin(widget, { + $ : query, + + Widget : Widget + }); + + + return skylark.widget = widget; +}); + +define('skylarkjs/widget',[ + "skylark-utils/widget" +], function(widget) { + return widget; +}); + +define('skylarkjs/main',[ + "./core", + "./browser", + "./css", + "./datax", + "./dnd", + "./eventer", + "./filer", + "./finder", + "./fx", + "./geom", + "./http", + "./images", + "./mover", + "./noder", + "./query", + "./scripter", + "./styler", + "./velm", + "./widget" +], function(skylark) { + return skylark; +}) +; +define('skylarkjs', ['skylarkjs/main'], function (main) { return main; }); + + +},this); diff --git a/libs/skylarkjs/0.9.8/skylarkjs.js.map b/libs/skylarkjs/0.9.8/skylarkjs.js.map new file mode 100644 index 000000000..eb9eefca6 --- /dev/null +++ b/libs/skylarkjs/0.9.8/skylarkjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["skylarkjs.js"],"names":["factory","globals","absolute","relative","base","stack","split","parts","pop","i","length","push","join","xhrGet","url","callback","xhr","XMLHttpRequest","onreadystatechange","this","readyState","response","responseText","open","send","define","require","isAmd","amd","isCmd","exports","map","id","deps","dep","resolved","cb","requireOne","hasOwnProperty","Error","module","args","forEach","apply","window","onedep","modules","config","baseUrl","skylarkjs","skylark","http","res","console","error","cfg","JSON","parse","runtime","initApp","spa","_cfg","contextPath","app","go","path","force","prepare","then","run","spaModule","_start","advise","dispatcher","type","advice","receiveArguments","signal","previous","around","advised","arguments","remove","target","next","nextId","aspect","methodName","existing","executionId","before","results","after","newResults","undefined","call","clone","src","checkCloneMethod","copy","isArray","isPlainObject","key","createEvent","props","e","CustomEvent","safeMixin","debounce","fn","wait","timeout","later","clearTimeout","setTimeout","compact","array","filter","item","dasherize","str","replace","toLowerCase","deserializeValue","value","test","each","obj","undef","flatten","isArrayLike","result","j","funcArg","context","arg","idx","payload","isFunction","getQueryParams","location","href","segs","params","queryParam","nv","inArray","indexOf","object","constructor","Array","isString","isHtmlNode","isBoolean","isDocument","nodeType","DOCUMENT_NODE","isEqual","a","b","eq","isObject","isWindow","Object","getPrototypeOf","prototype","isDefined","Node","isNumber","isSameOrigin","origin","protocol","hostname","port","startsWith","isEmptyObject","name","makeArray","offset","startWith","concat","slice","elements","values","nextTick","requestAnimationFrame","proxy","proxyFn","unshift","TypeError","toPixel","parseFloat","trim","String","removeItem","items","splice","_mixin","source","deep","safe","_parseMixinArgs","shift","sources","mixin","fallback","prop","substitute","template","transform","thisObject","getObject","match","retVal","getValue","keys","_k","reverse","v","format","toString","uid","_uid","uniq","uniqueId","prefix","idCounter","langx","createClass","extendClass","ctor","options","proto","_super","superclass","noOverrided","_constructor","superFn","tmp","overrided","ret","parent","init","klassName","Function","create","__proto__","partial","inherit","delegate","TMP","Deferred","promise","Promise","resolve","reject","_resolve","_reject","bind","reason","errback","progback","all","first","race","when","valueOrPromise","receivedPromise","nativePromise","deferred","cancel","progress","err","d","data","immediate","deepEq","Evented","on","events","selector","ctx","one","self","_hub","trigger","eventName","listeners","len","reCompact","listener","listened","event","evtArr","_events","listenTo","listening","listeningTo","_listeningTo","listeningEvents","listeningEvent","listenToOnce","off","evts","liveEvents","_","unlistenTo","SymbolProto","document","createElement","Symbol","aStack","bStack","className","valueOf","areArrays","aCtor","bCtor","class2type","Stateful","attributes","attrs","cid","cidPrefix","collection","defaults","set","changed","validationError","idAttribute","toJSON","get","attr","has","val","_validate","unset","silent","changes","changing","_changing","_previousAttributes","current","prev","_pending","clear","hasChanged","changedAttributes","diff","old","previousAttributes","isNew","isValid","validate","camelCase","toUpperCase","klass","lowerFirst","charAt","returnTrue","returnFalse","serializeValue","stringify","upperFirst","URL","webkitURL","_curCtx","dispatch","route","exit","_prevCtx","m","r","enter","router","useHistoryApi","state","history","pushState","title","_baseUrl","dispatchEvent","useHashbang","newHash","hash","noCache","finded","_cache","_routes","routeName","hub","homePath","_homePath","setting","settings","routes","Route","start","host","initPath","pathname","addEventListener","preventDefault","pathto","pattern","paramNames","paramName","substring","_setting","regex","RegExp","query","_entering","_entered","ok","_exiting","_exited","names","x","decodeURIComponent","exec","content","forceRefresh","_prepared","getConfigData","getNamedValue","controllerSetting","controller","contentPath","render","perform","RouteController","Page","routeViewer","_params","_rvc","querySelector","_router","refresh","curCtx","innerHTML","appendChild","Plugin","hookers","isHooked","plugin","PluginController","Application","plugins","_plugins","_config","pluginName","_page","page","baseURI","getConfig","promises0","promises1","lazy","promises2","normalizeCssEvent","css3EventPrefix","normalizeCssProperty","cssProps","normalizeStyleProperty","cssStyles","browser","vendorPrefix","vendorPrefixRE","css3PropPrefix","css3StylePrefix","vendorPrefixesRE","testEl","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","testStyle","style","matched","cssPropName","support","maybeAddPx","cssNumber","classRE","classReCache","node","svg","baseVal","defaultDisplay","nodeName","element","display","elementDisplay","body","getComputedStyle","getPropertyValue","parentNode","removeChild","show","elm","styler","css","isInvisible","hide","addClass","cls","re","property","computedStyle","removeProperty","cssText","hasClass","removeClass","toggleClass","every","column-count","columns","font-weight","line-height","opacity","z-index","zoom","autocssfix","cssHooks","ensureNodes","nodes","copyByClone","cloneNode","chkName","contents","contentDocument","childNodes","html","empty","isIE","getAttribs","setAttrib","getAttrib","tag","setAttribute","append","createFragment","singleTagRE","$1","fragmentRE","containers","container","dom","contains","child","isChildOf","createTextNode","text","doc","hasChildNodes","firstChild","directly","documentElement","isDoc","ownerDoc","ownerDocument","ownerWindow","defaultView","parentWindow","placing","refNode","nextSibling","insertBefore","prepend","overlay","overlayDiv","position","top","left","width","height","zIndex","warn","oldNode","replaceChild","throb","timer","time","throbber","textNode","update","nodeValue","end","traverse","children","wrapper","wrapperNode","wrapperInner","unwrap","noder","navigator","userAgent","div","table","tableBody","tableRow","tr","tbody","thead","tfoot","td","th","*","construct","_createStyleSheet","link","count","rel","async","defer","head","sheetElementsById","insertRuleFunc","getElementsByTagName","sheetsByUrl","defaultSheetId","defaultSheet","rulesPropName","deleteRuleFunc","deleteRule","removeRule","insertRule","_insertRule","index","addRule","createStyleSheet","loadStyleSheet","loadedCallback","errorCallback","sheet","loadedCallbacks","errorCallbacks","onload","onerror","startTime","Date","getTime","callbacks","deleteSheetRule","sheetId","rule","_rule","removeStyleSheet","findRules","rules","filters","parseSelector","$","styleSheets","styleSheet","filterStyleSheet","merge","_rules","matchSelector","selectorText","normalizeRule","nativeCSSStyleRule","CSSStyleRule","insertSheetRule","velm","ancestor","root","rootIsSelector","matches","ancestors","local","byId","getElementById","closest","descendants","querySelectorAll","matchError","descendant","find","findAll","lastChild","last","previousSibling","nativeMatchesSelector","check","adjacent","nextSiblings","previousSiblings","siblings","parser","rawMatch","separator","combinator","combinatorChildren","tagName","attributeKey","attributeOperator","attributeQuote","attributeValue","pseudoMarker","pseudoClass","pseudoQuote","pseudoClassQuotedValue","pseudoClassValue","separatorIndex","parsed","expressions","combinatorIndex","currentSeparator","reversed","reverseCombinator","currentParsed","reUnescape","classList","classes","regexp","escapeRegExp","pseudos","operator","cache","reverseCache","expression","isReversed","Slick","currentCache","raw","exp","cexp","from","to","string","checkbox","checked","disabled","enabled","focus","activeElement","tabindex","gt","sel","hidden","lt","not","radio","selected","visible","offsetWidth","isArrayFilter","divide","cond","nativeSelector","customPseudos","part","arrayFilte","pseudo","getAttribute","hasAttribute","currentExpression","simpleExpCounter","filterSingle","matchs","combine","bit","node1","op","divided","single","currentBit","founds","found","currentItems","finder","removeAttribute","attrName","_attributeData","store","_store","confirm","_getData","camelName","capitalRE","_setData","dataAttrName","removeData","pluck","propMap","removeAttr","removeProp","txt","textContent","multiple","selectedOptions","option","datax","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","offsetParent","rootNodeRE","borderExtents","s","px","borderLeftWidth","borderTopWidth","right","borderRightWidth","bottom","borderBottomWidth","boundingPosition","coords","getBoundingClientRect","parentOffset","mex","marginExtents","pbex","relativePosition","boundingRect","size","clientHeight","clientSize","dimension","clientWidth","isBorderBox","bex","pex","paddingExtents","contentRect","cs","getDocumentSize","max","Math","scrollWidth","scrollHeight","offsetHeight","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","pagePosition","pageXOffset","pageYOffset","pageRect","round","relativeRect","scrollIntoView","align","getOffset","rootElm","y","offsetLeft","offsetTop","parentWidth","parentHeight","parentElm","pos","scrollLeft","scrollTop","hasScrollLeft","scrollTo","scrollY","hasScrollTop","scrollX","innerWidth","innerHeight","geom","compatible","isDefaultPrevented","eventMethods","predicate","sourceMethod","ns","sort","createProxy","originalEvent","ignoreProperties","$this","handler","findHandler","unregister","ready","register","stop","keyCode","stopPropagation","evented","Event","_args","readyRE","shortcuts","registry","shortcut","n","metaKey","ctrlKey","ctrl","alt","altKey","shiftKey","charCode","add","shortcutKeys","shortcutKey","charCodeAt","keyCodeLookup","regKey","eventer","stopImmediatePropagation","getEventCtor","NativeEvents","EventCtors","compositionstart","compositionend","compositionupdate","beforecopy","beforecut","beforepaste","cut","paste","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","abort","change","selectionchange","submit","reset","blur","focusin","focusout","keydown","keypress","keyup","message","click","contextmenu","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","textInput","touchstart","touchmove","touchend","load","resize","select","scroll","unload","wheel","bubbles","cancelable","namespace","specialEvents","focusinSupported","hover","realEvent","handlers","EventBindings","_target","_event","_bindings","bindings","binding","_listener","domEvt","isImmediatePropagationStopped","currentTarget","liveFired","l","related","relatedTarget","matcherFor","matcher","removing","removeEventListener","EventsHandler","_handler","specialEvent","bindingEvent","bindType","bindEventName","delete","special","draggable","Draggable","droppable","Droppable","dnd","DndManager","dragSource","handleElm","p","draggingOffsetX","parseInt","pageX","draggingOffsetY","pageY","ghost","transfer","dragging","draggingClass","draggingGhost","draggingTransfer","dataTransfer","setData","setDragImage","effectAllowed","over","dropped","manager","handle","hoverClass","activeClass","acceptable","e2","overElm","dropEffect","selectFile","selectFiles","pickedFiles","maxFileSize","fileSelected","fileInput","input","onchange","files","filer","dropzone","droppedCallback","enterdCount","types","picker","pickedCallback","picked","readFile","file","reader","FileReader","evt","code","alert","asArrayBuffer","readAsArrayBuffer","asDataUrl","readAsDataURL","asText","readAsText","writeFile","msSaveBlob","dataURItoBlob","Blob","createObjectURL","animate","properties","duration","ease","delay","endEvent","wrappedCallback","cssValues","cssProperties","transforms","that","fired","easing","complete","fx","speeds","normal","eace","animationName","animationDuration","animationTiming","animationEnd","supportedTransforms","transitionEnd","transitionProperty","transitionDuration","transitionDelay","transitionTiming","cssReset","clientLeft","scrollToTop","speed","scale","scrollFrom","runEvery","freq","interval","setInterval","clearInterval","toggle","fadeTo","fadeIn","fadeOut","fadeToggle","ceasing","allback","slideDown","visibility","overflow","slideUp","queue","slideToggle","animationDelay","fast","slow","mimeToDataType","mime","scriptTypeRE","xmlTypeRE","appendQuery","serializeData","processData","param","traditional","ajaxSuccess","status","success","ajaxComplete","ajaxError","ajax","ajaxSettings","crossDomain","abortTimeout","dataType","accepts","headers","setHeader","nativeSetHeader","setRequestHeader","mimeType","overrideMimeType","contentType","getResponseHeader","eval","responseXML","blankRE","statusText","username","password","parseArguments","post","getJSON","beforeSend","global","script","json","xml","gtJSON","images","elementNodeTypes","1","9","11","ImagesLoaded","elem","onAlways","getImages","addElementImages","addImage","background","addElementBackgroundImages","childImgs","img","reURL","backgroundImage","addBackground","loadingImage","LoadingImage","Background","onProgress","_this","progressedCount","hasAnyBroken","isLoaded","debug","log","isComplete","getIsImageComplete","naturalWidth","proxyImage","Image","handleEvent","method","unbindEvents","loaded","_place","choices","layoutNode","aroundNodeCoords","win","view","best","some","choice","corner","spaceAvailable","w","L","R","M","h","T","B","aroundCorner","bb","startXpos","min","startYpos","startX","startY","endX","endY","at","corners","padding","c","anchor","positions","leftToRight","aroundNodePos","domGeometry","anchorBorder","getBorderExtents","anchorChildBorder","t","nodeBorder","nodeChildBorder","sawPosAbsolute","domStyle","parentPos","pcs","bottomYCoord","rightXCoord","kernel","deprecated","ltr","movable","updateWithTouchData","changedTouches","downButton","originalPos","handleEl","constraints","startedCallback","started","movingCallback","moving","stoppedCallback","stopped","cursor","docSize","button","screenX","screenY","move","deltaX","deltaY","minX","maxX","minY","maxY","mover","wrapper_map","func","wrapper_selector","wrapper_selector_until","util","wrapper_every_act","wrapper_every_act_firstArgFunc","oldValueFunc","arg1","wrapper_some_chk","wrapper_name_value","newValue","wrapper_value","isQ","rquickExpr","NodeList","wrapper_node_operation","argType","el","toArray","is","excludes","parents","parentsUntil","replaceWith","newContent","wrap","structure","wrapAll","wrappingElement","wrapInner","prevAll","nextAll","detach","Dimension","margin","me","mb","insertAfter","appendTo","prependTo","toogle","prevObject","andSelf","addBack","place","addContent","replaceClass","newClass","oldClass","scripter","scriptsByUrl","scriptElementsById","loadJavaScript","deleteJavaScript","_delegator","domNode","HTMLElement","VisualElement","batch","action","widget","delegateEventSplitter","Widget","_ensureElement","$el","_removeElement","setElement","undelegateEvents","_setElement","delegateEvents","undelegate","_createEl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mtC,EAAAzkC,QAAA/I,IAGAiJ,SAAA,SAAAwK,EAAA3R,GACA,GAAA9B,KAEAyT,GAAAvX,QAAA,SAAAsI,GACAxE,EAAAwE,GAAA6oC,EAAAvrC,EAAA0C,GAAA1C,KAGA0rC,EAAAzkC,QAAA/I,MAKAijB,EAAAha,UACA,OACA,OACA,OACA,aACA,aACA,OACA,OACAiiB,GAGAjI,EAAAha,UACA,YACA,aACAwvB,GAIAxV,EAAAha,UACA,MACA,KACA,MACA,YACA,WACA6pB,GAGA7P,EAAAha,UACA,SACA,YACA+xB,GAGA/X,EAAAha,UACA,WACA,YACA,WACA,aACA,OACA,UACA,aACA,YACA,UACA,cACA,eACA,SACA,kBACA,mBACA,YACA2gB,GAEA3G,EAAAc,KAAA,SAAA/Y,GACA,MAAA,SAAAA,EACArQ,KAAAwoB,KAEAxoB,KAAAwoB,KAAAW,WAAA9Y,IAKAiY,EAAAha,UACA,UACA,SACA,UACA,SACA,aACA,OACA,cACA,OACA,UACAu0B,GAIAva,EAAAha,UACA,gBACA,mBACA,eACA,eACA,aACA,cACA,cACA,SACA,gBACA,eACA,iBACA,eACA,WACA,mBACA,eACA,iBACA,aACA,YACA,OACA,SACAonB,GAGApN,EAAAha,UACA,WACAwvB,GAIAxV,EAAAha,UACA,QACA,SACA,SACA,QACA,WACA,WACA,QACA,OACA,YACA,WACA,UACA,SACA,UACA,UACA,QACA,WACA,UACA,eACA,UACA0V,GAGAsE,EAAAha,UACA,WACA,YACA,MACA,WACA,OACA,cACA,cACA,OACA,eACA4P,GAEAnc,EAAAumB,KAAAA,IAGAhoB,EAAA,kBACA,sBACA,SAAAgoB,GACA,MAAAA,KAGAhoB,EAAA,wBACA,YACA,UACA,UACA,WACA,SACA,YACA,WACA,SAAAyB,EAAAiL,EAAAgX,EAAA9F,EAAAwX,EAAAyC,EAAA3f,GAIA,QAAAw6B,KACA,MAAAA,GAHA,GAAAC,GAAA,iBAMAC,EAAAlmC,EAAAkD,QAAA7B,SACAN,KA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M,KACA1M,MAKA0zC,WAAA,SAAA/iC,EAAAN,EAAAU,GAEA,MADA/Q,MAAAozC,IAAAzhC,IAAAhB,EAAA,kBAAA3Q,KAAA0M,IAAA2D,EAAAU,GACA/Q,MAKA2zC,eAAA,SAAAvpB,EAAAtX,GACA,MAAAkR,GAAA9R,cAAAkY,EAAAtX,IAOAqgC,eAAA,WACA,GAAAnzC,KAAAqwC,GAOArwC,KAAAszC,WAAAtmC,EAAAhG,OAAAhH,KAAA,WAPA,CACA,GAAA8S,GAAA9F,EAAAvB,SAAAuB,EAAAhG,OAAAhH,KAAA,cACAA,MAAAa,KAAAiS,EAAAjS,GAAAmM,EAAAhG,OAAAhH,KAAA,OACAA,KAAAsS,YAAAQ,EAAA,SAAA9F,EAAAhG,OAAAhH,KAAA,cACAA,KAAAszC,WAAAtzC,KAAA2zC,eAAA3mC,EAAAhG,OAAAhH,KAAA,WAAA8S,IACA9S,KAAA4zC,eAAA9gC,KAQA8gC,eAAA,SAAA/gC,GACA7S,KAAAozC,IAAA3/B,KAAAZ,KAYA,OAPA7F,GAAAvB,MAAAunC,GACAtrB,EAAAlP,EAEA06B,OAAAA,IAIAnxC,EAAAixC,OAAAA,IAGA1yC,EAAA,oBACA,wBACA,SAAA0yC,GACA,MAAAA,KAGA1yC,EAAA,kBACA,SACA,YACA,QACA,UACA,QACA,YACA,UACA,WACA,OACA,SACA,SACA,WACA,UACA,UACA,UACA,aACA,WACA,SACA,YACA,SAAAyB,GACA,MAAAA,KAGAzB,EAAA,aAAA,kBAAA,SAAAuzC,GAAA,MAAAA,MAwJE7zC","file":"../skylarkjs.js","sourcesContent":["define('skylark-langx/skylark',[], function() {\r\n var skylark = {\r\n\r\n };\r\n return skylark;\r\n});\r\n\ndefine('skylark-utils/skylark',[\"skylark-langx/skylark\"], function(skylark) {\r\n return skylark;\r\n});\r\n\ndefine('skylarkjs/skylark',[\r\n \"skylark-utils/skylark\"\r\n], function(skylark) {\r\n return skylark;\r\n});\r\n\ndefine('skylark-langx/langx',[\"./skylark\"], function(skylark) {\r\n var toString = {}.toString,\r\n concat = Array.prototype.concat,\r\n indexOf = Array.prototype.indexOf,\r\n slice = Array.prototype.slice,\r\n filter = Array.prototype.filter;\r\n\r\n var undefined, nextId = 0;\r\n function advise(dispatcher, type, advice, receiveArguments){\r\n var previous = dispatcher[type];\r\n var around = type == \"around\";\r\n var signal;\r\n if(around){\r\n var advised = advice(function(){\r\n return previous.advice(this, arguments);\r\n });\r\n signal = {\r\n remove: function(){\r\n if(advised){\r\n advised = dispatcher = advice = null;\r\n }\r\n },\r\n advice: function(target, args){\r\n return advised ?\r\n advised.apply(target, args) : // called the advised function\r\n previous.advice(target, args); // cancelled, skip to next one\r\n }\r\n };\r\n }else{\r\n // create the remove handler\r\n signal = {\r\n remove: function(){\r\n if(signal.advice){\r\n var previous = signal.previous;\r\n var next = signal.next;\r\n if(!next && !previous){\r\n delete dispatcher[type];\r\n }else{\r\n if(previous){\r\n previous.next = next;\r\n }else{\r\n dispatcher[type] = next;\r\n }\r\n if(next){\r\n next.previous = previous;\r\n }\r\n }\r\n\r\n // remove the advice to signal that this signal has been removed\r\n dispatcher = advice = signal.advice = null;\r\n }\r\n },\r\n id: nextId++,\r\n advice: advice,\r\n receiveArguments: receiveArguments\r\n };\r\n }\r\n if(previous && !around){\r\n if(type == \"after\"){\r\n // add the listener to the end of the list\r\n // note that we had to change this loop a little bit to workaround a bizarre IE10 JIT bug\r\n while(previous.next && (previous = previous.next)){}\r\n previous.next = signal;\r\n signal.previous = previous;\r\n }else if(type == \"before\"){\r\n // add to beginning\r\n dispatcher[type] = signal;\r\n signal.next = previous;\r\n previous.previous = signal;\r\n }\r\n }else{\r\n // around or first one just replaces\r\n dispatcher[type] = signal;\r\n }\r\n return signal;\r\n }\r\n function aspect(type){\r\n return function(target, methodName, advice, receiveArguments){\r\n var existing = target[methodName], dispatcher;\r\n if(!existing || existing.target != target){\r\n // no dispatcher in place\r\n target[methodName] = dispatcher = function(){\r\n var executionId = nextId;\r\n // before advice\r\n var args = arguments;\r\n var before = dispatcher.before;\r\n while(before){\r\n args = before.advice.apply(this, args) || args;\r\n before = before.next;\r\n }\r\n // around advice\r\n if(dispatcher.around){\r\n var results = dispatcher.around.advice(this, args);\r\n }\r\n // after advice\r\n var after = dispatcher.after;\r\n while(after && after.id < executionId){\r\n if(after.receiveArguments){\r\n var newResults = after.advice.apply(this, args);\r\n // change the return value only if a new value was returned\r\n results = newResults === undefined ? results : newResults;\r\n }else{\r\n results = after.advice.call(this, results, args);\r\n }\r\n after = after.next;\r\n }\r\n return results;\r\n };\r\n if(existing){\r\n dispatcher.around = {advice: function(target, args){\r\n return existing.apply(target, args);\r\n }};\r\n }\r\n dispatcher.target = target;\r\n }\r\n var results = advise((dispatcher || existing), type, advice, receiveArguments);\r\n advice = null;\r\n return results;\r\n };\r\n }\r\n\r\n\r\n var createClass = (function() {\r\n function extendClass(ctor, props, options) {\r\n // Copy the properties to the prototype of the class.\r\n var proto = ctor.prototype,\r\n _super = ctor.superclass.prototype,\r\n noOverrided = options && options.noOverrided;\r\n\r\n for (var name in props) {\r\n if (name === \"constructor\") {\r\n continue;\r\n }\r\n\r\n // Check if we're overwriting an existing function\r\n proto[name] = typeof props[name] == \"function\" && !props[name]._constructor && !noOverrided && typeof _super[name] == \"function\" ?\r\n (function(name, fn, superFn) {\r\n return function() {\r\n var tmp = this.overrided;\r\n\r\n // Add a new ._super() method that is the same method\r\n // but on the super-class\r\n this.overrided = superFn;\r\n\r\n // The method only need to be bound temporarily, so we\r\n // remove it when we're done executing\r\n var ret = fn.apply(this, arguments);\r\n\r\n this.overrided = tmp;\r\n\r\n return ret;\r\n };\r\n })(name, props[name], _super[name]) :\r\n props[name];\r\n }\r\n\r\n return ctor;\r\n }\r\n\r\n return function createClass(props, parent, options) {\r\n\r\n var _constructor = props.constructor;\r\n if (_constructor === Object) {\r\n _constructor = function() {\r\n if (this.init) {\r\n this.init.apply(this, arguments);\r\n }\r\n };\r\n };\r\n\r\n var klassName = props.klassName || \"\",\r\n ctor = new Function(\r\n \"return function \" + klassName + \"() {\" +\r\n \"var inst = this,\" +\r\n \" ctor = arguments.callee;\" +\r\n \"if (!(inst instanceof ctor)) {\" +\r\n \"inst = Object.create(ctor.prototype);\" +\r\n \"}\" +\r\n \"ctor._constructor.apply(inst, arguments);\" +\r\n \"return inst;\" +\r\n \"}\"\r\n )();\r\n ctor._constructor = _constructor;\r\n parent = parent || Object;\r\n // Populate our constructed prototype object\r\n ctor.prototype = Object.create(parent.prototype);\r\n\r\n // Enforce the constructor to be what we expect\r\n ctor.prototype.constructor = ctor;\r\n ctor.superclass = parent;\r\n\r\n // And make this class extendable\r\n ctor.__proto__ = parent;\r\n\r\n if (!ctor.partial) {\r\n ctor.partial = function(props, options) {\r\n return extendClass(this, props, options);\r\n };\r\n }\r\n if (!ctor.inherit) {\r\n ctor.inherit = function(props, options) {\r\n return createClass(props, this, options);\r\n };\r\n }\r\n\r\n ctor.partial(props, options);\r\n\r\n return ctor;\r\n }\r\n })();\r\n\r\n\r\n function clone( /*anything*/ src,checkCloneMethod) {\r\n var copy;\r\n if (src === undefined || src === null) {\r\n copy = src;\r\n } else if (checkCloneMethod && src.clone) {\r\n copy = src.clone();\r\n } else if (isArray(src)) {\r\n copy = [];\r\n for (var i = 0; i < src.length; i++) {\r\n copy.push(clone(src[i]));\r\n }\r\n } else if (isPlainObject(src)) {\r\n copy = {};\r\n for (var key in src) {\r\n copy[key] = clone(src[key]);\r\n }\r\n } else {\r\n copy = src;\r\n }\r\n\r\n return copy;\r\n\r\n }\r\n\r\n function createEvent(type, props) {\r\n var e = new CustomEvent(type, props);\r\n return safeMixin(e, props);\r\n }\r\n \r\n function debounce(fn, wait) {\r\n var timeout,\r\n args,\r\n later = function() {\r\n fn.apply(null, args);\r\n };\r\n\r\n return function() {\r\n args = arguments;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n };\r\n }\r\n\r\n var delegate = (function() {\r\n // boodman/crockford delegation w/ cornford optimization\r\n function TMP() {}\r\n return function(obj, props) {\r\n TMP.prototype = obj;\r\n var tmp = new TMP();\r\n TMP.prototype = null;\r\n if (props) {\r\n mixin(tmp, props);\r\n }\r\n return tmp; // Object\r\n };\r\n })();\r\n\r\n\r\n var Deferred = function() {\r\n this.promise = new Promise(function(resolve, reject) {\r\n this._resolve = resolve;\r\n this._reject = reject;\r\n }.bind(this));\r\n\r\n this.resolve = Deferred.prototype.resolve.bind(this);\r\n this.reject = Deferred.prototype.reject.bind(this);\r\n };\r\n\r\n Deferred.prototype.resolve = function(value) {\r\n this._resolve.call(this.promise, value);\r\n return this;\r\n };\r\n\r\n Deferred.prototype.reject = function(reason) {\r\n this._reject.call(this.promise, reason);\r\n return this;\r\n };\r\n\r\n\r\n Deferred.prototype.then = function(callback, errback, progback) {\r\n return this.promise.then(callback, errback, progback);\r\n };\r\n\r\n Deferred.all = function(array) {\r\n return Promise.all(array);\r\n };\r\n\r\n Deferred.first = function(array) {\r\n return Promise.race(array);\r\n };\r\n\r\n Deferred.when = function(valueOrPromise, callback, errback, progback) {\r\n var receivedPromise = valueOrPromise && typeof valueOrPromise.then === \"function\";\r\n var nativePromise = receivedPromise && valueOrPromise instanceof Promise;\r\n\r\n if (!receivedPromise) {\r\n if (arguments.length > 1) {\r\n return callback ? callback(valueOrPromise) : valueOrPromise;\r\n } else {\r\n return new Deferred().resolve(valueOrPromise);\r\n }\r\n } else if (!nativePromise) {\r\n var deferred = new Deferred(valueOrPromise.cancel);\r\n valueOrPromise.then(deferred.resolve, deferred.reject, deferred.progress);\r\n valueOrPromise = deferred.promise;\r\n }\r\n\r\n if (callback || errback || progback) {\r\n return valueOrPromise.then(callback, errback, progback);\r\n }\r\n return valueOrPromise;\r\n };\r\n\r\n Deferred.reject = function(err) {\r\n var d = new Deferred();\r\n d.reject(err);\r\n return d.promise;\r\n };\r\n\r\n Deferred.resolve = function(data) {\r\n var d = new Deferred();\r\n d.resolve(data);\r\n return d.promise;\r\n };\r\n\r\n Deferred.immediate = Deferred.resolve;\r\n\r\n var Evented = createClass({\r\n on: function(events, selector, data, callback, ctx, /*used internally*/ one) {\r\n var self = this,\r\n _hub = this._hub || (this._hub = {});\r\n\r\n if (isPlainObject(events)) {\r\n ctx = callback;\r\n each(events, function(type, fn) {\r\n self.on(type, selector, data, fn, ctx, one);\r\n });\r\n return this;\r\n }\r\n\r\n if (!isString(selector) && !isFunction(callback)) {\r\n ctx = callback;\r\n callback = data;\r\n data = selector;\r\n selector = undefined;\r\n }\r\n\r\n if (isFunction(data)) {\r\n ctx = callback;\r\n callback = data;\r\n data = null;\r\n }\r\n\r\n if (isString(events)) {\r\n events = events.split(/\\s/)\r\n }\r\n\r\n events.forEach(function(name) {\r\n (_hub[name] || (_hub[name] = [])).push({\r\n fn: callback,\r\n selector: selector,\r\n data: data,\r\n ctx: ctx,\r\n one: one\r\n });\r\n });\r\n\r\n return this;\r\n },\r\n\r\n one: function(events, selector, data, callback, ctx) {\r\n return this.on(events, selector, data, callback, ctx, 1);\r\n },\r\n\r\n trigger: function(e /*,argument list*/ ) {\r\n if (!this._hub) {\r\n return this;\r\n }\r\n\r\n var self = this;\r\n\r\n if (isString(e)) {\r\n e = new CustomEvent(e);\r\n }\r\n\r\n e.target = this;\r\n\r\n var args = slice.call(arguments, 1);\r\n if (isDefined(args)) {\r\n args = [e].concat(args);\r\n } else {\r\n args = [e];\r\n }\r\n [e.type || e.name, \"all\"].forEach(function(eventName) {\r\n var listeners = self._hub[eventName];\r\n if (!listeners) {\r\n return;\r\n }\r\n\r\n var len = listeners.length,\r\n reCompact = false;\r\n\r\n for (var i = 0; i < len; i++) {\r\n var listener = listeners[i];\r\n if (e.data) {\r\n if (listener.data) {\r\n e.data = mixin({}, listener.data, e.data);\r\n }\r\n } else {\r\n e.data = listener.data || null;\r\n }\r\n listener.fn.apply(listener.ctx, args);\r\n if (listener.one) {\r\n listeners[i] = null;\r\n reCompact = true;\r\n }\r\n }\r\n\r\n if (reCompact) {\r\n self._hub[eventName] = compact(listeners);\r\n }\r\n\r\n });\r\n return this;\r\n },\r\n\r\n listened: function(event) {\r\n var evtArr = ((this._hub || (this._events = {}))[event] || []);\r\n return evtArr.length > 0;\r\n },\r\n\r\n listenTo: function(obj, event, callback, /*used internally*/ one) {\r\n if (!obj) {\r\n return this;\r\n }\r\n\r\n // Bind callbacks on obj,\r\n if (isString(callback)) {\r\n callback = this[callback];\r\n }\r\n\r\n if (one) {\r\n obj.one(event, callback, this);\r\n } else {\r\n obj.on(event, callback, this);\r\n }\r\n\r\n //keep track of them on listening.\r\n var listeningTo = this._listeningTo || (this._listeningTo = []),\r\n listening;\r\n\r\n for (var i = 0; i < listeningTo.length; i++) {\r\n if (listeningTo[i].obj == obj) {\r\n listening = listeningTo[i];\r\n break;\r\n }\r\n }\r\n if (!listening) {\r\n listeningTo.push(\r\n listening = {\r\n obj: obj,\r\n events: {}\r\n }\r\n );\r\n }\r\n var listeningEvents = listening.events,\r\n listeningEvent = listeningEvents[event] = listeningEvents[event] || [];\r\n if (listeningEvent.indexOf(callback) == -1) {\r\n listeningEvent.push(callback);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n listenToOnce: function(obj, event, callback) {\r\n return this.listenTo(obj, event, callback, 1);\r\n },\r\n\r\n off: function(events, callback) {\r\n var _hub = this._hub || (this._hub = {});\r\n if (isString(events)) {\r\n events = events.split(/\\s/)\r\n }\r\n\r\n events.forEach(function(name) {\r\n var evts = _hub[name];\r\n var liveEvents = [];\r\n\r\n if (evts && callback) {\r\n for (var i = 0, len = evts.length; i < len; i++) {\r\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\r\n liveEvents.push(evts[i]);\r\n }\r\n }\r\n\r\n if (liveEvents.length) {\r\n _hub[name] = liveEvents;\r\n } else {\r\n delete _hub[name];\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n unlistenTo: function(obj, event, callback) {\r\n var listeningTo = this._listeningTo;\r\n if (!listeningTo) {\r\n return this;\r\n }\r\n for (var i = 0; i < listeningTo.length; i++) {\r\n var listening = listeningTo[i];\r\n\r\n if (obj && obj != listening.obj) {\r\n continue;\r\n }\r\n\r\n var listeningEvents = listening.events;\r\n for (var eventName in listeningEvents) {\r\n if (event && event != eventName) {\r\n continue;\r\n }\r\n\r\n listeningEvent = listeningEvents[eventName];\r\n\r\n for (var j = 0; j < listeningEvent.length; j++) {\r\n if (!callback || callback == listeningEvent[i]) {\r\n listening.obj.off(eventName, listeningEvent[i], this);\r\n listeningEvent[i] = null;\r\n }\r\n }\r\n\r\n listeningEvent = listeningEvents[eventName] = compact(listeningEvent);\r\n\r\n if (isEmptyObject(listeningEvent)) {\r\n listeningEvents[eventName] = null;\r\n }\r\n\r\n }\r\n\r\n if (isEmptyObject(listeningEvents)) {\r\n listeningTo[i] = null;\r\n }\r\n }\r\n\r\n listeningTo = this._listeningTo = compact(listeningTo);\r\n if (isEmptyObject(listeningTo)) {\r\n this._listeningTo = null;\r\n }\r\n\r\n return this;\r\n }\r\n });\r\n\r\n \r\n function compact(array) {\r\n return filter.call(array, function(item) {\r\n return item != null;\r\n });\r\n }\r\n\r\n function dasherize(str) {\r\n return str.replace(/::/g, '/')\r\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\r\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\r\n .replace(/_/g, '-')\r\n .toLowerCase();\r\n }\r\n\r\n function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n (value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\r\n value) : value;\r\n } catch (e) {\r\n return value;\r\n }\r\n }\r\n\r\n function each(obj, callback) {\r\n var length, key, i, undef, value;\r\n\r\n if (obj) {\r\n length = obj.length;\r\n\r\n if (length === undef) {\r\n // Loop object items\r\n for (key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n value = obj[key];\r\n if (callback.call(value, key, value) === false) {\r\n break;\r\n }\r\n }\r\n }\r\n } else {\r\n // Loop array items\r\n for (i = 0; i < length; i++) {\r\n value = obj[i];\r\n if (callback.call(value, i, value) === false) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function flatten(array) {\r\n if (isArrayLike(array)) {\r\n var result = [];\r\n for (var i = 0; i < array.length; i++) {\r\n var item = array[i];\r\n if (isArrayLike(item)) {\r\n for (var j = 0; j < item.length; j++) {\r\n result.push(item[j]);\r\n }\r\n } else {\r\n result.push(item);\r\n }\r\n }\r\n return result;\r\n } else {\r\n return array;\r\n }\r\n //return array.length > 0 ? concat.apply([], array) : array;\r\n }\r\n\r\n function funcArg(context, arg, idx, payload) {\r\n return isFunction(arg) ? arg.call(context, idx, payload) : arg;\r\n }\r\n\r\n var getAbsoluteUrl = (function() {\r\n var a;\r\n\r\n return function(url) {\r\n if (!a) a = document.createElement('a');\r\n a.href = url;\r\n\r\n return a.href;\r\n };\r\n })();\r\n\r\n function getQueryParams(url) {\r\n var url = url || window.location.href,\r\n segs = url.split(\"?\"),\r\n params = {};\r\n\r\n if (segs.length > 1) {\r\n segs[1].split(\"&\").forEach(function(queryParam) {\r\n var nv = queryParam.split('=');\r\n params[nv[0]] = nv[1];\r\n });\r\n }\r\n return params;\r\n }\r\n\r\n function grep(array, callback) {\r\n var out = [];\r\n\r\n each(array, function(i, item) {\r\n if (callback(item, i)) {\r\n out.push(item);\r\n }\r\n });\r\n\r\n return out;\r\n }\r\n\r\n function inArray(item, array) {\r\n if (!array) {\r\n return -1;\r\n }\r\n var i;\r\n\r\n if (array.indexOf) {\r\n return array.indexOf(item);\r\n }\r\n\r\n i = array.length;\r\n while (i--) {\r\n if (array[i] === item) {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n function inherit(ctor, base) {\r\n var f = function() {};\r\n f.prototype = base.prototype;\r\n\r\n ctor.prototype = new f();\r\n }\r\n\r\n function isArray(object) {\r\n return object && object.constructor === Array;\r\n }\r\n\r\n function isArrayLike(obj) {\r\n return !isString(obj) && !isHtmlNode(obj) && typeof obj.length == 'number';\r\n }\r\n\r\n function isBoolean(obj) {\r\n return typeof(obj) === \"boolean\";\r\n }\r\n\r\n function isDocument(obj) {\r\n return obj != null && obj.nodeType == obj.DOCUMENT_NODE;\r\n }\r\n\r\n\r\n // Internal recursive comparison function for `isEqual`.\r\n var eq, deepEq;\r\n var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\r\n\r\n eq = function(a, b, aStack, bStack) {\r\n // Identical objects are equal. `0 === -0`, but they aren't identical.\r\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\r\n if (a === b) return a !== 0 || 1 / a === 1 / b;\r\n // `null` or `undefined` only equal to itself (strict comparison).\r\n if (a == null || b == null) return false;\r\n // `NaN`s are equivalent, but non-reflexive.\r\n if (a !== a) return b !== b;\r\n // Exhaust primitive checks\r\n var type = typeof a;\r\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\r\n return deepEq(a, b, aStack, bStack);\r\n };\r\n\r\n // Internal recursive comparison function for `isEqual`.\r\n deepEq = function(a, b, aStack, bStack) {\r\n // Unwrap any wrapped objects.\r\n //if (a instanceof _) a = a._wrapped;\r\n //if (b instanceof _) b = b._wrapped;\r\n // Compare `[[Class]]` names.\r\n var className = toString.call(a);\r\n if (className !== toString.call(b)) return false;\r\n switch (className) {\r\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\r\n case '[object RegExp]':\r\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\r\n case '[object String]':\r\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\r\n // equivalent to `new String(\"5\")`.\r\n return '' + a === '' + b;\r\n case '[object Number]':\r\n // `NaN`s are equivalent, but non-reflexive.\r\n // Object(NaN) is equivalent to NaN.\r\n if (+a !== +a) return +b !== +b;\r\n // An `egal` comparison is performed for other numeric values.\r\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\r\n case '[object Date]':\r\n case '[object Boolean]':\r\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\r\n // millisecond representations. Note that invalid dates with millisecond representations\r\n // of `NaN` are not equivalent.\r\n return +a === +b;\r\n case '[object Symbol]':\r\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\r\n }\r\n\r\n var areArrays = className === '[object Array]';\r\n if (!areArrays) {\r\n if (typeof a != 'object' || typeof b != 'object') return false;\r\n\r\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\r\n // from different frames are.\r\n var aCtor = a.constructor, bCtor = b.constructor;\r\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\r\n isFunction(bCtor) && bCtor instanceof bCtor)\r\n && ('constructor' in a && 'constructor' in b)) {\r\n return false;\r\n }\r\n }\r\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\r\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\r\n\r\n // Initializing stack of traversed objects.\r\n // It's done here since we only need them for objects and arrays comparison.\r\n aStack = aStack || [];\r\n bStack = bStack || [];\r\n var length = aStack.length;\r\n while (length--) {\r\n // Linear search. Performance is inversely proportional to the number of\r\n // unique nested structures.\r\n if (aStack[length] === a) return bStack[length] === b;\r\n }\r\n\r\n // Add the first object to the stack of traversed objects.\r\n aStack.push(a);\r\n bStack.push(b);\r\n\r\n // Recursively compare objects and arrays.\r\n if (areArrays) {\r\n // Compare array lengths to determine if a deep comparison is necessary.\r\n length = a.length;\r\n if (length !== b.length) return false;\r\n // Deep compare the contents, ignoring non-numeric properties.\r\n while (length--) {\r\n if (!eq(a[length], b[length], aStack, bStack)) return false;\r\n }\r\n } else {\r\n // Deep compare objects.\r\n var keys = Object.keys(a), key;\r\n length = keys.length;\r\n // Ensure that both objects contain the same number of properties before comparing deep equality.\r\n if (Object.keys(b).length !== length) return false;\r\n while (length--) {\r\n // Deep compare each member\r\n key = keys[length];\r\n if (!(b[key]!==undefined && eq(a[key], b[key], aStack, bStack))) return false;\r\n }\r\n }\r\n // Remove the first object from the stack of traversed objects.\r\n aStack.pop();\r\n bStack.pop();\r\n return true;\r\n };\r\n\r\n // Perform a deep comparison to check if two objects are equal.\r\n function isEqual(a, b) {\r\n return eq(a, b);\r\n }\r\n\r\n function isFunction(value) {\r\n return type(value) == \"function\";\r\n }\r\n\r\n function isObject(obj) {\r\n return type(obj) == \"object\";\r\n }\r\n\r\n function isPlainObject(obj) {\r\n return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype;\r\n }\r\n\r\n function isString(obj) {\r\n return typeof obj === 'string';\r\n }\r\n\r\n function isWindow(obj) {\r\n return obj && obj == obj.window;\r\n }\r\n\r\n function isDefined(obj) {\r\n return typeof obj !== 'undefined';\r\n }\r\n\r\n function isHtmlNode(obj) {\r\n return obj && (obj instanceof Node);\r\n }\r\n\r\n function isNumber(obj) {\r\n return typeof obj == 'number';\r\n }\r\n\r\n function isSameOrigin(href) {\r\n if (href) {\r\n var origin = location.protocol + '//' + location.hostname;\r\n if (location.port) {\r\n origin += ':' + location.port;\r\n }\r\n return href.startsWith(origin);\r\n }\r\n }\r\n\r\n\r\n function isEmptyObject(obj) {\r\n var name;\r\n for (name in obj) {\r\n if (obj[name] !== null) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n function makeArray(obj, offset, startWith) {\r\n if (isArrayLike(obj) ) {\r\n return (startWith || []).concat(Array.prototype.slice.call(obj, offset || 0));\r\n }\r\n\r\n // array of single index\r\n return [ obj ]; \r\n }\r\n\r\n function map(elements, callback) {\r\n var value, values = [],\r\n i, key\r\n if (isArrayLike(elements))\r\n for (i = 0; i < elements.length; i++) {\r\n value = callback.call(elements[i], elements[i], i);\r\n if (value != null) values.push(value)\r\n }\r\n else\r\n for (key in elements) {\r\n value = callback.call(elements[key], elements[key], key);\r\n if (value != null) values.push(value)\r\n }\r\n return flatten(values)\r\n }\r\n\r\n function nextTick(fn) {\r\n requestAnimationFrame(fn);\r\n return this;\r\n }\r\n\r\n function proxy(fn, context) {\r\n var args = (2 in arguments) && slice.call(arguments, 2)\r\n if (isFunction(fn)) {\r\n var proxyFn = function() {\r\n return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments);\r\n }\r\n return proxyFn;\r\n } else if (isString(context)) {\r\n if (args) {\r\n args.unshift(fn[context], fn)\r\n return proxy.apply(null, args)\r\n } else {\r\n return proxy(fn[context], fn);\r\n }\r\n } else {\r\n throw new TypeError(\"expected function\");\r\n }\r\n }\r\n\r\n\r\n function toPixel(value) {\r\n // style values can be floats, client code may want\r\n // to round for integer pixels.\r\n return parseFloat(value) || 0;\r\n }\r\n\r\n var type = (function() {\r\n var class2type = {};\r\n\r\n // Populate the class2type map\r\n each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\r\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\r\n });\r\n\r\n return function type(obj) {\r\n return obj == null ? String(obj) :\r\n class2type[toString.call(obj)] || \"object\";\r\n };\r\n })();\r\n\r\n function trim(str) {\r\n return str == null ? \"\" : String.prototype.trim.call(str);\r\n }\r\n\r\n function removeItem(items, item) {\r\n if (isArray(items)) {\r\n var idx = items.indexOf(item);\r\n if (idx != -1) {\r\n items.splice(idx, 1);\r\n }\r\n } else if (isPlainObject(items)) {\r\n for (var key in items) {\r\n if (items[key] == item) {\r\n delete items[key];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function _mixin(target, source, deep, safe) {\r\n for (var key in source) {\r\n if (!source.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n if (safe && target[key] !== undefined) {\r\n continue;\r\n }\r\n if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\r\n if (isPlainObject(source[key]) && !isPlainObject(target[key])) {\r\n target[key] = {};\r\n }\r\n if (isArray(source[key]) && !isArray(target[key])) {\r\n target[key] = [];\r\n }\r\n _mixin(target[key], source[key], deep, safe);\r\n } else if (source[key] !== undefined) {\r\n target[key] = source[key]\r\n }\r\n }\r\n return target;\r\n }\r\n\r\n function _parseMixinArgs(args) {\r\n var params = slice.call(arguments, 0);\r\n target = params.shift(),\r\n deep = false;\r\n if (isBoolean(params[params.length - 1])) {\r\n deep = params.pop();\r\n }\r\n\r\n return {\r\n target: target,\r\n sources: params,\r\n deep: deep\r\n };\r\n }\r\n\r\n function mixin() {\r\n var args = _parseMixinArgs.apply(this, arguments);\r\n\r\n args.sources.forEach(function(source) {\r\n _mixin(args.target, source, args.deep, false);\r\n });\r\n return args.target;\r\n }\r\n\r\n function result(obj, path, fallback) {\r\n if (!isArray(path)) {\r\n path = [path]\r\n };\r\n var length = path.length;\r\n if (!length) {\r\n return isFunction(fallback) ? fallback.call(obj) : fallback;\r\n }\r\n for (var i = 0; i < length; i++) {\r\n var prop = obj == null ? void 0 : obj[path[i]];\r\n if (prop === void 0) {\r\n prop = fallback;\r\n i = length; // Ensure we don't continue iterating.\r\n }\r\n obj = isFunction(prop) ? prop.call(obj) : prop;\r\n }\r\n\r\n return obj;\r\n }\r\n\r\n function safeMixin() {\r\n var args = _parseMixinArgs.apply(this, arguments);\r\n\r\n args.sources.forEach(function(source) {\r\n _mixin(args.target, source, args.deep, true);\r\n });\r\n return args.target;\r\n }\r\n\r\n function substitute( /*String*/ template,\r\n /*Object|Array*/\r\n map,\r\n /*Function?*/\r\n transform,\r\n /*Object?*/\r\n thisObject) {\r\n // summary:\r\n // Performs parameterized substitutions on a string. Throws an\r\n // exception if any parameter is unmatched.\r\n // template:\r\n // a string with expressions in the form `${key}` to be replaced or\r\n // `${key:format}` which specifies a format function. keys are case-sensitive.\r\n // map:\r\n // hash to search for substitutions\r\n // transform:\r\n // a function to process all parameters before substitution takes\r\n\r\n\r\n thisObject = thisObject || window;\r\n transform = transform ?\r\n proxy(thisObject, transform) : function(v) {\r\n return v;\r\n };\r\n\r\n function getObject(key, map) {\r\n if (key.match(/\\./)) {\r\n var retVal,\r\n getValue = function(keys, obj) {\r\n var _k = keys.pop();\r\n if (_k) {\r\n if (!obj[_k]) return null;\r\n return getValue(keys, retVal = obj[_k]);\r\n } else {\r\n return retVal;\r\n }\r\n };\r\n return getValue(key.split(\".\").reverse(), map);\r\n } else {\r\n return map[key];\r\n }\r\n }\r\n\r\n return template.replace(/\\$\\{([^\\s\\:\\}]+)(?:\\:([^\\s\\:\\}]+))?\\}/g,\r\n function(match, key, format) {\r\n var value = getObject(key, map);\r\n if (format) {\r\n value = getObject(format, thisObject).call(thisObject, value, key);\r\n }\r\n return transform(value, key).toString();\r\n }); // String\r\n }\r\n\r\n\r\n var Stateful = Evented.inherit({\r\n init : function(attributes, options) {\r\n var attrs = attributes || {};\r\n options || (options = {});\r\n this.cid = uniqueId(this.cidPrefix);\r\n this.attributes = {};\r\n if (options.collection) this.collection = options.collection;\r\n if (options.parse) attrs = this.parse(attrs, options) || {};\r\n var defaults = result(this, 'defaults');\r\n attrs = mixin({}, defaults, attrs);\r\n this.set(attrs, options);\r\n this.changed = {};\r\n },\r\n\r\n // A hash of attributes whose current and previous value differ.\r\n changed: null,\r\n\r\n // The value returned during the last failed validation.\r\n validationError: null,\r\n\r\n // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\r\n // CouchDB users may want to set this to `\"_id\"`.\r\n idAttribute: 'id',\r\n\r\n // The prefix is used to create the client id which is used to identify models locally.\r\n // You may want to override this if you're experiencing name clashes with model ids.\r\n cidPrefix: 'c',\r\n\r\n\r\n // Return a copy of the model's `attributes` object.\r\n toJSON: function(options) {\r\n return clone(this.attributes);\r\n },\r\n\r\n\r\n // Get the value of an attribute.\r\n get: function(attr) {\r\n return this.attributes[attr];\r\n },\r\n\r\n // Returns `true` if the attribute contains a value that is not null\r\n // or undefined.\r\n has: function(attr) {\r\n return this.get(attr) != null;\r\n },\r\n\r\n // Set a hash of model attributes on the object, firing `\"change\"`. This is\r\n // the core primitive operation of a model, updating the data and notifying\r\n // anyone who needs to know about the change in state. The heart of the beast.\r\n set: function(key, val, options) {\r\n if (key == null) return this;\r\n\r\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\r\n var attrs;\r\n if (typeof key === 'object') {\r\n attrs = key;\r\n options = val;\r\n } else {\r\n (attrs = {})[key] = val;\r\n }\r\n\r\n options || (options = {});\r\n\r\n // Run validation.\r\n if (!this._validate(attrs, options)) return false;\r\n\r\n // Extract attributes and options.\r\n var unset = options.unset;\r\n var silent = options.silent;\r\n var changes = [];\r\n var changing = this._changing;\r\n this._changing = true;\r\n\r\n if (!changing) {\r\n this._previousAttributes = clone(this.attributes);\r\n this.changed = {};\r\n }\r\n\r\n var current = this.attributes;\r\n var changed = this.changed;\r\n var prev = this._previousAttributes;\r\n\r\n // For each `set` attribute, update or delete the current value.\r\n for (var attr in attrs) {\r\n val = attrs[attr];\r\n if (!isEqual(current[attr], val)) changes.push(attr);\r\n if (!isEqual(prev[attr], val)) {\r\n changed[attr] = val;\r\n } else {\r\n delete changed[attr];\r\n }\r\n unset ? delete current[attr] : current[attr] = val;\r\n }\r\n\r\n // Update the `id`.\r\n if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);\r\n\r\n // Trigger all relevant attribute changes.\r\n if (!silent) {\r\n if (changes.length) this._pending = options;\r\n for (var i = 0; i < changes.length; i++) {\r\n this.trigger('change:' + changes[i], this, current[changes[i]], options);\r\n }\r\n }\r\n\r\n // You might be wondering why there's a `while` loop here. Changes can\r\n // be recursively nested within `\"change\"` events.\r\n if (changing) return this;\r\n if (!silent) {\r\n while (this._pending) {\r\n options = this._pending;\r\n this._pending = false;\r\n this.trigger('change', this, options);\r\n }\r\n }\r\n this._pending = false;\r\n this._changing = false;\r\n return this;\r\n },\r\n\r\n // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\r\n // if the attribute doesn't exist.\r\n unset: function(attr, options) {\r\n return this.set(attr, void 0, mixin({}, options, {unset: true}));\r\n },\r\n\r\n // Clear all attributes on the model, firing `\"change\"`.\r\n clear: function(options) {\r\n var attrs = {};\r\n for (var key in this.attributes) attrs[key] = void 0;\r\n return this.set(attrs, mixin({}, options, {unset: true}));\r\n },\r\n\r\n // Determine if the model has changed since the last `\"change\"` event.\r\n // If you specify an attribute name, determine if that attribute has changed.\r\n hasChanged: function(attr) {\r\n if (attr == null) return !isEmptyObject(this.changed);\r\n return this.changed[attr] !== undefined;\r\n },\r\n\r\n // Return an object containing all the attributes that have changed, or\r\n // false if there are no changed attributes. Useful for determining what\r\n // parts of a view need to be updated and/or what attributes need to be\r\n // persisted to the server. Unset attributes will be set to undefined.\r\n // You can also pass an attributes object to diff against the model,\r\n // determining if there *would be* a change.\r\n changedAttributes: function(diff) {\r\n if (!diff) return this.hasChanged() ? clone(this.changed) : false;\r\n var old = this._changing ? this._previousAttributes : this.attributes;\r\n var changed = {};\r\n for (var attr in diff) {\r\n var val = diff[attr];\r\n if (isEqual(old[attr], val)) continue;\r\n changed[attr] = val;\r\n }\r\n return !isEmptyObject(changed) ? changed : false;\r\n },\r\n\r\n // Get the previous value of an attribute, recorded at the time the last\r\n // `\"change\"` event was fired.\r\n previous: function(attr) {\r\n if (attr == null || !this._previousAttributes) return null;\r\n return this._previousAttributes[attr];\r\n },\r\n\r\n // Get all of the attributes of the model at the time of the previous\r\n // `\"change\"` event.\r\n previousAttributes: function() {\r\n return clone(this._previousAttributes);\r\n },\r\n\r\n // Create a new model with identical attributes to this one.\r\n clone: function() {\r\n return new this.constructor(this.attributes);\r\n },\r\n\r\n // A model is new if it has never been saved to the server, and lacks an id.\r\n isNew: function() {\r\n return !this.has(this.idAttribute);\r\n },\r\n\r\n // Check if the model is currently in a valid state.\r\n isValid: function(options) {\r\n return this._validate({}, mixin({}, options, {validate: true}));\r\n },\r\n\r\n // Run validation against the next complete set of model attributes,\r\n // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\r\n _validate: function(attrs, options) {\r\n if (!options.validate || !this.validate) return true;\r\n attrs = mixin({}, this.attributes, attrs);\r\n var error = this.validationError = this.validate(attrs, options) || null;\r\n if (!error) return true;\r\n this.trigger('invalid', this, error, mixin(options, {validationError: error}));\r\n return false;\r\n }\r\n });\r\n\r\n var _uid = 1;\r\n\r\n function uid(obj) {\r\n return obj._uid || (obj._uid = _uid++);\r\n }\r\n\r\n function uniq(array) {\r\n return filter.call(array, function(item, idx) {\r\n return array.indexOf(item) == idx;\r\n })\r\n }\r\n\r\n var idCounter = 0;\r\n function uniqueId (prefix) {\r\n var id = ++idCounter + '';\r\n return prefix ? prefix + id : id;\r\n }\r\n\r\n function langx() {\r\n return langx;\r\n }\r\n\r\n mixin(langx, {\r\n after: aspect(\"after\"),\r\n\r\n around: aspect(\"around\"),\r\n\r\n before: aspect(\"before\"),\r\n\r\n camelCase: function(str) {\r\n return str.replace(/-([\\da-z])/g, function(a) {\r\n return a.toUpperCase().replace('-', '');\r\n });\r\n },\r\n clone: clone,\r\n\r\n compact: compact,\r\n\r\n createEvent : createEvent,\r\n\r\n dasherize: dasherize,\r\n\r\n debounce: debounce,\r\n\r\n delegate: delegate,\r\n\r\n Deferred: Deferred,\r\n\r\n Evented: Evented,\r\n\r\n deserializeValue: deserializeValue,\r\n\r\n each: each,\r\n\r\n flatten: flatten,\r\n\r\n funcArg: funcArg,\r\n\r\n getQueryParams: getQueryParams,\r\n\r\n inArray: inArray,\r\n\r\n isArray: isArray,\r\n\r\n isArrayLike: isArrayLike,\r\n\r\n isBoolean: isBoolean,\r\n\r\n isDefined: function(v) {\r\n return v !== undefined;\r\n },\r\n\r\n isDocument: isDocument,\r\n\r\n isEmptyObject: isEmptyObject,\r\n\r\n isEqual: isEqual,\r\n\r\n isFunction: isFunction,\r\n\r\n isHtmlNode: isHtmlNode,\r\n\r\n isObject: isObject,\r\n\r\n isPlainObject: isPlainObject,\r\n\r\n isNumber: isNumber,\r\n\r\n isString: isString,\r\n\r\n isSameOrigin: isSameOrigin,\r\n\r\n isWindow: isWindow,\r\n\r\n klass: function(props, parent, options) {\r\n return createClass(props, parent, options);\r\n },\r\n\r\n lowerFirst: function(str) {\r\n return str.charAt(0).toLowerCase() + str.slice(1);\r\n },\r\n\r\n makeArray: makeArray,\r\n\r\n map: map,\r\n\r\n mixin: mixin,\r\n\r\n nextTick: nextTick,\r\n\r\n proxy: proxy,\r\n\r\n removeItem: removeItem,\r\n\r\n result : result,\r\n \r\n returnTrue: function() {\r\n return true;\r\n },\r\n\r\n returnFalse: function() {\r\n return false;\r\n },\r\n\r\n safeMixin: safeMixin,\r\n\r\n serializeValue: function(value) {\r\n return JSON.stringify(value)\r\n },\r\n\r\n Stateful: Stateful,\r\n\r\n substitute: substitute,\r\n\r\n toPixel: toPixel,\r\n\r\n trim: trim,\r\n\r\n type: type,\r\n\r\n uid: uid,\r\n\r\n uniq: uniq,\r\n\r\n uniqueId: uniqueId,\r\n\r\n upperFirst: function(str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n },\r\n\r\n URL: window.URL || window.webkitURL\r\n\r\n });\r\n\r\n return skylark.langx = langx;\r\n});\n/**\n * skylark-router - An Elegant HTML5 Routing Framework.\n * @author Hudaokeji Co.,Ltd\n * @version v0.9.6-beta\n * @link www.skylarkjs.org\n * @license MIT\n */\ndefine('skylark-router/router',[\r\n \"skylark-langx/skylark\",\r\n \"skylark-langx/langx\"\r\n], function(skylark, langx) {\r\n\r\n var _curCtx,\r\n _prevCtx,\r\n _baseUrl,\r\n _homePath,\r\n _routes = {},\r\n _cache = {},\r\n _hub = new langx.Evented();\r\n\r\n function createEvent(type,props) {\r\n var e = new CustomEvent(type,props);\r\n return langx.safeMixin(e, props);\r\n }\r\n\r\n var Route = langx.Evented.inherit({\r\n klassName: \"Route\",\r\n init: function(name, setting) {\r\n setting = langx.mixin({}, setting);\r\n var pathto = setting.pathto || \"\",\r\n pattern = pathto,\r\n paramNames = pattern.match(/\\:([a-zA-Z0-9_]+)/g);\r\n if (paramNames !== null) {\r\n paramNames = paramNames.map(function(paramName) {\r\n return paramName.substring(1);\r\n });\r\n pattern = pattern.replace(/\\:([a-zA-Z0-9_]+)/g, '(.*?)');\r\n } else {\r\n paramNames = [];\r\n }\r\n if (pattern === \"*\") {\r\n pattern = \"(.*)\";\r\n } else {\r\n pattern = pattern.replace(\"/\", \"\\\\/\");\r\n }\r\n\r\n this._setting = setting;\r\n this.name = name;\r\n this.pathto = pathto;\r\n this.paramNames = paramNames;\r\n this.params = pattern;\r\n this.regex = new RegExp(\"^\" + pattern + \"$\", \"\");\r\n\r\n var self = this;\r\n [\"entering\", \"entered\", \"exiting\", \"exited\"].forEach(function(eventName) {\r\n if (langx.isFunction(setting[eventName])) {\r\n self.on(eventName, setting[eventName]);\r\n }\r\n });\r\n },\r\n\r\n enter: function(ctx,query) {\r\n if (query) {\r\n var r = this._entering(ctx),\r\n self = this;\r\n\r\n return langx.Deferred.when(r).then(function(){\r\n var e = createEvent(\"entering\", {\r\n route: self,\r\n result: true\r\n });\r\n\r\n self.trigger(e);\r\n\r\n return e.result;\r\n });\r\n } else {\r\n this._entered(ctx);\r\n\r\n this.trigger(createEvent(\"entered\", langx.safeMixin({\r\n route: this\r\n }, ctx)));\r\n return this;\r\n }\r\n },\r\n\r\n exit: function(ctx, query) {\r\n if (query) {\r\n var ok = this._exiting(ctx);\r\n if (!ok) {\r\n return false;\r\n }\r\n\r\n var e = createEvent(\"exiting\", {\r\n route: this,\r\n result: true\r\n });\r\n\r\n this.trigger(e);\r\n\r\n return e.result;\r\n } else {\r\n this._exited(ctx);\r\n this.trigger(createEvent(\"exited\", langx.safeMixin({\r\n route: this\r\n }, ctx)));\r\n\r\n return this;\r\n }\r\n },\r\n\r\n match: function(path) {\r\n var names = this.paramNames,\r\n x = path.indexOf('?'),\r\n path = ~x ? path.slice(0, x) : decodeURIComponent(path),\r\n m = this.regex.exec(path);\r\n\r\n if (!m) {\r\n return false\r\n };\r\n\r\n var params = {};\r\n for (var i = 1, len = m.length; i < len; ++i) {\r\n var name = names[i - 1],\r\n val = decodeURIComponent(m[i]);\r\n params[name] = val;\r\n }\r\n\r\n return params;\r\n },\r\n\r\n path: function(params) {\r\n var path = this.pathto;\r\n if (params) {\r\n path = path.replace(/:([a-zA-Z0-9_]+)/g, function(match, paramName) {\r\n return params[paramName];\r\n });\r\n }\r\n return path;\r\n },\r\n\r\n _entering: function(ctx) {\r\n return true;\r\n },\r\n _entered: function(ctx) {\r\n return true;\r\n },\r\n _exiting: function(ctx) {\r\n return true;\r\n },\r\n _exited: function(ctx) {\r\n return true;\r\n },\r\n });\r\n\r\n function current() {\r\n return _curCtx;\r\n }\r\n\r\n // refresh the current route\r\n function dispatch(ctx) {\r\n\r\n if (_curCtx) {\r\n var ret = _curCtx.route.exit({\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n }, true);\r\n if (!ret) {\r\n return;\r\n }\r\n }\r\n\r\n _prevCtx = _curCtx;\r\n _curCtx = ctx;\r\n if (!_curCtx.route) {\r\n var m = map(_curCtx.path);\r\n _curCtx.route = m.route;\r\n _curCtx.params = m.params;\r\n }\r\n\r\n var r = _curCtx.route.enter({\r\n force: _curCtx.force,\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n },true);\r\n\r\n langx.Deferred.when(r).then(function() {\r\n _hub.trigger(createEvent(\"routing\", {\r\n current: _curCtx,\r\n previous: _prevCtx\r\n }));\r\n\r\n _curCtx.route.enter({\r\n path: _curCtx.path,\r\n params: _curCtx.params\r\n },false);\r\n\r\n if (_prevCtx) {\r\n _prevCtx.route.exit({\r\n path: _prevCtx.path,\r\n params: _prevCtx.params\r\n }, false);\r\n }\r\n\r\n _hub.trigger(createEvent(\"routed\", {\r\n current: _curCtx,\r\n previous: _prevCtx\r\n }));\r\n });\r\n }\r\n\r\n function go(path, force) {\r\n if (!force && _curCtx && _curCtx.path == path) {\r\n return false;\r\n }\r\n var ctx = map(path);\r\n if (ctx) {\r\n ctx.path = path;\r\n\r\n if (router.useHistoryApi) {\r\n var state = {\r\n force: force,\r\n path: path\r\n }\r\n\r\n window.history.pushState(state, document.title, (_baseUrl + path).replace(\"//\", \"/\"));\r\n window.dispatchEvent(createEvent(\"popstate\", {\r\n state: state\r\n }));\r\n } else if (router.useHashbang) {\r\n var newHash = \"#!\" + path;\r\n if (window.location.hash !== newHash) {\r\n window.location.hash = newHash;\r\n } else {\r\n dispatch(ctx);\r\n };\r\n } else {\r\n dispatch(ctx);\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n function map(path, noCache) {\r\n var finded = false;\r\n if (!noCache) {\r\n finded = _cache[path];\r\n if (finded) {\r\n return finded;\r\n }\r\n }\r\n langx.each(_routes, function(name, route) {\r\n var ret = route.match(path);\r\n if (ret) {\r\n finded = {\r\n route: route,\r\n params: ret\r\n }\r\n return false;\r\n }\r\n return true;\r\n });\r\n if (finded && !noCache) {\r\n _cache[path] = finded;\r\n }\r\n return finded;\r\n }\r\n\r\n function path(routeName, params) {\r\n var route = _routes[routeName],\r\n path;\r\n if (route) {\r\n path = route.path(params);\r\n }\r\n return path;\r\n }\r\n\r\n function previous() {\r\n return _prevCtx;\r\n }\r\n\r\n function baseUrl(path) {\r\n if (langx.isDefined(path)) {\r\n _baseUrl = path;\r\n return this;\r\n } else {\r\n return _baseUrl;\r\n }\r\n }\r\n\r\n function hub(){\r\n return _hub;\r\n }\r\n\r\n function homePath(path) {\r\n if (langx.isDefined(path)) {\r\n _homePath = path;\r\n return this;\r\n } else {\r\n return _homePath;\r\n }\r\n }\r\n\r\n function route(name, setting) {\r\n if (langx.isDefined(setting)) {\r\n var settings = {};\r\n settings[name] = setting;\r\n routes(settings);\r\n return this;\r\n } else {\r\n return _routes[name];\r\n }\r\n }\r\n\r\n function routes(settings) {\r\n if (!langx.isDefined(settings)) {\r\n return langx.mixin({}, _routes);\r\n } else {\r\n for (var name in settings) {\r\n _routes[name] = new router.Route(name, settings[name]);\r\n }\r\n }\r\n }\r\n\r\n //starts routing urls\r\n function start() {\r\n if (router.useHashbang == null && router.useHistoryApi == null) {\r\n if (window.location.host && window.history.pushState) {\r\n //web access\r\n router.useHistoryApi = true;\r\n } else {\r\n // local access\r\n router.useHashbang = true;\r\n }\r\n }\r\n\r\n var initPath = \"\";\r\n\r\n if (router.useHistoryApi) {\r\n initPath = window.location.pathname;\r\n if (_baseUrl === undefined) {\r\n _baseUrl = initPath.replace(/\\/$/, \"\");\r\n }\r\n initPath = initPath.replace(_baseUrl, \"\") || _homePath || \"/\";\r\n } else if (router.useHashbang) {\r\n initPath = window.location.hash.replace(\"#!\", \"\") || _homePath || \"/\";\r\n } else {\r\n initPath = \"/\";\r\n }\r\n\r\n if (!initPath.startsWith(\"/\")) {\r\n initPath = \"/\" + initPath;\r\n }\r\n /*\r\n eventer.on(document.body, \"click\", \"a[href]\", function(e) {\r\n var elm = e.currentTarget,\r\n url = elm.getAttribute(\"href\");\r\n\r\n if (url == \"#\") {\r\n return;\r\n }\r\n if (url && langx.isSameOrigin(elm.href)) {\r\n if (url.indexOf(_baseUrl) === 0) {\r\n url = url.substr(_baseUrl.length);\r\n eventer.stop(e);\r\n url = url.replace('#!', '');\r\n go(url);\r\n }\r\n }\r\n });\r\n */\r\n if (router.useHistoryApi) {\r\n window.addEventListener(\"popstate\", function(e) {\r\n if(e.state) dispatch(e.state);\r\n e.preventDefault();\r\n });\r\n } else if (router.useHashbang) {\r\n window.addEventListener(\"hashchange\", function(e) {\r\n dispatch({\r\n path: window.location.hash.replace(/^#!/, \"\")\r\n });\r\n e.preventDefault();\r\n });\r\n }\r\n\r\n go(initPath);\r\n }\r\n\r\n var router = function() {\r\n return router;\r\n };\r\n\r\n langx.mixin(router, {\r\n \"Route\": Route,\r\n\r\n // Current path being processed\r\n \"current\": current,\r\n\r\n // Changes the current path\r\n \"go\": go,\r\n\r\n \"map\": map,\r\n\r\n \"hub\": hub,\r\n\r\n \"off\": function() {\r\n _hub.off.apply(_hub, arguments);\r\n },\r\n\r\n \"on\": function() {\r\n _hub.on.apply(_hub, arguments);\r\n },\r\n\r\n \"one\": function() {\r\n _hub.one.apply(_hub, arguments);\r\n },\r\n\r\n // Returns the path of the named route\r\n \"path\": path,\r\n\r\n \"previous\": previous,\r\n\r\n \"baseUrl\": baseUrl,\r\n\r\n \"homePath\": homePath,\r\n\r\n \"route\": route,\r\n\r\n \"routes\": routes,\r\n\r\n //starts routing urls\r\n \"start\": start,\r\n\r\n \"trigger\": function(e) {\r\n _hub.trigger(e);\r\n return this;\r\n },\r\n\r\n \"useHistoryApi\": null,\r\n \"useHashbang\": null\r\n });\r\n\r\n return skylark.router = router;\r\n});\r\n\ndefine('skylarkjs/router',[\r\n \"skylark-router/router\"\r\n], function(router) {\r\n return router;\r\n});\r\n\ndefine('skylark-spa/spa',[\r\n \"skylark-langx/skylark\",\r\n \"skylark-langx/langx\",\r\n \"skylark-router/router\"\r\n], function(skylark, langx, router) {\r\n var Deferred = langx.Deferred;\r\n\r\n function createEvent(type, props) {\r\n var e = new CustomEvent(type, props);\r\n return langx.safeMixin(e, props);\r\n }\r\n\r\n var Route = router.Route = router.Route.inherit({\r\n klassName: \"SpaRoute\",\r\n\r\n init: function(name, setting) {\r\n this.overrided(name, setting);\r\n this.content = setting.content;\r\n this.forceRefresh = setting.forceRefresh;\r\n this.data = setting.data;\r\n //this.lazy = !!setting.lazy;\r\n var self = this;\r\n [\"preparing\", \"rendering\", \"rendered\"].forEach(function(eventName) {\r\n if (langx.isFunction(setting[eventName])) {\r\n self.on(eventName, setting[eventName]);\r\n }\r\n });\r\n },\r\n\r\n _entering: function(ctx) {\r\n if (this.forceRefresh || ctx.force || !this._prepared) {\r\n return this.prepare();\r\n }\r\n return this;\r\n },\r\n\r\n getConfigData: function(key) {\r\n return key ? this.data[key] : this.data;\r\n },\r\n\r\n getNamedValue: function() {\r\n return window.location.pathname.match(this.regex);\r\n },\r\n\r\n prepare: function() {\r\n var d = new Deferred(),\r\n setting = this._setting,\r\n controllerSetting = setting.controller,\r\n controller = this.controller,\r\n\r\n self = this,\r\n content = setting.content,\r\n contentPath = setting.contentPath;\r\n\r\n require([controllerSetting.type], function(type) {\r\n controller = self.controller = new type(controllerSetting);\r\n d.resolve();\r\n });\r\n\r\n return d.then(function() {\r\n var e = createEvent(\"preparing\", {\r\n route: self,\r\n result: true\r\n });\r\n self.trigger(e);\r\n return Deferred.when(e.result).then(function() {\r\n self._prepared = true;\r\n });\r\n });\r\n },\r\n\r\n render: function(ctx) {\r\n var e = createEvent(\"rendering\", {\r\n route: this,\r\n context: ctx,\r\n content: this.content\r\n });\r\n this.trigger(e);\r\n return e.content;\r\n },\r\n\r\n trigger: function(e) {\r\n var controller = this.controller;\r\n if (controller) {\r\n return controller.perform(e);\r\n } else {\r\n return this.overrided(e);\r\n }\r\n }\r\n });\r\n\r\n var RouteController = langx.Evented.inherit({\r\n klassName: \"SpaRouteController\",\r\n\r\n init: function(route, setting) {\r\n setting = setting || {};\r\n this.content = setting.content;\r\n this.data = setting.data;\r\n },\r\n\r\n getConfigData: function(key) {\r\n return key ? this.data[key] : this.data;\r\n },\r\n\r\n perform: function(e) {\r\n var eventName = e.type;\r\n if (this[eventName]) {\r\n return this[eventName].call(this, e);\r\n }\r\n\r\n }\r\n });\r\n\r\n var Page = langx.Evented.inherit({\r\n klassName: \"SpaPage\",\r\n\r\n init: function(params) {\r\n params = langx.mixin({\r\n \"routeViewer\": \"body\"\r\n }, params);\r\n\r\n this._params = params;\r\n this._rvc = document.querySelector(params.routeViewer);\r\n this._router = router;\r\n\r\n router.on(\"routed\", langx.proxy(this, \"refresh\"));\r\n },\r\n\r\n prepare: function() {\r\n\r\n },\r\n\r\n //Refreshes the route\r\n refresh: function() {\r\n var curCtx = router.current(),\r\n prevCtx = router.previous();\r\n var content = curCtx.route.render(curCtx);\r\n if (content===undefined || content===null) {\r\n return;\r\n }\r\n if (langx.isString(content)) {\r\n this._rvc.innerHTML = content;\r\n } else {\r\n this._rvc.innerHTML = \"\";\r\n this._rvc.appendChild(content);\r\n }\r\n curCtx.route.trigger(createEvent(\"rendered\", {\r\n route: curCtx.route,\r\n content: content\r\n }));\r\n }\r\n });\r\n\r\n var Plugin = langx.Evented.inherit({\r\n klassName: \"SpaPlugin\",\r\n\r\n init: function(name, setting) {\r\n this.name = name;\r\n\r\n if (langx.isString(setting.hookers)) {\r\n setting.hookers = setting.hookers.split(\" \");\r\n }\r\n this._setting = setting;\r\n },\r\n\r\n isHooked: function(eventName) {\r\n var hookers = this._setting.hookers || [];\r\n return hookers.indexOf(eventName) > -1;\r\n },\r\n\r\n prepare: function() {\r\n var d = new Deferred(),\r\n setting = this._setting,\r\n controllerSetting = setting.controller,\r\n controller = this.controller,\r\n self = this;\r\n require([controllerSetting.type], function(type) {\r\n controller = self.controller = new type(controllerSetting);\r\n router.on(setting.hookers, {\r\n plugin: self\r\n }, langx.proxy(controller.perform, controller));\r\n d.resolve();\r\n });\r\n return d.then(function() {\r\n var e = createEvent(\"preparing\", {\r\n plugin: self,\r\n result: true\r\n });\r\n self.trigger(e);\r\n return Deferred.when(e.result).then(function() {\r\n self._prepared = true;\r\n });\r\n });\r\n },\r\n\r\n trigger: function(e) {\r\n var controller = this.controller;\r\n if (controller) {\r\n return controller.perform(e);\r\n } else {\r\n return this.overrided(e);\r\n }\r\n }\r\n });\r\n\r\n var PluginController = langx.Evented.inherit({\r\n klassName: \"SpaPluginController\",\r\n\r\n init: function(plugin) {\r\n this.plugin = plugin;\r\n },\r\n\r\n perform: function(e) {\r\n var eventName = e.type;\r\n if (this[eventName]) {\r\n return this[eventName].call(this, e);\r\n }\r\n\r\n }\r\n });\r\n\r\n var Application = langx.Evented.inherit({\r\n klassName: \"SpaApplication\",\r\n\r\n init: function(config) {\r\n if (app) {\r\n return app;\r\n }\r\n var plugins = this._plugins = {};\r\n\r\n config = this._config = langx.mixin({\r\n plugins: {}\r\n }, config, true);\r\n\r\n langx.each(config.plugins, function(pluginName, setting) {\r\n plugins[pluginName] = new Plugin(pluginName, setting);\r\n });\r\n\r\n router.routes(config.routes);\r\n\r\n this._router = router;\r\n\r\n this._page = new spa.Page(config.page);\r\n\r\n document.title = config.title;\r\n var baseUrl = config.baseUrl;\r\n if (baseUrl === undefined) {\r\n baseUrl = config.baseUrl = (new langx.URL(document.baseURI)).pathname;\r\n }\r\n router.baseUrl(baseUrl);\r\n\r\n if (config.homePath) {\r\n router.homePath(config.homePath);\r\n }\r\n\r\n app = this;\r\n },\r\n\r\n getConfig: function(key) {\r\n return key ? this._config[key] : this._config;\r\n },\r\n\r\n go: function(path, force) {\r\n router.go(path, force);\r\n return this;\r\n },\r\n\r\n page: function() {\r\n return this._page;\r\n },\r\n\r\n prepare: function() {\r\n if (this._prepared) {\r\n return Deferred.resolve();\r\n }\r\n var self = this;\r\n\r\n var promises0 = langx.map(this._plugins, function(plugin, name) {\r\n if (plugin.isHooked(\"starting\")) {\r\n return plugin.prepare();\r\n }\r\n });\r\n\r\n return Deferred.all(promises0).then(function() {\r\n router.trigger(createEvent(\"starting\", {\r\n spa: self\r\n }));\r\n var promises1 = langx.map(router.routes(), function(route, name) {\r\n if (route.lazy === false) {\r\n return route.prepare();\r\n }\r\n }),\r\n promises2 = langx.map(self._plugins, function(plugin, name) {\r\n if (!plugin.isHooked(\"starting\")) {\r\n return plugin.prepare();\r\n }\r\n });\r\n\r\n\r\n return Deferred.all(promises1.concat(promises2)).then(function() {\r\n self._prepared = true;\r\n });\r\n });\r\n },\r\n\r\n run: function() {\r\n this._router.start();\r\n router.trigger(createEvent(\"started\", {\r\n spa: this\r\n }));\r\n }\r\n });\r\n\r\n var app;\r\n var spa = function(config) {\r\n if (!app) {\r\n window[config.name || \"app\"] = app = new spa.Application(config);\r\n }\r\n\r\n return app;\r\n }\r\n\r\n langx.mixin(spa, {\r\n \"Application\": Application,\r\n\r\n \"Page\": Page,\r\n\r\n \"Plugin\": Plugin,\r\n \"PluginController\": PluginController,\r\n\r\n \"Route\": Route,\r\n \"RouteController\": RouteController\r\n\r\n });\r\n\r\n return skylark.spa = spa;\r\n});\r\n\ndefine('skylarkjs/spa',[\r\n \"skylark-spa/spa\"\r\n], function(spa) {\r\n return spa;\r\n});\r\n\ndefine('skylarkjs/langx',[\r\n \"skylark-langx/langx\"\r\n], function(langx) {\r\n return langx;\r\n});\r\n\ndefine('skylarkjs/core',[\r\n \"./skylark\",\r\n \"./router\",\r\n \"./spa\",\r\n \"./langx\"\r\n], function(skylark) {\r\n return skylark;\r\n})\r\n;\ndefine('skylark-utils/langx',[\r\n \"skylark-langx/langx\"\r\n], function(langx) {\r\n return langx;\r\n});\r\n\ndefine('skylark-utils/browser',[\r\n \"./skylark\",\r\n \"./langx\"\r\n], function(skylark,langx) {\r\n var checkedCssProperties = {\r\n \"transitionproperty\": \"TransitionProperty\",\r\n };\r\n\r\n var css3PropPrefix = \"\",\r\n css3StylePrefix = \"\",\r\n css3EventPrefix = \"\",\r\n\r\n cssStyles = {},\r\n cssProps = {},\r\n\r\n vendorPrefix,\r\n vendorPrefixRE,\r\n vendorPrefixesRE = /^(Webkit|webkit|O|Moz|moz|ms)(.*)$/,\r\n\r\n document = window.document,\r\n testEl = document.createElement(\"div\"),\r\n\r\n matchesSelector = testEl.webkitMatchesSelector ||\r\n testEl.mozMatchesSelector ||\r\n testEl.oMatchesSelector ||\r\n testEl.matchesSelector,\r\n\r\n testStyle = testEl.style;\r\n\r\n for (var name in testStyle) {\r\n var matched = name.match(vendorPrefixRE || vendorPrefixesRE);\r\n if (matched) {\r\n if (!vendorPrefixRE) {\r\n vendorPrefix = matched[1];\r\n vendorPrefixRE = new RegExp(\"^(\" + vendorPrefix + \")(.*)$\");\r\n\r\n css3StylePrefix = vendorPrefix;\r\n css3PropPrefix = '-' + vendorPrefix.toLowerCase() + '-';\r\n css3EventPrefix = vendorPrefix.toLowerCase();\r\n }\r\n\r\n cssStyles[langx.lowerFirst(matched[2])] = name;\r\n var cssPropName = langx.dasherize(matched[2]);\r\n cssProps[cssPropName] = css3PropPrefix + cssPropName;\r\n\r\n }\r\n }\r\n\r\n\r\n function normalizeCssEvent(name) {\r\n return css3EventPrefix ? css3EventPrefix + name : name.toLowerCase();\r\n }\r\n\r\n function normalizeCssProperty(name) {\r\n return cssProps[name] || name;\r\n }\r\n\r\n function normalizeStyleProperty(name) {\r\n return cssStyles[name] || name;\r\n }\r\n\r\n function browser() {\r\n return browser;\r\n }\r\n\r\n langx.mixin(browser, {\r\n css3PropPrefix: css3PropPrefix,\r\n\r\n normalizeStyleProperty: normalizeStyleProperty,\r\n\r\n normalizeCssProperty: normalizeCssProperty,\r\n\r\n normalizeCssEvent: normalizeCssEvent,\r\n\r\n matchesSelector: matchesSelector,\r\n\r\n location: function() {\r\n return window.location;\r\n },\r\n\r\n support : {}\r\n\r\n });\r\n\r\n testEl = null;\r\n\r\n return skylark.browser = browser;\r\n});\r\n\ndefine('skylarkjs/browser',[\r\n \"skylark-utils/browser\"\r\n], function(browser) {\r\n return browser;\r\n});\r\n\ndefine('skylark-utils/styler',[\r\n \"./skylark\",\r\n \"./langx\"\r\n], function(skylark, langx) {\r\n var every = Array.prototype.every,\r\n forEach = Array.prototype.forEach,\r\n camelCase = langx.camelCase,\r\n dasherize = langx.dasherize;\r\n\r\n function maybeAddPx(name, value) {\r\n return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\r\n }\r\n\r\n var cssNumber = {\r\n 'column-count': 1,\r\n 'columns': 1,\r\n 'font-weight': 1,\r\n 'line-height': 1,\r\n 'opacity': 1,\r\n 'z-index': 1,\r\n 'zoom': 1\r\n },\r\n classReCache = {\r\n\r\n };\r\n\r\n function classRE(name) {\r\n return name in classReCache ?\r\n classReCache[name] : (classReCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'));\r\n }\r\n\r\n // access className property while respecting SVGAnimatedString\r\n function className(node, value) {\r\n var klass = node.className || '',\r\n svg = klass && klass.baseVal !== undefined\r\n\r\n if (value === undefined) return svg ? klass.baseVal : klass\r\n svg ? (klass.baseVal = value) : (node.className = value)\r\n }\r\n\r\n\r\n var elementDisplay = {};\r\n\r\n function defaultDisplay(nodeName) {\r\n var element, display\r\n if (!elementDisplay[nodeName]) {\r\n element = document.createElement(nodeName)\r\n document.body.appendChild(element)\r\n display = getComputedStyle(element, '').getPropertyValue(\"display\")\r\n element.parentNode.removeChild(element)\r\n display == \"none\" && (display = \"block\")\r\n elementDisplay[nodeName] = display\r\n }\r\n return elementDisplay[nodeName]\r\n }\r\n\r\n function show(elm) {\r\n styler.css(elm, \"display\", \"\");\r\n if (styler.css(elm, \"display\") == \"none\") {\r\n styler.css(elm, \"display\", defaultDisplay(elm.nodeName));\r\n }\r\n return this;\r\n }\r\n\r\n function isInvisible(elm) {\r\n return styler.css(elm, \"display\") == \"none\" || styler.css(elm, \"opacity\") == 0;\r\n }\r\n\r\n function hide(elm) {\r\n styler.css(elm, \"display\", \"none\");\r\n return this;\r\n }\r\n\r\n function addClass(elm, name) {\r\n if (!name) return this\r\n var cls = className(elm),\r\n names;\r\n if (langx.isString(name)) {\r\n names = name.split(/\\s+/g);\r\n } else {\r\n names = name;\r\n }\r\n names.forEach(function(klass) {\r\n var re = classRE(klass);\r\n if (!cls.match(re)) {\r\n cls += (cls ? \" \" : \"\") + klass;\r\n }\r\n });\r\n\r\n className(elm, cls);\r\n\r\n return this;\r\n }\r\n\r\n function css(elm, property, value) {\r\n if (arguments.length < 3) {\r\n var computedStyle,\r\n computedStyle = getComputedStyle(elm, '')\r\n if (langx.isString(property)) {\r\n return elm.style[camelCase(property)] || computedStyle.getPropertyValue(property)\r\n } else if (langx.isArrayLike(property)) {\r\n var props = {}\r\n forEach.call(property, function(prop) {\r\n props[prop] = (elm.style[camelCase(prop)] || computedStyle.getPropertyValue(prop))\r\n })\r\n return props\r\n }\r\n }\r\n\r\n var css = '';\r\n if (typeof(property) == 'string') {\r\n if (!value && value !== 0) {\r\n elm.style.removeProperty(dasherize(property));\r\n } else {\r\n css = dasherize(property) + \":\" + maybeAddPx(property, value)\r\n }\r\n } else {\r\n for (key in property) {\r\n if (property[key] === undefined) {\r\n continue;\r\n }\r\n if (!property[key] && property[key] !== 0) {\r\n elm.style.removeProperty(dasherize(key));\r\n } else {\r\n css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\r\n }\r\n }\r\n }\r\n\r\n elm.style.cssText += ';' + css;\r\n return this;\r\n }\r\n\r\n\r\n function hasClass(elm, name) {\r\n var re = classRE(name);\r\n return elm.className && elm.className.match(re);\r\n }\r\n\r\n function removeClass(elm, name) {\r\n if (name) {\r\n var cls = className(elm),\r\n names;\r\n\r\n if (langx.isString(name)) {\r\n names = name.split(/\\s+/g);\r\n } else {\r\n names = name;\r\n }\r\n\r\n names.forEach(function(klass) {\r\n var re = classRE(klass);\r\n if (cls.match(re)) {\r\n cls = cls.replace(re, \" \");\r\n }\r\n });\r\n\r\n className(elm, cls.trim());\r\n } else {\r\n className(elm,\"\");\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function toggleClass(elm, name, when) {\r\n var self = this;\r\n name.split(/\\s+/g).forEach(function(klass) {\r\n if (when === undefined) {\r\n when = !self.hasClass(elm, klass);\r\n }\r\n if (when) {\r\n self.addClass(elm, klass);\r\n } else {\r\n self.removeClass(elm, klass)\r\n }\r\n });\r\n\r\n return self;\r\n }\r\n\r\n var styler = function() {\r\n return styler;\r\n };\r\n\r\n langx.mixin(styler, {\r\n autocssfix: true,\r\n cssHooks : {\r\n\r\n },\r\n \r\n addClass: addClass,\r\n className: className,\r\n css: css,\r\n hasClass: hasClass,\r\n hide: hide,\r\n isInvisible: isInvisible,\r\n removeClass: removeClass,\r\n show: show,\r\n toggleClass: toggleClass\r\n });\r\n\r\n return skylark.styler = styler;\r\n});\r\n\ndefine('skylark-utils/noder',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./styler\"\r\n], function(skylark, langx, styler) {\r\n var isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g),\r\n fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\r\n singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\r\n div = document.createElement(\"div\"),\r\n table = document.createElement('table'),\r\n tableBody = document.createElement('tbody'),\r\n tableRow = document.createElement('tr'),\r\n containers = {\r\n 'tr': tableBody,\r\n 'tbody': table,\r\n 'thead': table,\r\n 'tfoot': table,\r\n 'td': tableRow,\r\n 'th': tableRow,\r\n '*': div\r\n },\r\n rootNodeRE = /^(?:body|html)$/i,\r\n map = Array.prototype.map,\r\n slice = Array.prototype.slice;\r\n\r\n function ensureNodes(nodes, copyByClone) {\r\n if (!langx.isArrayLike(nodes)) {\r\n nodes = [nodes];\r\n }\r\n if (copyByClone) {\r\n nodes = map.call(nodes, function(node) {\r\n return node.cloneNode(true);\r\n });\r\n }\r\n return langx.flatten(nodes);\r\n }\r\n\r\n function nodeName(elm, chkName) {\r\n var name = elm.nodeName && elm.nodeName.toLowerCase();\r\n if (chkName !== undefined) {\r\n return name === chkName.toLowerCase();\r\n }\r\n return name;\r\n };\r\n\r\n function contents(elm) {\r\n if (nodeName(elm, \"iframe\")) {\r\n return elm.contentDocument;\r\n }\r\n return elm.childNodes;\r\n }\r\n\r\n function html(node, html) {\r\n if (html === undefined) {\r\n return node.innerHTML;\r\n } else {\r\n this.empty(node);\r\n html = html || \"\";\r\n if (langx.isString(html) || langx.isNumber(html)) {\r\n node.innerHTML = html;\r\n } else if (langx.isArrayLike(html)) {\r\n for (var i = 0; i < html.length; i++) {\r\n node.appendChild(html[i]);\r\n }\r\n } else {\r\n node.appendChild(html);\r\n }\r\n }\r\n }\r\n\r\n function clone(node, deep) {\r\n var self = this,\r\n clone;\r\n\r\n // TODO: Add feature detection here in the future\r\n if (!isIE || node.nodeType !== 1 || deep) {\r\n return node.cloneNode(deep);\r\n }\r\n\r\n // Make a HTML5 safe shallow copy\r\n if (!deep) {\r\n clone = document.createElement(node.nodeName);\r\n\r\n // Copy attribs\r\n each(self.getAttribs(node), function(attr) {\r\n self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName));\r\n });\r\n\r\n return clone;\r\n }\r\n }\r\n\r\n function createElement(tag, props,parent) {\r\n var node = document.createElement(tag);\r\n if (props) {\r\n for (var name in props) {\r\n node.setAttribute(name, props[name]);\r\n }\r\n }\r\n if (parent) {\r\n append(parent,node);\r\n }\r\n return node;\r\n }\r\n\r\n function createFragment(html) {\r\n // A special case optimization for a single tag\r\n html = langx.trim(html);\r\n if (singleTagRE.test(html)) {\r\n return [createElement(RegExp.$1)];\r\n }\r\n\r\n var name = fragmentRE.test(html) && RegExp.$1\r\n if (!(name in containers)) {\r\n name = \"*\"\r\n }\r\n var container = containers[name];\r\n container.innerHTML = \"\" + html;\r\n dom = slice.call(container.childNodes);\r\n\r\n dom.forEach(function(node) {\r\n container.removeChild(node);\r\n })\r\n\r\n return dom;\r\n }\r\n\r\n function contains(node, child) {\r\n return isChildOf(child, node);\r\n }\r\n\r\n function createTextNode(text) {\r\n return document.createTextNode(text);\r\n }\r\n\r\n function doc() {\r\n return document;\r\n }\r\n\r\n function empty(node) {\r\n while (node.hasChildNodes()) {\r\n var child = node.firstChild;\r\n node.removeChild(child);\r\n }\r\n return this;\r\n }\r\n\r\n function isChildOf(node, parent,directly) {\r\n if (directly) {\r\n return node.parentNode === parent;\r\n }\r\n if (document.documentElement.contains) {\r\n return parent.contains(node);\r\n }\r\n while (node) {\r\n if (parent === node) {\r\n return true;\r\n }\r\n\r\n node = node.parentNode;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function isDoc(node) {\r\n return node != null && node.nodeType == node.DOCUMENT_NODE\r\n }\r\n\r\n function ownerDoc(elm) {\r\n if (!elm) {\r\n return document;\r\n }\r\n\r\n if (elm.nodeType == 9) {\r\n return elm;\r\n }\r\n\r\n return elm.ownerDocument;\r\n }\r\n\r\n function ownerWindow(elm) {\r\n var doc = ownerDoc(elm);\r\n return doc.defaultView || doc.parentWindow;\r\n } \r\n\r\n function after(node, placing, copyByClone) {\r\n var refNode = node,\r\n parent = refNode.parentNode;\r\n if (parent) {\r\n var nodes = ensureNodes(placing, copyByClone),\r\n refNode = refNode.nextSibling;\r\n\r\n for (var i = 0; i < nodes.length; i++) {\r\n if (refNode) {\r\n parent.insertBefore(nodes[i], refNode);\r\n } else {\r\n parent.appendChild(nodes[i]);\r\n }\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n function before(node, placing, copyByClone) {\r\n var refNode = node,\r\n parent = refNode.parentNode;\r\n if (parent) {\r\n var nodes = ensureNodes(placing, copyByClone);\r\n for (var i = 0; i < nodes.length; i++) {\r\n parent.insertBefore(nodes[i], refNode);\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n function prepend(node, placing, copyByClone) {\r\n var parentNode = node,\r\n refNode = parentNode.firstChild,\r\n nodes = ensureNodes(placing, copyByClone);\r\n for (var i = 0; i < nodes.length; i++) {\r\n if (refNode) {\r\n parentNode.insertBefore(nodes[i], refNode);\r\n } else {\r\n parentNode.appendChild(nodes[i]);\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n function append(node, placing, copyByClone) {\r\n var parentNode = node,\r\n nodes = ensureNodes(placing, copyByClone);\r\n for (var i = 0; i < nodes.length; i++) {\r\n parentNode.appendChild(nodes[i]);\r\n }\r\n return this;\r\n }\r\n\r\n function overlay(elm, params) {\r\n var overlayDiv = createElement(\"div\", params);\r\n styler.css(overlayDiv, {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n zIndex: 0x7FFFFFFF,\r\n opacity: 0.7\r\n });\r\n elm.appendChild(overlayDiv);\r\n return overlayDiv;\r\n\r\n }\r\n\r\n\r\n\r\n function remove(node) {\r\n if (node && node.parentNode) {\r\n try {\r\n node.parentNode.removeChild(node);\r\n } catch (e) {\r\n console.warn(\"The node is already removed\",e);\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n function replace(node, oldNode) {\r\n oldNode.parentNode.replaceChild(node, oldNode);\r\n return this;\r\n }\r\n\r\n function throb(elm, params) {\r\n params = params || {};\r\n var self = this,\r\n text = params.text,\r\n style = params.style,\r\n time = params.time,\r\n callback = params.callback,\r\n timer,\r\n throbber = this.createElement(\"div\", {\r\n className: params.className || \"throbber\",\r\n style: style\r\n }),\r\n _overlay = overlay(throbber, {\r\n className: 'overlay fade'\r\n }),\r\n throb = this.createElement(\"div\", {\r\n className: \"throb\"\r\n }),\r\n textNode = this.createTextNode(text || \"\"),\r\n remove = function() {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n if (throbber) {\r\n self.remove(throbber);\r\n throbber = null;\r\n }\r\n },\r\n update = function(params) {\r\n if (params && params.text && throbber) {\r\n textNode.nodeValue = params.text;\r\n }\r\n };\r\n throb.appendChild(textNode);\r\n throbber.appendChild(throb);\r\n elm.appendChild(throbber);\r\n var end = function() {\r\n remove();\r\n if (callback) callback();\r\n };\r\n if (time) {\r\n timer = setTimeout(end, time);\r\n }\r\n\r\n return {\r\n remove: remove,\r\n update: update\r\n };\r\n }\r\n\r\n function traverse(node, fn) {\r\n fn(node)\r\n for (var i = 0, len = node.childNodes.length; i < len; i++) {\r\n traverse(node.childNodes[i], fn);\r\n }\r\n return this;\r\n }\r\n\r\n function reverse(node) {\r\n var firstChild = node.firstChild;\r\n for (var i = node.children.length - 1; i > 0; i--) {\r\n if (i > 0) {\r\n var child = node.children[i];\r\n node.insertBefore(child, firstChild);\r\n }\r\n }\r\n }\r\n\r\n function wrapper(node, wrapperNode) {\r\n if (langx.isString(wrapperNode)) {\r\n wrapperNode = this.createFragment(wrapperNode).firstChild;\r\n }\r\n node.parentNode.insertBefore(wrapperNode, node);\r\n wrapperNode.appendChild(node);\r\n }\r\n\r\n function wrapperInner(node, wrapperNode) {\r\n var childNodes = slice.call(node.childNodes);\r\n node.appendChild(wrapperNode);\r\n for (var i = 0; i < childNodes.length; i++) {\r\n wrapperNode.appendChild(childNodes[i]);\r\n }\r\n return this;\r\n }\r\n\r\n function unwrap(node) {\r\n var child, parent = node.parentNode;\r\n if (parent) {\r\n if (this.isDoc(parent.parentNode)) return;\r\n parent.parentNode.insertBefore(node, parent);\r\n }\r\n }\r\n\r\n function noder() {\r\n return noder;\r\n }\r\n\r\n langx.mixin(noder, {\r\n clone: clone,\r\n contents: contents,\r\n\r\n createElement: createElement,\r\n\r\n createFragment: createFragment,\r\n\r\n contains: contains,\r\n\r\n createTextNode: createTextNode,\r\n\r\n doc: doc,\r\n\r\n empty: empty,\r\n\r\n html: html,\r\n\r\n isChildOf: isChildOf,\r\n\r\n isDoc: isDoc,\r\n\r\n ownerDoc: ownerDoc,\r\n\r\n ownerWindow : ownerWindow,\r\n\r\n after: after,\r\n\r\n before: before,\r\n\r\n prepend: prepend,\r\n\r\n append: append,\r\n\r\n remove: remove,\r\n\r\n replace: replace,\r\n\r\n throb: throb,\r\n\r\n traverse: traverse,\r\n\r\n reverse: reverse,\r\n\r\n wrapper: wrapper,\r\n\r\n wrapperInner: wrapperInner,\r\n\r\n unwrap: unwrap\r\n });\r\n\r\n return skylark.noder = noder;\r\n});\r\n\ndefine('skylark-utils/css',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\"\r\n], function(skylark, langx, construct) {\r\n\r\n var head = document.getElementsByTagName(\"head\")[0],\r\n count = 0,\r\n sheetsByUrl = {},\r\n sheetElementsById = {},\r\n defaultSheetId = _createStyleSheet(),\r\n defaultSheet = sheetElementsById[defaultSheetId],\r\n rulesPropName = (\"cssRules\" in defaultSheet) ? \"cssRules\" : \"rules\",\r\n insertRuleFunc,\r\n deleteRuleFunc = defaultSheet.deleteRule || defaultSheet.removeRule;\r\n\r\n if (defaultSheet.insertRule) {\r\n var _insertRule = defaultSheet.insertRule;\r\n insertRuleFunc = function(selector, css, index) {\r\n _insertRule.call(this, selector + \"{\" + css + \"}\", index);\r\n };\r\n } else {\r\n insertRuleFunc = defaultSheet.addRule;\r\n }\r\n\r\n function normalizeSelector(selectorText) {\r\n var selector = [],\r\n last, len;\r\n last = defaultSheet[rulesPropName].length;\r\n insertRuleFunc.call(defaultSheet, selectorText, ';');\r\n len = defaultSheet[rulesPropName].length;\r\n for (var i = len - 1; i >= last; i--) {\r\n selector.push(_sheet[_rules][i].selectorText);\r\n deleteRuleFunc.call(defaultSheet, i);\r\n }\r\n return selector.reverse().join(', ');\r\n }\r\n\r\n function _createStyleSheet() {\r\n var link = document.createElement(\"link\"),\r\n id = (count++);\r\n\r\n link.rel = \"stylesheet\";\r\n link.type = \"text/css\";\r\n link.async = false;\r\n link.defer = false;\r\n\r\n head.appendChild(link);\r\n sheetElementsById[id] = link;\r\n\r\n return id;\r\n }\r\n\r\n function css() {\r\n return css;\r\n }\r\n\r\n langx.mixin(css, {\r\n createStyleSheet: function(cssText) {\r\n return _createStyleSheet();\r\n },\r\n\r\n loadStyleSheet: function(url, loadedCallback, errorCallback) {\r\n var sheet = sheetsByUrl[url];\r\n if (!sheet) {\r\n sheet = sheetsByUrl[url] = {\r\n state: 0, //0:unload,1:loaded,-1:loaderror\r\n loadedCallbacks: [],\r\n errorCallbacks: []\r\n };\r\n }\r\n\r\n sheet.loadedCallbacks.push(loadedCallback);\r\n sheet.errorCallbacks.push(errorCallback);\r\n\r\n if (sheet.state === 1) {\r\n sheet.node.onload();\r\n } else if (sheet.state === -1) {\r\n sheet.node.onerror();\r\n } else {\r\n sheet.id = _createStyleSheet();\r\n var node = sheet.node = sheetElementsById[sheet.id];\r\n\r\n startTime = new Date().getTime();\r\n\r\n node.onload = function() {\r\n sheet.state = 1;\r\n sheet.state = -1;\r\n var callbacks = sheet.loadedCallbacks,\r\n i = callbacks.length;\r\n\r\n while (i--) {\r\n callbacks[i]();\r\n }\r\n sheet.loadedCallbacks = [];\r\n sheet.errorCallbacks = [];\r\n },\r\n node.onerror = function() {\r\n sheet.state = -1;\r\n var callbacks = sheet.errorCallbacks,\r\n i = callbacks.length;\r\n\r\n while (i--) {\r\n callbacks[i]();\r\n }\r\n sheet.loadedCallbacks = [];\r\n sheet.errorCallbacks = [];\r\n };\r\n\r\n node.href = sheet.url = url;\r\n\r\n sheetsByUrl[node.url] = sheet;\r\n\r\n }\r\n return sheet.id;\r\n },\r\n\r\n deleteSheetRule: function(sheetId, rule) {\r\n var sheet = sheetElementsById[sheetId];\r\n if (langx.isNumber(rule)) {\r\n deleteRuleFunc.call(sheet, rule);\r\n } else {\r\n langx.each(sheet[rulesPropName], function(i, _rule) {\r\n if (rule === _rule) {\r\n deleteRuleFunc.call(sheet, i);\r\n return false;\r\n }\r\n });\r\n }\r\n },\r\n\r\n deleteRule: function(rule) {\r\n this.deleteSheetRule(defaultSheetId, rule);\r\n return this;\r\n },\r\n\r\n removeStyleSheet: function(sheetId) {\r\n if (sheetId === defaultSheetId) {\r\n throw new Error(\"The default stylesheet can not be deleted\");\r\n }\r\n var sheet = sheetElementsById[sheetId];\r\n delete sheetElementsById[sheetId];\r\n\r\n\r\n construct.remove(sheet);\r\n return this;\r\n },\r\n\r\n findRules: function(selector, sheetId) {\r\n //return array of CSSStyleRule objects that match the selector text\r\n var rules = [],\r\n filters = parseSelector(selector);\r\n $(document.styleSheets).each(function(i, styleSheet) {\r\n if (filterStyleSheet(filters.styleSheet, styleSheet)) {\r\n $.merge(rules, $(styleSheet[_rules]).filter(function() {\r\n return matchSelector(this, filters.selectorText, filters.styleSheet === \"*\");\r\n }).map(function() {\r\n return normalizeRule($.support.nativeCSSStyleRule ? this : new CSSStyleRule(this), styleSheet);\r\n }));\r\n }\r\n });\r\n return rules.reverse();\r\n },\r\n\r\n insertRule: function(selector, css, index) {\r\n return this.insertSheetRule(defaultSheetId, selector, css, index);\r\n },\r\n\r\n insertSheetRule: function(sheetId, selector, css, index) {\r\n if (!selector || !css) {\r\n return -1;\r\n }\r\n\r\n var sheet = sheetElementsById[sheetId];\r\n index = index || sheet[rulesPropName].length;\r\n\r\n return insertRuleFunc.call(sheet, selector, css, index);\r\n\r\n }\r\n });\r\n\r\n return skylark.css = css;\r\n});\r\n\ndefine('skylarkjs/css',[\r\n \"skylark-utils/css\"\r\n], function(css) {\r\n return css;\r\n});\r\n\ndefine('skylark-utils/finder',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./browser\",\r\n \"./noder\"\r\n], function(skylark, langx, browser, noder, velm) {\r\n var local = {},\r\n filter = Array.prototype.filter,\r\n slice = Array.prototype.slice,\r\n nativeMatchesSelector = browser.matchesSelector;\r\n\r\n /*\r\n ---\r\n name: Slick.Parser\r\n description: Standalone CSS3 Selector parser\r\n provides: Slick.Parser\r\n ...\r\n */\r\n ;\r\n (function() {\r\n\r\n var parsed,\r\n separatorIndex,\r\n combinatorIndex,\r\n reversed,\r\n cache = {},\r\n reverseCache = {},\r\n reUnescape = /\\\\/g;\r\n\r\n var parse = function(expression, isReversed) {\r\n if (expression == null) return null;\r\n if (expression.Slick === true) return expression;\r\n expression = ('' + expression).replace(/^\\s+|\\s+$/g, '');\r\n reversed = !!isReversed;\r\n var currentCache = (reversed) ? reverseCache : cache;\r\n if (currentCache[expression]) return currentCache[expression];\r\n parsed = {\r\n Slick: true,\r\n expressions: [],\r\n raw: expression,\r\n reverse: function() {\r\n return parse(this.raw, true);\r\n }\r\n };\r\n separatorIndex = -1;\r\n while (expression != (expression = expression.replace(regexp, parser)));\r\n parsed.length = parsed.expressions.length;\r\n return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed;\r\n };\r\n\r\n var reverseCombinator = function(combinator) {\r\n if (combinator === '!') return ' ';\r\n else if (combinator === ' ') return '!';\r\n else if ((/^!/).test(combinator)) return combinator.replace(/^!/, '');\r\n else return '!' + combinator;\r\n };\r\n\r\n var reverse = function(expression) {\r\n var expressions = expression.expressions;\r\n for (var i = 0; i < expressions.length; i++) {\r\n var exp = expressions[i];\r\n var last = {\r\n parts: [],\r\n tag: '*',\r\n combinator: reverseCombinator(exp[0].combinator)\r\n };\r\n\r\n for (var j = 0; j < exp.length; j++) {\r\n var cexp = exp[j];\r\n if (!cexp.reverseCombinator) cexp.reverseCombinator = ' ';\r\n cexp.combinator = cexp.reverseCombinator;\r\n delete cexp.reverseCombinator;\r\n }\r\n\r\n exp.reverse().push(last);\r\n }\r\n return expression;\r\n };\r\n\r\n var escapeRegExp = (function() {\r\n // Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan MIT License\r\n var from = /(?=[\\-\\[\\]{}()*+?.\\\\\\^$|,#\\s])/g,\r\n to = '\\\\';\r\n return function(string) {\r\n return string.replace(from, to)\r\n }\r\n }())\r\n\r\n var regexp = new RegExp(\r\n \"^(?:\\\\s*(,)\\\\s*|\\\\s*(+)\\\\s*|(\\\\s+)|(+|\\\\*)|\\\\#(+)|\\\\.(+)|\\\\[\\\\s*(+)(?:\\\\s*([*^$!~|]?=)(?:\\\\s*(?:([\\\"']?)(.*?)\\\\9)))?\\\\s*\\\\](?!\\\\])|(:+)(+)(?:\\\\((?:(?:([\\\"'])([^\\\\13]*)\\\\13)|((?:\\\\([^)]+\\\\)|[^()]*)+))\\\\))?)\"\r\n .replace(//, '[' + escapeRegExp(\">+~`!@$%^&={}\\\\;/g, '(?:[\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n .replace(//g, '(?:[:\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\r\n );\r\n\r\n function parser(\r\n rawMatch,\r\n\r\n separator,\r\n combinator,\r\n combinatorChildren,\r\n\r\n tagName,\r\n id,\r\n className,\r\n\r\n attributeKey,\r\n attributeOperator,\r\n attributeQuote,\r\n attributeValue,\r\n\r\n pseudoMarker,\r\n pseudoClass,\r\n pseudoQuote,\r\n pseudoClassQuotedValue,\r\n pseudoClassValue\r\n ) {\r\n if (separator || separatorIndex === -1) {\r\n parsed.expressions[++separatorIndex] = [];\r\n combinatorIndex = -1;\r\n if (separator) return '';\r\n }\r\n\r\n if (combinator || combinatorChildren || combinatorIndex === -1) {\r\n combinator = combinator || ' ';\r\n var currentSeparator = parsed.expressions[separatorIndex];\r\n if (reversed && currentSeparator[combinatorIndex])\r\n currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator);\r\n currentSeparator[++combinatorIndex] = {\r\n combinator: combinator,\r\n tag: '*'\r\n };\r\n }\r\n\r\n var currentParsed = parsed.expressions[separatorIndex][combinatorIndex];\r\n\r\n if (tagName) {\r\n currentParsed.tag = tagName.replace(reUnescape, '');\r\n\r\n } else if (id) {\r\n currentParsed.id = id.replace(reUnescape, '');\r\n\r\n } else if (className) {\r\n className = className.replace(reUnescape, '');\r\n\r\n if (!currentParsed.classList) currentParsed.classList = [];\r\n if (!currentParsed.classes) currentParsed.classes = [];\r\n currentParsed.classList.push(className);\r\n currentParsed.classes.push({\r\n value: className,\r\n regexp: new RegExp('(^|\\\\s)' + escapeRegExp(className) + '(\\\\s|$)')\r\n });\r\n\r\n } else if (pseudoClass) {\r\n pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue;\r\n pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null;\r\n\r\n if (!currentParsed.pseudos) currentParsed.pseudos = [];\r\n currentParsed.pseudos.push({\r\n key: pseudoClass.replace(reUnescape, ''),\r\n value: pseudoClassValue,\r\n type: pseudoMarker.length == 1 ? 'class' : 'element'\r\n });\r\n\r\n } else if (attributeKey) {\r\n attributeKey = attributeKey.replace(reUnescape, '');\r\n attributeValue = (attributeValue || '').replace(reUnescape, '');\r\n\r\n var test, regexp;\r\n\r\n switch (attributeOperator) {\r\n case '^=':\r\n regexp = new RegExp('^' + escapeRegExp(attributeValue));\r\n break;\r\n case '$=':\r\n regexp = new RegExp(escapeRegExp(attributeValue) + '$');\r\n break;\r\n case '~=':\r\n regexp = new RegExp('(^|\\\\s)' + escapeRegExp(attributeValue) + '(\\\\s|$)');\r\n break;\r\n case '|=':\r\n regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');\r\n break;\r\n case '=':\r\n test = function(value) {\r\n return attributeValue == value;\r\n };\r\n break;\r\n case '*=':\r\n test = function(value) {\r\n return value && value.indexOf(attributeValue) > -1;\r\n };\r\n break;\r\n case '!=':\r\n test = function(value) {\r\n return attributeValue != value;\r\n };\r\n break;\r\n default:\r\n test = function(value) {\r\n return !!value;\r\n };\r\n }\r\n\r\n if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function() {\r\n return false;\r\n };\r\n\r\n if (!test) test = function(value) {\r\n return value && regexp.test(value);\r\n };\r\n\r\n if (!currentParsed.attributes) currentParsed.attributes = [];\r\n currentParsed.attributes.push({\r\n key: attributeKey,\r\n operator: attributeOperator,\r\n value: attributeValue,\r\n test: test\r\n });\r\n\r\n }\r\n\r\n return '';\r\n };\r\n\r\n // Slick NS\r\n\r\n var Slick = (this.Slick || {});\r\n\r\n Slick.parse = function(expression) {\r\n return parse(expression);\r\n };\r\n\r\n Slick.escapeRegExp = escapeRegExp;\r\n\r\n if (!this.Slick) this.Slick = Slick;\r\n\r\n }).apply(local);\r\n\r\n\r\n var simpleClassSelectorRE = /^\\.([\\w-]*)$/,\r\n simpleIdSelectorRE = /^#([\\w-]*)$/,\r\n slice = Array.prototype.slice;\r\n\r\n\r\n local.parseSelector = local.Slick.parse;\r\n\r\n\r\n local.pseudos = {\r\n // custom pseudos\r\n 'checkbox': function(elm){\r\n return elm.type === \"checkbox\";\r\n },\r\n 'checked': function(elm) {\r\n return !!elm.checked;\r\n },\r\n\r\n 'contains': function(elm, idx, nodes, text) {\r\n if ($(this).text().indexOf(text) > -1) return this\r\n },\r\n\r\n 'disabled': function(elm) {\r\n return !!elm.disabled;\r\n },\r\n\r\n 'enabled': function(elm) {\r\n return !elm.disabled;\r\n },\r\n\r\n 'eq': function(elm, idx, nodes, value) {\r\n return (idx == value);\r\n },\r\n\r\n 'focus': function(elm) {\r\n return document.activeElement === elm && (elm.href || elm.type || elm.tabindex);\r\n },\r\n\r\n 'first': function(elm, idx) {\r\n return (idx === 0);\r\n },\r\n\r\n 'gt': function(elm, idx, nodes, value) {\r\n return (idx > value);\r\n },\r\n\r\n 'has': function(elm, idx, nodes, sel) {\r\n return matches(elm, sel);\r\n },\r\n\r\n\r\n 'hidden': function(elm) {\r\n return !local.pseudos[\"visible\"](elm);\r\n },\r\n\r\n 'last': function(elm, idx, nodes) {\r\n return (idx === nodes.length - 1);\r\n },\r\n\r\n 'lt': function(elm, idx, nodes, value) {\r\n return (idx < value);\r\n },\r\n\r\n 'not': function(elm, idx, nodes, sel) {\r\n return !matches(elm, sel);\r\n },\r\n\r\n 'parent': function(elm) {\r\n return !!elm.parentNode;\r\n },\r\n\r\n 'radio': function(elm){\r\n return elm.type === \"radio\";\r\n },\r\n\r\n 'selected': function(elm) {\r\n return !!elm.selected;\r\n },\r\n\r\n 'text': function(elm){\r\n return elm.type === \"text\";\r\n },\r\n\r\n 'visible': function(elm) {\r\n return elm.offsetWidth && elm.offsetWidth\r\n }\r\n };\r\n\r\n [\"first\",\"eq\",\"last\"].forEach(function(item){\r\n local.pseudos[item].isArrayFilter = true;\r\n });\r\n\r\n local.divide = function(cond) {\r\n var nativeSelector = \"\",\r\n customPseudos = [],\r\n tag,\r\n id,\r\n classes,\r\n attributes,\r\n pseudos;\r\n\r\n\r\n if (id = cond.id) {\r\n nativeSelector += (\"#\" + id);\r\n }\r\n if (classes = cond.classes) {\r\n for (var i = classes.length; i--;) {\r\n nativeSelector += (\".\" + classes[i].value);\r\n }\r\n }\r\n if (attributes = cond.attributes) {\r\n for (var i = 0; i < attributes.length; i++) {\r\n if (attributes[i].operator) {\r\n nativeSelector += (\"[\" + attributes[i].key + attributes[i].operator + JSON.stringify(attributes[i].value) +\"]\");\r\n } else {\r\n nativeSelector += (\"[\" + attributes[i].key + \"]\");\r\n }\r\n }\r\n }\r\n if (pseudos = cond.pseudos) {\r\n for (i = pseudos.length; i--;) {\r\n part = pseudos[i];\r\n if (this.pseudos[part.key]) {\r\n customPseudos.push(part);\r\n } else {\r\n if (part.value !== undefined) {\r\n nativeSelector += (\":\" + part.key + \"(\" + JSON.stringify(part))\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (tag = cond.tag) {\r\n nativeSelector = tag.toUpperCase() + nativeSelector;\r\n }\r\n\r\n if (!nativeSelector) {\r\n nativeSelector = \"*\";\r\n }\r\n\r\n return {\r\n nativeSelector: nativeSelector,\r\n customPseudos: customPseudos\r\n }\r\n\r\n };\r\n\r\n local.check = function(node, cond, idx, nodes,arrayFilte) {\r\n var tag,\r\n id,\r\n classes,\r\n attributes,\r\n pseudos,\r\n\r\n i, part, cls, pseudo;\r\n\r\n if (!arrayFilte) {\r\n if (tag = cond.tag) {\r\n var nodeName = node.nodeName.toUpperCase();\r\n if (tag == '*') {\r\n if (nodeName < '@') return false; // Fix for comment nodes and closed nodes\r\n } else {\r\n if (nodeName != (tag || \"\").toUpperCase()) return false;\r\n }\r\n }\r\n\r\n if (id = cond.id) {\r\n if (node.getAttribute('id') != id) {\r\n return false;\r\n }\r\n }\r\n\r\n\r\n if (classes = cond.classes) {\r\n for (i = classes.length; i--;) {\r\n cls = node.getAttribute('class');\r\n if (!(cls && classes[i].regexp.test(cls))) return false;\r\n }\r\n }\r\n\r\n if (attributes) {\r\n for (i = attributes.length; i--;) {\r\n part = attributes[i];\r\n if (part.operator ? !part.test(node.getAttribute(part.key)) : !node.hasAttribute(part.key)) return false;\r\n }\r\n\r\n }\r\n\r\n }\r\n if (pseudos = cond.pseudos) {\r\n for (i = pseudos.length; i--;) {\r\n part = pseudos[i];\r\n if (pseudo = this.pseudos[part.key]) {\r\n if ((arrayFilte && pseudo.isArrayFilter) || (!arrayFilte && !pseudo.isArrayFilter)) {\r\n if (!pseudo(node, idx, nodes, part.value)) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n if (!arrayFilte && !nativeMatchesSelector.call(node, part.key)) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n local.match = function(node, selector) {\r\n\r\n var parsed ;\r\n\r\n if (langx.isString(selector)) {\r\n parsed = local.Slick.parse(selector);\r\n } else {\r\n parsed = selector; \r\n }\r\n \r\n if (!parsed) {\r\n return true;\r\n }\r\n\r\n // simple (single) selectors\r\n var expressions = parsed.expressions,\r\n simpleExpCounter = 0,\r\n i,\r\n currentExpression;\r\n for (i = 0;\r\n (currentExpression = expressions[i]); i++) {\r\n if (currentExpression.length == 1) {\r\n var exp = currentExpression[0];\r\n if (this.check(node,exp)) {\r\n return true;\r\n }\r\n simpleExpCounter++;\r\n }\r\n }\r\n\r\n if (simpleExpCounter == parsed.length) {\r\n return false;\r\n }\r\n\r\n var nodes = this.query(document, parsed),\r\n item;\r\n for (i = 0; item = nodes[i++];) {\r\n if (item === node) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n\r\n local.filterSingle = function(nodes, exp){\r\n var matchs = filter.call(nodes, function(node, idx) {\r\n return local.check(node, exp, idx, nodes,false);\r\n }); \r\n\r\n matchs = filter.call(matchs, function(node, idx) {\r\n return local.check(node, exp, idx, matchs,true);\r\n }); \r\n return matchs;\r\n };\r\n\r\n local.filter = function(nodes, selector) {\r\n var parsed;\r\n\r\n if (langx.isString(selector)) {\r\n parsed = local.Slick.parse(selector);\r\n } else {\r\n return local.filterSingle(nodes,selector); \r\n }\r\n\r\n // simple (single) selectors\r\n var expressions = parsed.expressions,\r\n i,\r\n currentExpression,\r\n ret = [];\r\n for (i = 0;\r\n (currentExpression = expressions[i]); i++) {\r\n if (currentExpression.length == 1) {\r\n var exp = currentExpression[0];\r\n\r\n var matchs = local.filterSingle(nodes,exp); \r\n\r\n ret = langx.uniq(ret.concat(matchs));\r\n } else {\r\n throw new Error(\"not supported selector:\" + selector);\r\n }\r\n }\r\n\r\n return ret;\r\n \r\n }; \r\n\r\n local.combine = function(elm, bit) {\r\n var op = bit.combinator,\r\n cond = bit,\r\n node1,\r\n nodes = [];\r\n\r\n switch (op) {\r\n case '>': // direct children\r\n nodes = children(elm, cond);\r\n break;\r\n case '+': // next sibling\r\n node1 = nextSibling(elm, cond, true);\r\n if (node1) {\r\n nodes.push(node1);\r\n }\r\n break;\r\n case '^': // first child\r\n node1 = firstChild(elm, cond, true);\r\n if (node1) {\r\n nodes.push(node1);\r\n }\r\n break;\r\n case '~': // next siblings\r\n nodes = nextSiblings(elm, cond);\r\n break;\r\n case '++': // next sibling and previous sibling\r\n var prev = previousSibling(elm, cond, true),\r\n next = nextSibling(elm, cond, true);\r\n if (prev) {\r\n nodes.push(prev);\r\n }\r\n if (next) {\r\n nodes.push(next);\r\n }\r\n break;\r\n case '~~': // next siblings and previous siblings\r\n nodes = siblings(elm, cond);\r\n break;\r\n case '!': // all parent nodes up to document\r\n nodes = ancestors(elm, cond);\r\n break;\r\n case '!>': // direct parent (one level)\r\n node1 = parent(elm, cond);\r\n if (node1) {\r\n nodes.push(node1);\r\n }\r\n break;\r\n case '!+': // previous sibling\r\n nodes = previousSibling(elm, cond, true);\r\n break;\r\n case '!^': // last child\r\n node1 = lastChild(elm, cond, true);\r\n if (node1) {\r\n nodes.push(node1);\r\n }\r\n break;\r\n case '!~': // previous siblings\r\n nodes = previousSiblings(elm, cond);\r\n break;\r\n default:\r\n var divided = this.divide(bit);\r\n nodes = slice.call(elm.querySelectorAll(divided.nativeSelector));\r\n if (divided.customPseudos) {\r\n for (var i = divided.customPseudos.length - 1; i >= 0; i--) {\r\n nodes = filter.call(nodes, function(item, idx) {\r\n return local.check(item, {\r\n pseudos: [divided.customPseudos[i]]\r\n }, idx, nodes,false)\r\n });\r\n\r\n nodes = filter.call(nodes, function(item, idx) {\r\n return local.check(item, {\r\n pseudos: [divided.customPseudos[i]]\r\n }, idx, nodes,true)\r\n }); \r\n }\r\n }\r\n break;\r\n\r\n }\r\n return nodes;\r\n }\r\n\r\n local.query = function(node, selector, single) {\r\n\r\n\r\n var parsed = this.Slick.parse(selector);\r\n\r\n var\r\n founds = [],\r\n currentExpression, currentBit,\r\n expressions = parsed.expressions;\r\n\r\n for (var i = 0;\r\n (currentExpression = expressions[i]); i++) {\r\n var currentItems = [node],\r\n found;\r\n for (var j = 0;\r\n (currentBit = currentExpression[j]); j++) {\r\n found = langx.map(currentItems, function(item, i) {\r\n return local.combine(item, currentBit)\r\n });\r\n if (found) {\r\n currentItems = found;\r\n }\r\n }\r\n if (found) {\r\n founds = founds.concat(found);\r\n }\r\n }\r\n\r\n return founds;\r\n }\r\n\r\n\r\n function ancestor(node, selector, root) {\r\n var rootIsSelector = root && langx.isString(root);\r\n while (node = node.parentNode) {\r\n if (matches(node, selector)) {\r\n return node;\r\n }\r\n if (root) {\r\n if (rootIsSelector) {\r\n if (matches(node,root)) {\r\n break;\r\n }\r\n } else if (node == root) {\r\n break;\r\n }\r\n } \r\n }\r\n return null;\r\n }\r\n\r\n function ancestors(node, selector,root) {\r\n var ret = [],\r\n rootIsSelector = root && langx.isString(root);\r\n while (node = node.parentNode) {\r\n ret.push(node);\r\n if (root) {\r\n if (rootIsSelector) {\r\n if (matches(node,root)) {\r\n break;\r\n }\r\n } else if (node == root) {\r\n break;\r\n }\r\n } \r\n\r\n }\r\n\r\n if (selector) {\r\n ret = local.filter(ret,selector);\r\n }\r\n return ret;\r\n }\r\n\r\n function byId(id, doc) {\r\n doc = doc || noder.doc();\r\n return doc.getElementById(id);\r\n }\r\n\r\n function children(node, selector) {\r\n var childNodes = node.childNodes,\r\n ret = [];\r\n for (var i = 0; i < childNodes.length; i++) {\r\n var node = childNodes[i];\r\n if (node.nodeType == 1) {\r\n ret.push(node);\r\n }\r\n }\r\n if (selector) {\r\n ret = local.filter(ret,selector);\r\n }\r\n return ret;\r\n }\r\n\r\n function closest(node, selector) {\r\n while (node && !(matches(node, selector))) {\r\n node = node.parentNode;\r\n }\r\n\r\n return node;\r\n }\r\n\r\n function descendants(elm, selector) {\r\n // Selector\r\n try {\r\n return slice.call(elm.querySelectorAll(selector));\r\n } catch (matchError) {\r\n //console.log(matchError);\r\n }\r\n return local.query(elm, selector);\r\n }\r\n\r\n function descendant(elm, selector) {\r\n // Selector\r\n try {\r\n return elm.querySelector(selector);\r\n } catch (matchError) {\r\n //console.log(matchError);\r\n }\r\n var nodes = local.query(elm, selector);\r\n if (nodes.length > 0) {\r\n return nodes[0];\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function find(elm,selector) {\r\n if (!selector) {\r\n selector = elm;\r\n elm = document.body;\r\n }\r\n if (matches(elm,selector)) {\r\n return elm;\r\n } else {\r\n return descendant(elm, selector);\r\n }\r\n }\r\n\r\n function findAll(elm,selector) {\r\n if (!selector) {\r\n selector = elm;\r\n elm = document.body;\r\n }\r\n return descendants(elm, selector);\r\n }\r\n\r\n function firstChild(elm, selector, first) {\r\n var childNodes = elm.childNodes,\r\n node = childNodes[0];\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n return node;\r\n }\r\n if (first) {\r\n break;\r\n }\r\n }\r\n node = node.nextSibling;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function lastChild(elm, selector, last) {\r\n var childNodes = elm.childNodes,\r\n node = childNodes[childNodes.length - 1];\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n return node;\r\n }\r\n if (last) {\r\n break;\r\n }\r\n }\r\n node = node.previousSibling;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function matches(elm, selector) {\r\n if (!selector || !elm || elm.nodeType !== 1) {\r\n return false\r\n }\r\n\r\n if (langx.isString(selector)) {\r\n try {\r\n return nativeMatchesSelector.call(elm, selector.replace(/\\[([^=]+)=\\s*([^'\"\\]]+?)\\s*\\]/g, '[$1=\"$2\"]'));\r\n } catch (matchError) {\r\n //console.log(matchError);\r\n }\r\n return local.match(elm, selector);\r\n } else if (langx.isArrayLike(selector)) {\r\n return langx.inArray(elm,selector) > -1;\r\n } else if (langx.isPlainObject(selector)){ \r\n return local.check(elm, selector);\r\n } else {\r\n return elm === selector;\r\n }\r\n\r\n }\r\n\r\n function nextSibling(elm, selector, adjacent) {\r\n var node = elm.nextSibling;\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n return node;\r\n }\r\n if (adjacent) {\r\n break;\r\n }\r\n }\r\n node = node.nextSibling;\r\n }\r\n return null;\r\n }\r\n\r\n function nextSiblings(elm, selector) {\r\n var node = elm.nextSibling,\r\n ret = [];\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n ret.push(node);\r\n }\r\n }\r\n node = node.nextSibling;\r\n }\r\n return ret;\r\n }\r\n\r\n\r\n function parent(elm, selector) {\r\n var node = elm.parentNode;\r\n if (node && (!selector || matches(node, selector))) {\r\n return node;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n function previousSibling(elm, selector, adjacent) {\r\n var node = elm.previousSibling;\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n return node;\r\n }\r\n if (adjacent) {\r\n break;\r\n }\r\n }\r\n node = node.previousSibling;\r\n }\r\n return null;\r\n }\r\n\r\n function previousSiblings(elm, selector) {\r\n var node = elm.previousSibling,\r\n ret = [];\r\n while (node) {\r\n if (node.nodeType == 1) {\r\n if (!selector || matches(node, selector)) {\r\n ret.push(node);\r\n }\r\n }\r\n node = node.previousSibling;\r\n }\r\n return ret;\r\n }\r\n\r\n function siblings(elm, selector) {\r\n var node = elm.parentNode.firstChild,\r\n ret = [];\r\n while (node) {\r\n if (node.nodeType == 1 && node !== elm) {\r\n if (!selector || matches(node, selector)) {\r\n ret.push(node);\r\n }\r\n }\r\n node = node.nextSibling;\r\n }\r\n return ret;\r\n }\r\n\r\n var finder = function() {\r\n return finder;\r\n };\r\n\r\n langx.mixin(finder, {\r\n\r\n ancestor: ancestor,\r\n\r\n ancestors: ancestors,\r\n\r\n byId: byId,\r\n\r\n children: children,\r\n\r\n closest: closest,\r\n\r\n descendant: descendant,\r\n\r\n descendants: descendants,\r\n\r\n find: find,\r\n\r\n findAll: findAll,\r\n\r\n firstChild: firstChild,\r\n\r\n lastChild: lastChild,\r\n\r\n matches: matches,\r\n\r\n nextSibling: nextSibling,\r\n\r\n nextSiblings: nextSiblings,\r\n\r\n parent: parent,\r\n\r\n previousSibling: previousSibling,\r\n\r\n previousSiblings: previousSiblings,\r\n\r\n pseudos: local.pseudos,\r\n\r\n siblings: siblings\r\n });\r\n\r\n return skylark.finder = finder;\r\n});\r\n\ndefine('skylark-utils/datax',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./finder\"\r\n], function(skylark, langx, finder) {\r\n var map = Array.prototype.map,\r\n filter = Array.prototype.filter,\r\n camelCase = langx.camelCase,\r\n deserializeValue = langx.deserializeValue,\r\n\r\n capitalRE = /([A-Z])/g,\r\n propMap = {\r\n 'tabindex': 'tabIndex',\r\n 'readonly': 'readOnly',\r\n 'for': 'htmlFor',\r\n 'class': 'className',\r\n 'maxlength': 'maxLength',\r\n 'cellspacing': 'cellSpacing',\r\n 'cellpadding': 'cellPadding',\r\n 'rowspan': 'rowSpan',\r\n 'colspan': 'colSpan',\r\n 'usemap': 'useMap',\r\n 'frameborder': 'frameBorder',\r\n 'contenteditable': 'contentEditable'\r\n };\r\n\r\n function setAttribute(elm, name, value) {\r\n if (value == null) {\r\n elm.removeAttribute(name);\r\n } else {\r\n elm.setAttribute(name, value);\r\n }\r\n }\r\n\r\n function attr(elm, name, value) {\r\n if (value === undefined) {\r\n if (typeof name === \"object\") {\r\n for (var attrName in name) {\r\n attr(elm, attrName, name[attrName]);\r\n }\r\n return this;\r\n } else {\r\n if (elm.hasAttribute(name)) {\r\n return elm.getAttribute(name);\r\n }\r\n }\r\n } else {\r\n elm.setAttribute(name, value);\r\n return this;\r\n }\r\n }\r\n\r\n // Read all \"data-*\" attributes from a node\r\n function _attributeData(elm) {\r\n var store = {}\r\n langx.each(elm.attributes || [], function(i, attr) {\r\n if (attr.name.indexOf('data-') == 0) {\r\n store[camelCase(attr.name.replace('data-', ''))] = deserializeValue(attr.value);\r\n }\r\n })\r\n return store;\r\n }\r\n\r\n function _store(elm, confirm) {\r\n var store = elm[\"_$_store\"];\r\n if (!store && confirm) {\r\n store = elm[\"_$_store\"] = _attributeData(elm);\r\n }\r\n return store;\r\n }\r\n\r\n function _getData(elm, name) {\r\n if (name === undefined) {\r\n return _store(elm, true);\r\n } else {\r\n var store = _store(elm);\r\n if (store) {\r\n if (name in store) {\r\n return store[name];\r\n }\r\n var camelName = camelCase(name);\r\n if (camelName in store) {\r\n return store[camelName];\r\n }\r\n }\r\n var attrName = 'data-' + name.replace(capitalRE, \"-$1\").toLowerCase()\r\n return attr(elm, attrName);\r\n }\r\n\r\n }\r\n\r\n function _setData(elm, name, value) {\r\n var store = _store(elm, true);\r\n store[camelCase(name)] = value;\r\n }\r\n\r\n\r\n function data(elm, name, value) {\r\n\r\n if (value === undefined) {\r\n if (typeof name === \"object\") {\r\n for (var dataAttrName in name) {\r\n _setData(elm, dataAttrName, name[dataAttrName]);\r\n }\r\n return this;\r\n } else {\r\n return _getData(elm, name);\r\n }\r\n } else {\r\n _setData(elm, name, value);\r\n return this;\r\n }\r\n }\r\n\r\n function removeData(elm, names) {\r\n if (langx.isString(names)) {\r\n names = names.split(/\\s+/);\r\n }\r\n var store = _store(elm, true);\r\n names.forEach(function(name) {\r\n delete store[name];\r\n });\r\n return this;\r\n }\r\n\r\n function pluck(nodes, property) {\r\n return map.call(nodes, function(elm) {\r\n return elm[property];\r\n });\r\n }\r\n\r\n function prop(elm, name, value) {\r\n name = propMap[name] || name;\r\n if (value === undefined) {\r\n return elm[name];\r\n } else {\r\n elm[name] = value;\r\n return this;\r\n }\r\n }\r\n\r\n function removeAttr(elm, name) {\r\n name.split(' ').forEach(function(attr) {\r\n setAttribute(elm, attr);\r\n });\r\n return this;\r\n }\r\n\r\n function removeProp(elm, name) {\r\n name.split(' ').forEach(function(prop) {\r\n delete elm[prop];\r\n });\r\n return this;\r\n }\r\n\r\n function text(elm, txt) {\r\n if (txt === undefined) {\r\n return elm.textContent;\r\n } else {\r\n elm.textContent = txt == null ? '' : '' + txt;\r\n return this;\r\n }\r\n }\r\n\r\n function val(elm, value) {\r\n if (value === undefined) {\r\n if (elm.multiple) {\r\n // select multiple values\r\n var selectedOptions = filter.call(finder.find(elm, \"option\"), (function(option) {\r\n return option.selected;\r\n }));\r\n return pluck(selectedOptions, \"value\");\r\n } else {\r\n return elm.value;\r\n }\r\n } else {\r\n elm.value = value;\r\n return this;\r\n }\r\n }\r\n\r\n function datax() {\r\n return datax;\r\n }\r\n\r\n langx.mixin(datax, {\r\n attr: attr,\r\n\r\n data: data,\r\n\r\n pluck: pluck,\r\n\r\n prop: prop,\r\n\r\n removeAttr: removeAttr,\r\n\r\n removeData: removeData,\r\n\r\n removeProp: removeProp,\r\n\r\n text: text,\r\n\r\n val: val\r\n });\r\n\r\n return skylark.datax = datax;\r\n});\r\n\ndefine('skylarkjs/datax',[\r\n \"skylark-utils/datax\"\r\n], function(datax) {\r\n return datax;\r\n});\r\n\ndefine('skylark-utils/geom',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./styler\"\r\n], function(skylark, langx, styler) {\r\n var rootNodeRE = /^(?:body|html)$/i,\r\n px = langx.toPixel;\r\n\r\n function offsetParent(elm) {\r\n var parent = elm.offsetParent || document.body;\r\n while (parent && !rootNodeRE.test(parent.nodeName) && styler.css(parent, \"position\") == \"static\") {\r\n parent = parent.offsetParent;\r\n }\r\n return parent;\r\n }\r\n\r\n\r\n function borderExtents(elm) {\r\n var s = getComputedStyle(elm);\r\n return {\r\n left: px(s.borderLeftWidth , elm),\r\n top: px(s.borderTopWidth, elm),\r\n right: px(s.borderRightWidth, elm),\r\n bottom: px(s.borderBottomWidth, elm)\r\n }\r\n }\r\n\r\n //viewport coordinate\r\n function boundingPosition(elm, coords) {\r\n if (coords === undefined) {\r\n return rootNodeRE.test(elm.nodeName) ? { top: 0, left: 0 } : elm.getBoundingClientRect();\r\n } else {\r\n var // Get *real* offsetParent\r\n parent = offsetParent(elm),\r\n // Get correct offsets\r\n parentOffset = boundingPosition(parent),\r\n mex = marginExtents(elm),\r\n pbex = borderExtents(parent);\r\n\r\n relativePosition(elm, {\r\n top: coords.top - parentOffset.top - mex.top - pbex.top,\r\n left: coords.left - parentOffset.left - mex.left - pbex.left\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n function boundingRect(elm, coords) {\r\n if (coords === undefined) {\r\n return elm.getBoundingClientRect()\r\n } else {\r\n boundingPosition(elm, coords);\r\n size(elm, coords);\r\n return this;\r\n }\r\n }\r\n\r\n function clientHeight(elm, value) {\r\n if (value == undefined) {\r\n return clientSize(elm).height;\r\n } else {\r\n return clientSize(elm, {\r\n height: value\r\n });\r\n }\r\n }\r\n\r\n function clientSize(elm, dimension) {\r\n if (dimension == undefined) {\r\n return {\r\n width: elm.clientWidth,\r\n height: elm.clientHeight\r\n }\r\n } else {\r\n var isBorderBox = (styler.css(elm, \"box-sizing\") === \"border-box\"),\r\n props = {\r\n width: dimension.width,\r\n height: dimension.height\r\n };\r\n if (!isBorderBox) {\r\n var pex = paddingExtents(elm);\r\n\r\n if (props.width !== undefined) {\r\n props.width = props.width - pex.left - pex.right;\r\n }\r\n\r\n if (props.height !== undefined) {\r\n props.height = props.height - pex.top - pex.bottom;\r\n }\r\n } else {\r\n var bex = borderExtents(elm);\r\n\r\n if (props.width !== undefined) {\r\n props.width = props.width + bex.left + bex.right;\r\n }\r\n\r\n if (props.height !== undefined) {\r\n props.height = props.height + bex.top + bex.bottom;\r\n }\r\n\r\n }\r\n styler.css(elm, props);\r\n return this;\r\n }\r\n return {\r\n width: elm.clientWidth,\r\n height: elm.clientHeight\r\n };\r\n }\r\n\r\n function clientWidth(elm, value) {\r\n if (value == undefined) {\r\n return clientSize(elm).width;\r\n } else {\r\n clientSize(elm, {\r\n width: value\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n function contentRect(elm) {\r\n var cs = clientSize(elm),\r\n pex = paddingExtents(elm);\r\n\r\n\r\n //// On Opera, offsetLeft includes the parent's border\r\n //if(has(\"opera\")){\r\n // pe.l += be.l;\r\n // pe.t += be.t;\r\n //}\r\n return {\r\n left: pex.left,\r\n top: pex.top,\r\n width: cs.width - pex.left - pex.right,\r\n height: cs.height - pex.top - pex.bottom\r\n };\r\n }\r\n\r\n function getDocumentSize(doc) {\r\n var documentElement = doc.documentElement,\r\n body = doc.body,\r\n max = Math.max,\r\n scrollWidth = max(documentElement.scrollWidth, body.scrollWidth),\r\n clientWidth = max(documentElement.clientWidth, body.clientWidth),\r\n offsetWidth = max(documentElement.offsetWidth, body.offsetWidth),\r\n scrollHeight = max(documentElement.scrollHeight, body.scrollHeight),\r\n clientHeight = max(documentElement.clientHeight, body.clientHeight),\r\n offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);\r\n\r\n return {\r\n width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,\r\n height: scrollHeight < offsetHeight ? clientHeight : scrollHeight\r\n };\r\n }\r\n\r\n function height(elm, value) {\r\n if (value == undefined) {\r\n return size(elm).height;\r\n } else {\r\n size(elm, {\r\n height: value\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n function marginExtents(elm) {\r\n var s = getComputedStyle(elm);\r\n return {\r\n left: px(s.marginLeft),\r\n top: px(s.marginTop),\r\n right: px(s.marginRight),\r\n bottom: px(s.marginBottom),\r\n }\r\n }\r\n\r\n\r\n function paddingExtents(elm) {\r\n var s = getComputedStyle(elm);\r\n return {\r\n left: px(s.paddingLeft),\r\n top: px(s.paddingTop),\r\n right: px(s.paddingRight),\r\n bottom: px(s.paddingBottom),\r\n }\r\n }\r\n\r\n //coordinate to the document\r\n function pagePosition(elm, coords) {\r\n if (coords === undefined) {\r\n var obj = elm.getBoundingClientRect()\r\n return {\r\n left: obj.left + window.pageXOffset,\r\n top: obj.top + window.pageYOffset\r\n }\r\n } else {\r\n var // Get *real* offsetParent\r\n parent = offsetParent(elm),\r\n // Get correct offsets\r\n parentOffset = pagePosition(parent),\r\n mex = marginExtents(elm),\r\n pbex = borderExtents(parent);\r\n\r\n relativePosition(elm, {\r\n top: coords.top - parentOffset.top - mex.top - pbex.top,\r\n left: coords.left - parentOffset.left - mex.left - pbex.left\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n function pageRect(elm, coords) {\r\n if (coords === undefined) {\r\n var obj = elm.getBoundingClientRect()\r\n return {\r\n left: obj.left + window.pageXOffset,\r\n top: obj.top + window.pageYOffset,\r\n width: Math.round(obj.width),\r\n height: Math.round(obj.height)\r\n }\r\n } else {\r\n pagePosition(elm, coords);\r\n size(elm, coords);\r\n return this;\r\n }\r\n }\r\n\r\n // coordinate relative to it's parent\r\n function relativePosition(elm, coords) {\r\n if (coords == undefined) {\r\n var // Get *real* offsetParent\r\n parent = offsetParent(elm),\r\n // Get correct offsets\r\n offset = boundingPosition(elm),\r\n parentOffset = boundingPosition(parent),\r\n mex = marginExtents(elm),\r\n pbex = borderExtents(parent);\r\n\r\n // Subtract parent offsets and element margins\r\n return {\r\n top: offset.top - parentOffset.top - pbex.top - mex.top,\r\n left: offset.left - parentOffset.left - pbex.left - mex.left\r\n }\r\n } else {\r\n var props = {\r\n top: coords.top,\r\n left: coords.left\r\n }\r\n\r\n if (styler.css(elm, \"position\") == \"static\") {\r\n props['position'] = \"relative\";\r\n }\r\n styler.css(elm, props);\r\n return this;\r\n }\r\n }\r\n\r\n function relativeRect(elm, coords) {\r\n if (coords === undefined) {\r\n var // Get *real* offsetParent\r\n parent = offsetParent(elm),\r\n // Get correct offsets\r\n offset = boundingRect(elm),\r\n parentOffset = boundingPosition(parent),\r\n mex = marginExtents(elm),\r\n pbex = borderExtents(parent);\r\n\r\n // Subtract parent offsets and element margins\r\n return {\r\n top: offset.top - parentOffset.top - pbex.top - mex.top,\r\n left: offset.left - parentOffset.left - pbex.left - mex.left,\r\n width: offset.width,\r\n height: offset.height\r\n }\r\n } else {\r\n relativePosition(elm, coords);\r\n size(elm, coords);\r\n return this;\r\n }\r\n }\r\n\r\n function scrollIntoView(elm, align) {\r\n function getOffset(elm, rootElm) {\r\n var x, y, parent = elm;\r\n\r\n x = y = 0;\r\n while (parent && parent != rootElm && parent.nodeType) {\r\n x += parent.offsetLeft || 0;\r\n y += parent.offsetTop || 0;\r\n parent = parent.offsetParent;\r\n }\r\n\r\n return { x: x, y: y };\r\n }\r\n\r\n var parentElm = elm.parentNode;\r\n var x, y, width, height, parentWidth, parentHeight;\r\n var pos = getOffset(elm, parentElm);\r\n\r\n x = pos.x;\r\n y = pos.y;\r\n width = elm.offsetWidth;\r\n height = elm.offsetHeight;\r\n parentWidth = parentElm.clientWidth;\r\n parentHeight = parentElm.clientHeight;\r\n\r\n if (align == \"end\") {\r\n x -= parentWidth - width;\r\n y -= parentHeight - height;\r\n } else if (align == \"center\") {\r\n x -= (parentWidth / 2) - (width / 2);\r\n y -= (parentHeight / 2) - (height / 2);\r\n }\r\n\r\n parentElm.scrollLeft = x;\r\n parentElm.scrollTop = y;\r\n\r\n return this;\r\n }\r\n\r\n function scrollLeft(elm, value) {\r\n var hasScrollLeft = \"scrollLeft\" in elm;\r\n if (value === undefined) {\r\n return hasScrollLeft ? elm.scrollLeft : elm.pageXOffset\r\n } else {\r\n if (hasScrollLeft) {\r\n elm.scrollLeft = value;\r\n } else {\r\n elm.scrollTo(value, elm.scrollY);\r\n }\r\n return this;\r\n }\r\n }\r\n\r\n function scrollTop(elm, value) {\r\n var hasScrollTop = \"scrollTop\" in elm;\r\n\r\n if (value === undefined) {\r\n return hasScrollTop ? elm.scrollTop : elm.pageYOffset\r\n } else {\r\n if (hasScrollTop) {\r\n elm.scrollTop = value;\r\n } else {\r\n elm.scrollTo(elm.scrollX, value);\r\n }\r\n return this;\r\n }\r\n }\r\n\r\n function size(elm, dimension) {\r\n if (dimension == undefined) {\r\n if (langx.isWindow(elm)) {\r\n return {\r\n width: elm.innerWidth,\r\n height: elm.innerHeight\r\n }\r\n\r\n } else if (langx.isDocument(elm)) {\r\n return getDocumentSize(document);\r\n } else {\r\n return {\r\n width: elm.offsetWidth,\r\n height: elm.offsetHeight\r\n }\r\n }\r\n } else {\r\n var isBorderBox = (styler.css(elm, \"box-sizing\") === \"border-box\"),\r\n props = {\r\n width: dimension.width,\r\n height: dimension.height\r\n };\r\n if (!isBorderBox) {\r\n var pex = paddingExtents(elm),\r\n bex = borderExtents(elm);\r\n\r\n if (props.width !== undefined && props.width !== \"\" && props.width !== null) {\r\n props.width = props.width - pex.left - pex.right - bex.left - bex.right;\r\n }\r\n\r\n if (props.height !== undefined && props.height !== \"\" && props.height !== null) {\r\n props.height = props.height - pex.top - pex.bottom - bex.top - bex.bottom;\r\n }\r\n }\r\n styler.css(elm, props);\r\n return this;\r\n }\r\n }\r\n\r\n function width(elm, value) {\r\n if (value == undefined) {\r\n return size(elm).width;\r\n } else {\r\n size(elm, {\r\n width: value\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n function geom() {\r\n return geom;\r\n }\r\n\r\n langx.mixin(geom, {\r\n borderExtents: borderExtents,\r\n //viewport coordinate\r\n boundingPosition: boundingPosition,\r\n\r\n boundingRect: boundingRect,\r\n\r\n clientHeight: clientHeight,\r\n\r\n clientSize: clientSize,\r\n\r\n clientWidth: clientWidth,\r\n\r\n contentRect: contentRect,\r\n\r\n getDocumentSize: getDocumentSize,\r\n\r\n height: height,\r\n\r\n marginExtents: marginExtents,\r\n\r\n offsetParent: offsetParent,\r\n\r\n paddingExtents: paddingExtents,\r\n\r\n //coordinate to the document\r\n pagePosition: pagePosition,\r\n\r\n pageRect: pageRect,\r\n\r\n // coordinate relative to it's parent\r\n relativePosition: relativePosition,\r\n\r\n relativeRect: relativeRect,\r\n\r\n scrollIntoView: scrollIntoView,\r\n\r\n scrollLeft: scrollLeft,\r\n\r\n scrollTop: scrollTop,\r\n\r\n size: size,\r\n\r\n width: width\r\n });\r\n\r\n return skylark.geom = geom;\r\n});\r\n\ndefine('skylark-utils/eventer',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./browser\",\r\n \"./finder\",\r\n \"./noder\",\r\n \"./datax\"\r\n], function(skylark, langx, browser, finder, noder, datax) {\r\n var mixin = langx.mixin,\r\n each = langx.each,\r\n slice = Array.prototype.slice,\r\n uid = langx.uid,\r\n ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/,\r\n eventMethods = {\r\n preventDefault: \"isDefaultPrevented\",\r\n stopImmediatePropagation: \"isImmediatePropagationStopped\",\r\n stopPropagation: \"isPropagationStopped\"\r\n },\r\n readyRE = /complete|loaded|interactive/;\r\n\r\n function compatible(event, source) {\r\n if (source || !event.isDefaultPrevented) {\r\n if (!source) {\r\n source = event;\r\n }\r\n\r\n langx.each(eventMethods, function(name, predicate) {\r\n var sourceMethod = source[name];\r\n event[name] = function() {\r\n this[predicate] = langx.returnTrue;\r\n return sourceMethod && sourceMethod.apply(source, arguments);\r\n }\r\n event[predicate] = langx.returnFalse;\r\n });\r\n }\r\n return event;\r\n }\r\n\r\n function parse(event) {\r\n var segs = (\"\" + event).split(\".\");\r\n return {\r\n type: segs[0],\r\n ns: segs.slice(1).sort().join(\" \")\r\n };\r\n }\r\n\r\n //create a custom dom event\r\n var createEvent = (function() {\r\n var EventCtors = [\r\n window[\"CustomEvent\"], // 0 default\r\n window[\"CompositionEvent\"], // 1\r\n window[\"DragEvent\"], // 2\r\n window[\"Event\"], // 3\r\n window[\"FocusEvent\"], // 4\r\n window[\"KeyboardEvent\"], // 5\r\n window[\"MessageEvent\"], // 6\r\n window[\"MouseEvent\"], // 7\r\n window[\"MouseScrollEvent\"], // 8\r\n window[\"MouseWheelEvent\"], // 9\r\n window[\"MutationEvent\"], // 10\r\n window[\"ProgressEvent\"], // 11\r\n window[\"TextEvent\"], // 12\r\n window[\"TouchEvent\"], // 13\r\n window[\"UIEvent\"], // 14\r\n window[\"WheelEvent\"] // 15\r\n ],\r\n NativeEvents = {\r\n \"compositionstart\": 1, // CompositionEvent\r\n \"compositionend\": 1, // CompositionEvent\r\n \"compositionupdate\": 1, // CompositionEvent\r\n\r\n \"beforecopy\": 2, // DragEvent\r\n \"beforecut\": 2, // DragEvent\r\n \"beforepaste\": 2, // DragEvent\r\n \"copy\": 2, // DragEvent\r\n \"cut\": 2, // DragEvent\r\n \"paste\": 2, // DragEvent\r\n\r\n \"drag\": 2, // DragEvent\r\n \"dragend\": 2, // DragEvent\r\n \"dragenter\": 2, // DragEvent\r\n \"dragexit\": 2, // DragEvent\r\n \"dragleave\": 2, // DragEvent\r\n \"dragover\": 2, // DragEvent\r\n \"dragstart\": 2, // DragEvent\r\n \"drop\": 2, // DragEvent\r\n\r\n \"abort\": 3, // Event\r\n \"change\": 3, // Event\r\n \"error\": 3, // Event\r\n \"selectionchange\": 3, // Event\r\n \"submit\": 3, // Event\r\n \"reset\": 3, // Event\r\n\r\n \"focus\": 4, // FocusEvent\r\n \"blur\": 4, // FocusEvent\r\n \"focusin\": 4, // FocusEvent\r\n \"focusout\": 4, // FocusEvent\r\n\r\n \"keydown\": 5, // KeyboardEvent\r\n \"keypress\": 5, // KeyboardEvent\r\n \"keyup\": 5, // KeyboardEvent\r\n\r\n \"message\": 6, // MessageEvent\r\n\r\n \"click\": 7, // MouseEvent\r\n \"contextmenu\": 7, // MouseEvent\r\n \"dblclick\": 7, // MouseEvent\r\n \"mousedown\": 7, // MouseEvent\r\n \"mouseup\": 7, // MouseEvent\r\n \"mousemove\": 7, // MouseEvent\r\n \"mouseover\": 7, // MouseEvent\r\n \"mouseout\": 7, // MouseEvent\r\n \"mouseenter\": 7, // MouseEvent\r\n \"mouseleave\": 7, // MouseEvent\r\n\r\n\r\n \"textInput\": 12, // TextEvent\r\n\r\n \"touchstart\": 13, // TouchEvent\r\n \"touchmove\": 13, // TouchEvent\r\n \"touchend\": 13, // TouchEvent\r\n\r\n \"load\": 14, // UIEvent\r\n \"resize\": 14, // UIEvent\r\n \"select\": 14, // UIEvent\r\n \"scroll\": 14, // UIEvent\r\n \"unload\": 14, // UIEvent,\r\n\r\n \"wheel\": 15 // WheelEvent\r\n }\r\n ;\r\n\r\n function getEventCtor(type) {\r\n var idx = NativeEvents[type];\r\n if (!idx) {\r\n idx = 0;\r\n }\r\n return EventCtors[idx];\r\n }\r\n\r\n return function(type, props) {\r\n //create a custom dom event\r\n\r\n if (langx.isString(type)) {\r\n props = props || {};\r\n } else {\r\n props = type || {};\r\n type = props.type || \"\";\r\n }\r\n var parsed = parse(type);\r\n type = parsed.type;\r\n\r\n props = langx.mixin({\r\n bubbles: true,\r\n cancelable: true\r\n }, props);\r\n\r\n if (parsed.ns) {\r\n props.namespace = parsed.ns;\r\n }\r\n\r\n var ctor = getEventCtor(type),\r\n e = new ctor(type, props);\r\n\r\n langx.safeMixin(e, props);\r\n\r\n return compatible(e);\r\n };\r\n })();\r\n\r\n function createProxy(event) {\r\n var key,\r\n proxy = {\r\n originalEvent: event\r\n };\r\n for (key in event) {\r\n if (key !== \"keyIdentifier\" && !ignoreProperties.test(key) && event[key] !== undefined) {\r\n proxy[key] = event[key];\r\n }\r\n }\r\n return compatible(proxy, event);\r\n }\r\n\r\n var\r\n specialEvents = {},\r\n focusinSupported = \"onfocusin\" in window,\r\n focus = { focus: \"focusin\", blur: \"focusout\" },\r\n hover = { mouseenter: \"mouseover\", mouseleave: \"mouseout\" },\r\n realEvent = function(type) {\r\n return hover[type] || (focusinSupported && focus[type]) || type;\r\n },\r\n handlers = {},\r\n EventBindings = langx.klass({\r\n init: function(target, event) {\r\n this._target = target;\r\n this._event = event;\r\n this._bindings = [];\r\n },\r\n\r\n add: function(fn, options) {\r\n var bindings = this._bindings,\r\n binding = {\r\n fn: fn,\r\n options: langx.mixin({}, options)\r\n };\r\n\r\n bindings.push(binding);\r\n\r\n var self = this;\r\n if (!self._listener) {\r\n self._listener = function(domEvt) {\r\n var elm = this,\r\n e = createProxy(domEvt),\r\n args = domEvt._args,\r\n bindings = self._bindings,\r\n ns = e.namespace;\r\n\r\n if (langx.isDefined(args)) {\r\n args = [e].concat(args);\r\n } else {\r\n args = [e];\r\n }\r\n\r\n langx.each(bindings,function(idx,binding) {\r\n var match = elm;\r\n if (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped()) {\r\n return false;\r\n }\r\n var fn = binding.fn,\r\n options = binding.options || {},\r\n selector = options.selector,\r\n one = options.one,\r\n data = options.data;\r\n\r\n if (ns && ns != options.ns && options.ns.indexOf(ns)===-1) {\r\n return ;\r\n }\r\n if (selector) {\r\n match = finder.closest(e.target, selector);\r\n if (match && match !== elm) {\r\n langx.mixin(e, {\r\n currentTarget: match,\r\n liveFired: elm\r\n });\r\n } else {\r\n return ;\r\n }\r\n }\r\n\r\n if (langx.isDefined(data)) {\r\n e.data = data;\r\n }\r\n\r\n if (one) {\r\n self.remove(fn, options);\r\n }\r\n\r\n var result = fn.apply(match, args);\r\n\r\n if (result === false) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n });;\r\n };\r\n\r\n var event = self._event;\r\n if (event in hover) {\r\n var l = self._listener;\r\n self._listener = function(e) {\r\n var related = e.relatedTarget;\r\n if (!related || (related !== this && !noder.contains(this, related))) {\r\n return l.apply(this, arguments);\r\n }\r\n }\r\n }\r\n\r\n if (self._target.addEventListener) {\r\n self._target.addEventListener(realEvent(event), self._listener, false);\r\n } else {\r\n console.warn(\"invalid eventer object\", self._target);\r\n }\r\n }\r\n\r\n },\r\n remove: function(fn, options) {\r\n options = langx.mixin({}, options);\r\n\r\n function matcherFor(ns) {\r\n return new RegExp(\"(?:^| )\" + ns.replace(\" \", \" .* ?\") + \"(?: |$)\");\r\n }\r\n var matcher;\r\n if (options.ns) {\r\n matcher = matcherFor(options.ns);\r\n }\r\n\r\n this._bindings = this._bindings.filter(function(binding) {\r\n var removing = (!fn || fn === binding.fn) &&\r\n (!matcher || matcher.test(binding.options.ns)) &&\r\n (!options.selector || options.selector == binding.options.selector);\r\n\r\n return !removing;\r\n });\r\n if (this._bindings.length == 0) {\r\n if (this._target.removeEventListener) {\r\n this._target.removeEventListener(realEvent(this._event), this._listener, false);\r\n }\r\n this._listener = null;\r\n }\r\n }\r\n }),\r\n EventsHandler = langx.klass({\r\n init: function(elm) {\r\n this._target = elm;\r\n this._handler = {};\r\n },\r\n\r\n // add a event listener\r\n // selector Optional\r\n register: function(event, callback, options) {\r\n // Seperate the event from the namespace\r\n var parsed = parse(event),\r\n event = parsed.type,\r\n specialEvent = specialEvents[event],\r\n bindingEvent = specialEvent && (specialEvent.bindType || specialEvent.bindEventName);\r\n\r\n var events = this._handler;\r\n\r\n // Check if there is already a handler for this event\r\n if (events[event] === undefined) {\r\n events[event] = new EventBindings(this._target, bindingEvent || event);\r\n }\r\n\r\n // Register the new callback function\r\n events[event].add(callback, langx.mixin({\r\n ns: parsed.ns\r\n }, options)); // options:{selector:xxx}\r\n },\r\n\r\n // remove a event listener\r\n unregister: function(event, fn, options) {\r\n // Check for parameter validtiy\r\n var events = this._handler,\r\n parsed = parse(event);\r\n event = parsed.type;\r\n\r\n var listener = events[event];\r\n\r\n if (listener) {\r\n listener.remove(fn, langx.mixin({\r\n ns: parsed.ns\r\n }, options));\r\n }\r\n }\r\n }),\r\n\r\n findHandler = function(elm) {\r\n var id = uid(elm),\r\n handler = handlers[id];\r\n if (!handler) {\r\n handler = handlers[id] = new EventsHandler(elm);\r\n }\r\n return handler;\r\n };\r\n\r\n function off(elm, events, selector, callback) {\r\n var $this = this\r\n if (langx.isPlainObject(events)) {\r\n langx.each(events, function(type, fn) {\r\n off(elm, type, selector, fn);\r\n })\r\n return $this;\r\n }\r\n\r\n if (!langx.isString(selector) && !langx.isFunction(callback) && callback !== false) {\r\n callback = selector;\r\n selector = undefined;\r\n }\r\n\r\n if (callback === false) {\r\n callback = langx.returnFalse;\r\n }\r\n\r\n if (typeof events == \"string\") {\r\n if (events.indexOf(\",\") > -1) {\r\n events = events.split(\",\");\r\n } else {\r\n events = events.split(/\\s/);\r\n }\r\n }\r\n\r\n var handler = findHandler(elm);\r\n\r\n if (events) events.forEach(function(event) {\r\n\r\n handler.unregister(event, callback, {\r\n selector: selector,\r\n });\r\n });\r\n return this;\r\n }\r\n\r\n function on(elm, events, selector, data, callback, one) {\r\n\r\n var autoRemove, delegator;\r\n if (langx.isPlainObject(events)) {\r\n langx.each(events, function(type, fn) {\r\n on(elm, type, selector, data, fn, one);\r\n });\r\n return this;\r\n }\r\n\r\n if (!langx.isString(selector) && !langx.isFunction(callback)) {\r\n callback = data;\r\n data = selector;\r\n selector = undefined;\r\n }\r\n\r\n if (langx.isFunction(data)) {\r\n callback = data;\r\n data = undefined;\r\n }\r\n\r\n if (callback === false) {\r\n callback = langx.returnFalse;\r\n }\r\n\r\n if (typeof events == \"string\") {\r\n if (events.indexOf(\",\") > -1) {\r\n events = events.split(\",\");\r\n } else {\r\n events = events.split(/\\s/);\r\n }\r\n }\r\n\r\n var handler = findHandler(elm);\r\n\r\n events.forEach(function(event) {\r\n if (event == \"ready\") {\r\n return ready(callback);\r\n }\r\n handler.register(event, callback, {\r\n data: data,\r\n selector: selector,\r\n one: !!one\r\n });\r\n });\r\n return this;\r\n }\r\n\r\n function one(elm, events, selector, data, callback) {\r\n on(elm, events, selector, data, callback, 1);\r\n\r\n return this;\r\n }\r\n\r\n function stop(event) {\r\n if (window.document.all) {\r\n event.keyCode = 0;\r\n }\r\n if (event.preventDefault) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n return this;\r\n }\r\n\r\n function trigger(evented, type, args) {\r\n var e;\r\n if (type instanceof Event) {\r\n e = type;\r\n } else {\r\n e = createEvent(type, args);\r\n }\r\n e._args = args;\r\n\r\n var fn = (evented.dispatchEvent || evented.trigger);\r\n if (fn) {\r\n fn.call(evented, e);\r\n } else {\r\n console.warn(\"The evented parameter is not a eventable object\");\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function ready(callback) {\r\n // need to check if document.body exists for IE as that browser reports\r\n // document ready when it hasn't yet created the body elm\r\n if (readyRE.test(document.readyState) && document.body) {\r\n callback()\r\n } else {\r\n document.addEventListener('DOMContentLoaded', callback, false);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n var keyCodeLookup = {\r\n \"delete\": 46\r\n };\r\n //example:\r\n //shortcuts(elm).add(\"CTRL+ALT+SHIFT+X\",function(){console.log(\"test!\")});\r\n function shortcuts(elm) {\r\n\r\n var registry = datax.data(elm, \"shortcuts\");\r\n if (!registry) {\r\n registry = {};\r\n datax.data(elm, \"shortcuts\", registry);\r\n var run = function(shortcut, event) {\r\n var n = event.metaKey || event.ctrlKey;\r\n if (shortcut.ctrl == n && shortcut.alt == event.altKey && shortcut.shift == event.shiftKey) {\r\n if (event.keyCode == shortcut.keyCode || event.charCode && event.charCode == shortcut.charCode) {\r\n event.preventDefault();\r\n if (\"keydown\" == event.type) {\r\n shortcut.fn(event);\r\n }\r\n return true;\r\n }\r\n }\r\n };\r\n on(elm, \"keyup keypress keydown\", function(event) {\r\n if (!(/INPUT|TEXTAREA/.test(event.target.nodeName))) {\r\n for (var key in registry) {\r\n run(registry[key], event);\r\n }\r\n }\r\n });\r\n\r\n }\r\n\r\n return {\r\n add: function(pattern, fn) {\r\n var shortcutKeys;\r\n if (pattern.indexOf(\",\") > -1) {\r\n shortcutKeys = pattern.toLowerCase().split(\",\");\r\n } else {\r\n shortcutKeys = pattern.toLowerCase().split(\" \");\r\n }\r\n shortcutKeys.forEach(function(shortcutKey) {\r\n var setting = {\r\n fn: fn,\r\n alt: false,\r\n ctrl: false,\r\n shift: false\r\n };\r\n shortcutKey.split(\"+\").forEach(function(key) {\r\n switch (key) {\r\n case \"alt\":\r\n case \"ctrl\":\r\n case \"shift\":\r\n setting[key] = true;\r\n break;\r\n default:\r\n setting.charCode = key.charCodeAt(0);\r\n setting.keyCode = keyCodeLookup[key] || key.toUpperCase().charCodeAt(0);\r\n }\r\n });\r\n var regKey = (setting.ctrl ? \"ctrl\" : \"\") + \",\" + (setting.alt ? \"alt\" : \"\") + \",\" + (setting.shift ? \"shift\" : \"\") + \",\" + setting.keyCode;\r\n registry[regKey] = setting;\r\n })\r\n }\r\n\r\n };\r\n\r\n }\r\n\r\n function eventer() {\r\n return eventer;\r\n }\r\n\r\n langx.mixin(eventer, {\r\n create: createEvent,\r\n\r\n off: off,\r\n\r\n on: on,\r\n\r\n one: one,\r\n\r\n proxy: createProxy,\r\n\r\n ready: ready,\r\n\r\n shortcuts: shortcuts,\r\n\r\n special : specialEvents,\r\n\r\n stop: stop,\r\n\r\n trigger: trigger\r\n\r\n });\r\n\r\n return skylark.eventer = eventer;\r\n});\r\n\ndefine('skylark-utils/dnd',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\",\r\n \"./datax\",\r\n \"./finder\",\r\n \"./geom\",\r\n \"./eventer\",\r\n \"./styler\"\r\n],function(skylark, langx,noder,datax,finder,geom,eventer,styler){\r\n var on = eventer.on,\r\n off = eventer.off,\r\n attr = datax.attr,\r\n removeAttr = datax.removeAttr,\r\n offset = geom.pagePosition,\r\n addClass = styler.addClass,\r\n height = geom.height;\r\n\r\n\r\n var DndManager = langx.Evented.inherit({\r\n klassName : \"DndManager\",\r\n\r\n init : function() {\r\n\r\n },\r\n\r\n prepare : function(draggable) {\r\n var e = eventer.create(\"preparing\",{\r\n dragSource : draggable.elm,\r\n handleElm : draggable.handleElm\r\n });\r\n draggable.trigger(e);\r\n draggable.dragSource = e.dragSource;\r\n },\r\n\r\n start : function(draggable,event) {\r\n\r\n var p = geom.pagePosition(draggable.elm);\r\n this.draggingOffsetX = parseInt(event.pageX - p.left);\r\n this.draggingOffsetY = parseInt(event.pageY - p.top)\r\n\r\n var e = eventer.create(\"started\",{\r\n elm : draggable.elm,\r\n dragSource : draggable.dragSource,\r\n handleElm : draggable.handleElm,\r\n ghost : null,\r\n\r\n transfer : {\r\n }\r\n });\r\n\r\n draggable.trigger(e);\r\n\r\n\r\n this.dragging = draggable;\r\n\r\n if (draggable.draggingClass) {\r\n styler.addClass(draggable.dragSource,draggable.draggingClass);\r\n }\r\n\r\n this.draggingGhost = e.ghost;\r\n if (!this.draggingGhost) {\r\n this.draggingGhost = draggable.elm;\r\n }\r\n\r\n this.draggingTransfer = e.transfer;\r\n if (this.draggingTransfer) {\r\n\r\n langx.each(this.draggingTransfer,function(key,value){\r\n event.dataTransfer.setData(key, value);\r\n });\r\n }\r\n\r\n event.dataTransfer.setDragImage(this.draggingGhost, this.draggingOffsetX, this.draggingOffsetY);\r\n\r\n event.dataTransfer.effectAllowed = \"copyMove\";\r\n\r\n this.trigger(e);\r\n },\r\n\r\n over : function() {\r\n\r\n },\r\n\r\n end : function(dropped) {\r\n var dragging = this.dragging;\r\n if (dragging) {\r\n if (dragging.draggingClass) {\r\n styler.removeClass(dragging.dragSource,dragging.draggingClass);\r\n }\r\n }\r\n\r\n var e = eventer.create(\"ended\",{\r\n }); \r\n this.trigger(e);\r\n\r\n\r\n this.dragging = null;\r\n this.draggingTransfer = null;\r\n this.draggingGhost = null;\r\n this.draggingOffsetX = null;\r\n this.draggingOffsetY = null;\r\n }\r\n });\r\n\r\n var manager = new DndManager(),\r\n draggingHeight,\r\n placeholders = [];\r\n\r\n\r\n\r\n var Draggable = langx.Evented.inherit({\r\n klassName : \"Draggable\",\r\n\r\n init : function (elm,params) {\r\n var self = this;\r\n\r\n self.elm = elm;\r\n self.draggingClass = params.draggingClass || \"dragging\",\r\n self._params = params;\r\n\r\n [\"preparing\",\"started\", \"ended\", \"moving\"].forEach(function(eventName) {\r\n if (langx.isFunction(params[eventName])) {\r\n self.on(eventName, params[eventName]);\r\n }\r\n });\r\n\r\n\r\n eventer.on(elm,{\r\n \"mousedown\" : function(e) {\r\n if (params.handle) {\r\n self.handleElm = finder.closest(e.target,params.handle);\r\n if (!self.handleElm) {\r\n return;\r\n }\r\n }\r\n manager.prepare(self);\r\n if (self.dragSource) {\r\n datax.prop(self.dragSource, \"draggable\", true);\r\n }\r\n },\r\n\r\n \"mouseup\" : function(e) {\r\n if (self.dragSource) {\r\n datax.prop(self.dragSource, \"draggable\", false);\r\n self.dragSource = null;\r\n self.handleElm = null;\r\n }\r\n },\r\n\r\n \"dragstart\": function(e) {\r\n datax.prop(self.dragSource, \"draggable\", false);\r\n manager.start(self, e);\r\n },\r\n\r\n \"dragend\": function(e){\r\n eventer.stop(e);\r\n\r\n if (!manager.dragging) {\r\n return;\r\n }\r\n\r\n manager.end(false);\r\n }\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n\r\n var Droppable = langx.Evented.inherit({\r\n klassName : \"Droppable\",\r\n\r\n init : function(elm,params) {\r\n var self = this,\r\n draggingClass = params.draggingClass || \"dragging\",\r\n hoverClass,\r\n activeClass,\r\n acceptable = true;\r\n\r\n self.elm = elm;\r\n self._params = params;\r\n\r\n [\"started\",\"entered\", \"leaved\", \"dropped\",\"overing\"].forEach(function(eventName) {\r\n if (langx.isFunction(params[eventName])) {\r\n self.on(eventName, params[eventName]);\r\n }\r\n });\r\n\r\n eventer.on(elm,{\r\n \"dragover\" : function(e) {\r\n e.stopPropagation()\r\n\r\n if (!acceptable) {\r\n return\r\n }\r\n\r\n var e2 = eventer.create(\"overing\",{\r\n overElm : e.target,\r\n transfer : manager.draggingTransfer,\r\n acceptable : true\r\n });\r\n self.trigger(e2);\r\n\r\n if (e2.acceptable) {\r\n e.preventDefault() // allow drop\r\n\r\n e.dataTransfer.dropEffect = \"copyMove\";\r\n }\r\n\r\n },\r\n\r\n \"dragenter\" : function(e) {\r\n var params = self._params,\r\n elm = self.elm;\r\n\r\n var e2 = eventer.create(\"entered\",{\r\n transfer : manager.draggingTransfer\r\n });\r\n\r\n self.trigger(e2);\r\n\r\n e.stopPropagation()\r\n\r\n if (hoverClass && acceptable) {\r\n styler.addClass(elm,hoverClass)\r\n }\r\n },\r\n\r\n \"dragleave\": function(e) {\r\n var params = self._params,\r\n elm = self.elm;\r\n if (!acceptable) return false\r\n \r\n var e2 = eventer.create(\"leaved\",{\r\n transfer : manager.draggingTransfer\r\n });\r\n \r\n self.trigger(e2);\r\n\r\n e.stopPropagation()\r\n\r\n if (hoverClass && acceptable) {\r\n styler.removeClass(elm,hoverClass);\r\n }\r\n },\r\n\r\n \"drop\": function(e){\r\n var params = self._params,\r\n elm = self.elm;\r\n\r\n eventer.stop(e); // stops the browser from redirecting.\r\n\r\n if (!manager.dragging) return\r\n\r\n // manager.dragging.elm.removeClass('dragging');\r\n\r\n if (hoverClass && acceptable) {\r\n styler.addClass(elm,hoverClass)\r\n }\r\n\r\n var e2 = eventer.create(\"dropped\",{\r\n transfer : manager.draggingTransfer\r\n });\r\n\r\n self.trigger(e2);\r\n\r\n manager.end(true)\r\n }\r\n });\r\n\r\n manager.on(\"started\",function(e){\r\n var e2 = eventer.create(\"started\",{\r\n transfer : manager.draggingTransfer,\r\n acceptable : false\r\n });\r\n\r\n self.trigger(e2);\r\n\r\n acceptable = e2.acceptable;\r\n hoverClass = e2.hoverClass;\r\n activeClass = e2.activeClass;\r\n\r\n if (activeClass && acceptable) {\r\n styler.addClass(elm,activeClass);\r\n }\r\n\r\n }).on(\"ended\" , function(e){\r\n var e2 = eventer.create(\"ended\",{\r\n transfer : manager.draggingTransfer,\r\n acceptable : false\r\n });\r\n\r\n self.trigger(e2);\r\n\r\n if (hoverClass && acceptable) {\r\n styler.removeClass(elm,hoverClass);\r\n }\r\n if (activeClass && acceptable) {\r\n styler.removeClass(elm,activeClass);\r\n }\r\n\r\n acceptable = false;\r\n activeClass = null;\r\n hoverClass = null;\r\n });\r\n\r\n }\r\n });\r\n\r\n\r\n function draggable(elm, params) {\r\n return new Draggable(elm,params);\r\n }\r\n\r\n function droppable(elm, params) {\r\n return new Droppable(elm,params);\r\n }\r\n\r\n function dnd(){\r\n return dnd;\r\n }\r\n\r\n langx.mixin(dnd, {\r\n //params : {\r\n // target : Element or string or function\r\n // handle : Element\r\n // copy : boolean\r\n // placeHolder : \"div\"\r\n // hoverClass : \"hover\"\r\n // start : function\r\n // enter : function\r\n // over : function\r\n // leave : function\r\n // drop : function\r\n // end : function\r\n //\r\n //\r\n //}\r\n draggable : draggable,\r\n\r\n //params : {\r\n // accept : string or function\r\n // placeHolder\r\n //\r\n //\r\n //\r\n //}\r\n droppable : droppable,\r\n\r\n manager : manager\r\n\r\n\r\n });\r\n\r\n return skylark.dnd = dnd;\r\n});\r\n\ndefine('skylarkjs/dnd',[\r\n \"skylark-utils/dnd\"\r\n], function(dnd) {\r\n return dnd;\r\n});\r\n\ndefine('skylarkjs/eventer',[\r\n \"skylark-utils/eventer\"\r\n], function(eventer) {\r\n return eventer;\r\n});\r\n\ndefine('skylark-utils/filer',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./eventer\",\r\n \"./styler\"\r\n], function(skylark, langx, eventer,styler) {\r\n var on = eventer.on,\r\n attr = eventer.attr,\r\n Deferred = langx.Deferred,\r\n\r\n fileInput,\r\n fileInputForm,\r\n fileSelected,\r\n maxFileSize = 1 / 0;\r\n\r\n function dataURLtoBlob(dataurl) {\r\n var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n while(n--){\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n return new Blob([u8arr], {type:mime});\r\n }\r\n\r\n function selectFile(callback) {\r\n fileSelected = callback;\r\n if (!fileInput) {\r\n var input = fileInput = document.createElement(\"input\");\r\n\r\n function selectFiles(pickedFiles) {\r\n for (var i = pickedFiles.length; i--;) {\r\n if (pickedFiles[i].size > maxFileSize) {\r\n pickedFiles.splice(i, 1);\r\n }\r\n }\r\n fileSelected(pickedFiles);\r\n }\r\n\r\n input.type = \"file\";\r\n input.style.position = \"fixed\",\r\n input.style.left = 0,\r\n input.style.top = 0,\r\n input.style.opacity = .001,\r\n document.body.appendChild(input);\r\n\r\n input.onchange = function(e) {\r\n selectFiles(Array.prototype.slice.call(e.target.files));\r\n // reset to \"\", so selecting the same file next time still trigger the change handler\r\n input.value = \"\";\r\n };\r\n }\r\n fileInput.click();\r\n }\r\n\r\n function upload(files, url, params) {\r\n params = params || {};\r\n var chunkSize = params.chunkSize || 0,\r\n maxSize = params.maxSize || 0,\r\n progressCallback = params.progress,\r\n errorCallback = params.error,\r\n completedCallback = params.completed,\r\n uploadedCallback = params.uploaded;\r\n\r\n\r\n function uploadOneFile(fileItem,oneFileloadedSize, fileItems) {\r\n function handleProcess(nowLoadedSize) {\r\n var t;\r\n speed = Math.ceil(oneFileloadedSize + nowLoadedSize / ((now() - uploadStartedTime) / 1e3)), \r\n percent = Math.round((oneFileloadedSize + nowLoadedSize) / file.size * 100); \r\n if (progressCallback) {\r\n progressCallback({\r\n name: file.name,\r\n loaded: oneFileloadedSize + nowLoadedSize,\r\n total: file.size,\r\n percent: percent,\r\n bytesPerSecond: speed,\r\n global: {\r\n loaded: allLoadedSize + oneFileloadedSize + nowLoadedSize,\r\n total: totalSize\r\n }\r\n });\r\n }\r\n }\r\n var file = fileItem.file,\r\n uploadChunkSize = chunkSize || file.size,\r\n chunk = file.slice(oneFileloadedSize, oneFileloadedSize + uploadChunkSize);\r\n\r\n xhr = createXmlHttpRequest();\r\n //xhr.open(\"POST\", url + \r\n // \"?action=upload&path=\" + \r\n // encodeURIComponent(path) + \r\n // \"&name=\" + encodeURIComponent(file.name) + \r\n // \"&loaded=\" + oneFileloadedSize + \r\n // \"&total=\" + file.size + \r\n // \"&id=\" + id + \r\n // \"&csrf=\" + encodeURIComponent(token) + \r\n // \"&resolution=\" + \r\n // encodeURIComponent(fileItem.type));\r\n xhr.upload.onprogress = function(event) {\r\n handleProcess(event.loaded - (event.total - h.size))\r\n };\r\n xhr.onload = function() {\r\n var response, i;\r\n xhr.upload.onprogress({\r\n loaded: h.size,\r\n total: h.size\r\n });\r\n try {\r\n response = JSON.parse(xhr.responseText);\r\n } catch (e) {\r\n i = {\r\n code: -1,\r\n message: \"Error response is not proper JSON\\n\\nResponse:\\n\" + xhr.responseText,\r\n data: {\r\n fileName: file.name,\r\n fileSize: file.size,\r\n maxSize: uploadMaxSize,\r\n extensions: extensions.join(\", \")\r\n },\r\n extra: extra\r\n };\r\n errorFileInfos.push(i);\r\n if (errorCallback) {\r\n errorCallback(i);\r\n }\r\n return uploadFiles(fileItems)\r\n }\r\n if (response.error) {\r\n\r\n i = {\r\n code: response.error.code,\r\n message: response.error.message,\r\n data: {\r\n fileName: file.name,\r\n fileSize: file.size,\r\n maxSize: uploadMaxSize,\r\n extensions: extensions.join(\", \")\r\n },\r\n extra: extra\r\n }; \r\n errorFileInfos.push(i); \r\n if (errorCallback) {\r\n errorCallback(i);\r\n }\r\n uploadFiles(fileItems);\r\n } else {\r\n if (!response.error && oneFileloadedSize + uploadChunkSize < file.size) {\r\n uploadOneFile(fileItem, oneFileloadedSize + uploadChunkSize, fileItems);\r\n } else {\r\n if (response.result) {\r\n utils.each(response.result, function(e) {\r\n e = File.fromJSON(e);\r\n uploadFileItems.push(e);\r\n\r\n if (uploadedCallback) {\r\n uploadedCallback({\r\n file: e\r\n });\r\n }\r\n }); \r\n\r\n } \r\n allLoadedSize += file.size;\r\n response.result && k.push(response.result);\r\n uploadFiles(fileItems);\r\n } \r\n } \r\n\r\n };\r\n handleProcess(0);\r\n xhr.send(createFormData(h));\r\n }\r\n\r\n function uploadFiles(fileItems) {\r\n var fileItem = fileItems.shift();\r\n processedFilesCount++; \r\n if (fileItem && fileItem.file.error) {\r\n uploadFiles(fileItem);\r\n } else {\r\n if (uploadingFile) {\r\n uploadOneFile(fileItem, null, 0, fileItems);\r\n } else {\r\n\r\n if (completedCallback) {\r\n completedCallback({\r\n files: new FileCollection(uploadFileItems),\r\n bytesPerSecond: I,\r\n errors: E(D),\r\n extra: extra\r\n });\r\n }\r\n } \r\n }\r\n }\r\n\r\n var self = this,\r\n fileItems = [],\r\n processedFilesCount = -1,\r\n xhr, \r\n totalSize = 0,\r\n allLoadedSize = 0,\r\n k = [],\r\n errorFileInfos = [],\r\n startedTime = now(),\r\n I = 0,\r\n uploadFileItems = [];\r\n\r\n for ( var i = 0; i < files.length; i++) {\r\n totalSize += files[i].size;\r\n fileItems.push({\r\n file : files[i]\r\n });\r\n } \r\n\r\n uploadFiles(fileItems);\r\n }\r\n\r\n\r\n var filer = function() {\r\n return filer;\r\n };\r\n\r\n langx.mixin(filer , {\r\n dropzone: function(elm, params) {\r\n params = params || {};\r\n var hoverClass = params.hoverClass || \"dropzone\",\r\n droppedCallback = params.dropped;\r\n\r\n var enterdCount = 0;\r\n on(elm, \"dragenter\", function(e) {\r\n if (e.dataTransfer && e.dataTransfer.types.indexOf(\"Files\")>-1) {\r\n eventer.stop(e);\r\n enterdCount ++;\r\n styler.addClass(elm,hoverClass)\r\n }\r\n });\r\n\r\n on(elm, \"dragover\", function(e) {\r\n if (e.dataTransfer && e.dataTransfer.types.indexOf(\"Files\")>-1) {\r\n eventer.stop(e);\r\n }\r\n });\r\n\r\n\r\n on(elm, \"dragleave\", function(e) {\r\n if (e.dataTransfer && e.dataTransfer.types.indexOf(\"Files\")>-1) {\r\n enterdCount--\r\n if (enterdCount==0) {\r\n styler.removeClass(elm,hoverClass);\r\n }\r\n }\r\n });\r\n\r\n on(elm, \"drop\", function(e) {\r\n if (e.dataTransfer && e.dataTransfer.types.indexOf(\"Files\")>-1) {\r\n styler.removeClass(elm,hoverClass)\r\n eventer.stop(e);\r\n if (droppedCallback) {\r\n droppedCallback(e.dataTransfer.files);\r\n }\r\n }\r\n });\r\n\r\n\r\n return this;\r\n },\r\n\r\n picker: function(elm, params) {\r\n params = params || {};\r\n\r\n var pickedCallback = params.picked;\r\n\r\n on(elm, \"click\", function(e) {\r\n e.preventDefault();\r\n selectFile(pickedCallback);\r\n });\r\n return this;\r\n },\r\n\r\n readFile : function(file,params) {\r\n params = params || {};\r\n var d = new Deferred,\r\n reader = new FileReader();\r\n \r\n reader.onload = function(evt) {\r\n d.resolve(evt.target.result);\r\n };\r\n reader.onerror = function(e) {\r\n var code = e.target.error.code;\r\n if (code === 2) {\r\n alert('please don\\'t open this page using protocol fill:///');\r\n } else {\r\n alert('error code: ' + code);\r\n }\r\n };\r\n \r\n if (params.asArrayBuffer){\r\n reader.readAsArrayBuffer(file);\r\n } else if (params.asDataUrl) {\r\n reader.readAsDataURL(file); \r\n } else if (params.asText) {\r\n reader.readAsText(file);\r\n } else {\r\n reader.readAsArrayBuffer(file);\r\n }\r\n\r\n return d.promise;\r\n },\r\n\r\n writeFile : function(data,name) {\r\n if (window.navigator.msSaveBlob) { \r\n if (langx.isString(data)) {\r\n data = dataURItoBlob(data);\r\n }\r\n window.navigator.msSaveBlob(data, name);\r\n } else {\r\n var a = document.createElement('a');\r\n if (data instanceof Blob) {\r\n data = langx.URL.createObjectURL(data);\r\n }\r\n a.href = data;\r\n a.setAttribute('download', name || 'noname');\r\n a.dispatchEvent(new CustomEvent('click'));\r\n } \r\n }\r\n\r\n\r\n });\r\n\r\n return skylark.filer = filer;\r\n});\r\n\ndefine('skylarkjs/filer',[\r\n \"skylark-utils/filer\"\r\n], function(filer) {\r\n return filer;\r\n});\r\n\ndefine('skylarkjs/finder',[\r\n \"skylark-utils/finder\"\r\n], function(finder) {\r\n return finder;\r\n});\r\n\ndefine('skylark-utils/fx',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./browser\",\r\n \"./geom\",\r\n \"./styler\",\r\n \"./eventer\"\r\n], function(skylark, langx, browser, geom, styler, eventer) {\r\n var animationName,\r\n animationDuration,\r\n animationTiming,\r\n animationDelay,\r\n transitionProperty,\r\n transitionDuration,\r\n transitionTiming,\r\n transitionDelay,\r\n\r\n animationEnd = browser.normalizeCssEvent('AnimationEnd'),\r\n transitionEnd = browser.normalizeCssEvent('TransitionEnd'),\r\n\r\n supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,\r\n transform = browser.css3PropPrefix + \"transform\",\r\n cssReset = {};\r\n\r\n\r\n cssReset[animationName = browser.normalizeCssProperty(\"animation-name\")] =\r\n cssReset[animationDuration = browser.normalizeCssProperty(\"animation-duration\")] =\r\n cssReset[animationDelay = browser.normalizeCssProperty(\"animation-delay\")] =\r\n cssReset[animationTiming = browser.normalizeCssProperty(\"animation-timing-function\")] = \"\";\r\n\r\n cssReset[transitionProperty = browser.normalizeCssProperty(\"transition-property\")] =\r\n cssReset[transitionDuration = browser.normalizeCssProperty(\"transition-duration\")] =\r\n cssReset[transitionDelay = browser.normalizeCssProperty(\"transition-delay\")] =\r\n cssReset[transitionTiming = browser.normalizeCssProperty(\"transition-timing-function\")] = \"\";\r\n\r\n\r\n\r\n function animate(elm, properties, duration, ease, callback, delay) {\r\n var key,\r\n cssValues = {},\r\n cssProperties = [],\r\n transforms = \"\",\r\n that = this,\r\n endEvent,\r\n wrappedCallback,\r\n fired = false,\r\n hasScrollTop = false;\r\n\r\n if (langx.isPlainObject(duration)) {\r\n ease = duration.easing;\r\n callback = duration.complete;\r\n delay = duration.delay;\r\n duration = duration.duration;\r\n }\r\n\r\n if (langx.isString(duration)) {\r\n duration = fx.speeds[duration];\r\n }\r\n if (duration === undefined) {\r\n duration = fx.speeds.normal;\r\n }\r\n duration = duration / 1000;\r\n if (fx.off) {\r\n duration = 0;\r\n }\r\n\r\n if (langx.isFunction(ease)) {\r\n callback = ease;\r\n eace = \"swing\";\r\n } else {\r\n ease = ease || \"swing\";\r\n }\r\n\r\n if (delay) {\r\n delay = delay / 1000;\r\n } else {\r\n delay = 0;\r\n }\r\n\r\n if (langx.isString(properties)) {\r\n // keyframe animation\r\n cssValues[animationName] = properties;\r\n cssValues[animationDuration] = duration + \"s\";\r\n cssValues[animationTiming] = ease;\r\n endEvent = animationEnd;\r\n } else {\r\n // CSS transitions\r\n for (key in properties) {\r\n if (supportedTransforms.test(key)) {\r\n transforms += key + \"(\" + properties[key] + \") \";\r\n } else {\r\n if (key === \"scrollTop\") {\r\n hasScrollTop = true;\r\n }\r\n cssValues[key] = properties[key];\r\n cssProperties.push(langx.dasherize(key));\r\n }\r\n }\r\n endEvent = transitionEnd;\r\n }\r\n\r\n if (transforms) {\r\n cssValues[transform] = transforms;\r\n cssProperties.push(transform);\r\n }\r\n\r\n if (duration > 0 && langx.isPlainObject(properties)) {\r\n cssValues[transitionProperty] = cssProperties.join(\", \");\r\n cssValues[transitionDuration] = duration + \"s\";\r\n cssValues[transitionDelay] = delay + \"s\";\r\n cssValues[transitionTiming] = ease;\r\n }\r\n\r\n wrappedCallback = function(event) {\r\n fired = true;\r\n if (event) {\r\n if (event.target !== event.currentTarget) {\r\n return // makes sure the event didn't bubble from \"below\"\r\n }\r\n eventer.off(event.target, endEvent, wrappedCallback)\r\n } else {\r\n eventer.off(elm, animationEnd, wrappedCallback) // triggered by setTimeout\r\n }\r\n styler.css(elm, cssReset);\r\n callback && callback.call(this);\r\n };\r\n\r\n if (duration > 0) {\r\n eventer.on(elm, endEvent, wrappedCallback);\r\n // transitionEnd is not always firing on older Android phones\r\n // so make sure it gets fired\r\n langx.debounce(function() {\r\n if (fired) {\r\n return;\r\n }\r\n wrappedCallback.call(that);\r\n }, ((duration + delay) * 1000) + 25)();\r\n }\r\n\r\n // trigger page reflow so new elements can animate\r\n elm.clientLeft;\r\n\r\n styler.css(elm, cssValues);\r\n\r\n if (duration <= 0) {\r\n langx.debounce(function() {\r\n if (fired) {\r\n return;\r\n }\r\n wrappedCallback.call(that);\r\n }, 0)();\r\n }\r\n\r\n if (hasScrollTop) {\r\n scrollToTop(elm, properties[\"scrollTop\"], duration, callback);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n function show(elm, speed, callback) {\r\n styler.show(elm);\r\n if (speed) {\r\n if (!callback && langx.isFunction(speed)) {\r\n callback = speed;\r\n speed = \"normal\";\r\n }\r\n styler.css(elm, \"opacity\", 0)\r\n animate(elm, { opacity: 1, scale: \"1,1\" }, speed, callback);\r\n }\r\n return this;\r\n }\r\n\r\n\r\n function hide(elm, speed, callback) {\r\n if (speed) {\r\n if (!callback && langx.isFunction(speed)) {\r\n callback = speed;\r\n speed = \"normal\";\r\n }\r\n animate(elm, { opacity: 0, scale: \"0,0\" }, speed, function() {\r\n styler.hide(elm);\r\n if (callback) {\r\n callback.call(elm);\r\n }\r\n });\r\n } else {\r\n styler.hide(elm);\r\n }\r\n return this;\r\n }\r\n\r\n function scrollToTop(elm, pos, speed, callback) {\r\n var scrollFrom = parseInt(elm.scrollTop),\r\n i = 0,\r\n runEvery = 5, // run every 5ms\r\n freq = speed * 1000 / runEvery,\r\n scrollTo = parseInt(pos);\r\n\r\n var interval = setInterval(function() {\r\n i++;\r\n\r\n if (i <= freq) elm.scrollTop = (scrollTo - scrollFrom) / freq * i + scrollFrom;\r\n\r\n if (i >= freq + 1) {\r\n clearInterval(interval);\r\n if (callback) langx.debounce(callback, 1000)();\r\n }\r\n }, runEvery);\r\n }\r\n\r\n function toggle(elm, speed, callback) {\r\n if (styler.isInvisible(elm)) {\r\n show(elm, speed, callback);\r\n } else {\r\n hide(elm, speed, callback);\r\n }\r\n return this;\r\n }\r\n\r\n function fadeTo(elm, speed, opacity, easing, callback) {\r\n animate(elm, { opacity: opacity }, speed, easing, callback);\r\n return this;\r\n }\r\n\r\n function fadeIn(elm, speed, easing, callback) {\r\n var target = styler.css(elm, \"opacity\");\r\n if (target > 0) {\r\n styler.css(elm, \"opacity\", 0);\r\n } else {\r\n target = 1;\r\n }\r\n styler.show(elm);\r\n\r\n fadeTo(elm, speed, target, easing, callback);\r\n\r\n return this;\r\n }\r\n\r\n function fadeOut(elm, speed, easing, callback) {\r\n var _elm = elm,\r\n complete,\r\n options = {};\r\n\r\n if (langx.isPlainObject(speed)) {\r\n options.easing = speed.easing;\r\n options.duration = speed.duration;\r\n complete = speed.complete;\r\n } else {\r\n options.duration = speed;\r\n if (callback) {\r\n complete = callback;\r\n options.easing = easing;\r\n } else {\r\n complete = easing;\r\n }\r\n }\r\n options.complete = function() {\r\n styler.hide(elm);\r\n if (complete) {\r\n complete.call(elm);\r\n }\r\n }\r\n\r\n fadeTo(elm, options, 0);\r\n\r\n return this;\r\n }\r\n\r\n function fadeToggle(elm, speed, ceasing, allback) {\r\n if (styler.isInvisible(elm)) {\r\n fadeIn(elm, speed, easing, callback);\r\n } else {\r\n fadeOut(elm, speed, easing, callback);\r\n }\r\n return this;\r\n }\r\n\r\n function slideDown(elm,duration,callback) { \r\n \r\n // get the element position to restore it then\r\n var position = styler.css(elm,'position');\r\n \r\n // show element if it is hidden\r\n show(elm);\r\n \r\n // place it so it displays as usually but hidden\r\n styler.css(elm,{\r\n position: 'absolute',\r\n visibility: 'hidden'\r\n });\r\n \r\n // get naturally height, margin, padding\r\n var marginTop = styler.css(elm,'margin-top');\r\n var marginBottom = styler.css(elm,'margin-bottom');\r\n var paddingTop = styler.css(elm,'padding-top');\r\n var paddingBottom = styler.css(elm,'padding-bottom');\r\n var height = styler.css(elm,'height');\r\n \r\n // set initial css for animation\r\n styler.css(elm,{\r\n position: position,\r\n visibility: 'visible',\r\n overflow: 'hidden',\r\n height: 0,\r\n marginTop: 0,\r\n marginBottom: 0,\r\n paddingTop: 0,\r\n paddingBottom: 0\r\n });\r\n \r\n // animate to gotten height, margin and padding\r\n animate(elm,{\r\n height: height,\r\n marginTop: marginTop,\r\n marginBottom: marginBottom,\r\n paddingTop: paddingTop,\r\n paddingBottom: paddingBottom\r\n }, {\r\n duration : duration,\r\n complete: function(){\r\n if (callback) {\r\n callback.apply(elm); \r\n }\r\n } \r\n }\r\n );\r\n \r\n return this;\r\n };\r\n\r\n function slideUp(elm,duration,callback) {\r\n // active the function only if the element is visible\r\n if (geom.height(elm) > 0) {\r\n \r\n // get the element position to restore it then\r\n var position = styler.css(elm,'position');\r\n \r\n // get the element height, margin and padding to restore them then\r\n var height = styler.css(elm,'height');\r\n var marginTop = styler.css(elm,'margin-top');\r\n var marginBottom = styler.css(elm,'margin-bottom');\r\n var paddingTop = styler.css(elm,'padding-top');\r\n var paddingBottom = styler.css(elm,'padding-bottom');\r\n \r\n // set initial css for animation\r\n styler.css(elm,{\r\n visibility: 'visible',\r\n overflow: 'hidden',\r\n height: height,\r\n marginTop: marginTop,\r\n marginBottom: marginBottom,\r\n paddingTop: paddingTop,\r\n paddingBottom: paddingBottom\r\n });\r\n \r\n // animate element height, margin and padding to zero\r\n animate(elm,{\r\n height: 0,\r\n marginTop: 0,\r\n marginBottom: 0,\r\n paddingTop: 0,\r\n paddingBottom: 0\r\n }, { \r\n // callback : restore the element position, height, margin and padding to original values\r\n duration: duration,\r\n queue: false,\r\n complete: function(){\r\n hide(elm);\r\n styler.css(elm,{\r\n visibility: 'visible',\r\n overflow: 'hidden',\r\n height: height,\r\n marginTop: marginTop,\r\n marginBottom: marginBottom,\r\n paddingTop: paddingTop,\r\n paddingBottom: paddingBottom\r\n });\r\n if (callback) {\r\n callback.apply(elm); \r\n }\r\n }\r\n });\r\n }\r\n return this;\r\n };\r\n \r\n /* SlideToggle */\r\n function slideToggle(elm,duration,callback) {\r\n \r\n // if the element is hidden, slideDown !\r\n if (geom.height(elm) == 0) {\r\n slideDown(elm,duration,callback);\r\n } \r\n // if the element is visible, slideUp !\r\n else {\r\n slideUp(elm,duration,callback);\r\n }\r\n return this;\r\n };\r\n\r\n\r\n function fx() {\r\n return fx;\r\n }\r\n\r\n langx.mixin(fx, {\r\n off: false,\r\n\r\n speeds: {\r\n normal: 400,\r\n fast: 200,\r\n slow: 600\r\n },\r\n\r\n animate: animate,\r\n fadeIn: fadeIn,\r\n fadeOut: fadeOut,\r\n fadeTo: fadeTo,\r\n fadeToggle: fadeToggle,\r\n hide: hide,\r\n scrollToTop: scrollToTop,\r\n\r\n slideDown : slideDown,\r\n slideToggle : slideToggle,\r\n slideUp : slideUp,\r\n show: show,\r\n toggle: toggle\r\n });\r\n\r\n return skylark.fx = fx;\r\n});\ndefine('skylarkjs/fx',[\r\n \"skylark-utils/fx\"\r\n], function(fx) {\r\n return fx;\r\n});\r\n\ndefine('skylarkjs/geom',[\r\n \"skylark-utils/geom\"\r\n], function(geom) {\r\n return geom;\r\n});\r\n\ndefine('skylark-utils/http',[\r\n \"./skylark\",\r\n \"./langx\"\r\n],function(skylark, langx){\r\n var Deferred = langx.Deferred,\r\n blankRE = /^\\s*$/,\r\n scriptTypeRE = /^(?:text|application)\\/javascript/i,\r\n xmlTypeRE = /^(?:text|application)\\/xml/i;\r\n\r\n\r\n function empty() {}\r\n\r\n var ajaxSettings = {\r\n // Default type of request\r\n type: 'GET',\r\n // Callback that is executed before request\r\n beforeSend: empty,\r\n // Callback that is executed if the request succeeds\r\n success: empty,\r\n // Callback that is executed the the server drops error\r\n error: empty,\r\n // Callback that is executed on request complete (both: error and success)\r\n complete: empty,\r\n // The context for the callbacks\r\n context: null,\r\n // Whether to trigger \"global\" Ajax events\r\n global: true,\r\n // Transport\r\n xhr: function() {\r\n return new window.XMLHttpRequest();\r\n },\r\n // MIME types mapping\r\n // IIS returns Javascript as \"application/x-javascript\"\r\n accepts: {\r\n script: 'text/javascript, application/javascript, application/x-javascript',\r\n json: 'application/json',\r\n xml: 'application/xml, text/xml',\r\n html: 'text/html',\r\n text: 'text/plain'\r\n },\r\n // Whether the request is to another domain\r\n crossDomain: false,\r\n // Default timeout\r\n timeout: 0,\r\n // Whether data should be serialized to string\r\n processData: true,\r\n // Whether the browser should be allowed to cache GET responses\r\n cache: true\r\n }\r\n\r\n function mimeToDataType(mime) {\r\n if (mime) {\r\n mime = mime.split(';', 2)[0];\r\n }\r\n return mime && (mime == 'text/html' ? 'html' :\r\n mime == 'application/json' ? 'json' :\r\n scriptTypeRE.test(mime) ? 'script' :\r\n xmlTypeRE.test(mime) && 'xml') || 'text';\r\n }\r\n\r\n function appendQuery(url, query) {\r\n if (query == '') {\r\n return url;\r\n }\r\n return (url + '&' + query).replace(/[&?]{1,2}/, '?');\r\n }\r\n\r\n function serialize(params, obj, traditional, scope) {\r\n var type, array = langx.isArray(obj),\r\n hash = langx.isPlainObject(obj)\r\n langx.each(obj, function(key, value) {\r\n type = langx.type(value);\r\n if (scope) {\r\n key = traditional ? scope :\r\n scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' ;\r\n }\r\n // handle data in serializeArray() format\r\n if (!scope && array) {\r\n params.add(value.name, value.value);\r\n // recurse into nested objects\r\n } else if (type == \"array\" || (!traditional && type == \"object\")) {\r\n serialize(params, value, traditional, key);\r\n } else {\r\n params.add(key, value);\r\n }\r\n })\r\n } \r\n\r\n function param(obj, traditional) {\r\n var params = []\r\n params.add = function(key, value) {\r\n if (langx.isFunction(value)) {\r\n value = value();\r\n }\r\n if (value == null) {\r\n value = \"\";\r\n }\r\n this.push(escape(key) + '=' + escape(value));\r\n }\r\n \r\n serialize(params, obj, traditional);\r\n\r\n return params.join('&').replace(/%20/g, '+')\r\n }\r\n\r\n // serialize payload and append it to the URL for GET requests\r\n function serializeData(options) {\r\n if (options.processData && options.data && !langx.isString(options.data)) {\r\n options.data = $.param(options.data, options.traditional)\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }\r\n\r\n function ajaxSuccess(data, xhr, settings, deferred) {\r\n var context = settings.context,\r\n status = 'success'\r\n settings.success.call(context, data, status, xhr)\r\n //if (deferred) deferred.resolveWith(context, [data, status, xhr])\r\n //triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])\r\n ajaxComplete(status, xhr, settings)\r\n }\r\n // type: \"timeout\", \"error\", \"abort\", \"parsererror\"\r\n function ajaxError(error, type, xhr, settings, deferred) {\r\n var context = settings.context\r\n settings.error.call(context, xhr, type, error)\r\n //if (deferred) deferred.rejectWith(context, [xhr, type, error])\r\n //triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])\r\n ajaxComplete(type, xhr, settings)\r\n }\r\n // status: \"success\", \"notmodified\", \"error\", \"timeout\", \"abort\", \"parsererror\"\r\n function ajaxComplete(status, xhr, settings) {\r\n var context = settings.context\r\n settings.complete.call(context, xhr, status)\r\n //triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])\r\n //ajaxStop(settings)\r\n } \r\n\r\n function ajax(options) {\r\n var settings = langx.mixin({}, options),\r\n deferred = new Deferred();\r\n\r\n langx.safeMixin(settings,ajaxSettings);\r\n\r\n //ajaxStart(settings)\r\n if (!settings.crossDomain) {\r\n // settings.crossDomain = !langx.isSameOrigin(settings.url);\r\n }\r\n\r\n serializeData(settings);\r\n var dataType = settings.dataType;\r\n\r\n var mime = settings.accepts[dataType],\r\n headers = {},\r\n setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },\r\n protocol = /^([\\w-]+:)\\/\\//.test(settings.url) ? RegExp.$1 : window.location.protocol,\r\n xhr = settings.xhr(),\r\n nativeSetHeader = xhr.setRequestHeader,\r\n abortTimeout;\r\n\r\n //if (deferred) deferred.promise(xhr)\r\n\r\n if (!settings.crossDomain) {\r\n setHeader('X-Requested-With', 'XMLHttpRequest');\r\n }\r\n setHeader('Accept', mime || '*/*')\r\n if (mime = settings.mimeType || mime) {\r\n if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]\r\n xhr.overrideMimeType && xhr.overrideMimeType(mime)\r\n }\r\n if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) {\r\n setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')\r\n }\r\n\r\n if (settings.headers) {\r\n for (name in settings.headers) {\r\n setHeader(name, settings.headers[name]);\r\n } \r\n }\r\n xhr.setRequestHeader = setHeader;\r\n\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState == 4) {\r\n xhr.onreadystatechange = empty\r\n clearTimeout(abortTimeout)\r\n var result, error = false\r\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {\r\n dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))\r\n result = xhr.responseText\r\n\r\n try {\r\n // http://perfectionkills.com/global-eval-what-are-the-options/\r\n if (dataType == 'script') {\r\n (1, eval)(result);\r\n } else if (dataType == 'xml') {\r\n result = xhr.responseXML\r\n } else if (dataType == 'json') {\r\n result = blankRE.test(result) ? null : JSON.parse(result);\r\n }\r\n } catch (e) { \r\n error = e \r\n }\r\n\r\n if (error) {\r\n ajaxError(error, 'parsererror', xhr, settings, deferred);\r\n } else {\r\n ajaxSuccess(result, xhr, settings, deferred);\r\n }\r\n } else {\r\n ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n if (ajaxBeforeSend(xhr, settings) === false) {\r\n xhr.abort()\r\n ajaxError(null, 'abort', xhr, settings, deferred)\r\n return xhr\r\n }\r\n\r\n if (settings.xhrFields)\r\n for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]\r\n */\r\n var async = 'async' in settings ? settings.async : true\r\n xhr.open(settings.type, settings.url, async, settings.username, settings.password)\r\n\r\n for (name in headers) {\r\n nativeSetHeader.apply(xhr, headers[name]);\r\n }\r\n\r\n if (settings.timeout > 0) {\r\n abortTimeout = setTimeout(function() {\r\n xhr.onreadystatechange = empty;\r\n xhr.abort();\r\n ajaxError(null, 'timeout', xhr, settings, deferred);\r\n }, settings.timeout);\r\n }\r\n\r\n // avoid sending empty string (#319)\r\n xhr.send(settings.data ? settings.data : null)\r\n return xhr;\r\n }\r\n\r\n\r\n function get( /* url, data, success, dataType */ ) {\r\n return ajax(parseArguments.apply(null, arguments))\r\n }\r\n\r\n function post( /* url, data, success, dataType */ ) {\r\n var options = parseArguments.apply(null, arguments);\r\n options.type = 'POST';\r\n return ajax(options);\r\n }\r\n\r\n function getJSON( /* url, data, success */ ) {\r\n var options = parseArguments.apply(null, arguments);\r\n options.dataType = 'json';\r\n return ajax(options);\r\n } \r\n\r\n\r\n function http(){\r\n return http;\r\n }\r\n\r\n langx.mixin(http, {\r\n ajax: ajax,\r\n\r\n get: get,\r\n \r\n gtJSON: getJSON,\r\n\r\n post: post\r\n\r\n });\r\n\r\n return skylark.http = http;\r\n});\r\n\ndefine('skylarkjs/http',[\r\n \"skylark-utils/http\"\r\n], function(http) {\r\n return http;\r\n});\r\n\ndefine('skylark-utils/images',[\r\n \"./skylark\",\r\n \"./langx\"\r\n], function(skylark,langx) {\r\n\r\n var elementNodeTypes = {\r\n 1: true,\r\n 9: true,\r\n 11: true\r\n };\r\n\r\n var ImagesLoaded = langx.Evented.inherit({\r\n /**\r\n * @param {Array, Element, NodeList, String} elem\r\n * @param {Object or Function} options - if function, use as callback\r\n * @param {Function} onAlways - callback function\r\n */\r\n init : function(elem, options, onAlways) {\r\n // coerce ImagesLoaded() without new, to be new ImagesLoaded()\r\n if ( !( this instanceof ImagesLoaded ) ) {\r\n return new ImagesLoaded( elem, options, onAlways );\r\n }\r\n // use elem as selector string\r\n if ( typeof elem == 'string' ) {\r\n elem = document.querySelectorAll( elem );\r\n }\r\n\r\n this.elements = langx.makeArray( elem );\r\n this.options = langx.mixin( {}, this.options );\r\n\r\n if ( typeof options == 'function' ) {\r\n onAlways = options;\r\n } else {\r\n langx.mixin( this.options, options );\r\n }\r\n\r\n if ( onAlways ) {\r\n this.on( 'always', onAlways );\r\n }\r\n\r\n this.getImages();\r\n\r\n // HACK check async to allow time to bind listeners\r\n setTimeout( function() {\r\n this.check();\r\n }.bind( this ));\r\n\r\n },\r\n\r\n options : {},\r\n\r\n getImages : function() {\r\n this.images = [];\r\n\r\n // filter & find items if we have an item selector\r\n this.elements.forEach( this.addElementImages, this );\r\n },\r\n\r\n /**\r\n * @param {Node} element\r\n */\r\n addElementImages : function( elem ) {\r\n // filter siblings\r\n if ( elem.nodeName == 'IMG' ) {\r\n this.addImage( elem );\r\n }\r\n // get background image on element\r\n if ( this.options.background === true ) {\r\n this.addElementBackgroundImages( elem );\r\n }\r\n\r\n // find children\r\n // no non-element nodes, #143\r\n var nodeType = elem.nodeType;\r\n if ( !nodeType || !elementNodeTypes[ nodeType ] ) {\r\n return;\r\n }\r\n var childImgs = elem.querySelectorAll('img');\r\n // concat childElems to filterFound array\r\n for ( var i=0; i < childImgs.length; i++ ) {\r\n var img = childImgs[i];\r\n this.addImage( img );\r\n }\r\n\r\n // get child background images\r\n if ( typeof this.options.background == 'string' ) {\r\n var children = elem.querySelectorAll( this.options.background );\r\n for ( i=0; i < children.length; i++ ) {\r\n var child = children[i];\r\n this.addElementBackgroundImages( child );\r\n }\r\n }\r\n },\r\n\r\n addElementBackgroundImages : function( elem ) {\r\n var style = getComputedStyle( elem );\r\n if ( !style ) {\r\n // Firefox returns null if in a hidden iframe https://bugzil.la/548397\r\n return;\r\n }\r\n // get url inside url(\"...\")\r\n var reURL = /url\\((['\"])?(.*?)\\1\\)/gi;\r\n var matches = reURL.exec( style.backgroundImage );\r\n while ( matches !== null ) {\r\n var url = matches && matches[2];\r\n if ( url ) {\r\n this.addBackground( url, elem );\r\n }\r\n matches = reURL.exec( style.backgroundImage );\r\n }\r\n },\r\n\r\n /**\r\n * @param {Image} img\r\n */\r\n addImage : function( img ) {\r\n var loadingImage = new LoadingImage( img );\r\n this.images.push( loadingImage );\r\n },\r\n\r\n addBackground : function( url, elem ) {\r\n var background = new Background( url, elem );\r\n this.images.push( background );\r\n },\r\n\r\n check : function() {\r\n var _this = this;\r\n this.progressedCount = 0;\r\n this.hasAnyBroken = false;\r\n // complete if no images\r\n if ( !this.images.length ) {\r\n this.complete();\r\n return;\r\n }\r\n\r\n function onProgress( e ) {\r\n // HACK - Chrome triggers event before object properties have changed. #83\r\n setTimeout( function() {\r\n _this.progress( e );\r\n });\r\n }\r\n\r\n this.images.forEach( function( loadingImage ) {\r\n loadingImage.one( 'progress', onProgress );\r\n loadingImage.check();\r\n });\r\n },\r\n\r\n progress : function( e ) {\r\n\r\n this.progressedCount++;\r\n this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;\r\n // progress event\r\n this.trigger( langx.createEvent('progress', {\r\n img : e.img,\r\n element : e.element,\r\n message : e.message,\r\n isLoaded : e.isLoaded\r\n }));\r\n\r\n // check if completed\r\n if ( this.progressedCount == this.images.length ) {\r\n this.complete();\r\n }\r\n\r\n if ( this.options.debug && console ) {\r\n console.log( 'progress: ' + message, e.target, e.element );\r\n }\r\n },\r\n\r\n complete : function() {\r\n var eventName = this.hasAnyBroken ? 'fail' : 'done';\r\n this.isComplete = true;\r\n this.trigger( eventName);\r\n this.trigger( 'always');\r\n\r\n }\r\n\r\n });\r\n \r\n\r\n // -------------------------- -------------------------- //\r\n\r\n var LoadingImage = langx.Evented.inherit({\r\n init: function( img ) {\r\n this.img = img;\r\n },\r\n check : function() {\r\n // If complete is true and browser supports natural sizes,\r\n // try to check for image status manually.\r\n var isComplete = this.getIsImageComplete();\r\n if ( isComplete ) {\r\n // report based on naturalWidth\r\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\r\n return;\r\n }\r\n\r\n // If none of the checks above matched, simulate loading on detached element.\r\n this.proxyImage = new Image();\r\n this.proxyImage.addEventListener( 'load', this );\r\n this.proxyImage.addEventListener( 'error', this );\r\n // bind to image as well for Firefox. #191\r\n this.img.addEventListener( 'load', this );\r\n this.img.addEventListener( 'error', this );\r\n this.proxyImage.src = this.img.src;\r\n },\r\n\r\n getIsImageComplete : function() {\r\n return this.img.complete && this.img.naturalWidth !== undefined;\r\n },\r\n\r\n confirm : function( isLoaded, message ) {\r\n this.isLoaded = isLoaded;\r\n this.trigger( langx.createEvent('progress', {\r\n img : this.img, \r\n element : this.img,\r\n message : message ,\r\n isLoaded : isLoaded\r\n }));\r\n },\r\n\r\n // ----- events ----- //\r\n\r\n // trigger specified handler for event type\r\n handleEvent : function( event ) {\r\n var method = 'on' + event.type;\r\n if ( this[ method ] ) {\r\n this[ method ]( event );\r\n }\r\n },\r\n\r\n onload : function() {\r\n this.confirm( true, 'onload' );\r\n this.unbindEvents();\r\n },\r\n\r\n onerror : function() {\r\n this.confirm( false, 'onerror' );\r\n this.unbindEvents();\r\n },\r\n\r\n unbindEvents : function() {\r\n this.proxyImage.removeEventListener( 'load', this );\r\n this.proxyImage.removeEventListener( 'error', this );\r\n this.img.removeEventListener( 'load', this );\r\n this.img.removeEventListener( 'error', this );\r\n },\r\n\r\n });\r\n\r\n\r\n // -------------------------- Background -------------------------- //\r\n var Background = LoadingImage.inherit({\r\n\r\n init : function( url, element ) {\r\n this.url = url;\r\n this.element = element;\r\n this.img = new Image();\r\n },\r\n\r\n check : function() {\r\n this.img.addEventListener( 'load', this );\r\n this.img.addEventListener( 'error', this );\r\n this.img.src = this.url;\r\n // check if image is already complete\r\n var isComplete = this.getIsImageComplete();\r\n if ( isComplete ) {\r\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\r\n this.unbindEvents();\r\n }\r\n },\r\n\r\n unbindEvents : function() {\r\n this.img.removeEventListener( 'load', this );\r\n this.img.removeEventListener( 'error', this );\r\n },\r\n\r\n confirm : function( isLoaded, message ) {\r\n this.isLoaded = isLoaded;\r\n this.trigger( langx.createEvent('progress', {\r\n img : this.img,\r\n element : this.element, \r\n message : message,\r\n isLoaded : isLoaded \r\n }));\r\n }\r\n });\r\n\r\n\r\n function images() {\r\n return images;\r\n }\r\n\r\n langx.mixin(images, {\r\n loaded : ImagesLoaded\r\n });\r\n\r\n return skylark.images = images;\r\n});\r\n\ndefine('skylarkjs/images',[\r\n \"skylark-utils/images\"\r\n], function(images) {\r\n return images;\r\n});\r\n\ndefine('skylark-utils/mover',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\",\r\n \"./datax\",\r\n \"./geom\",\r\n \"./eventer\",\r\n \"./styler\"\r\n],function(skylark, langx,noder,datax,geom,eventer,styler){\r\n var on = eventer.on,\r\n off = eventer.off,\r\n attr = datax.attr,\r\n removeAttr = datax.removeAttr,\r\n offset = geom.pagePosition,\r\n addClass = styler.addClass,\r\n height = geom.height,\r\n some = Array.prototype.some,\r\n map = Array.prototype.map;\r\n\r\n function _place(/*DomNode*/ node, choices, layoutNode, aroundNodeCoords){\r\n // summary:\r\n // Given a list of spots to put node, put it at the first spot where it fits,\r\n // of if it doesn't fit anywhere then the place with the least overflow\r\n // choices: Array\r\n // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }\r\n // Above example says to put the top-left corner of the node at (10,20)\r\n // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)\r\n // for things like tooltip, they are displayed differently (and have different dimensions)\r\n // based on their orientation relative to the parent. This adjusts the popup based on orientation.\r\n // It also passes in the available size for the popup, which is useful for tooltips to\r\n // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing\r\n // how much the popup had to be modified to fit into the available space. This is used to determine\r\n // what the best placement is.\r\n // aroundNodeCoords: Object\r\n // Size of aroundNode, ex: {w: 200, h: 50}\r\n\r\n // get {x: 10, y: 10, w: 100, h:100} type obj representing position of\r\n // viewport over document\r\n\r\n var doc = noder.ownerDoc(node),\r\n win = noder.ownerWindow(doc),\r\n view = geom.size(win);\r\n\r\n view.left = 0;\r\n view.top = 0;\r\n\r\n if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != \"body\"){\r\n doc.body.appendChild(node);\r\n }\r\n\r\n var best = null;\r\n\r\n some.apply(choices, function(choice){\r\n var corner = choice.corner;\r\n var pos = choice.pos;\r\n var overflow = 0;\r\n\r\n // calculate amount of space available given specified position of node\r\n var spaceAvailable = {\r\n w: {\r\n 'L': view.left + view.width - pos.x,\r\n 'R': pos.x - view.left,\r\n 'M': view.width\r\n }[corner.charAt(1)],\r\n\r\n h: {\r\n 'T': view.top + view.height - pos.y,\r\n 'B': pos.y - view.top,\r\n 'M': view.height\r\n }[corner.charAt(0)]\r\n };\r\n\r\n if(layoutNode){\r\n var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);\r\n overflow = typeof res == \"undefined\" ? 0 : res;\r\n }\r\n\r\n var bb = geom.size(node);\r\n\r\n // coordinates and size of node with specified corner placed at pos,\r\n // and clipped by viewport\r\n var\r\n startXpos = {\r\n 'L': pos.x,\r\n 'R': pos.x - bb.width,\r\n 'M': Math.max(view.left, Math.min(view.left + view.width, pos.x + (bb.width >> 1)) - bb.width) // M orientation is more flexible\r\n }[corner.charAt(1)],\r\n\r\n startYpos = {\r\n 'T': pos.y,\r\n 'B': pos.y - bb.height,\r\n 'M': Math.max(view.top, Math.min(view.top + view.height, pos.y + (bb.height >> 1)) - bb.height)\r\n }[corner.charAt(0)],\r\n\r\n startX = Math.max(view.left, startXpos),\r\n startY = Math.max(view.top, startYpos),\r\n endX = Math.min(view.left + view.width, startXpos + bb.width),\r\n endY = Math.min(view.top + view.height, startYpos + bb.height),\r\n width = endX - startX,\r\n height = endY - startY;\r\n\r\n overflow += (bb.width - width) + (bb.height - height);\r\n\r\n if(best == null || overflow < best.overflow){\r\n best = {\r\n corner: corner,\r\n aroundCorner: choice.aroundCorner,\r\n left: startX,\r\n top: startY,\r\n width: width,\r\n height: height,\r\n overflow: overflow,\r\n spaceAvailable: spaceAvailable\r\n };\r\n }\r\n\r\n return !overflow;\r\n });\r\n\r\n // In case the best position is not the last one we checked, need to call\r\n // layoutNode() again.\r\n if(best.overflow && layoutNode){\r\n layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);\r\n }\r\n\r\n\r\n geom.boundingPosition(node,best);\r\n\r\n return best;\r\n }\r\n\r\n function at(node, pos, corners, padding, layoutNode){\r\n var choices = map.apply(corners, function(corner){\r\n var c = {\r\n corner: corner,\r\n aroundCorner: reverse[corner], // so TooltipDialog.orient() gets aroundCorner argument set\r\n pos: {x: pos.x,y: pos.y}\r\n };\r\n if(padding){\r\n c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;\r\n c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;\r\n }\r\n return c;\r\n });\r\n\r\n return _place(node, choices, layoutNode);\r\n }\r\n\r\n function around(\r\n /*DomNode*/ node,\r\n /*DomNode|__Rectangle*/ anchor,\r\n /*String[]*/ positions,\r\n /*Boolean*/ leftToRight,\r\n /*Function?*/ layoutNode){\r\n\r\n // summary:\r\n // Position node adjacent or kitty-corner to anchor\r\n // such that it's fully visible in viewport.\r\n // description:\r\n // Place node such that corner of node touches a corner of\r\n // aroundNode, and that node is fully visible.\r\n // anchor:\r\n // Either a DOMNode or a rectangle (object with x, y, width, height).\r\n // positions:\r\n // Ordered list of positions to try matching up.\r\n //\r\n // - before: places drop down to the left of the anchor node/widget, or to the right in the case\r\n // of RTL scripts like Hebrew and Arabic; aligns either the top of the drop down\r\n // with the top of the anchor, or the bottom of the drop down with bottom of the anchor.\r\n // - after: places drop down to the right of the anchor node/widget, or to the left in the case\r\n // of RTL scripts like Hebrew and Arabic; aligns either the top of the drop down\r\n // with the top of the anchor, or the bottom of the drop down with bottom of the anchor.\r\n // - before-centered: centers drop down to the left of the anchor node/widget, or to the right\r\n // in the case of RTL scripts like Hebrew and Arabic\r\n // - after-centered: centers drop down to the right of the anchor node/widget, or to the left\r\n // in the case of RTL scripts like Hebrew and Arabic\r\n // - above-centered: drop down is centered above anchor node\r\n // - above: drop down goes above anchor node, left sides aligned\r\n // - above-alt: drop down goes above anchor node, right sides aligned\r\n // - below-centered: drop down is centered above anchor node\r\n // - below: drop down goes below anchor node\r\n // - below-alt: drop down goes below anchor node, right sides aligned\r\n // layoutNode: Function(node, aroundNodeCorner, nodeCorner)\r\n // For things like tooltip, they are displayed differently (and have different dimensions)\r\n // based on their orientation relative to the parent. This adjusts the popup based on orientation.\r\n // leftToRight:\r\n // True if widget is LTR, false if widget is RTL. Affects the behavior of \"above\" and \"below\"\r\n // positions slightly.\r\n // example:\r\n // | placeAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});\r\n // This will try to position node such that node's top-left corner is at the same position\r\n // as the bottom left corner of the aroundNode (ie, put node below\r\n // aroundNode, with left edges aligned). If that fails it will try to put\r\n // the bottom-right corner of node where the top right corner of aroundNode is\r\n // (ie, put node above aroundNode, with right edges aligned)\r\n //\r\n\r\n // If around is a DOMNode (or DOMNode id), convert to coordinates.\r\n var aroundNodePos;\r\n if(typeof anchor == \"string\" || \"offsetWidth\" in anchor || \"ownerSVGElement\" in anchor){\r\n aroundNodePos = domGeometry.position(anchor, true);\r\n\r\n // For above and below dropdowns, subtract width of border so that popup and aroundNode borders\r\n // overlap, preventing a double-border effect. Unfortunately, difficult to measure the border\r\n // width of either anchor or popup because in both cases the border may be on an inner node.\r\n if(/^(above|below)/.test(positions[0])){\r\n var anchorBorder = domGeometry.getBorderExtents(anchor),\r\n anchorChildBorder = anchor.firstChild ? domGeometry.getBorderExtents(anchor.firstChild) : {t:0,l:0,b:0,r:0},\r\n nodeBorder = domGeometry.getBorderExtents(node),\r\n nodeChildBorder = node.firstChild ? domGeometry.getBorderExtents(node.firstChild) : {t:0,l:0,b:0,r:0};\r\n aroundNodePos.y += Math.min(anchorBorder.t + anchorChildBorder.t, nodeBorder.t + nodeChildBorder.t);\r\n aroundNodePos.h -= Math.min(anchorBorder.t + anchorChildBorder.t, nodeBorder.t+ nodeChildBorder.t) +\r\n Math.min(anchorBorder.b + anchorChildBorder.b, nodeBorder.b + nodeChildBorder.b);\r\n }\r\n }else{\r\n aroundNodePos = anchor;\r\n }\r\n\r\n // Compute position and size of visible part of anchor (it may be partially hidden by ancestor nodes w/scrollbars)\r\n if(anchor.parentNode){\r\n // ignore nodes between position:relative and position:absolute\r\n var sawPosAbsolute = domStyle.getComputedStyle(anchor).position == \"absolute\";\r\n var parent = anchor.parentNode;\r\n while(parent && parent.nodeType == 1 && parent.nodeName != \"BODY\"){ //ignoring the body will help performance\r\n var parentPos = domGeometry.position(parent, true),\r\n pcs = domStyle.getComputedStyle(parent);\r\n if(/relative|absolute/.test(pcs.position)){\r\n sawPosAbsolute = false;\r\n }\r\n if(!sawPosAbsolute && /hidden|auto|scroll/.test(pcs.overflow)){\r\n var bottomYCoord = Math.min(aroundNodePos.y + aroundNodePos.h, parentPos.y + parentPos.h);\r\n var rightXCoord = Math.min(aroundNodePos.x + aroundNodePos.w, parentPos.x + parentPos.w);\r\n aroundNodePos.x = Math.max(aroundNodePos.x, parentPos.x);\r\n aroundNodePos.y = Math.max(aroundNodePos.y, parentPos.y);\r\n aroundNodePos.h = bottomYCoord - aroundNodePos.y;\r\n aroundNodePos.w = rightXCoord - aroundNodePos.x;\r\n }\r\n if(pcs.position == \"absolute\"){\r\n sawPosAbsolute = true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n } \r\n\r\n var x = aroundNodePos.x,\r\n y = aroundNodePos.y,\r\n width = \"w\" in aroundNodePos ? aroundNodePos.w : (aroundNodePos.w = aroundNodePos.width),\r\n height = \"h\" in aroundNodePos ? aroundNodePos.h : (kernel.deprecated(\"place.around: dijit/place.__Rectangle: { x:\"+x+\", y:\"+y+\", height:\"+aroundNodePos.height+\", width:\"+width+\" } has been deprecated. Please use { x:\"+x+\", y:\"+y+\", h:\"+aroundNodePos.height+\", w:\"+width+\" }\", \"\", \"2.0\"), aroundNodePos.h = aroundNodePos.height);\r\n\r\n // Convert positions arguments into choices argument for _place()\r\n var choices = [];\r\n function push(aroundCorner, corner){\r\n choices.push({\r\n aroundCorner: aroundCorner,\r\n corner: corner,\r\n pos: {\r\n x: {\r\n 'L': x,\r\n 'R': x + width,\r\n 'M': x + (width >> 1)\r\n }[aroundCorner.charAt(1)],\r\n y: {\r\n 'T': y,\r\n 'B': y + height,\r\n 'M': y + (height >> 1)\r\n }[aroundCorner.charAt(0)]\r\n }\r\n })\r\n }\r\n array.forEach(positions, function(pos){\r\n var ltr = leftToRight;\r\n switch(pos){\r\n case \"above-centered\":\r\n push(\"TM\", \"BM\");\r\n break;\r\n case \"below-centered\":\r\n push(\"BM\", \"TM\");\r\n break;\r\n case \"after-centered\":\r\n ltr = !ltr;\r\n // fall through\r\n case \"before-centered\":\r\n push(ltr ? \"ML\" : \"MR\", ltr ? \"MR\" : \"ML\");\r\n break;\r\n case \"after\":\r\n ltr = !ltr;\r\n // fall through\r\n case \"before\":\r\n push(ltr ? \"TL\" : \"TR\", ltr ? \"TR\" : \"TL\");\r\n push(ltr ? \"BL\" : \"BR\", ltr ? \"BR\" : \"BL\");\r\n break;\r\n case \"below-alt\":\r\n ltr = !ltr;\r\n // fall through\r\n case \"below\":\r\n // first try to align left borders, next try to align right borders (or reverse for RTL mode)\r\n push(ltr ? \"BL\" : \"BR\", ltr ? \"TL\" : \"TR\");\r\n push(ltr ? \"BR\" : \"BL\", ltr ? \"TR\" : \"TL\");\r\n break;\r\n case \"above-alt\":\r\n ltr = !ltr;\r\n // fall through\r\n case \"above\":\r\n // first try to align left borders, next try to align right borders (or reverse for RTL mode)\r\n push(ltr ? \"TL\" : \"TR\", ltr ? \"BL\" : \"BR\");\r\n push(ltr ? \"TR\" : \"TL\", ltr ? \"BR\" : \"BL\");\r\n break;\r\n default:\r\n // To assist dijit/_base/place, accept arguments of type {aroundCorner: \"BL\", corner: \"TL\"}.\r\n // Not meant to be used directly. Remove for 2.0.\r\n push(pos.aroundCorner, pos.corner);\r\n }\r\n });\r\n\r\n var position = _place(node, choices, layoutNode, {w: width, h: height});\r\n position.aroundNodePos = aroundNodePos;\r\n\r\n return position;\r\n }\r\n\r\n function movable(elm, params) {\r\n function updateWithTouchData(e) {\r\n var keys, i;\r\n\r\n if (e.changedTouches) {\r\n keys = \"screenX screenY pageX pageY clientX clientY\".split(' ');\r\n for (i = 0; i < keys.length; i++) {\r\n e[keys[i]] = e.changedTouches[0][keys[i]];\r\n }\r\n }\r\n }\r\n\r\n params = params || {};\r\n var handleEl = params.handle || elm,\r\n constraints = params.constraints,\r\n overlayDiv,\r\n doc = params.document || document,\r\n downButton,\r\n start,\r\n stop,\r\n drag,\r\n startX,\r\n startY,\r\n originalPos,\r\n size,\r\n startedCallback = params.started,\r\n movingCallback = params.moving,\r\n stoppedCallback = params.stopped,\r\n\r\n start = function(e) {\r\n var docSize = geom.getDocumentSize(doc),\r\n cursor;\r\n\r\n updateWithTouchData(e);\r\n\r\n e.preventDefault();\r\n downButton = e.button;\r\n //handleEl = getHandleEl();\r\n startX = e.screenX;\r\n startY = e.screenY;\r\n\r\n originalPos = geom.relativePosition(elm);\r\n size = geom.size(elm);\r\n\r\n // Grab cursor from handle so we can place it on overlay\r\n cursor = styler.css(handleEl, \"curosr\");\r\n\r\n overlayDiv = noder.createElement(\"div\");\r\n styler.css(overlayDiv, {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: docSize.width,\r\n height: docSize.height,\r\n zIndex: 0x7FFFFFFF,\r\n opacity: 0.0001,\r\n cursor: cursor\r\n });\r\n noder.append(doc.body, overlayDiv);\r\n\r\n eventer.on(doc, \"mousemove touchmove\", move).on(doc, \"mouseup touchend\", stop);\r\n\r\n if (startedCallback) {\r\n startedCallback(e);\r\n }\r\n },\r\n\r\n move = function(e) {\r\n updateWithTouchData(e);\r\n\r\n if (e.button !== 0) {\r\n return stop(e);\r\n }\r\n\r\n e.deltaX = e.screenX - startX;\r\n e.deltaY = e.screenY - startY;\r\n\r\n var l = originalPos.left + e.deltaX,\r\n t = originalPos.top + e.deltaY;\r\n if (constraints) {\r\n\r\n if (l < constraints.minX) {\r\n l = constraints.minX;\r\n }\r\n\r\n if (l > constraints.maxX) {\r\n l = constraints.maxX;\r\n }\r\n\r\n if (t < constraints.minY) {\r\n t = constraints.minY;\r\n }\r\n\r\n if (t > constraints.maxY) {\r\n t = constraints.maxY;\r\n }\r\n }\r\n geom.relativePosition(elm, {\r\n left: l,\r\n top: t\r\n })\r\n\r\n e.preventDefault();\r\n if (movingCallback) {\r\n movingCallback(e);\r\n }\r\n },\r\n\r\n stop = function(e) {\r\n updateWithTouchData(e);\r\n\r\n eventer.off(doc, \"mousemove touchmove\", move).off(doc, \"mouseup touchend\", stop);\r\n\r\n noder.remove(overlayDiv);\r\n\r\n if (stoppedCallback) {\r\n stoppedCallback(e);\r\n }\r\n };\r\n\r\n eventer.on(handleEl, \"mousedown touchstart\", start);\r\n\r\n return {\r\n // destroys the dragger.\r\n remove: function() {\r\n eventer.off(handleEl);\r\n }\r\n }\r\n }\r\n\r\n function mover(){\r\n return mover;\r\n }\r\n\r\n langx.mixin(mover, {\r\n around : around,\r\n\r\n at: at, \r\n\r\n movable: movable\r\n\r\n });\r\n\r\n return skylark.mover = mover;\r\n});\r\n\ndefine('skylarkjs/mover',[\r\n \"skylark-utils/mover\"\r\n], function(mover) {\r\n return mover;\r\n});\r\n\ndefine('skylarkjs/noder',[\r\n \"skylark-utils/noder\"\r\n], function(noder) {\r\n return noder;\r\n});\r\n\ndefine('skylark-utils/query',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\",\r\n \"./datax\",\r\n \"./eventer\",\r\n \"./finder\",\r\n \"./geom\",\r\n \"./styler\",\r\n \"./fx\"\r\n], function(skylark, langx, noder, datax, eventer, finder, geom, styler, fx) {\r\n var some = Array.prototype.some,\r\n push = Array.prototype.push,\r\n every = Array.prototype.every,\r\n concat = Array.prototype.concat,\r\n slice = Array.prototype.slice,\r\n map = Array.prototype.map,\r\n filter = Array.prototype.filter,\r\n forEach = Array.prototype.forEach,\r\n isQ;\r\n\r\n var rquickExpr = /^(?:[^#<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)/;\r\n\r\n var funcArg = langx.funcArg,\r\n isArrayLike = langx.isArrayLike,\r\n isString = langx.isString,\r\n uniq = langx.uniq,\r\n isFunction = langx.isFunction;\r\n\r\n var type = langx.type,\r\n isArray = langx.isArray,\r\n\r\n isWindow = langx.isWindow,\r\n\r\n isDocument = langx.isDocument,\r\n\r\n isObject = langx.isObject,\r\n\r\n isPlainObject = langx.isPlainObject,\r\n\r\n compact = langx.compact,\r\n\r\n flatten = langx.flatten,\r\n\r\n camelCase = langx.camelCase,\r\n\r\n dasherize = langx.dasherize,\r\n children = finder.children;\r\n\r\n function wrapper_map(func, context) {\r\n return function() {\r\n var self = this,\r\n params = slice.call(arguments);\r\n var result = $.map(self, function(elem, idx) {\r\n return func.apply(context, [elem].concat(params));\r\n });\r\n return $(uniq(result));\r\n }\r\n }\r\n\r\n function wrapper_selector(func, context, last) {\r\n return function(selector) {\r\n var self = this,\r\n params = slice.call(arguments);\r\n var result = this.map(function(idx, elem) {\r\n // if (elem.nodeType == 1) {\r\n if (elem.querySelector) {\r\n return func.apply(context, last ? [elem] : [elem, selector]);\r\n }\r\n });\r\n if (last && selector) {\r\n return result.filter(selector);\r\n } else {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n function wrapper_selector_until(func, context, last) {\r\n return function(util, selector) {\r\n var self = this,\r\n params = slice.call(arguments);\r\n if (selector === undefined) {\r\n selector = util;\r\n util = undefined;\r\n }\r\n var result = this.map(function(idx, elem) {\r\n // if (elem.nodeType == 1) {\r\n if (elem.querySelector) {\r\n return func.apply(context, last ? [elem, util] : [elem, selector, util]);\r\n }\r\n });\r\n if (last && selector) {\r\n return result.filter(selector);\r\n } else {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n\r\n function wrapper_every_act(func, context) {\r\n return function() {\r\n var self = this,\r\n params = slice.call(arguments);\r\n this.each(function(idx) {\r\n func.apply(context, [this].concat(params));\r\n });\r\n return self;\r\n }\r\n }\r\n\r\n function wrapper_every_act_firstArgFunc(func, context, oldValueFunc) {\r\n return function(arg1) {\r\n var self = this,\r\n params = slice.call(arguments);\r\n forEach.call(self, function(elem, idx) {\r\n var newArg1 = funcArg(elem, arg1, idx, oldValueFunc(elem));\r\n func.apply(context, [elem, arg1].concat(params.slice(1)));\r\n });\r\n return self;\r\n }\r\n }\r\n\r\n function wrapper_some_chk(func, context) {\r\n return function() {\r\n var self = this,\r\n params = slice.call(arguments);\r\n return some.call(self, function(elem) {\r\n return func.apply(context, [elem].concat(params));\r\n });\r\n }\r\n }\r\n\r\n function wrapper_name_value(func, context, oldValueFunc) {\r\n return function(name, value) {\r\n var self = this,\r\n params = slice.call(arguments);\r\n\r\n if (langx.isPlainObject(name) || langx.isDefined(value)) {\r\n forEach.call(self, function(elem, idx) {\r\n var newValue;\r\n if (oldValueFunc) {\r\n newValue = funcArg(elem, value, idx, oldValueFunc(elem, name));\r\n } else {\r\n newValue = value\r\n }\r\n func.apply(context, [elem].concat(params));\r\n });\r\n return self;\r\n } else {\r\n if (self[0]) {\r\n return func.apply(context, [self[0], name]);\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n function wrapper_value(func, context, oldValueFunc) {\r\n return function(value) {\r\n var self = this;\r\n\r\n if (langx.isDefined(value)) {\r\n forEach.call(self, function(elem, idx) {\r\n var newValue;\r\n if (oldValueFunc) {\r\n newValue = funcArg(elem, value, idx, oldValueFunc(elem));\r\n } else {\r\n newValue = value\r\n }\r\n func.apply(context, [elem, newValue]);\r\n });\r\n return self;\r\n } else {\r\n if (self[0]) {\r\n return func.apply(context, [self[0]]);\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n var NodeList = langx.klass({\r\n klassName: \"SkNodeList\",\r\n init: function(selector, context) {\r\n var self = this,\r\n match, nodes, node, props;\r\n\r\n if (selector) {\r\n self.context = context = context || noder.doc();\r\n\r\n if (isString(selector)) {\r\n // a html string or a css selector is expected\r\n self.selector = selector;\r\n\r\n if (selector.charAt(0) === \"<\" && selector.charAt(selector.length - 1) === \">\" && selector.length >= 3) {\r\n match = [null, selector, null];\r\n } else {\r\n match = rquickExpr.exec(selector);\r\n }\r\n\r\n if (match) {\r\n if (match[1]) {\r\n // if selector is html\r\n nodes = noder.createFragment(selector);\r\n\r\n if (langx.isPlainObject(context)) {\r\n props = context;\r\n }\r\n\r\n } else {\r\n node = finder.byId(match[2], noder.ownerDoc(context));\r\n\r\n if (node) {\r\n // if selector is id\r\n nodes = [node];\r\n }\r\n\r\n }\r\n } else {\r\n // if selector is css selector\r\n nodes = finder.descendants(context, selector);\r\n }\r\n } else {\r\n if (isArray(selector)) {\r\n // a dom node array is expected\r\n nodes = selector;\r\n } else {\r\n // a dom node is expected\r\n nodes = [selector];\r\n }\r\n //self.add(selector, false);\r\n }\r\n }\r\n\r\n\r\n if (nodes) {\r\n\r\n push.apply(self, nodes);\r\n\r\n if (props) {\r\n for ( var name in props ) {\r\n // Properties of context are called as methods if possible\r\n if ( langx.isFunction( this[ name ] ) ) {\r\n this[ name ]( props[ name ] );\r\n } else {\r\n this.attr( name, props[ name ] );\r\n }\r\n }\r\n }\r\n }\r\n\r\n return self;\r\n }\r\n }, Array);\r\n\r\n var query = (function() {\r\n isQ = function(object) {\r\n return object instanceof NodeList;\r\n }\r\n init = function(selector, context) {\r\n return new NodeList(selector, context);\r\n }\r\n\r\n var $ = function(selector, context) {\r\n if (isFunction(selector)) {\r\n eventer.ready(function() {\r\n selector($);\r\n });\r\n } else if (isQ(selector)) {\r\n return selector;\r\n } else {\r\n if (context && isQ(context) && isString(selector)) {\r\n return context.find(selector);\r\n }\r\n return init(selector, context);\r\n }\r\n };\r\n\r\n $.fn = NodeList.prototype;\r\n langx.mixin($.fn, {\r\n // `map` and `slice` in the jQuery API work differently\r\n // from their array counterparts\r\n\r\n map: function(fn) {\r\n return $(uniq(langx.map(this, function(el, i) {\r\n return fn.call(el, i, el)\r\n })));\r\n },\r\n\r\n slice: function() {\r\n return $(slice.apply(this, arguments))\r\n },\r\n\r\n get: function(idx) {\r\n return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\r\n },\r\n\r\n toArray: function() {\r\n return slice.call(this);\r\n },\r\n\r\n size: function() {\r\n return this.length\r\n },\r\n\r\n remove: wrapper_every_act(noder.remove, noder),\r\n\r\n each: function(callback) {\r\n langx.each(this, callback);\r\n return this;\r\n },\r\n\r\n filter: function(selector) {\r\n if (isFunction(selector)) return this.not(this.not(selector))\r\n return $(filter.call(this, function(element) {\r\n return finder.matches(element, selector)\r\n }))\r\n },\r\n\r\n add: function(selector, context) {\r\n return $(uniq(this.toArray().concat($(selector, context).toArray())));\r\n },\r\n\r\n is: function(selector) {\r\n return this.length > 0 && finder.matches(this[0], selector)\r\n },\r\n\r\n not: function(selector) {\r\n var nodes = []\r\n if (isFunction(selector) && selector.call !== undefined)\r\n this.each(function(idx) {\r\n if (!selector.call(this, idx)) nodes.push(this)\r\n })\r\n else {\r\n var excludes = typeof selector == 'string' ? this.filter(selector) :\r\n (isArrayLike(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\r\n this.forEach(function(el) {\r\n if (excludes.indexOf(el) < 0) nodes.push(el)\r\n })\r\n }\r\n return $(nodes)\r\n },\r\n\r\n has: function(selector) {\r\n return this.filter(function() {\r\n return isObject(selector) ?\r\n noder.contains(this, selector) :\r\n $(this).find(selector).size()\r\n })\r\n },\r\n\r\n eq: function(idx) {\r\n return idx === -1 ? this.slice(idx) : this.slice(idx, +idx + 1);\r\n },\r\n\r\n first: function() {\r\n return this.eq(0);\r\n },\r\n\r\n last: function() {\r\n return this.eq(-1);\r\n },\r\n\r\n find: wrapper_selector(finder.descendants, finder),\r\n\r\n closest: wrapper_selector(finder.closest, finder),\r\n /*\r\n closest: function(selector, context) {\r\n var node = this[0],\r\n collection = false\r\n if (typeof selector == 'object') collection = $(selector)\r\n while (node && !(collection ? collection.indexOf(node) >= 0 : finder.matches(node, selector)))\r\n node = node !== context && !isDocument(node) && node.parentNode\r\n return $(node)\r\n },\r\n */\r\n\r\n\r\n parents: wrapper_selector(finder.ancestors, finder),\r\n\r\n parentsUntil: wrapper_selector_until(finder.ancestors, finder),\r\n\r\n\r\n parent: wrapper_selector(finder.parent, finder),\r\n\r\n children: wrapper_selector(finder.children, finder),\r\n\r\n contents: wrapper_map(noder.contents, noder),\r\n\r\n empty: wrapper_every_act(noder.empty, noder),\r\n\r\n // `pluck` is borrowed from Prototype.js\r\n pluck: function(property) {\r\n return langx.map(this, function(el) {\r\n return el[property]\r\n })\r\n },\r\n\r\n show: wrapper_every_act(fx.show, fx),\r\n\r\n replaceWith: function(newContent) {\r\n return this.before(newContent).remove();\r\n },\r\n\r\n wrap: function(structure) {\r\n var func = isFunction(structure)\r\n if (this[0] && !func)\r\n var dom = $(structure).get(0),\r\n clone = dom.parentNode || this.length > 1\r\n\r\n return this.each(function(index) {\r\n $(this).wrapAll(\r\n func ? structure.call(this, index) :\r\n clone ? dom.cloneNode(true) : dom\r\n )\r\n })\r\n },\r\n\r\n wrapAll: function(wrappingElement) {\r\n if (this[0]) {\r\n $(this[0]).before(wrappingElement = $(wrappingElement));\r\n var children;\r\n // drill down to the inmost element\r\n while ((children = wrappingElement.children()).length) {\r\n wrappingElement = children.first();\r\n }\r\n $(wrappingElement).append(this);\r\n }\r\n return this\r\n },\r\n\r\n wrapInner: function(wrappingElement) {\r\n var func = isFunction(wrappingElement)\r\n return this.each(function(index) {\r\n var self = $(this),\r\n contents = self.contents(),\r\n dom = func ? wrappingElement.call(this, index) : wrappingElement\r\n contents.length ? contents.wrapAll(dom) : self.append(dom)\r\n })\r\n },\r\n\r\n unwrap: function(selector) {\r\n if (this.parent().children().length === 0) {\r\n // remove dom without text\r\n this.parent(selector).not(\"body\").each(function() {\r\n $(this).replaceWith(document.createTextNode(this.childNodes[0].textContent));\r\n });\r\n } else {\r\n this.parent().each(function() {\r\n $(this).replaceWith($(this).children())\r\n });\r\n }\r\n return this\r\n },\r\n\r\n clone: function() {\r\n return this.map(function() {\r\n return this.cloneNode(true)\r\n })\r\n },\r\n\r\n hide: wrapper_every_act(fx.hide, fx),\r\n\r\n toggle: function(setting) {\r\n return this.each(function() {\r\n var el = $(this);\r\n (setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show(): el.hide()\r\n })\r\n },\r\n\r\n prev: function(selector) {\r\n return $(this.pluck('previousElementSibling')).filter(selector || '*')\r\n },\r\n\r\n prevAll: wrapper_selector(finder.previousSibling, finder),\r\n\r\n next: function(selector) {\r\n return $(this.pluck('nextElementSibling')).filter(selector || '*')\r\n },\r\n\r\n nextAll: wrapper_selector(finder.nextSiblings, finder),\r\n\r\n siblings: wrapper_selector(finder.siblings, finder),\r\n\r\n html: wrapper_value(noder.html, noder, noder.html),\r\n\r\n text: wrapper_value(datax.text, datax, datax.text),\r\n\r\n attr: wrapper_name_value(datax.attr, datax, datax.attr),\r\n\r\n removeAttr: wrapper_every_act(datax.removeAttr, datax),\r\n\r\n prop: wrapper_name_value(datax.prop, datax, datax.prop),\r\n\r\n removeProp: wrapper_every_act(datax.removeProp, datax),\r\n\r\n data: wrapper_name_value(datax.data, datax, datax.data),\r\n\r\n removeData: wrapper_every_act(datax.removeData, datax),\r\n\r\n val: wrapper_value(datax.val, datax, datax.val),\r\n\r\n offset: wrapper_value(geom.pageRect, geom, geom.pageRect),\r\n\r\n style: wrapper_name_value(styler.css, styler),\r\n\r\n css: wrapper_name_value(styler.css, styler),\r\n\r\n index: function(elem) {\r\n if (elem) {\r\n return this.indexOf($(elem)[0]);\r\n } else {\r\n return this.parent().children().indexOf(this[0]);\r\n }\r\n },\r\n\r\n //hasClass(name)\r\n hasClass: wrapper_some_chk(styler.hasClass, styler),\r\n\r\n //addClass(name)\r\n addClass: wrapper_every_act_firstArgFunc(styler.addClass, styler, styler.className),\r\n\r\n //removeClass(name)\r\n removeClass: wrapper_every_act_firstArgFunc(styler.removeClass, styler, styler.className),\r\n\r\n //toogleClass(name,when)\r\n toggleClass: wrapper_every_act_firstArgFunc(styler.toggleClass, styler, styler.className),\r\n\r\n scrollTop: wrapper_value(geom.scrollTop, geom),\r\n\r\n scrollLeft: wrapper_value(geom.scrollLeft, geom),\r\n\r\n position: function() {\r\n if (!this.length) return\r\n\r\n var elem = this[0];\r\n\r\n return geom.relativePosition(elem);\r\n },\r\n\r\n offsetParent: wrapper_map(geom.offsetParent, geom),\r\n });\r\n\r\n // for now\r\n $.fn.detach = $.fn.remove;\r\n\r\n\r\n $.fn.size = wrapper_value(geom.size, geom);\r\n\r\n $.fn.width = wrapper_value(geom.width, geom, geom.width);\r\n\r\n $.fn.height = wrapper_value(geom.height, geom, geom.height);\r\n\r\n ['width', 'height'].forEach(function(dimension) {\r\n var offset, Dimension = dimension.replace(/./, function(m) {\r\n return m[0].toUpperCase()\r\n });\r\n\r\n $.fn['outer' + Dimension] = function(margin, value) {\r\n if (arguments.length) {\r\n if (typeof margin !== 'boolean') {\r\n value = margin;\r\n margin = false;\r\n }\r\n } else {\r\n margin = false;\r\n value = undefined;\r\n }\r\n\r\n if (value === undefined) {\r\n var el = this[0];\r\n if (!el) {\r\n return undefined;\r\n }\r\n var cb = geom.size(el);\r\n if (margin) {\r\n var me = geom.marginExtents(el);\r\n cb.width = cb.width + me.left + me.right;\r\n cb.height = cb.height + me.top + me.bottom;\r\n }\r\n return dimension === \"width\" ? cb.width : cb.height;\r\n } else {\r\n return this.each(function(idx, el) {\r\n var mb = {};\r\n var me = geom.marginExtents(el);\r\n if (dimension === \"width\") {\r\n mb.width = value;\r\n if (margin) {\r\n mb.width = mb.width - me.left - me.right\r\n }\r\n } else {\r\n mb.height = value;\r\n if (margin) {\r\n mb.height = mb.height - me.top - me.bottom;\r\n }\r\n }\r\n geom.size(el, mb);\r\n })\r\n\r\n }\r\n };\r\n })\r\n\r\n $.fn.innerWidth = wrapper_value(geom.width, geom, geom.width);\r\n\r\n $.fn.innerHeight = wrapper_value(geom.height, geom, geom.height);\r\n\r\n\r\n var traverseNode = noder.traverse;\r\n\r\n function wrapper_node_operation(func, context, oldValueFunc) {\r\n return function(html) {\r\n var argType, nodes = langx.map(arguments, function(arg) {\r\n argType = type(arg)\r\n return argType == \"object\" || argType == \"array\" || arg == null ?\r\n arg : noder.createFragment(arg)\r\n });\r\n if (nodes.length < 1) {\r\n return this\r\n }\r\n this.each(function(idx) {\r\n func.apply(context, [this, nodes, idx > 0]);\r\n });\r\n return this;\r\n }\r\n }\r\n\r\n\r\n $.fn.after = wrapper_node_operation(noder.after, noder);\r\n\r\n $.fn.prepend = wrapper_node_operation(noder.prepend, noder);\r\n\r\n $.fn.before = wrapper_node_operation(noder.before, noder);\r\n\r\n $.fn.append = wrapper_node_operation(noder.append, noder);\r\n\r\n $.fn.insertAfter = function(html) {\r\n $(html).after(this);\r\n return this;\r\n };\r\n\r\n $.fn.insertBefore = function(html) {\r\n $(html).before(this);\r\n return this;\r\n };\r\n\r\n $.fn.appendTo = function(html) {\r\n $(html).append(this);\r\n return this;\r\n };\r\n\r\n $.fn.prependTo = function(html) {\r\n $(html).prepend(this);\r\n return this;\r\n };\r\n\r\n return $\r\n })();\r\n\r\n (function($) {\r\n $.fn.on = wrapper_every_act(eventer.on, eventer);\r\n\r\n $.fn.off = wrapper_every_act(eventer.off, eventer);\r\n\r\n $.fn.trigger = wrapper_every_act(eventer.trigger, eventer);\r\n\r\n\r\n ('focusin focusout focus blur load resize scroll unload click dblclick ' +\r\n 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave ' +\r\n 'change select keydown keypress keyup error').split(' ').forEach(function(event) {\r\n $.fn[event] = function(data, callback) {\r\n return (0 in arguments) ?\r\n this.on(event, data, callback) :\r\n this.trigger(event)\r\n }\r\n });\r\n\r\n\r\n $.fn.one = function(event, selector, data, callback) {\r\n if (!langx.isString(selector) && !langx.isFunction(callback)) {\r\n callback = data;\r\n data = selector;\r\n selector = null;\r\n }\r\n\r\n if (langx.isFunction(data)) {\r\n callback = data;\r\n data = null;\r\n }\r\n\r\n return this.on(event, selector, data, callback, 1)\r\n };\r\n\r\n $.fn.animate = wrapper_every_act(fx.animate, fx);\r\n\r\n $.fn.show = wrapper_every_act(fx.show, fx);\r\n $.fn.hide = wrapper_every_act(fx.hide, fx);\r\n $.fn.toogle = wrapper_every_act(fx.toogle, fx);\r\n $.fn.fadeTo = wrapper_every_act(fx.fadeTo, fx);\r\n $.fn.fadeIn = wrapper_every_act(fx.fadeIn, fx);\r\n $.fn.fadeOut = wrapper_every_act(fx.fadeOut, fx);\r\n $.fn.fadeToggle = wrapper_every_act(fx.fadeToggle, fx);\r\n\r\n $.fn.slideDown = wrapper_every_act(fx.slideDown, fx);\r\n $.fn.slideToggle = wrapper_every_act(fx.slideToggle, fx);\r\n $.fn.slideUp = wrapper_every_act(fx.slideUp, fx);\r\n })(query);\r\n\r\n\r\n (function($) {\r\n $.fn.end = function() {\r\n return this.prevObject || $()\r\n }\r\n\r\n $.fn.andSelf = function() {\r\n return this.add(this.prevObject || $())\r\n }\r\n\r\n $.fn.addBack = function(selector) {\r\n if (this.prevObject) {\r\n if (selector) {\r\n return this.add(this.prevObject.filter(selector));\r\n } else {\r\n return this.add(this.prevObject);\r\n }\r\n } else {\r\n return this;\r\n }\r\n }\r\n\r\n 'filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings'.split(',').forEach(function(property) {\r\n var fn = $.fn[property]\r\n $.fn[property] = function() {\r\n var ret = fn.apply(this, arguments)\r\n ret.prevObject = this\r\n return ret\r\n }\r\n })\r\n })(query);\r\n\r\n\r\n (function($) {\r\n $.fn.query = $.fn.find;\r\n\r\n $.fn.place = function(refNode, position) {\r\n // summary:\r\n // places elements of this node list relative to the first element matched\r\n // by queryOrNode. Returns the original NodeList. See: `dojo/dom-construct.place`\r\n // queryOrNode:\r\n // may be a string representing any valid CSS3 selector or a DOM node.\r\n // In the selector case, only the first matching element will be used\r\n // for relative positioning.\r\n // position:\r\n // can be one of:\r\n //\r\n // - \"last\" (default)\r\n // - \"first\"\r\n // - \"before\"\r\n // - \"after\"\r\n // - \"only\"\r\n // - \"replace\"\r\n //\r\n // or an offset in the childNodes\r\n if (langx.isString(refNode)) {\r\n refNode = finder.descendant(refNode);\r\n } else if (isQ(refNode)) {\r\n refNode = refNode[0];\r\n }\r\n return this.each(function(i, node) {\r\n switch (position) {\r\n case \"before\":\r\n noder.before(refNode, node);\r\n break;\r\n case \"after\":\r\n noder.after(refNode, node);\r\n break;\r\n case \"replace\":\r\n noder.replace(refNode, node);\r\n break;\r\n case \"only\":\r\n noder.empty(refNode);\r\n noder.append(refNode, node);\r\n break;\r\n case \"first\":\r\n noder.prepend(refNode, node);\r\n break;\r\n // else fallthrough...\r\n default: // aka: last\r\n noder.append(refNode, node);\r\n }\r\n });\r\n };\r\n\r\n $.fn.addContent = function(content, position) {\r\n if (content.template) {\r\n content = langx.substitute(content.template, content);\r\n }\r\n return this.append(content);\r\n };\r\n\r\n $.fn.replaceClass = function(newClass, oldClass) {\r\n this.removeClass(oldClass);\r\n this.addClass(newClass);\r\n return this;\r\n };\r\n\r\n })(query);\r\n\r\n\r\n return skylark.query = query;\r\n});\ndefine('skylarkjs/query',[\r\n \"skylark-utils/query\"\r\n], function(query) {\r\n return query;\r\n});\r\n\ndefine('skylark-utils/scripter',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\",\r\n \"./finder\"\r\n], function(skylark, langx, noder, finder) {\r\n\r\n var head = document.getElementsByTagName('head')[0],\r\n scriptsByUrl = {},\r\n scriptElementsById = {},\r\n count = 0;\r\n\r\n function scripter() {\r\n return scripter;\r\n }\r\n\r\n langx.mixin(scripter, {\r\n\r\n loadJavaScript: function(url, loadedCallback, errorCallback) {\r\n var script = scriptsByUrl[url];\r\n if (!script) {\r\n script = scriptsByUrl[url] = {\r\n state: 0, //0:unload,1:loaded,-1:loaderror\r\n loadedCallbacks: [],\r\n errorCallbacks: []\r\n }\r\n }\r\n\r\n script.loadedCallbacks.push(loadedCallback);\r\n script.errorCallbacks.push(errorCallback);\r\n\r\n if (script.state === 1) {\r\n script.node.onload();\r\n } else if (script.state === -1) {\r\n script.node.onerror();\r\n } else {\r\n var node = script.node = document.createElement(\"script\"),\r\n id = script.id = (count++);\r\n\r\n node.type = \"text/javascript\";\r\n node.async = false;\r\n node.defer = false;\r\n startTime = new Date().getTime();\r\n head.appendChild(node);\r\n\r\n node.onload = function() {\r\n script.state = 1;\r\n\r\n var callbacks = script.loadedCallbacks,\r\n i = callbacks.length;\r\n\r\n while (i--) {\r\n callbacks[i]();\r\n }\r\n script.loadedCallbacks = [];\r\n script.errorCallbacks = [];\r\n },\r\n node.onerror = function() {\r\n script.state = -1;\r\n var callbacks = script.errorCallbacks,\r\n i = callbacks.length;\r\n\r\n while (i--) {\r\n callbacks[i]();\r\n }\r\n script.loadedCallbacks = [];\r\n script.errorCallbacks = [];\r\n };\r\n node.src = url;\r\n\r\n scriptElementsById[id] = node;\r\n }\r\n return script.id;\r\n },\r\n\r\n deleteJavaScript: function(id) {\r\n var node = scriptElementsById[id];\r\n if (node) {\r\n var url = node.src;\r\n noder.remove(node);\r\n delete scriptElementsById[id];\r\n delete scriptsByUrl[url];\r\n }\r\n }\r\n });\r\n\r\n return skylark.scripter = scripter;\r\n});\r\n\ndefine('skylarkjs/scripter',[\r\n \"skylark-utils/scripter\"\r\n], function(scripter) {\r\n return scripter;\r\n});\r\n\ndefine('skylarkjs/styler',[\r\n \"skylark-utils/styler\"\r\n], function(styler) {\r\n return styler;\r\n});\r\n\ndefine('skylark-utils/velm',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./datax\",\r\n \"./dnd\",\r\n \"./eventer\",\r\n \"./filer\",\r\n \"./finder\",\r\n \"./fx\",\r\n \"./geom\",\r\n \"./mover\",\r\n \"./noder\",\r\n \"./styler\"\r\n], function(skylark, langx, datax, dnd, eventer, filer, finder, fx, geom, mover, noder, styler) {\r\n var map = Array.prototype.map,\r\n slice = Array.prototype.slice;\r\n\r\n var VisualElement = langx.klass({\r\n klassName: \"VisualElement\",\r\n\r\n \"init\": function(node) {\r\n if (langx.isString(node)) {\r\n node = document.getElementById(node);\r\n }\r\n this.domNode = node;\r\n }\r\n });\r\n\r\n var root = new VisualElement(document.body),\r\n velm = function(node) {\r\n if (node) {\r\n return new VisualElement(node);\r\n } else {\r\n return root;\r\n }\r\n };\r\n\r\n function _delegator(fn, context) {\r\n return function() {\r\n var self = this,\r\n elem = self.domNode,\r\n ret = fn.apply(context, [elem].concat(slice.call(arguments)));\r\n\r\n if (ret) {\r\n if (ret === context) {\r\n return self;\r\n } else {\r\n if (ret instanceof HTMLElement) {\r\n ret = new VisualElement(ret);\r\n } else if (langx.isArrayLike(ret)) {\r\n ret = map.call(ret, function(el) {\r\n if (el instanceof HTMLElement) {\r\n return new VisualElement(ret);\r\n } else {\r\n return el;\r\n }\r\n })\r\n }\r\n }\r\n }\r\n return ret;\r\n };\r\n }\r\n\r\n langx.mixin(velm, {\r\n batch: function(nodes, action, args) {\r\n nodes.forEach(function(node) {\r\n var elm = (node instanceof VisualElement) ? node : velm(node);\r\n elm[action].apply(elm, args);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n root: new VisualElement(document.body),\r\n\r\n VisualElement: VisualElement,\r\n\r\n partial : function(name,fn) {\r\n var props = {};\r\n\r\n props[name] = fn;\r\n\r\n VisualElement.partial(props);\r\n },\r\n\r\n delegate: function(names, context) {\r\n var props = {};\r\n\r\n names.forEach(function(name) {\r\n props[name] = _delegator(context[name], context);\r\n });\r\n\r\n VisualElement.partial(props);\r\n }\r\n });\r\n\r\n // from ./datax\r\n velm.delegate([\r\n \"attr\",\r\n \"data\",\r\n \"prop\",\r\n \"removeAttr\",\r\n \"removeData\",\r\n \"text\",\r\n \"val\"\r\n ], datax);\r\n\r\n // from ./dnd\r\n velm.delegate([\r\n \"draggable\",\r\n \"droppable\"\r\n ], dnd);\r\n\r\n\r\n // from ./eventer\r\n velm.delegate([\r\n \"off\",\r\n \"on\",\r\n \"one\",\r\n \"shortcuts\",\r\n \"trigger\"\r\n ], eventer);\r\n\r\n // from ./filer\r\n velm.delegate([\r\n \"picker\",\r\n \"dropzone\"\r\n ], filer);\r\n\r\n // from ./finder\r\n velm.delegate([\r\n \"ancestor\",\r\n \"ancestors\",\r\n \"children\",\r\n \"descendant\",\r\n \"find\",\r\n \"findAll\",\r\n \"firstChild\",\r\n \"lastChild\",\r\n \"matches\",\r\n \"nextSibling\",\r\n \"nextSiblings\",\r\n \"parent\",\r\n \"previousSibling\",\r\n \"previousSiblings\",\r\n \"siblings\"\r\n ], finder);\r\n\r\n velm.find = function(selector) {\r\n if (selector === \"body\") {\r\n return this.root;\r\n } else {\r\n return this.root.descendant(selector);\r\n }\r\n };\r\n\r\n // from ./fx\r\n velm.delegate([\r\n \"animate\",\r\n \"fadeIn\",\r\n \"fadeOut\",\r\n \"fadeTo\",\r\n \"fadeToggle\",\r\n \"hide\",\r\n \"scrollToTop\",\r\n \"show\",\r\n \"toggle\"\r\n ], fx);\r\n\r\n\r\n // from ./geom\r\n velm.delegate([\r\n \"borderExtents\",\r\n \"boundingPosition\",\r\n \"boundingRect\",\r\n \"clientHeight\",\r\n \"clientSize\",\r\n \"clientWidth\",\r\n \"contentRect\",\r\n \"height\",\r\n \"marginExtents\",\r\n \"offsetParent\",\r\n \"paddingExtents\",\r\n \"pagePosition\",\r\n \"pageRect\",\r\n \"relativePosition\",\r\n \"relativeRect\",\r\n \"scrollIntoView\",\r\n \"scrollLeft\",\r\n \"scrollTop\",\r\n \"size\",\r\n \"width\"\r\n ], geom);\r\n\r\n // from ./mover\r\n velm.delegate([\r\n \"movable\"\r\n ], dnd);\r\n\r\n\r\n // from ./noder\r\n velm.delegate([\r\n \"after\",\r\n \"append\",\r\n \"before\",\r\n \"clone\",\r\n \"contains\",\r\n \"contents\",\r\n \"empty\",\r\n \"html\",\r\n \"isChildOf\",\r\n \"ownerDoc\",\r\n \"prepend\",\r\n \"remove\",\r\n \"replace\",\r\n \"reverse\",\r\n \"throb\",\r\n \"traverse\",\r\n \"wrapper\",\r\n \"wrapperInner\",\r\n \"unwrap\"\r\n ], noder);\r\n\r\n // from ./styler\r\n velm.delegate([\r\n \"addClass\",\r\n \"className\",\r\n \"css\",\r\n \"hasClass\",\r\n \"hide\",\r\n \"isInvisible\",\r\n \"removeClass\",\r\n \"show\",\r\n \"toggleClass\"\r\n ], styler);\r\n \r\n return skylark.velm = velm;\r\n});\r\n\ndefine('skylarkjs/velm',[\r\n \"skylark-utils/velm\"\r\n], function(velm) {\r\n return velm;\r\n});\r\n\ndefine('skylark-utils/widget',[\r\n \"./skylark\",\r\n \"./langx\",\r\n \"./noder\",\r\n \"./styler\",\r\n \"./geom\",\r\n \"./eventer\",\r\n \"./query\"\r\n], function(skylark,langx,noder,styler,geom,eventer,query) {\r\n // Cached regex to split keys for `delegate`.\r\n var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\r\n\r\n function widget() {\r\n return widget;\r\n }\r\n\r\n\tvar Widget = langx.Evented.inherit({\r\n init :function(el,options) {\r\n if (!langx.isHtmlNode(el)) {\r\n options = el;\r\n el = null;\r\n }\r\n this.el = el;\r\n if (options) {\r\n langx.mixin(this,options);\r\n }\r\n if (!this.cid) {\r\n this.cid = langx.uniqueId('w');\r\n }\r\n this._ensureElement();\r\n },\r\n\r\n\t // The default `tagName` of a View's element is `\"div\"`.\r\n\t tagName: 'div',\r\n\r\n\t // jQuery delegate for element lookup, scoped to DOM elements within the\r\n\t // current view. This should be preferred to global lookups where possible.\r\n\t $: function(selector) {\r\n\t return this.$el.find(selector);\r\n\t },\r\n\r\n\t // **render** is the core function that your view should override, in order\r\n\t // to populate its element (`this.el`), with the appropriate HTML. The\r\n\t // convention is for **render** to always return `this`.\r\n\t render: function() {\r\n\t return this;\r\n\t },\r\n\r\n\t // Remove this view by taking the element out of the DOM, and removing any\r\n\t // applicable Backbone.Events listeners.\r\n\t remove: function() {\r\n\t this._removeElement();\r\n\t this.unlistenTo();\r\n\t return this;\r\n\t },\r\n\r\n\t // Remove this view's element from the document and all event listeners\r\n\t // attached to it. Exposed for subclasses using an alternative DOM\r\n\t // manipulation API.\r\n\t _removeElement: function() {\r\n\t this.$el.remove();\r\n\t },\r\n\r\n\t // Change the view's element (`this.el` property) and re-delegate the\r\n\t // view's events on the new element.\r\n\t setElement: function(element) {\r\n\t this.undelegateEvents();\r\n\t this._setElement(element);\r\n\t this.delegateEvents();\r\n\t return this;\r\n\t },\r\n\r\n\t // Creates the `this.el` and `this.$el` references for this view using the\r\n\t // given `el`. `el` can be a CSS selector or an HTML string, a jQuery\r\n\t // context or an element. Subclasses can override this to utilize an\r\n\t // alternative DOM manipulation API and are only required to set the\r\n\t // `this.el` property.\r\n\t _setElement: function(el) {\r\n\t this.$el = widget.$(el);\r\n\t this.el = this.$el[0];\r\n\t },\r\n\r\n\t // Set callbacks, where `this.events` is a hash of\r\n\t //\r\n\t // *{\"event selector\": \"callback\"}*\r\n\t //\r\n\t // {\r\n\t // 'mousedown .title': 'edit',\r\n\t // 'click .button': 'save',\r\n\t // 'click .open': function(e) { ... }\r\n\t // }\r\n\t //\r\n\t // pairs. Callbacks will be bound to the view, with `this` set properly.\r\n\t // Uses event delegation for efficiency.\r\n\t // Omitting the selector binds the event to `this.el`.\r\n\t delegateEvents: function(events) {\r\n\t events || (events = langx.result(this, 'events'));\r\n\t if (!events) return this;\r\n\t this.undelegateEvents();\r\n\t for (var key in events) {\r\n\t var method = events[key];\r\n\t if (!langx.isFunction(method)) method = this[method];\r\n\t if (!method) continue;\r\n\t var match = key.match(delegateEventSplitter);\r\n\t this.delegate(match[1], match[2], langx.proxy(method, this));\r\n\t }\r\n\t return this;\r\n\t },\r\n\r\n\t // Add a single event listener to the view's element (or a child element\r\n\t // using `selector`). This only works for delegate-able events: not `focus`,\r\n\t // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.\r\n\t delegate: function(eventName, selector, listener) {\r\n\t this.$el.on(eventName + '.delegateEvents' + this.uid, selector, listener);\r\n\t return this;\r\n\t },\r\n\r\n\t // Clears all callbacks previously bound to the view by `delegateEvents`.\r\n\t // You usually don't need to use this, but may wish to if you have multiple\r\n\t // Backbone views attached to the same DOM element.\r\n\t undelegateEvents: function() {\r\n\t if (this.$el) this.$el.off('.delegateEvents' + this.uid);\r\n\t return this;\r\n\t },\r\n\r\n\t // A finer-grained `undelegateEvents` for removing a single delegated event.\r\n\t // `selector` and `listener` are both optional.\r\n\t undelegate: function(eventName, selector, listener) {\r\n\t this.$el.off(eventName + '.delegateEvents' + this.uid, selector, listener);\r\n\t return this;\r\n\t },\r\n\r\n\t // Produces a DOM element to be assigned to your view. Exposed for\r\n\t // subclasses using an alternative DOM manipulation API.\r\n\t _createElement: function(tagName,attrs) {\r\n\t return noder.createElement(tagName,attrs);\r\n\t },\r\n\r\n\t // Ensure that the View has a DOM element to render into.\r\n\t // If `this.el` is a string, pass it through `$()`, take the first\r\n\t // matching element, and re-assign it to `el`. Otherwise, create\r\n\t // an element from the `id`, `className` and `tagName` properties.\r\n\t _ensureElement: function() {\r\n\t if (!this.el) {\r\n\t var attrs = langx.mixin({}, langx.result(this, 'attributes'));\r\n\t if (this.id) attrs.id = langx.result(this, 'id');\r\n\t if (this.className) attrs['class'] = langx.result(this, 'className');\r\n\t this.setElement(this._createElement(langx.result(this, 'tagName'),attrs));\r\n\t this._setAttributes(attrs);\r\n\t } else {\r\n\t this.setElement(langx.result(this, 'el'));\r\n\t }\r\n\t },\r\n\r\n\t // Set attributes from a hash on this view's element. Exposed for\r\n\t // subclasses using an alternative DOM manipulation API.\r\n\t _setAttributes: function(attributes) {\r\n\t this.$el.attr(attributes);\r\n\t }\r\n \t});\r\n\r\n\r\n langx.mixin(widget, {\r\n \t$ : query,\r\n\r\n \tWidget : Widget\r\n });\r\n\r\n\r\n return skylark.widget = widget;\r\n});\r\n\ndefine('skylarkjs/widget',[\r\n \"skylark-utils/widget\"\r\n], function(widget) {\r\n return widget;\r\n});\r\n\ndefine('skylarkjs/main',[\r\n \"./core\",\r\n \"./browser\",\r\n \"./css\",\r\n \"./datax\",\r\n \"./dnd\",\r\n \"./eventer\",\r\n \"./filer\",\r\n \"./finder\",\r\n \"./fx\",\r\n \"./geom\",\r\n \"./http\",\r\n \"./images\",\r\n \"./mover\",\r\n \"./noder\",\r\n \"./query\",\r\n \"./scripter\",\r\n \"./styler\",\r\n \"./velm\",\r\n \"./widget\"\r\n], function(skylark) {\r\n return skylark;\r\n})\r\n;\ndefine('skylarkjs', ['skylarkjs/main'], function (main) { return main; });\n\n"]} \ No newline at end of file diff --git a/libs/skylarkjs/0.9.8/skylarkjs.min.js b/libs/skylarkjs/0.9.8/skylarkjs.min.js new file mode 100644 index 000000000..526fdcce7 --- /dev/null +++ b/libs/skylarkjs/0.9.8/skylarkjs.min.js @@ -0,0 +1,11 @@ +/** + * skylarkjs - An Elegant JavaScript Library and HTML5 Application Framework. + * @author Hudaokeji Co.,Ltd + * @version v0.9.8 + * @link www.skylarkjs.org + * @license MIT + */ +!function(e,t){function n(e,t){if("."!==e[0])return e;var n=t.split("/"),r=e.split("/");n.pop();for(var i=0;i1&&t[1].split("&").forEach(function(e){var t=e.split("=");n[t[0]]=t[1]}),n}function d(e,t){if(!t)return-1;var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return e&&e.constructor===Array}function g(e){return!x(e)&&!T(e)&&"number"==typeof e.length}function v(e){return"boolean"==typeof e}function m(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function y(e,t){return ee(e,t)}function b(e){return"function"==ie(e)}function k(e){return"object"==ie(e)}function w(e){return k(e)&&!E(e)&&Object.getPrototypeOf(e)==Object.prototype}function x(e){return"string"==typeof e}function E(e){return e&&e==e.window}function C(e){return"undefined"!=typeof e}function T(e){return e&&e instanceof Node}function S(e){return"number"==typeof e}function A(e){if(e){var t=location.protocol+"//"+location.hostname;return location.port&&(t+=":"+location.port),e.startsWith(t)}}function _(e){var t;for(t in e)if(null!==e[t])return!1;return!0}function N(e,t,n){return g(e)?(n||[]).concat(Array.prototype.slice.call(e,t||0)):[e]}function j(e,t){var n,r,i,o=[];if(g(e))for(r=0;r1?t?t(e):e:(new Q).resolve(e);if(!o){var a=new Q(e.cancel);e.then(a.resolve,a.reject,a.progress),e=a.promise}return t||n||r?e.then(t,n,r):e},Q.reject=function(e){var t=new Q;return t.reject(e),t.promise},Q.resolve=function(e){var t=new Q;return t.resolve(e),t.promise},Q.immediate=Q.resolve;var ee,te,ne=Z({on:function(e,t,n,r,i,o){var a=this,s=this._hub||(this._hub={});return w(e)?(i=r,l(e,function(e,r){a.on(e,t,n,r,i,o)}),this):(x(t)||b(r)||(i=r,r=n,n=t,t=X),b(n)&&(i=r,r=n,n=null),x(e)&&(e=e.split(/\s/)),e.forEach(function(e){(s[e]||(s[e]=[])).push({fn:r,selector:t,data:n,ctx:i,one:o})}),this)},one:function(e,t,n,r,i){return this.on(e,t,n,r,i,1)},trigger:function(e){if(!this._hub)return this;var t=this;x(e)&&(e=new CustomEvent(e)),e.target=this;var n=V.call(arguments,1);return n=C(n)?[e].concat(n):[e],[e.type||e.name,"all"].forEach(function(r){var i=t._hub[r];if(i){for(var o=i.length,s=!1,u=0;u0},listenTo:function(e,t,n,r){if(!e)return this;x(n)&&(n=this[n]),r?e.one(t,n,this):e.on(t,n,this);for(var i,o=this._listeningTo||(this._listeningTo=[]),a=0;a-1},prepare:function(){var e=new a,o=this._setting,s=o.controller,u=this.controller,l=this;return t([s.type],function(t){u=l.controller=new t(s),r.on(o.hookers,{plugin:l},n.proxy(u.perform,u)),e.resolve()}),e.then(function(){var e=i("preparing",{plugin:l,result:!0});return l.trigger(e),a.when(e.result).then(function(){l._prepared=!0})})},trigger:function(e){var t=this.controller;return t?t.perform(e):this.overrided(e)}}),f=n.Evented.inherit({klassName:"SpaPluginController",init:function(e){this.plugin=e},perform:function(e){var t=e.type;if(this[t])return this[t].call(this,e)}}),h=n.Evented.inherit({klassName:"SpaApplication",init:function(e){if(o)return o;var t=this._plugins={};e=this._config=n.mixin({plugins:{}},e,!0),n.each(e.plugins,function(e,n){t[e]=new c(e,n)}),r.routes(e.routes),this._router=r,this._page=new d.Page(e.page),document.title=e.title;var i=e.baseUrl;void 0===i&&(i=e.baseUrl=new n.URL(document.baseURI).pathname),r.baseUrl(i),e.homePath&&r.homePath(e.homePath),o=this},getConfig:function(e){return e?this._config[e]:this._config},go:function(e,t){return r.go(e,t),this},page:function(){return this._page},prepare:function(){if(this._prepared)return a.resolve();var e=this,t=n.map(this._plugins,function(e,t){if(e.isHooked("starting"))return e.prepare()});return a.all(t).then(function(){r.trigger(i("starting",{spa:e}));var t=n.map(r.routes(),function(e,t){if(e.lazy===!1)return e.prepare()}),o=n.map(e._plugins,function(e,t){if(!e.isHooked("starting"))return e.prepare()});return a.all(t.concat(o)).then(function(){e._prepared=!0})})},run:function(){this._router.start(),r.trigger(i("started",{spa:this}))}}),d=function(e){return o||(window[e.name||"app"]=o=new d.Application(e)),o};return n.mixin(d,{Application:h,Page:l,Plugin:c,PluginController:f,Route:s,RouteController:u}),e.spa=d}),e("skylarkjs/spa",["skylark-spa/spa"],function(e){return e}),e("skylarkjs/langx",["skylark-langx/langx"],function(e){return e}),e("skylarkjs/core",["./skylark","./router","./spa","./langx"],function(e){return e}),e("skylark-utils/langx",["skylark-langx/langx"],function(e){return e}),e("skylark-utils/browser",["./skylark","./langx"],function(e,t){function n(e){return c?c+e:e.toLowerCase()}function r(e){return h[e]||e}function i(e){return f[e]||e}function o(){return o}var a,s,u="",l="",c="",f={},h={},d=/^(Webkit|webkit|O|Moz|moz|ms)(.*)$/,p=window.document,g=p.createElement("div"),v=g.webkitMatchesSelector||g.mozMatchesSelector||g.oMatchesSelector||g.matchesSelector,m=g.style;for(var y in m){var b=y.match(s||d);if(b){s||(a=b[1],s=new RegExp("^("+a+")(.*)$"),l=a,u="-"+a.toLowerCase()+"-",c=a.toLowerCase()),f[t.lowerFirst(b[2])]=y;var k=t.dasherize(b[2]);h[k]=u+k}}return t.mixin(o,{css3PropPrefix:u,normalizeStyleProperty:i,normalizeCssProperty:r,normalizeCssEvent:n,matchesSelector:v,location:function(){return window.location},support:{}}),g=null,e.browser=o}),e("skylarkjs/browser",["skylark-utils/browser"],function(e){return e}),e("skylark-utils/styler",["./skylark","./langx"],function(e,t){function n(e,t){return"number"!=typeof t||m[v(e)]?t:t+"px"}function r(e){return e in y?y[e]:y[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function i(e,t){var n=e.className||"",r=n&&void 0!==n.baseVal;return void 0===t?r?n.baseVal:n:void(r?n.baseVal=t:e.className=t)}function o(e){var t,n;return b[e]||(t=document.createElement(e),document.body.appendChild(t),n=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==n&&(n="block"),b[e]=n),b[e]}function a(e){return k.css(e,"display",""),"none"==k.css(e,"display")&&k.css(e,"display",o(e.nodeName)),this}function s(e){return"none"==k.css(e,"display")||0==k.css(e,"opacity")}function u(e){return k.css(e,"display","none"),this}function l(e,n){if(!n)return this;var o,a=i(e);return o=t.isString(n)?n.split(/\s+/g):n,o.forEach(function(e){var t=r(e);a.match(t)||(a+=(a?" ":"")+e)}),i(e,a),this}function c(e,r,i){if(arguments.length<3){var o,o=getComputedStyle(e,"");if(t.isString(r))return e.style[g(r)]||o.getPropertyValue(r);if(t.isArrayLike(r)){var a={};return p.call(r,function(t){a[t]=e.style[g(t)]||o.getPropertyValue(t)}),a}}var s="";if("string"==typeof r)i||0===i?s=v(r)+":"+n(r,i):e.style.removeProperty(v(r));else for(key in r)void 0!==r[key]&&(r[key]||0===r[key]?s+=v(key)+":"+n(key,r[key])+";":e.style.removeProperty(v(key)));return e.style.cssText+=";"+s,this}function f(e,t){var n=r(t);return e.className&&e.className.match(n)}function h(e,n){if(n){var o,a=i(e);o=t.isString(n)?n.split(/\s+/g):n,o.forEach(function(e){var t=r(e);a.match(t)&&(a=a.replace(t," "))}),i(e,a.trim())}else i(e,"");return this}function d(e,t,n){var r=this;return t.split(/\s+/g).forEach(function(t){void 0===n&&(n=!r.hasClass(e,t)),n?r.addClass(e,t):r.removeClass(e,t)}),r}var p=(Array.prototype.every,Array.prototype.forEach),g=t.camelCase,v=t.dasherize,m={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},y={},b={},k=function(){return k};return t.mixin(k,{autocssfix:!0,cssHooks:{},addClass:l,className:i,css:c,hasClass:f,hide:u,isInvisible:s,removeClass:h,show:a,toggleClass:d}),e.styler=k}),e("skylark-utils/noder",["./skylark","./langx","./styler"],function(e,t,n){function r(e,n){return t.isArrayLike(e)||(e=[e]),n&&(e=$.call(e,function(e){return e.cloneNode(!0)})),t.flatten(e)}function i(e,t){var n=e.nodeName&&e.nodeName.toLowerCase();return void 0!==t?n===t.toLowerCase():n}function o(e){return i(e,"iframe")?e.contentDocument:e.childNodes}function a(e,n){if(void 0===n)return e.innerHTML;if(this.empty(e),n=n||"",t.isString(n)||t.isNumber(n))e.innerHTML=n;else if(t.isArrayLike(n))for(var r=0;r0;n--)if(n>0){var r=e.children[n];e.insertBefore(r,t)}}function _(e,n){t.isString(n)&&(n=this.createFragment(n).firstChild),e.parentNode.insertBefore(n,e),n.appendChild(e)}function N(e,t){var n=F.call(e.childNodes);e.appendChild(t);for(var r=0;r]*>/,O=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,D=document.createElement("div"),M=document.createElement("table"),B=document.createElement("tbody"),I=document.createElement("tr"),z={tr:B,tbody:M,thead:M,tfoot:M,td:I,th:I,"*":D},$=Array.prototype.map,F=Array.prototype.slice;return t.mixin(P,{clone:s,contents:o,createElement:u,createFragment:l,contains:c,createTextNode:f,doc:h,empty:d,html:a,isChildOf:p,isDoc:g,ownerDoc:v,ownerWindow:m,after:y,before:b,prepend:k,append:w,remove:E,replace:C,throb:T,traverse:S,reverse:A,wrapper:_,wrapperInner:N,unwrap:j}),e.noder=P}),e("skylark-utils/css",["./skylark","./langx","./noder"],function(e,t,n){function r(){var e=document.createElement("link"),t=s++;return e.rel="stylesheet",e.type="text/css",e.async=!1,e.defer=!1,a.appendChild(e),l[t]=e,t}function i(){return i}var o,a=document.getElementsByTagName("head")[0],s=0,u={},l={},c=r(),f=l[c],h="cssRules"in f?"cssRules":"rules",d=f.deleteRule||f.removeRule;if(f.insertRule){var p=f.insertRule;o=function(e,t,n){p.call(this,e+"{"+t+"}",n)}}else o=f.addRule;return t.mixin(i,{createStyleSheet:function(e){return r()},loadStyleSheet:function(e,t,n){var i=u[e];if(i||(i=u[e]={state:0,loadedCallbacks:[],errorCallbacks:[]}),i.loadedCallbacks.push(t),i.errorCallbacks.push(n),1===i.state)i.node.onload();else if(i.state===-1)i.node.onerror();else{i.id=r();var o=i.node=l[i.id];startTime=(new Date).getTime(), +o.onload=function(){i.state=1,i.state=-1;for(var e=i.loadedCallbacks,t=e.length;t--;)e[t]();i.loadedCallbacks=[],i.errorCallbacks=[]},o.onerror=function(){i.state=-1;for(var e=i.errorCallbacks,t=e.length;t--;)e[t]();i.loadedCallbacks=[],i.errorCallbacks=[]},o.href=i.url=e,u[o.url]=i}return i.id},deleteSheetRule:function(e,n){var r=l[e];t.isNumber(n)?d.call(r,n):t.each(r[h],function(e,t){if(n===t)return d.call(r,e),!1})},deleteRule:function(e){return this.deleteSheetRule(c,e),this},removeStyleSheet:function(e){if(e===c)throw new Error("The default stylesheet can not be deleted");var t=l[e];return delete l[e],n.remove(t),this},findRules:function(e,t){var n=[],r=parseSelector(e);return $(document.styleSheets).each(function(e,t){filterStyleSheet(r.styleSheet,t)&&$.merge(n,$(t[_rules]).filter(function(){return matchSelector(this,r.selectorText,"*"===r.styleSheet)}).map(function(){return normalizeRule($.support.nativeCSSStyleRule?this:new CSSStyleRule(this),t)}))}),n.reverse()},insertRule:function(e,t,n){return this.insertSheetRule(c,e,t,n)},insertSheetRule:function(e,t,n,r){if(!t||!n)return-1;var i=l[e];return r=r||i[h].length,o.call(i,t,n,r)}}),e.css=i}),e("skylarkjs/css",["skylark-utils/css"],function(e){return e}),e("skylark-utils/finder",["./skylark","./langx","./browser","./noder"],function(e,t,n,r,i){function o(e,n,r){for(var i=r&&t.isString(r);e=e.parentNode;){if(v(e,n))return e;if(r)if(i){if(v(e,r))break}else if(e==r)break}return null}function a(e,n,r){for(var i=[],o=r&&t.isString(r);e=e.parentNode;)if(i.push(e),r)if(o){if(v(e,r))break}else if(e==r)break;return n&&(i=E.filter(i,n)),i}function s(e,t){return t=t||r.doc(),t.getElementById(e)}function u(e,t){for(var n=e.childNodes,r=[],i=0;i0?r[0]:null}function h(e,t){return t||(t=e,e=document.body),v(e,t)?e:f(e,t)}function d(e,t){return t||(t=e,e=document.body),c(e,t)}function p(e,t,n){for(var r=e.childNodes,i=r[0];i;){if(1==i.nodeType){if(!t||v(i,t))return i;if(n)break}i=i.nextSibling}return null}function g(e,t,n){for(var r=e.childNodes,i=r[r.length-1];i;){if(1==i.nodeType){if(!t||v(i,t))return i;if(n)break}i=i.previousSibling}return null}function v(e,n){if(!n||!e||1!==e.nodeType)return!1;if(t.isString(n)){try{return S.call(e,n.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g,'[$1="$2"]'))}catch(r){}return E.match(e,n)}return t.isArrayLike(n)?t.inArray(e,n)>-1:t.isPlainObject(n)?E.check(e,n):e===n}function m(e,t,n){for(var r=e.nextSibling;r;){if(1==r.nodeType){if(!t||v(r,t))return r;if(n)break}r=r.nextSibling}return null}function y(e,t){for(var n=e.nextSibling,r=[];n;)1==n.nodeType&&(t&&!v(n,t)||r.push(n)),n=n.nextSibling;return r}function b(e,t){var n=e.parentNode;return!n||t&&!v(n,t)?null:n}function k(e,t,n){for(var r=e.previousSibling;r;){if(1==r.nodeType){if(!t||v(r,t))return r;if(n)break}r=r.previousSibling}return null}function w(e,t){for(var n=e.previousSibling,r=[];n;)1==n.nodeType&&(t&&!v(n,t)||r.push(n)),n=n.previousSibling;return r}function x(e,t){for(var n=e.parentNode.firstChild,r=[];n;)1==n.nodeType&&n!==e&&(t&&!v(n,t)||r.push(n)),n=n.nextSibling;return r}var E={},C=Array.prototype.filter,T=Array.prototype.slice,S=n.matchesSelector;(function(){function e(e,o,a,u,c,h,d,p,g,v,m,y,b,k,w,x){if((o||n===-1)&&(t.expressions[++n]=[],r=-1,o))return"";if(a||u||r===-1){a=a||" ";var E=t.expressions[n];i&&E[r]&&(E[r].reverseCombinator=l(a)),E[++r]={combinator:a,tag:"*"}}var C=t.expressions[n][r];if(c)C.tag=c.replace(s,"");else if(h)C.id=h.replace(s,"");else if(d)d=d.replace(s,""),C.classList||(C.classList=[]),C.classes||(C.classes=[]),C.classList.push(d),C.classes.push({value:d,regexp:new RegExp("(^|\\s)"+f(d)+"(\\s|$)")});else if(b)x=x||w,x=x?x.replace(s,""):null,C.pseudos||(C.pseudos=[]),C.pseudos.push({key:b.replace(s,""),value:x,type:1==y.length?"class":"element"});else if(p){p=p.replace(s,""),m=(m||"").replace(s,"");var T,S;switch(g){case"^=":S=new RegExp("^"+f(m));break;case"$=":S=new RegExp(f(m)+"$");break;case"~=":S=new RegExp("(^|\\s)"+f(m)+"(\\s|$)");break;case"|=":S=new RegExp("^"+f(m)+"(-|$)");break;case"=":T=function(e){return m==e};break;case"*=":T=function(e){return e&&e.indexOf(m)>-1};break;case"!=":T=function(e){return m!=e};break;default:T=function(e){return!!e}}""==m&&/^[*$^]=$/.test(g)&&(T=function(){return!1}),T||(T=function(e){return e&&S.test(e)}),C.attributes||(C.attributes=[]),C.attributes.push({key:p,operator:g,value:m,test:T})}return""}var t,n,r,i,o={},a={},s=/\\/g,u=function(r,s){if(null==r)return null;if(r.Slick===!0)return r;r=(""+r).replace(/^\s+|\s+$/g,""),i=!!s;var l=i?a:o;if(l[r])return l[r];for(t={Slick:!0,expressions:[],raw:r,reverse:function(){return u(this.raw,!0)}},n=-1;r!=(r=r.replace(h,e)););return t.length=t.expressions.length,l[t.raw]=i?c(t):t},l=function(e){return"!"===e?" ":" "===e?"!":/^!/.test(e)?e.replace(/^!/,""):"!"+e},c=function(e){for(var t=e.expressions,n=0;n+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),d=this.Slick||{};d.parse=function(e){return u(e)},d.escapeRegExp=f,this.Slick||(this.Slick=d)}).apply(E);var T=Array.prototype.slice;E.parseSelector=E.Slick.parse,E.pseudos={checkbox:function(e){return"checkbox"===e.type},checked:function(e){return!!e.checked},contains:function(e,t,n,r){if($(this).text().indexOf(r)>-1)return this},disabled:function(e){return!!e.disabled},enabled:function(e){return!e.disabled},eq:function(e,t,n,r){return t==r},focus:function(e){return document.activeElement===e&&(e.href||e.type||e.tabindex)},first:function(e,t){return 0===t},gt:function(e,t,n,r){return t>r},has:function(e,t,n,r){return v(e,r)},hidden:function(e){return!E.pseudos.visible(e)},last:function(e,t,n){return t===n.length-1},lt:function(e,t,n,r){return t":o=u(e,i);break;case"+":n=m(e,i,!0),n&&o.push(n);break;case"^":n=p(e,i,!0),n&&o.push(n);break;case"~":o=y(e,i);break;case"++":var s=k(e,i,!0),l=m(e,i,!0);s&&o.push(s),l&&o.push(l);break;case"~~":o=x(e,i);break;case"!":o=a(e,i);break;case"!>":n=b(e,i),n&&o.push(n);break;case"!+":o=k(e,i,!0);break;case"!^":n=g(e,i,!0),n&&o.push(n);break;case"!~":o=w(e,i);break;default:var c=this.divide(t);if(o=T.call(e.querySelectorAll(c.nativeSelector)),c.customPseudos)for(var f=c.customPseudos.length-1;f>=0;f--)o=C.call(o,function(e,t){return E.check(e,{pseudos:[c.customPseudos[f]]},t,o,!1)}),o=C.call(o,function(e,t){return E.check(e,{pseudos:[c.customPseudos[f]]},t,o,!0)})}return o},E.query=function(e,n,r){for(var i,o,a=this.Slick.parse(n),s=[],u=a.expressions,l=0;i=u[l];l++){for(var c,f=[e],h=0;o=i[h];h++)c=t.map(f,function(e,t){return E.combine(e,o)}),c&&(f=c);c&&(s=s.concat(c))}return s};var A=function(){return A};return t.mixin(A,{ancestor:o,ancestors:a,byId:s,children:u,closest:l,descendant:f,descendants:c,find:h,findAll:d,firstChild:p,lastChild:g,matches:v,nextSibling:m,nextSiblings:y,parent:b,previousSibling:k,previousSiblings:w,pseudos:E.pseudos,siblings:x}),e.finder=A}),e("skylark-utils/datax",["./skylark","./langx","./finder"],function(e,t,n){function r(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function i(e,t,n){if(void 0!==n)return e.setAttribute(t,n),this;if("object"==typeof t){for(var r in t)i(e,r,t[r]);return this}return e.hasAttribute(t)?e.getAttribute(t):void 0}function o(e){var n={};return t.each(e.attributes||[],function(e,t){0==t.name.indexOf("data-")&&(n[k(t.name.replace("data-",""))]=w(t.value))}),n}function a(e,t){var n=e._$_store;return!n&&t&&(n=e._$_store=o(e)),n}function s(e,t){if(void 0===t)return a(e,!0);var n=a(e);if(n){if(t in n)return n[t];var r=k(t);if(r in n)return n[r]}var o="data-"+t.replace(x,"-$1").toLowerCase();return i(e,o)}function u(e,t,n){var r=a(e,!0);r[k(t)]=n}function l(e,t,n){if(void 0===n){if("object"==typeof t){for(var r in t)u(e,r,t[r]);return this}return s(e,t)}return u(e,t,n),this}function c(e,n){t.isString(n)&&(n=n.split(/\s+/));var r=a(e,!0);return n.forEach(function(e){delete r[e]}),this}function f(e,t){return y.call(e,function(e){return e[t]})}function h(e,t,n){return t=E[t]||t,void 0===n?e[t]:(e[t]=n,this)}function d(e,t){return t.split(" ").forEach(function(t){r(e,t)}),this}function p(e,t){return t.split(" ").forEach(function(t){delete e[t]}),this}function g(e,t){return void 0===t?e.textContent:(e.textContent=null==t?"":""+t,this)}function v(e,t){if(void 0===t){if(e.multiple){var r=b.call(n.find(e,"option"),function(e){return e.selected});return f(r,"value")}return e.value}return e.value=t,this}function m(){return m}var y=Array.prototype.map,b=Array.prototype.filter,k=t.camelCase,w=t.deserializeValue,x=/([A-Z])/g,E={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};return t.mixin(m,{attr:i,data:l,pluck:f,prop:h,removeAttr:d,removeData:c,removeProp:p,text:g,val:v}),e.datax=m}),e("skylarkjs/datax",["skylark-utils/datax"],function(e){return e}),e("skylark-utils/geom",["./skylark","./langx","./styler"],function(e,t,n){function r(e){for(var t=e.offsetParent||document.body;t&&!T.test(t.nodeName)&&"static"==n.css(t,"position");)t=t.offsetParent;return t}function i(e){var t=getComputedStyle(e);return{left:S(t.borderLeftWidth,e),top:S(t.borderTopWidth,e),right:S(t.borderRightWidth,e),bottom:S(t.borderBottomWidth,e)}}function o(e,t){if(void 0===t)return T.test(e.nodeName)?{top:0,left:0}:e.getBoundingClientRect();var n=r(e),a=o(n),s=d(e),u=i(n);return m(e,{top:t.top-a.top-s.top-u.top,left:t.left-a.left-s.left-u.left}),this}function a(e,t){return void 0===t?e.getBoundingClientRect():(o(e,t),x(e,t),this)}function s(e,t){return void 0==t?u(e).height:u(e,{height:t})}function u(e,t){if(void 0==t)return{width:e.clientWidth,height:e.clientHeight};var r="border-box"===n.css(e,"box-sizing"),o={width:t.width,height:t.height};if(r){var a=i(e);void 0!==o.width&&(o.width=o.width+a.left+a.right),void 0!==o.height&&(o.height=o.height+a.top+a.bottom)}else{var s=p(e);void 0!==o.width&&(o.width=o.width-s.left-s.right),void 0!==o.height&&(o.height=o.height-s.top-s.bottom)}return n.css(e,o),this}function l(e,t){return void 0==t?u(e).width:(u(e,{width:t}),this)}function c(e){var t=u(e),n=p(e);return{left:n.left,top:n.top,width:t.width-n.left-n.right,height:t.height-n.top-n.bottom}}function f(e){var t=e.documentElement,n=e.body,r=Math.max,i=r(t.scrollWidth,n.scrollWidth),o=r(t.clientWidth,n.clientWidth),a=r(t.offsetWidth,n.offsetWidth),s=r(t.scrollHeight,n.scrollHeight),u=r(t.clientHeight,n.clientHeight),l=r(t.offsetHeight,n.offsetHeight);return{width:i-1?n.split(","):n.split(/\s/));var a=j(e);return n&&n.forEach(function(e){a.unregister(e,i,{selector:r})}),this}function c(e,n,r,i,o,a){if(t.isPlainObject(n))return t.each(n,function(t,n){c(e,t,r,i,n,a)}),this;t.isString(r)||t.isFunction(o)||(o=i,i=r,r=void 0),t.isFunction(i)&&(o=i,i=void 0),o===!1&&(o=t.returnFalse),"string"==typeof n&&(n=n.indexOf(",")>-1?n.split(","):n.split(/\s/));var s=j(e);return n.forEach(function(e){return"ready"==e?p(o):void s.register(e,o,{data:i,selector:r,one:!!a})}),this}function f(e,t,n,r,i){return c(e,t,n,r,i,1),this}function h(e){return window.document.all&&(e.keyCode=0),e.preventDefault&&(e.preventDefault(),e.stopPropagation()),this}function d(e,t,n){var r;r=t instanceof Event?t:w(t,n),r._args=n;var i=e.dispatchEvent||e.trigger;return i?i.call(e,r):console.warn("The evented parameter is not a eventable object"),this}function p(e){return k.test(document.readyState)&&document.body?e():document.addEventListener("DOMContentLoaded",e,!1),this}function g(e){var t=o.data(e,"shortcuts");if(!t){t={},o.data(e,"shortcuts",t);var n=function(e,t){var n=t.metaKey||t.ctrlKey;if(e.ctrl==n&&e.alt==t.altKey&&e.shift==t.shiftKey&&(t.keyCode==e.keyCode||t.charCode&&t.charCode==e.charCode))return t.preventDefault(),"keydown"==t.type&&e.fn(t),!0};c(e,"keyup keypress keydown",function(e){if(!/INPUT|TEXTAREA/.test(e.target.nodeName))for(var r in t)n(t[r],e)})}return{add:function(e,n){var r;r=e.indexOf(",")>-1?e.toLowerCase().split(","):e.toLowerCase().split(" "),r.forEach(function(e){var r={fn:n,alt:!1,ctrl:!1,shift:!1};e.split("+").forEach(function(e){switch(e){case"alt":case"ctrl":case"shift":r[e]=!0;break;default:r.charCode=e.charCodeAt(0),r.keyCode=P[e]||e.toUpperCase().charCodeAt(0)}});var i=(r.ctrl?"ctrl":"")+","+(r.alt?"alt":"")+","+(r.shift?"shift":"")+","+r.keyCode;t[i]=r})}}}function v(){return v}var m=(t.mixin,t.each,Array.prototype.slice,t.uid),y=/^([A-Z]|returnValue$|layer[XY]$)/,b={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"},k=/complete|loaded|interactive/,w=function(){function e(e){var t=r[e];return t||(t=0),n[t]}var n=[window.CustomEvent,window.CompositionEvent,window.DragEvent,window.Event,window.FocusEvent,window.KeyboardEvent,window.MessageEvent,window.MouseEvent,window.MouseScrollEvent,window.MouseWheelEvent,window.MutationEvent,window.ProgressEvent,window.TextEvent,window.TouchEvent,window.UIEvent,window.WheelEvent],r={compositionstart:1,compositionend:1,compositionupdate:1,beforecopy:2,beforecut:2,beforepaste:2,copy:2,cut:2,paste:2,drag:2,dragend:2,dragenter:2,dragexit:2,dragleave:2,dragover:2,dragstart:2,drop:2,abort:3,change:3,error:3,selectionchange:3,submit:3,reset:3,focus:4,blur:4,focusin:4,focusout:4,keydown:5,keypress:5,keyup:5,message:6,click:7,contextmenu:7,dblclick:7,mousedown:7,mouseup:7,mousemove:7,mouseover:7,mouseout:7,mouseenter:7,mouseleave:7,textInput:12,touchstart:13,touchmove:13,touchend:13,load:14,resize:14,select:14,scroll:14,unload:14,wheel:15};return function(n,r){t.isString(n)?r=r||{}:(r=n||{},n=r.type||"");var i=s(n);n=i.type,r=t.mixin({bubbles:!0,cancelable:!0},r),i.ns&&(r.namespace=i.ns);var o=e(n),u=new o(n,r);return t.safeMixin(u,r),a(u)}}(),x={},E="onfocusin"in window,C={focus:"focusin",blur:"focusout"},T={mouseenter:"mouseover",mouseleave:"mouseout"},S=function(e){return T[e]||E&&C[e]||e},A={},_=t.klass({init:function(e,t){this._target=e,this._event=t,this._bindings=[]},add:function(e,n){var o=this._bindings,a={fn:e,options:t.mixin({},n)};o.push(a);var s=this;if(!s._listener){s._listener=function(e){var n=this,i=u(e),o=e._args,a=s._bindings,l=i.namespace;o=t.isDefined(o)?[i].concat(o):[i],t.each(a,function(e,a){var u=n;if(i.isImmediatePropagationStopped&&i.isImmediatePropagationStopped())return!1;var c=a.fn,f=a.options||{},h=f.selector,d=f.one,p=f.data;if(!l||l==f.ns||f.ns.indexOf(l)!==-1){if(h){if(u=r.closest(i.target,h),!u||u===n)return;t.mixin(i,{currentTarget:u,liveFired:n})}t.isDefined(p)&&(i.data=p),d&&s.remove(c,f);var g=c.apply(u,o);g===!1&&(i.preventDefault(),i.stopPropagation())}})};var l=s._event;if(l in T){var c=s._listener;s._listener=function(e){var t=e.relatedTarget;if(!t||t!==this&&!i.contains(this,t))return c.apply(this,arguments)}}s._target.addEventListener?s._target.addEventListener(S(l),s._listener,!1):console.warn("invalid eventer object",s._target)}},remove:function(e,n){function r(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}n=t.mixin({},n);var i;n.ns&&(i=r(n.ns)),this._bindings=this._bindings.filter(function(t){var r=(!e||e===t.fn)&&(!i||i.test(t.options.ns))&&(!n.selector||n.selector==t.options.selector);return!r}),0==this._bindings.length&&(this._target.removeEventListener&&this._target.removeEventListener(S(this._event),this._listener,!1),this._listener=null)}}),N=t.klass({init:function(e){this._target=e,this._handler={}},register:function(e,n,r){var i=s(e),e=i.type,o=x[e],a=o&&(o.bindType||o.bindEventName),u=this._handler;void 0===u[e]&&(u[e]=new _(this._target,a||e)),u[e].add(n,t.mixin({ns:i.ns},r))},unregister:function(e,n,r){var i=this._handler,o=s(e);e=o.type;var a=i[e];a&&a.remove(n,t.mixin({ns:o.ns},r))}}),j=function(e){var t=m(e),n=A[t];return n||(n=A[t]=new N(e)),n},P={"delete":46};return t.mixin(v,{create:w,off:l,on:c,one:f,proxy:u,ready:p,shortcuts:g,special:x,stop:h,trigger:d}),e.eventer=v}),e("skylark-utils/dnd",["./skylark","./langx","./noder","./datax","./finder","./geom","./eventer","./styler"],function(e,t,n,r,i,o,a,s){function u(e,t){return new d(e,t)}function l(e,t){return new p(e,t)}function c(){return c}var f=(a.on,a.off,r.attr,r.removeAttr,o.pagePosition,s.addClass,o.height,t.Evented.inherit({klassName:"DndManager",init:function(){},prepare:function(e){var t=a.create("preparing",{dragSource:e.elm,handleElm:e.handleElm});e.trigger(t),e.dragSource=t.dragSource},start:function(e,n){var r=o.pagePosition(e.elm);this.draggingOffsetX=parseInt(n.pageX-r.left),this.draggingOffsetY=parseInt(n.pageY-r.top);var i=a.create("started",{elm:e.elm,dragSource:e.dragSource,handleElm:e.handleElm,ghost:null,transfer:{}});e.trigger(i),this.dragging=e,e.draggingClass&&s.addClass(e.dragSource,e.draggingClass),this.draggingGhost=i.ghost,this.draggingGhost||(this.draggingGhost=e.elm),this.draggingTransfer=i.transfer,this.draggingTransfer&&t.each(this.draggingTransfer,function(e,t){n.dataTransfer.setData(e,t)}),n.dataTransfer.setDragImage(this.draggingGhost,this.draggingOffsetX,this.draggingOffsetY),n.dataTransfer.effectAllowed="copyMove",this.trigger(i)},over:function(){},end:function(e){var t=this.dragging;t&&t.draggingClass&&s.removeClass(t.dragSource,t.draggingClass);var n=a.create("ended",{});this.trigger(n),this.dragging=null,this.draggingTransfer=null,this.draggingGhost=null,this.draggingOffsetX=null,this.draggingOffsetY=null}})),h=new f,d=t.Evented.inherit({klassName:"Draggable",init:function(e,n){var o=this;o.elm=e,o.draggingClass=n.draggingClass||"dragging",o._params=n,["preparing","started","ended","moving"].forEach(function(e){t.isFunction(n[e])&&o.on(e,n[e])}),a.on(e,{mousedown:function(e){n.handle&&(o.handleElm=i.closest(e.target,n.handle),!o.handleElm)||(h.prepare(o),o.dragSource&&r.prop(o.dragSource,"draggable",!0))},mouseup:function(e){o.dragSource&&(r.prop(o.dragSource,"draggable",!1),o.dragSource=null,o.handleElm=null)},dragstart:function(e){r.prop(o.dragSource,"draggable",!1),h.start(o,e)},dragend:function(e){a.stop(e),h.dragging&&h.end(!1)}})}}),p=t.Evented.inherit({klassName:"Droppable",init:function(e,n){var r,i,o=this,u=(n.draggingClass||"dragging",!0);o.elm=e,o._params=n,["started","entered","leaved","dropped","overing"].forEach(function(e){t.isFunction(n[e])&&o.on(e,n[e])}),a.on(e,{dragover:function(e){if(e.stopPropagation(),u){var t=a.create("overing",{overElm:e.target,transfer:h.draggingTransfer,acceptable:!0});o.trigger(t),t.acceptable&&(e.preventDefault(),e.dataTransfer.dropEffect="copyMove")}},dragenter:function(e){var t=(o._params,o.elm),n=a.create("entered",{transfer:h.draggingTransfer});o.trigger(n),e.stopPropagation(),r&&u&&s.addClass(t,r)},dragleave:function(e){var t=(o._params,o.elm);if(!u)return!1;var n=a.create("leaved",{transfer:h.draggingTransfer});o.trigger(n),e.stopPropagation(),r&&u&&s.removeClass(t,r)},drop:function(e){var t=(o._params,o.elm);if(a.stop(e),h.dragging){r&&u&&s.addClass(t,r);var n=a.create("dropped",{transfer:h.draggingTransfer});o.trigger(n),h.end(!0)}}}),h.on("started",function(t){var n=a.create("started",{transfer:h.draggingTransfer,acceptable:!1});o.trigger(n),u=n.acceptable,r=n.hoverClass,i=n.activeClass,i&&u&&s.addClass(e,i)}).on("ended",function(t){var n=a.create("ended",{transfer:h.draggingTransfer,acceptable:!1});o.trigger(n),r&&u&&s.removeClass(e,r),i&&u&&s.removeClass(e,i),u=!1,i=null,r=null})}});return t.mixin(c,{draggable:u,droppable:l,manager:h}),e.dnd=c}),e("skylarkjs/dnd",["skylark-utils/dnd"],function(e){return e}),e("skylarkjs/eventer",["skylark-utils/eventer"],function(e){return e}),e("skylark-utils/filer",["./skylark","./langx","./eventer","./styler"],function(e,t,n,r){function i(e){function t(e){for(var t=e.length;t--;)e[t].size>l&&e.splice(t,1);a(e)}if(a=e,!o){var n=o=document.createElement("input");n.type="file",n.style.position="fixed",n.style.left=0,n.style.top=0,n.style.opacity=.001,document.body.appendChild(n),n.onchange=function(e){t(Array.prototype.slice.call(e.target.files)),n.value=""}}o.click()}var o,a,s=n.on,u=(n.attr,t.Deferred),l=1/0,c=function(){return c};return t.mixin(c,{dropzone:function(e,t){t=t||{};var i=t.hoverClass||"dropzone",o=t.dropped,a=0;return s(e,"dragenter",function(t){t.dataTransfer&&t.dataTransfer.types.indexOf("Files")>-1&&(n.stop(t),a++,r.addClass(e,i))}),s(e,"dragover",function(e){e.dataTransfer&&e.dataTransfer.types.indexOf("Files")>-1&&n.stop(e)}),s(e,"dragleave",function(t){t.dataTransfer&&t.dataTransfer.types.indexOf("Files")>-1&&(a--,0==a&&r.removeClass(e,i))}),s(e,"drop",function(t){t.dataTransfer&&t.dataTransfer.types.indexOf("Files")>-1&&(r.removeClass(e,i),n.stop(t),o&&o(t.dataTransfer.files))}),this},picker:function(e,t){t=t||{};var n=t.picked;return s(e,"click",function(e){e.preventDefault(),i(n)}),this},readFile:function(e,t){t=t||{};var n=new u,r=new FileReader;return r.onload=function(e){n.resolve(e.target.result)},r.onerror=function(e){var t=e.target.error.code;2===t?alert("please don't open this page using protocol fill:///"):alert("error code: "+t)},t.asArrayBuffer?r.readAsArrayBuffer(e):t.asDataUrl?r.readAsDataURL(e):t.asText?r.readAsText(e):r.readAsArrayBuffer(e),n.promise},writeFile:function(e,n){if(window.navigator.msSaveBlob)t.isString(e)&&(e=dataURItoBlob(e)),window.navigator.msSaveBlob(e,n);else{var r=document.createElement("a");e instanceof Blob&&(e=t.URL.createObjectURL(e)),r.href=e,r.setAttribute("download",n||"noname"),r.dispatchEvent(new CustomEvent("click"))}}}),e.filer=c}),e("skylarkjs/filer",["skylark-utils/filer"],function(e){return e}),e("skylarkjs/finder",["skylark-utils/finder"],function(e){return e}),e("skylark-utils/fx",["./skylark","./langx","./browser","./geom","./styler","./eventer"],function(e,t,n,r,i,o){function a(e,n,r,a,s,u){var c,f,h,d={},p=[],g="",v=this,m=!1,x=!1;if(t.isPlainObject(r)&&(a=r.easing,s=r.complete,u=r.delay,r=r.duration),t.isString(r)&&(r=y.speeds[r]),void 0===r&&(r=y.speeds.normal),r/=1e3,y.off&&(r=0),t.isFunction(a)?(s=a,eace="swing"):a=a||"swing",u?u/=1e3:u=0,t.isString(n))d[b]=n,d[k]=r+"s",d[w]=a,f=A;else{for(c in n)N.test(c)?g+=c+"("+n[c]+") ":("scrollTop"===c&&(x=!0),d[c]=n[c],p.push(t.dasherize(c)));f=_}return g&&(d[j]=g,p.push(j)),r>0&&t.isPlainObject(n)&&(d[E]=p.join(", "),d[C]=r+"s",d[S]=u+"s",d[T]=a),h=function(t){if(m=!0,t){if(t.target!==t.currentTarget)return;o.off(t.target,f,h)}else o.off(e,A,h);i.css(e,P),s&&s.call(this)},r>0&&(o.on(e,f,h),t.debounce(function(){m||h.call(v)},1e3*(r+u)+25)()),e.clientLeft,i.css(e,d),r<=0&&t.debounce(function(){m||h.call(v)},0)(),x&&l(e,n.scrollTop,r,s),this}function s(e,n,r){return i.show(e),n&&(!r&&t.isFunction(n)&&(r=n,n="normal"),i.css(e,"opacity",0),a(e,{opacity:1,scale:"1,1"},n,r)),this}function u(e,n,r){return n?(!r&&t.isFunction(n)&&(r=n,n="normal"),a(e,{opacity:0,scale:"0,0"},n,function(){i.hide(e),r&&r.call(e)})):i.hide(e),this}function l(e,n,r,i){var o=parseInt(e.scrollTop),a=0,s=5,u=1e3*r/s,l=parseInt(n),c=setInterval(function(){a++,a<=u&&(e.scrollTop=(l-o)/u*a+o),a>=u+1&&(clearInterval(c),i&&t.debounce(i,1e3)())},s)}function c(e,t,n){return i.isInvisible(e)?s(e,t,n):u(e,t,n),this}function f(e,t,n,r,i){return a(e,{opacity:n},t,r,i),this}function h(e,t,n,r){var o=i.css(e,"opacity");return o>0?i.css(e,"opacity",0):o=1,i.show(e),f(e,t,o,n,r),this}function d(e,n,r,o){var a,s={};return t.isPlainObject(n)?(s.easing=n.easing,s.duration=n.duration,a=n.complete):(s.duration=n,o?(a=o,s.easing=r):a=r),s.complete=function(){i.hide(e),a&&a.call(e)},f(e,s,0),this}function p(e,t,n,r){return i.isInvisible(e)?h(e,t,easing,callback):d(e,t,easing,callback),this}function g(e,t,n){var r=i.css(e,"position");s(e),i.css(e,{position:"absolute",visibility:"hidden"});var o=i.css(e,"margin-top"),u=i.css(e,"margin-bottom"),l=i.css(e,"padding-top"),c=i.css(e,"padding-bottom"),f=i.css(e,"height");return i.css(e,{position:r,visibility:"visible",overflow:"hidden",height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0}),a(e,{height:f,marginTop:o,marginBottom:u,paddingTop:l,paddingBottom:c},{duration:t,complete:function(){n&&n.apply(e)}}),this}function v(e,t,n){if(r.height(e)>0){var o=(i.css(e,"position"),i.css(e,"height")),s=i.css(e,"margin-top"),l=i.css(e,"margin-bottom"),c=i.css(e,"padding-top"),f=i.css(e,"padding-bottom");i.css(e,{visibility:"visible",overflow:"hidden",height:o,marginTop:s,marginBottom:l,paddingTop:c,paddingBottom:f}),a(e,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0},{duration:t,queue:!1,complete:function(){u(e),i.css(e,{visibility:"visible",overflow:"hidden",height:o,marginTop:s,marginBottom:l,paddingTop:c,paddingBottom:f}),n&&n.apply(e)}})}return this}function m(e,t,n){return 0==r.height(e)?g(e,t,n):v(e,t,n),this}function y(){return y}var b,k,w,x,E,C,T,S,A=n.normalizeCssEvent("AnimationEnd"),_=n.normalizeCssEvent("TransitionEnd"),N=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,j=n.css3PropPrefix+"transform",P={};return P[b=n.normalizeCssProperty("animation-name")]=P[k=n.normalizeCssProperty("animation-duration")]=P[x=n.normalizeCssProperty("animation-delay")]=P[w=n.normalizeCssProperty("animation-timing-function")]="",P[E=n.normalizeCssProperty("transition-property")]=P[C=n.normalizeCssProperty("transition-duration")]=P[S=n.normalizeCssProperty("transition-delay")]=P[T=n.normalizeCssProperty("transition-timing-function")]="", +t.mixin(y,{off:!1,speeds:{normal:400,fast:200,slow:600},animate:a,fadeIn:h,fadeOut:d,fadeTo:f,fadeToggle:p,hide:u,scrollToTop:l,slideDown:g,slideToggle:m,slideUp:v,show:s,toggle:c}),e.fx=y}),e("skylarkjs/fx",["skylark-utils/fx"],function(e){return e}),e("skylarkjs/geom",["skylark-utils/geom"],function(e){return e}),e("skylark-utils/http",["./skylark","./langx"],function(e,t){function n(){}function r(e){return e&&(e=e.split(";",2)[0]),e&&("text/html"==e?"html":"application/json"==e?"json":v.test(e)?"script":m.test(e)&&"xml")||"text"}function i(e,t){return""==t?e:(e+"&"+t).replace(/[&?]{1,2}/,"?")}function o(e){e.processData&&e.data&&!t.isString(e.data)&&(e.data=$.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=i(e.url,e.data),e.data=void 0)}function a(e,t,n,r){var i=n.context,o="success";n.success.call(i,e,o,t),u(o,t,n)}function s(e,t,n,r,i){var o=r.context;r.error.call(o,n,t,e),u(t,n,r)}function u(e,t,n){var r=n.context;n.complete.call(r,t,e)}function l(e){var i=t.mixin({},e),u=new p;t.safeMixin(i,y),!i.crossDomain,o(i);var l,c=i.dataType,f=i.accepts[c],h={},d=function(e,t){h[e.toLowerCase()]=[e,t]},v=/^([\w-]+:)\/\//.test(i.url)?RegExp.$1:window.location.protocol,m=i.xhr(),b=m.setRequestHeader;if(i.crossDomain||d("X-Requested-With","XMLHttpRequest"),d("Accept",f||"*/*"),(f=i.mimeType||f)&&(f.indexOf(",")>-1&&(f=f.split(",",2)[0]),m.overrideMimeType&&m.overrideMimeType(f)),(i.contentType||i.contentType!==!1&&i.data&&"GET"!=i.type.toUpperCase())&&d("Content-Type",i.contentType||"application/x-www-form-urlencoded"),i.headers)for(name in i.headers)d(name,i.headers[name]);m.setRequestHeader=d,m.onreadystatechange=function(){if(4==m.readyState){m.onreadystatechange=n,clearTimeout(l);var e,t=!1;if(m.status>=200&&m.status<300||304==m.status||0==m.status&&"file:"==v){c=c||r(i.mimeType||m.getResponseHeader("content-type")),e=m.responseText;try{"script"==c?(0,eval)(e):"xml"==c?e=m.responseXML:"json"==c&&(e=g.test(e)?null:JSON.parse(e))}catch(o){t=o}t?s(t,"parsererror",m,i,u):a(e,m,i,u)}else s(m.statusText||null,m.status?"error":"abort",m,i,u)}};var k=!("async"in i)||i.async;m.open(i.type,i.url,k,i.username,i.password);for(name in h)b.apply(m,h[name]);return i.timeout>0&&(l=setTimeout(function(){m.onreadystatechange=n,m.abort(),s(null,"timeout",m,i,u)},i.timeout)),m.send(i.data?i.data:null),m}function c(){return l(parseArguments.apply(null,arguments))}function f(){var e=parseArguments.apply(null,arguments);return e.type="POST",l(e)}function h(){var e=parseArguments.apply(null,arguments);return e.dataType="json",l(e)}function d(){return d}var p=t.Deferred,g=/^\s*$/,v=/^(?:text|application)\/javascript/i,m=/^(?:text|application)\/xml/i,y={type:"GET",beforeSend:n,success:n,error:n,complete:n,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0};return t.mixin(d,{ajax:l,get:c,gtJSON:h,post:f}),e.http=d}),e("skylarkjs/http",["skylark-utils/http"],function(e){return e}),e("skylark-utils/images",["./skylark","./langx"],function(e,t){function n(){return n}var r={1:!0,9:!0,11:!0},i=t.Evented.inherit({init:function(e,n,r){return this instanceof i?("string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=t.makeArray(e),this.options=t.mixin({},this.options),"function"==typeof n?r=n:t.mixin(this.options,n),r&&this.on("always",r),this.getImages(),void setTimeout(function(){this.check()}.bind(this))):new i(e,n,r)},options:{},getImages:function(){this.images=[],this.elements.forEach(this.addElementImages,this)},addElementImages:function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&r[t]){for(var n=e.querySelectorAll("img"),i=0;i>1))-h.width)}[n.charAt(1)],p={T:a.y,B:a.y-h.height,M:Math.max(u.top,Math.min(u.top+u.height,a.y+(h.height>>1))-h.height)}[n.charAt(0)],g=Math.max(u.left,d),v=Math.max(u.top,p),m=Math.min(u.left+u.width,d+h.width),y=Math.min(u.top+u.height,p+h.height),b=m-g,k=y-v;return s+=h.width-b+(h.height-k),(null==l||s>1)}[e.charAt(1)],y:{T:b,B:b+w,M:b+(w>>1)}[e.charAt(0)]}})}var a;if("string"==typeof t||"offsetWidth"in t||"ownerSVGElement"in t){if(a=domGeometry.position(t,!0),/^(above|below)/.test(n[0])){var u=domGeometry.getBorderExtents(t),l=t.firstChild?domGeometry.getBorderExtents(t.firstChild):{t:0,l:0,b:0,r:0},c=domGeometry.getBorderExtents(e),f=e.firstChild?domGeometry.getBorderExtents(e.firstChild):{t:0,l:0,b:0,r:0};a.y+=Math.min(u.t+l.t,c.t+f.t),a.h-=Math.min(u.t+l.t,c.t+f.t)+Math.min(u.b+l.b,c.b+f.b)}}else a=t;if(t.parentNode)for(var h="absolute"==domStyle.getComputedStyle(t).position,d=t.parentNode;d&&1==d.nodeType&&"BODY"!=d.nodeName;){var p=domGeometry.position(d,!0),g=domStyle.getComputedStyle(d);if(/relative|absolute/.test(g.position)&&(h=!1),!h&&/hidden|auto|scroll/.test(g.overflow)){var v=Math.min(a.y+a.h,p.y+p.h),m=Math.min(a.x+a.w,p.x+p.w);a.x=Math.max(a.x,p.x),a.y=Math.max(a.y,p.y),a.h=v-a.y,a.w=m-a.x}"absolute"==g.position&&(h=!0),d=d.parentNode}var y=a.x,b=a.y,k="w"in a?a.w:a.w=a.width,w="h"in a?a.h:(kernel.deprecated("place.around: dijit/place.__Rectangle: { x:"+y+", y:"+b+", height:"+a.height+", width:"+k+" } has been deprecated. Please use { x:"+y+", y:"+b+", h:"+a.height+", w:"+k+" }","","2.0"),a.h=a.height),x=[];array.forEach(n,function(e){var t=r;switch(e){case"above-centered":o("TM","BM");break;case"below-centered":o("BM","TM");break;case"after-centered":t=!t;case"before-centered":o(t?"ML":"MR",t?"MR":"ML");break;case"after":t=!t;case"before":o(t?"TL":"TR",t?"TR":"TL"),o(t?"BL":"BR",t?"BR":"BL");break;case"below-alt":t=!t;case"below":o(t?"BL":"BR",t?"TL":"TR"),o(t?"BR":"BL",t?"TR":"TL");break;case"above-alt":t=!t;case"above":o(t?"TL":"TR",t?"BL":"BR"),o(t?"TR":"TL",t?"BR":"BL");break;default:o(e.aroundCorner,e.corner)}});var E=s(e,x,i,{w:k,h:w});return E.aroundNodePos=a,E}function c(e,t){function r(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;nv.maxX&&(n=v.maxX),ov.maxY&&(o=v.maxY)),i.relativePosition(e,{left:n,top:o}),t.preventDefault(),b&&b(t)},c=function(e){r(e),o.off(m,"mousemove touchmove",w).off(m,"mouseup touchend",c),n.remove(s),k&&k(e)};return o.on(g,"mousedown touchstart",l),{remove:function(){o.off(g)}}}function f(){return f}var h=(o.on,o.off,r.attr,r.removeAttr,i.pagePosition,a.addClass,i.height,Array.prototype.some),d=Array.prototype.map;return t.mixin(f,{around:l,at:u,movable:c}),e.mover=f}),e("skylarkjs/mover",["skylark-utils/mover"],function(e){return e}),e("skylarkjs/noder",["skylark-utils/noder"],function(e){return e}),e("skylark-utils/query",["./skylark","./langx","./noder","./datax","./eventer","./finder","./geom","./styler","./fx"],function(e,t,n,r,i,o,a,s,u){function l(e,t){return function(){var n=this,r=k.call(arguments),i=$.map(n,function(n,i){return e.apply(t,[n].concat(r))});return $(A(i))}}function c(e,t,n){return function(r){var i=(k.call(arguments),this.map(function(i,o){if(o.querySelector)return e.apply(t,n?[o]:[o,r])}));return n&&r?i.filter(r):i}}function f(e,t,n){return function(r,i){k.call(arguments);void 0===i&&(i=r,r=void 0);var o=this.map(function(o,a){if(a.querySelector)return e.apply(t,n?[a,r]:[a,i,r])});return n&&i?o.filter(i):o}}function h(e,t){return function(){var n=this,r=k.call(arguments);return this.each(function(n){e.apply(t,[this].concat(r))}),n}}function d(e,t,n){return function(r){var i=this,o=k.call(arguments);return x.call(i,function(i,a){C(i,r,a,n(i));e.apply(t,[i,r].concat(o.slice(1)))}),i}}function p(e,t){return function(){var n=this,r=k.call(arguments);return y.call(n,function(n){return e.apply(t,[n].concat(r))})}}function g(e,n,r){return function(i,o){var a=this,s=k.call(arguments);return t.isPlainObject(i)||t.isDefined(o)?(x.call(a,function(t,a){var u;u=r?C(t,o,a,r(t,i)):o,e.apply(n,[t].concat(s))}),a):a[0]?e.apply(n,[a[0],i]):void 0}}function v(e,n,r){return function(i){var o=this;return t.isDefined(i)?(x.call(o,function(t,o){var a;a=r?C(t,i,o,r(t)):i,e.apply(n,[t,a])}),o):o[0]?e.apply(n,[o[0]]):void 0}}var m,y=Array.prototype.some,b=Array.prototype.push,k=(Array.prototype.every,Array.prototype.concat,Array.prototype.slice),w=(Array.prototype.map,Array.prototype.filter),x=Array.prototype.forEach,E=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,C=t.funcArg,T=t.isArrayLike,S=t.isString,A=t.uniq,_=t.isFunction,N=t.type,j=t.isArray,P=(t.isWindow,t.isDocument,t.isObject),L=(t.isPlainObject,t.compact,t.flatten,t.camelCase,t.dasherize,o.children,t.klass({klassName:"SkNodeList",init:function(e,r){var i,a,s,u,l=this;if(e&&(l.context=r=r||n.doc(),S(e)?(l.selector=e,i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:E.exec(e),i?i[1]?(a=n.createFragment(e),t.isPlainObject(r)&&(u=r)):(s=o.byId(i[2],n.ownerDoc(r)),s&&(a=[s])):a=o.descendants(r,e)):a=j(e)?e:[e]),a&&(b.apply(l,a),u))for(var c in u)t.isFunction(this[c])?this[c](u[c]):this.attr(c,u[c]);return l}},Array)),R=function(){function e(e,r,i){return function(i){var o,a=t.map(arguments,function(e){return o=N(e),"object"==o||"array"==o||null==e?e:n.createFragment(e)});return a.length<1?this:(this.each(function(t){e.apply(r,[this,a,t>0])}),this)}}m=function(e){return e instanceof L},init=function(e,t){return new L(e,t)};var y=function(e,t){return _(e)?void i.ready(function(){e(y)}):m(e)?e:t&&m(t)&&S(e)?t.find(e):init(e,t)};y.fn=L.prototype,t.mixin(y.fn,{map:function(e){return y(A(t.map(this,function(t,n){return e.call(t,n,t)})))},slice:function(){return y(k.apply(this,arguments))},get:function(e){return void 0===e?k.call(this):this[e>=0?e:e+this.length]},toArray:function(){return k.call(this)},size:function(){return this.length},remove:h(n.remove,n),each:function(e){return t.each(this,e),this},filter:function(e){return _(e)?this.not(this.not(e)):y(w.call(this,function(t){return o.matches(t,e)}))},add:function(e,t){return y(A(this.toArray().concat(y(e,t).toArray())))},is:function(e){return this.length>0&&o.matches(this[0],e)},not:function(e){var t=[];if(_(e)&&void 0!==e.call)this.each(function(n){e.call(this,n)||t.push(this)});else{var n="string"==typeof e?this.filter(e):T(e)&&_(e.item)?k.call(e):y(e);this.forEach(function(e){n.indexOf(e)<0&&t.push(e)})}return y(t)},has:function(e){return this.filter(function(){return P(e)?n.contains(this,e):y(this).find(e).size()})},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:c(o.descendants,o),closest:c(o.closest,o),parents:c(o.ancestors,o),parentsUntil:f(o.ancestors,o),parent:c(o.parent,o),children:c(o.children,o),contents:l(n.contents,n),empty:h(n.empty,n),pluck:function(e){return t.map(this,function(t){return t[e]})},show:h(u.show,u),replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=_(e);if(this[0]&&!t)var n=y(e).get(0),r=n.parentNode||this.length>1;return this.each(function(i){y(this).wrapAll(t?e.call(this,i):r?n.cloneNode(!0):n)})},wrapAll:function(e){if(this[0]){y(this[0]).before(e=y(e));for(var t;(t=e.children()).length;)e=t.first();y(e).append(this)}return this},wrapInner:function(e){var t=_(e);return this.each(function(n){var r=y(this),i=r.contents(),o=t?e.call(this,n):e;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(e){return 0===this.parent().children().length?this.parent(e).not("body").each(function(){y(this).replaceWith(document.createTextNode(this.childNodes[0].textContent))}):this.parent().each(function(){y(this).replaceWith(y(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:h(u.hide,u),toggle:function(e){return this.each(function(){var t=y(this);(void 0===e?"none"==t.css("display"):e)?t.show():t.hide()})},prev:function(e){return y(this.pluck("previousElementSibling")).filter(e||"*")},prevAll:c(o.previousSibling,o),next:function(e){return y(this.pluck("nextElementSibling")).filter(e||"*")},nextAll:c(o.nextSiblings,o),siblings:c(o.siblings,o),html:v(n.html,n,n.html),text:v(r.text,r,r.text),attr:g(r.attr,r,r.attr),removeAttr:h(r.removeAttr,r),prop:g(r.prop,r,r.prop),removeProp:h(r.removeProp,r),data:g(r.data,r,r.data),removeData:h(r.removeData,r),val:v(r.val,r,r.val),offset:v(a.pageRect,a,a.pageRect),style:g(s.css,s),css:g(s.css,s),index:function(e){return e?this.indexOf(y(e)[0]):this.parent().children().indexOf(this[0])},hasClass:p(s.hasClass,s),addClass:d(s.addClass,s,s.className),removeClass:d(s.removeClass,s,s.className),toggleClass:d(s.toggleClass,s,s.className),scrollTop:v(a.scrollTop,a),scrollLeft:v(a.scrollLeft,a),position:function(){if(this.length){var e=this[0];return a.relativePosition(e)}},offsetParent:l(a.offsetParent,a)}),y.fn.detach=y.fn.remove,y.fn.size=v(a.size,a),y.fn.width=v(a.width,a,a.width),y.fn.height=v(a.height,a,a.height),["width","height"].forEach(function(e){var t=e.replace(/./,function(e){return e[0].toUpperCase()});y.fn["outer"+t]=function(t,n){if(arguments.length?"boolean"!=typeof t&&(n=t,t=!1):(t=!1,n=void 0),void 0===n){var r=this[0];if(!r)return;var i=a.size(r);if(t){var o=a.marginExtents(r);i.width=i.width+o.left+o.right,i.height=i.height+o.top+o.bottom}return"width"===e?i.width:i.height}return this.each(function(r,i){var o={},s=a.marginExtents(i);"width"===e?(o.width=n,t&&(o.width=o.width-s.left-s.right)):(o.height=n,t&&(o.height=o.height-s.top-s.bottom)),a.size(i,o)})}}),y.fn.innerWidth=v(a.width,a,a.width),y.fn.innerHeight=v(a.height,a,a.height);n.traverse;return y.fn.after=e(n.after,n),y.fn.prepend=e(n.prepend,n),y.fn.before=e(n.before,n),y.fn.append=e(n.append,n),y.fn.insertAfter=function(e){return y(e).after(this),this},y.fn.insertBefore=function(e){return y(e).before(this),this},y.fn.appendTo=function(e){return y(e).append(this),this},y.fn.prependTo=function(e){return y(e).prepend(this),this},y}();return function(e){e.fn.on=h(i.on,i),e.fn.off=h(i.off,i),e.fn.trigger=h(i.trigger,i),"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e,n){return 0 in arguments?this.on(t,e,n):this.trigger(t)}}),e.fn.one=function(e,n,r,i){return t.isString(n)||t.isFunction(i)||(i=r,r=n,n=null),t.isFunction(r)&&(i=r,r=null),this.on(e,n,r,i,1)},e.fn.animate=h(u.animate,u),e.fn.show=h(u.show,u),e.fn.hide=h(u.hide,u),e.fn.toogle=h(u.toogle,u),e.fn.fadeTo=h(u.fadeTo,u),e.fn.fadeIn=h(u.fadeIn,u),e.fn.fadeOut=h(u.fadeOut,u),e.fn.fadeToggle=h(u.fadeToggle,u),e.fn.slideDown=h(u.slideDown,u),e.fn.slideToggle=h(u.slideToggle,u),e.fn.slideUp=h(u.slideUp,u)}(R),function(e){e.fn.end=function(){return this.prevObject||e()},e.fn.andSelf=function(){return this.add(this.prevObject||e())},e.fn.addBack=function(e){return this.prevObject?e?this.add(this.prevObject.filter(e)):this.add(this.prevObject):this},"filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings".split(",").forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=n.apply(this,arguments);return e.prevObject=this,e}})}(R),function(e){e.fn.query=e.fn.find,e.fn.place=function(e,r){return t.isString(e)?e=o.descendant(e):m(e)&&(e=e[0]),this.each(function(t,i){switch(r){case"before":n.before(e,i);break;case"after":n.after(e,i);break;case"replace":n.replace(e,i);break;case"only":n.empty(e),n.append(e,i);break;case"first":n.prepend(e,i);break;default:n.append(e,i)}})},e.fn.addContent=function(e,n){return e.template&&(e=t.substitute(e.template,e)),this.append(e)},e.fn.replaceClass=function(e,t){return this.removeClass(t),this.addClass(e),this}}(R),e.query=R}),e("skylarkjs/query",["skylark-utils/query"],function(e){return e}),e("skylark-utils/scripter",["./skylark","./langx","./noder","./finder"],function(e,t,n,r){function i(){return i}var o=document.getElementsByTagName("head")[0],a={},s={},u=0;return t.mixin(i,{loadJavaScript:function(e,t,n){var r=a[e];if(r||(r=a[e]={state:0,loadedCallbacks:[],errorCallbacks:[]}),r.loadedCallbacks.push(t),r.errorCallbacks.push(n),1===r.state)r.node.onload();else if(r.state===-1)r.node.onerror();else{var i=r.node=document.createElement("script"),l=r.id=u++;i.type="text/javascript",i.async=!1,i.defer=!1,startTime=(new Date).getTime(),o.appendChild(i),i.onload=function(){r.state=1;for(var e=r.loadedCallbacks,t=e.length;t--;)e[t]();r.loadedCallbacks=[],r.errorCallbacks=[]},i.onerror=function(){r.state=-1;for(var e=r.errorCallbacks,t=e.length;t--;)e[t]();r.loadedCallbacks=[],r.errorCallbacks=[]},i.src=e,s[l]=i}return r.id},deleteJavaScript:function(e){var t=s[e];if(t){var r=t.src;n.remove(t),delete s[e],delete a[r]}}}),e.scripter=i}),e("skylarkjs/scripter",["skylark-utils/scripter"],function(e){return e}),e("skylarkjs/styler",["skylark-utils/styler"],function(e){return e}),e("skylark-utils/velm",["./skylark","./langx","./datax","./dnd","./eventer","./filer","./finder","./fx","./geom","./mover","./noder","./styler"],function(e,t,n,r,i,o,a,s,u,l,c,f){function h(e,n){return function(){var r=this,i=r.domNode,o=e.apply(n,[i].concat(p.call(arguments)));if(o){if(o===n)return r;o instanceof HTMLElement?o=new g(o):t.isArrayLike(o)&&(o=d.call(o,function(e){return e instanceof HTMLElement?new g(o):e}))}return o}}var d=Array.prototype.map,p=Array.prototype.slice,g=t.klass({klassName:"VisualElement",init:function(e){t.isString(e)&&(e=document.getElementById(e)),this.domNode=e}}),v=new g(document.body),m=function(e){return e?new g(e):v};return t.mixin(m,{batch:function(e,t,n){return e.forEach(function(e){var r=e instanceof g?e:m(e);r[t].apply(r,n)}),this},root:new g(document.body),VisualElement:g,partial:function(e,t){var n={};n[e]=t,g.partial(n)},delegate:function(e,t){var n={};e.forEach(function(e){n[e]=h(t[e],t)}),g.partial(n)}}),m.delegate(["attr","data","prop","removeAttr","removeData","text","val"],n),m.delegate(["draggable","droppable"],r),m.delegate(["off","on","one","shortcuts","trigger"],i),m.delegate(["picker","dropzone"],o),m.delegate(["ancestor","ancestors","children","descendant","find","findAll","firstChild","lastChild","matches","nextSibling","nextSiblings","parent","previousSibling","previousSiblings","siblings"],a),m.find=function(e){return"body"===e?this.root:this.root.descendant(e)},m.delegate(["animate","fadeIn","fadeOut","fadeTo","fadeToggle","hide","scrollToTop","show","toggle"],s),m.delegate(["borderExtents","boundingPosition","boundingRect","clientHeight","clientSize","clientWidth","contentRect","height","marginExtents","offsetParent","paddingExtents","pagePosition","pageRect","relativePosition","relativeRect","scrollIntoView","scrollLeft","scrollTop","size","width"],u),m.delegate(["movable"],r),m.delegate(["after","append","before","clone","contains","contents","empty","html","isChildOf","ownerDoc","prepend","remove","replace","reverse","throb","traverse","wrapper","wrapperInner","unwrap"],c),m.delegate(["addClass","className","css","hasClass","hide","isInvisible","removeClass","show","toggleClass"],f),e.velm=m}),e("skylarkjs/velm",["skylark-utils/velm"],function(e){return e}),e("skylark-utils/widget",["./skylark","./langx","./noder","./styler","./geom","./eventer","./query"],function(e,t,n,r,i,o,a){function s(){return s}var u=/^(\S+)\s*(.*)$/,l=t.Evented.inherit({init:function(e,n){t.isHtmlNode(e)||(n=e,e=null),this.el=e,n&&t.mixin(this,n),this.cid||(this.cid=t.uniqueId("w")),this._ensureElement()},tagName:"div",$:function(e){return this.$el.find(e)},render:function(){return this},remove:function(){return this._removeElement(),this.unlistenTo(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=s.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=t.result(this,"events")),!e)return this;this.undelegateEvents();for(var n in e){var r=e[n];if(t.isFunction(r)||(r=this[r]),r){var i=n.match(u);this.delegate(i[1],i[2],t.proxy(r,this))}}return this},delegate:function(e,t,n){return this.$el.on(e+".delegateEvents"+this.uid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.uid),this},undelegate:function(e,t,n){return this.$el.off(e+".delegateEvents"+this.uid,t,n),this},_createElement:function(e,t){return n.createElement(e,t)},_ensureElement:function(){if(this.el)this.setElement(t.result(this,"el"));else{var e=t.mixin({},t.result(this,"attributes"));this.id&&(e.id=t.result(this,"id")),this.className&&(e["class"]=t.result(this,"className")),this.setElement(this._createElement(t.result(this,"tagName"),e)),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}});return t.mixin(s,{$:a,Widget:l}),e.widget=s}),e("skylarkjs/widget",["skylark-utils/widget"],function(e){return e}),e("skylarkjs/main",["./core","./browser","./css","./datax","./dnd","./eventer","./filer","./finder","./fx","./geom","./http","./images","./mover","./noder","./query","./scripter","./styler","./velm","./widget"],function(e){return e}),e("skylarkjs",["skylarkjs/main"],function(e){return e})},this); +//# sourceMappingURL=sourcemaps/skylarkjs.js.map diff --git a/libs/skylarkjs/package.json b/libs/skylarkjs/package.json new file mode 100644 index 000000000..298ea1724 --- /dev/null +++ b/libs/skylarkjs/package.json @@ -0,0 +1,24 @@ +{ + "name": "skylarkjs", + "filename": "skylarkjs.min.js", + "version": "0.9.8", + "description": "An Elegant JavaScript Library and HTML5 Application Framework.", + "homepage": "http://skylarkjs.org", + "keywords": [ + "skylark", + "skylarkjs", + "javacript", + "library", + "framework", + "slax" + ], + "maintainers": [{ + "name": "lihongwang", + "web": "https://github.com/lihongwang", + "mail": "lhw@hudaokeji.com" + }], + "repositories": [{ + "type": "git", + "url": "https://github.com/skylarkjs/skylark" + }] +} \ No newline at end of file