text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```javascript
/**
* XMLHttp client.
*/
var _ = require('../../util');
var Promise = require('../../promise');
module.exports = function (request) {
return new Promise(function (resolve) {
var xhr = new XMLHttpRequest(), response = {request: request}, handler;
request.cancel = function () {
xhr.abort();
};
xhr.open(request.method, _.url(request), true);
handler = function (event) {
response.data = xhr.responseText;
response.status = xhr.status;
response.statusText = xhr.statusText;
response.headers = xhr.getAllResponseHeaders();
resolve(response);
};
xhr.timeout = 0;
xhr.onload = handler;
xhr.onabort = handler;
xhr.onerror = handler;
xhr.ontimeout = function () {};
xhr.onprogress = function () {};
if (_.isPlainObject(request.xhr)) {
_.extend(xhr, request.xhr);
}
if (_.isPlainObject(request.upload)) {
_.extend(xhr.upload, request.upload);
}
_.each(request.headers || {}, function (value, header) {
xhr.setRequestHeader(header, value);
});
xhr.send(request.data);
});
};
``` | /content/code_sandbox/public/vendor/vue-resource/src/http/client/xhr.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 243 |
```javascript
/**
* JSONP client.
*/
var _ = require('../../util');
var Promise = require('../../promise');
module.exports = function (request) {
return new Promise(function (resolve) {
var callback = '_jsonp' + Math.random().toString(36).substr(2), response = {request: request, data: null}, handler, script;
request.params[request.jsonp] = callback;
request.cancel = function () {
handler({type: 'cancel'});
};
script = document.createElement('script');
script.src = _.url(request);
script.type = 'text/javascript';
script.async = true;
window[callback] = function (data) {
response.data = data;
};
handler = function (event) {
if (event.type === 'load' && response.data !== null) {
response.status = 200;
} else if (event.type === 'error') {
response.status = 404;
} else {
response.status = 0;
}
resolve(response);
delete window[callback];
document.body.removeChild(script);
};
script.onload = handler;
script.onerror = handler;
document.body.appendChild(script);
});
};
``` | /content/code_sandbox/public/vendor/vue-resource/src/http/client/jsonp.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 252 |
```javascript
/**
* vue-resource v0.7.0
* path_to_url
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueResource=e():t.VueResource=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t){var e=n(1);e.config=t.config,e.warning=t.util.warn,e.nextTick=t.util.nextTick,t.url=n(2),t.http=n(8),t.resource=n(23),t.Promise=n(10),Object.defineProperties(t.prototype,{$url:{get:function(){return e.options(t.url,this,this.$options.url)}},$http:{get:function(){return e.options(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){return function(e){return new t.Promise(e,this)}.bind(this)}}})}window.Vue&&Vue.use(r),t.exports=r},function(t,e){function n(t,e,o){for(var i in e)o&&(r.isPlainObject(e[i])||r.isArray(e[i]))?(r.isPlainObject(e[i])&&!r.isPlainObject(t[i])&&(t[i]={}),r.isArray(e[i])&&!r.isArray(t[i])&&(t[i]=[]),n(t[i],e[i],o)):void 0!==e[i]&&(t[i]=e[i])}var r=e,o=[],i=window.console;r.warn=function(t){i&&r.warning&&(!r.config.silent||r.config.debug)&&i.warn("[VueResource warn]: "+t)},r.error=function(t){i&&i.error(t)},r.trim=function(t){return t.replace(/^\s*|\s*$/g,"")},r.toLower=function(t){return t?t.toLowerCase():""},r.isArray=Array.isArray,r.isString=function(t){return"string"==typeof t},r.isFunction=function(t){return"function"==typeof t},r.isObject=function(t){return null!==t&&"object"==typeof t},r.isPlainObject=function(t){return r.isObject(t)&&Object.getPrototypeOf(t)==Object.prototype},r.options=function(t,e,n){return n=n||{},r.isFunction(n)&&(n=n.call(e)),r.merge(t.bind({$vm:e,$options:n}),t,{$options:n})},r.each=function(t,e){var n,o;if("number"==typeof t.length)for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(r.isObject(t))for(o in t)t.hasOwnProperty(o)&&e.call(t[o],t[o],o);return t},r.defaults=function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t},r.extend=function(t){var e=o.slice.call(arguments,1);return e.forEach(function(e){n(t,e)}),t},r.merge=function(t){var e=o.slice.call(arguments,1);return e.forEach(function(e){n(t,e,!0)}),t}},function(t,e,n){function r(t,e){var n,i=t;return s.isString(t)&&(i={url:t,params:e}),i=s.merge({},r.options,this.$options,i),r.transforms.forEach(function(t){n=o(t,n,this.$vm)},this),n(i)}function o(t,e,n){return function(r){return t.call(n,r,e)}}function i(t,e,n){var r,o=s.isArray(e),a=s.isPlainObject(e);s.each(e,function(e,u){r=s.isObject(e)||s.isArray(e),n&&(u=n+"["+(a||r?u:"")+"]"),!n&&o?t.add(e.name,e.value):r?i(t,e,u):t.add(u,e)})}var s=n(1),a=document.documentMode,u=document.createElement("a");r.options={url:"",root:null,params:{}},r.transforms=[n(3),n(5),n(6),n(7)],r.params=function(t){var e=[],n=encodeURIComponent;return e.add=function(t,e){s.isFunction(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},i(e,t),e.join("&").replace(/%20/g,"+")},r.parse=function(t){return a&&(u.href=t,t=u.href),u.href=t,{href:u.href,protocol:u.protocol?u.protocol.replace(/:$/,""):"",port:u.port,host:u.host,hostname:u.hostname,pathname:"/"===u.pathname.charAt(0)?u.pathname:"/"+u.pathname,search:u.search?u.search.replace(/^\?/,""):"",hash:u.hash?u.hash.replace(/^#/,""):""}},t.exports=s.url=r},function(t,e,n){var r=n(4);t.exports=function(t){var e=[],n=r.expand(t.url,t.params,e);return e.forEach(function(e){delete t.params[e]}),n}},function(t,e){e.expand=function(t,e,n){var r=this.parse(t),o=r.expand(e);return n&&n.push.apply(n,r.vars),o},e.parse=function(t){var n=["+","#",".","/",";","?","&"],r=[];return{vars:r,expand:function(o){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,i,s){if(i){var a=null,u=[];if(-1!==n.indexOf(i.charAt(0))&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(t){var n=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);u.push.apply(u,e.getValues(o,a,n[1],n[2]||n[3])),r.push(n[1])}),a&&"+"!==a){var c=",";return"?"===a?c="&":"#"!==a&&(c=a),(0!==u.length?a:"")+u.join(c)}return u.join(",")}return e.encodeReserved(s)})}}},e.getValues=function(t,e,n,r){var o=t[n],i=[];if(this.isDefined(o)&&""!==o)if("string"==typeof o||"number"==typeof o||"boolean"==typeof o)o=o.toString(),r&&"*"!==r&&(o=o.substring(0,parseInt(r,10))),i.push(this.encodeValue(e,o,this.isKeyOperator(e)?n:null));else if("*"===r)Array.isArray(o)?o.filter(this.isDefined).forEach(function(t){i.push(this.encodeValue(e,t,this.isKeyOperator(e)?n:null))},this):Object.keys(o).forEach(function(t){this.isDefined(o[t])&&i.push(this.encodeValue(e,o[t],t))},this);else{var s=[];Array.isArray(o)?o.filter(this.isDefined).forEach(function(t){s.push(this.encodeValue(e,t))},this):Object.keys(o).forEach(function(t){this.isDefined(o[t])&&(s.push(encodeURIComponent(t)),s.push(this.encodeValue(e,o[t].toString())))},this),this.isKeyOperator(e)?i.push(encodeURIComponent(n)+"="+s.join(",")):0!==s.length&&i.push(s.join(","))}else";"===e?i.push(encodeURIComponent(n)):""!==o||"&"!==e&&"?"!==e?""===o&&i.push(""):i.push(encodeURIComponent(n)+"=");return i},e.isDefined=function(t){return void 0!==t&&null!==t},e.isKeyOperator=function(t){return";"===t||"&"===t||"?"===t},e.encodeValue=function(t,e,n){return e="+"===t||"#"===t?this.encodeReserved(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e},e.encodeReserved=function(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}},function(t,e,n){function r(t){return o(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function o(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,e?"%20":"+")}var i=n(1);t.exports=function(t,e){var n=[],o=e(t);return o=o.replace(/(\/?):([a-z]\w*)/gi,function(e,o,s){return i.warn("The `:"+s+"` parameter syntax has been deprecated. Use the `{"+s+"}` syntax instead."),t.params[s]?(n.push(s),o+r(t.params[s])):""}),n.forEach(function(e){delete t.params[e]}),o}},function(t,e,n){var r=n(1);t.exports=function(t,e){var n=Object.keys(r.url.options.params),o={},i=e(t);return r.each(t.params,function(t,e){-1===n.indexOf(e)&&(o[e]=t)}),o=r.url.params(o),o&&(i+=(-1==i.indexOf("?")?"?":"&")+o),i}},function(t,e,n){var r=n(1);t.exports=function(t,e){var n=e(t);return r.isString(t.root)&&!n.match(/^(https?:)?\//)&&(n=t.root+"/"+n),n}},function(t,e,n){function r(t,e){var n,u,c=i;return r.interceptors.forEach(function(t){c=a(t,this.$vm)(c)},this),e=o.isObject(t)?t:o.extend({url:t},e),n=o.merge({},r.options,this.$options,e),u=c(n).bind(this.$vm).then(function(t){return t.ok?t:s.reject(t)},function(t){return t instanceof Error&&o.error(t),s.reject(t)}),n.success&&u.success(n.success),n.error&&u.error(n.error),u}var o=n(1),i=n(9),s=n(10),a=n(13),u={"Content-Type":"application/json"};r.options={method:"get",data:"",params:{},headers:{},xhr:null,upload:null,jsonp:"callback",beforeSend:null,crossOrigin:null,emulateHTTP:!1,emulateJSON:!1,timeout:0},r.interceptors=[n(14),n(15),n(16),n(18),n(19),n(20),n(21)],r.headers={put:u,post:u,patch:u,"delete":u,common:{Accept:"application/json, text/plain, */*"},custom:{"X-Requested-With":"XMLHttpRequest"}},["get","put","post","patch","delete","jsonp"].forEach(function(t){r[t]=function(e,n,r,i){return o.isFunction(n)&&(i=r,r=n,n=void 0),o.isObject(r)&&(i=r,r=void 0),this(e,o.extend({method:t,data:n,success:r},i))}}),t.exports=o.http=r},function(t,e,n){function r(t){var e,n,r,i={};return o.isString(t)&&o.each(t.split("\n"),function(t){r=t.indexOf(":"),n=o.trim(o.toLower(t.slice(0,r))),e=o.trim(t.slice(r+1)),i[n]?o.isArray(i[n])?i[n].push(e):i[n]=[i[n],e]:i[n]=e}),i}var o=n(1),i=n(10),s=n(12);t.exports=function(t){var e=(t.client||s)(t);return i.resolve(e).then(function(t){if(t.headers){var e=r(t.headers);t.headers=function(t){return t?e[o.toLower(t)]:e}}return t.ok=t.status>=200&&t.status<300,t})}},function(t,e,n){function r(t,e){t instanceof i?this.promise=t:this.promise=new i(t.bind(e)),this.context=e}var o=n(1),i=window.Promise||n(11);r.all=function(t,e){return new r(i.all(t),e)},r.resolve=function(t,e){return new r(i.resolve(t),e)},r.reject=function(t,e){return new r(i.reject(t),e)},r.race=function(t,e){return new r(i.race(t),e)};var s=r.prototype;s.bind=function(t){return this.context=t,this},s.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),this.promise=this.promise.then(t,e),this},s["catch"]=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),this.promise=this.promise["catch"](t),this},s["finally"]=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),i.reject(e)})},s.success=function(t){return o.warn("The `success` method has been deprecated. Use the `then` method instead."),this.then(function(e){return t.call(this,e.data,e.status,e)||e})},s.error=function(t){return o.warn("The `error` method has been deprecated. Use the `catch` method instead."),this["catch"](function(e){return t.call(this,e.data,e.status,e)||e})},s.always=function(t){o.warn("The `always` method has been deprecated. Use the `finally` method instead.");var e=function(e){return t.call(this,e.data,e.status,e)||e};return this.then(e,e)},t.exports=r},function(t,e,n){function r(t){this.state=a,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var o=n(1),i=0,s=1,a=2;r.reject=function(t){return new r(function(e,n){n(t)})},r.resolve=function(t){return new r(function(e,n){e(t)})},r.all=function(t){return new r(function(e,n){function o(n){return function(r){s[n]=r,i+=1,i===t.length&&e(s)}}var i=0,s=[];0===t.length&&e(s);for(var a=0;a<t.length;a+=1)r.resolve(t[a]).then(o(a),n)})},r.race=function(t){return new r(function(e,n){for(var o=0;o<t.length;o+=1)r.resolve(t[o]).then(e,n)})};var u=r.prototype;u.resolve=function(t){var e=this;if(e.state===a){if(t===e)throw new TypeError("Promise settled with itself.");var n=!1;try{var r=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof r)return void r.call(t,function(t){n||e.resolve(t),n=!0},function(t){n||e.reject(t),n=!0})}catch(o){return void(n||e.reject(o))}e.state=i,e.value=t,e.notify()}},u.reject=function(t){var e=this;if(e.state===a){if(t===e)throw new TypeError("Promise settled with itself.");e.state=s,e.value=t,e.notify()}},u.notify=function(){var t=this;o.nextTick(function(){if(t.state!==a)for(;t.deferred.length;){var e=t.deferred.shift(),n=e[0],r=e[1],o=e[2],u=e[3];try{t.state===i?o("function"==typeof n?n.call(void 0,t.value):t.value):t.state===s&&("function"==typeof r?o(r.call(void 0,t.value)):u(t.value))}catch(c){u(c)}}})},u.then=function(t,e){var n=this;return new r(function(r,o){n.deferred.push([t,e,r,o]),n.notify()})},u["catch"]=function(t){return this.then(void 0,t)},t.exports=r},function(t,e,n){var r=n(1),o=n(10);t.exports=function(t){return new o(function(e){var n,o=new XMLHttpRequest,i={request:t};t.cancel=function(){o.abort()},o.open(t.method,r.url(t),!0),n=function(t){i.data=o.responseText,i.status=o.status,i.statusText=o.statusText,i.headers=o.getAllResponseHeaders(),e(i)},o.timeout=0,o.onload=n,o.onabort=n,o.onerror=n,o.ontimeout=function(){},o.onprogress=function(){},r.isPlainObject(t.xhr)&&r.extend(o,t.xhr),r.isPlainObject(t.upload)&&r.extend(o.upload,t.upload),r.each(t.headers||{},function(t,e){o.setRequestHeader(e,t)}),o.send(t.data)})}},function(t,e,n){function r(t,e,n){var r=i.resolve(t);return arguments.length<2?r:r.then(e,n)}var o=n(1),i=n(10);t.exports=function(t,e){return function(n){return o.isFunction(t)&&(t=t.call(e,i)),function(i){return o.isFunction(t.request)&&(i=t.request.call(e,i)),r(i,function(i){return r(n(i),function(n){return o.isFunction(t.response)&&(n=t.response.call(e,n)),n})})}}}},function(t,e,n){var r=n(1);t.exports={request:function(t){return r.isFunction(t.beforeSend)&&t.beforeSend.call(this,t),t}}},function(t,e){t.exports=function(){var t;return{request:function(e){return e.timeout&&(t=setTimeout(function(){e.cancel()},e.timeout)),e},response:function(e){return clearTimeout(t),e}}}},function(t,e,n){var r=n(17);t.exports={request:function(t){return"JSONP"==t.method&&(t.client=r),t}}},function(t,e,n){var r=n(1),o=n(10);t.exports=function(t){return new o(function(e){var n,o,i="_jsonp"+Math.random().toString(36).substr(2),s={request:t,data:null};t.params[t.jsonp]=i,t.cancel=function(){n({type:"cancel"})},o=document.createElement("script"),o.src=r.url(t),o.type="text/javascript",o.async=!0,window[i]=function(t){s.data=t},n=function(t){"load"===t.type&&null!==s.data?s.status=200:"error"===t.type?s.status=404:s.status=0,e(s),delete window[i],document.body.removeChild(o)},o.onload=n,o.onerror=n,document.body.appendChild(o)})}},function(t,e){t.exports={request:function(t){return t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers["X-HTTP-Method-Override"]=t.method,t.method="POST"),t}}},function(t,e,n){var r=n(1);t.exports={request:function(t){return t.emulateJSON&&r.isPlainObject(t.data)&&(t.headers["Content-Type"]="application/x-www-form-urlencoded",t.data=r.url.params(t.data)),r.isObject(t.data)&&/FormData/i.test(t.data.toString())&&delete t.headers["Content-Type"],r.isPlainObject(t.data)&&(t.data=JSON.stringify(t.data)),t},response:function(t){try{t.data=JSON.parse(t.data)}catch(e){}return t}}},function(t,e,n){var r=n(1);t.exports={request:function(t){return t.method=t.method.toUpperCase(),t.headers=r.extend({},r.http.headers.common,t.crossOrigin?{}:r.http.headers.custom,r.http.headers[t.method.toLowerCase()],t.headers),r.isPlainObject(t.data)&&/^(GET|JSONP)$/i.test(t.method)&&(r.extend(t.params,t.data),delete t.data),t}}},function(t,e,n){function r(t){var e=o.url.parse(o.url(t));return e.protocol!==a.protocol||e.host!==a.host}var o=n(1),i=n(22),s="withCredentials"in new XMLHttpRequest,a=o.url.parse(location.href);t.exports={request:function(t){return null===t.crossOrigin&&(t.crossOrigin=r(t)),t.crossOrigin&&(s||(t.client=i),t.emulateHTTP=!1),t}}},function(t,e,n){var r=n(1),o=n(10);t.exports=function(t){return new o(function(e){var n,o=new XDomainRequest,i={request:t};t.cancel=function(){o.abort()},o.open(t.method,r.url(t),!0),n=function(t){i.data=o.responseText,i.status=o.status,i.statusText=o.statusText,e(i)},o.timeout=0,o.onload=n,o.onabort=n,o.onerror=n,o.ontimeout=function(){},o.onprogress=function(){},o.send(t.data)})}},function(t,e,n){function r(t,e,n,s){var a=this,u={};return n=i.extend({},r.actions,n),i.each(n,function(n,r){n=i.merge({url:t,params:e||{}},s,n),u[r]=function(){return(a.$http||i.http)(o(n,arguments))}}),u}function o(t,e){var n,r,o,s=i.extend({},t),a={};switch(e.length){case 4:o=e[3],r=e[2];case 3:case 2:if(!i.isFunction(e[1])){a=e[0],n=e[1],r=e[2];break}if(i.isFunction(e[0])){r=e[0],o=e[1];break}r=e[1],o=e[2];case 1:i.isFunction(e[0])?r=e[0]:/^(POST|PUT|PATCH)$/i.test(s.method)?n=e[0]:a=e[0];break;case 0:break;default:throw"Expected up to 4 arguments [params, data, success, error], got "+e.length+" arguments"}return s.data=n,s.params=i.extend({},s.params,a),r&&(s.success=r),o&&(s.error=o),s}var i=n(1);r.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},"delete":{method:"DELETE"}},t.exports=i.resource=r}])});
``` | /content/code_sandbox/public/vendor/vue-resource/dist/vue-resource.min.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 4,867 |
```javascript
/**
* vue-resource v0.7.0
* path_to_url
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["VueResource"] = factory();
else
root["VueResource"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Install plugin.
*/
function install(Vue) {
var _ = __webpack_require__(1);
_.config = Vue.config;
_.warning = Vue.util.warn;
_.nextTick = Vue.util.nextTick;
Vue.url = __webpack_require__(2);
Vue.http = __webpack_require__(8);
Vue.resource = __webpack_require__(23);
Vue.Promise = __webpack_require__(10);
Object.defineProperties(Vue.prototype, {
$url: {
get: function () {
return _.options(Vue.url, this, this.$options.url);
}
},
$http: {
get: function () {
return _.options(Vue.http, this, this.$options.http);
}
},
$resource: {
get: function () {
return Vue.resource.bind(this);
}
},
$promise: {
get: function () {
return function (executor) {
return new Vue.Promise(executor, this);
}.bind(this);
}
}
});
}
if (window.Vue) {
Vue.use(install);
}
module.exports = install;
/***/ },
/* 1 */
/***/ function(module, exports) {
/**
* Utility functions.
*/
var _ = exports, array = [], console = window.console;
_.warn = function (msg) {
if (console && _.warning && (!_.config.silent || _.config.debug)) {
console.warn('[VueResource warn]: ' + msg);
}
};
_.error = function (msg) {
if (console) {
console.error(msg);
}
};
_.trim = function (str) {
return str.replace(/^\s*|\s*$/g, '');
};
_.toLower = function (str) {
return str ? str.toLowerCase() : '';
};
_.isArray = Array.isArray;
_.isString = function (val) {
return typeof val === 'string';
};
_.isFunction = function (val) {
return typeof val === 'function';
};
_.isObject = function (obj) {
return obj !== null && typeof obj === 'object';
};
_.isPlainObject = function (obj) {
return _.isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
};
_.options = function (fn, obj, options) {
options = options || {};
if (_.isFunction(options)) {
options = options.call(obj);
}
return _.merge(fn.bind({$vm: obj, $options: options}), fn, {$options: options});
};
_.each = function (obj, iterator) {
var i, key;
if (typeof obj.length == 'number') {
for (i = 0; i < obj.length; i++) {
iterator.call(obj[i], obj[i], i);
}
} else if (_.isObject(obj)) {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
iterator.call(obj[key], obj[key], key);
}
}
}
return obj;
};
_.defaults = function (target, source) {
for (var key in source) {
if (target[key] === undefined) {
target[key] = source[key];
}
}
return target;
};
_.extend = function (target) {
var args = array.slice.call(arguments, 1);
args.forEach(function (arg) {
merge(target, arg);
});
return target;
};
_.merge = function (target) {
var args = array.slice.call(arguments, 1);
args.forEach(function (arg) {
merge(target, arg, true);
});
return target;
};
function merge(target, source, deep) {
for (var key in source) {
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] = [];
}
merge(target[key], source[key], deep);
} else if (source[key] !== undefined) {
target[key] = source[key];
}
}
}
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/**
* Service for URL templating.
*/
var _ = __webpack_require__(1);
var ie = document.documentMode;
var el = document.createElement('a');
function Url(url, params) {
var options = url, transform;
if (_.isString(url)) {
options = {url: url, params: params};
}
options = _.merge({}, Url.options, this.$options, options);
Url.transforms.forEach(function (handler) {
transform = factory(handler, transform, this.$vm);
}, this);
return transform(options);
};
/**
* Url options.
*/
Url.options = {
url: '',
root: null,
params: {}
};
/**
* Url transforms.
*/
Url.transforms = [
__webpack_require__(3),
__webpack_require__(5),
__webpack_require__(6),
__webpack_require__(7)
];
/**
* Encodes a Url parameter string.
*
* @param {Object} obj
*/
Url.params = function (obj) {
var params = [], escape = encodeURIComponent;
params.add = function (key, value) {
if (_.isFunction(value)) {
value = value();
}
if (value === null) {
value = '';
}
this.push(escape(key) + '=' + escape(value));
};
serialize(params, obj);
return params.join('&').replace(/%20/g, '+');
};
/**
* Parse a URL and return its components.
*
* @param {String} url
*/
Url.parse = function (url) {
if (ie) {
el.href = url;
url = el.href;
}
el.href = url;
return {
href: el.href,
protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
port: el.port,
host: el.host,
hostname: el.hostname,
pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
search: el.search ? el.search.replace(/^\?/, '') : '',
hash: el.hash ? el.hash.replace(/^#/, '') : ''
};
};
function factory(handler, next, vm) {
return function (options) {
return handler.call(vm, options, next);
};
}
function serialize(params, obj, scope) {
var array = _.isArray(obj), plain = _.isPlainObject(obj), hash;
_.each(obj, function (value, key) {
hash = _.isObject(value) || _.isArray(value);
if (scope) {
key = scope + '[' + (plain || hash ? key : '') + ']';
}
if (!scope && array) {
params.add(value.name, value.value);
} else if (hash) {
serialize(params, value, key);
} else {
params.add(key, value);
}
});
}
module.exports = _.url = Url;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* URL Template (RFC 6570) Transform.
*/
var UrlTemplate = __webpack_require__(4);
module.exports = function (options) {
var variables = [], url = UrlTemplate.expand(options.url, options.params, variables);
variables.forEach(function (key) {
delete options.params[key];
});
return url;
};
/***/ },
/* 4 */
/***/ function(module, exports) {
/**
* URL Template v2.0.6 (path_to_url
*/
exports.expand = function (url, params, variables) {
var tmpl = this.parse(url), expanded = tmpl.expand(params);
if (variables) {
variables.push.apply(variables, tmpl.vars);
}
return expanded;
};
exports.parse = function (template) {
var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
return {
vars: variables,
expand: function (context) {
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
if (expression) {
var operator = null, values = [];
if (operators.indexOf(expression.charAt(0)) !== -1) {
operator = expression.charAt(0);
expression = expression.substr(1);
}
expression.split(/,/g).forEach(function (variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push.apply(values, exports.getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
variables.push(tmp[1]);
});
if (operator && operator !== '+') {
var separator = ',';
if (operator === '?') {
separator = '&';
} else if (operator !== '#') {
separator = operator;
}
return (values.length !== 0 ? operator : '') + values.join(separator);
} else {
return values.join(',');
}
} else {
return exports.encodeReserved(literal);
}
});
}
};
};
exports.getValues = function (context, operator, key, modifier) {
var value = context[key], result = [];
if (this.isDefined(value) && value !== '') {
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
value = value.toString();
if (modifier && modifier !== '*') {
value = value.substring(0, parseInt(modifier, 10));
}
result.push(this.encodeValue(operator, value, this.isKeyOperator(operator) ? key : null));
} else {
if (modifier === '*') {
if (Array.isArray(value)) {
value.filter(this.isDefined).forEach(function (value) {
result.push(this.encodeValue(operator, value, this.isKeyOperator(operator) ? key : null));
}, this);
} else {
Object.keys(value).forEach(function (k) {
if (this.isDefined(value[k])) {
result.push(this.encodeValue(operator, value[k], k));
}
}, this);
}
} else {
var tmp = [];
if (Array.isArray(value)) {
value.filter(this.isDefined).forEach(function (value) {
tmp.push(this.encodeValue(operator, value));
}, this);
} else {
Object.keys(value).forEach(function (k) {
if (this.isDefined(value[k])) {
tmp.push(encodeURIComponent(k));
tmp.push(this.encodeValue(operator, value[k].toString()));
}
}, this);
}
if (this.isKeyOperator(operator)) {
result.push(encodeURIComponent(key) + '=' + tmp.join(','));
} else if (tmp.length !== 0) {
result.push(tmp.join(','));
}
}
}
} else {
if (operator === ';') {
result.push(encodeURIComponent(key));
} else if (value === '' && (operator === '&' || operator === '?')) {
result.push(encodeURIComponent(key) + '=');
} else if (value === '') {
result.push('');
}
}
return result;
};
exports.isDefined = function (value) {
return value !== undefined && value !== null;
};
exports.isKeyOperator = function (operator) {
return operator === ';' || operator === '&' || operator === '?';
};
exports.encodeValue = function (operator, value, key) {
value = (operator === '+' || operator === '#') ? this.encodeReserved(value) : encodeURIComponent(value);
if (key) {
return encodeURIComponent(key) + '=' + value;
} else {
return value;
}
};
exports.encodeReserved = function (str) {
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part);
}
return part;
}).join('');
};
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/**
* Legacy Transform.
*/
var _ = __webpack_require__(1);
module.exports = function (options, next) {
var variables = [], url = next(options);
url = url.replace(/(\/?):([a-z]\w*)/gi, function (match, slash, name) {
_.warn('The `:' + name + '` parameter syntax has been deprecated. Use the `{' + name + '}` syntax instead.');
if (options.params[name]) {
variables.push(name);
return slash + encodeUriSegment(options.params[name]);
}
return '';
});
variables.forEach(function (key) {
delete options.params[key];
});
return url;
};
function encodeUriSegment(value) {
return encodeUriQuery(value, true).
replace(/%26/gi, '&').
replace(/%3D/gi, '=').
replace(/%2B/gi, '+');
}
function encodeUriQuery(value, spaces) {
return encodeURIComponent(value).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, (spaces ? '%20' : '+'));
}
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/**
* Query Parameter Transform.
*/
var _ = __webpack_require__(1);
module.exports = function (options, next) {
var urlParams = Object.keys(_.url.options.params), query = {}, url = next(options);
_.each(options.params, function (value, key) {
if (urlParams.indexOf(key) === -1) {
query[key] = value;
}
});
query = _.url.params(query);
if (query) {
url += (url.indexOf('?') == -1 ? '?' : '&') + query;
}
return url;
};
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/**
* Root Prefix Transform.
*/
var _ = __webpack_require__(1);
module.exports = function (options, next) {
var url = next(options);
if (_.isString(options.root) && !url.match(/^(https?:)?\//)) {
url = options.root + '/' + url;
}
return url;
};
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
/**
* Service for sending network requests.
*/
var _ = __webpack_require__(1);
var Client = __webpack_require__(9);
var Promise = __webpack_require__(10);
var interceptor = __webpack_require__(13);
var jsonType = {'Content-Type': 'application/json'};
function Http(url, options) {
var client = Client, request, promise;
Http.interceptors.forEach(function (handler) {
client = interceptor(handler, this.$vm)(client);
}, this);
options = _.isObject(url) ? url : _.extend({url: url}, options);
request = _.merge({}, Http.options, this.$options, options);
promise = client(request).bind(this.$vm).then(function (response) {
return response.ok ? response : Promise.reject(response);
}, function (response) {
if (response instanceof Error) {
_.error(response);
}
return Promise.reject(response);
});
if (request.success) {
promise.success(request.success);
}
if (request.error) {
promise.error(request.error);
}
return promise;
}
Http.options = {
method: 'get',
data: '',
params: {},
headers: {},
xhr: null,
upload: null,
jsonp: 'callback',
beforeSend: null,
crossOrigin: null,
emulateHTTP: false,
emulateJSON: false,
timeout: 0
};
Http.interceptors = [
__webpack_require__(14),
__webpack_require__(15),
__webpack_require__(16),
__webpack_require__(18),
__webpack_require__(19),
__webpack_require__(20),
__webpack_require__(21)
];
Http.headers = {
put: jsonType,
post: jsonType,
patch: jsonType,
delete: jsonType,
common: {'Accept': 'application/json, text/plain, */*'},
custom: {'X-Requested-With': 'XMLHttpRequest'}
};
['get', 'put', 'post', 'patch', 'delete', 'jsonp'].forEach(function (method) {
Http[method] = function (url, data, success, options) {
if (_.isFunction(data)) {
options = success;
success = data;
data = undefined;
}
if (_.isObject(success)) {
options = success;
success = undefined;
}
return this(url, _.extend({method: method, data: data, success: success}, options));
};
});
module.exports = _.http = Http;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
/**
* Base client.
*/
var _ = __webpack_require__(1);
var Promise = __webpack_require__(10);
var xhrClient = __webpack_require__(12);
module.exports = function (request) {
var response = (request.client || xhrClient)(request);
return Promise.resolve(response).then(function (response) {
if (response.headers) {
var headers = parseHeaders(response.headers);
response.headers = function (name) {
if (name) {
return headers[_.toLower(name)];
}
return headers;
};
}
response.ok = response.status >= 200 && response.status < 300;
return response;
});
};
function parseHeaders(str) {
var headers = {}, value, name, i;
if (_.isString(str)) {
_.each(str.split('\n'), function (row) {
i = row.indexOf(':');
name = _.trim(_.toLower(row.slice(0, i)));
value = _.trim(row.slice(i + 1));
if (headers[name]) {
if (_.isArray(headers[name])) {
headers[name].push(value);
} else {
headers[name] = [headers[name], value];
}
} else {
headers[name] = value;
}
});
}
return headers;
}
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/**
* Promise adapter.
*/
var _ = __webpack_require__(1);
var PromiseObj = window.Promise || __webpack_require__(11);
function Promise(executor, context) {
if (executor instanceof PromiseObj) {
this.promise = executor;
} else {
this.promise = new PromiseObj(executor.bind(context));
}
this.context = context;
}
Promise.all = function (iterable, context) {
return new Promise(PromiseObj.all(iterable), context);
};
Promise.resolve = function (value, context) {
return new Promise(PromiseObj.resolve(value), context);
};
Promise.reject = function (reason, context) {
return new Promise(PromiseObj.reject(reason), context);
};
Promise.race = function (iterable, context) {
return new Promise(PromiseObj.race(iterable), context);
};
var p = Promise.prototype;
p.bind = function (context) {
this.context = context;
return this;
};
p.then = function (fulfilled, rejected) {
if (fulfilled && fulfilled.bind && this.context) {
fulfilled = fulfilled.bind(this.context);
}
if (rejected && rejected.bind && this.context) {
rejected = rejected.bind(this.context);
}
this.promise = this.promise.then(fulfilled, rejected);
return this;
};
p.catch = function (rejected) {
if (rejected && rejected.bind && this.context) {
rejected = rejected.bind(this.context);
}
this.promise = this.promise.catch(rejected);
return this;
};
p.finally = function (callback) {
return this.then(function (value) {
callback.call(this);
return value;
}, function (reason) {
callback.call(this);
return PromiseObj.reject(reason);
}
);
};
p.success = function (callback) {
_.warn('The `success` method has been deprecated. Use the `then` method instead.');
return this.then(function (response) {
return callback.call(this, response.data, response.status, response) || response;
});
};
p.error = function (callback) {
_.warn('The `error` method has been deprecated. Use the `catch` method instead.');
return this.catch(function (response) {
return callback.call(this, response.data, response.status, response) || response;
});
};
p.always = function (callback) {
_.warn('The `always` method has been deprecated. Use the `finally` method instead.');
var cb = function (response) {
return callback.call(this, response.data, response.status, response) || response;
};
return this.then(cb, cb);
};
module.exports = Promise;
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
/**
* Promises/A+ polyfill v1.1.4 (path_to_url
*/
var _ = __webpack_require__(1);
var RESOLVED = 0;
var REJECTED = 1;
var PENDING = 2;
function Promise(executor) {
this.state = PENDING;
this.value = undefined;
this.deferred = [];
var promise = this;
try {
executor(function (x) {
promise.resolve(x);
}, function (r) {
promise.reject(r);
});
} catch (e) {
promise.reject(e);
}
}
Promise.reject = function (r) {
return new Promise(function (resolve, reject) {
reject(r);
});
};
Promise.resolve = function (x) {
return new Promise(function (resolve, reject) {
resolve(x);
});
};
Promise.all = function all(iterable) {
return new Promise(function (resolve, reject) {
var count = 0, result = [];
if (iterable.length === 0) {
resolve(result);
}
function resolver(i) {
return function (x) {
result[i] = x;
count += 1;
if (count === iterable.length) {
resolve(result);
}
};
}
for (var i = 0; i < iterable.length; i += 1) {
Promise.resolve(iterable[i]).then(resolver(i), reject);
}
});
};
Promise.race = function race(iterable) {
return new Promise(function (resolve, reject) {
for (var i = 0; i < iterable.length; i += 1) {
Promise.resolve(iterable[i]).then(resolve, reject);
}
});
};
var p = Promise.prototype;
p.resolve = function resolve(x) {
var promise = this;
if (promise.state === PENDING) {
if (x === promise) {
throw new TypeError('Promise settled with itself.');
}
var called = false;
try {
var then = x && x['then'];
if (x !== null && typeof x === 'object' && typeof then === 'function') {
then.call(x, function (x) {
if (!called) {
promise.resolve(x);
}
called = true;
}, function (r) {
if (!called) {
promise.reject(r);
}
called = true;
});
return;
}
} catch (e) {
if (!called) {
promise.reject(e);
}
return;
}
promise.state = RESOLVED;
promise.value = x;
promise.notify();
}
};
p.reject = function reject(reason) {
var promise = this;
if (promise.state === PENDING) {
if (reason === promise) {
throw new TypeError('Promise settled with itself.');
}
promise.state = REJECTED;
promise.value = reason;
promise.notify();
}
};
p.notify = function notify() {
var promise = this;
_.nextTick(function () {
if (promise.state !== PENDING) {
while (promise.deferred.length) {
var deferred = promise.deferred.shift(),
onResolved = deferred[0],
onRejected = deferred[1],
resolve = deferred[2],
reject = deferred[3];
try {
if (promise.state === RESOLVED) {
if (typeof onResolved === 'function') {
resolve(onResolved.call(undefined, promise.value));
} else {
resolve(promise.value);
}
} else if (promise.state === REJECTED) {
if (typeof onRejected === 'function') {
resolve(onRejected.call(undefined, promise.value));
} else {
reject(promise.value);
}
}
} catch (e) {
reject(e);
}
}
}
});
};
p.then = function then(onResolved, onRejected) {
var promise = this;
return new Promise(function (resolve, reject) {
promise.deferred.push([onResolved, onRejected, resolve, reject]);
promise.notify();
});
};
p.catch = function (onRejected) {
return this.then(undefined, onRejected);
};
module.exports = Promise;
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
/**
* XMLHttp client.
*/
var _ = __webpack_require__(1);
var Promise = __webpack_require__(10);
module.exports = function (request) {
return new Promise(function (resolve) {
var xhr = new XMLHttpRequest(), response = {request: request}, handler;
request.cancel = function () {
xhr.abort();
};
xhr.open(request.method, _.url(request), true);
handler = function (event) {
response.data = xhr.responseText;
response.status = xhr.status;
response.statusText = xhr.statusText;
response.headers = xhr.getAllResponseHeaders();
resolve(response);
};
xhr.timeout = 0;
xhr.onload = handler;
xhr.onabort = handler;
xhr.onerror = handler;
xhr.ontimeout = function () {};
xhr.onprogress = function () {};
if (_.isPlainObject(request.xhr)) {
_.extend(xhr, request.xhr);
}
if (_.isPlainObject(request.upload)) {
_.extend(xhr.upload, request.upload);
}
_.each(request.headers || {}, function (value, header) {
xhr.setRequestHeader(header, value);
});
xhr.send(request.data);
});
};
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
/**
* Interceptor factory.
*/
var _ = __webpack_require__(1);
var Promise = __webpack_require__(10);
module.exports = function (handler, vm) {
return function (client) {
if (_.isFunction(handler)) {
handler = handler.call(vm, Promise);
}
return function (request) {
if (_.isFunction(handler.request)) {
request = handler.request.call(vm, request);
}
return when(request, function (request) {
return when(client(request), function (response) {
if (_.isFunction(handler.response)) {
response = handler.response.call(vm, response);
}
return response;
});
});
};
};
};
function when(value, fulfilled, rejected) {
var promise = Promise.resolve(value);
if (arguments.length < 2) {
return promise;
}
return promise.then(fulfilled, rejected);
}
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
/**
* Before Interceptor.
*/
var _ = __webpack_require__(1);
module.exports = {
request: function (request) {
if (_.isFunction(request.beforeSend)) {
request.beforeSend.call(this, request);
}
return request;
}
};
/***/ },
/* 15 */
/***/ function(module, exports) {
/**
* Timeout Interceptor.
*/
module.exports = function () {
var timeout;
return {
request: function (request) {
if (request.timeout) {
timeout = setTimeout(function () {
request.cancel();
}, request.timeout);
}
return request;
},
response: function (response) {
clearTimeout(timeout);
return response;
}
};
};
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
/**
* JSONP Interceptor.
*/
var jsonpClient = __webpack_require__(17);
module.exports = {
request: function (request) {
if (request.method == 'JSONP') {
request.client = jsonpClient;
}
return request;
}
};
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
/**
* JSONP client.
*/
var _ = __webpack_require__(1);
var Promise = __webpack_require__(10);
module.exports = function (request) {
return new Promise(function (resolve) {
var callback = '_jsonp' + Math.random().toString(36).substr(2), response = {request: request, data: null}, handler, script;
request.params[request.jsonp] = callback;
request.cancel = function () {
handler({type: 'cancel'});
};
script = document.createElement('script');
script.src = _.url(request);
script.type = 'text/javascript';
script.async = true;
window[callback] = function (data) {
response.data = data;
};
handler = function (event) {
if (event.type === 'load' && response.data !== null) {
response.status = 200;
} else if (event.type === 'error') {
response.status = 404;
} else {
response.status = 0;
}
resolve(response);
delete window[callback];
document.body.removeChild(script);
};
script.onload = handler;
script.onerror = handler;
document.body.appendChild(script);
});
};
/***/ },
/* 18 */
/***/ function(module, exports) {
/**
* HTTP method override Interceptor.
*/
module.exports = {
request: function (request) {
if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
request.headers['X-HTTP-Method-Override'] = request.method;
request.method = 'POST';
}
return request;
}
};
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
/**
* Mime Interceptor.
*/
var _ = __webpack_require__(1);
module.exports = {
request: function (request) {
if (request.emulateJSON && _.isPlainObject(request.data)) {
request.headers['Content-Type'] = 'application/x-www-form-urlencoded';
request.data = _.url.params(request.data);
}
if (_.isObject(request.data) && /FormData/i.test(request.data.toString())) {
delete request.headers['Content-Type'];
}
if (_.isPlainObject(request.data)) {
request.data = JSON.stringify(request.data);
}
return request;
},
response: function (response) {
try {
response.data = JSON.parse(response.data);
} catch (e) {}
return response;
}
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/**
* Header Interceptor.
*/
var _ = __webpack_require__(1);
module.exports = {
request: function (request) {
request.method = request.method.toUpperCase();
request.headers = _.extend({}, _.http.headers.common,
!request.crossOrigin ? _.http.headers.custom : {},
_.http.headers[request.method.toLowerCase()],
request.headers
);
if (_.isPlainObject(request.data) && /^(GET|JSONP)$/i.test(request.method)) {
_.extend(request.params, request.data);
delete request.data;
}
return request;
}
};
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
/**
* CORS Interceptor.
*/
var _ = __webpack_require__(1);
var xdrClient = __webpack_require__(22);
var xhrCors = 'withCredentials' in new XMLHttpRequest();
var originUrl = _.url.parse(location.href);
module.exports = {
request: function (request) {
if (request.crossOrigin === null) {
request.crossOrigin = crossOrigin(request);
}
if (request.crossOrigin) {
if (!xhrCors) {
request.client = xdrClient;
}
request.emulateHTTP = false;
}
return request;
}
};
function crossOrigin(request) {
var requestUrl = _.url.parse(_.url(request));
return (requestUrl.protocol !== originUrl.protocol || requestUrl.host !== originUrl.host);
}
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
/**
* XDomain client (Internet Explorer).
*/
var _ = __webpack_require__(1);
var Promise = __webpack_require__(10);
module.exports = function (request) {
return new Promise(function (resolve) {
var xdr = new XDomainRequest(), response = {request: request}, handler;
request.cancel = function () {
xdr.abort();
};
xdr.open(request.method, _.url(request), true);
handler = function (event) {
response.data = xdr.responseText;
response.status = xdr.status;
response.statusText = xdr.statusText;
resolve(response);
};
xdr.timeout = 0;
xdr.onload = handler;
xdr.onabort = handler;
xdr.onerror = handler;
xdr.ontimeout = function () {};
xdr.onprogress = function () {};
xdr.send(request.data);
});
};
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
/**
* Service for interacting with RESTful services.
*/
var _ = __webpack_require__(1);
function Resource(url, params, actions, options) {
var self = this, resource = {};
actions = _.extend({},
Resource.actions,
actions
);
_.each(actions, function (action, name) {
action = _.merge({url: url, params: params || {}}, options, action);
resource[name] = function () {
return (self.$http || _.http)(opts(action, arguments));
};
});
return resource;
}
function opts(action, args) {
var options = _.extend({}, action), params = {}, data, success, error;
switch (args.length) {
case 4:
error = args[3];
success = args[2];
case 3:
case 2:
if (_.isFunction(args[1])) {
if (_.isFunction(args[0])) {
success = args[0];
error = args[1];
break;
}
success = args[1];
error = args[2];
} else {
params = args[0];
data = args[1];
success = args[2];
break;
}
case 1:
if (_.isFunction(args[0])) {
success = args[0];
} else if (/^(POST|PUT|PATCH)$/i.test(options.method)) {
data = args[0];
} else {
params = args[0];
}
break;
case 0:
break;
default:
throw 'Expected up to 4 arguments [params, data, success, error], got ' + args.length + ' arguments';
}
options.data = data;
options.params = _.extend({}, options.params, params);
if (success) {
options.success = success;
}
if (error) {
options.error = error;
}
return options;
}
Resource.actions = {
get: {method: 'GET'},
save: {method: 'POST'},
query: {method: 'GET'},
update: {method: 'PUT'},
remove: {method: 'DELETE'},
delete: {method: 'DELETE'}
};
module.exports = _.resource = Resource;
/***/ }
/******/ ])
});
;
``` | /content/code_sandbox/public/vendor/vue-resource/dist/vue-resource.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 8,242 |
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Ridiculously Responsive Social Sharing Buttons by KNI Labs</title>
<meta name="description" content="It seemed like we were constantly making custom social sharing buttons for every single project, so we decided to create a super flexible system that would work in any container. SASS-powered, retina ready, and auto-magical resizing. A KNI Labs freebie."/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- sample fb meta -->
<meta property="og:title" content="Ridiculously Responsive Social Sharing Buttons" />
<meta property="og:type" content="website" />
<meta property="og:url" content="path_to_url" />
<meta property="og:image" content="path_to_url" />
<meta property="og:description" content="No one wants to create social buttons over and over again. RRSSB is a super flexible system that works in any container. SASS-powered, retina ready, svg images, tiny file size and auto-magical resizing. A KNI Labs freebie."/>
<!-- sample twitter meta -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@therealkni">
<meta name="twitter:creator" content="@dbox">
<meta name="twitter:title" content="Ridiculously Responsive Social Sharing Buttons">
<meta name="twitter:description" content="Ridiculously Responsive Social Sharing Buttons by @dbox and @joshuatuscan: path_to_url | path_to_url">
<meta name="twitter:image" content="path_to_url">
<link rel="icon" type="image/png" href="path_to_url" />
<!-- Stylesheet required to power RRSSB. Copy this css file to your header or merge directly into your css -->
<link rel="stylesheet" href="css/rrssb.css" />
</head>
<body style="font-family: helvetica, arial, sans-serif; padding: 5%;">
<h3>RRSSB - All sites</h3>
<p>Copy only the <code>li</code>'s that you need:</p>
<!-- Buttons start here. Copy this ul to your document. -->
<div>
<ul class="rrssb-buttons">
<li class="rrssb-email">
<!-- Replace subject with your message using URL Endocding: path_to_url -->
<a href="mailto:?subject=Check%20out%20how%20ridiculously%20responsive%20these%20social%20buttons%20are&body=http%3A%2F%2Fkurtnoble.com%2Flabs%2Frrssb%2Findex.html">
<span class="rrssb-icon">
<svg xmlns="path_to_url" width="28" height="28" viewBox="0 0 28 28"><path d="M20.11 26.147c-2.335 1.05-4.36 1.4-7.124 1.4C6.524 27.548.84 22.916.84 15.284.84 7.343 6.602.45 15.4.45c6.854 0 11.8 4.7 11.8 11.252 0 5.684-3.193 9.265-7.398 9.3-1.83 0-3.153-.934-3.347-2.997h-.077c-1.208 1.986-2.96 2.997-5.023 2.997-2.532 0-4.36-1.868-4.36-5.062 0-4.75 3.503-9.07 9.11-9.07 1.713 0 3.7.4 4.6.972l-1.17 7.203c-.387 2.298-.115 3.3 1 3.4 1.674 0 3.774-2.102 3.774-6.58 0-5.06-3.27-8.994-9.304-8.994C9.05 2.87 3.83 7.545 3.83 14.97c0 6.5 4.2 10.2 10 10.202 1.987 0 4.09-.43 5.647-1.245l.634 2.22zM16.647 10.1c-.31-.078-.7-.155-1.207-.155-2.572 0-4.596 2.53-4.596 5.53 0 1.5.7 2.4 1.9 2.4 1.44 0 2.96-1.83 3.31-4.088l.592-3.72z"/></svg>
</span>
<span class="rrssb-text">email</span>
</a>
</li>
<li class="rrssb-facebook">
<!-- Replace with your URL. For best results, make sure you page has the proper FB Open Graph tags in header:
path_to_url -->
<a href="path_to_url" class="popup">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 29 29"><path d="M26.4 0H2.6C1.714 0 0 1.715 0 2.6v23.8c0 .884 1.715 2.6 2.6 2.6h12.393V17.988h-3.996v-3.98h3.997v-3.062c0-3.746 2.835-5.97 6.177-5.97 1.6 0 2.444.173 2.845.226v3.792H21.18c-1.817 0-2.156.9-2.156 2.168v2.847h5.045l-.66 3.978h-4.386V29H26.4c.884 0 2.6-1.716 2.6-2.6V2.6c0-.885-1.716-2.6-2.6-2.6z"/></svg>
</span>
<span class="rrssb-text">facebook</span>
</a>
</li>
<li class="rrssb-instagram">
<!-- Replace href with your URL -->
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M4.066.636h19.867c1.887 0 3.43 1.543 3.43 3.43v19.868c0 1.888-1.543 3.43-3.43 3.43H4.066c-1.887 0-3.43-1.542-3.43-3.43V4.066c0-1.887 1.544-3.43 3.43-3.43zm16.04 2.97c-.66 0-1.203.54-1.203 1.202v2.88c0 .662.542 1.203 1.204 1.203h3.02c.663 0 1.204-.54 1.204-1.202v-2.88c0-.662-.54-1.203-1.202-1.203h-3.02zm4.238 8.333H21.99c.224.726.344 1.495.344 2.292 0 4.446-3.72 8.05-8.308 8.05s-8.31-3.604-8.31-8.05c0-.797.122-1.566.344-2.293H3.606v11.29c0 .584.48 1.06 1.062 1.06H23.28c.585 0 1.062-.477 1.062-1.06V11.94h.002zm-10.32-3.2c-2.963 0-5.367 2.33-5.367 5.202 0 2.873 2.404 5.202 5.368 5.202 2.965 0 5.368-2.33 5.368-5.202s-2.403-5.2-5.368-5.2z"/></svg>
</span>
<span class="rrssb-text">instagram</span>
</a>
</li>
<li class="rrssb-tumblr">
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M18.02 21.842c-2.03.052-2.422-1.396-2.44-2.446v-7.294h4.73V7.874H15.6V1.592h-3.714s-.167.053-.182.186c-.218 1.935-1.144 5.33-4.988 6.688v3.637h2.927v7.677c0 2.8 1.7 6.7 7.3 6.6 1.863-.03 3.934-.795 4.392-1.453l-1.22-3.54c-.52.213-1.415.413-2.115.455z"/></svg>
</span>
<span class="rrssb-text">tumblr</span>
</a>
</li>
<li class="rrssb-linkedin">
<!-- Replace href with your meta and URL information -->
<a href="path_to_url" class="popup">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M25.424 15.887v8.447h-4.896v-7.882c0-1.98-.71-3.33-2.48-3.33-1.354 0-2.158.91-2.514 1.802-.13.315-.162.753-.162 1.194v8.216h-4.9s.067-13.35 0-14.73h4.9v2.087c-.01.017-.023.033-.033.05h.032v-.05c.65-1.002 1.812-2.435 4.414-2.435 3.222 0 5.638 2.106 5.638 6.632zM5.348 2.5c-1.676 0-2.772 1.093-2.772 2.54 0 1.42 1.066 2.538 2.717 2.546h.032c1.71 0 2.77-1.132 2.77-2.546C8.056 3.593 7.02 2.5 5.344 2.5h.005zm-2.48 21.834h4.896V9.604H2.867v14.73z"/></svg>
</span>
<span class="rrssb-text">linkedin</span>
</a>
</li>
<li class="rrssb-twitter">
<!-- Replace href with your Meta and URL information -->
<a href="path_to_url"
class="popup">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M24.253 8.756C24.69 17.08 18.297 24.182 9.97 24.62a15.093 15.093 0 0 1-8.86-2.32c2.702.18 5.375-.648 7.507-2.32a5.417 5.417 0 0 1-4.49-3.64c.802.13 1.62.077 2.4-.154a5.416 5.416 0 0 1-4.412-5.11 5.43 5.43 0 0 0 2.168.387A5.416 5.416 0 0 1 2.89 4.498a15.09 15.09 0 0 0 10.913 5.573 5.185 5.185 0 0 1 3.434-6.48 5.18 5.18 0 0 1 5.546 1.682 9.076 9.076 0 0 0 3.33-1.317 5.038 5.038 0 0 1-2.4 2.942 9.068 9.068 0 0 0 3.02-.85 5.05 5.05 0 0 1-2.48 2.71z"/></svg>
</span>
<span class="rrssb-text">twitter</span>
</a>
</li>
<li class="rrssb-reddit">
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M11.794 15.316c0-1.03-.835-1.895-1.866-1.895-1.03 0-1.893.866-1.893 1.896s.863 1.9 1.9 1.9c1.023-.016 1.865-.916 1.865-1.9zM18.1 13.422c-1.03 0-1.895.864-1.895 1.895 0 1 .9 1.9 1.9 1.865 1.03 0 1.87-.836 1.87-1.865-.006-1.017-.875-1.917-1.875-1.895zM17.527 19.79c-.678.68-1.826 1.007-3.514 1.007h-.03c-1.686 0-2.834-.328-3.51-1.005a.677.677 0 0 0-.958 0c-.264.265-.264.7 0 1 .943.9 2.4 1.4 4.5 1.402.005 0 0 0 0 0 .005 0 0 0 0 0 2.066 0 3.527-.46 4.47-1.402a.678.678 0 0 0 .002-.958c-.267-.334-.688-.334-.988-.043z"/><path d="M27.707 13.267a3.24 3.24 0 0 0-3.236-3.237c-.792 0-1.517.287-2.08.76-2.04-1.294-4.647-2.068-7.44-2.218l1.484-4.69 4.062.955c.07 1.4 1.3 2.6 2.7 2.555a2.696 2.696 0 0 0 2.695-2.695C25.88 3.2 24.7 2 23.2 2c-1.06 0-1.98.616-2.42 1.508l-4.633-1.09a.683.683 0 0 0-.803.454l-1.793 5.7C10.55 8.6 7.7 9.4 5.6 10.75c-.594-.45-1.3-.75-2.1-.72-1.785 0-3.237 1.45-3.237 3.2 0 1.1.6 2.1 1.4 2.69-.04.27-.06.55-.06.83 0 2.3 1.3 4.4 3.7 5.9 2.298 1.5 5.3 2.3 8.6 2.325 3.227 0 6.27-.825 8.57-2.325 2.387-1.56 3.7-3.66 3.7-5.917 0-.26-.016-.514-.05-.768.965-.465 1.577-1.565 1.577-2.698zm-4.52-9.912c.74 0 1.3.6 1.3 1.3a1.34 1.34 0 0 1-2.683 0c.04-.655.596-1.255 1.396-1.3zM1.646 13.3c0-1.038.845-1.882 1.883-1.882.31 0 .6.1.9.21-1.05.867-1.813 1.86-2.26 2.9-.338-.328-.57-.728-.57-1.26zm20.126 8.27c-2.082 1.357-4.863 2.105-7.83 2.105-2.968 0-5.748-.748-7.83-2.105-1.99-1.3-3.087-3-3.087-4.782 0-1.784 1.097-3.484 3.088-4.784 2.08-1.358 4.86-2.106 7.828-2.106 2.967 0 5.7.7 7.8 2.106 1.99 1.3 3.1 3 3.1 4.784C24.86 18.6 23.8 20.3 21.8 21.57zm4.014-6.97c-.432-1.084-1.19-2.095-2.244-2.977.273-.156.59-.245.928-.245 1.036 0 1.9.8 1.9 1.9a2.073 2.073 0 0 1-.57 1.327z"/></svg>
</span>
<span class="rrssb-text">reddit</span>
</a>
</li>
<li class="rrssb-vk">
<a href="path_to_url" class="popup">
<span class="rrssb-icon">
<svg xmlns="path_to_url" width="28" height="28" viewBox="70 70 378.7 378.7"><path d="M254.998 363.106h21.217s6.408-.706 9.684-4.23c3.01-3.24 2.914-9.32 2.914-9.32s-.415-28.47 12.796-32.663c13.03-4.133 29.755 27.515 47.482 39.685 13.407 9.206 23.594 7.19 23.594 7.19l47.407-.662s24.797-1.53 13.038-21.027c-.96-1.594-6.85-14.424-35.247-40.784-29.728-27.59-25.743-23.126 10.063-70.85 21.807-29.063 30.523-46.806 27.8-54.405-2.596-7.24-18.636-5.326-18.636-5.326l-53.375.33s-3.96-.54-6.892 1.216c-2.87 1.716-4.71 5.726-4.71 5.726s-8.452 22.49-19.714 41.618c-23.77 40.357-33.274 42.494-37.16 39.984-9.037-5.842-6.78-23.462-6.78-35.983 0-39.112 5.934-55.42-11.55-59.64-5.802-1.4-10.076-2.327-24.915-2.48-19.046-.192-35.162.06-44.29 4.53-6.072 2.975-10.757 9.6-7.902 9.98 3.528.47 11.516 2.158 15.75 7.92 5.472 7.444 5.28 24.154 5.28 24.154s3.145 46.04-7.34 51.758c-7.193 3.922-17.063-4.085-38.253-40.7-10.855-18.755-19.054-39.49-19.054-39.49s-1.578-3.873-4.398-5.947c-3.42-2.51-8.2-3.307-8.2-3.307l-50.722.33s-7.612.213-10.41 3.525c-2.488 2.947-.198 9.036-.198 9.036s39.707 92.902 84.672 139.72c41.234 42.93 88.048 40.112 88.048 40.112"/></svg>
</span>
<span class="rrssb-text">vk.com</span>
</a>
</li>
<li class="rrssb-hackernews">
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M14 13.626l-4.508-9.19H6.588l6.165 12.208v6.92h2.51v-6.92l6.15-12.21H18.69z"/></svg>
</span>
<span class="rrssb-text">hackernews</span>
</a>
</li>
<li class="rrssb-googleplus">
<!-- Replace href with your meta and URL information. -->
<a href="path_to_url" class="popup">
<span class="rrssb-icon">
<svg xmlns="path_to_url" width="24" height="24" viewBox="0 0 24 24"><path d="M21 8.29h-1.95v2.6h-2.6v1.82h2.6v2.6H21v-2.6h2.6v-1.885H21V8.29zM7.614 10.306v2.925h3.9c-.26 1.69-1.755 2.925-3.9 2.925-2.34 0-4.29-2.016-4.29-4.354s1.885-4.353 4.29-4.353c1.104 0 2.014.326 2.794 1.105l2.08-2.08c-1.3-1.17-2.924-1.883-4.874-1.883C3.65 4.586.4 7.835.4 11.8s3.25 7.212 7.214 7.212c4.224 0 6.953-2.988 6.953-7.082 0-.52-.065-1.104-.13-1.624H7.614z"/></svg> </span>
<span class="rrssb-text">google+</span>
</a>
</li>
<li class="rrssb-pocket">
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 32 32"><path d="M28.782.002c2.03.002 3.193 1.12 3.182 3.106-.022 3.57.17 7.16-.158 10.7-1.09 11.773-14.588 18.092-24.6 11.573C2.72 22.458.197 18.313.057 12.937c-.09-3.36-.05-6.72-.026-10.08C.04 1.113 1.212.016 3.02.008 7.347-.006 11.678.004 16.006.002c4.258 0 8.518-.004 12.776 0zM8.65 7.856c-1.262.135-1.99.57-2.357 1.476-.392.965-.115 1.81.606 2.496a746.818 746.818 0 0 0 7.398 6.966c1.086 1.003 2.237.99 3.314-.013a700.448 700.448 0 0 0 7.17-6.747c1.203-1.148 1.32-2.468.365-3.426-1.01-1.014-2.302-.933-3.558.245-1.596 1.497-3.222 2.965-4.75 4.526-.706.715-1.12.627-1.783-.034a123.71 123.71 0 0 0-4.93-4.644c-.47-.42-1.123-.647-1.478-.844z"/></svg>
</span>
<span class="rrssb-text">pocket</span>
</a>
</li>
<li class="rrssb-youtube">
<a href="#">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M27.688 8.512a4.086 4.086 0 0 0-4.106-4.093H4.39A4.084 4.084 0 0 0 .312 8.51v10.976A4.08 4.08 0 0 0 4.39 23.58h19.19a4.09 4.09 0 0 0 4.107-4.092V8.512zm-16.425 10.12V8.322l7.817 5.154-7.817 5.156z"/></svg>
</span>
<span class="rrssb-text">youtube</span>
</a>
</li>
<li class="rrssb-pinterest">
<!-- Replace href with your meta and URL information. -->
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M14.02 1.57c-7.06 0-12.784 5.723-12.784 12.785S6.96 27.14 14.02 27.14c7.062 0 12.786-5.725 12.786-12.785 0-7.06-5.724-12.785-12.785-12.785zm1.24 17.085c-1.16-.09-1.648-.666-2.558-1.22-.5 2.627-1.113 5.146-2.925 6.46-.56-3.972.822-6.952 1.462-10.117-1.094-1.84.13-5.545 2.437-4.632 2.837 1.123-2.458 6.842 1.1 7.557 3.71.744 5.226-6.44 2.924-8.775-3.324-3.374-9.677-.077-8.896 4.754.19 1.178 1.408 1.538.49 3.168-2.13-.472-2.764-2.15-2.683-4.388.132-3.662 3.292-6.227 6.46-6.582 4.008-.448 7.772 1.474 8.29 5.24.58 4.254-1.815 8.864-6.1 8.532v.003z"/></svg>
</span>
<span class="rrssb-text">pinterest</span>
</a>
</li>
<li class="rrssb-github">
<a href="path_to_url">
<span class="rrssb-icon">
<svg xmlns="path_to_url" viewBox="0 0 28 28"><path d="M13.97 1.57c-7.03 0-12.733 5.703-12.733 12.74 0 5.622 3.636 10.393 8.717 12.084.637.13.87-.277.87-.615 0-.302-.013-1.103-.02-2.165-3.54.77-4.29-1.707-4.29-1.707-.578-1.473-1.413-1.863-1.413-1.863-1.154-.79.09-.775.09-.775 1.276.104 1.96 1.316 1.96 1.312 1.135 1.936 2.99 1.393 3.712 1.06.116-.823.445-1.384.81-1.704-2.83-.32-5.802-1.414-5.802-6.293 0-1.39.496-2.527 1.312-3.418-.132-.322-.57-1.617.123-3.37 0 0 1.07-.343 3.508 1.305A12.22 12.22 0 0 1 14 7.732c1.082 0 2.167.156 3.198.44 2.43-1.65 3.498-1.307 3.498-1.307.695 1.754.258 3.043.13 3.37a4.968 4.968 0 0 1 1.314 3.43c0 4.893-2.978 5.97-5.814 6.286.458.388.876 1.16.876 2.358 0 1.703-.016 3.076-.016 3.482 0 .334.232.748.877.61 5.056-1.687 8.7-6.456 8.7-12.08-.055-7.058-5.75-12.757-12.792-12.75z"/></svg>
</span>
<span class="rrssb-text">github</span>
</a>
</li>
<li class="rrssb-print">
<a href="javascript:window.print()">
<span class="rrssb-icon">
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="path_to_url"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
</span>
<span class="rrssb-text">print</span>
</a>
</li>
<li class="rrssb-whatsapp">
<a href="whatsapp://send?text=Ridiculously%20Responsive%20Social%20Sharing%20Buttons%20by%20%40dbox%20and%20%40joshuatuscan%3A%20http%3A%2F%2Fkurtnoble.com%2Flabs%2Frrssb%20%7C%20http%3A%2F%2Fkurtnoble.com%2Flabs%2Frrssb%2Fmedia%2Frrssb-preview.png" data-action="share/whatsapp/share">
<span class="rrssb-icon">
<svg xmlns="path_to_url" width="90" height="90" viewBox="0 0 90 90"><path d="M90 43.84c0 24.214-19.78 43.842-44.182 43.842a44.256 44.256 0 0 1-21.357-5.455L0 90l7.975-23.522a43.38 43.38 0 0 1-6.34-22.637C1.635 19.63 21.415 0 45.818 0 70.223 0 90 19.628 90 43.84zM45.818 6.983c-20.484 0-37.146 16.535-37.146 36.86 0 8.064 2.63 15.533 7.076 21.61l-4.64 13.688 14.274-4.537A37.122 37.122 0 0 0 45.82 80.7c20.48 0 37.145-16.533 37.145-36.857S66.3 6.983 45.818 6.983zm22.31 46.956c-.272-.447-.993-.717-2.075-1.254-1.084-.537-6.41-3.138-7.4-3.495-.993-.36-1.717-.54-2.438.536-.72 1.076-2.797 3.495-3.43 4.212-.632.72-1.263.81-2.347.27-1.082-.536-4.57-1.672-8.708-5.332-3.22-2.848-5.393-6.364-6.025-7.44-.63-1.076-.066-1.657.475-2.192.488-.482 1.084-1.255 1.625-1.882.543-.628.723-1.075 1.082-1.793.363-.718.182-1.345-.09-1.884-.27-.537-2.438-5.825-3.34-7.977-.902-2.15-1.803-1.793-2.436-1.793-.63 0-1.353-.09-2.075-.09-.722 0-1.896.27-2.89 1.344-.99 1.077-3.788 3.677-3.788 8.964 0 5.288 3.88 10.397 4.422 11.113.54.716 7.49 11.92 18.5 16.223 11.01 4.3 11.01 2.866 12.996 2.686 1.984-.18 6.406-2.6 7.312-5.107.9-2.513.9-4.664.63-5.112z"/></svg>
</span>
<span class="rrssb-text">Whatsapp</span>
</a>
</li>
</ul>
<!-- Buttons end here -->
</div>
<!-- Required Javascript files. Copy these to your document. -->
<script src="path_to_url"></script>
<script>
window.jQuery || document.write('<script src="js/vendor/jquery.1.10.2.min.js"><\/script>')
</script>
<script src="js/rrssb.min.js"></script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/RRSSB/index.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 8,590 |
```scss
// Ridiculously Responsive Social Sharing Buttons
// Team: @dbox, @joshuatuscan
// Site: path_to_url
// Twitter: @therealkni
//
// ___ ___
// /__/| /__/\ ___
// | |:| \ \:\ / /\
// | |:| \ \:\ / /:/
// __| |:| _____\__\:\ /__/::\
// /__/\_|:|____ /__/::::::::\ \__\/\:\__
// \ \:\/:::::/ \ \:\~~\~~\/ \ \:\/\
// \ \::/~~~~ \ \:\ ~~~ \__\::/
// \ \:\ \ \:\ /__/:/
// \ \:\ \ \:\ \__\/
// \__\/ \__\/
//
// Note: You can and should add or remove buttons from config settings and
// $social-list based on your specific needs.
// config settings
$rrssb-txt: #fff !default;
$rrssb-email: #0a88ff !default;
$rrssb-facebook: #306199 !default;
$rrssb-tumblr: #32506d !default;
$rrssb-linkedin: #007bb6 !default;
$rrssb-twitter: #26c4f1 !default;
$rrssb-googleplus: #e93f2e !default;
$rrssb-reddit: #8bbbe3 !default;
$rrssb-youtube: #df1c31 !default;
$rrssb-pinterest: #b81621 !default;
$rrssb-pocket: #ed4054 !default;
$rrssb-github: #444 !default;
$rrssb-instagram: #125688 !default;
$rrssb-hackernews: #ff6600 !default;
$rrssb-delicious: #0b79e5 !default;
$rrssb-vk: #4d71a9 !default;
$rrssb-print: #8d98a2 !default;
$rrssb-whatsapp: #43d854 !default;
// Set the border radius for the buttons
$rrssb-border-radius: 2px !default;
$rrssb-main-font: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
// Variable list for all social button colors to be iterated over.
$social-list: (rrssb-email $rrssb-email, rrssb-facebook $rrssb-facebook, rrssb-tumblr $rrssb-tumblr, rrssb-linkedin $rrssb-linkedin, rrssb-twitter $rrssb-twitter, rrssb-googleplus $rrssb-googleplus, rrssb-youtube $rrssb-youtube, rrssb-reddit $rrssb-reddit, rrssb-pinterest $rrssb-pinterest, rrssb-pocket $rrssb-pocket, rrssb-github $rrssb-github, rrssb-instagram $rrssb-instagram, rrssb-delicious $rrssb-delicious, rrssb-vk $rrssb-vk, rrssb-hackernews $rrssb-hackernews,rrssb-whatsapp $rrssb-whatsapp, rrssb-print $rrssb-print);
// The meat and potatoes
.rrssb-buttons {
box-sizing: border-box;
font-family: $rrssb-main-font;
font-size: 12px;
height: 36px;
margin: 0;
padding: 0;
width: 100%;
// clearfix buttons for large-format
&:after {
clear: both;
}
&:before,
&:after {
content: ' ';
display: table;
}
li {
box-sizing: border-box;
float: left;
height: 100%;
line-height: 13px;
list-style: none;
margin: 0;
padding: 0 2px;
// This generates individual button classes for each item in social list on line 39.
@each $s-name in $social-list {
&.#{nth($s-name, 1)} {
a {
background-color: nth($s-name, 2);
&:hover {
background-color: darken(nth($s-name, 2), 10%);
}
}
}
}
// end @each directive
a {
background-color: #ccc;
border-radius: $rrssb-border-radius;
box-sizing: border-box;
display: block;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-weight: bold;
height: 100%;
padding: 11px 7px 12px 27px;
position: relative;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: background-color 0.2s ease-in-out;
width: 100%;
.rrssb-icon {
display: block;
left: 10px;
padding-top: 9px;
position: absolute;
top: 0;
width: 10%;
svg {
height: 17px;
width: 17px;
path {
fill: $rrssb-txt;
}
}
}
.rrssb-text {
color: $rrssb-txt;
}
&:active {
box-shadow: inset 1px 3px 15px 0 rgba(22, 0, 0, .25);
}
}
&.small {
a {
padding: 0;
.rrssb-icon {
left: auto;
margin: 0 auto;
overflow: hidden;
position: relative;
top: auto;
width: 100%;
}
.rrssb-text {
visibility: hidden;
}
}
}
}
&.large-format {
height: auto;
li {
height: auto;
a {
backface-visibility: hidden;
border-radius: 0.2em;
padding: 8.5% 0 8.5% 12%;
.rrssb-icon {
height: 100%;
left: 7%;
padding-top: 0;
width: 12%;
svg {
height: 100%;
position: absolute;
top: 0;
width: 100%;
}
}
.rrssb-text {
backface-visibility: hidden;
}
}
}
}
&.small-format {
padding-top: 5px;
li {
height: 80%;
padding: 0 1px;
a {
.rrssb-icon {
height: 100%;
padding-top: 0;
svg {
height: 48%;
position: relative;
top: 6px;
width: 80%;
}
}
}
}
}
&.tiny-format {
height: 22px;
position: relative;
li {
padding-right: 7px;
a {
background-color: transparent;
padding: 0;
.rrssb-icon {
svg {
height: 70%;
width: 100%;
}
}
&:hover,
&:active {
background-color: transparent;
}
}
// This generates individual button classes for each item in social list on line 39.
@each $s-name in $social-list {
&.#{nth($s-name, 1)} {
a {
.rrssb-icon {
svg {
path {
fill: nth($s-name, 2);
}
}
&:hover {
.rrssb-icon {
svg {
path {
fill: darken(nth($s-name, 2), 20%);
}
}
}
}
}
}
}
} // end @each directive
}
}
li.rrssb-print a .rrssb-icon svg path:nth-child(2) { fill: none; }
}
``` | /content/code_sandbox/public/vendor/RRSSB/scss/rrssb.scss | scss | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,821 |
```css
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}
``` | /content/code_sandbox/public/vendor/RRSSB/css/normalize.min.css | css | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 766 |
```css
.clearfix:after,.share-container:after{clear:both}.clearfix:after,.clearfix:before,.share-container:after,.share-container:before{content:' ';display:table}body{overflow-x:hidden;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif}a{color:#0a88ff;font-weight:500;text-decoration:none}a:hover{color:#0061bd}.main-container{padding:1% 6%}.main-container h1{-webkit-transition:all .2s ease;transition:all .2s ease;color:#444;letter-spacing:-.03em;margin:20px 0 10px}@media screen and (min-width:1024px){.main-container h1{font-size:40px}}.main-container h2{color:#444}.main-container p{font-size:16px;line-height:1.4em}@media screen and (min-width:1024px){.main-container p{font-size:20px}}.main-container .rrssb-preview{-webkit-transition:all .2s ease;transition:all .2s ease;float:right;height:auto;margin:0 0 1% 1%;width:40%}@media screen and (max-width:400px){.main-container .rrssb-preview{width:60%}}.main-container small{color:#999;display:block;font-size:12px;margin:40px 0}hr{background-color:#ddd;border:0;height:1px;margin:0 0 10px}.share-container{padding:0 0 25px;position:relative}@media screen and (max-width:320px){.share-container{padding:0 0 12px}}.share-container .label{color:#777;display:block;float:left;font-size:14px;padding:10px 0 0;width:115px}@media screen and (max-width:400px){.share-container .label{display:none}}
``` | /content/code_sandbox/public/vendor/RRSSB/css/demo.css | css | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 411 |
```css
.rrssb-buttons{box-sizing:border-box;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;height:36px;margin:0;padding:0;width:100%}.rrssb-buttons:after{clear:both}.rrssb-buttons:after,.rrssb-buttons:before{content:' ';display:table}.rrssb-buttons li{box-sizing:border-box;float:left;height:100%;line-height:13px;list-style:none;margin:0;padding:0 2px}.rrssb-buttons li.rrssb-email a{background-color:#0a88ff}.rrssb-buttons li.rrssb-email a:hover{background-color:#006ed6}.rrssb-buttons li.rrssb-facebook a{background-color:#306199}.rrssb-buttons li.rrssb-facebook a:hover{background-color:#244872}.rrssb-buttons li.rrssb-tumblr a{background-color:#32506d}.rrssb-buttons li.rrssb-tumblr a:hover{background-color:#22364a}.rrssb-buttons li.rrssb-linkedin a{background-color:#007bb6}.rrssb-buttons li.rrssb-linkedin a:hover{background-color:#005983}.rrssb-buttons li.rrssb-twitter a{background-color:#26c4f1}.rrssb-buttons li.rrssb-twitter a:hover{background-color:#0eaad6}.rrssb-buttons li.rrssb-googleplus a{background-color:#e93f2e}.rrssb-buttons li.rrssb-googleplus a:hover{background-color:#ce2616}.rrssb-buttons li.rrssb-youtube a{background-color:#df1c31}.rrssb-buttons li.rrssb-youtube a:hover{background-color:#b21627}.rrssb-buttons li.rrssb-reddit a{background-color:#8bbbe3}.rrssb-buttons li.rrssb-reddit a:hover{background-color:#62a3d9}.rrssb-buttons li.rrssb-pinterest a{background-color:#b81621}.rrssb-buttons li.rrssb-pinterest a:hover{background-color:#8a1119}.rrssb-buttons li.rrssb-pocket a{background-color:#ed4054}.rrssb-buttons li.rrssb-pocket a:hover{background-color:#e4162d}.rrssb-buttons li.rrssb-github a{background-color:#444}.rrssb-buttons li.rrssb-github a:hover{background-color:#2b2b2b}.rrssb-buttons li.rrssb-instagram a{background-color:#125688}.rrssb-buttons li.rrssb-instagram a:hover{background-color:#0c3a5b}.rrssb-buttons li.rrssb-delicious a{background-color:#0b79e5}.rrssb-buttons li.rrssb-delicious a:hover{background-color:#095fb4}.rrssb-buttons li.rrssb-vk a{background-color:#4d71a9}.rrssb-buttons li.rrssb-vk a:hover{background-color:#3d5a86}.rrssb-buttons li.rrssb-hackernews a{background-color:#f60}.rrssb-buttons li.rrssb-hackernews a:hover{background-color:#cc5200}.rrssb-buttons li.rrssb-whatsapp a{background-color:#43d854}.rrssb-buttons li.rrssb-whatsapp a:hover{background-color:#28c039}.rrssb-buttons li.rrssb-print a{background-color:#8d98a2}.rrssb-buttons li.rrssb-print a:hover{background-color:#717f8b}.rrssb-buttons li a{background-color:#ccc;border-radius:2px;box-sizing:border-box;display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700;height:100%;padding:11px 7px 12px 27px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;width:100%}.rrssb-buttons li a .rrssb-icon{display:block;left:10px;padding-top:9px;position:absolute;top:0;width:10%}.rrssb-buttons li a .rrssb-icon svg{height:17px;width:17px}.rrssb-buttons li a .rrssb-icon svg path{fill:#fff}.rrssb-buttons li a .rrssb-text{color:#fff}.rrssb-buttons li a:active{box-shadow:inset 1px 3px 15px 0 rgba(22,0,0,.25)}.rrssb-buttons li.small a{padding:0}.rrssb-buttons li.small a .rrssb-icon{left:auto;margin:0 auto;overflow:hidden;position:relative;top:auto;width:100%}.rrssb-buttons li.small a .rrssb-text{visibility:hidden}.rrssb-buttons.large-format,.rrssb-buttons.large-format li{height:auto}.rrssb-buttons.large-format li a{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:.2em;padding:8.5% 0 8.5% 12%}.rrssb-buttons.large-format li a .rrssb-icon{height:100%;left:7%;padding-top:0;width:12%}.rrssb-buttons.large-format li a .rrssb-icon svg{height:100%;position:absolute;top:0;width:100%}.rrssb-buttons.large-format li a .rrssb-text{-webkit-backface-visibility:hidden;backface-visibility:hidden}.rrssb-buttons.small-format{padding-top:5px}.rrssb-buttons.small-format li{height:80%;padding:0 1px}.rrssb-buttons.small-format li a .rrssb-icon{height:100%;padding-top:0}.rrssb-buttons.small-format li a .rrssb-icon svg{height:48%;position:relative;top:6px;width:80%}.rrssb-buttons.tiny-format{height:22px;position:relative}.rrssb-buttons.tiny-format li{padding-right:7px}.rrssb-buttons.tiny-format li a{background-color:transparent;padding:0}.rrssb-buttons.tiny-format li a .rrssb-icon svg{height:70%;width:100%}.rrssb-buttons.tiny-format li a:active,.rrssb-buttons.tiny-format li a:hover{background-color:transparent}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon svg path{fill:#0a88ff}.rrssb-buttons.tiny-format li.rrssb-email a .rrssb-icon:hover .rrssb-icon svg path{fill:#0054a3}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon svg path{fill:#306199}.rrssb-buttons.tiny-format li.rrssb-facebook a .rrssb-icon:hover .rrssb-icon svg path{fill:#18304b}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon svg path{fill:#32506d}.rrssb-buttons.tiny-format li.rrssb-tumblr a .rrssb-icon:hover .rrssb-icon svg path{fill:#121d27}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon svg path{fill:#007bb6}.rrssb-buttons.tiny-format li.rrssb-linkedin a .rrssb-icon:hover .rrssb-icon svg path{fill:#003650}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon svg path{fill:#26c4f1}.rrssb-buttons.tiny-format li.rrssb-twitter a .rrssb-icon:hover .rrssb-icon svg path{fill:#0b84a6}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon svg path{fill:#e93f2e}.rrssb-buttons.tiny-format li.rrssb-googleplus a .rrssb-icon:hover .rrssb-icon svg path{fill:#a01e11}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon svg path{fill:#df1c31}.rrssb-buttons.tiny-format li.rrssb-youtube a .rrssb-icon:hover .rrssb-icon svg path{fill:#84111d}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon svg path{fill:#8bbbe3}.rrssb-buttons.tiny-format li.rrssb-reddit a .rrssb-icon:hover .rrssb-icon svg path{fill:#398bcf}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon svg path{fill:#b81621}.rrssb-buttons.tiny-format li.rrssb-pinterest a .rrssb-icon:hover .rrssb-icon svg path{fill:#5d0b11}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon svg path{fill:#ed4054}.rrssb-buttons.tiny-format li.rrssb-pocket a .rrssb-icon:hover .rrssb-icon svg path{fill:#b61124}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon svg path{fill:#444}.rrssb-buttons.tiny-format li.rrssb-github a .rrssb-icon:hover .rrssb-icon svg path{fill:#111}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon svg path{fill:#125688}.rrssb-buttons.tiny-format li.rrssb-instagram a .rrssb-icon:hover .rrssb-icon svg path{fill:#061d2e}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon svg path{fill:#0b79e5}.rrssb-buttons.tiny-format li.rrssb-delicious a .rrssb-icon:hover .rrssb-icon svg path{fill:#064684}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon svg path{fill:#4d71a9}.rrssb-buttons.tiny-format li.rrssb-vk a .rrssb-icon:hover .rrssb-icon svg path{fill:#2d4263}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon svg path{fill:#f60}.rrssb-buttons.tiny-format li.rrssb-hackernews a .rrssb-icon:hover .rrssb-icon svg path{fill:#993d00}.rrssb-buttons.tiny-format li.rrssb-whatsapp a .rrssb-icon svg path{fill:#43d854}.rrssb-buttons.tiny-format li.rrssb-whatsapp a .rrssb-icon:hover .rrssb-icon svg path{fill:#1f962d}.rrssb-buttons.tiny-format li.rrssb-print a .rrssb-icon svg path{fill:#8d98a2}.rrssb-buttons.tiny-format li.rrssb-print a .rrssb-icon:hover .rrssb-icon svg path{fill:#5a656f}.rrssb-buttons li.rrssb-print a .rrssb-icon svg path:nth-child(2){fill:none}
``` | /content/code_sandbox/public/vendor/RRSSB/css/rrssb.css | css | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,558 |
```javascript
+function(t,e,i){"use strict";var r={calc:!1};e.fn.rrssb=function(t){var r=e.extend({description:i,emailAddress:i,emailBody:i,emailSubject:i,image:i,title:i,url:i},t);r.emailSubject=r.emailSubject||r.title,r.emailBody=r.emailBody||(r.description?r.description:"")+(r.url?"\n\n"+r.url:"");for(var s in r)r.hasOwnProperty(s)&&r[s]!==i&&(r[s]=a(r[s]));r.url!==i&&(e(this).find(".rrssb-facebook a").attr("href","path_to_url"+r.url),e(this).find(".rrssb-tumblr a").attr("href","path_to_url"+r.url+(r.title!==i?"&name="+r.title:"")+(r.description!==i?"&description="+r.description:"")),e(this).find(".rrssb-linkedin a").attr("href","path_to_url"+r.url+(r.title!==i?"&title="+r.title:"")+(r.description!==i?"&summary="+r.description:"")),e(this).find(".rrssb-twitter a").attr("href","path_to_url"+(r.description!==i?r.description:"")+"%20"+r.url),e(this).find(".rrssb-hackernews a").attr("href","path_to_url"+r.url+(r.title!==i?"&text="+r.title:"")),e(this).find(".rrssb-reddit a").attr("href","path_to_url"+r.url+(r.description!==i?"&text="+r.description:"")+(r.title!==i?"&title="+r.title:"")),e(this).find(".rrssb-googleplus a").attr("href","path_to_url"+(r.description!==i?r.description:"")+"%20"+r.url),e(this).find(".rrssb-pinterest a").attr("href","path_to_url"+r.url+(r.image!==i?"&media="+r.image:"")+(r.description!==i?"&description="+r.description:"")),e(this).find(".rrssb-pocket a").attr("href","path_to_url"+r.url),e(this).find(".rrssb-github a").attr("href",r.url),e(this).find(".rrssb-print a").attr("href","javascript:window.print()"),e(this).find(".rrssb-whatsapp a").attr("href","whatsapp://send?text="+(r.description!==i?r.description+"%20":r.title!==i?r.title+"%20":"")+r.url)),(r.emailAddress!==i||r.emailSubject)&&e(this).find(".rrssb-email a").attr("href","mailto:"+(r.emailAddress?r.emailAddress:"")+"?"+(r.emailSubject!==i?"subject="+r.emailSubject:"")+(r.emailBody!==i?"&body="+r.emailBody:""))};var s=function(){var t=e("<div>"),i=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var s=0;s<i.length;s++)if(t.css("width",i[s]+"(1px)"),1===t.width()){r.calc=i[s];break}t.remove()},a=function(t){if(t!==i&&null!==t){if(null===t.match(/%[0-9a-f]{2}/i))return encodeURIComponent(t);t=decodeURIComponent(t),a(t)}},n=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li:visible",i),s=r.length,a=100/s;r.css("width",a+"%").attr("data-initwidth",a)})},l=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=i.width(),s=e("li",i).not(".small").eq(0).width(),a=e("li.small",i).length;if(s>170&&1>a){i.addClass("large-format");var n=s/12+"px";i.css("font-size",n)}else i.removeClass("large-format"),i.css("font-size","");25*a>r?i.removeClass("small-format").addClass("tiny-format"):i.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li",i),s=r.filter(".small"),a=0,n=0,l=s.eq(0),o=parseFloat(l.attr("data-size"))+55,c=s.length;if(c===r.length){var h=42*c,u=i.width();u>h+o&&(i.removeClass("small-format"),s.eq(0).removeClass("small"),d())}else{r.not(".small").each(function(t){var i=e(this),r=parseFloat(i.attr("data-size"))+55,s=parseFloat(i.width());a+=s,n+=r});var m=a-n;m>o&&(l.removeClass("small"),d())}})},c=function(t){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li",i);e(r.get().reverse()).each(function(t,i){var s=e(this);if(s.hasClass("small")===!1){var a=parseFloat(s.attr("data-size"))+55,n=parseFloat(s.width());if(a>n){var l=r.not(".small").last();e(l).addClass("small"),d()}}--i||o()})}),t===!0&&u(d)},d=function(){e(".rrssb-buttons").each(function(t){var i,s,a,l,o,c=e(this),d=e("li",c),h=d.filter(".small"),u=h.length;u>0&&u!==d.length?(c.removeClass("small-format"),h.css("width","42px"),a=42*u,i=d.not(".small").length,s=100/i,o=a/i,r.calc===!1?(l=(c.innerWidth()-1)/i-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=r.calc+"("+s+"% - "+o+"px)",d.not(".small").css("width",l)):u===d.length?(c.addClass("small-format"),n()):(c.removeClass("small-format"),n())}),l()},h=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),s(),n(),e(".rrssb-buttons li .rrssb-text").each(function(t){var i=e(this),r=i.width();i.closest("li").attr("data-size",r)}),c(!0)},u=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},m=function(e,r,s,a){var n=t.screenLeft!==i?t.screenLeft:screen.left,l=t.screenTop!==i?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,d=o/2-s/2+n,h=c/3-a/3+l,u=t.open(e,r,"scrollbars=yes, width="+s+", height="+a+", top="+h+", left="+d);u&&u.focus&&u.focus()},f=function(){var t={};return function(e,i,r){r||(r="Don't call this twice without a uniqueId"),t[r]&&clearTimeout(t[r]),t[r]=setTimeout(e,i)}}();e(document).ready(function(){try{e(document).on("click",".rrssb-buttons a.popup",{},function(t){var i=e(this);m(i.attr("href"),i.find(".rrssb-text").html(),580,470),t.preventDefault()})}catch(i){}e(t).resize(function(){u(d),f(function(){u(d)},200,"finished resizing")}),h()}),t.rrssbInit=h}(window,jQuery);
``` | /content/code_sandbox/public/vendor/RRSSB/js/rrssb.min.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,685 |
```javascript
/*!
Ridiculously Responsive Social Sharing Buttons
Team: @dbox, @joshuatuscan
Site: path_to_url
Twitter: @therealkni
___ ___
/__/| /__/\ ___
| |:| \ \:\ / /\
| |:| \ \:\ / /:/
__| |:| _____\__\:\ /__/::\
/__/\_|:|____ /__/::::::::\ \__\/\:\__
\ \:\/:::::/ \ \:\~~\~~\/ \ \:\/\
\ \::/~~~~ \ \:\ ~~~ \__\::/
\ \:\ \ \:\ /__/:/
\ \:\ \ \:\ \__\/
\__\/ \__\/
*/
+(function(window, $, undefined) {
'use strict';
var support = {
calc : false
};
/*
* Public Function
*/
$.fn.rrssb = function( options ) {
// Settings that $.rrssb() will accept.
var settings = $.extend({
description: undefined,
emailAddress: undefined,
emailBody: undefined,
emailSubject: undefined,
image: undefined,
title: undefined,
url: undefined
}, options );
// use some sensible defaults if they didn't specify email settings
settings.emailSubject = settings.emailSubject || settings.title;
settings.emailBody = settings.emailBody ||
(
(settings.description ? settings.description : '') +
(settings.url ? '\n\n' + settings.url : '')
);
// Return the encoded strings if the settings have been changed.
for (var key in settings) {
if (settings.hasOwnProperty(key) && settings[key] !== undefined) {
settings[key] = encodeString(settings[key]);
}
};
if (settings.url !== undefined) {
$(this).find('.rrssb-facebook a').attr('href', 'path_to_url + settings.url);
$(this).find('.rrssb-tumblr a').attr('href', 'path_to_url + settings.url + (settings.title !== undefined ? '&name=' + settings.title : '') + (settings.description !== undefined ? '&description=' + settings.description : ''));
$(this).find('.rrssb-linkedin a').attr('href', 'path_to_url + settings.url + (settings.title !== undefined ? '&title=' + settings.title : '') + (settings.description !== undefined ? '&summary=' + settings.description : ''));
$(this).find('.rrssb-twitter a').attr('href', 'path_to_url + (settings.description !== undefined ? settings.description : '') + '%20' + settings.url);
$(this).find('.rrssb-hackernews a').attr('href', 'path_to_url + settings.url + (settings.title !== undefined ? '&text=' + settings.title : ''));
$(this).find('.rrssb-reddit a').attr('href', 'path_to_url + settings.url + (settings.description !== undefined ? '&text=' + settings.description : '') + (settings.title !== undefined ? '&title=' + settings.title : ''));
$(this).find('.rrssb-googleplus a').attr('href', 'path_to_url + (settings.description !== undefined ? settings.description : '') + '%20' + settings.url);
$(this).find('.rrssb-pinterest a').attr('href', 'path_to_url + settings.url + ((settings.image !== undefined) ? '&media=' + settings.image : '') + (settings.description !== undefined ? '&description=' + settings.description : ''));
$(this).find('.rrssb-pocket a').attr('href', 'path_to_url + settings.url);
$(this).find('.rrssb-github a').attr('href', settings.url);
$(this).find('.rrssb-print a').attr('href', 'javascript:window.print()');
$(this).find('.rrssb-whatsapp a').attr('href', 'whatsapp://send?text=' + (settings.description !== undefined ? settings.description + '%20' : (settings.title !== undefined ? settings.title + '%20' : '')) + settings.url);
}
if (settings.emailAddress !== undefined || settings.emailSubject) {
$(this).find('.rrssb-email a').attr('href', 'mailto:' + (settings.emailAddress ? settings.emailAddress : '') + '?' + (settings.emailSubject !== undefined ? 'subject=' + settings.emailSubject : '') + (settings.emailBody !== undefined ? '&body=' + settings.emailBody : ''));
}
};
/*
* Utility functions
*/
var detectCalcSupport = function(){
//detect if calc is natively supported.
var el = $('<div>');
var calcProps = [
'calc',
'-webkit-calc',
'-moz-calc'
];
$('body').append(el);
for (var i=0; i < calcProps.length; i++) {
el.css('width', calcProps[i] + '(1px)');
if(el.width() === 1){
support.calc = calcProps[i];
break;
}
}
el.remove();
};
var encodeString = function(string) {
// Recursively decode string first to ensure we aren't double encoding.
if (string !== undefined && string !== null) {
if (string.match(/%[0-9a-f]{2}/i) !== null) {
string = decodeURIComponent(string);
encodeString(string);
} else {
return encodeURIComponent(string);
}
}
};
var setPercentBtns = function() {
// loop through each instance of buttons
$('.rrssb-buttons').each(function(index) {
var self = $(this);
var buttons = $('li:visible', self);
var numOfButtons = buttons.length;
var initBtnWidth = 100 / numOfButtons;
// set initial width of buttons
buttons.css('width', initBtnWidth + '%').attr('data-initwidth',initBtnWidth);
});
};
var makeExtremityBtns = function() {
// loop through each instance of buttons
$('.rrssb-buttons').each(function(index) {
var self = $(this);
//get button width
var containerWidth = self.width();
var buttonWidth = $('li', self).not('.small').eq(0).width();
var buttonCountSmall = $('li.small', self).length;
// enlarge buttons if they get wide enough
if (buttonWidth > 170 && buttonCountSmall < 1) {
self.addClass('large-format');
var fontSize = buttonWidth / 12 + 'px';
self.css('font-size', fontSize);
} else {
self.removeClass('large-format');
self.css('font-size', '');
}
if (containerWidth < buttonCountSmall * 25) {
self.removeClass('small-format').addClass('tiny-format');
} else {
self.removeClass('tiny-format');
}
});
};
var backUpFromSmall = function() {
// loop through each instance of buttons
$('.rrssb-buttons').each(function(index) {
var self = $(this);
var buttons = $('li', self);
var smallButtons = buttons.filter('.small');
var totalBtnSze = 0;
var totalTxtSze = 0;
var upCandidate = smallButtons.eq(0);
var nextBackUp = parseFloat(upCandidate.attr('data-size')) + 55;
var smallBtnCount = smallButtons.length;
if (smallBtnCount === buttons.length) {
var btnCalc = smallBtnCount * 42;
var containerWidth = self.width();
if ((btnCalc + nextBackUp) < containerWidth) {
self.removeClass('small-format');
smallButtons.eq(0).removeClass('small');
sizeSmallBtns();
}
} else {
buttons.not('.small').each(function(index) {
var button = $(this);
var txtWidth = parseFloat(button.attr('data-size')) + 55;
var btnWidth = parseFloat(button.width());
totalBtnSze = totalBtnSze + btnWidth;
totalTxtSze = totalTxtSze + txtWidth;
});
var spaceLeft = totalBtnSze - totalTxtSze;
if (nextBackUp < spaceLeft) {
upCandidate.removeClass('small');
sizeSmallBtns();
}
}
});
};
var checkSize = function(init) {
// loop through each instance of buttons
$('.rrssb-buttons').each(function(index) {
var self = $(this);
var buttons = $('li', self);
// get buttons in reverse order and loop through each
$(buttons.get().reverse()).each(function(index, count) {
var button = $(this);
if (button.hasClass('small') === false) {
var txtWidth = parseFloat(button.attr('data-size')) + 55;
var btnWidth = parseFloat(button.width());
if (txtWidth > btnWidth) {
var btn2small = buttons.not('.small').last();
$(btn2small).addClass('small');
sizeSmallBtns();
}
}
if (!--count) backUpFromSmall();
});
});
// if first time running, put it through the magic layout
if (init === true) {
rrssbMagicLayout(sizeSmallBtns);
}
};
var sizeSmallBtns = function() {
// loop through each instance of buttons
$('.rrssb-buttons').each(function(index) {
var self = $(this);
var regButtonCount;
var regPercent;
var pixelsOff;
var magicWidth;
var smallBtnFraction;
var buttons = $('li', self);
var smallButtons = buttons.filter('.small');
// readjust buttons for small display
var smallBtnCount = smallButtons.length;
// make sure there are small buttons
if (smallBtnCount > 0 && smallBtnCount !== buttons.length) {
self.removeClass('small-format');
//make sure small buttons are square when not all small
smallButtons.css('width','42px');
pixelsOff = smallBtnCount * 42;
regButtonCount = buttons.not('.small').length;
regPercent = 100 / regButtonCount;
smallBtnFraction = pixelsOff / regButtonCount;
// if calc is not supported. calculate the width on the fly.
if (support.calc === false) {
magicWidth = ((self.innerWidth()-1) / regButtonCount) - smallBtnFraction;
magicWidth = Math.floor(magicWidth*1000) / 1000;
magicWidth += 'px';
} else {
magicWidth = support.calc+'('+regPercent+'% - '+smallBtnFraction+'px)';
}
buttons.not('.small').css('width', magicWidth);
} else if (smallBtnCount === buttons.length) {
// if all buttons are small, change back to percentage
self.addClass('small-format');
setPercentBtns();
} else {
self.removeClass('small-format');
setPercentBtns();
}
}); //end loop
makeExtremityBtns();
};
var rrssbInit = function() {
$('.rrssb-buttons').each(function(index) {
$(this).addClass('rrssb-'+(index + 1));
});
detectCalcSupport();
setPercentBtns();
// grab initial text width of each button and add as data attr
$('.rrssb-buttons li .rrssb-text').each(function(index) {
var buttonTxt = $(this);
var txtWdth = buttonTxt.width();
buttonTxt.closest('li').attr('data-size', txtWdth);
});
checkSize(true);
};
var rrssbMagicLayout = function(callback) {
//remove small buttons before each conversion try
$('.rrssb-buttons li.small').removeClass('small');
checkSize();
callback();
};
var popupCenter = function(url, title, w, h) {
// Fixes dual-screen position Most browsers Firefox
var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left;
var dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top;
var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
var left = ((width / 2) - (w / 2)) + dualScreenLeft;
var top = ((height / 3) - (h / 3)) + dualScreenTop;
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
// Puts focus on the newWindow
if (newWindow && newWindow.focus) {
newWindow.focus();
}
};
var waitForFinalEvent = (function () {
var timers = {};
return function (callback, ms, uniqueId) {
if (!uniqueId) {
uniqueId = "Don't call this twice without a uniqueId";
}
if (timers[uniqueId]) {
clearTimeout (timers[uniqueId]);
}
timers[uniqueId] = setTimeout(callback, ms);
};
})();
// init load
$(document).ready(function(){
/*
* Event listners
*/
try {
$(document).on('click', '.rrssb-buttons a.popup', {}, function popUp(e) {
var self = $(this);
popupCenter(self.attr('href'), self.find('.rrssb-text').html(), 580, 470);
e.preventDefault();
});
}
catch (e) { // catching this adds partial support for jQuery 1.3
}
// resize function
$(window).resize(function () {
rrssbMagicLayout(sizeSmallBtns);
waitForFinalEvent(function(){
rrssbMagicLayout(sizeSmallBtns);
}, 200, "finished resizing");
});
rrssbInit();
});
// Make global
window.rrssbInit = rrssbInit;
})(window, jQuery);
``` | /content/code_sandbox/public/vendor/RRSSB/js/rrssb.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 3,227 |
```javascript
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
``` | /content/code_sandbox/public/vendor/RRSSB/js/vendor/jquery.1.10.2.min.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 31,232 |
```javascript
_aa={};_aa._ab=function(f,e){var d=qrcode.width;var b=qrcode.height;var c=true;for(var g=0;g<e.length&&c;g+=2){var a=Math.floor(e[g]);var h=Math.floor(e[g+1]);if(a<-1||a>d||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}c=true;for(var g=e.length-2;g>=0&&c;g-=2){var a=Math.floor(e[g]);var h=Math.floor(e[g+1]);if(a<-1||a>d||h<-1||h>b){throw"Error._ab "}c=false;if(a==-1){e[g]=0;c=true}else{if(a==d){e[g]=d-1;c=true}}if(h==-1){e[g+1]=0;c=true}else{if(h==b){e[g+1]=b-1;c=true}}}};_aa._af=function(b,d,a){var l=new _ac(d);var k=new Array(d<<1);for(var g=0;g<d;g++){var h=k.length;var j=g+0.5;for(var i=0;i<h;i+=2){k[i]=(i>>1)+0.5;k[i+1]=j}a._ad(k);_aa._ab(b,k);try{for(var i=0;i<h;i+=2){var e=(Math.floor(k[i])*4)+(Math.floor(k[i+1])*qrcode.width*4);var f=b[Math.floor(k[i])+qrcode.width*Math.floor(k[i+1])];qrcode.imagedata.data[e]=f?255:0;qrcode.imagedata.data[e+1]=f?255:0;qrcode.imagedata.data[e+2]=0;qrcode.imagedata.data[e+3]=255;if(f){l._dq(i>>1,g)}}}catch(c){throw"Error._ab"}}return l};_aa._ah=function(h,o,l,k,r,q,b,a,f,e,n,m,t,s,d,c,j,i){var g=_ae._ag(l,k,r,q,b,a,f,e,n,m,t,s,d,c,j,i);return _aa._af(h,o,g)};function _a1(b,a){this.count=b;this._fc=a;this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("_dm",function(){return this._fc})}function _a2(a,c,b){this._bm=a;if(b){this._do=new Array(c,b)}else{this._do=new Array(c)}this.__defineGetter__("_bo",function(){return this._bm});this.__defineGetter__("_dn",function(){return this._bm*this._fo});this.__defineGetter__("_fo",function(){var e=0;for(var d=0;d<this._do.length;d++){e+=this._do[d].length}return e});this._fb=function(){return this._do}}function _a3(k,l,h,g,f,e){this._bs=k;this._ar=l;this._do=new Array(h,g,f,e);var j=0;var b=h._bo;var a=h._fb();for(var d=0;d<a.length;d++){var c=a[d];j+=c.Count*(c._dm+b)}this._br=j;this.__defineGetter__("_fd",function(){return this._bs});this.__defineGetter__("_as",function(){return this._ar});this.__defineGetter__("_dp",function(){return this._br});this.__defineGetter__("_cr",function(){return 17+4*this._bs});this._aq=function(){var r=this._cr;var o=new _ac(r);o._bq(0,0,9,9);o._bq(r-8,0,8,9);o._bq(0,r-8,9,8);var n=this._ar.length;for(var m=0;m<n;m++){var q=this._ar[m]-2;for(var s=0;s<n;s++){if((m==0&&(s==0||s==n-1))||(m==n-1&&s==0)){continue}o._bq(this._ar[s]-2,q,5,5)}}o._bq(6,9,1,r-17);o._bq(9,6,r-17,1);if(this._bs>6){o._bq(r-11,0,3,6);o._bq(0,r-11,6,3)}return o};this._bu=function(i){return this._do[i.ordinal()]}}_a3._bv=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017);_a3.VERSIONS=_ay();_a3._av=function(a){if(a<1||a>40){throw"bad arguments"}return _a3.VERSIONS[a-1]};_a3._at=function(b){if(b%4!=1){throw"Error _at"}try{return _a3._av((b-17)>>2)}catch(a){throw"Error _av"}};_a3._aw=function(d){var b=4294967295;var f=0;for(var c=0;c<_a3._bv.length;c++){var a=_a3._bv[c];if(a==d){return this._av(c+7)}var e=_ax._gj(d,a);if(e<b){f=c+7;b=e}}if(b<=3){return this._av(f)}return null};function _ay(){return new Array(new _a3(1,new Array(),new _a2(7,new _a1(1,19)),new _a2(10,new _a1(1,16)),new _a2(13,new _a1(1,13)),new _a2(17,new _a1(1,9))),new _a3(2,new Array(6,18),new _a2(10,new _a1(1,34)),new _a2(16,new _a1(1,28)),new _a2(22,new _a1(1,22)),new _a2(28,new _a1(1,16))),new _a3(3,new Array(6,22),new _a2(15,new _a1(1,55)),new _a2(26,new _a1(1,44)),new _a2(18,new _a1(2,17)),new _a2(22,new _a1(2,13))),new _a3(4,new Array(6,26),new _a2(20,new _a1(1,80)),new _a2(18,new _a1(2,32)),new _a2(26,new _a1(2,24)),new _a2(16,new _a1(4,9))),new _a3(5,new Array(6,30),new _a2(26,new _a1(1,108)),new _a2(24,new _a1(2,43)),new _a2(18,new _a1(2,15),new _a1(2,16)),new _a2(22,new _a1(2,11),new _a1(2,12))),new _a3(6,new Array(6,34),new _a2(18,new _a1(2,68)),new _a2(16,new _a1(4,27)),new _a2(24,new _a1(4,19)),new _a2(28,new _a1(4,15))),new _a3(7,new Array(6,22,38),new _a2(20,new _a1(2,78)),new _a2(18,new _a1(4,31)),new _a2(18,new _a1(2,14),new _a1(4,15)),new _a2(26,new _a1(4,13),new _a1(1,14))),new _a3(8,new Array(6,24,42),new _a2(24,new _a1(2,97)),new _a2(22,new _a1(2,38),new _a1(2,39)),new _a2(22,new _a1(4,18),new _a1(2,19)),new _a2(26,new _a1(4,14),new _a1(2,15))),new _a3(9,new Array(6,26,46),new _a2(30,new _a1(2,116)),new _a2(22,new _a1(3,36),new _a1(2,37)),new _a2(20,new _a1(4,16),new _a1(4,17)),new _a2(24,new _a1(4,12),new _a1(4,13))),new _a3(10,new Array(6,28,50),new _a2(18,new _a1(2,68),new _a1(2,69)),new _a2(26,new _a1(4,43),new _a1(1,44)),new _a2(24,new _a1(6,19),new _a1(2,20)),new _a2(28,new _a1(6,15),new _a1(2,16))),new _a3(11,new Array(6,30,54),new _a2(20,new _a1(4,81)),new _a2(30,new _a1(1,50),new _a1(4,51)),new _a2(28,new _a1(4,22),new _a1(4,23)),new _a2(24,new _a1(3,12),new _a1(8,13))),new _a3(12,new Array(6,32,58),new _a2(24,new _a1(2,92),new _a1(2,93)),new _a2(22,new _a1(6,36),new _a1(2,37)),new _a2(26,new _a1(4,20),new _a1(6,21)),new _a2(28,new _a1(7,14),new _a1(4,15))),new _a3(13,new Array(6,34,62),new _a2(26,new _a1(4,107)),new _a2(22,new _a1(8,37),new _a1(1,38)),new _a2(24,new _a1(8,20),new _a1(4,21)),new _a2(22,new _a1(12,11),new _a1(4,12))),new _a3(14,new Array(6,26,46,66),new _a2(30,new _a1(3,115),new _a1(1,116)),new _a2(24,new _a1(4,40),new _a1(5,41)),new _a2(20,new _a1(11,16),new _a1(5,17)),new _a2(24,new _a1(11,12),new _a1(5,13))),new _a3(15,new Array(6,26,48,70),new _a2(22,new _a1(5,87),new _a1(1,88)),new _a2(24,new _a1(5,41),new _a1(5,42)),new _a2(30,new _a1(5,24),new _a1(7,25)),new _a2(24,new _a1(11,12),new _a1(7,13))),new _a3(16,new Array(6,26,50,74),new _a2(24,new _a1(5,98),new _a1(1,99)),new _a2(28,new _a1(7,45),new _a1(3,46)),new _a2(24,new _a1(15,19),new _a1(2,20)),new _a2(30,new _a1(3,15),new _a1(13,16))),new _a3(17,new Array(6,30,54,78),new _a2(28,new _a1(1,107),new _a1(5,108)),new _a2(28,new _a1(10,46),new _a1(1,47)),new _a2(28,new _a1(1,22),new _a1(15,23)),new _a2(28,new _a1(2,14),new _a1(17,15))),new _a3(18,new Array(6,30,56,82),new _a2(30,new _a1(5,120),new _a1(1,121)),new _a2(26,new _a1(9,43),new _a1(4,44)),new _a2(28,new _a1(17,22),new _a1(1,23)),new _a2(28,new _a1(2,14),new _a1(19,15))),new _a3(19,new Array(6,30,58,86),new _a2(28,new _a1(3,113),new _a1(4,114)),new _a2(26,new _a1(3,44),new _a1(11,45)),new _a2(26,new _a1(17,21),new _a1(4,22)),new _a2(26,new _a1(9,13),new _a1(16,14))),new _a3(20,new Array(6,34,62,90),new _a2(28,new _a1(3,107),new _a1(5,108)),new _a2(26,new _a1(3,41),new _a1(13,42)),new _a2(30,new _a1(15,24),new _a1(5,25)),new _a2(28,new _a1(15,15),new _a1(10,16))),new _a3(21,new Array(6,28,50,72,94),new _a2(28,new _a1(4,116),new _a1(4,117)),new _a2(26,new _a1(17,42)),new _a2(28,new _a1(17,22),new _a1(6,23)),new _a2(30,new _a1(19,16),new _a1(6,17))),new _a3(22,new Array(6,26,50,74,98),new _a2(28,new _a1(2,111),new _a1(7,112)),new _a2(28,new _a1(17,46)),new _a2(30,new _a1(7,24),new _a1(16,25)),new _a2(24,new _a1(34,13))),new _a3(23,new Array(6,30,54,74,102),new _a2(30,new _a1(4,121),new _a1(5,122)),new _a2(28,new _a1(4,47),new _a1(14,48)),new _a2(30,new _a1(11,24),new _a1(14,25)),new _a2(30,new _a1(16,15),new _a1(14,16))),new _a3(24,new Array(6,28,54,80,106),new _a2(30,new _a1(6,117),new _a1(4,118)),new _a2(28,new _a1(6,45),new _a1(14,46)),new _a2(30,new _a1(11,24),new _a1(16,25)),new _a2(30,new _a1(30,16),new _a1(2,17))),new _a3(25,new Array(6,32,58,84,110),new _a2(26,new _a1(8,106),new _a1(4,107)),new _a2(28,new _a1(8,47),new _a1(13,48)),new _a2(30,new _a1(7,24),new _a1(22,25)),new _a2(30,new _a1(22,15),new _a1(13,16))),new _a3(26,new Array(6,30,58,86,114),new _a2(28,new _a1(10,114),new _a1(2,115)),new _a2(28,new _a1(19,46),new _a1(4,47)),new _a2(28,new _a1(28,22),new _a1(6,23)),new _a2(30,new _a1(33,16),new _a1(4,17))),new _a3(27,new Array(6,34,62,90,118),new _a2(30,new _a1(8,122),new _a1(4,123)),new _a2(28,new _a1(22,45),new _a1(3,46)),new _a2(30,new _a1(8,23),new _a1(26,24)),new _a2(30,new _a1(12,15),new _a1(28,16))),new _a3(28,new Array(6,26,50,74,98,122),new _a2(30,new _a1(3,117),new _a1(10,118)),new _a2(28,new _a1(3,45),new _a1(23,46)),new _a2(30,new _a1(4,24),new _a1(31,25)),new _a2(30,new _a1(11,15),new _a1(31,16))),new _a3(29,new Array(6,30,54,78,102,126),new _a2(30,new _a1(7,116),new _a1(7,117)),new _a2(28,new _a1(21,45),new _a1(7,46)),new _a2(30,new _a1(1,23),new _a1(37,24)),new _a2(30,new _a1(19,15),new _a1(26,16))),new _a3(30,new Array(6,26,52,78,104,130),new _a2(30,new _a1(5,115),new _a1(10,116)),new _a2(28,new _a1(19,47),new _a1(10,48)),new _a2(30,new _a1(15,24),new _a1(25,25)),new _a2(30,new _a1(23,15),new _a1(25,16))),new _a3(31,new Array(6,30,56,82,108,134),new _a2(30,new _a1(13,115),new _a1(3,116)),new _a2(28,new _a1(2,46),new _a1(29,47)),new _a2(30,new _a1(42,24),new _a1(1,25)),new _a2(30,new _a1(23,15),new _a1(28,16))),new _a3(32,new Array(6,34,60,86,112,138),new _a2(30,new _a1(17,115)),new _a2(28,new _a1(10,46),new _a1(23,47)),new _a2(30,new _a1(10,24),new _a1(35,25)),new _a2(30,new _a1(19,15),new _a1(35,16))),new _a3(33,new Array(6,30,58,86,114,142),new _a2(30,new _a1(17,115),new _a1(1,116)),new _a2(28,new _a1(14,46),new _a1(21,47)),new _a2(30,new _a1(29,24),new _a1(19,25)),new _a2(30,new _a1(11,15),new _a1(46,16))),new _a3(34,new Array(6,34,62,90,118,146),new _a2(30,new _a1(13,115),new _a1(6,116)),new _a2(28,new _a1(14,46),new _a1(23,47)),new _a2(30,new _a1(44,24),new _a1(7,25)),new _a2(30,new _a1(59,16),new _a1(1,17))),new _a3(35,new Array(6,30,54,78,102,126,150),new _a2(30,new _a1(12,121),new _a1(7,122)),new _a2(28,new _a1(12,47),new _a1(26,48)),new _a2(30,new _a1(39,24),new _a1(14,25)),new _a2(30,new _a1(22,15),new _a1(41,16))),new _a3(36,new Array(6,24,50,76,102,128,154),new _a2(30,new _a1(6,121),new _a1(14,122)),new _a2(28,new _a1(6,47),new _a1(34,48)),new _a2(30,new _a1(46,24),new _a1(10,25)),new _a2(30,new _a1(2,15),new _a1(64,16))),new _a3(37,new Array(6,28,54,80,106,132,158),new _a2(30,new _a1(17,122),new _a1(4,123)),new _a2(28,new _a1(29,46),new _a1(14,47)),new _a2(30,new _a1(49,24),new _a1(10,25)),new _a2(30,new _a1(24,15),new _a1(46,16))),new _a3(38,new Array(6,32,58,84,110,136,162),new _a2(30,new _a1(4,122),new _a1(18,123)),new _a2(28,new _a1(13,46),new _a1(32,47)),new _a2(30,new _a1(48,24),new _a1(14,25)),new _a2(30,new _a1(42,15),new _a1(32,16))),new _a3(39,new Array(6,26,54,82,110,138,166),new _a2(30,new _a1(20,117),new _a1(4,118)),new _a2(28,new _a1(40,47),new _a1(7,48)),new _a2(30,new _a1(43,24),new _a1(22,25)),new _a2(30,new _a1(10,15),new _a1(67,16))),new _a3(40,new Array(6,30,58,86,114,142,170),new _a2(30,new _a1(19,118),new _a1(6,119)),new _a2(28,new _a1(18,47),new _a1(31,48)),new _a2(30,new _a1(34,24),new _a1(34,25)),new _a2(30,new _a1(20,15),new _a1(61,16))))}function _ae(i,f,c,h,e,b,g,d,a){this.a11=i;this.a12=h;this.a13=g;this.a21=f;this.a22=e;this.a23=d;this.a31=c;this.a32=b;this.a33=a;this._ad=function(w){var t=w.length;var A=this.a11;var z=this.a12;var v=this.a13;var r=this.a21;var q=this.a22;var o=this.a23;var m=this.a31;var k=this.a32;var j=this.a33;for(var n=0;n<t;n+=2){var u=w[n];var s=w[n+1];var l=v*u+o*s+j;w[n]=(A*u+r*s+m)/l;w[n+1]=(z*u+q*s+k)/l}};this._fp=function(m,k){var r=m.length;for(var l=0;l<r;l++){var j=m[l];var q=k[l];var o=this.a13*j+this.a23*q+this.a33;m[l]=(this.a11*j+this.a21*q+this.a31)/o;k[l]=(this.a12*j+this.a22*q+this.a32)/o}};this._fr=function(){return new _ae(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)};this.times=function(j){return new _ae(this.a11*j.a11+this.a21*j.a12+this.a31*j.a13,this.a11*j.a21+this.a21*j.a22+this.a31*j.a23,this.a11*j.a31+this.a21*j.a32+this.a31*j.a33,this.a12*j.a11+this.a22*j.a12+this.a32*j.a13,this.a12*j.a21+this.a22*j.a22+this.a32*j.a23,this.a12*j.a31+this.a22*j.a32+this.a32*j.a33,this.a13*j.a11+this.a23*j.a12+this.a33*j.a13,this.a13*j.a21+this.a23*j.a22+this.a33*j.a23,this.a13*j.a31+this.a23*j.a32+this.a33*j.a33)}}_ae._ag=function(q,e,o,d,n,c,m,b,h,r,l,f,a,j,i,s){var g=this._be(q,e,o,d,n,c,m,b);var k=this._bf(h,r,l,f,a,j,i,s);return k.times(g)};_ae._bf=function(f,h,d,g,b,e,a,c){dy2=c-e;dy3=h-g+e-c;if(dy2==0&&dy3==0){return new _ae(d-f,b-d,f,g-h,e-g,h,0,0,1)}else{dx1=d-b;dx2=a-b;dx3=f-d+b-a;dy1=g-e;_dr=dx1*dy2-dx2*dy1;a13=(dx3*dy2-dx2*dy3)/_dr;a23=(dx1*dy3-dx3*dy1)/_dr;return new _ae(d-f+a13*d,a-f+a23*a,f,g-h+a13*g,c-h+a23*c,h,a13,a23,1)}};_ae._be=function(f,h,d,g,b,e,a,c){return this._bf(f,h,d,g,b,e,a,c)._fr()};function _bg(b,a){this.bits=b;this.points=a}function Detector(a){this.image=a;this._am=null;this._bi=function(m,l,c,b){var d=Math.abs(b-l)>Math.abs(c-m);if(d){var s=m;m=l;l=s;s=c;c=b;b=s}var j=Math.abs(c-m);var i=Math.abs(b-l);var q=-j>>1;var v=l<b?1:-1;var f=m<c?1:-1;var e=0;for(var h=m,g=l;h!=c;h+=f){var u=d?g:h;var t=d?h:g;if(e==1){if(this.image[u+t*qrcode.width]){e++}}else{if(!this.image[u+t*qrcode.width]){e++}}if(e==3){var o=h-m;var n=g-l;return Math.sqrt((o*o+n*n))}q+=i;if(q>0){if(g==b){break}g+=v;q-=j}}var k=c-m;var r=b-l;return Math.sqrt((k*k+r*r))};this._bh=function(i,g,h,f){var b=this._bi(i,g,h,f);var e=1;var d=i-(h-i);if(d<0){e=i/(i-d);d=0}else{if(d>=qrcode.width){e=(qrcode.width-1-i)/(d-i);d=qrcode.width-1}}var c=Math.floor(g-(f-g)*e);e=1;if(c<0){e=g/(g-c);c=0}else{if(c>=qrcode.height){e=(qrcode.height-1-g)/(c-g);c=qrcode.height-1}}d=Math.floor(i+(d-i)*e);b+=this._bi(i,g,d,c);return b-1};this._bj=function(c,d){var b=this._bh(Math.floor(c.X),Math.floor(c.Y),Math.floor(d.X),Math.floor(d.Y));var e=this._bh(Math.floor(d.X),Math.floor(d.Y),Math.floor(c.X),Math.floor(c.Y));if(isNaN(b)){return e/7}if(isNaN(e)){return b/7}return(b+e)/14};this._bk=function(d,c,b){return(this._bj(d,c)+this._bj(d,b))/2};this.distance=function(c,b){xDiff=c.X-b.X;yDiff=c.Y-b.Y;return Math.sqrt((xDiff*xDiff+yDiff*yDiff))};this._bx=function(g,f,d,e){var b=Math.round(this.distance(g,f)/e);var c=Math.round(this.distance(g,d)/e);var h=((b+c)>>1)+7;switch(h&3){case 0:h++;break;case 2:h--;break;case 3:throw"Error"}return h};this._bl=function(g,f,d,j){var k=Math.floor(j*g);var h=Math.max(0,f-k);var i=Math.min(qrcode.width-1,f+k);if(i-h<g*3){throw"Error"}var b=Math.max(0,d-k);var c=Math.min(qrcode.height-1,d+k);var e=new _ak(this.image,h,b,i-h,c-b,g,this._am);return e.find()};this.createTransform=function(l,h,k,b,g){var j=g-3.5;var i;var f;var e;var c;if(b!=null){i=b.X;f=b.Y;e=c=j-3}else{i=(h.X-l.X)+k.X;f=(h.Y-l.Y)+k.Y;e=c=j}var d=_ae._ag(3.5,3.5,j,3.5,e,c,3.5,j,l.X,l.Y,h.X,h.Y,i,f,k.X,k.Y);return d};this._bz=function(e,b,d){var c=_aa;return c._af(e,d,b)};this._cd=function(r){var j=r._gq;var h=r._gs;var n=r._gp;var d=this._bk(j,h,n);if(d<1){throw"Error"}var s=this._bx(j,h,n,d);var b=_a3._at(s);var k=b._cr-7;var l=null;if(b._as.length>0){var f=h.X-j.X+n.X;var e=h.Y-j.Y+n.Y;var c=1-3/k;var u=Math.floor(j.X+c*(f-j.X));var t=Math.floor(j.Y+c*(e-j.Y));for(var q=4;q<=16;q<<=1){l=this._bl(d,u,t,q);break}}var g=this.createTransform(j,h,n,l,s);var m=this._bz(this.image,g,s);var o;if(l==null){o=new Array(n,j,h)}else{o=new Array(n,j,h,l)}return new _bg(m,o)};this.detect=function(){var b=new _cc()._ce(this.image);return this._cd(b)}}var _ca=21522;var _cb=new Array(new Array(21522,0),new Array(20773,1),new Array(24188,2),new Array(23371,3),new Array(17913,4),new Array(16590,5),new Array(20375,6),new Array(19104,7),new Array(30660,8),new Array(29427,9),new Array(32170,10),new Array(30877,11),new Array(26159,12),new Array(25368,13),new Array(27713,14),new Array(26998,15),new Array(5769,16),new Array(5054,17),new Array(7399,18),new Array(6608,19),new Array(1890,20),new Array(597,21),new Array(3340,22),new Array(2107,23),new Array(13663,24),new Array(12392,25),new Array(16177,26),new Array(14854,27),new Array(9396,28),new Array(8579,29),new Array(11994,30),new Array(11245,31));var _ch=new Array(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);function _ax(a){this._cf=_cg.forBits((a>>3)&3);this._fe=(a&7);this.__defineGetter__("_cg",function(){return this._cf});this.__defineGetter__("_dx",function(){return this._fe});this.GetHashCode=function(){return(this._cf.ordinal()<<3)|_fe};this.Equals=function(c){var b=c;return this._cf==b._cf&&this._fe==b._fe}}_ax._gj=function(d,c){d^=c;return _ch[d&15]+_ch[(_ew(d,4)&15)]+_ch[(_ew(d,8)&15)]+_ch[(_ew(d,12)&15)]+_ch[(_ew(d,16)&15)]+_ch[(_ew(d,20)&15)]+_ch[(_ew(d,24)&15)]+_ch[(_ew(d,28)&15)]};_ax._ci=function(a){var b=_ax._cj(a);if(b!=null){return b}return _ax._cj(a^_ca)};_ax._cj=function(d){var b=4294967295;var a=0;for(var c=0;c<_cb.length;c++){var g=_cb[c];var f=g[0];if(f==d){return new _ax(g[1])}var e=this._gj(d,f);if(e<b){a=g[1];b=e}}if(b<=3){return new _ax(a)}return null};function _cg(a,c,b){this._ff=a;this.bits=c;this.name=b;this.__defineGetter__("Bits",function(){return this.bits});this.__defineGetter__("Name",function(){return this.name});this.ordinal=function(){return this._ff}}_cg.forBits=function(a){if(a<0||a>=FOR_BITS.length){throw"bad arguments"}return FOR_BITS[a]};var L=new _cg(0,1,"L");var M=new _cg(1,0,"M");var Q=new _cg(2,3,"Q");var H=new _cg(3,2,"H");var FOR_BITS=new Array(M,L,H,Q);function _ac(d,a){if(!a){a=d}if(d<1||a<1){throw"Both dimensions must be greater than 0"}this.width=d;this.height=a;var c=d>>5;if((d&31)!=0){c++}this.rowSize=c;this.bits=new Array(c*a);for(var b=0;b<this.bits.length;b++){this.bits[b]=0}this.__defineGetter__("Width",function(){return this.width});this.__defineGetter__("Height",function(){return this.height});this.__defineGetter__("Dimension",function(){if(this.width!=this.height){throw"Can't call getDimension() on a non-square matrix"}return this.width});this._ds=function(e,g){var f=g*this.rowSize+(e>>5);return((_ew(this.bits[f],(e&31)))&1)!=0};this._dq=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]|=1<<(e&31)};this.flip=function(e,g){var f=g*this.rowSize+(e>>5);this.bits[f]^=1<<(e&31)};this.clear=function(){var e=this.bits.length;for(var f=0;f<e;f++){this.bits[f]=0}};this._bq=function(g,j,f,m){if(j<0||g<0){throw"Left and top must be nonnegative"}if(m<1||f<1){throw"Height and width must be at least 1"}var l=g+f;var e=j+m;if(e>this.height||l>this.width){throw"The region must fit inside the matrix"}for(var i=j;i<e;i++){var h=i*this.rowSize;for(var k=g;k<l;k++){this.bits[h+(k>>5)]|=1<<(k&31)}}}}function _dl(a,b){this._dv=a;this._dw=b;this.__defineGetter__("_du",function(){return this._dv});this.__defineGetter__("Codewords",function(){return this._dw})}_dl._gn=function(c,h,s){if(c.length!=h._dp){throw"bad arguments"}var k=h._bu(s);var e=0;var d=k._fb();for(var r=0;r<d.length;r++){e+=d[r].Count}var l=new Array(e);var n=0;for(var o=0;o<d.length;o++){var f=d[o];for(var r=0;r<f.Count;r++){var m=f._dm;var t=k._bo+m;l[n++]=new _dl(m,new Array(t))}}var u=l[0]._dw.length;var b=l.length-1;while(b>=0){var w=l[b]._dw.length;if(w==u){break}b--}b++;var g=u-k._bo;var a=0;for(var r=0;r<g;r++){for(var o=0;o<n;o++){l[o]._dw[r]=c[a++]}}for(var o=b;o<n;o++){l[o]._dw[g]=c[a++]}var q=l[0]._dw.length;for(var r=g;r<q;r++){for(var o=0;o<n;o++){var v=o<b?r:r+1;l[o]._dw[v]=c[a++]}}return l};function _cl(a){var b=a.Dimension;if(b<21||(b&3)!=1){throw"Error _cl"}this._au=a;this._cp=null;this._co=null;this._dk=function(d,c,e){return this._au._ds(d,c)?(e<<1)|1:e<<1};this._cm=function(){if(this._co!=null){return this._co}var g=0;for(var e=0;e<6;e++){g=this._dk(e,8,g)}g=this._dk(7,8,g);g=this._dk(8,8,g);g=this._dk(8,7,g);for(var c=5;c>=0;c--){g=this._dk(8,c,g)}this._co=_ax._ci(g);if(this._co!=null){return this._co}var f=this._au.Dimension;g=0;var d=f-8;for(var e=f-1;e>=d;e--){g=this._dk(e,8,g)}for(var c=f-7;c<f;c++){g=this._dk(8,c,g)}this._co=_ax._ci(g);if(this._co!=null){return this._co}throw"Error _cm"};this._cq=function(){if(this._cp!=null){return this._cp}var h=this._au.Dimension;var f=(h-17)>>2;if(f<=6){return _a3._av(f)}var g=0;var e=h-11;for(var c=5;c>=0;c--){for(var d=h-9;d>=e;d--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}g=0;for(var d=5;d>=0;d--){for(var c=h-9;c>=e;c--){g=this._dk(d,c,g)}}this._cp=_a3._aw(g);if(this._cp!=null&&this._cp._cr==h){return this._cp}throw"Error _cq"};this._gk=function(){var r=this._cm();var o=this._cq();var c=_dx._gl(r._dx);var f=this._au.Dimension;c._dj(this._au,f);var k=o._aq();var n=true;var s=new Array(o._dp);var m=0;var q=0;var h=0;for(var e=f-1;e>0;e-=2){if(e==6){e--}for(var l=0;l<f;l++){var g=n?f-1-l:l;for(var d=0;d<2;d++){if(!k._ds(e-d,g)){h++;q<<=1;if(this._au._ds(e-d,g)){q|=1}if(h==8){s[m++]=q;h=0;q=0}}}}n^=true}if(m!=o._dp){throw"Error _gk"}return s}}_dx={};_dx._gl=function(a){if(a<0||a>7){throw"bad arguments"}return _dx._dy[a]};function _fg(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return((b+a)&1)==0}}function _fh(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return(b&1)==0}}function _fi(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return a%3==0}}function _fj(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return(b+a)%3==0}}function _fk(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return(((_ew(b,1))+(a/3))&1)==0}}function _fl(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(c,b){var a=c*b;return(a&1)+(a%3)==0}}function _fm(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(c,b){var a=c*b;return(((a&1)+(a%3))&1)==0}}function _fn(){this._dj=function(c,d){for(var b=0;b<d;b++){for(var a=0;a<d;a++){if(this._fw(b,a)){c.flip(a,b)}}}};this._fw=function(b,a){return((((b+a)&1)+((b*a)%3))&1)==0}}_dx._dy=new Array(new _fg(),new _fh(),new _fi(),new _fj(),new _fk(),new _fl(),new _fm(),new _fn());function _db(_fa){this._fa=_fa;this.decode=function(received,_fv){var poly=new _bp(this._fa,received);var _dh=new Array(_fv);for(var i=0;i<_dh.length;i++){_dh[i]=0}var _fq=false;var noError=true;for(var i=0;i<_fv;i++){var eval=poly.evaluateAt(this._fa.exp(_fq?i+1:i));_dh[_dh.length-1-i]=eval;if(eval!=0){noError=false}}if(noError){return}var _fu=new _bp(this._fa,_dh);var _dg=this._eb(this._fa._ba(_fv,1),_fu,_fv);var sigma=_dg[0];var omega=_dg[1];var _dz=this._ey(sigma);var _ea=this._di(omega,_dz,_fq);for(var i=0;i<_dz.length;i++){var position=received.length-1-this._fa.log(_dz[i]);if(position<0){throw"ReedSolomonException Bad error location"}received[position]=_az._bd(received[position],_ea[i])}};this._eb=function(a,b,R){if(a._ec<b._ec){var temp=a;a=b;b=temp}var rLast=a;var r=b;var sLast=this._fa.One;var s=this._fa.Zero;var tLast=this._fa.Zero;var t=this._fa.One;while(r._ec>=Math.floor(R/2)){var rLastLast=rLast;var _ga=sLast;var _gb=tLast;rLast=r;sLast=s;tLast=t;if(rLast.Zero){throw"r_{i-1} was zero"}r=rLastLast;var q=this._fa.Zero;var _df=rLast._ex(rLast._ec);var _fy=this._fa.inverse(_df);while(r._ec>=rLast._ec&&!r.Zero){var _fx=r._ec-rLast._ec;var scale=this._fa.multiply(r._ex(r._ec),_fy);q=q._bd(this._fa._ba(_fx,scale));r=r._bd(rLast._dc(_fx,scale))}s=q.multiply1(sLast)._bd(_ga);t=q.multiply1(tLast)._bd(_gb)}var _de=t._ex(0);if(_de==0){throw"ReedSolomonException sigmaTilde(0) was zero"}var inverse=this._fa.inverse(_de);var sigma=t.multiply2(inverse);var omega=r.multiply2(inverse);return new Array(sigma,omega)};this._ey=function(_ez){var _fz=_ez._ec;if(_fz==1){return new Array(_ez._ex(1))}var result=new Array(_fz);var e=0;for(var i=1;i<256&&e<_fz;i++){if(_ez.evaluateAt(i)==0){result[e]=this._fa.inverse(i);e++}}if(e!=_fz){throw"Error locator degree does not match number of roots"}return result};this._di=function(_fs,_dz,_fq){var s=_dz.length;var result=new Array(s);for(var i=0;i<s;i++){var _gc=this._fa.inverse(_dz[i]);var _dr=1;for(var j=0;j<s;j++){if(i!=j){_dr=this._fa.multiply(_dr,_az._bd(1,this._fa.multiply(_dz[j],_gc)))}}result[i]=this._fa.multiply(_fs.evaluateAt(_gc),this._fa.inverse(_dr));if(_fq){result[i]=this._fa.multiply(result[i],_gc)}}return result}}function _bp(f,e){if(e==null||e.length==0){throw"bad arguments"}this._fa=f;var c=e.length;if(c>1&&e[0]==0){var d=1;while(d<c&&e[d]==0){d++}if(d==c){this._dd=f.Zero._dd}else{this._dd=new Array(c-d);for(var b=0;b<this._dd.length;b++){this._dd[b]=0}for(var a=0;a<this._dd.length;a++){this._dd[a]=e[d+a]}}}else{this._dd=e}this.__defineGetter__("Zero",function(){return this._dd[0]==0});this.__defineGetter__("_ec",function(){return this._dd.length-1});this.__defineGetter__("Coefficients",function(){return this._dd});this._ex=function(g){return this._dd[this._dd.length-1-g]};this.evaluateAt=function(h){if(h==0){return this._ex(0)}var l=this._dd.length;if(h==1){var g=0;for(var k=0;k<l;k++){g=_az._bd(g,this._dd[k])}return g}var j=this._dd[0];for(var k=1;k<l;k++){j=_az._bd(this._fa.multiply(h,j),this._dd[k])}return j};this._bd=function(g){if(this._fa!=g._fa){throw"GF256Polys do not have same _az _fa"}if(this.Zero){return g}if(g.Zero){return this}var o=this._dd;var n=g._dd;if(o.length>n.length){var j=o;o=n;n=j}var h=new Array(n.length);var k=n.length-o.length;for(var m=0;m<k;m++){h[m]=n[m]}for(var l=k;l<n.length;l++){h[l]=_az._bd(o[l-k],n[l])}return new _bp(f,h)};this.multiply1=function(o){if(this._fa!=o._fa){throw"GF256Polys do not have same _az _fa"}if(this.Zero||o.Zero){return this._fa.Zero}var r=this._dd;var g=r.length;var l=o._dd;var n=l.length;var q=new Array(g+n-1);for(var m=0;m<g;m++){var h=r[m];for(var k=0;k<n;k++){q[m+k]=_az._bd(q[m+k],this._fa.multiply(h,l[k]))}}return new _bp(this._fa,q)};this.multiply2=function(g){if(g==0){return this._fa.Zero}if(g==1){return this}var j=this._dd.length;var k=new Array(j);for(var h=0;h<j;h++){k[h]=this._fa.multiply(this._dd[h],g)}return new _bp(this._fa,k)};this._dc=function(l,g){if(l<0){throw"bad arguments"}if(g==0){return this._fa.Zero}var j=this._dd.length;var k=new Array(j+l);for(var h=0;h<k.length;h++){k[h]=0}for(var h=0;h<j;h++){k[h]=this._fa.multiply(this._dd[h],g)}return new _bp(this._fa,k)};this.divide=function(l){if(this._fa!=l._fa){throw"GF256Polys do not have same _az _fa"}if(l.Zero){throw"Divide by 0"}var j=this._fa.Zero;var o=this;var g=l._ex(l._ec);var n=this._fa.inverse(g);while(o._ec>=l._ec&&!o.Zero){var m=o._ec-l._ec;var h=this._fa.multiply(o._ex(o._ec),n);var i=l._dc(m,h);var k=this._fa._ba(m,h);j=j._bd(k);o=o._bd(i)}return new Array(j,o)}}function _az(b){this._gh=new Array(256);this._gi=new Array(256);var a=1;for(var e=0;e<256;e++){this._gh[e]=a;a<<=1;if(a>=256){a^=b}}for(var e=0;e<255;e++){this._gi[this._gh[e]]=e}var d=new Array(1);d[0]=0;this.zero=new _bp(this,new Array(d));var c=new Array(1);c[0]=1;this.one=new _bp(this,new Array(c));this.__defineGetter__("Zero",function(){return this.zero});this.__defineGetter__("One",function(){return this.one});this._ba=function(j,f){if(j<0){throw"bad arguments"}if(f==0){return zero}var h=new Array(j+1);for(var g=0;g<h.length;g++){h[g]=0}h[0]=f;return new _bp(this,h)};this.exp=function(f){return this._gh[f]};this.log=function(f){if(f==0){throw"bad arguments"}return this._gi[f]};this.inverse=function(f){if(f==0){throw"System.ArithmeticException"}return this._gh[255-this._gi[f]]};this.multiply=function(g,f){if(g==0||f==0){return 0}if(g==1){return f}if(f==1){return g}return this._gh[(this._gi[g]+this._gi[f])%255]}}_az._bb=new _az(285);_az._bc=new _az(301);_az._bd=function(d,c){return d^c};Decoder={};Decoder.rsDecoder=new _db(_az._bb);Decoder.correctErrors=function(g,b){var d=g.length;var f=new Array(d);for(var e=0;e<d;e++){f[e]=g[e]&255}var a=g.length-b;try{Decoder.rsDecoder.decode(f,a)}catch(c){throw c}for(var e=0;e<b;e++){g[e]=f[e]}};Decoder.decode=function(r){var b=new _cl(r);var o=b._cq();var c=b._cm()._cg;var q=b._gk();var a=_dl._gn(q,o,c);var f=0;for(var k=0;k<a.length;k++){f+=a[k]._du}var e=new Array(f);var n=0;for(var h=0;h<a.length;h++){var m=a[h];var d=m.Codewords;var g=m._du;Decoder.correctErrors(d,g);for(var k=0;k<g;k++){e[n++]=d[k]}}var l=new QRCodeDataBlockReader(e,o._fd,c.Bits);return l};qrcode={};qrcode.imagedata=null;qrcode.width=0;qrcode.height=0;qrcode.qrCodeSymbol=null;qrcode.debug=false;qrcode.maxImgSize=1024*1024;qrcode._eo=[[10,9,8,8],[12,11,16,10],[14,13,16,12]];qrcode.callback=null;qrcode.decode=function(d){if(arguments.length==0){var b=document.getElementById("QrCanvas");var a=b.getContext("2d");qrcode.width=b.width;qrcode.height=b.height;qrcode.imagedata=a.getImageData(0,0,qrcode.width,qrcode.height);qrcode.result=qrcode.process(a);if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return qrcode.result}else{var c=new Image();c.onload=function(){var g=document.getElementById("out-canvas");if(g!=null){var j=g.getContext("2d");j.clearRect(0,0,320,240);j.drawImage(c,0,0,320,240)}var i=document.createElement("canvas");var h=i.getContext("2d");var f=c.height;var l=c.width;if(c.width*c.height>qrcode.maxImgSize){var k=c.width/c.height;f=Math.sqrt(qrcode.maxImgSize/k);l=k*f}i.width=l;i.height=f;h.drawImage(c,0,0,i.width,i.height);qrcode.width=i.width;qrcode.height=i.height;try{qrcode.imagedata=h.getImageData(0,0,i.width,i.height)}catch(m){qrcode.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!";if(qrcode.callback!=null){qrcode.callback(qrcode.result)}return}try{qrcode.result=qrcode.process(h)}catch(m){console.log(m);qrcode.result="error decoding QR Code"}if(qrcode.callback!=null){qrcode.callback(qrcode.result)}};c.src=d}};qrcode.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};qrcode.decode_url=function(b){var d="";try{d=escape(b)}catch(c){console.log(c);d=b}var a="";try{a=decodeURIComponent(d)}catch(c){console.log(c);a=d}return a};qrcode.decode_utf8=function(a){if(qrcode.isUrl(a)){return qrcode.decode_url(a)}else{return a}};qrcode.process=function(r){var a=new Date().getTime();var c=qrcode.grayScaleToBitmap(qrcode.grayscale());if(qrcode.debug){for(var m=0;m<qrcode.height;m++){for(var n=0;n<qrcode.width;n++){var o=(n*4)+(m*qrcode.width*4);qrcode.imagedata.data[o]=c[n+m*qrcode.width]?0:0;qrcode.imagedata.data[o+1]=c[n+m*qrcode.width]?0:0;qrcode.imagedata.data[o+2]=c[n+m*qrcode.width]?255:0}}r.putImageData(qrcode.imagedata,0,0)}var h=new Detector(c);var q=h.detect();if(qrcode.debug){r.putImageData(qrcode.imagedata,0,0)}var k=Decoder.decode(q.bits);var g=k.DataByte;var l="";for(var f=0;f<g.length;f++){for(var e=0;e<g[f].length;e++){l+=String.fromCharCode(g[f][e])}}var d=new Date().getTime();var b=d-a;console.log(b);return qrcode.decode_utf8(l)};qrcode.getPixel=function(a,b){if(qrcode.width<a){throw"point error"}if(qrcode.height<b){throw"point error"}point=(a*4)+(b*qrcode.width*4);p=(qrcode.imagedata.data[point]*33+qrcode.imagedata.data[point+1]*34+qrcode.imagedata.data[point+2]*33)/100;return p};qrcode.binarize=function(d){var c=new Array(qrcode.width*qrcode.height);for(var e=0;e<qrcode.height;e++){for(var b=0;b<qrcode.width;b++){var a=qrcode.getPixel(b,e);c[b+e*qrcode.width]=a<=d?true:false}}return c};qrcode._em=function(d){var c=4;var k=Math.floor(qrcode.width/c);var j=Math.floor(qrcode.height/c);var f=new Array(c);for(var g=0;g<c;g++){f[g]=new Array(c);for(var e=0;e<c;e++){f[g][e]=new Array(0,0)}}for(var o=0;o<c;o++){for(var a=0;a<c;a++){f[a][o][0]=255;for(var l=0;l<j;l++){for(var n=0;n<k;n++){var h=d[k*a+n+(j*o+l)*qrcode.width];if(h<f[a][o][0]){f[a][o][0]=h}if(h>f[a][o][1]){f[a][o][1]=h}}}}}var m=new Array(c);for(var b=0;b<c;b++){m[b]=new Array(c)}for(var o=0;o<c;o++){for(var a=0;a<c;a++){m[a][o]=Math.floor((f[a][o][0]+f[a][o][1])/2)}}return m};qrcode.grayScaleToBitmap=function(f){var j=qrcode._em(f);var b=j.length;var e=Math.floor(qrcode.width/b);var d=Math.floor(qrcode.height/b);var c=new Array(qrcode.height*qrcode.width);for(var i=0;i<b;i++){for(var a=0;a<b;a++){for(var g=0;g<d;g++){for(var h=0;h<e;h++){c[e*a+h+(d*i+g)*qrcode.width]=(f[e*a+h+(d*i+g)*qrcode.width]<j[a][i])?true:false}}}}return c};qrcode.grayscale=function(){var c=new Array(qrcode.width*qrcode.height);for(var d=0;d<qrcode.height;d++){for(var b=0;b<qrcode.width;b++){var a=qrcode.getPixel(b,d);c[b+d*qrcode.width]=a}}return c};function _ew(a,b){if(a>=0){return a>>b}else{return(a>>b)+(2<<~b)}}Array.prototype.remove=function(c,b){var a=this.slice((b||c)+1||this.length);this.length=c<0?this.length+c:c;return this.push.apply(this,a)};var _gf=3;var _eh=57;var _el=8;var _eg=2;qrcode._er=function(c){function b(l,k){xDiff=l.X-k.X;yDiff=l.Y-k.Y;return Math.sqrt((xDiff*xDiff+yDiff*yDiff))}function d(k,o,n){var m=o.x;var l=o.y;return((n.x-m)*(k.y-l))-((n.y-l)*(k.x-m))}var i=b(c[0],c[1]);var f=b(c[1],c[2]);var e=b(c[0],c[2]);var a,j,h;if(f>=i&&f>=e){j=c[0];a=c[1];h=c[2]}else{if(e>=f&&e>=i){j=c[1];a=c[0];h=c[2]}else{j=c[2];a=c[0];h=c[1]}}if(d(a,j,h)<0){var g=a;a=h;h=g}c[0]=a;c[1]=j;c[2]=h};function _cz(c,a,b){this.x=c;this.y=a;this.count=1;this._aj=b;this.__defineGetter__("_ei",function(){return this._aj});this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("X",function(){return this.x});this.__defineGetter__("Y",function(){return this.y});this._ek=function(){this.count++};this._ev=function(f,e,d){if(Math.abs(e-this.y)<=f&&Math.abs(d-this.x)<=f){var g=Math.abs(f-this._aj);return g<=1||g/this._aj<=1}return false}}function _es(a){this._go=a[0];this._gu=a[1];this._gr=a[2];this.__defineGetter__("_gp",function(){return this._go});this.__defineGetter__("_gq",function(){return this._gu});this.__defineGetter__("_gs",function(){return this._gr})}function _cc(){this.image=null;this._cv=[];this._ge=false;this._al=new Array(0,0,0,0,0);this._am=null;this.__defineGetter__("_da",function(){this._al[0]=0;this._al[1]=0;this._al[2]=0;this._al[3]=0;this._al[4]=0;return this._al});this._ao=function(f){var b=0;for(var d=0;d<5;d++){var e=f[d];if(e==0){return false}b+=e}if(b<7){return false}var c=Math.floor((b<<_el)/7);var a=Math.floor(c/2);return Math.abs(c-(f[0]<<_el))<a&&Math.abs(c-(f[1]<<_el))<a&&Math.abs(3*c-(f[2]<<_el))<3*a&&Math.abs(c-(f[3]<<_el))<a&&Math.abs(c-(f[4]<<_el))<a};this._an=function(b,a){return(a-b[4]-b[3])-b[2]/2};this._ap=function(a,j,d,g){var c=this.image;var h=qrcode.height;var b=this._da;var f=a;while(f>=0&&c[j+f*qrcode.width]){b[2]++;f--}if(f<0){return NaN}while(f>=0&&!c[j+f*qrcode.width]&&b[1]<=d){b[1]++;f--}if(f<0||b[1]>d){return NaN}while(f>=0&&c[j+f*qrcode.width]&&b[0]<=d){b[0]++;f--}if(b[0]>d){return NaN}f=a+1;while(f<h&&c[j+f*qrcode.width]){b[2]++;f++}if(f==h){return NaN}while(f<h&&!c[j+f*qrcode.width]&&b[3]<d){b[3]++;f++}if(f==h||b[3]>=d){return NaN}while(f<h&&c[j+f*qrcode.width]&&b[4]<d){b[4]++;f++}if(b[4]>=d){return NaN}var e=b[0]+b[1]+b[2]+b[3]+b[4];if(5*Math.abs(e-g)>=2*g){return NaN}return this._ao(b)?this._an(b,f):NaN};this._ej=function(b,a,e,h){var d=this.image;var i=qrcode.width;var c=this._da;var g=b;while(g>=0&&d[g+a*qrcode.width]){c[2]++;g--}if(g<0){return NaN}while(g>=0&&!d[g+a*qrcode.width]&&c[1]<=e){c[1]++;g--}if(g<0||c[1]>e){return NaN}while(g>=0&&d[g+a*qrcode.width]&&c[0]<=e){c[0]++;g--}if(c[0]>e){return NaN}g=b+1;while(g<i&&d[g+a*qrcode.width]){c[2]++;g++}if(g==i){return NaN}while(g<i&&!d[g+a*qrcode.width]&&c[3]<e){c[3]++;g++}if(g==i||c[3]>=e){return NaN}while(g<i&&d[g+a*qrcode.width]&&c[4]<e){c[4]++;g++}if(c[4]>=e){return NaN}var f=c[0]+c[1]+c[2]+c[3]+c[4];if(5*Math.abs(f-h)>=h){return NaN}return this._ao(c)?this._an(c,g):NaN};this._cu=function(c,f,e){var d=c[0]+c[1]+c[2]+c[3]+c[4];var n=this._an(c,e);var b=this._ap(f,Math.floor(n),c[2],d);if(!isNaN(b)){n=this._ej(Math.floor(n),Math.floor(b),c[2],d);if(!isNaN(n)){var l=d/7;var m=false;var h=this._cv.length;for(var g=0;g<h;g++){var a=this._cv[g];if(a._ev(l,b,n)){a._ek();m=true;break}}if(!m){var k=new _cz(n,b,l);this._cv.push(k);if(this._am!=null){this._am._ep(k)}}return true}}return false};this._ee=function(){var h=this._cv.length;if(h<3){throw"Couldn't find enough finder patterns"}if(h>3){var b=0;var j=0;for(var d=0;d<h;d++){var g=this._cv[d]._ei;b+=g;j+=(g*g)}var a=b/h;this._cv.sort(function(m,l){var k=Math.abs(l._ei-a);var i=Math.abs(m._ei-a);if(k<i){return(-1)}else{if(k==i){return 0}else{return 1}}});var e=Math.sqrt(j/h-a*a);var c=Math.max(0.2*a,e);for(var d=0;d<this._cv.length&&this._cv.length>3;d++){var f=this._cv[d];if(Math.abs(f._ei-a)>c){this._cv.remove(d);d--}}}if(this._cv.length>3){this._cv.sort(function(k,i){if(k.count>i.count){return -1}if(k.count<i.count){return 1}return 0})}return new Array(this._cv[0],this._cv[1],this._cv[2])};this._eq=function(){var b=this._cv.length;if(b<=1){return 0}var c=null;for(var d=0;d<b;d++){var a=this._cv[d];if(a.Count>=_eg){if(c==null){c=a}else{this._ge=true;return Math.floor((Math.abs(c.X-a.X)-Math.abs(c.Y-a.Y))/2)}}}return 0};this._cx=function(){var g=0;var c=0;var a=this._cv.length;for(var d=0;d<a;d++){var f=this._cv[d];if(f.Count>=_eg){g++;c+=f._ei}}if(g<3){return false}var e=c/a;var b=0;for(var d=0;d<a;d++){f=this._cv[d];b+=Math.abs(f._ei-e)}return b<=0.05*c};this._ce=function(e){var o=false;this.image=e;var n=qrcode.height;var k=qrcode.width;var a=Math.floor((3*n)/(4*_eh));if(a<_gf||o){a=_gf}var g=false;var d=new Array(5);for(var h=a-1;h<n&&!g;h+=a){d[0]=0;d[1]=0;d[2]=0;d[3]=0;d[4]=0;var b=0;for(var f=0;f<k;f++){if(e[f+h*qrcode.width]){if((b&1)==1){b++}d[b]++}else{if((b&1)==0){if(b==4){if(this._ao(d)){var c=this._cu(d,h,f);if(c){a=2;if(this._ge){g=this._cx()}else{var m=this._eq();if(m>d[2]){h+=m-d[2]-a;f=k-1}}}else{do{f++}while(f<k&&!e[f+h*qrcode.width]);f--}b=0;d[0]=0;d[1]=0;d[2]=0;d[3]=0;d[4]=0}else{d[0]=d[2];d[1]=d[3];d[2]=d[4];d[3]=1;d[4]=0;b=3}}else{d[++b]++}}else{d[b]++}}}if(this._ao(d)){var c=this._cu(d,h,k);if(c){a=d[0];if(this._ge){g=_cx()}}}}var l=this._ee();qrcode._er(l);return new _es(l)}}function _ai(c,a,b){this.x=c;this.y=a;this.count=1;this._aj=b;this.__defineGetter__("_ei",function(){return this._aj});this.__defineGetter__("Count",function(){return this.count});this.__defineGetter__("X",function(){return Math.floor(this.x)});this.__defineGetter__("Y",function(){return Math.floor(this.y)});this._ek=function(){this.count++};this._ev=function(f,e,d){if(Math.abs(e-this.y)<=f&&Math.abs(d-this.x)<=f){var g=Math.abs(f-this._aj);return g<=1||g/this._aj<=1}return false}}function _ak(g,c,b,f,a,e,d){this.image=g;this._cv=new Array();this.startX=c;this.startY=b;this.width=f;this.height=a;this._ef=e;this._al=new Array(0,0,0);this._am=d;this._an=function(i,h){return(h-i[2])-i[1]/2};this._ao=function(l){var k=this._ef;var h=k/2;for(var j=0;j<3;j++){if(Math.abs(k-l[j])>=h){return false}}return true};this._ap=function(h,r,l,o){var k=this.image;var q=qrcode.height;var j=this._al;j[0]=0;j[1]=0;j[2]=0;var n=h;while(n>=0&&k[r+n*qrcode.width]&&j[1]<=l){j[1]++;n--}if(n<0||j[1]>l){return NaN}while(n>=0&&!k[r+n*qrcode.width]&&j[0]<=l){j[0]++;n--}if(j[0]>l){return NaN}n=h+1;while(n<q&&k[r+n*qrcode.width]&&j[1]<=l){j[1]++;n++}if(n==q||j[1]>l){return NaN}while(n<q&&!k[r+n*qrcode.width]&&j[2]<=l){j[2]++;n++}if(j[2]>l){return NaN}var m=j[0]+j[1]+j[2];if(5*Math.abs(m-o)>=2*o){return NaN}return this._ao(j)?this._an(j,n):NaN};this._cu=function(l,o,n){var m=l[0]+l[1]+l[2];var u=this._an(l,n);var k=this._ap(o,Math.floor(u),2*l[1],m);if(!isNaN(k)){var t=(l[0]+l[1]+l[2])/3;var r=this._cv.length;for(var q=0;q<r;q++){var h=this._cv[q];if(h._ev(t,k,u)){return new _ai(u,k,t)}}var s=new _ai(u,k,t);this._cv.push(s);if(this._am!=null){this._am._ep(s)}}return null};this.find=function(){var q=this.startX;var t=this.height;var r=q+f;var s=b+(t>>1);var m=new Array(0,0,0);for(var k=0;k<t;k++){var o=s+((k&1)==0?((k+1)>>1):-((k+1)>>1));m[0]=0;m[1]=0;m[2]=0;var n=q;while(n<r&&!g[n+qrcode.width*o]){n++}var h=0;while(n<r){if(g[n+o*qrcode.width]){if(h==1){m[h]++}else{if(h==2){if(this._ao(m)){var l=this._cu(m,o,n);if(l!=null){return l}}m[0]=m[2];m[1]=1;m[2]=0;h=1}else{m[++h]++}}}else{if(h==1){h++}m[h]++}n++}if(this._ao(m)){var l=this._cu(m,o,r);if(l!=null){return l}}}if(!(this._cv.length==0)){return this._cv[0]}throw"Couldn't find enough alignment patterns"}}function QRCodeDataBlockReader(c,a,b){this._ed=0;this._cw=7;this.dataLength=0;this.blocks=c;this._en=b;if(a<=9){this.dataLengthMode=0}else{if(a>=10&&a<=26){this.dataLengthMode=1}else{if(a>=27&&a<=40){this.dataLengthMode=2}}}this._gd=function(f){var k=0;if(f<this._cw+1){var m=0;for(var e=0;e<f;e++){m+=(1<<e)}m<<=(this._cw-f+1);k=(this.blocks[this._ed]&m)>>(this._cw-f+1);this._cw-=f;return k}else{if(f<this._cw+1+8){var j=0;for(var e=0;e<this._cw+1;e++){j+=(1<<e)}k=(this.blocks[this._ed]&j)<<(f-(this._cw+1));this._ed++;k+=((this.blocks[this._ed])>>(8-(f-(this._cw+1))));this._cw=this._cw-f%8;if(this._cw<0){this._cw=8+this._cw}return k}else{if(f<this._cw+1+16){var j=0;var h=0;for(var e=0;e<this._cw+1;e++){j+=(1<<e)}var g=(this.blocks[this._ed]&j)<<(f-(this._cw+1));this._ed++;var d=this.blocks[this._ed]<<(f-(this._cw+1+8));this._ed++;for(var e=0;e<f-(this._cw+1+8);e++){h+=(1<<e)}h<<=8-(f-(this._cw+1+8));var l=(this.blocks[this._ed]&h)>>(8-(f-(this._cw+1+8)));k=g+d+l;this._cw=this._cw-(f-8)%8;if(this._cw<0){this._cw=8+this._cw}return k}else{return 0}}}};this.NextMode=function(){if((this._ed>this.blocks.length-this._en-2)){return 0}else{return this._gd(4)}};this.getDataLength=function(d){var e=0;while(true){if((d>>e)==1){break}e++}return this._gd(qrcode._eo[this.dataLengthMode][e])};this.getRomanAndFigureString=function(h){var f=h;var g=0;var j="";var d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do{if(f>1){g=this._gd(11);var i=Math.floor(g/45);var e=g%45;j+=d[i];j+=d[e];f-=2}else{if(f==1){g=this._gd(6);j+=d[g];f-=1}}}while(f>0);return j};this.getFigureString=function(f){var d=f;var e=0;var g="";do{if(d>=3){e=this._gd(10);if(e<100){g+="0"}if(e<10){g+="0"}d-=3}else{if(d==2){e=this._gd(7);if(e<10){g+="0"}d-=2}else{if(d==1){e=this._gd(4);d-=1}}}g+=e}while(d>0);return g};this.get8bitByteArray=function(g){var e=g;var f=0;var d=new Array();do{f=this._gd(8);d.push(f);e--}while(e>0);return d};this.getKanjiString=function(j){var g=j;var i=0;var h="";do{i=_gd(13);var e=i%192;var f=i/192;var k=(f<<8)+e;var d=0;if(k+33088<=40956){d=k+33088}else{d=k+49472}h+=String.fromCharCode(d);g--}while(g>0);return h};this.__defineGetter__("DataByte",function(){var g=new Array();var e=1;var f=2;var d=4;var n=8;do{var k=this.NextMode();if(k==0){if(g.length>0){break}else{throw"Empty data block"}}if(k!=e&&k!=f&&k!=d&&k!=n){throw"Invalid mode: "+k+" in (block:"+this._ed+" bit:"+this._cw+")"}dataLength=this.getDataLength(k);if(dataLength<1){throw"Invalid data length: "+dataLength}switch(k){case e:var l=this.getFigureString(dataLength);var i=new Array(l.length);for(var h=0;h<l.length;h++){i[h]=l.charCodeAt(h)}g.push(i);break;case f:var l=this.getRomanAndFigureString(dataLength);var i=new Array(l.length);for(var h=0;h<l.length;h++){i[h]=l.charCodeAt(h)}g.push(i);break;case d:var m=this.get8bitByteArray(dataLength);g.push(m);break;case n:var l=this.getKanjiString(dataLength);g.push(l);break}}while(true);return g})};
``` | /content/code_sandbox/public/vendor/qrcode-scan/llqrcode.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 18,339 |
```javascript
// path_to_url
var workingAway = false;
var gCtx = null;
var gCanvas = null;
var c=0;
var stype=0;
var gUM=false;
var webkit=false;
var moz=false;
var v=null;
var beepSound = new Audio('/mp3/beep.mp3');
var vidhtml = '<video id="v" autoplay></video>';
function initCanvas(w,h)
{
gCanvas = document.getElementById("qr-canvas");
gCanvas.style.width = w + "px";
gCanvas.style.height = h + "px";
gCanvas.width = w;
gCanvas.height = h;
gCtx = gCanvas.getContext("2d");
gCtx.clearRect(0, 0, w, h);
}
function captureToCanvas() {
if(stype!=1)
return;
if(gUM)
{
try{
gCtx.drawImage(v,0,0);
try{
qrcode.decode();
}
catch(e){
console.log(e);
setTimeout(captureToCanvas, 500);
};
}
catch(e){
console.log(e);
setTimeout(captureToCanvas, 500);
};
}
}
function htmlEntities(str) {
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
}
function read(qrcode_token)
{
if(workingAway) {
return;
}
workingAway = true;
$.ajax({
type: "POST",
url: Attendize.qrcodeCheckInRoute,
data: {qrcode_token: htmlEntities(qrcode_token)},
cache: false,
complete: function(){
beepSound.play();
},
error: function() {
},
success: function(response) {
document.getElementById("result").innerHTML = "<b>" + response.message +"</b>";
}
});
}
function isCanvasSupported(){
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
}
function success(stream) {
if(webkit)
v.src = window.webkitURL.createObjectURL(stream);
else
if(moz)
{
v.mozSrcObject = stream;
v.play();
}
else
v.src = stream;
gUM=true;
setTimeout(captureToCanvas, 500);
}
function error(error) {
gUM=false;
return;
}
function load()
{
if(isCanvasSupported() && window.File && window.FileReader)
{
initCanvas(800, 600);
qrcode.callback = read;
document.getElementById("mainbody").style.display="inline";
setwebcam();
}
else
{
document.getElementById("mainbody").style.display="inline";
document.getElementById("mainbody").innerHTML='<p id="mp1">Attendize Checkpoint Manager for HTML5 capable browsers</p><br>'+
'<br><p id="mp2">sorry your browser is not supported</p><br><br>'+
'<p id="mp1">try <a href="path_to_url"><img src="/assets/images/firefox.png"/></a> or <a href="path_to_url"><img src="/assets/images/chrome_logo.gif"/></a> or <a href="path_to_url"><img src="/assets/images/Opera-logo.png"/></a></p>';
}
}
function setwebcam()
{
document.getElementById("help-text").style.display = "block";
document.getElementById("result").innerHTML='Scanning <i class="fa fa-spinner fa-spin"></i>';
if(stype==1)
{
setTimeout(captureToCanvas, 500);
return;
}
var n=navigator;
document.getElementById("outdiv").innerHTML = vidhtml;
v=document.getElementById("v");
if(n.getUserMedia)
n.getUserMedia({video: true, audio: false}, success, error);
else
if(n.webkitGetUserMedia)
{
webkit=true;
n.webkitGetUserMedia({video:true, audio: false}, success, error);
}
else
if(n.mozGetUserMedia)
{
moz=true;
n.mozGetUserMedia({video: true, audio: false}, success, error);
}
stype=1;
setTimeout(captureToCanvas, 500);
}
``` | /content/code_sandbox/public/vendor/qrcode-scan/webqr.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 943 |
```javascript
/**
* jQuery Geocoding and Places Autocomplete Plugin - V 1.6.5
*
* @author Martin Kleppe <kleppe@ubilabs.net>, 2014
* @author Ubilabs path_to_url 2014
*/
// # $.geocomplete()
// ## jQuery Geocoding and Places Autocomplete Plugin
//
// * path_to_url
// * by Martin Kleppe <kleppe@ubilabs.net>
(function($, window, document, undefined){
// ## Options
// The default options for this plugin.
//
// * `map` - Might be a selector, an jQuery object or a DOM element. Default is `false` which shows no map.
// * `details` - The container that should be populated with data. Defaults to `false` which ignores the setting.
// * `location` - Location to initialize the map on. Might be an address `string` or an `array` with [latitude, longitude] or a `google.maps.LatLng`object. Default is `false` which shows a blank map.
// * `bounds` - Whether to snap geocode search to map bounds. Default: `true` if false search globally. Alternatively pass a custom `LatLngBounds object.
// * `autoselect` - Automatically selects the highlighted item or the first item from the suggestions list on Enter.
// * `detailsAttribute` - The attribute's name to use as an indicator. Default: `"name"`
// * `mapOptions` - Options to pass to the `google.maps.Map` constructor. See the full list [here](path_to_url#MapOptions).
// * `mapOptions.zoom` - The inital zoom level. Default: `14`
// * `mapOptions.scrollwheel` - Whether to enable the scrollwheel to zoom the map. Default: `false`
// * `mapOptions.mapTypeId` - The map type. Default: `"roadmap"`
// * `markerOptions` - The options to pass to the `google.maps.Marker` constructor. See the full list [here](path_to_url#MarkerOptions).
// * `markerOptions.draggable` - If the marker is draggable. Default: `false`. Set to true to enable dragging.
// * `markerOptions.disabled` - Do not show marker. Default: `false`. Set to true to disable marker.
// * `maxZoom` - The maximum zoom level too zoom in after a geocoding response. Default: `16`
// * `types` - An array containing one or more of the supported types for the places request. Default: `['geocode']` See the full list [here](path_to_url#place_search_requests).
// * `blur` - Trigger geocode when input loses focus.
// * `geocodeAfterResult` - If blur is set to true, choose whether to geocode if user has explicitly selected a result before blur.
// * `restoreValueAfterBlur` - Restores the input's value upon blurring. Default is `false` which ignores the setting.
var defaults = {
bounds: true,
country: null,
map: false,
details: false,
detailsAttribute: "name",
autoselect: true,
location: false,
mapOptions: {
zoom: 14,
scrollwheel: false,
mapTypeId: "roadmap"
},
markerOptions: {
draggable: false
},
maxZoom: 16,
types: ['geocode'],
blur: false,
geocodeAfterResult: false,
restoreValueAfterBlur: false
};
// See: [Geocoding Types](path_to_url#Types)
// on Google Developers.
var componentTypes = ("street_address route intersection political " +
"country administrative_area_level_1 administrative_area_level_2 " +
"administrative_area_level_3 colloquial_area locality sublocality " +
"neighborhood premise subpremise postal_code natural_feature airport " +
"park point_of_interest post_box street_number floor room " +
"lat lng viewport location " +
"formatted_address location_type bounds").split(" ");
// See: [Places Details Responses](path_to_url#place_details_responses)
// on Google Developers.
var placesDetails = ("id place_id url website vicinity reference name rating " +
"international_phone_number icon formatted_phone_number").split(" ");
// The actual plugin constructor.
function GeoComplete(input, options) {
this.options = $.extend(true, {}, defaults, options);
this.input = input;
this.$input = $(input);
this._defaults = defaults;
this._name = 'geocomplete';
this.init();
}
// Initialize all parts of the plugin.
$.extend(GeoComplete.prototype, {
init: function(){
this.initMap();
this.initMarker();
this.initGeocoder();
this.initDetails();
this.initLocation();
},
// Initialize the map but only if the option `map` was set.
// This will create a `map` within the given container
// using the provided `mapOptions` or link to the existing map instance.
initMap: function(){
if (!this.options.map){ return; }
if (typeof this.options.map.setCenter == "function"){
this.map = this.options.map;
return;
}
this.map = new google.maps.Map(
$(this.options.map)[0],
this.options.mapOptions
);
// add click event listener on the map
google.maps.event.addListener(
this.map,
'click',
$.proxy(this.mapClicked, this)
);
google.maps.event.addListener(
this.map,
'zoom_changed',
$.proxy(this.mapZoomed, this)
);
},
// Add a marker with the provided `markerOptions` but only
// if the option was set. Additionally it listens for the `dragend` event
// to notify the plugin about changes.
initMarker: function(){
if (!this.map){ return; }
var options = $.extend(this.options.markerOptions, { map: this.map });
if (options.disabled){ return; }
this.marker = new google.maps.Marker(options);
google.maps.event.addListener(
this.marker,
'dragend',
$.proxy(this.markerDragged, this)
);
},
// Associate the input with the autocompleter and create a geocoder
// to fall back when the autocompleter does not return a value.
initGeocoder: function(){
// Indicates is user did select a result from the dropdown.
var selected = false;
var options = {
types: this.options.types,
bounds: this.options.bounds === true ? null : this.options.bounds,
componentRestrictions: this.options.componentRestrictions
};
if (this.options.country){
options.componentRestrictions = {country: this.options.country};
}
this.autocomplete = new google.maps.places.Autocomplete(
this.input, options
);
this.geocoder = new google.maps.Geocoder();
// Bind autocomplete to map bounds but only if there is a map
// and `options.bindToMap` is set to true.
if (this.map && this.options.bounds === true){
this.autocomplete.bindTo('bounds', this.map);
}
// Watch `place_changed` events on the autocomplete input field.
google.maps.event.addListener(
this.autocomplete,
'place_changed',
$.proxy(this.placeChanged, this)
);
// Prevent parent form from being submitted if user hit enter.
this.$input.on('keypress.' + this._name, function(event){
if (event.keyCode === 13){ return false; }
});
// Assume that if user types anything after having selected a result,
// the selected location is not valid any more.
if (this.options.geocodeAfterResult === true){
this.$input.bind('keypress.' + this._name, $.proxy(function(){
if (event.keyCode != 9 && this.selected === true){
this.selected = false;
}
}, this));
}
// Listen for "geocode" events and trigger find action.
this.$input.bind('geocode.' + this._name, $.proxy(function(){
this.find();
}, this));
// Saves the previous input value
this.$input.bind('geocode:result.' + this._name, $.proxy(function(){
this.lastInputVal = this.$input.val();
}, this));
// Trigger find action when input element is blurred out and user has
// not explicitly selected a result.
// (Useful for typing partial location and tabbing to the next field
// or clicking somewhere else.)
if (this.options.blur === true){
this.$input.on('blur.' + this._name, $.proxy(function(){
if (this.options.geocodeAfterResult === true && this.selected === true) { return; }
if (this.options.restoreValueAfterBlur === true && this.selected === true) {
setTimeout($.proxy(this.restoreLastValue, this), 0);
} else {
this.find();
}
}, this));
}
},
// Prepare a given DOM structure to be populated when we got some data.
// This will cycle through the list of component types and map the
// corresponding elements.
initDetails: function(){
if (!this.options.details){ return; }
var $details = $(this.options.details),
attribute = this.options.detailsAttribute,
details = {};
function setDetail(value){
details[value] = $details.find("[" + attribute + "=" + value + "]");
}
$.each(componentTypes, function(index, key){
setDetail(key);
setDetail(key + "_short");
});
$.each(placesDetails, function(index, key){
setDetail(key);
});
this.$details = $details;
this.details = details;
},
// Set the initial location of the plugin if the `location` options was set.
// This method will care about converting the value into the right format.
initLocation: function() {
var location = this.options.location, latLng;
if (!location) { return; }
if (typeof location == 'string') {
this.find(location);
return;
}
if (location instanceof Array) {
latLng = new google.maps.LatLng(location[0], location[1]);
}
if (location instanceof google.maps.LatLng){
latLng = location;
}
if (latLng){
if (this.map){ this.map.setCenter(latLng); }
if (this.marker){ this.marker.setPosition(latLng); }
}
},
destroy: function(){
if (this.map) {
google.maps.event.clearInstanceListeners(this.map);
google.maps.event.clearInstanceListeners(this.marker);
}
this.autocomplete.unbindAll();
google.maps.event.clearInstanceListeners(this.autocomplete);
google.maps.event.clearInstanceListeners(this.input);
this.$input.removeData();
this.$input.off(this._name);
this.$input.unbind('.' + this._name);
},
// Look up a given address. If no `address` was specified it uses
// the current value of the input.
find: function(address){
this.geocode({
address: address || this.$input.val()
});
},
// Requests details about a given location.
// Additionally it will bias the requests to the provided bounds.
geocode: function(request){
if (this.options.bounds && !request.bounds){
if (this.options.bounds === true){
request.bounds = this.map && this.map.getBounds();
} else {
request.bounds = this.options.bounds;
}
}
if (this.options.country){
request.region = this.options.country;
}
this.geocoder.geocode(request, $.proxy(this.handleGeocode, this));
},
// Get the selected result. If no result is selected on the list, then get
// the first result from the list.
selectFirstResult: function() {
//$(".pac-container").hide();
var selected = '';
// Check if any result is selected.
if ($(".pac-item-selected")[0]) {
selected = '-selected';
}
// Get the first suggestion's text.
var $span1 = $(".pac-container:last .pac-item" + selected + ":first span:nth-child(2)").text();
var $span2 = $(".pac-container:last .pac-item" + selected + ":first span:nth-child(3)").text();
// Adds the additional information, if available.
var firstResult = $span1;
if ($span2) {
firstResult += " - " + $span2;
}
this.$input.val(firstResult);
return firstResult;
},
// Restores the input value using the previous value if it exists
restoreLastValue: function() {
if (this.lastInputVal){ this.$input.val(this.lastInputVal); }
},
// Handles the geocode response. If more than one results was found
// it triggers the "geocode:multiple" events. If there was an error
// the "geocode:error" event is fired.
handleGeocode: function(results, status){
if (status === google.maps.GeocoderStatus.OK) {
var result = results[0];
this.$input.val(result.formatted_address);
this.update(result);
if (results.length > 1){
this.trigger("geocode:multiple", results);
}
} else {
this.trigger("geocode:error", status);
}
},
// Triggers a given `event` with optional `arguments` on the input.
trigger: function(event, argument){
this.$input.trigger(event, [argument]);
},
// Set the map to a new center by passing a `geometry`.
// If the geometry has a viewport, the map zooms out to fit the bounds.
// Additionally it updates the marker position.
center: function(geometry){
if (geometry.viewport){
this.map.fitBounds(geometry.viewport);
if (this.map.getZoom() > this.options.maxZoom){
this.map.setZoom(this.options.maxZoom);
}
} else {
this.map.setZoom(this.options.maxZoom);
this.map.setCenter(geometry.location);
}
if (this.marker){
this.marker.setPosition(geometry.location);
this.marker.setAnimation(this.options.markerOptions.animation);
}
},
// Update the elements based on a single places or geocoding response
// and trigger the "geocode:result" event on the input.
update: function(result){
if (this.map){
this.center(result.geometry);
}
if (this.$details){
this.fillDetails(result);
}
this.trigger("geocode:result", result);
},
// Populate the provided elements with new `result` data.
// This will lookup all elements that has an attribute with the given
// component type.
fillDetails: function(result){
var data = {},
geometry = result.geometry,
viewport = geometry.viewport,
bounds = geometry.bounds;
// Create a simplified version of the address components.
$.each(result.address_components, function(index, object){
var name = object.types[0];
$.each(object.types, function(index, name){
data[name] = object.long_name;
data[name + "_short"] = object.short_name;
});
});
// Add properties of the places details.
$.each(placesDetails, function(index, key){
data[key] = result[key];
});
// Add infos about the address and geometry.
$.extend(data, {
formatted_address: result.formatted_address,
location_type: geometry.location_type || "PLACES",
viewport: viewport,
bounds: bounds,
location: geometry.location,
lat: geometry.location.lat(),
lng: geometry.location.lng()
});
// Set the values for all details.
$.each(this.details, $.proxy(function(key, $detail){
var value = data[key];
this.setDetail($detail, value);
}, this));
this.data = data;
},
// Assign a given `value` to a single `$element`.
// If the element is an input, the value is set, otherwise it updates
// the text content.
setDetail: function($element, value){
if (value === undefined){
value = "";
} else if (typeof value.toUrlValue == "function"){
value = value.toUrlValue();
}
if ($element.is(":input")){
$element.val(value);
} else {
$element.text(value);
}
},
// Fire the "geocode:dragged" event and pass the new position.
markerDragged: function(event){
this.trigger("geocode:dragged", event.latLng);
},
mapClicked: function(event) {
this.trigger("geocode:click", event.latLng);
},
mapZoomed: function(event) {
this.trigger("geocode:zoom", this.map.getZoom());
},
// Restore the old position of the marker to the last now location.
resetMarker: function(){
this.marker.setPosition(this.data.location);
this.setDetail(this.details.lat, this.data.location.lat());
this.setDetail(this.details.lng, this.data.location.lng());
},
// Update the plugin after the user has selected an autocomplete entry.
// If the place has no geometry it passes it to the geocoder.
placeChanged: function(){
var place = this.autocomplete.getPlace();
this.selected = true;
if (!place.geometry){
if (this.options.autoselect) {
// Automatically selects the highlighted item or the first item from the
// suggestions list.
var autoSelection = this.selectFirstResult();
this.find(autoSelection);
}
} else {
// Use the input text if it already gives geometry.
this.update(place);
}
}
});
// A plugin wrapper around the constructor.
// Pass `options` with all settings that are different from the default.
// The attribute is used to prevent multiple instantiations of the plugin.
$.fn.geocomplete = function(options) {
var attribute = 'plugin_geocomplete';
// If you call `.geocomplete()` with a string as the first parameter
// it returns the corresponding property or calls the method with the
// following arguments.
if (typeof options == "string"){
var instance = $(this).data(attribute) || $(this).geocomplete().data(attribute),
prop = instance[options];
if (typeof prop == "function"){
prop.apply(instance, Array.prototype.slice.call(arguments, 1));
return $(this);
} else {
if (arguments.length == 2){
prop = arguments[1];
}
return prop;
}
} else {
return this.each(function() {
// Prevent against multiple instantiations.
var instance = $.data(this, attribute);
if (!instance) {
instance = new GeoComplete( this, options );
$.data(this, attribute, instance);
}
});
}
};
})( jQuery, window, document );
``` | /content/code_sandbox/public/vendor/geocomplete/jquery.geocomplete.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 4,093 |
```javascript
/**
* jQuery Geocoding and Places Autocomplete Plugin - V 1.6.5
*
* @author Martin Kleppe <kleppe@ubilabs.net>, 2014
* @author Ubilabs path_to_url 2014
*/
(function($,window,document,undefined){var defaults={bounds:true,country:null,map:false,details:false,detailsAttribute:"name",autoselect:true,location:false,mapOptions:{zoom:14,scrollwheel:false,mapTypeId:"roadmap"},markerOptions:{draggable:false},maxZoom:16,types:["geocode"],blur:false,geocodeAfterResult:false,restoreValueAfterBlur:false};var componentTypes=("street_address route intersection political "+"country administrative_area_level_1 administrative_area_level_2 "+"administrative_area_level_3 colloquial_area locality sublocality "+"neighborhood premise subpremise postal_code natural_feature airport "+"park point_of_interest post_box street_number floor room "+"lat lng viewport location "+"formatted_address location_type bounds").split(" ");var placesDetails=("id place_id url website vicinity reference name rating "+"international_phone_number icon formatted_phone_number").split(" ");function GeoComplete(input,options){this.options=$.extend(true,{},defaults,options);this.input=input;this.$input=$(input);this._defaults=defaults;this._name="geocomplete";this.init()}$.extend(GeoComplete.prototype,{init:function(){this.initMap();this.initMarker();this.initGeocoder();this.initDetails();this.initLocation()},initMap:function(){if(!this.options.map){return}if(typeof this.options.map.setCenter=="function"){this.map=this.options.map;return}this.map=new google.maps.Map($(this.options.map)[0],this.options.mapOptions);google.maps.event.addListener(this.map,"click",$.proxy(this.mapClicked,this));google.maps.event.addListener(this.map,"zoom_changed",$.proxy(this.mapZoomed,this))},initMarker:function(){if(!this.map){return}var options=$.extend(this.options.markerOptions,{map:this.map});if(options.disabled){return}this.marker=new google.maps.Marker(options);google.maps.event.addListener(this.marker,"dragend",$.proxy(this.markerDragged,this))},initGeocoder:function(){var selected=false;var options={types:this.options.types,bounds:this.options.bounds===true?null:this.options.bounds,componentRestrictions:this.options.componentRestrictions};if(this.options.country){options.componentRestrictions={country:this.options.country}}this.autocomplete=new google.maps.places.Autocomplete(this.input,options);this.geocoder=new google.maps.Geocoder;if(this.map&&this.options.bounds===true){this.autocomplete.bindTo("bounds",this.map)}google.maps.event.addListener(this.autocomplete,"place_changed",$.proxy(this.placeChanged,this));this.$input.on("keypress."+this._name,function(event){if(event.keyCode===13){return false}});if(this.options.geocodeAfterResult===true){this.$input.bind("keypress."+this._name,$.proxy(function(){if(event.keyCode!=9&&this.selected===true){this.selected=false}},this))}this.$input.bind("geocode."+this._name,$.proxy(function(){this.find()},this));this.$input.bind("geocode:result."+this._name,$.proxy(function(){this.lastInputVal=this.$input.val()},this));if(this.options.blur===true){this.$input.on("blur."+this._name,$.proxy(function(){if(this.options.geocodeAfterResult===true&&this.selected===true){return}if(this.options.restoreValueAfterBlur===true&&this.selected===true){setTimeout($.proxy(this.restoreLastValue,this),0)}else{this.find()}},this))}},initDetails:function(){if(!this.options.details){return}var $details=$(this.options.details),attribute=this.options.detailsAttribute,details={};function setDetail(value){details[value]=$details.find("["+attribute+"="+value+"]")}$.each(componentTypes,function(index,key){setDetail(key);setDetail(key+"_short")});$.each(placesDetails,function(index,key){setDetail(key)});this.$details=$details;this.details=details},initLocation:function(){var location=this.options.location,latLng;if(!location){return}if(typeof location=="string"){this.find(location);return}if(location instanceof Array){latLng=new google.maps.LatLng(location[0],location[1])}if(location instanceof google.maps.LatLng){latLng=location}if(latLng){if(this.map){this.map.setCenter(latLng)}if(this.marker){this.marker.setPosition(latLng)}}},destroy:function(){if(this.map){google.maps.event.clearInstanceListeners(this.map);google.maps.event.clearInstanceListeners(this.marker)}this.autocomplete.unbindAll();google.maps.event.clearInstanceListeners(this.autocomplete);google.maps.event.clearInstanceListeners(this.input);this.$input.removeData();this.$input.off(this._name);this.$input.unbind("."+this._name)},find:function(address){this.geocode({address:address||this.$input.val()})},geocode:function(request){if(this.options.bounds&&!request.bounds){if(this.options.bounds===true){request.bounds=this.map&&this.map.getBounds()}else{request.bounds=this.options.bounds}}if(this.options.country){request.region=this.options.country}this.geocoder.geocode(request,$.proxy(this.handleGeocode,this))},selectFirstResult:function(){var selected="";if($(".pac-item-selected")[0]){selected="-selected"}var $span1=$(".pac-container:last .pac-item"+selected+":first span:nth-child(2)").text();var $span2=$(".pac-container:last .pac-item"+selected+":first span:nth-child(3)").text();var firstResult=$span1;if($span2){firstResult+=" - "+$span2}this.$input.val(firstResult);return firstResult},restoreLastValue:function(){if(this.lastInputVal){this.$input.val(this.lastInputVal)}},handleGeocode:function(results,status){if(status===google.maps.GeocoderStatus.OK){var result=results[0];this.$input.val(result.formatted_address);this.update(result);if(results.length>1){this.trigger("geocode:multiple",results)}}else{this.trigger("geocode:error",status)}},trigger:function(event,argument){this.$input.trigger(event,[argument])},center:function(geometry){if(geometry.viewport){this.map.fitBounds(geometry.viewport);if(this.map.getZoom()>this.options.maxZoom){this.map.setZoom(this.options.maxZoom)}}else{this.map.setZoom(this.options.maxZoom);this.map.setCenter(geometry.location)}if(this.marker){this.marker.setPosition(geometry.location);this.marker.setAnimation(this.options.markerOptions.animation)}},update:function(result){if(this.map){this.center(result.geometry)}if(this.$details){this.fillDetails(result)}this.trigger("geocode:result",result)},fillDetails:function(result){var data={},geometry=result.geometry,viewport=geometry.viewport,bounds=geometry.bounds;$.each(result.address_components,function(index,object){var name=object.types[0];$.each(object.types,function(index,name){data[name]=object.long_name;data[name+"_short"]=object.short_name})});$.each(placesDetails,function(index,key){data[key]=result[key]});$.extend(data,{formatted_address:result.formatted_address,location_type:geometry.location_type||"PLACES",viewport:viewport,bounds:bounds,location:geometry.location,lat:geometry.location.lat(),lng:geometry.location.lng()});$.each(this.details,$.proxy(function(key,$detail){var value=data[key];this.setDetail($detail,value)},this));this.data=data},setDetail:function($element,value){if(value===undefined){value=""}else if(typeof value.toUrlValue=="function"){value=value.toUrlValue()}if($element.is(":input")){$element.val(value)}else{$element.text(value)}},markerDragged:function(event){this.trigger("geocode:dragged",event.latLng)},mapClicked:function(event){this.trigger("geocode:click",event.latLng)},mapZoomed:function(event){this.trigger("geocode:zoom",this.map.getZoom())},resetMarker:function(){this.marker.setPosition(this.data.location);this.setDetail(this.details.lat,this.data.location.lat());this.setDetail(this.details.lng,this.data.location.lng())},placeChanged:function(){var place=this.autocomplete.getPlace();this.selected=true;if(!place.geometry){if(this.options.autoselect){var autoSelection=this.selectFirstResult();this.find(autoSelection)}}else{this.update(place)}}});$.fn.geocomplete=function(options){var attribute="plugin_geocomplete";if(typeof options=="string"){var instance=$(this).data(attribute)||$(this).geocomplete().data(attribute),prop=instance[options];if(typeof prop=="function"){prop.apply(instance,Array.prototype.slice.call(arguments,1));return $(this)}else{if(arguments.length==2){prop=arguments[1]}return prop}}else{return this.each(function(){var instance=$.data(this,attribute);if(!instance){instance=new GeoComplete(this,options);$.data(this,attribute,instance)}})}}})(jQuery,window,document);
``` | /content/code_sandbox/public/vendor/geocomplete/jquery.geocomplete.min.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,866 |
```shell
# sh build.sh
# minify script
uglifyjs --comments license jquery.geocomplete.js > jquery.geocomplete.min.js
## create documentation
docco jquery.geocomplete.js
mv docs/jquery.geocomplete.html docs/index.html
rm -Rf _temp
mkdir _temp
mkdir _temp/examples
mv docs _temp
cp jquery.geocomplete.js _temp/
cp jquery.geocomplete.min.js _temp/
cp examples/* _temp/examples
``` | /content/code_sandbox/public/vendor/geocomplete/build.sh | shell | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 92 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
<input id="find" type="button" value="find" />
</form>
<div class="map_canvas"></div>
<p>Try searching for somewhere. All results should be within Germany. <br />
For further details on result limiting via country: <a href="path_to_url#adding_autocomplete">path_to_url#adding_autocomplete</a> and read about '<em>componentRestrictions</em>'. <br />
The Geocoder can also be limited by region: <a href="path_to_url#GeocoderRequest">path_to_url#GeocoderRequest</a>
</p>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var center = new google.maps.LatLng(51.165691,10.451526);
$("#geocomplete").geocomplete({
map: ".map_canvas",
types: ['establishment'],
country: 'de'
});
var map = $("#geocomplete").geocomplete("map")
map.setCenter(center);
map.setZoom(6);
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/country_limit.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 358 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
<style type="text/css" media="screen">
form { width: 300px; float: left; }
fieldset { width: 320px; margin-top: 20px}
fieldset strong { display: block; margin: 0.5em 0 0em; }
fieldset input { width: 95%; }
ul span { color: #999; }
</style>
</head>
<body>
<div class="map_canvas"></div>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
<input id="find" type="button" value="find" />
<ul>
<li>Location: <span data-geo="location"></span></li>
<li>Route: <span data-geo="route"></span></li>
<li>Street Number: <span data-geo="street_number"></span></li>
<li>Postal Code: <span data-geo="postal_code"></span></li>
<li>Locality: <span data-geo="locality"></span></li>
<li>Country Code: <span data-geo="country_short"></span></li>
<li>State: <span data-geo="administrative_area_level_1"></span></li>
</ul>
</form>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete({
map: ".map_canvas",
details: "form ul",
detailsAttribute: "data-geo"
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/custom_attribute.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 472 |
```html
<!DOCTYPE html>
<html>
<head>
<title>GeoComplete</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
</form>
<div class="map_canvas"></div>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var options = {
map: ".map_canvas",
location: "NYC"
};
$("#geocomplete").geocomplete(options);
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/location.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 198 |
```html
<!DOCTYPE html>
<html>
<head>
<title>GeoComplete</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
<input id="find" type="button" value="find" />
</form>
<div id="examples">
Examples:
<a href="#">Hamburg, Germany</a>
<a href="#">Juliusstrae 25, Germany</a>
<a href="#">3rr0r</a>
<a href="#">Hauptstrae</a>
</div>
<div class="map_canvas"></div>
<pre id="logger">Log:</pre>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var options = {
map: ".map_canvas"
};
$("#geocomplete").geocomplete(options)
.bind("geocode:result", function(event, result){
$.log("Result: " + result.formatted_address);
})
.bind("geocode:error", function(event, status){
$.log("ERROR: " + status);
})
.bind("geocode:multiple", function(event, results){
$.log("Multiple: " + results.length + " results found");
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
$("#examples a").click(function(){
$("#geocomplete").val($(this).text()).trigger("geocode");
return false;
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/map.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 421 |
```javascript
$.log = function(message){
var $logger = $("#logger");
$logger.html($logger.html() + "\n * " + message );
}
``` | /content/code_sandbox/public/vendor/geocomplete/examples/logger.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 32 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div class="map_canvas"></div>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" value="Hauptstrae"/>
<input id="find" type="button" value="find" />
</form>
<ul id="multiple"></ul>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var $geocomplete = $("#geocomplete"),
$multiple = $("#multiple");
$geocomplete
.geocomplete({ map: ".map_canvas" })
.bind("geocode:multiple", function(event, results){
$.each(results, function(){
var result = this;
$("<li>")
.html(result.formatted_address)
.appendTo($multiple)
.click(function(){
$geocomplete.geocomplete("update", result)
});
});
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/multiple_results.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 320 |
```css
body {
color: #333;
}
body, input, button {
line-height: 1.4;
font: 13px Helvetica,arial,freesans,clean,sans-serif;
}
a {
color: #4183C4;
text-decoration: none;
}
#examples a {
text-decoration: underline;
}
#geocomplete { width: 200px}
.map_canvas {
width: 600px;
height: 400px;
margin: 10px 20px 10px 0;
}
#multiple li {
cursor: pointer;
text-decoration: underline;
}
``` | /content/code_sandbox/public/vendor/geocomplete/examples/styles.css | css | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 138 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
<style type="text/css" media="screen">
form { width: 300px; float: left; margin-left: 20px}
fieldset { width: 320px; margin-top: 20px}
fieldset strong { display: block; margin: 0.5em 0 0em; }
fieldset input { width: 95%; }
ul span { color: #999; }
</style>
</head>
<body>
<div class="map_canvas"></div>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" value="111 Broadway, New York, NY" />
<input id="find" type="button" value="find" />
<fieldset>
<label>Latitude</label>
<input name="lat" type="text" value="">
<label>Longitude</label>
<input name="lng" type="text" value="">
<label>Formatted Address</label>
<input name="formatted_address" type="text" value="">
</fieldset>
<a id="reset" href="#" style="display:none;">Reset Marker</a>
</form>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete({
map: ".map_canvas",
details: "form ",
markerOptions: {
draggable: true
}
});
$("#geocomplete").bind("geocode:dragged", function(event, latLng){
$("input[name=lat]").val(latLng.lat());
$("input[name=lng]").val(latLng.lng());
$("#reset").show();
});
$("#reset").click(function(){
$("#geocomplete").geocomplete("resetMarker");
$("#reset").hide();
return false;
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
}).click();
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/draggable.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 515 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
<style type="text/css" media="screen">
.map_canvas { float: left; }
form { width: 300px; float: left; }
fieldset { width: 320px; margin-top: 20px}
fieldset label { display: block; margin: 0.5em 0 0em; }
fieldset input { width: 95%; }
</style>
</head>
<body>
<div class="map_canvas"></div>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
<input id="other" type="text" placeholder="Type in a value" value="" />
<input id="find" type="button" value="find" />
<fieldset>
<h3>Address-Details</h3>
<label>Name</label>
<input name="name" type="text" value="">
<label>POI Name</label>
<input name="point_of_interest" type="text" value="">
<label>Latitude</label>
<input name="lat" type="text" value="">
<label>Longitude</label>
<input name="lng" type="text" value="">
<label>Location</label>
<input name="location" type="text" value="">
<label>Location Type</label>
<input name="location_type" type="text" value="">
<label>Formatted Address</label>
<input name="formatted_address" type="text" value="">
<label>Bounds</label>
<input name="bounds" type="text" value="">
<label>Viewport</label>
<input name="viewport" type="text" value="">
<label>Route</label>
<input name="route" type="text" value="">
<label>Street Number</label>
<input name="street_number" type="text" value="">
<label>Postal Code</label>
<input name="postal_code" type="text" value="">
<label>Locality</label>
<input name="locality" type="text" value="">
<label>Sub Locality</label>
<input name="sublocality" type="text" value="">
<label>Country</label>
<input name="country" type="text" value="">
<label>Country Code</label>
<input name="country_short" type="text" value="">
<label>State</label>
<input name="administrative_area_level_1" type="text" value="">
<label>ID</label>
<input name="id" type="text" value="">
<label>Reference</label>
<input name="reference" type="text" value="">
<label>URL</label>
<input name="url" type="text" value="">
<label>Website</label>
<input name="website" type="text" value="">
</fieldset>
</form>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete({
map: ".map_canvas",
details: "form",
blur: true,
geocodeAfterResult: true
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/blur.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 845 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
<style type="text/css" media="screen">
.map_canvas { float: left; }
form { width: 300px; float: left; }
fieldset { width: 320px; margin-top: 20px}
fieldset label { display: block; margin: 0.5em 0 0em; }
fieldset input { width: 95%; }
</style>
</head>
<body>
<div class="map_canvas"></div>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" value="Empire State Bldg" />
<input id="find" type="button" value="find" />
<fieldset>
<h3>Address-Details</h3>
<label>Name</label>
<input name="name" type="text" value="">
<label>POI Name</label>
<input name="point_of_interest" type="text" value="">
<label>Latitude</label>
<input name="lat" type="text" value="">
<label>Longitude</label>
<input name="lng" type="text" value="">
<label>Location</label>
<input name="location" type="text" value="">
<label>Location Type</label>
<input name="location_type" type="text" value="">
<label>Formatted Address</label>
<input name="formatted_address" type="text" value="">
<label>Bounds</label>
<input name="bounds" type="text" value="">
<label>Viewport</label>
<input name="viewport" type="text" value="">
<label>Route</label>
<input name="route" type="text" value="">
<label>Street Number</label>
<input name="street_number" type="text" value="">
<label>Postal Code</label>
<input name="postal_code" type="text" value="">
<label>Locality</label>
<input name="locality" type="text" value="">
<label>Sub Locality</label>
<input name="sublocality" type="text" value="">
<label>Country</label>
<input name="country" type="text" value="">
<label>Country Code</label>
<input name="country_short" type="text" value="">
<label>State</label>
<input name="administrative_area_level_1" type="text" value="">
<label>Place ID</label>
<input name="place_id" type="text" value="">
<label>ID</label>
<input name="id" type="text" value="">
<label>Reference</label>
<input name="reference" type="text" value="">
<label>URL</label>
<input name="url" type="text" value="">
<label>Website</label>
<input name="website" type="text" value="">
</fieldset>
</form>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete({
map: ".map_canvas",
details: "form",
types: ["geocode", "establishment"],
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/form.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 846 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
<input id="find" type="button" value="find" />
</form>
<div class="map_canvas"></div>
Call:
<button id="search">.geocomplete("find", "NYC")</button>
<button id="center">.geocomplete("map").setCenter()</button>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete({
map: ".map_canvas"
});
$("#search").click(function(){
$("#geocomplete").geocomplete("find", "NYC");
});
$("#center").click(function(){
var map = $("#geocomplete").geocomplete("map"),
center = new google.maps.LatLng(10, 0);
map.setCenter(center);
map.setZoom(3);
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/api.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 316 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
<input id="find" type="button" value="find" />
</form>
<div class="map_canvas"></div>
<p>Try searching for "Google". Results should be biased within Sydney. <br />For further details on result biasing: <a href="path_to_url#adding_autocomplete">path_to_url#adding_autocomplete</a></p>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var center = new google.maps.LatLng(-33.873651,151.20689),
defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-33.8902, 151.1759),
new google.maps.LatLng(-33.8474, 151.2631)
);
$("#geocomplete").geocomplete({
map: ".map_canvas",
types: ['establishment'],
bounds: defaultBounds
});
var map = $("#geocomplete").geocomplete("map")
map.setCenter(center);
map.setZoom(11);
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/bounds.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 353 |
```html
<!DOCTYPE html>
<html>
<head>
<title>$.geocomplete()</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
<input id="find" type="button" value="find" />
</form>
<div id="examples">
Examples:
<a href="#">Hamburg, Germany</a>
<a href="#">3rr0r</a>
<a href="#">Hauptstrae</a>
</div>
<pre id="logger">Log:</pre>
<script src="path_to_url"></script>
<script src="path_to_url"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
$("#geocomplete").geocomplete()
.bind("geocode:result", function(event, result){
$.log("Result: " + result.formatted_address);
})
.bind("geocode:error", function(event, status){
$.log("ERROR: " + status);
})
.bind("geocode:multiple", function(event, results){
$.log("Multiple: " + results.length + " results found");
});
$("#find").click(function(){
$("#geocomplete").trigger("geocode");
});
$("#examples a").click(function(){
$("#geocomplete").val($(this).text()).trigger("geocode");
return false;
});
});
</script>
</body>
</html>
``` | /content/code_sandbox/public/vendor/geocomplete/examples/simple.html | html | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 379 |
```javascript
import Vue from './instance/vue'
import installGlobalAPI from './global-api'
import { inBrowser, devtools } from './util/index'
import config from './config'
installGlobalAPI(Vue)
Vue.version = '1.0.24'
export default Vue
// devtools global hook
/* istanbul ignore next */
setTimeout(() => {
if (config.devtools) {
if (devtools) {
devtools.emit('init', Vue)
} else if (
process.env.NODE_ENV !== 'production' &&
inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
) {
console.log(
'Download the Vue Devtools for a better development experience:\n' +
'path_to_url
)
}
}
}, 0)
``` | /content/code_sandbox/public/vendor/vue/src/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 167 |
```javascript
import {
extend,
bind,
on,
off,
getAttr,
getBindAttr,
camelize,
hyphenate,
nextTick,
warn
} from './util/index'
import Watcher from './watcher'
import { parseExpression, isSimplePath } from './parsers/expression'
function noop () {}
/**
* A directive links a DOM element with a piece of data,
* which is the result of evaluating an expression.
* It registers a watcher with the expression and calls
* the DOM update function when a change is triggered.
*
* @param {Object} descriptor
* - {String} name
* - {Object} def
* - {String} expression
* - {Array<Object>} [filters]
* - {Object} [modifiers]
* - {Boolean} literal
* - {String} attr
* - {String} arg
* - {String} raw
* - {String} [ref]
* - {Array<Object>} [interp]
* - {Boolean} [hasOneTime]
* @param {Vue} vm
* @param {Node} el
* @param {Vue} [host] - transclusion host component
* @param {Object} [scope] - v-for scope
* @param {Fragment} [frag] - owner fragment
* @constructor
*/
export default function Directive (descriptor, vm, el, host, scope, frag) {
this.vm = vm
this.el = el
// copy descriptor properties
this.descriptor = descriptor
this.name = descriptor.name
this.expression = descriptor.expression
this.arg = descriptor.arg
this.modifiers = descriptor.modifiers
this.filters = descriptor.filters
this.literal = this.modifiers && this.modifiers.literal
// private
this._locked = false
this._bound = false
this._listeners = null
// link context
this._host = host
this._scope = scope
this._frag = frag
// store directives on node in dev mode
if (process.env.NODE_ENV !== 'production' && this.el) {
this.el._vue_directives = this.el._vue_directives || []
this.el._vue_directives.push(this)
}
}
/**
* Initialize the directive, mixin definition properties,
* setup the watcher, call definition bind() and update()
* if present.
*/
Directive.prototype._bind = function () {
var name = this.name
var descriptor = this.descriptor
// remove attribute
if (
(name !== 'cloak' || this.vm._isCompiled) &&
this.el && this.el.removeAttribute
) {
var attr = descriptor.attr || ('v-' + name)
this.el.removeAttribute(attr)
}
// copy def properties
var def = descriptor.def
if (typeof def === 'function') {
this.update = def
} else {
extend(this, def)
}
// setup directive params
this._setupParams()
// initial bind
if (this.bind) {
this.bind()
}
this._bound = true
if (this.literal) {
this.update && this.update(descriptor.raw)
} else if (
(this.expression || this.modifiers) &&
(this.update || this.twoWay) &&
!this._checkStatement()
) {
// wrapped updater for context
var dir = this
if (this.update) {
this._update = function (val, oldVal) {
if (!dir._locked) {
dir.update(val, oldVal)
}
}
} else {
this._update = noop
}
var preProcess = this._preProcess
? bind(this._preProcess, this)
: null
var postProcess = this._postProcess
? bind(this._postProcess, this)
: null
var watcher = this._watcher = new Watcher(
this.vm,
this.expression,
this._update, // callback
{
filters: this.filters,
twoWay: this.twoWay,
deep: this.deep,
preProcess: preProcess,
postProcess: postProcess,
scope: this._scope
}
)
// v-model with inital inline value need to sync back to
// model instead of update to DOM on init. They would
// set the afterBind hook to indicate that.
if (this.afterBind) {
this.afterBind()
} else if (this.update) {
this.update(watcher.value)
}
}
}
/**
* Setup all param attributes, e.g. track-by,
* transition-mode, etc...
*/
Directive.prototype._setupParams = function () {
if (!this.params) {
return
}
var params = this.params
// swap the params array with a fresh object.
this.params = Object.create(null)
var i = params.length
var key, val, mappedKey
while (i--) {
key = hyphenate(params[i])
mappedKey = camelize(key)
val = getBindAttr(this.el, key)
if (val != null) {
// dynamic
this._setupParamWatcher(mappedKey, val)
} else {
// static
val = getAttr(this.el, key)
if (val != null) {
this.params[mappedKey] = val === '' ? true : val
}
}
}
}
/**
* Setup a watcher for a dynamic param.
*
* @param {String} key
* @param {String} expression
*/
Directive.prototype._setupParamWatcher = function (key, expression) {
var self = this
var called = false
var unwatch = (this._scope || this.vm).$watch(expression, function (val, oldVal) {
self.params[key] = val
// since we are in immediate mode,
// only call the param change callbacks if this is not the first update.
if (called) {
var cb = self.paramWatchers && self.paramWatchers[key]
if (cb) {
cb.call(self, val, oldVal)
}
} else {
called = true
}
}, {
immediate: true,
user: false
})
;(this._paramUnwatchFns || (this._paramUnwatchFns = [])).push(unwatch)
}
/**
* Check if the directive is a function caller
* and if the expression is a callable one. If both true,
* we wrap up the expression and use it as the event
* handler.
*
* e.g. on-click="a++"
*
* @return {Boolean}
*/
Directive.prototype._checkStatement = function () {
var expression = this.expression
if (
expression && this.acceptStatement &&
!isSimplePath(expression)
) {
var fn = parseExpression(expression).get
var scope = this._scope || this.vm
var handler = function (e) {
scope.$event = e
fn.call(scope, scope)
scope.$event = null
}
if (this.filters) {
handler = scope._applyFilters(handler, null, this.filters)
}
this.update(handler)
return true
}
}
/**
* Set the corresponding value with the setter.
* This should only be used in two-way directives
* e.g. v-model.
*
* @param {*} value
* @public
*/
Directive.prototype.set = function (value) {
/* istanbul ignore else */
if (this.twoWay) {
this._withLock(function () {
this._watcher.set(value)
})
} else if (process.env.NODE_ENV !== 'production') {
warn(
'Directive.set() can only be used inside twoWay' +
'directives.'
)
}
}
/**
* Execute a function while preventing that function from
* triggering updates on this directive instance.
*
* @param {Function} fn
*/
Directive.prototype._withLock = function (fn) {
var self = this
self._locked = true
fn.call(self)
nextTick(function () {
self._locked = false
})
}
/**
* Convenience method that attaches a DOM event listener
* to the directive element and autometically tears it down
* during unbind.
*
* @param {String} event
* @param {Function} handler
* @param {Boolean} [useCapture]
*/
Directive.prototype.on = function (event, handler, useCapture) {
on(this.el, event, handler, useCapture)
;(this._listeners || (this._listeners = []))
.push([event, handler])
}
/**
* Teardown the watcher and call unbind.
*/
Directive.prototype._teardown = function () {
if (this._bound) {
this._bound = false
if (this.unbind) {
this.unbind()
}
if (this._watcher) {
this._watcher.teardown()
}
var listeners = this._listeners
var i
if (listeners) {
i = listeners.length
while (i--) {
off(this.el, listeners[i][0], listeners[i][1])
}
}
var unwatchFns = this._paramUnwatchFns
if (unwatchFns) {
i = unwatchFns.length
while (i--) {
unwatchFns[i]()
}
}
if (process.env.NODE_ENV !== 'production' && this.el) {
this.el._vue_directives.$remove(this)
}
this.vm = this.el = this._watcher = this._listeners = null
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directive.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,088 |
```javascript
import config from './config'
import directives from './directives/public/index'
import elementDirectives from './directives/element/index'
import filters from './filters/index'
import * as util from './util/index'
import * as compiler from './compiler/index'
import * as path from './parsers/path'
import * as text from './parsers/text'
import * as template from './parsers/template'
import * as directive from './parsers/directive'
import * as expression from './parsers/expression'
import * as transition from './transition/index'
import FragmentFactory from './fragment/factory'
import internalDirectives from './directives/internal/index'
import {
set,
del,
nextTick,
mergeOptions,
classify,
toArray,
commonTagRE,
reservedTagRE,
warn,
isPlainObject,
extend
} from './util/index'
export default function (Vue) {
/**
* Vue and every constructor that extends Vue has an
* associated options object, which can be accessed during
* compilation steps as `this.constructor.options`.
*
* These can be seen as the default options of every
* Vue instance.
*/
Vue.options = {
directives,
elementDirectives,
filters,
transitions: {},
components: {},
partials: {},
replace: true
}
/**
* Expose useful internals
*/
Vue.util = util
Vue.config = config
Vue.set = set
Vue.delete = del
Vue.nextTick = nextTick
/**
* The following are exposed for advanced usage / plugins
*/
Vue.compiler = compiler
Vue.FragmentFactory = FragmentFactory
Vue.internalDirectives = internalDirectives
Vue.parsers = {
path,
text,
template,
directive,
expression
}
/**
* Each instance constructor, including Vue, has a unique
* cid. This enables us to create wrapped "child
* constructors" for prototypal inheritance and cache them.
*/
Vue.cid = 0
var cid = 1
/**
* Class inheritance
*
* @param {Object} extendOptions
*/
Vue.extend = function (extendOptions) {
extendOptions = extendOptions || {}
var Super = this
var isFirstExtend = Super.cid === 0
if (isFirstExtend && extendOptions._Ctor) {
return extendOptions._Ctor
}
var name = extendOptions.name || Super.options.name
if (process.env.NODE_ENV !== 'production') {
if (!/^[a-zA-Z][\w-]*$/.test(name)) {
warn(
'Invalid component name: "' + name + '". Component names ' +
'can only contain alphanumeric characaters and the hyphen.'
)
name = null
}
}
var Sub = createClass(name || 'VueComponent')
Sub.prototype = Object.create(Super.prototype)
Sub.prototype.constructor = Sub
Sub.cid = cid++
Sub.options = mergeOptions(
Super.options,
extendOptions
)
Sub['super'] = Super
// allow further extension
Sub.extend = Super.extend
// create asset registers, so extended classes
// can have their private assets too.
config._assetTypes.forEach(function (type) {
Sub[type] = Super[type]
})
// enable recursive self-lookup
if (name) {
Sub.options.components[name] = Sub
}
// cache constructor
if (isFirstExtend) {
extendOptions._Ctor = Sub
}
return Sub
}
/**
* A function that returns a sub-class constructor with the
* given name. This gives us much nicer output when
* logging instances in the console.
*
* @param {String} name
* @return {Function}
*/
function createClass (name) {
/* eslint-disable no-new-func */
return new Function(
'return function ' + classify(name) +
' (options) { this._init(options) }'
)()
/* eslint-enable no-new-func */
}
/**
* Plugin system
*
* @param {Object} plugin
*/
Vue.use = function (plugin) {
/* istanbul ignore if */
if (plugin.installed) {
return
}
// additional parameters
var args = toArray(arguments, 1)
args.unshift(this)
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args)
} else {
plugin.apply(null, args)
}
plugin.installed = true
return this
}
/**
* Apply a global mixin by merging it into the default
* options.
*/
Vue.mixin = function (mixin) {
Vue.options = mergeOptions(Vue.options, mixin)
}
/**
* Create asset registration methods with the following
* signature:
*
* @param {String} id
* @param {*} definition
*/
config._assetTypes.forEach(function (type) {
Vue[type] = function (id, definition) {
if (!definition) {
return this.options[type + 's'][id]
} else {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
if (
type === 'component' &&
(commonTagRE.test(id) || reservedTagRE.test(id))
) {
warn(
'Do not use built-in or reserved HTML elements as component ' +
'id: ' + id
)
}
}
if (
type === 'component' &&
isPlainObject(definition)
) {
definition.name = id
definition = Vue.extend(definition)
}
this.options[type + 's'][id] = definition
return definition
}
}
})
// expose internal transition API
extend(Vue.transition, transition)
}
``` | /content/code_sandbox/public/vendor/vue/src/global-api.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,286 |
```javascript
import config from './config'
import Dep from './observer/dep'
import { parseExpression } from './parsers/expression'
import { pushWatcher } from './batcher'
import {
extend,
warn,
isArray,
isObject,
nextTick,
_Set as Set
} from './util/index'
let uid = 0
/**
* A watcher parses an expression, collects dependencies,
* and fires callback when the expression value changes.
* This is used for both the $watch() api and directives.
*
* @param {Vue} vm
* @param {String|Function} expOrFn
* @param {Function} cb
* @param {Object} options
* - {Array} filters
* - {Boolean} twoWay
* - {Boolean} deep
* - {Boolean} user
* - {Boolean} sync
* - {Boolean} lazy
* - {Function} [preProcess]
* - {Function} [postProcess]
* @constructor
*/
export default function Watcher (vm, expOrFn, cb, options) {
// mix in options
if (options) {
extend(this, options)
}
var isFn = typeof expOrFn === 'function'
this.vm = vm
vm._watchers.push(this)
this.expression = expOrFn
this.cb = cb
this.id = ++uid // uid for batching
this.active = true
this.dirty = this.lazy // for lazy watchers
this.deps = []
this.newDeps = []
this.depIds = new Set()
this.newDepIds = new Set()
this.prevError = null // for async error stacks
// parse expression for getter/setter
if (isFn) {
this.getter = expOrFn
this.setter = undefined
} else {
var res = parseExpression(expOrFn, this.twoWay)
this.getter = res.get
this.setter = res.set
}
this.value = this.lazy
? undefined
: this.get()
// state for avoiding false triggers for deep and Array
// watchers during vm._digest()
this.queued = this.shallow = false
}
/**
* Evaluate the getter, and re-collect dependencies.
*/
Watcher.prototype.get = function () {
this.beforeGet()
var scope = this.scope || this.vm
var value
try {
value = this.getter.call(scope, scope)
} catch (e) {
if (
process.env.NODE_ENV !== 'production' &&
config.warnExpressionErrors
) {
warn(
'Error when evaluating expression ' +
'"' + this.expression + '": ' + e.toString(),
this.vm
)
}
}
// "touch" every property so they are all tracked as
// dependencies for deep watching
if (this.deep) {
traverse(value)
}
if (this.preProcess) {
value = this.preProcess(value)
}
if (this.filters) {
value = scope._applyFilters(value, null, this.filters, false)
}
if (this.postProcess) {
value = this.postProcess(value)
}
this.afterGet()
return value
}
/**
* Set the corresponding value with the setter.
*
* @param {*} value
*/
Watcher.prototype.set = function (value) {
var scope = this.scope || this.vm
if (this.filters) {
value = scope._applyFilters(
value, this.value, this.filters, true)
}
try {
this.setter.call(scope, scope, value)
} catch (e) {
if (
process.env.NODE_ENV !== 'production' &&
config.warnExpressionErrors
) {
warn(
'Error when evaluating setter ' +
'"' + this.expression + '": ' + e.toString(),
this.vm
)
}
}
// two-way sync for v-for alias
var forContext = scope.$forContext
if (forContext && forContext.alias === this.expression) {
if (forContext.filters) {
process.env.NODE_ENV !== 'production' && warn(
'It seems you are using two-way binding on ' +
'a v-for alias (' + this.expression + '), and the ' +
'v-for has filters. This will not work properly. ' +
'Either remove the filters or use an array of ' +
'objects and bind to object properties instead.',
this.vm
)
return
}
forContext._withLock(function () {
if (scope.$key) { // original is an object
forContext.rawValue[scope.$key] = value
} else {
forContext.rawValue.$set(scope.$index, value)
}
})
}
}
/**
* Prepare for dependency collection.
*/
Watcher.prototype.beforeGet = function () {
Dep.target = this
}
/**
* Add a dependency to this directive.
*
* @param {Dep} dep
*/
Watcher.prototype.addDep = function (dep) {
var id = dep.id
if (!this.newDepIds.has(id)) {
this.newDepIds.add(id)
this.newDeps.push(dep)
if (!this.depIds.has(id)) {
dep.addSub(this)
}
}
}
/**
* Clean up for dependency collection.
*/
Watcher.prototype.afterGet = function () {
Dep.target = null
var i = this.deps.length
while (i--) {
var dep = this.deps[i]
if (!this.newDepIds.has(dep.id)) {
dep.removeSub(this)
}
}
var tmp = this.depIds
this.depIds = this.newDepIds
this.newDepIds = tmp
this.newDepIds.clear()
tmp = this.deps
this.deps = this.newDeps
this.newDeps = tmp
this.newDeps.length = 0
}
/**
* Subscriber interface.
* Will be called when a dependency changes.
*
* @param {Boolean} shallow
*/
Watcher.prototype.update = function (shallow) {
if (this.lazy) {
this.dirty = true
} else if (this.sync || !config.async) {
this.run()
} else {
// if queued, only overwrite shallow with non-shallow,
// but not the other way around.
this.shallow = this.queued
? shallow
? this.shallow
: false
: !!shallow
this.queued = true
// record before-push error stack in debug mode
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.debug) {
this.prevError = new Error('[vue] async stack trace')
}
pushWatcher(this)
}
}
/**
* Batcher job interface.
* Will be called by the batcher.
*/
Watcher.prototype.run = function () {
if (this.active) {
var value = this.get()
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated; but only do so if this is a
// non-shallow update (caused by a vm digest).
((isObject(value) || this.deep) && !this.shallow)
) {
// set new value
var oldValue = this.value
this.value = value
// in debug + async mode, when a watcher callbacks
// throws, we also throw the saved before-push error
// so the full cross-tick stack trace is available.
var prevError = this.prevError
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' &&
config.debug && prevError) {
this.prevError = null
try {
this.cb.call(this.vm, value, oldValue)
} catch (e) {
nextTick(function () {
throw prevError
}, 0)
throw e
}
} else {
this.cb.call(this.vm, value, oldValue)
}
}
this.queued = this.shallow = false
}
}
/**
* Evaluate the value of the watcher.
* This only gets called for lazy watchers.
*/
Watcher.prototype.evaluate = function () {
// avoid overwriting another watcher that is being
// collected.
var current = Dep.target
this.value = this.get()
this.dirty = false
Dep.target = current
}
/**
* Depend on all deps collected by this watcher.
*/
Watcher.prototype.depend = function () {
var i = this.deps.length
while (i--) {
this.deps[i].depend()
}
}
/**
* Remove self from all dependencies' subcriber list.
*/
Watcher.prototype.teardown = function () {
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed or is performing a v-for
// re-render (the watcher list is then filtered by v-for).
if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
this.vm._watchers.$remove(this)
}
var i = this.deps.length
while (i--) {
this.deps[i].removeSub(this)
}
this.active = false
this.vm = this.cb = this.value = null
}
}
/**
* Recrusively traverse an object to evoke all converted
* getters, so that every nested property inside the object
* is collected as a "deep" dependency.
*
* @param {*} val
*/
const seenObjects = new Set()
function traverse (val, seen) {
let i, keys
if (!seen) {
seen = seenObjects
seen.clear()
}
const isA = isArray(val)
const isO = isObject(val)
if (isA || isO) {
if (val.__ob__) {
var depId = val.__ob__.dep.id
if (seen.has(depId)) {
return
} else {
seen.add(depId)
}
}
if (isA) {
i = val.length
while (i--) traverse(val[i], seen)
} else if (isO) {
keys = Object.keys(val)
i = keys.length
while (i--) traverse(val[keys[i]], seen)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/watcher.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,254 |
```javascript
/**
* A doubly linked list-based Least Recently Used (LRU)
* cache. Will keep most recently used items while
* discarding least recently used items when its limit is
* reached. This is a bare-bone version of
* Rasmus Andersson's js-lru:
*
* path_to_url
*
* @param {Number} limit
* @constructor
*/
export default function Cache (limit) {
this.size = 0
this.limit = limit
this.head = this.tail = undefined
this._keymap = Object.create(null)
}
var p = Cache.prototype
/**
* Put <value> into the cache associated with <key>.
* Returns the entry which was removed to make room for
* the new entry. Otherwise undefined is returned.
* (i.e. if there was enough room already).
*
* @param {String} key
* @param {*} value
* @return {Entry|undefined}
*/
p.put = function (key, value) {
var removed
if (this.size === this.limit) {
removed = this.shift()
}
var entry = this.get(key, true)
if (!entry) {
entry = {
key: key
}
this._keymap[key] = entry
if (this.tail) {
this.tail.newer = entry
entry.older = this.tail
} else {
this.head = entry
}
this.tail = entry
this.size++
}
entry.value = value
return removed
}
/**
* Purge the least recently used (oldest) entry from the
* cache. Returns the removed entry or undefined if the
* cache was empty.
*/
p.shift = function () {
var entry = this.head
if (entry) {
this.head = this.head.newer
this.head.older = undefined
entry.newer = entry.older = undefined
this._keymap[entry.key] = undefined
this.size--
}
return entry
}
/**
* Get and register recent use of <key>. Returns the value
* associated with <key> or undefined if not in cache.
*
* @param {String} key
* @param {Boolean} returnEntry
* @return {Entry|*}
*/
p.get = function (key, returnEntry) {
var entry = this._keymap[key]
if (entry === undefined) return
if (entry === this.tail) {
return returnEntry
? entry
: entry.value
}
// HEAD--------------TAIL
// <.older .newer>
// <--- add direction --
// A B C <D> E
if (entry.newer) {
if (entry === this.head) {
this.head = entry.newer
}
entry.newer.older = entry.older // C <-- E.
}
if (entry.older) {
entry.older.newer = entry.newer // C. --> E
}
entry.newer = undefined // D --x
entry.older = this.tail // D. --> E
if (this.tail) {
this.tail.newer = entry // E. <-- D
}
this.tail = entry
return returnEntry
? entry
: entry.value
}
``` | /content/code_sandbox/public/vendor/vue/src/cache.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 718 |
```javascript
import config from './config'
import {
warn,
nextTick,
devtools
} from './util/index'
// we have two separate queues: one for directive updates
// and one for user watcher registered via $watch().
// we want to guarantee directive updates to be called
// before user watchers so that when user watchers are
// triggered, the DOM would have already been in updated
// state.
var queue = []
var userQueue = []
var has = {}
var circular = {}
var waiting = false
/**
* Reset the batcher's state.
*/
function resetBatcherState () {
queue.length = 0
userQueue.length = 0
has = {}
circular = {}
waiting = false
}
/**
* Flush both queues and run the watchers.
*/
function flushBatcherQueue () {
runBatcherQueue(queue)
runBatcherQueue(userQueue)
// user watchers triggered more watchers,
// keep flushing until it depletes
if (queue.length) {
return flushBatcherQueue()
}
// dev tool hook
/* istanbul ignore if */
if (devtools && config.devtools) {
devtools.emit('flush')
}
resetBatcherState()
}
/**
* Run the watchers in a single queue.
*
* @param {Array} queue
*/
function runBatcherQueue (queue) {
// do not cache length because more watchers might be pushed
// as we run existing watchers
for (let i = 0; i < queue.length; i++) {
var watcher = queue[i]
var id = watcher.id
has[id] = null
watcher.run()
// in dev build, check and stop circular updates.
if (process.env.NODE_ENV !== 'production' && has[id] != null) {
circular[id] = (circular[id] || 0) + 1
if (circular[id] > config._maxUpdateCount) {
warn(
'You may have an infinite update loop for watcher ' +
'with expression "' + watcher.expression + '"',
watcher.vm
)
break
}
}
}
queue.length = 0
}
/**
* Push a watcher into the watcher queue.
* Jobs with duplicate IDs will be skipped unless it's
* pushed when the queue is being flushed.
*
* @param {Watcher} watcher
* properties:
* - {Number} id
* - {Function} run
*/
export function pushWatcher (watcher) {
const id = watcher.id
if (has[id] == null) {
// push watcher into appropriate queue
const q = watcher.user
? userQueue
: queue
has[id] = q.length
q.push(watcher)
// queue the flush
if (!waiting) {
waiting = true
nextTick(flushBatcherQueue)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/batcher.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 624 |
```javascript
import { compileRegex } from './parsers/text'
let delimiters = ['{{', '}}']
let unsafeDelimiters = ['{{{', '}}}']
const config = {
/**
* Whether to print debug messages.
* Also enables stack trace for warnings.
*
* @type {Boolean}
*/
debug: false,
/**
* Whether to suppress warnings.
*
* @type {Boolean}
*/
silent: false,
/**
* Whether to use async rendering.
*/
async: true,
/**
* Whether to warn against errors caught when evaluating
* expressions.
*/
warnExpressionErrors: true,
/**
* Whether to allow devtools inspection.
* Disabled by default in production builds.
*/
devtools: process.env.NODE_ENV !== 'production',
/**
* Internal flag to indicate the delimiters have been
* changed.
*
* @type {Boolean}
*/
_delimitersChanged: true,
/**
* List of asset types that a component can own.
*
* @type {Array}
*/
_assetTypes: [
'component',
'directive',
'elementDirective',
'filter',
'transition',
'partial'
],
/**
* prop binding modes
*/
_propBindingModes: {
ONE_WAY: 0,
TWO_WAY: 1,
ONE_TIME: 2
},
/**
* Max circular updates allowed in a batcher flush cycle.
*/
_maxUpdateCount: 100,
/**
* Interpolation delimiters. Changing these would trigger
* the text parser to re-compile the regular expressions.
*
* @type {Array<String>}
*/
get delimiters () {
return delimiters
},
set delimiters (val) {
delimiters = val
compileRegex()
},
get unsafeDelimiters () {
return unsafeDelimiters
},
set unsafeDelimiters (val) {
unsafeDelimiters = val
compileRegex()
}
}
export default config
``` | /content/code_sandbox/public/vendor/vue/src/config.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 450 |
```javascript
import config from '../config'
import { parseDirective } from '../parsers/directive'
import { isSimplePath } from '../parsers/expression'
import { defineReactive, withoutConversion } from '../observer/index'
import propDef from '../directives/internal/prop'
import {
warn,
camelize,
hyphenate,
getAttr,
getBindAttr,
isLiteral,
toBoolean,
toNumber,
stripQuotes,
isArray,
isPlainObject,
isObject,
hasOwn
} from '../util/index'
const propBindingModes = config._propBindingModes
const empty = {}
// regexes
const identRE = /^[$_a-zA-Z]+[\w$]*$/
const settablePathRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\[[^\[\]]+\])*$/
/**
* Compile props on a root element and return
* a props link function.
*
* @param {Element|DocumentFragment} el
* @param {Array} propOptions
* @param {Vue} vm
* @return {Function} propsLinkFn
*/
export function compileProps (el, propOptions, vm) {
var props = []
var names = Object.keys(propOptions)
var i = names.length
var options, name, attr, value, path, parsed, prop
while (i--) {
name = names[i]
options = propOptions[name] || empty
if (process.env.NODE_ENV !== 'production' && name === '$data') {
warn('Do not use $data as prop.', vm)
continue
}
// props could contain dashes, which will be
// interpreted as minus calculations by the parser
// so we need to camelize the path here
path = camelize(name)
if (!identRE.test(path)) {
process.env.NODE_ENV !== 'production' && warn(
'Invalid prop key: "' + name + '". Prop keys ' +
'must be valid identifiers.',
vm
)
continue
}
prop = {
name: name,
path: path,
options: options,
mode: propBindingModes.ONE_WAY,
raw: null
}
attr = hyphenate(name)
// first check dynamic version
if ((value = getBindAttr(el, attr)) === null) {
if ((value = getBindAttr(el, attr + '.sync')) !== null) {
prop.mode = propBindingModes.TWO_WAY
} else if ((value = getBindAttr(el, attr + '.once')) !== null) {
prop.mode = propBindingModes.ONE_TIME
}
}
if (value !== null) {
// has dynamic binding!
prop.raw = value
parsed = parseDirective(value)
value = parsed.expression
prop.filters = parsed.filters
// check binding type
if (isLiteral(value) && !parsed.filters) {
// for expressions containing literal numbers and
// booleans, there's no need to setup a prop binding,
// so we can optimize them as a one-time set.
prop.optimizedLiteral = true
} else {
prop.dynamic = true
// check non-settable path for two-way bindings
if (process.env.NODE_ENV !== 'production' &&
prop.mode === propBindingModes.TWO_WAY &&
!settablePathRE.test(value)) {
prop.mode = propBindingModes.ONE_WAY
warn(
'Cannot bind two-way prop with non-settable ' +
'parent path: ' + value,
vm
)
}
}
prop.parentPath = value
// warn required two-way
if (
process.env.NODE_ENV !== 'production' &&
options.twoWay &&
prop.mode !== propBindingModes.TWO_WAY
) {
warn(
'Prop "' + name + '" expects a two-way binding type.',
vm
)
}
} else if ((value = getAttr(el, attr)) !== null) {
// has literal binding!
prop.raw = value
} else if (process.env.NODE_ENV !== 'production') {
// check possible camelCase prop usage
var lowerCaseName = path.toLowerCase()
value = /[A-Z\-]/.test(name) && (
el.getAttribute(lowerCaseName) ||
el.getAttribute(':' + lowerCaseName) ||
el.getAttribute('v-bind:' + lowerCaseName) ||
el.getAttribute(':' + lowerCaseName + '.once') ||
el.getAttribute('v-bind:' + lowerCaseName + '.once') ||
el.getAttribute(':' + lowerCaseName + '.sync') ||
el.getAttribute('v-bind:' + lowerCaseName + '.sync')
)
if (value) {
warn(
'Possible usage error for prop `' + lowerCaseName + '` - ' +
'did you mean `' + attr + '`? HTML is case-insensitive, remember to use ' +
'kebab-case for props in templates.',
vm
)
} else if (options.required) {
// warn missing required
warn('Missing required prop: ' + name, vm)
}
}
// push prop
props.push(prop)
}
return makePropsLinkFn(props)
}
/**
* Build a function that applies props to a vm.
*
* @param {Array} props
* @return {Function} propsLinkFn
*/
function makePropsLinkFn (props) {
return function propsLinkFn (vm, scope) {
// store resolved props info
vm._props = {}
var inlineProps = vm.$options.propsData
var i = props.length
var prop, path, options, value, raw
while (i--) {
prop = props[i]
raw = prop.raw
path = prop.path
options = prop.options
vm._props[path] = prop
if (inlineProps && hasOwn(inlineProps, path)) {
initProp(vm, prop, inlineProps[path])
} if (raw === null) {
// initialize absent prop
initProp(vm, prop, undefined)
} else if (prop.dynamic) {
// dynamic prop
if (prop.mode === propBindingModes.ONE_TIME) {
// one time binding
value = (scope || vm._context || vm).$get(prop.parentPath)
initProp(vm, prop, value)
} else {
if (vm._context) {
// dynamic binding
vm._bindDir({
name: 'prop',
def: propDef,
prop: prop
}, null, null, scope) // el, host, scope
} else {
// root instance
initProp(vm, prop, vm.$get(prop.parentPath))
}
}
} else if (prop.optimizedLiteral) {
// optimized literal, cast it and just set once
var stripped = stripQuotes(raw)
value = stripped === raw
? toBoolean(toNumber(raw))
: stripped
initProp(vm, prop, value)
} else {
// string literal, but we need to cater for
// Boolean props with no value, or with same
// literal value (e.g. disabled="disabled")
// see path_to_url
value = (
options.type === Boolean &&
(raw === '' || raw === hyphenate(prop.name))
) ? true
: raw
initProp(vm, prop, value)
}
}
}
}
/**
* Process a prop with a rawValue, applying necessary coersions,
* default values & assertions and call the given callback with
* processed value.
*
* @param {Vue} vm
* @param {Object} prop
* @param {*} rawValue
* @param {Function} fn
*/
function processPropValue (vm, prop, rawValue, fn) {
const isSimple = prop.dynamic && isSimplePath(prop.parentPath)
let value = rawValue
if (value === undefined) {
value = getPropDefaultValue(vm, prop)
}
value = coerceProp(prop, value)
const coerced = value !== rawValue
if (!assertProp(prop, value, vm)) {
value = undefined
}
if (isSimple && !coerced) {
withoutConversion(() => {
fn(value)
})
} else {
fn(value)
}
}
/**
* Set a prop's initial value on a vm and its data object.
*
* @param {Vue} vm
* @param {Object} prop
* @param {*} value
*/
export function initProp (vm, prop, value) {
processPropValue(vm, prop, value, value => {
defineReactive(vm, prop.path, value)
})
}
/**
* Update a prop's value on a vm.
*
* @param {Vue} vm
* @param {Object} prop
* @param {*} value
*/
export function updateProp (vm, prop, value) {
processPropValue(vm, prop, value, value => {
vm[prop.path] = value
})
}
/**
* Get the default value of a prop.
*
* @param {Vue} vm
* @param {Object} prop
* @return {*}
*/
function getPropDefaultValue (vm, prop) {
// no default, return undefined
const options = prop.options
if (!hasOwn(options, 'default')) {
// absent boolean value defaults to false
return options.type === Boolean
? false
: undefined
}
var def = options.default
// warn against non-factory defaults for Object & Array
if (isObject(def)) {
process.env.NODE_ENV !== 'production' && warn(
'Invalid default value for prop "' + prop.name + '": ' +
'Props with type Object/Array must use a factory function ' +
'to return the default value.',
vm
)
}
// call factory function for non-Function types
return typeof def === 'function' && options.type !== Function
? def.call(vm)
: def
}
/**
* Assert whether a prop is valid.
*
* @param {Object} prop
* @param {*} value
* @param {Vue} vm
*/
function assertProp (prop, value, vm) {
if (
!prop.options.required && ( // non-required
prop.raw === null || // abscent
value == null // null or undefined
)
) {
return true
}
var options = prop.options
var type = options.type
var valid = !type
var expectedTypes = []
if (type) {
if (!isArray(type)) {
type = [type]
}
for (var i = 0; i < type.length && !valid; i++) {
var assertedType = assertType(value, type[i])
expectedTypes.push(assertedType.expectedType)
valid = assertedType.valid
}
}
if (!valid) {
if (process.env.NODE_ENV !== 'production') {
warn(
'Invalid prop: type check failed for prop "' + prop.name + '".' +
' Expected ' + expectedTypes.map(formatType).join(', ') +
', got ' + formatValue(value) + '.',
vm
)
}
return false
}
var validator = options.validator
if (validator) {
if (!validator(value)) {
process.env.NODE_ENV !== 'production' && warn(
'Invalid prop: custom validator check failed for prop "' + prop.name + '".',
vm
)
return false
}
}
return true
}
/**
* Force parsing value with coerce option.
*
* @param {*} value
* @param {Object} options
* @return {*}
*/
function coerceProp (prop, value) {
var coerce = prop.options.coerce
if (!coerce) {
return value
}
// coerce is a function
return coerce(value)
}
/**
* Assert the type of a value
*
* @param {*} value
* @param {Function} type
* @return {Object}
*/
function assertType (value, type) {
var valid
var expectedType
if (type === String) {
expectedType = 'string'
valid = typeof value === expectedType
} else if (type === Number) {
expectedType = 'number'
valid = typeof value === expectedType
} else if (type === Boolean) {
expectedType = 'boolean'
valid = typeof value === expectedType
} else if (type === Function) {
expectedType = 'function'
valid = typeof value === expectedType
} else if (type === Object) {
expectedType = 'object'
valid = isPlainObject(value)
} else if (type === Array) {
expectedType = 'array'
valid = isArray(value)
} else {
valid = value instanceof type
}
return {
valid,
expectedType
}
}
/**
* Format type for output
*
* @param {String} type
* @return {String}
*/
function formatType (type) {
return type
? type.charAt(0).toUpperCase() + type.slice(1)
: 'custom type'
}
/**
* Format value
*
* @param {*} value
* @return {String}
*/
function formatValue (val) {
return Object.prototype.toString.call(val).slice(8, -1)
}
``` | /content/code_sandbox/public/vendor/vue/src/compiler/compile-props.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,917 |
```javascript
export * from './compile'
export * from './transclude'
export * from './resolve-slots'
``` | /content/code_sandbox/public/vendor/vue/src/compiler/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 22 |
```javascript
import { parseTemplate } from '../parsers/template'
import {
isTemplate,
toArray,
getBindAttr,
warn
} from '../util/index'
/**
* Scan and determine slot content distribution.
* We do this during transclusion instead at compile time so that
* the distribution is decoupled from the compilation order of
* the slots.
*
* @param {Element|DocumentFragment} template
* @param {Element} content
* @param {Vue} vm
*/
export function resolveSlots (vm, content) {
if (!content) {
return
}
var contents = vm._slotContents = Object.create(null)
var el, name
for (var i = 0, l = content.children.length; i < l; i++) {
el = content.children[i]
/* eslint-disable no-cond-assign */
if (name = el.getAttribute('slot')) {
(contents[name] || (contents[name] = [])).push(el)
}
/* eslint-enable no-cond-assign */
if (process.env.NODE_ENV !== 'production' && getBindAttr(el, 'slot')) {
warn('The "slot" attribute must be static.', vm.$parent)
}
}
for (name in contents) {
contents[name] = extractFragment(contents[name], content)
}
if (content.hasChildNodes()) {
const nodes = content.childNodes
if (
nodes.length === 1 &&
nodes[0].nodeType === 3 &&
!nodes[0].data.trim()
) {
return
}
contents['default'] = extractFragment(content.childNodes, content)
}
}
/**
* Extract qualified content nodes from a node list.
*
* @param {NodeList} nodes
* @return {DocumentFragment}
*/
function extractFragment (nodes, parent) {
var frag = document.createDocumentFragment()
nodes = toArray(nodes)
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i]
if (
isTemplate(node) &&
!node.hasAttribute('v-if') &&
!node.hasAttribute('v-for')
) {
parent.removeChild(node)
node = parseTemplate(node, true)
}
frag.appendChild(node)
}
return frag
}
``` | /content/code_sandbox/public/vendor/vue/src/compiler/resolve-slots.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 492 |
```javascript
import publicDirectives from '../directives/public/index'
import internalDirectives from '../directives/internal/index'
import { compileProps } from './compile-props'
import { parseText, tokensToExp } from '../parsers/text'
import { parseDirective } from '../parsers/directive'
import { parseTemplate } from '../parsers/template'
import {
resolveAsset,
toArray,
warn,
remove,
replace,
commonTagRE,
checkComponentAttr,
findRef,
defineReactive,
getAttr
} from '../util/index'
// special binding prefixes
const bindRE = /^v-bind:|^:/
const onRE = /^v-on:|^@/
const dirAttrRE = /^v-([^:]+)(?:$|:(.*)$)/
const modifierRE = /\.[^\.]+/g
const transitionRE = /^(v-bind:|:)?transition$/
// default directive priority
const DEFAULT_PRIORITY = 1000
const DEFAULT_TERMINAL_PRIORITY = 2000
/**
* Compile a template and return a reusable composite link
* function, which recursively contains more link functions
* inside. This top level compile function would normally
* be called on instance root nodes, but can also be used
* for partial compilation if the partial argument is true.
*
* The returned composite link function, when called, will
* return an unlink function that tearsdown all directives
* created during the linking phase.
*
* @param {Element|DocumentFragment} el
* @param {Object} options
* @param {Boolean} partial
* @return {Function}
*/
export function compile (el, options, partial) {
// link function for the node itself.
var nodeLinkFn = partial || !options._asComponent
? compileNode(el, options)
: null
// link function for the childNodes
var childLinkFn =
!(nodeLinkFn && nodeLinkFn.terminal) &&
!isScript(el) &&
el.hasChildNodes()
? compileNodeList(el.childNodes, options)
: null
/**
* A composite linker function to be called on a already
* compiled piece of DOM, which instantiates all directive
* instances.
*
* @param {Vue} vm
* @param {Element|DocumentFragment} el
* @param {Vue} [host] - host vm of transcluded content
* @param {Object} [scope] - v-for scope
* @param {Fragment} [frag] - link context fragment
* @return {Function|undefined}
*/
return function compositeLinkFn (vm, el, host, scope, frag) {
// cache childNodes before linking parent, fix #657
var childNodes = toArray(el.childNodes)
// link
var dirs = linkAndCapture(function compositeLinkCapturer () {
if (nodeLinkFn) nodeLinkFn(vm, el, host, scope, frag)
if (childLinkFn) childLinkFn(vm, childNodes, host, scope, frag)
}, vm)
return makeUnlinkFn(vm, dirs)
}
}
/**
* Apply a linker to a vm/element pair and capture the
* directives created during the process.
*
* @param {Function} linker
* @param {Vue} vm
*/
function linkAndCapture (linker, vm) {
/* istanbul ignore if */
if (process.env.NODE_ENV === 'production') {
// reset directives before every capture in production
// mode, so that when unlinking we don't need to splice
// them out (which turns out to be a perf hit).
// they are kept in development mode because they are
// useful for Vue's own tests.
vm._directives = []
}
var originalDirCount = vm._directives.length
linker()
var dirs = vm._directives.slice(originalDirCount)
dirs.sort(directiveComparator)
for (var i = 0, l = dirs.length; i < l; i++) {
dirs[i]._bind()
}
return dirs
}
/**
* Directive priority sort comparator
*
* @param {Object} a
* @param {Object} b
*/
function directiveComparator (a, b) {
a = a.descriptor.def.priority || DEFAULT_PRIORITY
b = b.descriptor.def.priority || DEFAULT_PRIORITY
return a > b ? -1 : a === b ? 0 : 1
}
/**
* Linker functions return an unlink function that
* tearsdown all directives instances generated during
* the process.
*
* We create unlink functions with only the necessary
* information to avoid retaining additional closures.
*
* @param {Vue} vm
* @param {Array} dirs
* @param {Vue} [context]
* @param {Array} [contextDirs]
* @return {Function}
*/
function makeUnlinkFn (vm, dirs, context, contextDirs) {
function unlink (destroying) {
teardownDirs(vm, dirs, destroying)
if (context && contextDirs) {
teardownDirs(context, contextDirs)
}
}
// expose linked directives
unlink.dirs = dirs
return unlink
}
/**
* Teardown partial linked directives.
*
* @param {Vue} vm
* @param {Array} dirs
* @param {Boolean} destroying
*/
function teardownDirs (vm, dirs, destroying) {
var i = dirs.length
while (i--) {
dirs[i]._teardown()
if (process.env.NODE_ENV !== 'production' && !destroying) {
vm._directives.$remove(dirs[i])
}
}
}
/**
* Compile link props on an instance.
*
* @param {Vue} vm
* @param {Element} el
* @param {Object} props
* @param {Object} [scope]
* @return {Function}
*/
export function compileAndLinkProps (vm, el, props, scope) {
var propsLinkFn = compileProps(el, props, vm)
var propDirs = linkAndCapture(function () {
propsLinkFn(vm, scope)
}, vm)
return makeUnlinkFn(vm, propDirs)
}
/**
* Compile the root element of an instance.
*
* 1. attrs on context container (context scope)
* 2. attrs on the component template root node, if
* replace:true (child scope)
*
* If this is a fragment instance, we only need to compile 1.
*
* @param {Element} el
* @param {Object} options
* @param {Object} contextOptions
* @return {Function}
*/
export function compileRoot (el, options, contextOptions) {
var containerAttrs = options._containerAttrs
var replacerAttrs = options._replacerAttrs
var contextLinkFn, replacerLinkFn
// only need to compile other attributes for
// non-fragment instances
if (el.nodeType !== 11) {
// for components, container and replacer need to be
// compiled separately and linked in different scopes.
if (options._asComponent) {
// 2. container attributes
if (containerAttrs && contextOptions) {
contextLinkFn = compileDirectives(containerAttrs, contextOptions)
}
if (replacerAttrs) {
// 3. replacer attributes
replacerLinkFn = compileDirectives(replacerAttrs, options)
}
} else {
// non-component, just compile as a normal element.
replacerLinkFn = compileDirectives(el.attributes, options)
}
} else if (process.env.NODE_ENV !== 'production' && containerAttrs) {
// warn container directives for fragment instances
var names = containerAttrs
.filter(function (attr) {
// allow vue-loader/vueify scoped css attributes
return attr.name.indexOf('_v-') < 0 &&
// allow event listeners
!onRE.test(attr.name) &&
// allow slots
attr.name !== 'slot'
})
.map(function (attr) {
return '"' + attr.name + '"'
})
if (names.length) {
var plural = names.length > 1
warn(
'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
(plural ? ' are' : ' is') + ' ignored on component ' +
'<' + options.el.tagName.toLowerCase() + '> because ' +
'the component is a fragment instance: ' +
'path_to_url#Fragment-Instance'
)
}
}
options._containerAttrs = options._replacerAttrs = null
return function rootLinkFn (vm, el, scope) {
// link context scope dirs
var context = vm._context
var contextDirs
if (context && contextLinkFn) {
contextDirs = linkAndCapture(function () {
contextLinkFn(context, el, null, scope)
}, context)
}
// link self
var selfDirs = linkAndCapture(function () {
if (replacerLinkFn) replacerLinkFn(vm, el)
}, vm)
// return the unlink function that tearsdown context
// container directives.
return makeUnlinkFn(vm, selfDirs, context, contextDirs)
}
}
/**
* Compile a node and return a nodeLinkFn based on the
* node type.
*
* @param {Node} node
* @param {Object} options
* @return {Function|null}
*/
function compileNode (node, options) {
var type = node.nodeType
if (type === 1 && !isScript(node)) {
return compileElement(node, options)
} else if (type === 3 && node.data.trim()) {
return compileTextNode(node, options)
} else {
return null
}
}
/**
* Compile an element and return a nodeLinkFn.
*
* @param {Element} el
* @param {Object} options
* @return {Function|null}
*/
function compileElement (el, options) {
// preprocess textareas.
// textarea treats its text content as the initial value.
// just bind it as an attr directive for value.
if (el.tagName === 'TEXTAREA') {
var tokens = parseText(el.value)
if (tokens) {
el.setAttribute(':value', tokensToExp(tokens))
el.value = ''
}
}
var linkFn
var hasAttrs = el.hasAttributes()
var attrs = hasAttrs && toArray(el.attributes)
// check terminal directives (for & if)
if (hasAttrs) {
linkFn = checkTerminalDirectives(el, attrs, options)
}
// check element directives
if (!linkFn) {
linkFn = checkElementDirectives(el, options)
}
// check component
if (!linkFn) {
linkFn = checkComponent(el, options)
}
// normal directives
if (!linkFn && hasAttrs) {
linkFn = compileDirectives(attrs, options)
}
return linkFn
}
/**
* Compile a textNode and return a nodeLinkFn.
*
* @param {TextNode} node
* @param {Object} options
* @return {Function|null} textNodeLinkFn
*/
function compileTextNode (node, options) {
// skip marked text nodes
if (node._skip) {
return removeText
}
var tokens = parseText(node.wholeText)
if (!tokens) {
return null
}
// mark adjacent text nodes as skipped,
// because we are using node.wholeText to compile
// all adjacent text nodes together. This fixes
// issues in IE where sometimes it splits up a single
// text node into multiple ones.
var next = node.nextSibling
while (next && next.nodeType === 3) {
next._skip = true
next = next.nextSibling
}
var frag = document.createDocumentFragment()
var el, token
for (var i = 0, l = tokens.length; i < l; i++) {
token = tokens[i]
el = token.tag
? processTextToken(token, options)
: document.createTextNode(token.value)
frag.appendChild(el)
}
return makeTextNodeLinkFn(tokens, frag, options)
}
/**
* Linker for an skipped text node.
*
* @param {Vue} vm
* @param {Text} node
*/
function removeText (vm, node) {
remove(node)
}
/**
* Process a single text token.
*
* @param {Object} token
* @param {Object} options
* @return {Node}
*/
function processTextToken (token, options) {
var el
if (token.oneTime) {
el = document.createTextNode(token.value)
} else {
if (token.html) {
el = document.createComment('v-html')
setTokenType('html')
} else {
// IE will clean up empty textNodes during
// frag.cloneNode(true), so we have to give it
// something here...
el = document.createTextNode(' ')
setTokenType('text')
}
}
function setTokenType (type) {
if (token.descriptor) return
var parsed = parseDirective(token.value)
token.descriptor = {
name: type,
def: publicDirectives[type],
expression: parsed.expression,
filters: parsed.filters
}
}
return el
}
/**
* Build a function that processes a textNode.
*
* @param {Array<Object>} tokens
* @param {DocumentFragment} frag
*/
function makeTextNodeLinkFn (tokens, frag) {
return function textNodeLinkFn (vm, el, host, scope) {
var fragClone = frag.cloneNode(true)
var childNodes = toArray(fragClone.childNodes)
var token, value, node
for (var i = 0, l = tokens.length; i < l; i++) {
token = tokens[i]
value = token.value
if (token.tag) {
node = childNodes[i]
if (token.oneTime) {
value = (scope || vm).$eval(value)
if (token.html) {
replace(node, parseTemplate(value, true))
} else {
node.data = value
}
} else {
vm._bindDir(token.descriptor, node, host, scope)
}
}
}
replace(el, fragClone)
}
}
/**
* Compile a node list and return a childLinkFn.
*
* @param {NodeList} nodeList
* @param {Object} options
* @return {Function|undefined}
*/
function compileNodeList (nodeList, options) {
var linkFns = []
var nodeLinkFn, childLinkFn, node
for (var i = 0, l = nodeList.length; i < l; i++) {
node = nodeList[i]
nodeLinkFn = compileNode(node, options)
childLinkFn =
!(nodeLinkFn && nodeLinkFn.terminal) &&
node.tagName !== 'SCRIPT' &&
node.hasChildNodes()
? compileNodeList(node.childNodes, options)
: null
linkFns.push(nodeLinkFn, childLinkFn)
}
return linkFns.length
? makeChildLinkFn(linkFns)
: null
}
/**
* Make a child link function for a node's childNodes.
*
* @param {Array<Function>} linkFns
* @return {Function} childLinkFn
*/
function makeChildLinkFn (linkFns) {
return function childLinkFn (vm, nodes, host, scope, frag) {
var node, nodeLinkFn, childrenLinkFn
for (var i = 0, n = 0, l = linkFns.length; i < l; n++) {
node = nodes[n]
nodeLinkFn = linkFns[i++]
childrenLinkFn = linkFns[i++]
// cache childNodes before linking parent, fix #657
var childNodes = toArray(node.childNodes)
if (nodeLinkFn) {
nodeLinkFn(vm, node, host, scope, frag)
}
if (childrenLinkFn) {
childrenLinkFn(vm, childNodes, host, scope, frag)
}
}
}
}
/**
* Check for element directives (custom elements that should
* be resovled as terminal directives).
*
* @param {Element} el
* @param {Object} options
*/
function checkElementDirectives (el, options) {
var tag = el.tagName.toLowerCase()
if (commonTagRE.test(tag)) {
return
}
var def = resolveAsset(options, 'elementDirectives', tag)
if (def) {
return makeTerminalNodeLinkFn(el, tag, '', options, def)
}
}
/**
* Check if an element is a component. If yes, return
* a component link function.
*
* @param {Element} el
* @param {Object} options
* @return {Function|undefined}
*/
function checkComponent (el, options) {
var component = checkComponentAttr(el, options)
if (component) {
var ref = findRef(el)
var descriptor = {
name: 'component',
ref: ref,
expression: component.id,
def: internalDirectives.component,
modifiers: {
literal: !component.dynamic
}
}
var componentLinkFn = function (vm, el, host, scope, frag) {
if (ref) {
defineReactive((scope || vm).$refs, ref, null)
}
vm._bindDir(descriptor, el, host, scope, frag)
}
componentLinkFn.terminal = true
return componentLinkFn
}
}
/**
* Check an element for terminal directives in fixed order.
* If it finds one, return a terminal link function.
*
* @param {Element} el
* @param {Array} attrs
* @param {Object} options
* @return {Function} terminalLinkFn
*/
function checkTerminalDirectives (el, attrs, options) {
// skip v-pre
if (getAttr(el, 'v-pre') !== null) {
return skip
}
// skip v-else block, but only if following v-if
if (el.hasAttribute('v-else')) {
var prev = el.previousElementSibling
if (prev && prev.hasAttribute('v-if')) {
return skip
}
}
var attr, name, value, modifiers, matched, dirName, rawName, arg, def, termDef
for (var i = 0, j = attrs.length; i < j; i++) {
attr = attrs[i]
name = attr.name.replace(modifierRE, '')
if ((matched = name.match(dirAttrRE))) {
def = resolveAsset(options, 'directives', matched[1])
if (def && def.terminal) {
if (!termDef || ((def.priority || DEFAULT_TERMINAL_PRIORITY) > termDef.priority)) {
termDef = def
rawName = attr.name
modifiers = parseModifiers(attr.name)
value = attr.value
dirName = matched[1]
arg = matched[2]
}
}
}
}
if (termDef) {
return makeTerminalNodeLinkFn(el, dirName, value, options, termDef, rawName, arg, modifiers)
}
}
function skip () {}
skip.terminal = true
/**
* Build a node link function for a terminal directive.
* A terminal link function terminates the current
* compilation recursion and handles compilation of the
* subtree in the directive.
*
* @param {Element} el
* @param {String} dirName
* @param {String} value
* @param {Object} options
* @param {Object} def
* @param {String} [rawName]
* @param {String} [arg]
* @param {Object} [modifiers]
* @return {Function} terminalLinkFn
*/
function makeTerminalNodeLinkFn (el, dirName, value, options, def, rawName, arg, modifiers) {
var parsed = parseDirective(value)
var descriptor = {
name: dirName,
arg: arg,
expression: parsed.expression,
filters: parsed.filters,
raw: value,
attr: rawName,
modifiers: modifiers,
def: def
}
// check ref for v-for and router-view
if (dirName === 'for' || dirName === 'router-view') {
descriptor.ref = findRef(el)
}
var fn = function terminalNodeLinkFn (vm, el, host, scope, frag) {
if (descriptor.ref) {
defineReactive((scope || vm).$refs, descriptor.ref, null)
}
vm._bindDir(descriptor, el, host, scope, frag)
}
fn.terminal = true
return fn
}
/**
* Compile the directives on an element and return a linker.
*
* @param {Array|NamedNodeMap} attrs
* @param {Object} options
* @return {Function}
*/
function compileDirectives (attrs, options) {
var i = attrs.length
var dirs = []
var attr, name, value, rawName, rawValue, dirName, arg, modifiers, dirDef, tokens, matched
while (i--) {
attr = attrs[i]
name = rawName = attr.name
value = rawValue = attr.value
tokens = parseText(value)
// reset arg
arg = null
// check modifiers
modifiers = parseModifiers(name)
name = name.replace(modifierRE, '')
// attribute interpolations
if (tokens) {
value = tokensToExp(tokens)
arg = name
pushDir('bind', publicDirectives.bind, tokens)
// warn against mixing mustaches with v-bind
if (process.env.NODE_ENV !== 'production') {
if (name === 'class' && Array.prototype.some.call(attrs, function (attr) {
return attr.name === ':class' || attr.name === 'v-bind:class'
})) {
warn(
'class="' + rawValue + '": Do not mix mustache interpolation ' +
'and v-bind for "class" on the same element. Use one or the other.',
options
)
}
}
} else
// special attribute: transition
if (transitionRE.test(name)) {
modifiers.literal = !bindRE.test(name)
pushDir('transition', internalDirectives.transition)
} else
// event handlers
if (onRE.test(name)) {
arg = name.replace(onRE, '')
pushDir('on', publicDirectives.on)
} else
// attribute bindings
if (bindRE.test(name)) {
dirName = name.replace(bindRE, '')
if (dirName === 'style' || dirName === 'class') {
pushDir(dirName, internalDirectives[dirName])
} else {
arg = dirName
pushDir('bind', publicDirectives.bind)
}
} else
// normal directives
if ((matched = name.match(dirAttrRE))) {
dirName = matched[1]
arg = matched[2]
// skip v-else (when used with v-show)
if (dirName === 'else') {
continue
}
dirDef = resolveAsset(options, 'directives', dirName, true)
if (dirDef) {
pushDir(dirName, dirDef)
}
}
}
/**
* Push a directive.
*
* @param {String} dirName
* @param {Object|Function} def
* @param {Array} [interpTokens]
*/
function pushDir (dirName, def, interpTokens) {
var hasOneTimeToken = interpTokens && hasOneTime(interpTokens)
var parsed = !hasOneTimeToken && parseDirective(value)
dirs.push({
name: dirName,
attr: rawName,
raw: rawValue,
def: def,
arg: arg,
modifiers: modifiers,
// conversion from interpolation strings with one-time token
// to expression is differed until directive bind time so that we
// have access to the actual vm context for one-time bindings.
expression: parsed && parsed.expression,
filters: parsed && parsed.filters,
interp: interpTokens,
hasOneTime: hasOneTimeToken
})
}
if (dirs.length) {
return makeNodeLinkFn(dirs)
}
}
/**
* Parse modifiers from directive attribute name.
*
* @param {String} name
* @return {Object}
*/
function parseModifiers (name) {
var res = Object.create(null)
var match = name.match(modifierRE)
if (match) {
var i = match.length
while (i--) {
res[match[i].slice(1)] = true
}
}
return res
}
/**
* Build a link function for all directives on a single node.
*
* @param {Array} directives
* @return {Function} directivesLinkFn
*/
function makeNodeLinkFn (directives) {
return function nodeLinkFn (vm, el, host, scope, frag) {
// reverse apply because it's sorted low to high
var i = directives.length
while (i--) {
vm._bindDir(directives[i], el, host, scope, frag)
}
}
}
/**
* Check if an interpolation string contains one-time tokens.
*
* @param {Array} tokens
* @return {Boolean}
*/
function hasOneTime (tokens) {
var i = tokens.length
while (i--) {
if (tokens[i].oneTime) return true
}
}
function isScript (el) {
return el.tagName === 'SCRIPT' && (
!el.hasAttribute('type') ||
el.getAttribute('type') === 'text/javascript'
)
}
``` | /content/code_sandbox/public/vendor/vue/src/compiler/compile.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 5,615 |
```javascript
import { parseText } from '../parsers/text'
import { parseTemplate } from '../parsers/template'
import {
warn,
isTemplate,
isFragment,
prepend,
extractContent,
createAnchor,
resolveAsset,
toArray,
addClass,
hasBindAttr
} from '../util/index'
const specialCharRE = /[^\w\-:\.]/
/**
* Process an element or a DocumentFragment based on a
* instance option object. This allows us to transclude
* a template node/fragment before the instance is created,
* so the processed fragment can then be cloned and reused
* in v-for.
*
* @param {Element} el
* @param {Object} options
* @return {Element|DocumentFragment}
*/
export function transclude (el, options) {
// extract container attributes to pass them down
// to compiler, because they need to be compiled in
// parent scope. we are mutating the options object here
// assuming the same object will be used for compile
// right after this.
if (options) {
options._containerAttrs = extractAttrs(el)
}
// for template tags, what we want is its content as
// a documentFragment (for fragment instances)
if (isTemplate(el)) {
el = parseTemplate(el)
}
if (options) {
if (options._asComponent && !options.template) {
options.template = '<slot></slot>'
}
if (options.template) {
options._content = extractContent(el)
el = transcludeTemplate(el, options)
}
}
if (isFragment(el)) {
// anchors for fragment instance
// passing in `persist: true` to avoid them being
// discarded by IE during template cloning
prepend(createAnchor('v-start', true), el)
el.appendChild(createAnchor('v-end', true))
}
return el
}
/**
* Process the template option.
* If the replace option is true this will swap the $el.
*
* @param {Element} el
* @param {Object} options
* @return {Element|DocumentFragment}
*/
function transcludeTemplate (el, options) {
var template = options.template
var frag = parseTemplate(template, true)
if (frag) {
var replacer = frag.firstChild
var tag = replacer.tagName && replacer.tagName.toLowerCase()
if (options.replace) {
/* istanbul ignore if */
if (el === document.body) {
process.env.NODE_ENV !== 'production' && warn(
'You are mounting an instance with a template to ' +
'<body>. This will replace <body> entirely. You ' +
'should probably use `replace: false` here.'
)
}
// there are many cases where the instance must
// become a fragment instance: basically anything that
// can create more than 1 root nodes.
if (
// multi-children template
frag.childNodes.length > 1 ||
// non-element template
replacer.nodeType !== 1 ||
// single nested component
tag === 'component' ||
resolveAsset(options, 'components', tag) ||
hasBindAttr(replacer, 'is') ||
// element directive
resolveAsset(options, 'elementDirectives', tag) ||
// for block
replacer.hasAttribute('v-for') ||
// if block
replacer.hasAttribute('v-if')
) {
return frag
} else {
options._replacerAttrs = extractAttrs(replacer)
mergeAttrs(el, replacer)
return replacer
}
} else {
el.appendChild(frag)
return el
}
} else {
process.env.NODE_ENV !== 'production' && warn(
'Invalid template option: ' + template
)
}
}
/**
* Helper to extract a component container's attributes
* into a plain object array.
*
* @param {Element} el
* @return {Array}
*/
function extractAttrs (el) {
if (el.nodeType === 1 && el.hasAttributes()) {
return toArray(el.attributes)
}
}
/**
* Merge the attributes of two elements, and make sure
* the class names are merged properly.
*
* @param {Element} from
* @param {Element} to
*/
function mergeAttrs (from, to) {
var attrs = from.attributes
var i = attrs.length
var name, value
while (i--) {
name = attrs[i].name
value = attrs[i].value
if (!to.hasAttribute(name) && !specialCharRE.test(name)) {
to.setAttribute(name, value)
} else if (name === 'class' && !parseText(value) && (value = value.trim())) {
value.split(/\s+/).forEach(function (cls) {
addClass(to, cls)
})
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/compiler/transclude.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,054 |
```javascript
import { toNumber, stripQuotes } from '../util/index'
import Cache from '../cache'
const cache = new Cache(1000)
const filterTokenRE = /[^\s'"]+|'[^']*'|"[^"]*"/g
const reservedArgRE = /^in$|^-?\d+/
/**
* Parser state
*/
var str, dir
var c, prev, i, l, lastFilterIndex
var inSingle, inDouble, curly, square, paren
/**
* Push a filter to the current directive object
*/
function pushFilter () {
var exp = str.slice(lastFilterIndex, i).trim()
var filter
if (exp) {
filter = {}
var tokens = exp.match(filterTokenRE)
filter.name = tokens[0]
if (tokens.length > 1) {
filter.args = tokens.slice(1).map(processFilterArg)
}
}
if (filter) {
(dir.filters = dir.filters || []).push(filter)
}
lastFilterIndex = i + 1
}
/**
* Check if an argument is dynamic and strip quotes.
*
* @param {String} arg
* @return {Object}
*/
function processFilterArg (arg) {
if (reservedArgRE.test(arg)) {
return {
value: toNumber(arg),
dynamic: false
}
} else {
var stripped = stripQuotes(arg)
var dynamic = stripped === arg
return {
value: dynamic ? arg : stripped,
dynamic: dynamic
}
}
}
/**
* Parse a directive value and extract the expression
* and its filters into a descriptor.
*
* Example:
*
* "a + 1 | uppercase" will yield:
* {
* expression: 'a + 1',
* filters: [
* { name: 'uppercase', args: null }
* ]
* }
*
* @param {String} s
* @return {Object}
*/
export function parseDirective (s) {
var hit = cache.get(s)
if (hit) {
return hit
}
// reset parser state
str = s
inSingle = inDouble = false
curly = square = paren = 0
lastFilterIndex = 0
dir = {}
for (i = 0, l = str.length; i < l; i++) {
prev = c
c = str.charCodeAt(i)
if (inSingle) {
// check single quote
if (c === 0x27 && prev !== 0x5C) inSingle = !inSingle
} else if (inDouble) {
// check double quote
if (c === 0x22 && prev !== 0x5C) inDouble = !inDouble
} else if (
c === 0x7C && // pipe
str.charCodeAt(i + 1) !== 0x7C &&
str.charCodeAt(i - 1) !== 0x7C
) {
if (dir.expression == null) {
// first filter, end of expression
lastFilterIndex = i + 1
dir.expression = str.slice(0, i).trim()
} else {
// already has filter
pushFilter()
}
} else {
switch (c) {
case 0x22: inDouble = true; break // "
case 0x27: inSingle = true; break // '
case 0x28: paren++; break // (
case 0x29: paren--; break // )
case 0x5B: square++; break // [
case 0x5D: square--; break // ]
case 0x7B: curly++; break // {
case 0x7D: curly--; break // }
}
}
}
if (dir.expression == null) {
dir.expression = str.slice(0, i).trim()
} else if (lastFilterIndex !== 0) {
pushFilter()
}
cache.put(s, dir)
return dir
}
``` | /content/code_sandbox/public/vendor/vue/src/parsers/directive.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 884 |
```javascript
import { parseExpression } from './expression'
import {
isLiteral,
stripQuotes,
isObject,
isArray,
warn,
set
} from '../util/index'
import Cache from '../cache'
var pathCache = new Cache(1000)
// actions
var APPEND = 0
var PUSH = 1
var INC_SUB_PATH_DEPTH = 2
var PUSH_SUB_PATH = 3
// states
var BEFORE_PATH = 0
var IN_PATH = 1
var BEFORE_IDENT = 2
var IN_IDENT = 3
var IN_SUB_PATH = 4
var IN_SINGLE_QUOTE = 5
var IN_DOUBLE_QUOTE = 6
var AFTER_PATH = 7
var ERROR = 8
var pathStateMachine = []
pathStateMachine[BEFORE_PATH] = {
'ws': [BEFORE_PATH],
'ident': [IN_IDENT, APPEND],
'[': [IN_SUB_PATH],
'eof': [AFTER_PATH]
}
pathStateMachine[IN_PATH] = {
'ws': [IN_PATH],
'.': [BEFORE_IDENT],
'[': [IN_SUB_PATH],
'eof': [AFTER_PATH]
}
pathStateMachine[BEFORE_IDENT] = {
'ws': [BEFORE_IDENT],
'ident': [IN_IDENT, APPEND]
}
pathStateMachine[IN_IDENT] = {
'ident': [IN_IDENT, APPEND],
'0': [IN_IDENT, APPEND],
'number': [IN_IDENT, APPEND],
'ws': [IN_PATH, PUSH],
'.': [BEFORE_IDENT, PUSH],
'[': [IN_SUB_PATH, PUSH],
'eof': [AFTER_PATH, PUSH]
}
pathStateMachine[IN_SUB_PATH] = {
"'": [IN_SINGLE_QUOTE, APPEND],
'"': [IN_DOUBLE_QUOTE, APPEND],
'[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],
']': [IN_PATH, PUSH_SUB_PATH],
'eof': ERROR,
'else': [IN_SUB_PATH, APPEND]
}
pathStateMachine[IN_SINGLE_QUOTE] = {
"'": [IN_SUB_PATH, APPEND],
'eof': ERROR,
'else': [IN_SINGLE_QUOTE, APPEND]
}
pathStateMachine[IN_DOUBLE_QUOTE] = {
'"': [IN_SUB_PATH, APPEND],
'eof': ERROR,
'else': [IN_DOUBLE_QUOTE, APPEND]
}
/**
* Determine the type of a character in a keypath.
*
* @param {Char} ch
* @return {String} type
*/
function getPathCharType (ch) {
if (ch === undefined) {
return 'eof'
}
var code = ch.charCodeAt(0)
switch (code) {
case 0x5B: // [
case 0x5D: // ]
case 0x2E: // .
case 0x22: // "
case 0x27: // '
case 0x30: // 0
return ch
case 0x5F: // _
case 0x24: // $
return 'ident'
case 0x20: // Space
case 0x09: // Tab
case 0x0A: // Newline
case 0x0D: // Return
case 0xA0: // No-break space
case 0xFEFF: // Byte Order Mark
case 0x2028: // Line Separator
case 0x2029: // Paragraph Separator
return 'ws'
}
// a-z, A-Z
if (
(code >= 0x61 && code <= 0x7A) ||
(code >= 0x41 && code <= 0x5A)
) {
return 'ident'
}
// 1-9
if (code >= 0x31 && code <= 0x39) {
return 'number'
}
return 'else'
}
/**
* Format a subPath, return its plain form if it is
* a literal string or number. Otherwise prepend the
* dynamic indicator (*).
*
* @param {String} path
* @return {String}
*/
function formatSubPath (path) {
var trimmed = path.trim()
// invalid leading 0
if (path.charAt(0) === '0' && isNaN(path)) {
return false
}
return isLiteral(trimmed)
? stripQuotes(trimmed)
: '*' + trimmed
}
/**
* Parse a string path into an array of segments
*
* @param {String} path
* @return {Array|undefined}
*/
function parse (path) {
var keys = []
var index = -1
var mode = BEFORE_PATH
var subPathDepth = 0
var c, newChar, key, type, transition, action, typeMap
var actions = []
actions[PUSH] = function () {
if (key !== undefined) {
keys.push(key)
key = undefined
}
}
actions[APPEND] = function () {
if (key === undefined) {
key = newChar
} else {
key += newChar
}
}
actions[INC_SUB_PATH_DEPTH] = function () {
actions[APPEND]()
subPathDepth++
}
actions[PUSH_SUB_PATH] = function () {
if (subPathDepth > 0) {
subPathDepth--
mode = IN_SUB_PATH
actions[APPEND]()
} else {
subPathDepth = 0
key = formatSubPath(key)
if (key === false) {
return false
} else {
actions[PUSH]()
}
}
}
function maybeUnescapeQuote () {
var nextChar = path[index + 1]
if ((mode === IN_SINGLE_QUOTE && nextChar === "'") ||
(mode === IN_DOUBLE_QUOTE && nextChar === '"')) {
index++
newChar = '\\' + nextChar
actions[APPEND]()
return true
}
}
while (mode != null) {
index++
c = path[index]
if (c === '\\' && maybeUnescapeQuote()) {
continue
}
type = getPathCharType(c)
typeMap = pathStateMachine[mode]
transition = typeMap[type] || typeMap['else'] || ERROR
if (transition === ERROR) {
return // parse error
}
mode = transition[0]
action = actions[transition[1]]
if (action) {
newChar = transition[2]
newChar = newChar === undefined
? c
: newChar
if (action() === false) {
return
}
}
if (mode === AFTER_PATH) {
keys.raw = path
return keys
}
}
}
/**
* External parse that check for a cache hit first
*
* @param {String} path
* @return {Array|undefined}
*/
export function parsePath (path) {
var hit = pathCache.get(path)
if (!hit) {
hit = parse(path)
if (hit) {
pathCache.put(path, hit)
}
}
return hit
}
/**
* Get from an object from a path string
*
* @param {Object} obj
* @param {String} path
*/
export function getPath (obj, path) {
return parseExpression(path).get(obj)
}
/**
* Warn against setting non-existent root path on a vm.
*/
var warnNonExistent
if (process.env.NODE_ENV !== 'production') {
warnNonExistent = function (path, vm) {
warn(
'You are setting a non-existent path "' + path.raw + '" ' +
'on a vm instance. Consider pre-initializing the property ' +
'with the "data" option for more reliable reactivity ' +
'and better performance.',
vm
)
}
}
/**
* Set on an object from a path
*
* @param {Object} obj
* @param {String | Array} path
* @param {*} val
*/
export function setPath (obj, path, val) {
var original = obj
if (typeof path === 'string') {
path = parse(path)
}
if (!path || !isObject(obj)) {
return false
}
var last, key
for (var i = 0, l = path.length; i < l; i++) {
last = obj
key = path[i]
if (key.charAt(0) === '*') {
key = parseExpression(key.slice(1)).get.call(original, original)
}
if (i < l - 1) {
obj = obj[key]
if (!isObject(obj)) {
obj = {}
if (process.env.NODE_ENV !== 'production' && last._isVue) {
warnNonExistent(path, last)
}
set(last, key, obj)
}
} else {
if (isArray(obj)) {
obj.$set(key, val)
} else if (key in obj) {
obj[key] = val
} else {
if (process.env.NODE_ENV !== 'production' && obj._isVue) {
warnNonExistent(path, obj)
}
set(obj, key, val)
}
}
}
return true
}
``` | /content/code_sandbox/public/vendor/vue/src/parsers/path.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,053 |
```javascript
import { warn } from '../util/index'
import { parsePath, setPath } from './path'
import Cache from '../cache'
const expressionCache = new Cache(1000)
const allowedKeywords =
'Math,Date,this,true,false,null,undefined,Infinity,NaN,' +
'isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,' +
'encodeURIComponent,parseInt,parseFloat'
const allowedKeywordsRE =
new RegExp('^(' + allowedKeywords.replace(/,/g, '\\b|') + '\\b)')
// keywords that don't make sense inside expressions
const improperKeywords =
'break,case,class,catch,const,continue,debugger,default,' +
'delete,do,else,export,extends,finally,for,function,if,' +
'import,in,instanceof,let,return,super,switch,throw,try,' +
'var,while,with,yield,enum,await,implements,package,' +
'protected,static,interface,private,public'
const improperKeywordsRE =
new RegExp('^(' + improperKeywords.replace(/,/g, '\\b|') + '\\b)')
const wsRE = /\s/g
const newlineRE = /\n/g
const saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g
const restoreRE = /"(\d+)"/g
const pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/
const identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g
const booleanLiteralRE = /^(?:true|false)$/
/**
* Save / Rewrite / Restore
*
* When rewriting paths found in an expression, it is
* possible for the same letter sequences to be found in
* strings and Object literal property keys. Therefore we
* remove and store these parts in a temporary array, and
* restore them after the path rewrite.
*/
var saved = []
/**
* Save replacer
*
* The save regex can match two possible cases:
* 1. An opening object literal
* 2. A string
* If matched as a plain string, we need to escape its
* newlines, since the string needs to be preserved when
* generating the function body.
*
* @param {String} str
* @param {String} isString - str if matched as a string
* @return {String} - placeholder with index
*/
function save (str, isString) {
var i = saved.length
saved[i] = isString
? str.replace(newlineRE, '\\n')
: str
return '"' + i + '"'
}
/**
* Path rewrite replacer
*
* @param {String} raw
* @return {String}
*/
function rewrite (raw) {
var c = raw.charAt(0)
var path = raw.slice(1)
if (allowedKeywordsRE.test(path)) {
return raw
} else {
path = path.indexOf('"') > -1
? path.replace(restoreRE, restore)
: path
return c + 'scope.' + path
}
}
/**
* Restore replacer
*
* @param {String} str
* @param {String} i - matched save index
* @return {String}
*/
function restore (str, i) {
return saved[i]
}
/**
* Rewrite an expression, prefixing all path accessors with
* `scope.` and generate getter/setter functions.
*
* @param {String} exp
* @return {Function}
*/
function compileGetter (exp) {
if (improperKeywordsRE.test(exp)) {
process.env.NODE_ENV !== 'production' && warn(
'Avoid using reserved keywords in expression: ' + exp
)
}
// reset state
saved.length = 0
// save strings and object literal keys
var body = exp
.replace(saveRE, save)
.replace(wsRE, '')
// rewrite all paths
// pad 1 space here becaue the regex matches 1 extra char
body = (' ' + body)
.replace(identRE, rewrite)
.replace(restoreRE, restore)
return makeGetterFn(body)
}
/**
* Build a getter function. Requires eval.
*
* We isolate the try/catch so it doesn't affect the
* optimization of the parse function when it is not called.
*
* @param {String} body
* @return {Function|undefined}
*/
function makeGetterFn (body) {
try {
/* eslint-disable no-new-func */
return new Function('scope', 'return ' + body + ';')
/* eslint-enable no-new-func */
} catch (e) {
process.env.NODE_ENV !== 'production' && warn(
'Invalid expression. ' +
'Generated function body: ' + body
)
}
}
/**
* Compile a setter function for the expression.
*
* @param {String} exp
* @return {Function|undefined}
*/
function compileSetter (exp) {
var path = parsePath(exp)
if (path) {
return function (scope, val) {
setPath(scope, path, val)
}
} else {
process.env.NODE_ENV !== 'production' && warn(
'Invalid setter expression: ' + exp
)
}
}
/**
* Parse an expression into re-written getter/setters.
*
* @param {String} exp
* @param {Boolean} needSet
* @return {Function}
*/
export function parseExpression (exp, needSet) {
exp = exp.trim()
// try cache
var hit = expressionCache.get(exp)
if (hit) {
if (needSet && !hit.set) {
hit.set = compileSetter(hit.exp)
}
return hit
}
var res = { exp: exp }
res.get = isSimplePath(exp) && exp.indexOf('[') < 0
// optimized super simple getter
? makeGetterFn('scope.' + exp)
// dynamic getter
: compileGetter(exp)
if (needSet) {
res.set = compileSetter(exp)
}
expressionCache.put(exp, res)
return res
}
/**
* Check if an expression is a simple path.
*
* @param {String} exp
* @return {Boolean}
*/
export function isSimplePath (exp) {
return pathTestRE.test(exp) &&
// don't treat true/false as paths
!booleanLiteralRE.test(exp) &&
// Math constants e.g. Math.PI, Math.E etc.
exp.slice(0, 5) !== 'Math.'
}
``` | /content/code_sandbox/public/vendor/vue/src/parsers/expression.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,519 |
```javascript
import Cache from '../cache'
import {
inBrowser,
trimNode,
isTemplate,
isFragment
} from '../util/index'
const templateCache = new Cache(1000)
const idSelectorCache = new Cache(1000)
const map = {
efault: [0, '', ''],
legend: [1, '<fieldset>', '</fieldset>'],
tr: [2, '<table><tbody>', '</tbody></table>'],
col: [
2,
'<table><tbody></tbody><colgroup>',
'</colgroup></table>'
]
}
map.td =
map.th = [
3,
'<table><tbody><tr>',
'</tr></tbody></table>'
]
map.option =
map.optgroup = [
1,
'<select multiple="multiple">',
'</select>'
]
map.thead =
map.tbody =
map.colgroup =
map.caption =
map.tfoot = [1, '<table>', '</table>']
map.g =
map.defs =
map.symbol =
map.use =
map.image =
map.text =
map.circle =
map.ellipse =
map.line =
map.path =
map.polygon =
map.polyline =
map.rect = [
1,
'<svg ' +
'xmlns="path_to_url" ' +
'xmlns:xlink="path_to_url" ' +
'xmlns:ev="path_to_url"' +
'version="1.1">',
'</svg>'
]
/**
* Check if a node is a supported template node with a
* DocumentFragment content.
*
* @param {Node} node
* @return {Boolean}
*/
function isRealTemplate (node) {
return isTemplate(node) && isFragment(node.content)
}
const tagRE = /<([\w:-]+)/
const entityRE = /&#?\w+?;/
/**
* Convert a string template to a DocumentFragment.
* Determines correct wrapping by tag types. Wrapping
* strategy found in jQuery & component/domify.
*
* @param {String} templateString
* @param {Boolean} raw
* @return {DocumentFragment}
*/
function stringToFragment (templateString, raw) {
// try a cache hit first
var cacheKey = raw
? templateString
: templateString.trim()
var hit = templateCache.get(cacheKey)
if (hit) {
return hit
}
var frag = document.createDocumentFragment()
var tagMatch = templateString.match(tagRE)
var entityMatch = entityRE.test(templateString)
if (!tagMatch && !entityMatch) {
// text only, return a single text node.
frag.appendChild(
document.createTextNode(templateString)
)
} else {
var tag = tagMatch && tagMatch[1]
var wrap = map[tag] || map.efault
var depth = wrap[0]
var prefix = wrap[1]
var suffix = wrap[2]
var node = document.createElement('div')
node.innerHTML = prefix + templateString + suffix
while (depth--) {
node = node.lastChild
}
var child
/* eslint-disable no-cond-assign */
while (child = node.firstChild) {
/* eslint-enable no-cond-assign */
frag.appendChild(child)
}
}
if (!raw) {
trimNode(frag)
}
templateCache.put(cacheKey, frag)
return frag
}
/**
* Convert a template node to a DocumentFragment.
*
* @param {Node} node
* @return {DocumentFragment}
*/
function nodeToFragment (node) {
// if its a template tag and the browser supports it,
// its content is already a document fragment. However, iOS Safari has
// bug when using directly cloned template content with touch
// events and can cause crashes when the nodes are removed from DOM, so we
// have to treat template elements as string templates. (#2805)
/* istanbul ignore if */
if (isRealTemplate(node)) {
return stringToFragment(node.innerHTML)
}
// script template
if (node.tagName === 'SCRIPT') {
return stringToFragment(node.textContent)
}
// normal node, clone it to avoid mutating the original
var clonedNode = cloneNode(node)
var frag = document.createDocumentFragment()
var child
/* eslint-disable no-cond-assign */
while (child = clonedNode.firstChild) {
/* eslint-enable no-cond-assign */
frag.appendChild(child)
}
trimNode(frag)
return frag
}
// Test for the presence of the Safari template cloning bug
// path_to_url
var hasBrokenTemplate = (function () {
/* istanbul ignore else */
if (inBrowser) {
var a = document.createElement('div')
a.innerHTML = '<template>1</template>'
return !a.cloneNode(true).firstChild.innerHTML
} else {
return false
}
})()
// Test for IE10/11 textarea placeholder clone bug
var hasTextareaCloneBug = (function () {
/* istanbul ignore else */
if (inBrowser) {
var t = document.createElement('textarea')
t.placeholder = 't'
return t.cloneNode(true).value === 't'
} else {
return false
}
})()
/**
* 1. Deal with Safari cloning nested <template> bug by
* manually cloning all template instances.
* 2. Deal with IE10/11 textarea placeholder bug by setting
* the correct value after cloning.
*
* @param {Element|DocumentFragment} node
* @return {Element|DocumentFragment}
*/
export function cloneNode (node) {
/* istanbul ignore if */
if (!node.querySelectorAll) {
return node.cloneNode()
}
var res = node.cloneNode(true)
var i, original, cloned
/* istanbul ignore if */
if (hasBrokenTemplate) {
var tempClone = res
if (isRealTemplate(node)) {
node = node.content
tempClone = res.content
}
original = node.querySelectorAll('template')
if (original.length) {
cloned = tempClone.querySelectorAll('template')
i = cloned.length
while (i--) {
cloned[i].parentNode.replaceChild(
cloneNode(original[i]),
cloned[i]
)
}
}
}
/* istanbul ignore if */
if (hasTextareaCloneBug) {
if (node.tagName === 'TEXTAREA') {
res.value = node.value
} else {
original = node.querySelectorAll('textarea')
if (original.length) {
cloned = res.querySelectorAll('textarea')
i = cloned.length
while (i--) {
cloned[i].value = original[i].value
}
}
}
}
return res
}
/**
* Process the template option and normalizes it into a
* a DocumentFragment that can be used as a partial or a
* instance template.
*
* @param {*} template
* Possible values include:
* - DocumentFragment object
* - Node object of type Template
* - id selector: '#some-template-id'
* - template string: '<div><span>{{msg}}</span></div>'
* @param {Boolean} shouldClone
* @param {Boolean} raw
* inline HTML interpolation. Do not check for id
* selector and keep whitespace in the string.
* @return {DocumentFragment|undefined}
*/
export function parseTemplate (template, shouldClone, raw) {
var node, frag
// if the template is already a document fragment,
// do nothing
if (isFragment(template)) {
trimNode(template)
return shouldClone
? cloneNode(template)
: template
}
if (typeof template === 'string') {
// id selector
if (!raw && template.charAt(0) === '#') {
// id selector can be cached too
frag = idSelectorCache.get(template)
if (!frag) {
node = document.getElementById(template.slice(1))
if (node) {
frag = nodeToFragment(node)
// save selector to cache
idSelectorCache.put(template, frag)
}
}
} else {
// normal string template
frag = stringToFragment(template, raw)
}
} else if (template.nodeType) {
// a direct node
frag = nodeToFragment(template)
}
return frag && shouldClone
? cloneNode(frag)
: frag
}
``` | /content/code_sandbox/public/vendor/vue/src/parsers/template.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,817 |
```javascript
import Cache from '../cache'
import config from '../config'
import { parseDirective } from '../parsers/directive'
const regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g
let cache, tagRE, htmlRE
/**
* Escape a string so it can be used in a RegExp
* constructor.
*
* @param {String} str
*/
function escapeRegex (str) {
return str.replace(regexEscapeRE, '\\$&')
}
export function compileRegex () {
var open = escapeRegex(config.delimiters[0])
var close = escapeRegex(config.delimiters[1])
var unsafeOpen = escapeRegex(config.unsafeDelimiters[0])
var unsafeClose = escapeRegex(config.unsafeDelimiters[1])
tagRE = new RegExp(
unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '|' +
open + '((?:.|\\n)+?)' + close,
'g'
)
htmlRE = new RegExp(
'^' + unsafeOpen + '.*' + unsafeClose + '$'
)
// reset cache
cache = new Cache(1000)
}
/**
* Parse a template text string into an array of tokens.
*
* @param {String} text
* @return {Array<Object> | null}
* - {String} type
* - {String} value
* - {Boolean} [html]
* - {Boolean} [oneTime]
*/
export function parseText (text) {
if (!cache) {
compileRegex()
}
var hit = cache.get(text)
if (hit) {
return hit
}
if (!tagRE.test(text)) {
return null
}
var tokens = []
var lastIndex = tagRE.lastIndex = 0
var match, index, html, value, first, oneTime
/* eslint-disable no-cond-assign */
while (match = tagRE.exec(text)) {
/* eslint-enable no-cond-assign */
index = match.index
// push text token
if (index > lastIndex) {
tokens.push({
value: text.slice(lastIndex, index)
})
}
// tag token
html = htmlRE.test(match[0])
value = html ? match[1] : match[2]
first = value.charCodeAt(0)
oneTime = first === 42 // *
value = oneTime
? value.slice(1)
: value
tokens.push({
tag: true,
value: value.trim(),
html: html,
oneTime: oneTime
})
lastIndex = index + match[0].length
}
if (lastIndex < text.length) {
tokens.push({
value: text.slice(lastIndex)
})
}
cache.put(text, tokens)
return tokens
}
/**
* Format a list of tokens into an expression.
* e.g. tokens parsed from 'a {{b}} c' can be serialized
* into one single expression as '"a " + b + " c"'.
*
* @param {Array} tokens
* @param {Vue} [vm]
* @return {String}
*/
export function tokensToExp (tokens, vm) {
if (tokens.length > 1) {
return tokens.map(function (token) {
return formatToken(token, vm)
}).join('+')
} else {
return formatToken(tokens[0], vm, true)
}
}
/**
* Format a single token.
*
* @param {Object} token
* @param {Vue} [vm]
* @param {Boolean} [single]
* @return {String}
*/
function formatToken (token, vm, single) {
return token.tag
? token.oneTime && vm
? '"' + vm.$eval(token.value) + '"'
: inlineFilters(token.value, single)
: '"' + token.value + '"'
}
/**
* For an attribute with multiple interpolation tags,
* e.g. attr="some-{{thing | filter}}", in order to combine
* the whole thing into a single watchable expression, we
* have to inline those filters. This function does exactly
* that. This is a bit hacky but it avoids heavy changes
* to directive parser and watcher mechanism.
*
* @param {String} exp
* @param {Boolean} single
* @return {String}
*/
var filterRE = /[^|]\|[^|]/
function inlineFilters (exp, single) {
if (!filterRE.test(exp)) {
return single
? exp
: '(' + exp + ')'
} else {
var dir = parseDirective(exp)
if (!dir.filters) {
return '(' + exp + ')'
} else {
return 'this._applyFilters(' +
dir.expression + // value
',null,' + // oldValue (null for read)
JSON.stringify(dir.filters) + // filter descriptors
',false)' // write?
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/parsers/text.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,075 |
```javascript
import { toArray, debounce as _debounce } from '../util/index'
import { orderBy, filterBy, limitBy } from './array-filters'
const digitsRE = /(\d{3})(?=\d)/g
// asset collections must be a plain object.
export default {
orderBy,
filterBy,
limitBy,
/**
* Stringify value.
*
* @param {Number} indent
*/
json: {
read: function (value, indent) {
return typeof value === 'string'
? value
: JSON.stringify(value, null, Number(indent) || 2)
},
write: function (value) {
try {
return JSON.parse(value)
} catch (e) {
return value
}
}
},
/**
* 'abc' => 'Abc'
*/
capitalize (value) {
if (!value && value !== 0) return ''
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
},
/**
* 'abc' => 'ABC'
*/
uppercase (value) {
return (value || value === 0)
? value.toString().toUpperCase()
: ''
},
/**
* 'AbC' => 'abc'
*/
lowercase (value) {
return (value || value === 0)
? value.toString().toLowerCase()
: ''
},
/**
* 12345 => $12,345.00
*
* @param {String} sign
* @param {Number} decimals Decimal places
*/
currency (value, currency, decimals) {
value = parseFloat(value)
if (!isFinite(value) || (!value && value !== 0)) return ''
currency = currency != null ? currency : '$'
decimals = decimals != null ? decimals : 2
var stringified = Math.abs(value).toFixed(decimals)
var _int = decimals
? stringified.slice(0, -1 - decimals)
: stringified
var i = _int.length % 3
var head = i > 0
? (_int.slice(0, i) + (_int.length > 3 ? ',' : ''))
: ''
var _float = decimals
? stringified.slice(-1 - decimals)
: ''
var sign = value < 0 ? '-' : ''
return sign + currency + head +
_int.slice(i).replace(digitsRE, '$1,') +
_float
},
/**
* 'item' => 'items'
*
* @params
* an array of strings corresponding to
* the single, double, triple ... forms of the word to
* be pluralized. When the number to be pluralized
* exceeds the length of the args, it will use the last
* entry in the array.
*
* e.g. ['single', 'double', 'triple', 'multiple']
*/
pluralize (value) {
var args = toArray(arguments, 1)
return args.length > 1
? (args[value % 10 - 1] || args[args.length - 1])
: (args[0] + (value === 1 ? '' : 's'))
},
/**
* Debounce a handler function.
*
* @param {Function} handler
* @param {Number} delay = 300
* @return {Function}
*/
debounce (handler, delay) {
if (!handler) return
if (!delay) {
delay = 300
}
return _debounce(handler, delay)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/filters/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 802 |
```javascript
import { getPath } from '../parsers/path'
import vFor from '../directives/public/for'
import {
toArray,
toNumber,
isArray,
isObject,
isPlainObject
} from '../util/index'
const convertArray = vFor._postProcess
/**
* Limit filter for arrays
*
* @param {Number} n
* @param {Number} offset (Decimal expected)
*/
export function limitBy (arr, n, offset) {
offset = offset ? parseInt(offset, 10) : 0
n = toNumber(n)
return typeof n === 'number'
? arr.slice(offset, offset + n)
: arr
}
/**
* Filter filter for arrays
*
* @param {String} search
* @param {String} [delimiter]
* @param {String} ...dataKeys
*/
export function filterBy (arr, search, delimiter) {
arr = convertArray(arr)
if (search == null) {
return arr
}
if (typeof search === 'function') {
return arr.filter(search)
}
// cast to lowercase string
search = ('' + search).toLowerCase()
// allow optional `in` delimiter
// because why not
var n = delimiter === 'in' ? 3 : 2
// extract and flatten keys
var keys = Array.prototype.concat.apply([], toArray(arguments, n))
var res = []
var item, key, val, j
for (var i = 0, l = arr.length; i < l; i++) {
item = arr[i]
val = (item && item.$value) || item
j = keys.length
if (j) {
while (j--) {
key = keys[j]
if ((key === '$key' && contains(item.$key, search)) ||
contains(getPath(val, key), search)) {
res.push(item)
break
}
}
} else if (contains(item, search)) {
res.push(item)
}
}
return res
}
/**
* Filter filter for arrays
*
* @param {String|Array<String>|Function} ...sortKeys
* @param {Number} [order]
*/
export function orderBy (arr) {
let comparator = null
let sortKeys
arr = convertArray(arr)
// determine order (last argument)
let args = toArray(arguments, 1)
let order = args[args.length - 1]
if (typeof order === 'number') {
order = order < 0 ? -1 : 1
args = args.length > 1 ? args.slice(0, -1) : args
} else {
order = 1
}
// determine sortKeys & comparator
const firstArg = args[0]
if (!firstArg) {
return arr
} else if (typeof firstArg === 'function') {
// custom comparator
comparator = function (a, b) {
return firstArg(a, b) * order
}
} else {
// string keys. flatten first
sortKeys = Array.prototype.concat.apply([], args)
comparator = function (a, b, i) {
i = i || 0
return i >= sortKeys.length - 1
? baseCompare(a, b, i)
: baseCompare(a, b, i) || comparator(a, b, i + 1)
}
}
function baseCompare (a, b, sortKeyIndex) {
const sortKey = sortKeys[sortKeyIndex]
if (sortKey) {
if (sortKey !== '$key') {
if (isObject(a) && '$value' in a) a = a.$value
if (isObject(b) && '$value' in b) b = b.$value
}
a = isObject(a) ? getPath(a, sortKey) : a
b = isObject(b) ? getPath(b, sortKey) : b
}
return a === b ? 0 : a > b ? order : -order
}
// sort on a copy to avoid mutating original array
return arr.slice().sort(comparator)
}
/**
* String contain helper
*
* @param {*} val
* @param {String} search
*/
function contains (val, search) {
var i
if (isPlainObject(val)) {
var keys = Object.keys(val)
i = keys.length
while (i--) {
if (contains(val[keys[i]], search)) {
return true
}
}
} else if (isArray(val)) {
i = val.length
while (i--) {
if (contains(val[i], search)) {
return true
}
}
} else if (val != null) {
return val.toString().toLowerCase().indexOf(search) > -1
}
}
``` | /content/code_sandbox/public/vendor/vue/src/filters/array-filters.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,053 |
```javascript
import initMixin from './internal/init'
import stateMixin from './internal/state'
import eventsMixin from './internal/events'
import lifecycleMixin from './internal/lifecycle'
import miscMixin from './internal/misc'
import dataAPI from './api/data'
import domAPI from './api/dom'
import eventsAPI from './api/events'
import lifecycleAPI from './api/lifecycle'
/**
* The exposed Vue constructor.
*
* API conventions:
* - public API methods/properties are prefixed with `$`
* - internal methods/properties are prefixed with `_`
* - non-prefixed properties are assumed to be proxied user
* data.
*
* @constructor
* @param {Object} [options]
* @public
*/
function Vue (options) {
this._init(options)
}
// install internals
initMixin(Vue)
stateMixin(Vue)
eventsMixin(Vue)
lifecycleMixin(Vue)
miscMixin(Vue)
// install instance APIs
dataAPI(Vue)
domAPI(Vue)
eventsAPI(Vue)
lifecycleAPI(Vue)
export default Vue
``` | /content/code_sandbox/public/vendor/vue/src/instance/vue.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 221 |
```javascript
import { isSimplePath } from '../../parsers/expression'
import {
inDoc,
isArray,
warn
} from '../../util/index'
const eventRE = /^v-on:|^@/
export default function (Vue) {
/**
* Setup the instance's option events & watchers.
* If the value is a string, we pull it from the
* instance's methods by name.
*/
Vue.prototype._initEvents = function () {
var options = this.$options
if (options._asComponent) {
registerComponentEvents(this, options.el)
}
registerCallbacks(this, '$on', options.events)
registerCallbacks(this, '$watch', options.watch)
}
/**
* Register v-on events on a child component
*
* @param {Vue} vm
* @param {Element} el
*/
function registerComponentEvents (vm, el) {
var attrs = el.attributes
var name, value, handler
for (var i = 0, l = attrs.length; i < l; i++) {
name = attrs[i].name
if (eventRE.test(name)) {
name = name.replace(eventRE, '')
// force the expression into a statement so that
// it always dynamically resolves the method to call (#2670)
// kinda ugly hack, but does the job.
value = attrs[i].value
if (isSimplePath(value)) {
value += '.apply(this, $arguments)'
}
handler = (vm._scope || vm._context).$eval(value, true)
handler._fromParent = true
vm.$on(name.replace(eventRE), handler)
}
}
}
/**
* Register callbacks for option events and watchers.
*
* @param {Vue} vm
* @param {String} action
* @param {Object} hash
*/
function registerCallbacks (vm, action, hash) {
if (!hash) return
var handlers, key, i, j
for (key in hash) {
handlers = hash[key]
if (isArray(handlers)) {
for (i = 0, j = handlers.length; i < j; i++) {
register(vm, action, key, handlers[i])
}
} else {
register(vm, action, key, handlers)
}
}
}
/**
* Helper to register an event/watch callback.
*
* @param {Vue} vm
* @param {String} action
* @param {String} key
* @param {Function|String|Object} handler
* @param {Object} [options]
*/
function register (vm, action, key, handler, options) {
var type = typeof handler
if (type === 'function') {
vm[action](key, handler, options)
} else if (type === 'string') {
var methods = vm.$options.methods
var method = methods && methods[handler]
if (method) {
vm[action](key, method, options)
} else {
process.env.NODE_ENV !== 'production' && warn(
'Unknown method: "' + handler + '" when ' +
'registering callback for ' + action +
': "' + key + '".',
vm
)
}
} else if (handler && type === 'object') {
register(vm, action, key, handler.handler, handler)
}
}
/**
* Setup recursive attached/detached calls
*/
Vue.prototype._initDOMHooks = function () {
this.$on('hook:attached', onAttached)
this.$on('hook:detached', onDetached)
}
/**
* Callback to recursively call attached hook on children
*/
function onAttached () {
if (!this._isAttached) {
this._isAttached = true
this.$children.forEach(callAttach)
}
}
/**
* Iterator to call attached hook
*
* @param {Vue} child
*/
function callAttach (child) {
if (!child._isAttached && inDoc(child.$el)) {
child._callHook('attached')
}
}
/**
* Callback to recursively call detached hook on children
*/
function onDetached () {
if (this._isAttached) {
this._isAttached = false
this.$children.forEach(callDetach)
}
}
/**
* Iterator to call detached hook
*
* @param {Vue} child
*/
function callDetach (child) {
if (child._isAttached && !inDoc(child.$el)) {
child._callHook('detached')
}
}
/**
* Trigger all handlers for a hook
*
* @param {String} hook
*/
Vue.prototype._callHook = function (hook) {
this.$emit('pre-hook:' + hook)
var handlers = this.$options[hook]
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
handlers[i].call(this)
}
}
this.$emit('hook:' + hook)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/internal/events.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,129 |
```javascript
import {
resolveAsset,
isPlainObject,
warn
} from '../../util/index'
export default function (Vue) {
/**
* Apply a list of filter (descriptors) to a value.
* Using plain for loops here because this will be called in
* the getter of any watcher with filters so it is very
* performance sensitive.
*
* @param {*} value
* @param {*} [oldValue]
* @param {Array} filters
* @param {Boolean} write
* @return {*}
*/
Vue.prototype._applyFilters = function (value, oldValue, filters, write) {
var filter, fn, args, arg, offset, i, l, j, k
for (i = 0, l = filters.length; i < l; i++) {
filter = filters[write ? l - i - 1 : i]
fn = resolveAsset(this.$options, 'filters', filter.name, true)
if (!fn) continue
fn = write ? fn.write : (fn.read || fn)
if (typeof fn !== 'function') continue
args = write ? [value, oldValue] : [value]
offset = write ? 2 : 1
if (filter.args) {
for (j = 0, k = filter.args.length; j < k; j++) {
arg = filter.args[j]
args[j + offset] = arg.dynamic
? this.$get(arg.value)
: arg.value
}
}
value = fn.apply(this, args)
}
return value
}
/**
* Resolve a component, depending on whether the component
* is defined normally or using an async factory function.
* Resolves synchronously if already resolved, otherwise
* resolves asynchronously and caches the resolved
* constructor on the factory.
*
* @param {String|Function} value
* @param {Function} cb
*/
Vue.prototype._resolveComponent = function (value, cb) {
var factory
if (typeof value === 'function') {
factory = value
} else {
factory = resolveAsset(this.$options, 'components', value, true)
}
/* istanbul ignore if */
if (!factory) {
return
}
// async component factory
if (!factory.options) {
if (factory.resolved) {
// cached
cb(factory.resolved)
} else if (factory.requested) {
// pool callbacks
factory.pendingCallbacks.push(cb)
} else {
factory.requested = true
var cbs = factory.pendingCallbacks = [cb]
factory.call(this, function resolve (res) {
if (isPlainObject(res)) {
res = Vue.extend(res)
}
// cache resolved
factory.resolved = res
// invoke callbacks
for (var i = 0, l = cbs.length; i < l; i++) {
cbs[i](res)
}
}, function reject (reason) {
process.env.NODE_ENV !== 'production' && warn(
'Failed to resolve async component' +
(typeof value === 'string' ? ': ' + value : '') + '. ' +
(reason ? '\nReason: ' + reason : '')
)
})
}
} else {
// normal component
cb(factory)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/internal/misc.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 739 |
```javascript
import Watcher from '../../watcher'
import { compileAndLinkProps } from '../../compiler/index'
import Dep from '../../observer/dep'
import {
observe,
defineReactive
} from '../../observer/index'
import {
warn,
query,
hasOwn,
isReserved,
isPlainObject,
bind
} from '../../util/index'
export default function (Vue) {
/**
* Accessor for `$data` property, since setting $data
* requires observing the new object and updating
* proxied properties.
*/
Object.defineProperty(Vue.prototype, '$data', {
get () {
return this._data
},
set (newData) {
if (newData !== this._data) {
this._setData(newData)
}
}
})
/**
* Setup the scope of an instance, which contains:
* - observed data
* - computed properties
* - user methods
* - meta properties
*/
Vue.prototype._initState = function () {
this._initProps()
this._initMeta()
this._initMethods()
this._initData()
this._initComputed()
}
/**
* Initialize props.
*/
Vue.prototype._initProps = function () {
var options = this.$options
var el = options.el
var props = options.props
if (props && !el) {
process.env.NODE_ENV !== 'production' && warn(
'Props will not be compiled if no `el` option is ' +
'provided at instantiation.',
this
)
}
// make sure to convert string selectors into element now
el = options.el = query(el)
this._propsUnlinkFn = el && el.nodeType === 1 && props
// props must be linked in proper scope if inside v-for
? compileAndLinkProps(this, el, props, this._scope)
: null
}
/**
* Initialize the data.
*/
Vue.prototype._initData = function () {
var dataFn = this.$options.data
var data = this._data = dataFn ? dataFn() : {}
if (!isPlainObject(data)) {
data = {}
process.env.NODE_ENV !== 'production' && warn(
'data functions should return an object.',
this
)
}
var props = this._props
// proxy data on instance
var keys = Object.keys(data)
var i, key
i = keys.length
while (i--) {
key = keys[i]
// there are two scenarios where we can proxy a data key:
// 1. it's not already defined as a prop
// 2. it's provided via a instantiation option AND there are no
// template prop present
if (!props || !hasOwn(props, key)) {
this._proxy(key)
} else if (process.env.NODE_ENV !== 'production') {
warn(
'Data field "' + key + '" is already defined ' +
'as a prop. To provide default value for a prop, use the "default" ' +
'prop option; if you want to pass prop values to an instantiation ' +
'call, use the "propsData" option.',
this
)
}
}
// observe data
observe(data, this)
}
/**
* Swap the instance's $data. Called in $data's setter.
*
* @param {Object} newData
*/
Vue.prototype._setData = function (newData) {
newData = newData || {}
var oldData = this._data
this._data = newData
var keys, key, i
// unproxy keys not present in new data
keys = Object.keys(oldData)
i = keys.length
while (i--) {
key = keys[i]
if (!(key in newData)) {
this._unproxy(key)
}
}
// proxy keys not already proxied,
// and trigger change for changed values
keys = Object.keys(newData)
i = keys.length
while (i--) {
key = keys[i]
if (!hasOwn(this, key)) {
// new property
this._proxy(key)
}
}
oldData.__ob__.removeVm(this)
observe(newData, this)
this._digest()
}
/**
* Proxy a property, so that
* vm.prop === vm._data.prop
*
* @param {String} key
*/
Vue.prototype._proxy = function (key) {
if (!isReserved(key)) {
// need to store ref to self here
// because these getter/setters might
// be called by child scopes via
// prototype inheritance.
var self = this
Object.defineProperty(self, key, {
configurable: true,
enumerable: true,
get: function proxyGetter () {
return self._data[key]
},
set: function proxySetter (val) {
self._data[key] = val
}
})
}
}
/**
* Unproxy a property.
*
* @param {String} key
*/
Vue.prototype._unproxy = function (key) {
if (!isReserved(key)) {
delete this[key]
}
}
/**
* Force update on every watcher in scope.
*/
Vue.prototype._digest = function () {
for (var i = 0, l = this._watchers.length; i < l; i++) {
this._watchers[i].update(true) // shallow updates
}
}
/**
* Setup computed properties. They are essentially
* special getter/setters
*/
function noop () {}
Vue.prototype._initComputed = function () {
var computed = this.$options.computed
if (computed) {
for (var key in computed) {
var userDef = computed[key]
var def = {
enumerable: true,
configurable: true
}
if (typeof userDef === 'function') {
def.get = makeComputedGetter(userDef, this)
def.set = noop
} else {
def.get = userDef.get
? userDef.cache !== false
? makeComputedGetter(userDef.get, this)
: bind(userDef.get, this)
: noop
def.set = userDef.set
? bind(userDef.set, this)
: noop
}
Object.defineProperty(this, key, def)
}
}
}
function makeComputedGetter (getter, owner) {
var watcher = new Watcher(owner, getter, null, {
lazy: true
})
return function computedGetter () {
if (watcher.dirty) {
watcher.evaluate()
}
if (Dep.target) {
watcher.depend()
}
return watcher.value
}
}
/**
* Setup instance methods. Methods must be bound to the
* instance since they might be passed down as a prop to
* child components.
*/
Vue.prototype._initMethods = function () {
var methods = this.$options.methods
if (methods) {
for (var key in methods) {
this[key] = bind(methods[key], this)
}
}
}
/**
* Initialize meta information like $index, $key & $value.
*/
Vue.prototype._initMeta = function () {
var metas = this.$options._meta
if (metas) {
for (var key in metas) {
defineReactive(this, key, metas[key])
}
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/internal/state.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,655 |
```javascript
import { mergeOptions } from '../../util/index'
let uid = 0
export default function (Vue) {
/**
* The main init sequence. This is called for every
* instance, including ones that are created from extended
* constructors.
*
* @param {Object} options - this options object should be
* the result of merging class
* options and the options passed
* in to the constructor.
*/
Vue.prototype._init = function (options) {
options = options || {}
this.$el = null
this.$parent = options.parent
this.$root = this.$parent
? this.$parent.$root
: this
this.$children = []
this.$refs = {} // child vm references
this.$els = {} // element references
this._watchers = [] // all watchers as an array
this._directives = [] // all directives
// a uid
this._uid = uid++
// a flag to avoid this being observed
this._isVue = true
// events bookkeeping
this._events = {} // registered callbacks
this._eventsCount = {} // for $broadcast optimization
// fragment instance properties
this._isFragment = false
this._fragment = // @type {DocumentFragment}
this._fragmentStart = // @type {Text|Comment}
this._fragmentEnd = null // @type {Text|Comment}
// lifecycle state
this._isCompiled =
this._isDestroyed =
this._isReady =
this._isAttached =
this._isBeingDestroyed =
this._vForRemoving = false
this._unlinkFn = null
// context:
// if this is a transcluded component, context
// will be the common parent vm of this instance
// and its host.
this._context = options._context || this.$parent
// scope:
// if this is inside an inline v-for, the scope
// will be the intermediate scope created for this
// repeat fragment. this is used for linking props
// and container directives.
this._scope = options._scope
// fragment:
// if this instance is compiled inside a Fragment, it
// needs to reigster itself as a child of that fragment
// for attach/detach to work properly.
this._frag = options._frag
if (this._frag) {
this._frag.children.push(this)
}
// push self into parent / transclusion host
if (this.$parent) {
this.$parent.$children.push(this)
}
// merge options.
options = this.$options = mergeOptions(
this.constructor.options,
options,
this
)
// set ref
this._updateRef()
// initialize data as empty object.
// it will be filled up in _initData().
this._data = {}
// call init hook
this._callHook('init')
// initialize data observation and scope inheritance.
this._initState()
// setup event system and option events.
this._initEvents()
// call created hook
this._callHook('created')
// if `el` option is passed, start compilation.
if (options.el) {
this.$mount(options.el)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/internal/init.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 737 |
```javascript
import Directive from '../../directive'
import {
replace,
getAttr,
isFragment
} from '../../util/index'
import {
compile,
compileRoot,
transclude,
resolveSlots
} from '../../compiler/index'
export default function (Vue) {
/**
* Update v-ref for component.
*
* @param {Boolean} remove
*/
Vue.prototype._updateRef = function (remove) {
var ref = this.$options._ref
if (ref) {
var refs = (this._scope || this._context).$refs
if (remove) {
if (refs[ref] === this) {
refs[ref] = null
}
} else {
refs[ref] = this
}
}
}
/**
* Transclude, compile and link element.
*
* If a pre-compiled linker is available, that means the
* passed in element will be pre-transcluded and compiled
* as well - all we need to do is to call the linker.
*
* Otherwise we need to call transclude/compile/link here.
*
* @param {Element} el
*/
Vue.prototype._compile = function (el) {
var options = this.$options
// transclude and init element
// transclude can potentially replace original
// so we need to keep reference; this step also injects
// the template and caches the original attributes
// on the container node and replacer node.
var original = el
el = transclude(el, options)
this._initElement(el)
// handle v-pre on root node (#2026)
if (el.nodeType === 1 && getAttr(el, 'v-pre') !== null) {
return
}
// root is always compiled per-instance, because
// container attrs and props can be different every time.
var contextOptions = this._context && this._context.$options
var rootLinker = compileRoot(el, options, contextOptions)
// resolve slot distribution
resolveSlots(this, options._content)
// compile and link the rest
var contentLinkFn
var ctor = this.constructor
// component compilation can be cached
// as long as it's not using inline-template
if (options._linkerCachable) {
contentLinkFn = ctor.linker
if (!contentLinkFn) {
contentLinkFn = ctor.linker = compile(el, options)
}
}
// link phase
// make sure to link root with prop scope!
var rootUnlinkFn = rootLinker(this, el, this._scope)
var contentUnlinkFn = contentLinkFn
? contentLinkFn(this, el)
: compile(el, options)(this, el)
// register composite unlink function
// to be called during instance destruction
this._unlinkFn = function () {
rootUnlinkFn()
// passing destroying: true to avoid searching and
// splicing the directives
contentUnlinkFn(true)
}
// finally replace original
if (options.replace) {
replace(original, el)
}
this._isCompiled = true
this._callHook('compiled')
}
/**
* Initialize instance element. Called in the public
* $mount() method.
*
* @param {Element} el
*/
Vue.prototype._initElement = function (el) {
if (isFragment(el)) {
this._isFragment = true
this.$el = this._fragmentStart = el.firstChild
this._fragmentEnd = el.lastChild
// set persisted text anchors to empty
if (this._fragmentStart.nodeType === 3) {
this._fragmentStart.data = this._fragmentEnd.data = ''
}
this._fragment = el
} else {
this.$el = el
}
this.$el.__vue__ = this
this._callHook('beforeCompile')
}
/**
* Create and bind a directive to an element.
*
* @param {Object} descriptor - parsed directive descriptor
* @param {Node} node - target node
* @param {Vue} [host] - transclusion host component
* @param {Object} [scope] - v-for scope
* @param {Fragment} [frag] - owner fragment
*/
Vue.prototype._bindDir = function (descriptor, node, host, scope, frag) {
this._directives.push(
new Directive(descriptor, this, node, host, scope, frag)
)
}
/**
* Teardown an instance, unobserves the data, unbind all the
* directives, turn off all the event listeners, etc.
*
* @param {Boolean} remove - whether to remove the DOM node.
* @param {Boolean} deferCleanup - if true, defer cleanup to
* be called later
*/
Vue.prototype._destroy = function (remove, deferCleanup) {
if (this._isBeingDestroyed) {
if (!deferCleanup) {
this._cleanup()
}
return
}
var destroyReady
var pendingRemoval
var self = this
// Cleanup should be called either synchronously or asynchronoysly as
// callback of this.$remove(), or if remove and deferCleanup are false.
// In any case it should be called after all other removing, unbinding and
// turning of is done
var cleanupIfPossible = function () {
if (destroyReady && !pendingRemoval && !deferCleanup) {
self._cleanup()
}
}
// remove DOM element
if (remove && this.$el) {
pendingRemoval = true
this.$remove(function () {
pendingRemoval = false
cleanupIfPossible()
})
}
this._callHook('beforeDestroy')
this._isBeingDestroyed = true
var i
// remove self from parent. only necessary
// if parent is not being destroyed as well.
var parent = this.$parent
if (parent && !parent._isBeingDestroyed) {
parent.$children.$remove(this)
// unregister ref (remove: true)
this._updateRef(true)
}
// destroy all children.
i = this.$children.length
while (i--) {
this.$children[i].$destroy()
}
// teardown props
if (this._propsUnlinkFn) {
this._propsUnlinkFn()
}
// teardown all directives. this also tearsdown all
// directive-owned watchers.
if (this._unlinkFn) {
this._unlinkFn()
}
i = this._watchers.length
while (i--) {
this._watchers[i].teardown()
}
// remove reference to self on $el
if (this.$el) {
this.$el.__vue__ = null
}
destroyReady = true
cleanupIfPossible()
}
/**
* Clean up to ensure garbage collection.
* This is called after the leave transition if there
* is any.
*/
Vue.prototype._cleanup = function () {
if (this._isDestroyed) {
return
}
// remove self from owner fragment
// do it in cleanup so that we can call $destroy with
// defer right when a fragment is about to be removed.
if (this._frag) {
this._frag.children.$remove(this)
}
// remove reference from data ob
// frozen object may not have observer.
if (this._data && this._data.__ob__) {
this._data.__ob__.removeVm(this)
}
// Clean up references to private properties and other
// instances. preserve reference to _data so that proxy
// accessors still work. The only potential side effect
// here is that mutating the instance after it's destroyed
// may affect the state of other components that are still
// observing the same object, but that seems to be a
// reasonable responsibility for the user rather than
// always throwing an error on them.
this.$el =
this.$parent =
this.$root =
this.$children =
this._watchers =
this._context =
this._scope =
this._directives = null
// call the last hook...
this._isDestroyed = true
this._callHook('destroyed')
// turn off all instance listeners.
this.$off()
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/internal/lifecycle.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,861 |
```javascript
import Watcher from '../../watcher'
import { del, toArray } from '../../util/index'
import { parseText } from '../../parsers/text'
import { parseDirective } from '../../parsers/directive'
import { getPath } from '../../parsers/path'
import { parseExpression } from '../../parsers/expression'
const filterRE = /[^|]\|[^|]/
export default function (Vue) {
/**
* Get the value from an expression on this vm.
*
* @param {String} exp
* @param {Boolean} [asStatement]
* @return {*}
*/
Vue.prototype.$get = function (exp, asStatement) {
var res = parseExpression(exp)
if (res) {
if (asStatement) {
var self = this
return function statementHandler () {
self.$arguments = toArray(arguments)
var result = res.get.call(self, self)
self.$arguments = null
return result
}
} else {
try {
return res.get.call(this, this)
} catch (e) {}
}
}
}
/**
* Set the value from an expression on this vm.
* The expression must be a valid left-hand
* expression in an assignment.
*
* @param {String} exp
* @param {*} val
*/
Vue.prototype.$set = function (exp, val) {
var res = parseExpression(exp, true)
if (res && res.set) {
res.set.call(this, this, val)
}
}
/**
* Delete a property on the VM
*
* @param {String} key
*/
Vue.prototype.$delete = function (key) {
del(this._data, key)
}
/**
* Watch an expression, trigger callback when its
* value changes.
*
* @param {String|Function} expOrFn
* @param {Function} cb
* @param {Object} [options]
* - {Boolean} deep
* - {Boolean} immediate
* @return {Function} - unwatchFn
*/
Vue.prototype.$watch = function (expOrFn, cb, options) {
var vm = this
var parsed
if (typeof expOrFn === 'string') {
parsed = parseDirective(expOrFn)
expOrFn = parsed.expression
}
var watcher = new Watcher(vm, expOrFn, cb, {
deep: options && options.deep,
sync: options && options.sync,
filters: parsed && parsed.filters,
user: !options || options.user !== false
})
if (options && options.immediate) {
cb.call(vm, watcher.value)
}
return function unwatchFn () {
watcher.teardown()
}
}
/**
* Evaluate a text directive, including filters.
*
* @param {String} text
* @param {Boolean} [asStatement]
* @return {String}
*/
Vue.prototype.$eval = function (text, asStatement) {
// check for filters.
if (filterRE.test(text)) {
var dir = parseDirective(text)
// the filter regex check might give false positive
// for pipes inside strings, so it's possible that
// we don't get any filters here
var val = this.$get(dir.expression, asStatement)
return dir.filters
? this._applyFilters(val, null, dir.filters)
: val
} else {
// no filter
return this.$get(text, asStatement)
}
}
/**
* Interpolate a piece of template text.
*
* @param {String} text
* @return {String}
*/
Vue.prototype.$interpolate = function (text) {
var tokens = parseText(text)
var vm = this
if (tokens) {
if (tokens.length === 1) {
return vm.$eval(tokens[0].value) + ''
} else {
return tokens.map(function (token) {
return token.tag
? vm.$eval(token.value)
: token.value
}).join('')
}
} else {
return text
}
}
/**
* Log instance data as a plain JS object
* so that it is easier to inspect in console.
* This method assumes console is available.
*
* @param {String} [path]
*/
Vue.prototype.$log = function (path) {
var data = path
? getPath(this._data, path)
: this._data
if (data) {
data = clean(data)
}
// include computed fields
if (!path) {
var key
for (key in this.$options.computed) {
data[key] = clean(this[key])
}
if (this._props) {
for (key in this._props) {
data[key] = clean(this[key])
}
}
}
console.log(data)
}
/**
* "clean" a getter/setter converted object into a plain
* object copy.
*
* @param {Object} - obj
* @return {Object}
*/
function clean (obj) {
return JSON.parse(JSON.stringify(obj))
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/api/data.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,152 |
```javascript
import { toArray } from '../../util/index'
export default function (Vue) {
/**
* Listen on the given `event` with `fn`.
*
* @param {String} event
* @param {Function} fn
*/
Vue.prototype.$on = function (event, fn) {
(this._events[event] || (this._events[event] = []))
.push(fn)
modifyListenerCount(this, event, 1)
return this
}
/**
* Adds an `event` listener that will be invoked a single
* time then automatically removed.
*
* @param {String} event
* @param {Function} fn
*/
Vue.prototype.$once = function (event, fn) {
var self = this
function on () {
self.$off(event, on)
fn.apply(this, arguments)
}
on.fn = fn
this.$on(event, on)
return this
}
/**
* Remove the given callback for `event` or all
* registered callbacks.
*
* @param {String} event
* @param {Function} fn
*/
Vue.prototype.$off = function (event, fn) {
var cbs
// all
if (!arguments.length) {
if (this.$parent) {
for (event in this._events) {
cbs = this._events[event]
if (cbs) {
modifyListenerCount(this, event, -cbs.length)
}
}
}
this._events = {}
return this
}
// specific event
cbs = this._events[event]
if (!cbs) {
return this
}
if (arguments.length === 1) {
modifyListenerCount(this, event, -cbs.length)
this._events[event] = null
return this
}
// specific handler
var cb
var i = cbs.length
while (i--) {
cb = cbs[i]
if (cb === fn || cb.fn === fn) {
modifyListenerCount(this, event, -1)
cbs.splice(i, 1)
break
}
}
return this
}
/**
* Trigger an event on self.
*
* @param {String|Object} event
* @return {Boolean} shouldPropagate
*/
Vue.prototype.$emit = function (event) {
var isSource = typeof event === 'string'
event = isSource
? event
: event.name
var cbs = this._events[event]
var shouldPropagate = isSource || !cbs
if (cbs) {
cbs = cbs.length > 1
? toArray(cbs)
: cbs
// this is a somewhat hacky solution to the question raised
// in #2102: for an inline component listener like <comp @test="doThis">,
// the propagation handling is somewhat broken. Therefore we
// need to treat these inline callbacks differently.
var hasParentCbs = isSource && cbs.some(function (cb) {
return cb._fromParent
})
if (hasParentCbs) {
shouldPropagate = false
}
var args = toArray(arguments, 1)
for (var i = 0, l = cbs.length; i < l; i++) {
var cb = cbs[i]
var res = cb.apply(this, args)
if (res === true && (!hasParentCbs || cb._fromParent)) {
shouldPropagate = true
}
}
}
return shouldPropagate
}
/**
* Recursively broadcast an event to all children instances.
*
* @param {String|Object} event
* @param {...*} additional arguments
*/
Vue.prototype.$broadcast = function (event) {
var isSource = typeof event === 'string'
event = isSource
? event
: event.name
// if no child has registered for this event,
// then there's no need to broadcast.
if (!this._eventsCount[event]) return
var children = this.$children
var args = toArray(arguments)
if (isSource) {
// use object event to indicate non-source emit
// on children
args[0] = { name: event, source: this }
}
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i]
var shouldPropagate = child.$emit.apply(child, args)
if (shouldPropagate) {
child.$broadcast.apply(child, args)
}
}
return this
}
/**
* Recursively propagate an event up the parent chain.
*
* @param {String} event
* @param {...*} additional arguments
*/
Vue.prototype.$dispatch = function (event) {
var shouldPropagate = this.$emit.apply(this, arguments)
if (!shouldPropagate) return
var parent = this.$parent
var args = toArray(arguments)
// use object event to indicate non-source emit
// on parents
args[0] = { name: event, source: this }
while (parent) {
shouldPropagate = parent.$emit.apply(parent, args)
parent = shouldPropagate
? parent.$parent
: null
}
return this
}
/**
* Modify the listener counts on all parents.
* This bookkeeping allows $broadcast to return early when
* no child has listened to a certain event.
*
* @param {Vue} vm
* @param {String} event
* @param {Number} count
*/
var hookRE = /^hook:/
function modifyListenerCount (vm, event, count) {
var parent = vm.$parent
// hooks do not get broadcasted so no need
// to do bookkeeping for them
if (!parent || !count || hookRE.test(event)) return
while (parent) {
parent._eventsCount[event] =
(parent._eventsCount[event] || 0) + count
parent = parent.$parent
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/api/events.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,375 |
```javascript
import {
nextTick,
inDoc,
removeNodeRange,
mapNodeRange,
before,
remove
} from '../../util/index'
import {
beforeWithTransition,
appendWithTransition,
removeWithTransition
} from '../../transition/index'
export default function (Vue) {
/**
* Convenience on-instance nextTick. The callback is
* auto-bound to the instance, and this avoids component
* modules having to rely on the global Vue.
*
* @param {Function} fn
*/
Vue.prototype.$nextTick = function (fn) {
nextTick(fn, this)
}
/**
* Append instance to target
*
* @param {Node} target
* @param {Function} [cb]
* @param {Boolean} [withTransition] - defaults to true
*/
Vue.prototype.$appendTo = function (target, cb, withTransition) {
return insert(
this, target, cb, withTransition,
append, appendWithTransition
)
}
/**
* Prepend instance to target
*
* @param {Node} target
* @param {Function} [cb]
* @param {Boolean} [withTransition] - defaults to true
*/
Vue.prototype.$prependTo = function (target, cb, withTransition) {
target = query(target)
if (target.hasChildNodes()) {
this.$before(target.firstChild, cb, withTransition)
} else {
this.$appendTo(target, cb, withTransition)
}
return this
}
/**
* Insert instance before target
*
* @param {Node} target
* @param {Function} [cb]
* @param {Boolean} [withTransition] - defaults to true
*/
Vue.prototype.$before = function (target, cb, withTransition) {
return insert(
this, target, cb, withTransition,
beforeWithCb, beforeWithTransition
)
}
/**
* Insert instance after target
*
* @param {Node} target
* @param {Function} [cb]
* @param {Boolean} [withTransition] - defaults to true
*/
Vue.prototype.$after = function (target, cb, withTransition) {
target = query(target)
if (target.nextSibling) {
this.$before(target.nextSibling, cb, withTransition)
} else {
this.$appendTo(target.parentNode, cb, withTransition)
}
return this
}
/**
* Remove instance from DOM
*
* @param {Function} [cb]
* @param {Boolean} [withTransition] - defaults to true
*/
Vue.prototype.$remove = function (cb, withTransition) {
if (!this.$el.parentNode) {
return cb && cb()
}
var inDocument = this._isAttached && inDoc(this.$el)
// if we are not in document, no need to check
// for transitions
if (!inDocument) withTransition = false
var self = this
var realCb = function () {
if (inDocument) self._callHook('detached')
if (cb) cb()
}
if (this._isFragment) {
removeNodeRange(
this._fragmentStart,
this._fragmentEnd,
this, this._fragment, realCb
)
} else {
var op = withTransition === false
? removeWithCb
: removeWithTransition
op(this.$el, this, realCb)
}
return this
}
/**
* Shared DOM insertion function.
*
* @param {Vue} vm
* @param {Element} target
* @param {Function} [cb]
* @param {Boolean} [withTransition]
* @param {Function} op1 - op for non-transition insert
* @param {Function} op2 - op for transition insert
* @return vm
*/
function insert (vm, target, cb, withTransition, op1, op2) {
target = query(target)
var targetIsDetached = !inDoc(target)
var op = withTransition === false || targetIsDetached
? op1
: op2
var shouldCallHook =
!targetIsDetached &&
!vm._isAttached &&
!inDoc(vm.$el)
if (vm._isFragment) {
mapNodeRange(vm._fragmentStart, vm._fragmentEnd, function (node) {
op(node, target, vm)
})
cb && cb()
} else {
op(vm.$el, target, vm, cb)
}
if (shouldCallHook) {
vm._callHook('attached')
}
return vm
}
/**
* Check for selectors
*
* @param {String|Element} el
*/
function query (el) {
return typeof el === 'string'
? document.querySelector(el)
: el
}
/**
* Append operation that takes a callback.
*
* @param {Node} el
* @param {Node} target
* @param {Vue} vm - unused
* @param {Function} [cb]
*/
function append (el, target, vm, cb) {
target.appendChild(el)
if (cb) cb()
}
/**
* InsertBefore operation that takes a callback.
*
* @param {Node} el
* @param {Node} target
* @param {Vue} vm - unused
* @param {Function} [cb]
*/
function beforeWithCb (el, target, vm, cb) {
before(el, target)
if (cb) cb()
}
/**
* Remove operation that takes a callback.
*
* @param {Node} el
* @param {Vue} vm - unused
* @param {Function} [cb]
*/
function removeWithCb (el, vm, cb) {
remove(el)
if (cb) cb()
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/api/dom.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,331 |
```javascript
import { warn, query, inDoc } from '../../util/index'
import { compile } from '../../compiler/index'
export default function (Vue) {
/**
* Set instance target element and kick off the compilation
* process. The passed in `el` can be a selector string, an
* existing Element, or a DocumentFragment (for block
* instances).
*
* @param {Element|DocumentFragment|string} el
* @public
*/
Vue.prototype.$mount = function (el) {
if (this._isCompiled) {
process.env.NODE_ENV !== 'production' && warn(
'$mount() should be called only once.',
this
)
return
}
el = query(el)
if (!el) {
el = document.createElement('div')
}
this._compile(el)
this._initDOMHooks()
if (inDoc(this.$el)) {
this._callHook('attached')
ready.call(this)
} else {
this.$once('hook:attached', ready)
}
return this
}
/**
* Mark an instance as ready.
*/
function ready () {
this._isAttached = true
this._isReady = true
this._callHook('ready')
}
/**
* Teardown the instance, simply delegate to the internal
* _destroy.
*
* @param {Boolean} remove
* @param {Boolean} deferCleanup
*/
Vue.prototype.$destroy = function (remove, deferCleanup) {
this._destroy(remove, deferCleanup)
}
/**
* Partially compile a piece of DOM and return a
* decompile function.
*
* @param {Element|DocumentFragment} el
* @param {Vue} [host]
* @param {Object} [scope]
* @param {Fragment} [frag]
* @return {Function}
*/
Vue.prototype.$compile = function (el, host, scope, frag) {
return compile(el, this.$options, true)(
this, el, host, scope, frag
)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/instance/api/lifecycle.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 464 |
```javascript
export const ON = 700
export const MODEL = 800
export const BIND = 850
export const TRANSITION = 1100
export const EL = 1500
export const COMPONENT = 1500
export const PARTIAL = 1750
export const IF = 2100
export const FOR = 2200
export const SLOT = 2300
``` | /content/code_sandbox/public/vendor/vue/src/directives/priorities.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 80 |
```javascript
import slot from './slot'
import partial from './partial'
export default {
slot,
partial
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/element/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 23 |
```javascript
import { SLOT } from '../priorities'
import {
extractContent,
replace,
remove
} from '../../util/index'
export default {
priority: SLOT,
params: ['name'],
bind () {
// this was resolved during component transclusion
var name = this.params.name || 'default'
var content = this.vm._slotContents && this.vm._slotContents[name]
if (!content || !content.hasChildNodes()) {
this.fallback()
} else {
this.compile(content.cloneNode(true), this.vm._context, this.vm)
}
},
compile (content, context, host) {
if (content && context) {
if (
this.el.hasChildNodes() &&
content.childNodes.length === 1 &&
content.childNodes[0].nodeType === 1 &&
content.childNodes[0].hasAttribute('v-if')
) {
// if the inserted slot has v-if
// inject fallback content as the v-else
const elseBlock = document.createElement('template')
elseBlock.setAttribute('v-else', '')
elseBlock.innerHTML = this.el.innerHTML
// the else block should be compiled in child scope
elseBlock._context = this.vm
content.appendChild(elseBlock)
}
const scope = host
? host._scope
: this._scope
this.unlink = context.$compile(
content, host, scope, this._frag
)
}
if (content) {
replace(this.el, content)
} else {
remove(this.el)
}
},
fallback () {
this.compile(extractContent(this.el, true), this.vm)
},
unbind () {
if (this.unlink) {
this.unlink()
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/element/slot.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 377 |
```javascript
import vIf from '../public/if'
import FragmentFactory from '../../fragment/factory'
import { PARTIAL } from '../priorities'
import {
createAnchor,
replace,
resolveAsset
} from '../../util/index'
export default {
priority: PARTIAL,
params: ['name'],
// watch changes to name for dynamic partials
paramWatchers: {
name (value) {
vIf.remove.call(this)
if (value) {
this.insert(value)
}
}
},
bind () {
this.anchor = createAnchor('v-partial')
replace(this.el, this.anchor)
this.insert(this.params.name)
},
insert (id) {
var partial = resolveAsset(this.vm.$options, 'partials', id, true)
if (partial) {
this.factory = new FragmentFactory(this.vm, partial)
vIf.insert.call(this)
}
},
unbind () {
if (this.frag) {
this.frag.destroy()
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/element/partial.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 218 |
```javascript
// NOTE: the prop internal directive is compiled and linked
// during _initProps(), before the created hook is called.
// The purpose is to make the initial prop values available
// inside `created` hooks and `data` functions.
import Watcher from '../../watcher'
import config from '../../config'
import { initProp, updateProp } from '../../compiler/compile-props'
const bindingModes = config._propBindingModes
export default {
bind () {
const child = this.vm
const parent = child._context
// passed in from compiler directly
const prop = this.descriptor.prop
const childKey = prop.path
const parentKey = prop.parentPath
const twoWay = prop.mode === bindingModes.TWO_WAY
const parentWatcher = this.parentWatcher = new Watcher(
parent,
parentKey,
function (val) {
updateProp(child, prop, val)
}, {
twoWay: twoWay,
filters: prop.filters,
// important: props need to be observed on the
// v-for scope if present
scope: this._scope
}
)
// set the child initial value.
initProp(child, prop, parentWatcher.value)
// setup two-way binding
if (twoWay) {
// important: defer the child watcher creation until
// the created hook (after data observation)
var self = this
child.$once('pre-hook:created', function () {
self.childWatcher = new Watcher(
child,
childKey,
function (val) {
parentWatcher.set(val)
}, {
// ensure sync upward before parent sync down.
// this is necessary in cases e.g. the child
// mutates a prop array, then replaces it. (#1683)
sync: true
}
)
})
}
},
unbind () {
this.parentWatcher.teardown()
if (this.childWatcher) {
this.childWatcher.teardown()
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/prop.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 432 |
```javascript
import style from './style'
import vClass from './class'
import component from './component'
import prop from './prop'
import transition from './transition'
export default {
style,
'class': vClass,
component,
prop,
transition
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 55 |
```javascript
import {
addClass,
removeClass,
isArray,
isObject
} from '../../util/index'
export default {
deep: true,
update (value) {
if (!value) {
this.cleanup()
} else if (typeof value === 'string') {
this.setClass(value.trim().split(/\s+/))
} else {
this.setClass(normalize(value))
}
},
setClass (value) {
this.cleanup(value)
for (var i = 0, l = value.length; i < l; i++) {
var val = value[i]
if (val) {
apply(this.el, val, addClass)
}
}
this.prevKeys = value
},
cleanup (value) {
const prevKeys = this.prevKeys
if (!prevKeys) return
var i = prevKeys.length
while (i--) {
var key = prevKeys[i]
if (!value || value.indexOf(key) < 0) {
apply(this.el, key, removeClass)
}
}
}
}
/**
* Normalize objects and arrays (potentially containing objects)
* into array of strings.
*
* @param {Object|Array<String|Object>} value
* @return {Array<String>}
*/
function normalize (value) {
const res = []
if (isArray(value)) {
for (var i = 0, l = value.length; i < l; i++) {
const key = value[i]
if (key) {
if (typeof key === 'string') {
res.push(key)
} else {
for (var k in key) {
if (key[k]) res.push(k)
}
}
}
}
} else if (isObject(value)) {
for (var key in value) {
if (value[key]) res.push(key)
}
}
return res
}
/**
* Add or remove a class/classes on an element
*
* @param {Element} el
* @param {String} key The class name. This may or may not
* contain a space character, in such a
* case we'll deal with multiple class
* names at once.
* @param {Function} fn
*/
function apply (el, key, fn) {
key = key.trim()
if (key.indexOf(' ') === -1) {
fn(el, key)
return
}
// The key contains one or more space characters.
// Since a class name doesn't accept such characters, we
// treat it as multiple classes.
var keys = key.split(/\s+/)
for (var i = 0, l = keys.length; i < l; i++) {
fn(el, keys[i])
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/class.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 595 |
```javascript
import {
extend,
isArray,
hyphenate,
camelize,
warn
} from '../../util/index'
const prefixes = ['-webkit-', '-moz-', '-ms-']
const camelPrefixes = ['Webkit', 'Moz', 'ms']
const importantRE = /!important;?$/
const propCache = Object.create(null)
let testEl = null
export default {
deep: true,
update (value) {
if (typeof value === 'string') {
this.el.style.cssText = value
} else if (isArray(value)) {
this.handleObject(value.reduce(extend, {}))
} else {
this.handleObject(value || {})
}
},
handleObject (value) {
// cache object styles so that only changed props
// are actually updated.
var cache = this.cache || (this.cache = {})
var name, val
for (name in cache) {
if (!(name in value)) {
this.handleSingle(name, null)
delete cache[name]
}
}
for (name in value) {
val = value[name]
if (val !== cache[name]) {
cache[name] = val
this.handleSingle(name, val)
}
}
},
handleSingle (prop, value) {
prop = normalize(prop)
if (!prop) return // unsupported prop
// cast possible numbers/booleans into strings
if (value != null) value += ''
if (value) {
var isImportant = importantRE.test(value)
? 'important'
: ''
if (isImportant) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
warn(
'It\'s probably a bad idea to use !important with inline rules. ' +
'This feature will be deprecated in a future version of Vue.'
)
}
value = value.replace(importantRE, '').trim()
this.el.style.setProperty(prop.kebab, value, isImportant)
} else {
this.el.style[prop.camel] = value
}
} else {
this.el.style[prop.camel] = ''
}
}
}
/**
* Normalize a CSS property name.
* - cache result
* - auto prefix
* - camelCase -> dash-case
*
* @param {String} prop
* @return {String}
*/
function normalize (prop) {
if (propCache[prop]) {
return propCache[prop]
}
var res = prefix(prop)
propCache[prop] = propCache[res] = res
return res
}
/**
* Auto detect the appropriate prefix for a CSS property.
* path_to_url
*
* @param {String} prop
* @return {String}
*/
function prefix (prop) {
prop = hyphenate(prop)
var camel = camelize(prop)
var upper = camel.charAt(0).toUpperCase() + camel.slice(1)
if (!testEl) {
testEl = document.createElement('div')
}
var i = prefixes.length
var prefixed
if (camel !== 'filter' && (camel in testEl.style)) {
return {
kebab: prop,
camel: camel
}
}
while (i--) {
prefixed = camelPrefixes[i] + upper
if (prefixed in testEl.style) {
return {
kebab: prefixes[i] + prop,
camel: prefixed
}
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/style.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 742 |
```javascript
import { cloneNode } from '../../parsers/template'
import { COMPONENT } from '../priorities'
import {
extractContent,
createAnchor,
replace,
hyphenate,
warn,
cancellable,
extend
} from '../../util/index'
export default {
priority: COMPONENT,
params: [
'keep-alive',
'transition-mode',
'inline-template'
],
/**
* Setup. Two possible usages:
*
* - static:
* <comp> or <div v-component="comp">
*
* - dynamic:
* <component :is="view">
*/
bind () {
if (!this.el.__vue__) {
// keep-alive cache
this.keepAlive = this.params.keepAlive
if (this.keepAlive) {
this.cache = {}
}
// check inline-template
if (this.params.inlineTemplate) {
// extract inline template as a DocumentFragment
this.inlineTemplate = extractContent(this.el, true)
}
// component resolution related state
this.pendingComponentCb =
this.Component = null
// transition related state
this.pendingRemovals = 0
this.pendingRemovalCb = null
// create a ref anchor
this.anchor = createAnchor('v-component')
replace(this.el, this.anchor)
// remove is attribute.
// this is removed during compilation, but because compilation is
// cached, when the component is used elsewhere this attribute
// will remain at link time.
this.el.removeAttribute('is')
this.el.removeAttribute(':is')
// remove ref, same as above
if (this.descriptor.ref) {
this.el.removeAttribute('v-ref:' + hyphenate(this.descriptor.ref))
}
// if static, build right now.
if (this.literal) {
this.setComponent(this.expression)
}
} else {
process.env.NODE_ENV !== 'production' && warn(
'cannot mount component "' + this.expression + '" ' +
'on already mounted element: ' + this.el
)
}
},
/**
* Public update, called by the watcher in the dynamic
* literal scenario, e.g. <component :is="view">
*/
update (value) {
if (!this.literal) {
this.setComponent(value)
}
},
/**
* Switch dynamic components. May resolve the component
* asynchronously, and perform transition based on
* specified transition mode. Accepts a few additional
* arguments specifically for vue-router.
*
* The callback is called when the full transition is
* finished.
*
* @param {String} value
* @param {Function} [cb]
*/
setComponent (value, cb) {
this.invalidatePending()
if (!value) {
// just remove current
this.unbuild(true)
this.remove(this.childVM, cb)
this.childVM = null
} else {
var self = this
this.resolveComponent(value, function () {
self.mountComponent(cb)
})
}
},
/**
* Resolve the component constructor to use when creating
* the child vm.
*
* @param {String|Function} value
* @param {Function} cb
*/
resolveComponent (value, cb) {
var self = this
this.pendingComponentCb = cancellable(function (Component) {
self.ComponentName =
Component.options.name ||
(typeof value === 'string' ? value : null)
self.Component = Component
cb()
})
this.vm._resolveComponent(value, this.pendingComponentCb)
},
/**
* Create a new instance using the current constructor and
* replace the existing instance. This method doesn't care
* whether the new component and the old one are actually
* the same.
*
* @param {Function} [cb]
*/
mountComponent (cb) {
// actual mount
this.unbuild(true)
var self = this
var activateHooks = this.Component.options.activate
var cached = this.getCached()
var newComponent = this.build()
if (activateHooks && !cached) {
this.waitingFor = newComponent
callActivateHooks(activateHooks, newComponent, function () {
if (self.waitingFor !== newComponent) {
return
}
self.waitingFor = null
self.transition(newComponent, cb)
})
} else {
// update ref for kept-alive component
if (cached) {
newComponent._updateRef()
}
this.transition(newComponent, cb)
}
},
/**
* When the component changes or unbinds before an async
* constructor is resolved, we need to invalidate its
* pending callback.
*/
invalidatePending () {
if (this.pendingComponentCb) {
this.pendingComponentCb.cancel()
this.pendingComponentCb = null
}
},
/**
* Instantiate/insert a new child vm.
* If keep alive and has cached instance, insert that
* instance; otherwise build a new one and cache it.
*
* @param {Object} [extraOptions]
* @return {Vue} - the created instance
*/
build (extraOptions) {
var cached = this.getCached()
if (cached) {
return cached
}
if (this.Component) {
// default options
var options = {
name: this.ComponentName,
el: cloneNode(this.el),
template: this.inlineTemplate,
// make sure to add the child with correct parent
// if this is a transcluded component, its parent
// should be the transclusion host.
parent: this._host || this.vm,
// if no inline-template, then the compiled
// linker can be cached for better performance.
_linkerCachable: !this.inlineTemplate,
_ref: this.descriptor.ref,
_asComponent: true,
_isRouterView: this._isRouterView,
// if this is a transcluded component, context
// will be the common parent vm of this instance
// and its host.
_context: this.vm,
// if this is inside an inline v-for, the scope
// will be the intermediate scope created for this
// repeat fragment. this is used for linking props
// and container directives.
_scope: this._scope,
// pass in the owner fragment of this component.
// this is necessary so that the fragment can keep
// track of its contained components in order to
// call attach/detach hooks for them.
_frag: this._frag
}
// extra options
// in 1.0.0 this is used by vue-router only
/* istanbul ignore if */
if (extraOptions) {
extend(options, extraOptions)
}
var child = new this.Component(options)
if (this.keepAlive) {
this.cache[this.Component.cid] = child
}
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' &&
this.el.hasAttribute('transition') &&
child._isFragment) {
warn(
'Transitions will not work on a fragment instance. ' +
'Template: ' + child.$options.template,
child
)
}
return child
}
},
/**
* Try to get a cached instance of the current component.
*
* @return {Vue|undefined}
*/
getCached () {
return this.keepAlive && this.cache[this.Component.cid]
},
/**
* Teardown the current child, but defers cleanup so
* that we can separate the destroy and removal steps.
*
* @param {Boolean} defer
*/
unbuild (defer) {
if (this.waitingFor) {
if (!this.keepAlive) {
this.waitingFor.$destroy()
}
this.waitingFor = null
}
var child = this.childVM
if (!child || this.keepAlive) {
if (child) {
// remove ref
child._inactive = true
child._updateRef(true)
}
return
}
// the sole purpose of `deferCleanup` is so that we can
// "deactivate" the vm right now and perform DOM removal
// later.
child.$destroy(false, defer)
},
/**
* Remove current destroyed child and manually do
* the cleanup after removal.
*
* @param {Function} cb
*/
remove (child, cb) {
var keepAlive = this.keepAlive
if (child) {
// we may have a component switch when a previous
// component is still being transitioned out.
// we want to trigger only one lastest insertion cb
// when the existing transition finishes. (#1119)
this.pendingRemovals++
this.pendingRemovalCb = cb
var self = this
child.$remove(function () {
self.pendingRemovals--
if (!keepAlive) child._cleanup()
if (!self.pendingRemovals && self.pendingRemovalCb) {
self.pendingRemovalCb()
self.pendingRemovalCb = null
}
})
} else if (cb) {
cb()
}
},
/**
* Actually swap the components, depending on the
* transition mode. Defaults to simultaneous.
*
* @param {Vue} target
* @param {Function} [cb]
*/
transition (target, cb) {
var self = this
var current = this.childVM
// for devtool inspection
if (current) current._inactive = true
target._inactive = false
this.childVM = target
switch (self.params.transitionMode) {
case 'in-out':
target.$before(self.anchor, function () {
self.remove(current, cb)
})
break
case 'out-in':
self.remove(current, function () {
target.$before(self.anchor, cb)
})
break
default:
self.remove(current)
target.$before(self.anchor, cb)
}
},
/**
* Unbind.
*/
unbind () {
this.invalidatePending()
// Do not defer cleanup when unbinding
this.unbuild()
// destroy all keep-alive cached instances
if (this.cache) {
for (var key in this.cache) {
this.cache[key].$destroy()
}
this.cache = null
}
}
}
/**
* Call activate hooks in order (asynchronous)
*
* @param {Array} hooks
* @param {Vue} vm
* @param {Function} cb
*/
function callActivateHooks (hooks, vm, cb) {
var total = hooks.length
var called = 0
hooks[0].call(vm, next)
function next () {
if (++called >= total) {
cb()
} else {
hooks[called].call(vm, next)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/component.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,406 |
```javascript
import { resolveAsset, addClass, removeClass } from '../../util/index'
import { TRANSITION } from '../priorities'
import Transition from '../../transition/transition'
export default {
priority: TRANSITION,
update (id, oldId) {
var el = this.el
// resolve on owner vm
var hooks = resolveAsset(this.vm.$options, 'transitions', id)
id = id || 'v'
el.__v_trans = new Transition(el, id, hooks, this.vm)
if (oldId) {
removeClass(el, oldId + '-transition')
}
addClass(el, id + '-transition')
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/internal/transition.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 142 |
```javascript
import { on, off, warn } from '../../util/index'
import { ON } from '../priorities'
// keyCode aliases
const keyCodes = {
esc: 27,
tab: 9,
enter: 13,
space: 32,
'delete': [8, 46],
up: 38,
left: 37,
right: 39,
down: 40
}
function keyFilter (handler, keys) {
var codes = keys.map(function (key) {
var charCode = key.charCodeAt(0)
if (charCode > 47 && charCode < 58) {
return parseInt(key, 10)
}
if (key.length === 1) {
charCode = key.toUpperCase().charCodeAt(0)
if (charCode > 64 && charCode < 91) {
return charCode
}
}
return keyCodes[key]
})
codes = [].concat.apply([], codes)
return function keyHandler (e) {
if (codes.indexOf(e.keyCode) > -1) {
return handler.call(this, e)
}
}
}
function stopFilter (handler) {
return function stopHandler (e) {
e.stopPropagation()
return handler.call(this, e)
}
}
function preventFilter (handler) {
return function preventHandler (e) {
e.preventDefault()
return handler.call(this, e)
}
}
function selfFilter (handler) {
return function selfHandler (e) {
if (e.target === e.currentTarget) {
return handler.call(this, e)
}
}
}
export default {
priority: ON,
acceptStatement: true,
keyCodes,
bind () {
// deal with iframes
if (
this.el.tagName === 'IFRAME' &&
this.arg !== 'load'
) {
var self = this
this.iframeBind = function () {
on(
self.el.contentWindow,
self.arg,
self.handler,
self.modifiers.capture
)
}
this.on('load', this.iframeBind)
}
},
update (handler) {
// stub a noop for v-on with no value,
// e.g. @mousedown.prevent
if (!this.descriptor.raw) {
handler = function () {}
}
if (typeof handler !== 'function') {
process.env.NODE_ENV !== 'production' && warn(
'v-on:' + this.arg + '="' +
this.expression + '" expects a function value, ' +
'got ' + handler,
this.vm
)
return
}
// apply modifiers
if (this.modifiers.stop) {
handler = stopFilter(handler)
}
if (this.modifiers.prevent) {
handler = preventFilter(handler)
}
if (this.modifiers.self) {
handler = selfFilter(handler)
}
// key filter
var keys = Object.keys(this.modifiers)
.filter(function (key) {
return key !== 'stop' &&
key !== 'prevent' &&
key !== 'self' &&
key !== 'capture'
})
if (keys.length) {
handler = keyFilter(handler, keys)
}
this.reset()
this.handler = handler
if (this.iframeBind) {
this.iframeBind()
} else {
on(
this.el,
this.arg,
this.handler,
this.modifiers.capture
)
}
},
reset () {
var el = this.iframeBind
? this.el.contentWindow
: this.el
if (this.handler) {
off(el, this.arg, this.handler)
}
},
unbind () {
this.reset()
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/on.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 808 |
```javascript
import { warn } from '../../util/index'
export default {
bind () {
process.env.NODE_ENV !== 'production' && warn(
'v-ref:' + this.arg + ' must be used on a child ' +
'component. Found on <' + this.el.tagName.toLowerCase() + '>.',
this.vm
)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/ref.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 73 |
```javascript
import { warn, setClass, camelize } from '../../util/index'
import { BIND } from '../priorities'
import vStyle from '../internal/style'
import { tokensToExp } from '../../parsers/text'
// xlink
const xlinkNS = 'path_to_url
const xlinkRE = /^xlink:/
// check for attributes that prohibit interpolations
const disallowedInterpAttrRE = /^v-|^:|^@|^(?:is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/
// these attributes should also set their corresponding properties
// because they only affect the initial state of the element
const attrWithPropsRE = /^(?:value|checked|selected|muted)$/
// these attributes expect enumrated values of "true" or "false"
// but are not boolean attributes
const enumeratedAttrRE = /^(?:draggable|contenteditable|spellcheck)$/
// these attributes should set a hidden property for
// binding v-model to object values
const modelProps = {
value: '_value',
'true-value': '_trueValue',
'false-value': '_falseValue'
}
export default {
priority: BIND,
bind () {
var attr = this.arg
var tag = this.el.tagName
// should be deep watch on object mode
if (!attr) {
this.deep = true
}
// handle interpolation bindings
const descriptor = this.descriptor
const tokens = descriptor.interp
if (tokens) {
// handle interpolations with one-time tokens
if (descriptor.hasOneTime) {
this.expression = tokensToExp(tokens, this._scope || this.vm)
}
// only allow binding on native attributes
if (
disallowedInterpAttrRE.test(attr) ||
(attr === 'name' && (tag === 'PARTIAL' || tag === 'SLOT'))
) {
process.env.NODE_ENV !== 'production' && warn(
attr + '="' + descriptor.raw + '": ' +
'attribute interpolation is not allowed in Vue.js ' +
'directives and special attributes.',
this.vm
)
this.el.removeAttribute(attr)
this.invalid = true
}
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
var raw = attr + '="' + descriptor.raw + '": '
// warn src
if (attr === 'src') {
warn(
raw + 'interpolation in "src" attribute will cause ' +
'a 404 request. Use v-bind:src instead.',
this.vm
)
}
// warn style
if (attr === 'style') {
warn(
raw + 'interpolation in "style" attribute will cause ' +
'the attribute to be discarded in Internet Explorer. ' +
'Use v-bind:style instead.',
this.vm
)
}
}
}
},
update (value) {
if (this.invalid) {
return
}
var attr = this.arg
if (this.arg) {
this.handleSingle(attr, value)
} else {
this.handleObject(value || {})
}
},
// share object handler with v-bind:class
handleObject: vStyle.handleObject,
handleSingle (attr, value) {
const el = this.el
const interp = this.descriptor.interp
if (this.modifiers.camel) {
attr = camelize(attr)
}
if (
!interp &&
attrWithPropsRE.test(attr) &&
attr in el
) {
var attrValue = attr === 'value'
? value == null // IE9 will set input.value to "null" for null...
? ''
: value
: value
if (el[attr] !== attrValue) {
el[attr] = attrValue
}
}
// set model props
var modelProp = modelProps[attr]
if (!interp && modelProp) {
el[modelProp] = value
// update v-model if present
var model = el.__v_model
if (model) {
model.listener()
}
}
// do not set value attribute for textarea
if (attr === 'value' && el.tagName === 'TEXTAREA') {
el.removeAttribute(attr)
return
}
// update attribute
if (enumeratedAttrRE.test(attr)) {
el.setAttribute(attr, value ? 'true' : 'false')
} else if (value != null && value !== false) {
if (attr === 'class') {
// handle edge case #1960:
// class interpolation should not overwrite Vue transition class
if (el.__v_trans) {
value += ' ' + el.__v_trans.id + '-transition'
}
setClass(el, value)
} else if (xlinkRE.test(attr)) {
el.setAttributeNS(xlinkNS, attr, value === true ? '' : value)
} else {
el.setAttribute(attr, value === true ? '' : value)
}
} else {
el.removeAttribute(attr)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/bind.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,101 |
```javascript
// text & html
import text from './text'
import html from './html'
// logic control
import vFor from './for'
import vIf from './if'
import show from './show'
// two-way binding
import model from './model/index'
// event handling
import on from './on'
// attributes
import bind from './bind'
// ref & el
import el from './el'
import ref from './ref'
// cloak
import cloak from './cloak'
// must export plain object
export default {
text,
html,
'for': vFor,
'if': vIf,
show,
model,
on,
bind,
el,
ref,
cloak
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 150 |
```javascript
import FragmentFactory from '../../fragment/factory'
import { IF } from '../priorities'
import {
getAttr,
remove,
replace,
createAnchor,
warn
} from '../../util/index'
export default {
priority: IF,
terminal: true,
bind () {
var el = this.el
if (!el.__vue__) {
// check else block
var next = el.nextElementSibling
if (next && getAttr(next, 'v-else') !== null) {
remove(next)
this.elseEl = next
}
// check main block
this.anchor = createAnchor('v-if')
replace(el, this.anchor)
} else {
process.env.NODE_ENV !== 'production' && warn(
'v-if="' + this.expression + '" cannot be ' +
'used on an instance root element.',
this.vm
)
this.invalid = true
}
},
update (value) {
if (this.invalid) return
if (value) {
if (!this.frag) {
this.insert()
}
} else {
this.remove()
}
},
insert () {
if (this.elseFrag) {
this.elseFrag.remove()
this.elseFrag = null
}
// lazy init factory
if (!this.factory) {
this.factory = new FragmentFactory(this.vm, this.el)
}
this.frag = this.factory.create(this._host, this._scope, this._frag)
this.frag.before(this.anchor)
},
remove () {
if (this.frag) {
this.frag.remove()
this.frag = null
}
if (this.elseEl && !this.elseFrag) {
if (!this.elseFactory) {
this.elseFactory = new FragmentFactory(
this.elseEl._context || this.vm,
this.elseEl
)
}
this.elseFrag = this.elseFactory.create(this._host, this._scope, this._frag)
this.elseFrag.before(this.anchor)
}
},
unbind () {
if (this.frag) {
this.frag.destroy()
}
if (this.elseFrag) {
this.elseFrag.destroy()
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/if.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 502 |
```javascript
export default {
bind () {
var el = this.el
this.vm.$once('pre-hook:compiled', function () {
el.removeAttribute('v-cloak')
})
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/cloak.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 43 |
```javascript
import FragmentFactory from '../../fragment/factory'
import { FOR } from '../priorities'
import { withoutConversion } from '../../observer/index'
import { getPath } from '../../parsers/path'
import {
isObject,
warn,
createAnchor,
replace,
before,
after,
remove,
hasOwn,
inDoc,
defineReactive,
def,
cancellable,
isArray,
isPlainObject
} from '../../util/index'
let uid = 0
const vFor = {
priority: FOR,
terminal: true,
params: [
'track-by',
'stagger',
'enter-stagger',
'leave-stagger'
],
bind () {
// support "item in/of items" syntax
var inMatch = this.expression.match(/(.*) (?:in|of) (.*)/)
if (inMatch) {
var itMatch = inMatch[1].match(/\((.*),(.*)\)/)
if (itMatch) {
this.iterator = itMatch[1].trim()
this.alias = itMatch[2].trim()
} else {
this.alias = inMatch[1].trim()
}
this.expression = inMatch[2]
}
if (!this.alias) {
process.env.NODE_ENV !== 'production' && warn(
'Invalid v-for expression "' + this.descriptor.raw + '": ' +
'alias is required.',
this.vm
)
return
}
// uid as a cache identifier
this.id = '__v-for__' + (++uid)
// check if this is an option list,
// so that we know if we need to update the <select>'s
// v-model when the option list has changed.
// because v-model has a lower priority than v-for,
// the v-model is not bound here yet, so we have to
// retrive it in the actual updateModel() function.
var tag = this.el.tagName
this.isOption =
(tag === 'OPTION' || tag === 'OPTGROUP') &&
this.el.parentNode.tagName === 'SELECT'
// setup anchor nodes
this.start = createAnchor('v-for-start')
this.end = createAnchor('v-for-end')
replace(this.el, this.end)
before(this.start, this.end)
// cache
this.cache = Object.create(null)
// fragment factory
this.factory = new FragmentFactory(this.vm, this.el)
},
update (data) {
this.diff(data)
this.updateRef()
this.updateModel()
},
/**
* Diff, based on new data and old data, determine the
* minimum amount of DOM manipulations needed to make the
* DOM reflect the new data Array.
*
* The algorithm diffs the new data Array by storing a
* hidden reference to an owner vm instance on previously
* seen data. This allows us to achieve O(n) which is
* better than a levenshtein distance based algorithm,
* which is O(m * n).
*
* @param {Array} data
*/
diff (data) {
// check if the Array was converted from an Object
var item = data[0]
var convertedFromObject = this.fromObject =
isObject(item) &&
hasOwn(item, '$key') &&
hasOwn(item, '$value')
var trackByKey = this.params.trackBy
var oldFrags = this.frags
var frags = this.frags = new Array(data.length)
var alias = this.alias
var iterator = this.iterator
var start = this.start
var end = this.end
var inDocument = inDoc(start)
var init = !oldFrags
var i, l, frag, key, value, primitive
// First pass, go through the new Array and fill up
// the new frags array. If a piece of data has a cached
// instance for it, we reuse it. Otherwise build a new
// instance.
for (i = 0, l = data.length; i < l; i++) {
item = data[i]
key = convertedFromObject ? item.$key : null
value = convertedFromObject ? item.$value : item
primitive = !isObject(value)
frag = !init && this.getCachedFrag(value, i, key)
if (frag) { // reusable fragment
frag.reused = true
// update $index
frag.scope.$index = i
// update $key
if (key) {
frag.scope.$key = key
}
// update iterator
if (iterator) {
frag.scope[iterator] = key !== null ? key : i
}
// update data for track-by, object repeat &
// primitive values.
if (trackByKey || convertedFromObject || primitive) {
withoutConversion(() => {
frag.scope[alias] = value
})
}
} else { // new isntance
frag = this.create(value, alias, i, key)
frag.fresh = !init
}
frags[i] = frag
if (init) {
frag.before(end)
}
}
// we're done for the initial render.
if (init) {
return
}
// Second pass, go through the old fragments and
// destroy those who are not reused (and remove them
// from cache)
var removalIndex = 0
var totalRemoved = oldFrags.length - frags.length
// when removing a large number of fragments, watcher removal
// turns out to be a perf bottleneck, so we batch the watcher
// removals into a single filter call!
this.vm._vForRemoving = true
for (i = 0, l = oldFrags.length; i < l; i++) {
frag = oldFrags[i]
if (!frag.reused) {
this.deleteCachedFrag(frag)
this.remove(frag, removalIndex++, totalRemoved, inDocument)
}
}
this.vm._vForRemoving = false
if (removalIndex) {
this.vm._watchers = this.vm._watchers.filter(w => w.active)
}
// Final pass, move/insert new fragments into the
// right place.
var targetPrev, prevEl, currentPrev
var insertionIndex = 0
for (i = 0, l = frags.length; i < l; i++) {
frag = frags[i]
// this is the frag that we should be after
targetPrev = frags[i - 1]
prevEl = targetPrev
? targetPrev.staggerCb
? targetPrev.staggerAnchor
: targetPrev.end || targetPrev.node
: start
if (frag.reused && !frag.staggerCb) {
currentPrev = findPrevFrag(frag, start, this.id)
if (
currentPrev !== targetPrev && (
!currentPrev ||
// optimization for moving a single item.
// thanks to suggestions by @livoras in #1807
findPrevFrag(currentPrev, start, this.id) !== targetPrev
)
) {
this.move(frag, prevEl)
}
} else {
// new instance, or still in stagger.
// insert with updated stagger index.
this.insert(frag, insertionIndex++, prevEl, inDocument)
}
frag.reused = frag.fresh = false
}
},
/**
* Create a new fragment instance.
*
* @param {*} value
* @param {String} alias
* @param {Number} index
* @param {String} [key]
* @return {Fragment}
*/
create (value, alias, index, key) {
var host = this._host
// create iteration scope
var parentScope = this._scope || this.vm
var scope = Object.create(parentScope)
// ref holder for the scope
scope.$refs = Object.create(parentScope.$refs)
scope.$els = Object.create(parentScope.$els)
// make sure point $parent to parent scope
scope.$parent = parentScope
// for two-way binding on alias
scope.$forContext = this
// define scope properties
// important: define the scope alias without forced conversion
// so that frozen data structures remain non-reactive.
withoutConversion(() => {
defineReactive(scope, alias, value)
})
defineReactive(scope, '$index', index)
if (key) {
defineReactive(scope, '$key', key)
} else if (scope.$key) {
// avoid accidental fallback
def(scope, '$key', null)
}
if (this.iterator) {
defineReactive(scope, this.iterator, key !== null ? key : index)
}
var frag = this.factory.create(host, scope, this._frag)
frag.forId = this.id
this.cacheFrag(value, frag, index, key)
return frag
},
/**
* Update the v-ref on owner vm.
*/
updateRef () {
var ref = this.descriptor.ref
if (!ref) return
var hash = (this._scope || this.vm).$refs
var refs
if (!this.fromObject) {
refs = this.frags.map(findVmFromFrag)
} else {
refs = {}
this.frags.forEach(function (frag) {
refs[frag.scope.$key] = findVmFromFrag(frag)
})
}
hash[ref] = refs
},
/**
* For option lists, update the containing v-model on
* parent <select>.
*/
updateModel () {
if (this.isOption) {
var parent = this.start.parentNode
var model = parent && parent.__v_model
if (model) {
model.forceUpdate()
}
}
},
/**
* Insert a fragment. Handles staggering.
*
* @param {Fragment} frag
* @param {Number} index
* @param {Node} prevEl
* @param {Boolean} inDocument
*/
insert (frag, index, prevEl, inDocument) {
if (frag.staggerCb) {
frag.staggerCb.cancel()
frag.staggerCb = null
}
var staggerAmount = this.getStagger(frag, index, null, 'enter')
if (inDocument && staggerAmount) {
// create an anchor and insert it synchronously,
// so that we can resolve the correct order without
// worrying about some elements not inserted yet
var anchor = frag.staggerAnchor
if (!anchor) {
anchor = frag.staggerAnchor = createAnchor('stagger-anchor')
anchor.__v_frag = frag
}
after(anchor, prevEl)
var op = frag.staggerCb = cancellable(function () {
frag.staggerCb = null
frag.before(anchor)
remove(anchor)
})
setTimeout(op, staggerAmount)
} else {
var target = prevEl.nextSibling
/* istanbul ignore if */
if (!target) {
// reset end anchor position in case the position was messed up
// by an external drag-n-drop library.
after(this.end, prevEl)
target = this.end
}
frag.before(target)
}
},
/**
* Remove a fragment. Handles staggering.
*
* @param {Fragment} frag
* @param {Number} index
* @param {Number} total
* @param {Boolean} inDocument
*/
remove (frag, index, total, inDocument) {
if (frag.staggerCb) {
frag.staggerCb.cancel()
frag.staggerCb = null
// it's not possible for the same frag to be removed
// twice, so if we have a pending stagger callback,
// it means this frag is queued for enter but removed
// before its transition started. Since it is already
// destroyed, we can just leave it in detached state.
return
}
var staggerAmount = this.getStagger(frag, index, total, 'leave')
if (inDocument && staggerAmount) {
var op = frag.staggerCb = cancellable(function () {
frag.staggerCb = null
frag.remove()
})
setTimeout(op, staggerAmount)
} else {
frag.remove()
}
},
/**
* Move a fragment to a new position.
* Force no transition.
*
* @param {Fragment} frag
* @param {Node} prevEl
*/
move (frag, prevEl) {
// fix a common issue with Sortable:
// if prevEl doesn't have nextSibling, this means it's
// been dragged after the end anchor. Just re-position
// the end anchor to the end of the container.
/* istanbul ignore if */
if (!prevEl.nextSibling) {
this.end.parentNode.appendChild(this.end)
}
frag.before(prevEl.nextSibling, false)
},
/**
* Cache a fragment using track-by or the object key.
*
* @param {*} value
* @param {Fragment} frag
* @param {Number} index
* @param {String} [key]
*/
cacheFrag (value, frag, index, key) {
var trackByKey = this.params.trackBy
var cache = this.cache
var primitive = !isObject(value)
var id
if (key || trackByKey || primitive) {
id = getTrackByKey(index, key, value, trackByKey)
if (!cache[id]) {
cache[id] = frag
} else if (trackByKey !== '$index') {
process.env.NODE_ENV !== 'production' &&
this.warnDuplicate(value)
}
} else {
id = this.id
if (hasOwn(value, id)) {
if (value[id] === null) {
value[id] = frag
} else {
process.env.NODE_ENV !== 'production' &&
this.warnDuplicate(value)
}
} else if (Object.isExtensible(value)) {
def(value, id, frag)
} else if (process.env.NODE_ENV !== 'production') {
warn(
'Frozen v-for objects cannot be automatically tracked, make sure to ' +
'provide a track-by key.'
)
}
}
frag.raw = value
},
/**
* Get a cached fragment from the value/index/key
*
* @param {*} value
* @param {Number} index
* @param {String} key
* @return {Fragment}
*/
getCachedFrag (value, index, key) {
var trackByKey = this.params.trackBy
var primitive = !isObject(value)
var frag
if (key || trackByKey || primitive) {
var id = getTrackByKey(index, key, value, trackByKey)
frag = this.cache[id]
} else {
frag = value[this.id]
}
if (frag && (frag.reused || frag.fresh)) {
process.env.NODE_ENV !== 'production' &&
this.warnDuplicate(value)
}
return frag
},
/**
* Delete a fragment from cache.
*
* @param {Fragment} frag
*/
deleteCachedFrag (frag) {
var value = frag.raw
var trackByKey = this.params.trackBy
var scope = frag.scope
var index = scope.$index
// fix #948: avoid accidentally fall through to
// a parent repeater which happens to have $key.
var key = hasOwn(scope, '$key') && scope.$key
var primitive = !isObject(value)
if (trackByKey || key || primitive) {
var id = getTrackByKey(index, key, value, trackByKey)
this.cache[id] = null
} else {
value[this.id] = null
frag.raw = null
}
},
/**
* Get the stagger amount for an insertion/removal.
*
* @param {Fragment} frag
* @param {Number} index
* @param {Number} total
* @param {String} type
*/
getStagger (frag, index, total, type) {
type = type + 'Stagger'
var trans = frag.node.__v_trans
var hooks = trans && trans.hooks
var hook = hooks && (hooks[type] || hooks.stagger)
return hook
? hook.call(frag, index, total)
: index * parseInt(this.params[type] || this.params.stagger, 10)
},
/**
* Pre-process the value before piping it through the
* filters. This is passed to and called by the watcher.
*/
_preProcess (value) {
// regardless of type, store the un-filtered raw value.
this.rawValue = value
return value
},
/**
* Post-process the value after it has been piped through
* the filters. This is passed to and called by the watcher.
*
* It is necessary for this to be called during the
* wathcer's dependency collection phase because we want
* the v-for to update when the source Object is mutated.
*/
_postProcess (value) {
if (isArray(value)) {
return value
} else if (isPlainObject(value)) {
// convert plain object to array.
var keys = Object.keys(value)
var i = keys.length
var res = new Array(i)
var key
while (i--) {
key = keys[i]
res[i] = {
$key: key,
$value: value[key]
}
}
return res
} else {
if (typeof value === 'number' && !isNaN(value)) {
value = range(value)
}
return value || []
}
},
unbind () {
if (this.descriptor.ref) {
(this._scope || this.vm).$refs[this.descriptor.ref] = null
}
if (this.frags) {
var i = this.frags.length
var frag
while (i--) {
frag = this.frags[i]
this.deleteCachedFrag(frag)
frag.destroy()
}
}
}
}
/**
* Helper to find the previous element that is a fragment
* anchor. This is necessary because a destroyed frag's
* element could still be lingering in the DOM before its
* leaving transition finishes, but its inserted flag
* should have been set to false so we can skip them.
*
* If this is a block repeat, we want to make sure we only
* return frag that is bound to this v-for. (see #929)
*
* @param {Fragment} frag
* @param {Comment|Text} anchor
* @param {String} id
* @return {Fragment}
*/
function findPrevFrag (frag, anchor, id) {
var el = frag.node.previousSibling
/* istanbul ignore if */
if (!el) return
frag = el.__v_frag
while (
(!frag || frag.forId !== id || !frag.inserted) &&
el !== anchor
) {
el = el.previousSibling
/* istanbul ignore if */
if (!el) return
frag = el.__v_frag
}
return frag
}
/**
* Find a vm from a fragment.
*
* @param {Fragment} frag
* @return {Vue|undefined}
*/
function findVmFromFrag (frag) {
let node = frag.node
// handle multi-node frag
if (frag.end) {
while (!node.__vue__ && node !== frag.end && node.nextSibling) {
node = node.nextSibling
}
}
return node.__vue__
}
/**
* Create a range array from given number.
*
* @param {Number} n
* @return {Array}
*/
function range (n) {
var i = -1
var ret = new Array(Math.floor(n))
while (++i < n) {
ret[i] = i
}
return ret
}
/**
* Get the track by key for an item.
*
* @param {Number} index
* @param {String} key
* @param {*} value
* @param {String} [trackByKey]
*/
function getTrackByKey (index, key, value, trackByKey) {
return trackByKey
? trackByKey === '$index'
? index
: trackByKey.charAt(0).match(/\w/)
? getPath(value, trackByKey)
: value[trackByKey]
: (key || value)
}
if (process.env.NODE_ENV !== 'production') {
vFor.warnDuplicate = function (value) {
warn(
'Duplicate value found in v-for="' + this.descriptor.raw + '": ' +
JSON.stringify(value) + '. Use track-by="$index" if ' +
'you are expecting duplicate values.',
this.vm
)
}
}
export default vFor
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/for.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 4,609 |
```javascript
import { _toString } from '../../util/index'
export default {
bind () {
this.attr = this.el.nodeType === 3
? 'data'
: 'textContent'
},
update (value) {
this.el[this.attr] = _toString(value)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/text.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 61 |
```javascript
import { parseTemplate } from '../../parsers/template'
import {
createAnchor,
before,
replace,
remove,
_toString,
toArray
} from '../../util/index'
export default {
bind () {
// a comment node means this is a binding for
// {{{ inline unescaped html }}}
if (this.el.nodeType === 8) {
// hold nodes
this.nodes = []
// replace the placeholder with proper anchor
this.anchor = createAnchor('v-html')
replace(this.el, this.anchor)
}
},
update (value) {
value = _toString(value)
if (this.nodes) {
this.swap(value)
} else {
this.el.innerHTML = value
}
},
swap (value) {
// remove old nodes
var i = this.nodes.length
while (i--) {
remove(this.nodes[i])
}
// convert new value to a fragment
// do not attempt to retrieve from id selector
var frag = parseTemplate(value, true, true)
// save a reference to these nodes so we can remove later
this.nodes = toArray(frag.childNodes)
before(frag, this.anchor)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/html.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 259 |
```javascript
import { getAttr, inDoc } from '../../util/index'
import { applyTransition } from '../../transition/index'
export default {
bind () {
// check else block
var next = this.el.nextElementSibling
if (next && getAttr(next, 'v-else') !== null) {
this.elseEl = next
}
},
update (value) {
this.apply(this.el, value)
if (this.elseEl) {
this.apply(this.elseEl, !value)
}
},
apply (el, value) {
if (inDoc(el)) {
applyTransition(el, value ? 1 : -1, toggle, this.vm)
} else {
toggle()
}
function toggle () {
el.style.display = value ? '' : 'none'
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/show.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 179 |
```javascript
import { camelize, hasOwn, defineReactive } from '../../util/index'
import { EL } from '../priorities'
export default {
priority: EL,
bind () {
/* istanbul ignore if */
if (!this.arg) {
return
}
var id = this.id = camelize(this.arg)
var refs = (this._scope || this.vm).$els
if (hasOwn(refs, id)) {
refs[id] = this.el
} else {
defineReactive(refs, id, this.el)
}
},
unbind () {
var refs = (this._scope || this.vm).$els
if (refs[this.id] === this.el) {
refs[this.id] = null
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/el.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 170 |
```javascript
import { warn, resolveAsset } from '../../../util/index'
import { MODEL } from '../../priorities'
import text from './text'
import radio from './radio'
import select from './select'
import checkbox from './checkbox'
const handlers = {
text,
radio,
select,
checkbox
}
export default {
priority: MODEL,
twoWay: true,
handlers: handlers,
params: ['lazy', 'number', 'debounce'],
/**
* Possible elements:
* <select>
* <textarea>
* <input type="*">
* - text
* - checkbox
* - radio
* - number
*/
bind () {
// friendly warning...
this.checkFilters()
if (this.hasRead && !this.hasWrite) {
process.env.NODE_ENV !== 'production' && warn(
'It seems you are using a read-only filter with ' +
'v-model="' + this.descriptor.raw + '". ' +
'You might want to use a two-way filter to ensure correct behavior.',
this.vm
)
}
var el = this.el
var tag = el.tagName
var handler
if (tag === 'INPUT') {
handler = handlers[el.type] || handlers.text
} else if (tag === 'SELECT') {
handler = handlers.select
} else if (tag === 'TEXTAREA') {
handler = handlers.text
} else {
process.env.NODE_ENV !== 'production' && warn(
'v-model does not support element type: ' + tag,
this.vm
)
return
}
el.__v_model = this
handler.bind.call(this)
this.update = handler.update
this._unbind = handler.unbind
},
/**
* Check read/write filter stats.
*/
checkFilters () {
var filters = this.filters
if (!filters) return
var i = filters.length
while (i--) {
var filter = resolveAsset(this.vm.$options, 'filters', filters[i].name)
if (typeof filter === 'function' || filter.read) {
this.hasRead = true
}
if (filter.write) {
this.hasWrite = true
}
}
},
unbind () {
this.el.__v_model = null
this._unbind && this._unbind()
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/model/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 517 |
```javascript
import { isArray, toNumber, looseEqual } from '../../../util/index'
export default {
bind () {
var self = this
var el = this.el
// method to force update DOM using latest value.
this.forceUpdate = function () {
if (self._watcher) {
self.update(self._watcher.get())
}
}
// check if this is a multiple select
var multiple = this.multiple = el.hasAttribute('multiple')
// attach listener
this.listener = function () {
var value = getValue(el, multiple)
value = self.params.number
? isArray(value)
? value.map(toNumber)
: toNumber(value)
: value
self.set(value)
}
this.on('change', this.listener)
// if has initial value, set afterBind
var initValue = getValue(el, multiple, true)
if ((multiple && initValue.length) ||
(!multiple && initValue !== null)) {
this.afterBind = this.listener
}
// All major browsers except Firefox resets
// selectedIndex with value -1 to 0 when the element
// is appended to a new parent, therefore we have to
// force a DOM update whenever that happens...
this.vm.$on('hook:attached', this.forceUpdate)
},
update (value) {
var el = this.el
el.selectedIndex = -1
var multi = this.multiple && isArray(value)
var options = el.options
var i = options.length
var op, val
while (i--) {
op = options[i]
val = op.hasOwnProperty('_value')
? op._value
: op.value
/* eslint-disable eqeqeq */
op.selected = multi
? indexOf(value, val) > -1
: looseEqual(value, val)
/* eslint-enable eqeqeq */
}
},
unbind () {
/* istanbul ignore next */
this.vm.$off('hook:attached', this.forceUpdate)
}
}
/**
* Get select value
*
* @param {SelectElement} el
* @param {Boolean} multi
* @param {Boolean} init
* @return {Array|*}
*/
function getValue (el, multi, init) {
var res = multi ? [] : null
var op, val, selected
for (var i = 0, l = el.options.length; i < l; i++) {
op = el.options[i]
selected = init
? op.hasAttribute('selected')
: op.selected
if (selected) {
val = op.hasOwnProperty('_value')
? op._value
: op.value
if (multi) {
res.push(val)
} else {
return val
}
}
}
return res
}
/**
* Native Array.indexOf uses strict equal, but in this
* case we need to match string/numbers with custom equal.
*
* @param {Array} arr
* @param {*} val
*/
function indexOf (arr, val) {
var i = arr.length
while (i--) {
if (looseEqual(arr[i], val)) {
return i
}
}
return -1
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/model/select.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 700 |
```javascript
import {
toNumber,
isArray,
indexOf,
looseEqual
} from '../../../util/index'
export default {
bind () {
var self = this
var el = this.el
this.getValue = function () {
return el.hasOwnProperty('_value')
? el._value
: self.params.number
? toNumber(el.value)
: el.value
}
function getBooleanValue () {
var val = el.checked
if (val && el.hasOwnProperty('_trueValue')) {
return el._trueValue
}
if (!val && el.hasOwnProperty('_falseValue')) {
return el._falseValue
}
return val
}
this.listener = function () {
var model = self._watcher.value
if (isArray(model)) {
var val = self.getValue()
if (el.checked) {
if (indexOf(model, val) < 0) {
model.push(val)
}
} else {
model.$remove(val)
}
} else {
self.set(getBooleanValue())
}
}
this.on('change', this.listener)
if (el.hasAttribute('checked')) {
this.afterBind = this.listener
}
},
update (value) {
var el = this.el
if (isArray(value)) {
el.checked = indexOf(value, this.getValue()) > -1
} else {
if (el.hasOwnProperty('_trueValue')) {
el.checked = looseEqual(value, el._trueValue)
} else {
el.checked = !!value
}
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/model/checkbox.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 340 |
```javascript
/* global jQuery */
import {
isIE9,
isAndroid,
toNumber,
_toString,
nextTick,
debounce as _debounce
} from '../../../util/index'
export default {
bind () {
var self = this
var el = this.el
var isRange = el.type === 'range'
var lazy = this.params.lazy
var number = this.params.number
var debounce = this.params.debounce
// handle composition events.
// path_to_url
// skip this for Android because it handles composition
// events quite differently. Android doesn't trigger
// composition events for language input methods e.g.
// Chinese, but instead triggers them for spelling
// suggestions... (see Discussion/#162)
var composing = false
if (!isAndroid && !isRange) {
this.on('compositionstart', function () {
composing = true
})
this.on('compositionend', function () {
composing = false
// in IE11 the "compositionend" event fires AFTER
// the "input" event, so the input handler is blocked
// at the end... have to call it here.
//
// #1327: in lazy mode this is unecessary.
if (!lazy) {
self.listener()
}
})
}
// prevent messing with the input when user is typing,
// and force update on blur.
this.focused = false
if (!isRange && !lazy) {
this.on('focus', function () {
self.focused = true
})
this.on('blur', function () {
self.focused = false
// do not sync value after fragment removal (#2017)
if (!self._frag || self._frag.inserted) {
self.rawListener()
}
})
}
// Now attach the main listener
this.listener = this.rawListener = function () {
if (composing || !self._bound) {
return
}
var val = number || isRange
? toNumber(el.value)
: el.value
self.set(val)
// force update on next tick to avoid lock & same value
// also only update when user is not typing
nextTick(function () {
if (self._bound && !self.focused) {
self.update(self._watcher.value)
}
})
}
// apply debounce
if (debounce) {
this.listener = _debounce(this.listener, debounce)
}
// Support jQuery events, since jQuery.trigger() doesn't
// trigger native events in some cases and some plugins
// rely on $.trigger()
//
// We want to make sure if a listener is attached using
// jQuery, it is also removed with jQuery, that's why
// we do the check for each directive instance and
// store that check result on itself. This also allows
// easier test coverage control by unsetting the global
// jQuery variable in tests.
this.hasjQuery = typeof jQuery === 'function'
if (this.hasjQuery) {
const method = jQuery.fn.on ? 'on' : 'bind'
jQuery(el)[method]('change', this.rawListener)
if (!lazy) {
jQuery(el)[method]('input', this.listener)
}
} else {
this.on('change', this.rawListener)
if (!lazy) {
this.on('input', this.listener)
}
}
// IE9 doesn't fire input event on backspace/del/cut
if (!lazy && isIE9) {
this.on('cut', function () {
nextTick(self.listener)
})
this.on('keyup', function (e) {
if (e.keyCode === 46 || e.keyCode === 8) {
self.listener()
}
})
}
// set initial value if present
if (
el.hasAttribute('value') ||
(el.tagName === 'TEXTAREA' && el.value.trim())
) {
this.afterBind = this.listener
}
},
update (value) {
this.el.value = _toString(value)
},
unbind () {
var el = this.el
if (this.hasjQuery) {
const method = jQuery.fn.off ? 'off' : 'unbind'
jQuery(el)[method]('change', this.listener)
jQuery(el)[method]('input', this.listener)
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/model/text.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 959 |
```javascript
import { toNumber, looseEqual } from '../../../util/index'
export default {
bind () {
var self = this
var el = this.el
this.getValue = function () {
// value overwrite via v-bind:value
if (el.hasOwnProperty('_value')) {
return el._value
}
var val = el.value
if (self.params.number) {
val = toNumber(val)
}
return val
}
this.listener = function () {
self.set(self.getValue())
}
this.on('change', this.listener)
if (el.hasAttribute('checked')) {
this.afterBind = this.listener
}
},
update (value) {
this.el.checked = looseEqual(value, this.getValue())
}
}
``` | /content/code_sandbox/public/vendor/vue/src/directives/public/model/radio.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 164 |
```javascript
import Dep from './dep'
import { arrayMethods } from './array'
import {
def,
isArray,
isPlainObject,
hasProto,
hasOwn
} from '../util/index'
const arrayKeys = Object.getOwnPropertyNames(arrayMethods)
/**
* By default, when a reactive property is set, the new value is
* also converted to become reactive. However in certain cases, e.g.
* v-for scope alias and props, we don't want to force conversion
* because the value may be a nested value under a frozen data structure.
*
* So whenever we want to set a reactive property without forcing
* conversion on the new value, we wrap that call inside this function.
*/
let shouldConvert = true
export function withoutConversion (fn) {
shouldConvert = false
fn()
shouldConvert = true
}
/**
* Observer class that are attached to each observed
* object. Once attached, the observer converts target
* object's property keys into getter/setters that
* collect dependencies and dispatches updates.
*
* @param {Array|Object} value
* @constructor
*/
export function Observer (value) {
this.value = value
this.dep = new Dep()
def(value, '__ob__', this)
if (isArray(value)) {
var augment = hasProto
? protoAugment
: copyAugment
augment(value, arrayMethods, arrayKeys)
this.observeArray(value)
} else {
this.walk(value)
}
}
// Instance methods
/**
* Walk through each property and convert them into
* getter/setters. This method should only be called when
* value type is Object.
*
* @param {Object} obj
*/
Observer.prototype.walk = function (obj) {
var keys = Object.keys(obj)
for (var i = 0, l = keys.length; i < l; i++) {
this.convert(keys[i], obj[keys[i]])
}
}
/**
* Observe a list of Array items.
*
* @param {Array} items
*/
Observer.prototype.observeArray = function (items) {
for (var i = 0, l = items.length; i < l; i++) {
observe(items[i])
}
}
/**
* Convert a property into getter/setter so we can emit
* the events when the property is accessed/changed.
*
* @param {String} key
* @param {*} val
*/
Observer.prototype.convert = function (key, val) {
defineReactive(this.value, key, val)
}
/**
* Add an owner vm, so that when $set/$delete mutations
* happen we can notify owner vms to proxy the keys and
* digest the watchers. This is only called when the object
* is observed as an instance's root $data.
*
* @param {Vue} vm
*/
Observer.prototype.addVm = function (vm) {
(this.vms || (this.vms = [])).push(vm)
}
/**
* Remove an owner vm. This is called when the object is
* swapped out as an instance's $data object.
*
* @param {Vue} vm
*/
Observer.prototype.removeVm = function (vm) {
this.vms.$remove(vm)
}
// helpers
/**
* Augment an target Object or Array by intercepting
* the prototype chain using __proto__
*
* @param {Object|Array} target
* @param {Object} src
*/
function protoAugment (target, src) {
/* eslint-disable no-proto */
target.__proto__ = src
/* eslint-enable no-proto */
}
/**
* Augment an target Object or Array by defining
* hidden properties.
*
* @param {Object|Array} target
* @param {Object} proto
*/
function copyAugment (target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i]
def(target, key, src[key])
}
}
/**
* Attempt to create an observer instance for a value,
* returns the new observer if successfully observed,
* or the existing observer if the value already has one.
*
* @param {*} value
* @param {Vue} [vm]
* @return {Observer|undefined}
* @static
*/
export function observe (value, vm) {
if (!value || typeof value !== 'object') {
return
}
var ob
if (
hasOwn(value, '__ob__') &&
value.__ob__ instanceof Observer
) {
ob = value.__ob__
} else if (
shouldConvert &&
(isArray(value) || isPlainObject(value)) &&
Object.isExtensible(value) &&
!value._isVue
) {
ob = new Observer(value)
}
if (ob && vm) {
ob.addVm(vm)
}
return ob
}
/**
* Define a reactive property on an Object.
*
* @param {Object} obj
* @param {String} key
* @param {*} val
*/
export function defineReactive (obj, key, val) {
var dep = new Dep()
var property = Object.getOwnPropertyDescriptor(obj, key)
if (property && property.configurable === false) {
return
}
// cater for pre-defined getter/setters
var getter = property && property.get
var setter = property && property.set
var childOb = observe(val)
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val
if (Dep.target) {
dep.depend()
if (childOb) {
childOb.dep.depend()
}
if (isArray(value)) {
for (var e, i = 0, l = value.length; i < l; i++) {
e = value[i]
e && e.__ob__ && e.__ob__.dep.depend()
}
}
}
return value
},
set: function reactiveSetter (newVal) {
var value = getter ? getter.call(obj) : val
if (newVal === value) {
return
}
if (setter) {
setter.call(obj, newVal)
} else {
val = newVal
}
childOb = observe(newVal)
dep.notify()
}
})
}
``` | /content/code_sandbox/public/vendor/vue/src/observer/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,363 |
```javascript
import { toArray } from '../util/index'
let uid = 0
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*
* @constructor
*/
export default function Dep () {
this.id = uid++
this.subs = []
}
// the current target watcher being evaluated.
// this is globally unique because there could be only one
// watcher being evaluated at any time.
Dep.target = null
/**
* Add a directive subscriber.
*
* @param {Directive} sub
*/
Dep.prototype.addSub = function (sub) {
this.subs.push(sub)
}
/**
* Remove a directive subscriber.
*
* @param {Directive} sub
*/
Dep.prototype.removeSub = function (sub) {
this.subs.$remove(sub)
}
/**
* Add self as a dependency to the target watcher.
*/
Dep.prototype.depend = function () {
Dep.target.addDep(this)
}
/**
* Notify all subscribers of a new value.
*/
Dep.prototype.notify = function () {
// stablize the subscriber list first
var subs = toArray(this.subs)
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update()
}
}
``` | /content/code_sandbox/public/vendor/vue/src/observer/dep.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 258 |
```javascript
import { def, indexOf } from '../util/index'
const arrayProto = Array.prototype
export const arrayMethods = Object.create(arrayProto)
/**
* Intercept mutating methods and emit events
*/
;[
'push',
'pop',
'shift',
'unshift',
'splice',
'sort',
'reverse'
]
.forEach(function (method) {
// cache original method
var original = arrayProto[method]
def(arrayMethods, method, function mutator () {
// avoid leaking arguments:
// path_to_url
var i = arguments.length
var args = new Array(i)
while (i--) {
args[i] = arguments[i]
}
var result = original.apply(this, args)
var ob = this.__ob__
var inserted
switch (method) {
case 'push':
inserted = args
break
case 'unshift':
inserted = args
break
case 'splice':
inserted = args.slice(2)
break
}
if (inserted) ob.observeArray(inserted)
// notify change
ob.dep.notify()
return result
})
})
/**
* Swap the element at the given index with a new value
* and emits corresponding event.
*
* @param {Number} index
* @param {*} val
* @return {*} - replaced element
*/
def(
arrayProto,
'$set',
function $set (index, val) {
if (index >= this.length) {
this.length = Number(index) + 1
}
return this.splice(index, 1, val)[0]
}
)
/**
* Convenience method to remove the element at given index or target element reference.
*
* @param {*} item
*/
def(
arrayProto,
'$remove',
function $remove (item) {
/* istanbul ignore if */
if (!this.length) return
var index = indexOf(this, item)
if (index > -1) {
return this.splice(index, 1)
}
}
)
``` | /content/code_sandbox/public/vendor/vue/src/observer/array.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 440 |
```javascript
/* global MutationObserver */
// can we use __proto__?
export const hasProto = '__proto__' in {}
// Browser environment sniffing
export const inBrowser =
typeof window !== 'undefined' &&
Object.prototype.toString.call(window) !== '[object Object]'
// detect devtools
export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
// UA sniffing for working around browser-specific quirks
const UA = inBrowser && window.navigator.userAgent.toLowerCase()
export const isIE9 = UA && UA.indexOf('msie 9.0') > 0
export const isAndroid = UA && UA.indexOf('android') > 0
export const isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA)
export const isWechat = UA && UA.indexOf('micromessenger') > 0
let transitionProp
let transitionEndEvent
let animationProp
let animationEndEvent
// Transition property/event sniffing
if (inBrowser && !isIE9) {
const isWebkitTrans =
window.ontransitionend === undefined &&
window.onwebkittransitionend !== undefined
const isWebkitAnim =
window.onanimationend === undefined &&
window.onwebkitanimationend !== undefined
transitionProp = isWebkitTrans
? 'WebkitTransition'
: 'transition'
transitionEndEvent = isWebkitTrans
? 'webkitTransitionEnd'
: 'transitionend'
animationProp = isWebkitAnim
? 'WebkitAnimation'
: 'animation'
animationEndEvent = isWebkitAnim
? 'webkitAnimationEnd'
: 'animationend'
}
export {
transitionProp,
transitionEndEvent,
animationProp,
animationEndEvent
}
/**
* Defer a task to execute it asynchronously. Ideally this
* should be executed as a microtask, so we leverage
* MutationObserver if it's available, and fallback to
* setTimeout(0).
*
* @param {Function} cb
* @param {Object} ctx
*/
export const nextTick = (function () {
var callbacks = []
var pending = false
var timerFunc
function nextTickHandler () {
pending = false
var copies = callbacks.slice(0)
callbacks = []
for (var i = 0; i < copies.length; i++) {
copies[i]()
}
}
/* istanbul ignore if */
if (typeof MutationObserver !== 'undefined' && !(isWechat && isIos)) {
var counter = 1
var observer = new MutationObserver(nextTickHandler)
var textNode = document.createTextNode(counter)
observer.observe(textNode, {
characterData: true
})
timerFunc = function () {
counter = (counter + 1) % 2
textNode.data = counter
}
} else {
// webpack attempts to inject a shim for setImmediate
// if it is used as a global, so we have to work around that to
// avoid bundling unnecessary code.
const context = inBrowser
? window
: typeof global !== 'undefined' ? global : {}
timerFunc = context.setImmediate || setTimeout
}
return function (cb, ctx) {
var func = ctx
? function () { cb.call(ctx) }
: cb
callbacks.push(func)
if (pending) return
pending = true
timerFunc(nextTickHandler, 0)
}
})()
let _Set
/* istanbul ignore if */
if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {
// use native Set when available.
_Set = Set
} else {
// a non-standard Set polyfill that only works with primitive keys.
_Set = function () {
this.set = Object.create(null)
}
_Set.prototype.has = function (key) {
return this.set[key] !== undefined
}
_Set.prototype.add = function (key) {
this.set[key] = 1
}
_Set.prototype.clear = function () {
this.set = Object.create(null)
}
}
export { _Set }
``` | /content/code_sandbox/public/vendor/vue/src/util/env.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 900 |
```javascript
export * from './lang'
export * from './env'
export * from './dom'
export * from './options'
export * from './component'
export * from './debug'
export { defineReactive } from '../observer/index'
``` | /content/code_sandbox/public/vendor/vue/src/util/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 48 |
```javascript
/**
* Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't
* already exist.
*
* @param {Object} obj
* @param {String} key
* @param {*} val
* @public
*/
export function set (obj, key, val) {
if (hasOwn(obj, key)) {
obj[key] = val
return
}
if (obj._isVue) {
set(obj._data, key, val)
return
}
var ob = obj.__ob__
if (!ob) {
obj[key] = val
return
}
ob.convert(key, val)
ob.dep.notify()
if (ob.vms) {
var i = ob.vms.length
while (i--) {
var vm = ob.vms[i]
vm._proxy(key)
vm._digest()
}
}
return val
}
/**
* Delete a property and trigger change if necessary.
*
* @param {Object} obj
* @param {String} key
*/
export function del (obj, key) {
if (!hasOwn(obj, key)) {
return
}
delete obj[key]
var ob = obj.__ob__
if (!ob) {
if (obj._isVue) {
delete obj._data[key]
obj._digest()
}
return
}
ob.dep.notify()
if (ob.vms) {
var i = ob.vms.length
while (i--) {
var vm = ob.vms[i]
vm._unproxy(key)
vm._digest()
}
}
}
var hasOwnProperty = Object.prototype.hasOwnProperty
/**
* Check whether the object has the property.
*
* @param {Object} obj
* @param {String} key
* @return {Boolean}
*/
export function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
/**
* Check if an expression is a literal value.
*
* @param {String} exp
* @return {Boolean}
*/
var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/
export function isLiteral (exp) {
return literalValueRE.test(exp)
}
/**
* Check if a string starts with $ or _
*
* @param {String} str
* @return {Boolean}
*/
export function isReserved (str) {
var c = (str + '').charCodeAt(0)
return c === 0x24 || c === 0x5F
}
/**
* Guard text output, make sure undefined outputs
* empty string
*
* @param {*} value
* @return {String}
*/
export function _toString (value) {
return value == null
? ''
: value.toString()
}
/**
* Check and convert possible numeric strings to numbers
* before setting back to data
*
* @param {*} value
* @return {*|Number}
*/
export function toNumber (value) {
if (typeof value !== 'string') {
return value
} else {
var parsed = Number(value)
return isNaN(parsed)
? value
: parsed
}
}
/**
* Convert string boolean literals into real booleans.
*
* @param {*} value
* @return {*|Boolean}
*/
export function toBoolean (value) {
return value === 'true'
? true
: value === 'false'
? false
: value
}
/**
* Strip quotes from a string
*
* @param {String} str
* @return {String | false}
*/
export function stripQuotes (str) {
var a = str.charCodeAt(0)
var b = str.charCodeAt(str.length - 1)
return a === b && (a === 0x22 || a === 0x27)
? str.slice(1, -1)
: str
}
/**
* Camelize a hyphen-delmited string.
*
* @param {String} str
* @return {String}
*/
var camelizeRE = /-(\w)/g
export function camelize (str) {
return str.replace(camelizeRE, toUpper)
}
function toUpper (_, c) {
return c ? c.toUpperCase() : ''
}
/**
* Hyphenate a camelCase string.
*
* @param {String} str
* @return {String}
*/
var hyphenateRE = /([a-z\d])([A-Z])/g
export function hyphenate (str) {
return str
.replace(hyphenateRE, '$1-$2')
.toLowerCase()
}
/**
* Converts hyphen/underscore/slash delimitered names into
* camelized classNames.
*
* e.g. my-component => MyComponent
* some_else => SomeElse
* some/comp => SomeComp
*
* @param {String} str
* @return {String}
*/
var classifyRE = /(?:^|[-_\/])(\w)/g
export function classify (str) {
return str.replace(classifyRE, toUpper)
}
/**
* Simple bind, faster than native
*
* @param {Function} fn
* @param {Object} ctx
* @return {Function}
*/
export function bind (fn, ctx) {
return function (a) {
var l = arguments.length
return l
? l > 1
? fn.apply(ctx, arguments)
: fn.call(ctx, a)
: fn.call(ctx)
}
}
/**
* Convert an Array-like object to a real Array.
*
* @param {Array-like} list
* @param {Number} [start] - start index
* @return {Array}
*/
export function toArray (list, start) {
start = start || 0
var i = list.length - start
var ret = new Array(i)
while (i--) {
ret[i] = list[i + start]
}
return ret
}
/**
* Mix properties into target object.
*
* @param {Object} to
* @param {Object} from
*/
export function extend (to, from) {
var keys = Object.keys(from)
var i = keys.length
while (i--) {
to[keys[i]] = from[keys[i]]
}
return to
}
/**
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
*
* @param {*} obj
* @return {Boolean}
*/
export function isObject (obj) {
return obj !== null && typeof obj === 'object'
}
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*
* @param {*} obj
* @return {Boolean}
*/
var toString = Object.prototype.toString
var OBJECT_STRING = '[object Object]'
export function isPlainObject (obj) {
return toString.call(obj) === OBJECT_STRING
}
/**
* Array type check.
*
* @param {*} obj
* @return {Boolean}
*/
export const isArray = Array.isArray
/**
* Define a property.
*
* @param {Object} obj
* @param {String} key
* @param {*} val
* @param {Boolean} [enumerable]
*/
export function def (obj, key, val, enumerable) {
Object.defineProperty(obj, key, {
value: val,
enumerable: !!enumerable,
writable: true,
configurable: true
})
}
/**
* Debounce a function so it only gets called after the
* input stops arriving after the given wait period.
*
* @param {Function} func
* @param {Number} wait
* @return {Function} - the debounced function
*/
export function debounce (func, wait) {
var timeout, args, context, timestamp, result
var later = function () {
var last = Date.now() - timestamp
if (last < wait && last >= 0) {
timeout = setTimeout(later, wait - last)
} else {
timeout = null
result = func.apply(context, args)
if (!timeout) context = args = null
}
}
return function () {
context = this
args = arguments
timestamp = Date.now()
if (!timeout) {
timeout = setTimeout(later, wait)
}
return result
}
}
/**
* Manual indexOf because it's slightly faster than
* native.
*
* @param {Array} arr
* @param {*} obj
*/
export function indexOf (arr, obj) {
var i = arr.length
while (i--) {
if (arr[i] === obj) return i
}
return -1
}
/**
* Make a cancellable version of an async callback.
*
* @param {Function} fn
* @return {Function}
*/
export function cancellable (fn) {
var cb = function () {
if (!cb.cancelled) {
return fn.apply(this, arguments)
}
}
cb.cancel = function () {
cb.cancelled = true
}
return cb
}
/**
* Check if two values are loosely equal - that is,
* if they are plain objects, do they have the same shape?
*
* @param {*} a
* @param {*} b
* @return {Boolean}
*/
export function looseEqual (a, b) {
/* eslint-disable eqeqeq */
return a == b || (
isObject(a) && isObject(b)
? JSON.stringify(a) === JSON.stringify(b)
: false
)
/* eslint-enable eqeqeq */
}
``` | /content/code_sandbox/public/vendor/vue/src/util/lang.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,070 |
```javascript
import { warn } from './debug'
import { resolveAsset } from './options'
import { getBindAttr } from './dom'
export const commonTagRE = /^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/i
export const reservedTagRE = /^(slot|partial|component)$/i
let isUnknownElement
if (process.env.NODE_ENV !== 'production') {
isUnknownElement = function (el, tag) {
if (tag.indexOf('-') > -1) {
// path_to_url
return (
el.constructor === window.HTMLUnknownElement ||
el.constructor === window.HTMLElement
)
} else {
return (
/HTMLUnknownElement/.test(el.toString()) &&
// Chrome returns unknown for several HTML5 elements.
// path_to_url
!/^(data|time|rtc|rb)$/.test(tag)
)
}
}
}
/**
* Check if an element is a component, if yes return its
* component id.
*
* @param {Element} el
* @param {Object} options
* @return {Object|undefined}
*/
export function checkComponentAttr (el, options) {
var tag = el.tagName.toLowerCase()
var hasAttrs = el.hasAttributes()
if (!commonTagRE.test(tag) && !reservedTagRE.test(tag)) {
if (resolveAsset(options, 'components', tag)) {
return { id: tag }
} else {
var is = hasAttrs && getIsBinding(el, options)
if (is) {
return is
} else if (process.env.NODE_ENV !== 'production') {
var expectedTag =
options._componentNameMap &&
options._componentNameMap[tag]
if (expectedTag) {
warn(
'Unknown custom element: <' + tag + '> - ' +
'did you mean <' + expectedTag + '>? ' +
'HTML is case-insensitive, remember to use kebab-case in templates.'
)
} else if (isUnknownElement(el, tag)) {
warn(
'Unknown custom element: <' + tag + '> - did you ' +
'register the component correctly? For recursive components, ' +
'make sure to provide the "name" option.'
)
}
}
}
} else if (hasAttrs) {
return getIsBinding(el, options)
}
}
/**
* Get "is" binding from an element.
*
* @param {Element} el
* @param {Object} options
* @return {Object|undefined}
*/
function getIsBinding (el, options) {
// dynamic syntax
var exp = el.getAttribute('is')
if (exp != null) {
if (resolveAsset(options, 'components', exp)) {
el.removeAttribute('is')
return { id: exp }
}
} else {
exp = getBindAttr(el, 'is')
if (exp != null) {
return { id: exp, dynamic: true }
}
}
}
``` | /content/code_sandbox/public/vendor/vue/src/util/component.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 698 |
```javascript
import config from '../config'
import { isIE9 } from './env'
import { warn } from './debug'
import { camelize } from './lang'
import { removeWithTransition } from '../transition/index'
/**
* Query an element selector if it's not an element already.
*
* @param {String|Element} el
* @return {Element}
*/
export function query (el) {
if (typeof el === 'string') {
var selector = el
el = document.querySelector(el)
if (!el) {
process.env.NODE_ENV !== 'production' && warn(
'Cannot find element: ' + selector
)
}
}
return el
}
/**
* Check if a node is in the document.
* Note: document.documentElement.contains should work here
* but always returns false for comment nodes in phantomjs,
* making unit tests difficult. This is fixed by doing the
* contains() check on the node's parentNode instead of
* the node itself.
*
* @param {Node} node
* @return {Boolean}
*/
export function inDoc (node) {
if (!node) return false
var doc = node.ownerDocument.documentElement
var parent = node.parentNode
return doc === node ||
doc === parent ||
!!(parent && parent.nodeType === 1 && (doc.contains(parent)))
}
/**
* Get and remove an attribute from a node.
*
* @param {Node} node
* @param {String} _attr
*/
export function getAttr (node, _attr) {
var val = node.getAttribute(_attr)
if (val !== null) {
node.removeAttribute(_attr)
}
return val
}
/**
* Get an attribute with colon or v-bind: prefix.
*
* @param {Node} node
* @param {String} name
* @return {String|null}
*/
export function getBindAttr (node, name) {
var val = getAttr(node, ':' + name)
if (val === null) {
val = getAttr(node, 'v-bind:' + name)
}
return val
}
/**
* Check the presence of a bind attribute.
*
* @param {Node} node
* @param {String} name
* @return {Boolean}
*/
export function hasBindAttr (node, name) {
return node.hasAttribute(name) ||
node.hasAttribute(':' + name) ||
node.hasAttribute('v-bind:' + name)
}
/**
* Insert el before target
*
* @param {Element} el
* @param {Element} target
*/
export function before (el, target) {
target.parentNode.insertBefore(el, target)
}
/**
* Insert el after target
*
* @param {Element} el
* @param {Element} target
*/
export function after (el, target) {
if (target.nextSibling) {
before(el, target.nextSibling)
} else {
target.parentNode.appendChild(el)
}
}
/**
* Remove el from DOM
*
* @param {Element} el
*/
export function remove (el) {
el.parentNode.removeChild(el)
}
/**
* Prepend el to target
*
* @param {Element} el
* @param {Element} target
*/
export function prepend (el, target) {
if (target.firstChild) {
before(el, target.firstChild)
} else {
target.appendChild(el)
}
}
/**
* Replace target with el
*
* @param {Element} target
* @param {Element} el
*/
export function replace (target, el) {
var parent = target.parentNode
if (parent) {
parent.replaceChild(el, target)
}
}
/**
* Add event listener shorthand.
*
* @param {Element} el
* @param {String} event
* @param {Function} cb
* @param {Boolean} [useCapture]
*/
export function on (el, event, cb, useCapture) {
el.addEventListener(event, cb, useCapture)
}
/**
* Remove event listener shorthand.
*
* @param {Element} el
* @param {String} event
* @param {Function} cb
*/
export function off (el, event, cb) {
el.removeEventListener(event, cb)
}
/**
* For IE9 compat: when both class and :class are present
* getAttribute('class') returns wrong value...
*
* @param {Element} el
* @return {String}
*/
function getClass (el) {
var classname = el.className
if (typeof classname === 'object') {
classname = classname.baseVal || ''
}
return classname
}
/**
* In IE9, setAttribute('class') will result in empty class
* if the element also has the :class attribute; However in
* PhantomJS, setting `className` does not work on SVG elements...
* So we have to do a conditional check here.
*
* @param {Element} el
* @param {String} cls
*/
export function setClass (el, cls) {
/* istanbul ignore if */
if (isIE9 && !/svg$/.test(el.namespaceURI)) {
el.className = cls
} else {
el.setAttribute('class', cls)
}
}
/**
* Add class with compatibility for IE & SVG
*
* @param {Element} el
* @param {String} cls
*/
export function addClass (el, cls) {
if (el.classList) {
el.classList.add(cls)
} else {
var cur = ' ' + getClass(el) + ' '
if (cur.indexOf(' ' + cls + ' ') < 0) {
setClass(el, (cur + cls).trim())
}
}
}
/**
* Remove class with compatibility for IE & SVG
*
* @param {Element} el
* @param {String} cls
*/
export function removeClass (el, cls) {
if (el.classList) {
el.classList.remove(cls)
} else {
var cur = ' ' + getClass(el) + ' '
var tar = ' ' + cls + ' '
while (cur.indexOf(tar) >= 0) {
cur = cur.replace(tar, ' ')
}
setClass(el, cur.trim())
}
if (!el.className) {
el.removeAttribute('class')
}
}
/**
* Extract raw content inside an element into a temporary
* container div
*
* @param {Element} el
* @param {Boolean} asFragment
* @return {Element|DocumentFragment}
*/
export function extractContent (el, asFragment) {
var child
var rawContent
/* istanbul ignore if */
if (isTemplate(el) && isFragment(el.content)) {
el = el.content
}
if (el.hasChildNodes()) {
trimNode(el)
rawContent = asFragment
? document.createDocumentFragment()
: document.createElement('div')
/* eslint-disable no-cond-assign */
while (child = el.firstChild) {
/* eslint-enable no-cond-assign */
rawContent.appendChild(child)
}
}
return rawContent
}
/**
* Trim possible empty head/tail text and comment
* nodes inside a parent.
*
* @param {Node} node
*/
export function trimNode (node) {
var child
/* eslint-disable no-sequences */
while (child = node.firstChild, isTrimmable(child)) {
node.removeChild(child)
}
while (child = node.lastChild, isTrimmable(child)) {
node.removeChild(child)
}
/* eslint-enable no-sequences */
}
function isTrimmable (node) {
return node && (
(node.nodeType === 3 && !node.data.trim()) ||
node.nodeType === 8
)
}
/**
* Check if an element is a template tag.
* Note if the template appears inside an SVG its tagName
* will be in lowercase.
*
* @param {Element} el
*/
export function isTemplate (el) {
return el.tagName &&
el.tagName.toLowerCase() === 'template'
}
/**
* Create an "anchor" for performing dom insertion/removals.
* This is used in a number of scenarios:
* - fragment instance
* - v-html
* - v-if
* - v-for
* - component
*
* @param {String} content
* @param {Boolean} persist - IE trashes empty textNodes on
* cloneNode(true), so in certain
* cases the anchor needs to be
* non-empty to be persisted in
* templates.
* @return {Comment|Text}
*/
export function createAnchor (content, persist) {
var anchor = config.debug
? document.createComment(content)
: document.createTextNode(persist ? ' ' : '')
anchor.__v_anchor = true
return anchor
}
/**
* Find a component ref attribute that starts with $.
*
* @param {Element} node
* @return {String|undefined}
*/
var refRE = /^v-ref:/
export function findRef (node) {
if (node.hasAttributes()) {
var attrs = node.attributes
for (var i = 0, l = attrs.length; i < l; i++) {
var name = attrs[i].name
if (refRE.test(name)) {
return camelize(name.replace(refRE, ''))
}
}
}
}
/**
* Map a function to a range of nodes .
*
* @param {Node} node
* @param {Node} end
* @param {Function} op
*/
export function mapNodeRange (node, end, op) {
var next
while (node !== end) {
next = node.nextSibling
op(node)
node = next
}
op(end)
}
/**
* Remove a range of nodes with transition, store
* the nodes in a fragment with correct ordering,
* and call callback when done.
*
* @param {Node} start
* @param {Node} end
* @param {Vue} vm
* @param {DocumentFragment} frag
* @param {Function} cb
*/
export function removeNodeRange (start, end, vm, frag, cb) {
var done = false
var removed = 0
var nodes = []
mapNodeRange(start, end, function (node) {
if (node === end) done = true
nodes.push(node)
removeWithTransition(node, vm, onRemoved)
})
function onRemoved () {
removed++
if (done && removed >= nodes.length) {
for (var i = 0; i < nodes.length; i++) {
frag.appendChild(nodes[i])
}
cb && cb()
}
}
}
/**
* Check if a node is a DocumentFragment.
*
* @param {Node} node
* @return {Boolean}
*/
export function isFragment (node) {
return node && node.nodeType === 11
}
/**
* Get outerHTML of elements, taking care
* of SVG elements in IE as well.
*
* @param {Element} el
* @return {String}
*/
export function getOuterHTML (el) {
if (el.outerHTML) {
return el.outerHTML
} else {
var container = document.createElement('div')
container.appendChild(el.cloneNode(true))
return container.innerHTML
}
}
``` | /content/code_sandbox/public/vendor/vue/src/util/dom.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,419 |
```javascript
import config from '../config'
import { hyphenate } from './lang'
let warn
let formatComponentName
if (process.env.NODE_ENV !== 'production') {
const hasConsole = typeof console !== 'undefined'
warn = (msg, vm) => {
if (hasConsole && (!config.silent)) {
console.error('[Vue warn]: ' + msg + (vm ? formatComponentName(vm) : ''))
}
}
formatComponentName = vm => {
var name = vm._isVue ? vm.$options.name : vm.name
return name
? ' (found in component: <' + hyphenate(name) + '>)'
: ''
}
}
export { warn }
``` | /content/code_sandbox/public/vendor/vue/src/util/debug.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 154 |
```javascript
import Vue from '../instance/vue'
import config from '../config'
import {
extend,
set,
isObject,
isArray,
isPlainObject,
hasOwn,
camelize,
hyphenate
} from './lang'
import { warn } from './debug'
import { commonTagRE, reservedTagRE } from './component'
/**
* Option overwriting strategies are functions that handle
* how to merge a parent option value and a child option
* value into the final value.
*
* All strategy functions follow the same signature:
*
* @param {*} parentVal
* @param {*} childVal
* @param {Vue} [vm]
*/
var strats = config.optionMergeStrategies = Object.create(null)
/**
* Helper that recursively merges two data objects together.
*/
function mergeData (to, from) {
var key, toVal, fromVal
for (key in from) {
toVal = to[key]
fromVal = from[key]
if (!hasOwn(to, key)) {
set(to, key, fromVal)
} else if (isObject(toVal) && isObject(fromVal)) {
mergeData(toVal, fromVal)
}
}
return to
}
/**
* Data
*/
strats.data = function (parentVal, childVal, vm) {
if (!vm) {
// in a Vue.extend merge, both should be functions
if (!childVal) {
return parentVal
}
if (typeof childVal !== 'function') {
process.env.NODE_ENV !== 'production' && warn(
'The "data" option should be a function ' +
'that returns a per-instance value in component ' +
'definitions.',
vm
)
return parentVal
}
if (!parentVal) {
return childVal
}
// when parentVal & childVal are both present,
// we need to return a function that returns the
// merged result of both functions... no need to
// check if parentVal is a function here because
// it has to be a function to pass previous merges.
return function mergedDataFn () {
return mergeData(
childVal.call(this),
parentVal.call(this)
)
}
} else if (parentVal || childVal) {
return function mergedInstanceDataFn () {
// instance merge
var instanceData = typeof childVal === 'function'
? childVal.call(vm)
: childVal
var defaultData = typeof parentVal === 'function'
? parentVal.call(vm)
: undefined
if (instanceData) {
return mergeData(instanceData, defaultData)
} else {
return defaultData
}
}
}
}
/**
* El
*/
strats.el = function (parentVal, childVal, vm) {
if (!vm && childVal && typeof childVal !== 'function') {
process.env.NODE_ENV !== 'production' && warn(
'The "el" option should be a function ' +
'that returns a per-instance value in component ' +
'definitions.',
vm
)
return
}
var ret = childVal || parentVal
// invoke the element factory if this is instance merge
return vm && typeof ret === 'function'
? ret.call(vm)
: ret
}
/**
* Hooks and param attributes are merged as arrays.
*/
strats.init =
strats.created =
strats.ready =
strats.attached =
strats.detached =
strats.beforeCompile =
strats.compiled =
strats.beforeDestroy =
strats.destroyed =
strats.activate = function (parentVal, childVal) {
return childVal
? parentVal
? parentVal.concat(childVal)
: isArray(childVal)
? childVal
: [childVal]
: parentVal
}
/**
* Assets
*
* When a vm is present (instance creation), we need to do
* a three-way merge between constructor options, instance
* options and parent options.
*/
function mergeAssets (parentVal, childVal) {
var res = Object.create(parentVal || null)
return childVal
? extend(res, guardArrayAssets(childVal))
: res
}
config._assetTypes.forEach(function (type) {
strats[type + 's'] = mergeAssets
})
/**
* Events & Watchers.
*
* Events & watchers hashes should not overwrite one
* another, so we merge them as arrays.
*/
strats.watch =
strats.events = function (parentVal, childVal) {
if (!childVal) return parentVal
if (!parentVal) return childVal
var ret = {}
extend(ret, parentVal)
for (var key in childVal) {
var parent = ret[key]
var child = childVal[key]
if (parent && !isArray(parent)) {
parent = [parent]
}
ret[key] = parent
? parent.concat(child)
: [child]
}
return ret
}
/**
* Other object hashes.
*/
strats.props =
strats.methods =
strats.computed = function (parentVal, childVal) {
if (!childVal) return parentVal
if (!parentVal) return childVal
var ret = Object.create(null)
extend(ret, parentVal)
extend(ret, childVal)
return ret
}
/**
* Default strategy.
*/
var defaultStrat = function (parentVal, childVal) {
return childVal === undefined
? parentVal
: childVal
}
/**
* Make sure component options get converted to actual
* constructors.
*
* @param {Object} options
*/
function guardComponents (options) {
if (options.components) {
var components = options.components =
guardArrayAssets(options.components)
var ids = Object.keys(components)
var def
if (process.env.NODE_ENV !== 'production') {
var map = options._componentNameMap = {}
}
for (var i = 0, l = ids.length; i < l; i++) {
var key = ids[i]
if (commonTagRE.test(key) || reservedTagRE.test(key)) {
process.env.NODE_ENV !== 'production' && warn(
'Do not use built-in or reserved HTML elements as component ' +
'id: ' + key
)
continue
}
// record a all lowercase <-> kebab-case mapping for
// possible custom element case error warning
if (process.env.NODE_ENV !== 'production') {
map[key.replace(/-/g, '').toLowerCase()] = hyphenate(key)
}
def = components[key]
if (isPlainObject(def)) {
components[key] = Vue.extend(def)
}
}
}
}
/**
* Ensure all props option syntax are normalized into the
* Object-based format.
*
* @param {Object} options
*/
function guardProps (options) {
var props = options.props
var i, val
if (isArray(props)) {
options.props = {}
i = props.length
while (i--) {
val = props[i]
if (typeof val === 'string') {
options.props[val] = null
} else if (val.name) {
options.props[val.name] = val
}
}
} else if (isPlainObject(props)) {
var keys = Object.keys(props)
i = keys.length
while (i--) {
val = props[keys[i]]
if (typeof val === 'function') {
props[keys[i]] = { type: val }
}
}
}
}
/**
* Guard an Array-format assets option and converted it
* into the key-value Object format.
*
* @param {Object|Array} assets
* @return {Object}
*/
function guardArrayAssets (assets) {
if (isArray(assets)) {
var res = {}
var i = assets.length
var asset
while (i--) {
asset = assets[i]
var id = typeof asset === 'function'
? ((asset.options && asset.options.name) || asset.id)
: (asset.name || asset.id)
if (!id) {
process.env.NODE_ENV !== 'production' && warn(
'Array-syntax assets must provide a "name" or "id" field.'
)
} else {
res[id] = asset
}
}
return res
}
return assets
}
/**
* Merge two option objects into a new one.
* Core utility used in both instantiation and inheritance.
*
* @param {Object} parent
* @param {Object} child
* @param {Vue} [vm] - if vm is present, indicates this is
* an instantiation merge.
*/
export function mergeOptions (parent, child, vm) {
guardComponents(child)
guardProps(child)
if (process.env.NODE_ENV !== 'production') {
if (child.propsData && !vm) {
warn('propsData can only be used as an instantiation option.')
}
}
var options = {}
var key
if (child.extends) {
parent = typeof child.extends === 'function'
? mergeOptions(parent, child.extends.options, vm)
: mergeOptions(parent, child.extends, vm)
}
if (child.mixins) {
for (var i = 0, l = child.mixins.length; i < l; i++) {
parent = mergeOptions(parent, child.mixins[i], vm)
}
}
for (key in parent) {
mergeField(key)
}
for (key in child) {
if (!hasOwn(parent, key)) {
mergeField(key)
}
}
function mergeField (key) {
var strat = strats[key] || defaultStrat
options[key] = strat(parent[key], child[key], vm, key)
}
return options
}
/**
* Resolve an asset.
* This function is used because child instances need access
* to assets defined in its ancestor chain.
*
* @param {Object} options
* @param {String} type
* @param {String} id
* @param {Boolean} warnMissing
* @return {Object|Function}
*/
export function resolveAsset (options, type, id, warnMissing) {
/* istanbul ignore if */
if (typeof id !== 'string') {
return
}
var assets = options[type]
var camelizedId
var res = assets[id] ||
// camelCase ID
assets[camelizedId = camelize(id)] ||
// Pascal Case ID
assets[camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)]
if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
warn(
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
options
)
}
return res
}
``` | /content/code_sandbox/public/vendor/vue/src/util/options.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,354 |
```javascript
import { nextTick } from '../util/index'
let queue = []
let queued = false
/**
* Push a job into the queue.
*
* @param {Function} job
*/
export function pushJob (job) {
queue.push(job)
if (!queued) {
queued = true
nextTick(flush)
}
}
/**
* Flush the queue, and do one forced reflow before
* triggering transitions.
*/
function flush () {
// Force layout
var f = document.documentElement.offsetHeight
for (var i = 0; i < queue.length; i++) {
queue[i]()
}
queue = []
queued = false
// dummy return, so js linters don't complain about
// unused variable f
return f
}
``` | /content/code_sandbox/public/vendor/vue/src/transition/queue.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 165 |
```javascript
import {
before,
remove,
transitionEndEvent
} from '../util/index'
/**
* Append with transition.
*
* @param {Element} el
* @param {Element} target
* @param {Vue} vm
* @param {Function} [cb]
*/
export function appendWithTransition (el, target, vm, cb) {
applyTransition(el, 1, function () {
target.appendChild(el)
}, vm, cb)
}
/**
* InsertBefore with transition.
*
* @param {Element} el
* @param {Element} target
* @param {Vue} vm
* @param {Function} [cb]
*/
export function beforeWithTransition (el, target, vm, cb) {
applyTransition(el, 1, function () {
before(el, target)
}, vm, cb)
}
/**
* Remove with transition.
*
* @param {Element} el
* @param {Vue} vm
* @param {Function} [cb]
*/
export function removeWithTransition (el, vm, cb) {
applyTransition(el, -1, function () {
remove(el)
}, vm, cb)
}
/**
* Apply transitions with an operation callback.
*
* @param {Element} el
* @param {Number} direction
* 1: enter
* -1: leave
* @param {Function} op - the actual DOM operation
* @param {Vue} vm
* @param {Function} [cb]
*/
export function applyTransition (el, direction, op, vm, cb) {
var transition = el.__v_trans
if (
!transition ||
// skip if there are no js hooks and CSS transition is
// not supported
(!transition.hooks && !transitionEndEvent) ||
// skip transitions for initial compile
!vm._isCompiled ||
// if the vm is being manipulated by a parent directive
// during the parent's compilation phase, skip the
// animation.
(vm.$parent && !vm.$parent._isCompiled)
) {
op()
if (cb) cb()
return
}
var action = direction > 0 ? 'enter' : 'leave'
transition[action](op, cb)
}
``` | /content/code_sandbox/public/vendor/vue/src/transition/index.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 483 |
```javascript
import { pushJob } from './queue'
import {
on,
off,
bind,
addClass,
removeClass,
cancellable,
transitionEndEvent,
animationEndEvent,
transitionProp,
animationProp,
warn,
inBrowser
} from '../util/index'
const TYPE_TRANSITION = 'transition'
const TYPE_ANIMATION = 'animation'
const transDurationProp = transitionProp + 'Duration'
const animDurationProp = animationProp + 'Duration'
/**
* If a just-entered element is applied the
* leave class while its enter transition hasn't started yet,
* and the transitioned property has the same value for both
* enter/leave, then the leave transition will be skipped and
* the transitionend event never fires. This function ensures
* its callback to be called after a transition has started
* by waiting for double raf.
*
* It falls back to setTimeout on devices that support CSS
* transitions but not raf (e.g. Android 4.2 browser) - since
* these environments are usually slow, we are giving it a
* relatively large timeout.
*/
const raf = inBrowser && window.requestAnimationFrame
const waitForTransitionStart = raf
/* istanbul ignore next */
? function (fn) { raf(function () { raf(fn) }) }
: function (fn) { setTimeout(fn, 50) }
/**
* A Transition object that encapsulates the state and logic
* of the transition.
*
* @param {Element} el
* @param {String} id
* @param {Object} hooks
* @param {Vue} vm
*/
export default function Transition (el, id, hooks, vm) {
this.id = id
this.el = el
this.enterClass = (hooks && hooks.enterClass) || id + '-enter'
this.leaveClass = (hooks && hooks.leaveClass) || id + '-leave'
this.hooks = hooks
this.vm = vm
// async state
this.pendingCssEvent =
this.pendingCssCb =
this.cancel =
this.pendingJsCb =
this.op =
this.cb = null
this.justEntered = false
this.entered = this.left = false
this.typeCache = {}
// check css transition type
this.type = hooks && hooks.type
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
if (
this.type &&
this.type !== TYPE_TRANSITION &&
this.type !== TYPE_ANIMATION
) {
warn(
'invalid CSS transition type for transition="' +
this.id + '": ' + this.type,
vm
)
}
}
// bind
var self = this
;['enterNextTick', 'enterDone', 'leaveNextTick', 'leaveDone']
.forEach(function (m) {
self[m] = bind(self[m], self)
})
}
var p = Transition.prototype
/**
* Start an entering transition.
*
* 1. enter transition triggered
* 2. call beforeEnter hook
* 3. add enter class
* 4. insert/show element
* 5. call enter hook (with possible explicit js callback)
* 6. reflow
* 7. based on transition type:
* - transition:
* remove class now, wait for transitionend,
* then done if there's no explicit js callback.
* - animation:
* wait for animationend, remove class,
* then done if there's no explicit js callback.
* - no css transition:
* done now if there's no explicit js callback.
* 8. wait for either done or js callback, then call
* afterEnter hook.
*
* @param {Function} op - insert/show the element
* @param {Function} [cb]
*/
p.enter = function (op, cb) {
this.cancelPending()
this.callHook('beforeEnter')
this.cb = cb
addClass(this.el, this.enterClass)
op()
this.entered = false
this.callHookWithCb('enter')
if (this.entered) {
return // user called done synchronously.
}
this.cancel = this.hooks && this.hooks.enterCancelled
pushJob(this.enterNextTick)
}
/**
* The "nextTick" phase of an entering transition, which is
* to be pushed into a queue and executed after a reflow so
* that removing the class can trigger a CSS transition.
*/
p.enterNextTick = function () {
// prevent transition skipping
this.justEntered = true
waitForTransitionStart(() => {
this.justEntered = false
})
var enterDone = this.enterDone
var type = this.getCssTransitionType(this.enterClass)
if (!this.pendingJsCb) {
if (type === TYPE_TRANSITION) {
// trigger transition by removing enter class now
removeClass(this.el, this.enterClass)
this.setupCssCb(transitionEndEvent, enterDone)
} else if (type === TYPE_ANIMATION) {
this.setupCssCb(animationEndEvent, enterDone)
} else {
enterDone()
}
} else if (type === TYPE_TRANSITION) {
removeClass(this.el, this.enterClass)
}
}
/**
* The "cleanup" phase of an entering transition.
*/
p.enterDone = function () {
this.entered = true
this.cancel = this.pendingJsCb = null
removeClass(this.el, this.enterClass)
this.callHook('afterEnter')
if (this.cb) this.cb()
}
/**
* Start a leaving transition.
*
* 1. leave transition triggered.
* 2. call beforeLeave hook
* 3. add leave class (trigger css transition)
* 4. call leave hook (with possible explicit js callback)
* 5. reflow if no explicit js callback is provided
* 6. based on transition type:
* - transition or animation:
* wait for end event, remove class, then done if
* there's no explicit js callback.
* - no css transition:
* done if there's no explicit js callback.
* 7. wait for either done or js callback, then call
* afterLeave hook.
*
* @param {Function} op - remove/hide the element
* @param {Function} [cb]
*/
p.leave = function (op, cb) {
this.cancelPending()
this.callHook('beforeLeave')
this.op = op
this.cb = cb
addClass(this.el, this.leaveClass)
this.left = false
this.callHookWithCb('leave')
if (this.left) {
return // user called done synchronously.
}
this.cancel = this.hooks && this.hooks.leaveCancelled
// only need to handle leaveDone if
// 1. the transition is already done (synchronously called
// by the user, which causes this.op set to null)
// 2. there's no explicit js callback
if (this.op && !this.pendingJsCb) {
// if a CSS transition leaves immediately after enter,
// the transitionend event never fires. therefore we
// detect such cases and end the leave immediately.
if (this.justEntered) {
this.leaveDone()
} else {
pushJob(this.leaveNextTick)
}
}
}
/**
* The "nextTick" phase of a leaving transition.
*/
p.leaveNextTick = function () {
var type = this.getCssTransitionType(this.leaveClass)
if (type) {
var event = type === TYPE_TRANSITION
? transitionEndEvent
: animationEndEvent
this.setupCssCb(event, this.leaveDone)
} else {
this.leaveDone()
}
}
/**
* The "cleanup" phase of a leaving transition.
*/
p.leaveDone = function () {
this.left = true
this.cancel = this.pendingJsCb = null
this.op()
removeClass(this.el, this.leaveClass)
this.callHook('afterLeave')
if (this.cb) this.cb()
this.op = null
}
/**
* Cancel any pending callbacks from a previously running
* but not finished transition.
*/
p.cancelPending = function () {
this.op = this.cb = null
var hasPending = false
if (this.pendingCssCb) {
hasPending = true
off(this.el, this.pendingCssEvent, this.pendingCssCb)
this.pendingCssEvent = this.pendingCssCb = null
}
if (this.pendingJsCb) {
hasPending = true
this.pendingJsCb.cancel()
this.pendingJsCb = null
}
if (hasPending) {
removeClass(this.el, this.enterClass)
removeClass(this.el, this.leaveClass)
}
if (this.cancel) {
this.cancel.call(this.vm, this.el)
this.cancel = null
}
}
/**
* Call a user-provided synchronous hook function.
*
* @param {String} type
*/
p.callHook = function (type) {
if (this.hooks && this.hooks[type]) {
this.hooks[type].call(this.vm, this.el)
}
}
/**
* Call a user-provided, potentially-async hook function.
* We check for the length of arguments to see if the hook
* expects a `done` callback. If true, the transition's end
* will be determined by when the user calls that callback;
* otherwise, the end is determined by the CSS transition or
* animation.
*
* @param {String} type
*/
p.callHookWithCb = function (type) {
var hook = this.hooks && this.hooks[type]
if (hook) {
if (hook.length > 1) {
this.pendingJsCb = cancellable(this[type + 'Done'])
}
hook.call(this.vm, this.el, this.pendingJsCb)
}
}
/**
* Get an element's transition type based on the
* calculated styles.
*
* @param {String} className
* @return {Number}
*/
p.getCssTransitionType = function (className) {
/* istanbul ignore if */
if (
!transitionEndEvent ||
// skip CSS transitions if page is not visible -
// this solves the issue of transitionend events not
// firing until the page is visible again.
// pageVisibility API is supported in IE10+, same as
// CSS transitions.
document.hidden ||
// explicit js-only transition
(this.hooks && this.hooks.css === false) ||
// element is hidden
isHidden(this.el)
) {
return
}
var type = this.type || this.typeCache[className]
if (type) return type
var inlineStyles = this.el.style
var computedStyles = window.getComputedStyle(this.el)
var transDuration =
inlineStyles[transDurationProp] ||
computedStyles[transDurationProp]
if (transDuration && transDuration !== '0s') {
type = TYPE_TRANSITION
} else {
var animDuration =
inlineStyles[animDurationProp] ||
computedStyles[animDurationProp]
if (animDuration && animDuration !== '0s') {
type = TYPE_ANIMATION
}
}
if (type) {
this.typeCache[className] = type
}
return type
}
/**
* Setup a CSS transitionend/animationend callback.
*
* @param {String} event
* @param {Function} cb
*/
p.setupCssCb = function (event, cb) {
this.pendingCssEvent = event
var self = this
var el = this.el
var onEnd = this.pendingCssCb = function (e) {
if (e.target === el) {
off(el, event, onEnd)
self.pendingCssEvent = self.pendingCssCb = null
if (!self.pendingJsCb && cb) {
cb()
}
}
}
on(el, event, onEnd)
}
/**
* Check if an element is hidden - in that case we can just
* skip the transition alltogether.
*
* @param {Element} el
* @return {Boolean}
*/
function isHidden (el) {
if (/svg$/.test(el.namespaceURI)) {
// SVG elements do not have offset(Width|Height)
// so we need to check the client rect
var rect = el.getBoundingClientRect()
return !(rect.width || rect.height)
} else {
return !(
el.offsetWidth ||
el.offsetHeight ||
el.getClientRects().length
)
}
}
``` | /content/code_sandbox/public/vendor/vue/src/transition/transition.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 2,724 |
```javascript
import {
createAnchor,
before,
prepend,
inDoc,
mapNodeRange,
removeNodeRange
} from '../util/index'
import {
beforeWithTransition,
removeWithTransition
} from '../transition/index'
/**
* Abstraction for a partially-compiled fragment.
* Can optionally compile content with a child scope.
*
* @param {Function} linker
* @param {Vue} vm
* @param {DocumentFragment} frag
* @param {Vue} [host]
* @param {Object} [scope]
* @param {Fragment} [parentFrag]
*/
export default function Fragment (linker, vm, frag, host, scope, parentFrag) {
this.children = []
this.childFrags = []
this.vm = vm
this.scope = scope
this.inserted = false
this.parentFrag = parentFrag
if (parentFrag) {
parentFrag.childFrags.push(this)
}
this.unlink = linker(vm, frag, host, scope, this)
var single = this.single =
frag.childNodes.length === 1 &&
// do not go single mode if the only node is an anchor
!(frag.childNodes[0].__v_anchor)
if (single) {
this.node = frag.childNodes[0]
this.before = singleBefore
this.remove = singleRemove
} else {
this.node = createAnchor('fragment-start')
this.end = createAnchor('fragment-end')
this.frag = frag
prepend(this.node, frag)
frag.appendChild(this.end)
this.before = multiBefore
this.remove = multiRemove
}
this.node.__v_frag = this
}
/**
* Call attach/detach for all components contained within
* this fragment. Also do so recursively for all child
* fragments.
*
* @param {Function} hook
*/
Fragment.prototype.callHook = function (hook) {
var i, l
for (i = 0, l = this.childFrags.length; i < l; i++) {
this.childFrags[i].callHook(hook)
}
for (i = 0, l = this.children.length; i < l; i++) {
hook(this.children[i])
}
}
/**
* Insert fragment before target, single node version
*
* @param {Node} target
* @param {Boolean} withTransition
*/
function singleBefore (target, withTransition) {
this.inserted = true
var method = withTransition !== false
? beforeWithTransition
: before
method(this.node, target, this.vm)
if (inDoc(this.node)) {
this.callHook(attach)
}
}
/**
* Remove fragment, single node version
*/
function singleRemove () {
this.inserted = false
var shouldCallRemove = inDoc(this.node)
var self = this
this.beforeRemove()
removeWithTransition(this.node, this.vm, function () {
if (shouldCallRemove) {
self.callHook(detach)
}
self.destroy()
})
}
/**
* Insert fragment before target, multi-nodes version
*
* @param {Node} target
* @param {Boolean} withTransition
*/
function multiBefore (target, withTransition) {
this.inserted = true
var vm = this.vm
var method = withTransition !== false
? beforeWithTransition
: before
mapNodeRange(this.node, this.end, function (node) {
method(node, target, vm)
})
if (inDoc(this.node)) {
this.callHook(attach)
}
}
/**
* Remove fragment, multi-nodes version
*/
function multiRemove () {
this.inserted = false
var self = this
var shouldCallRemove = inDoc(this.node)
this.beforeRemove()
removeNodeRange(this.node, this.end, this.vm, this.frag, function () {
if (shouldCallRemove) {
self.callHook(detach)
}
self.destroy()
})
}
/**
* Prepare the fragment for removal.
*/
Fragment.prototype.beforeRemove = function () {
var i, l
for (i = 0, l = this.childFrags.length; i < l; i++) {
// call the same method recursively on child
// fragments, depth-first
this.childFrags[i].beforeRemove(false)
}
for (i = 0, l = this.children.length; i < l; i++) {
// Call destroy for all contained instances,
// with remove:false and defer:true.
// Defer is necessary because we need to
// keep the children to call detach hooks
// on them.
this.children[i].$destroy(false, true)
}
var dirs = this.unlink.dirs
for (i = 0, l = dirs.length; i < l; i++) {
// disable the watchers on all the directives
// so that the rendered content stays the same
// during removal.
dirs[i]._watcher && dirs[i]._watcher.teardown()
}
}
/**
* Destroy the fragment.
*/
Fragment.prototype.destroy = function () {
if (this.parentFrag) {
this.parentFrag.childFrags.$remove(this)
}
this.node.__v_frag = null
this.unlink()
}
/**
* Call attach hook for a Vue instance.
*
* @param {Vue} child
*/
function attach (child) {
if (!child._isAttached && inDoc(child.$el)) {
child._callHook('attached')
}
}
/**
* Call detach hook for a Vue instance.
*
* @param {Vue} child
*/
function detach (child) {
if (child._isAttached && !inDoc(child.$el)) {
child._callHook('detached')
}
}
``` | /content/code_sandbox/public/vendor/vue/src/fragment/fragment.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 1,253 |
```javascript
import { compile } from '../compiler/index'
import { isTemplate, getOuterHTML } from '../util/index'
import { parseTemplate, cloneNode } from '../parsers/template'
import Fragment from './fragment'
import Cache from '../cache'
const linkerCache = new Cache(5000)
/**
* A factory that can be used to create instances of a
* fragment. Caches the compiled linker if possible.
*
* @param {Vue} vm
* @param {Element|String} el
*/
export default function FragmentFactory (vm, el) {
this.vm = vm
var template
var isString = typeof el === 'string'
if (isString || isTemplate(el) && !el.hasAttribute('v-if')) {
template = parseTemplate(el, true)
} else {
template = document.createDocumentFragment()
template.appendChild(el)
}
this.template = template
// linker can be cached, but only for components
var linker
var cid = vm.constructor.cid
if (cid > 0) {
var cacheId = cid + (isString ? el : getOuterHTML(el))
linker = linkerCache.get(cacheId)
if (!linker) {
linker = compile(template, vm.$options, true)
linkerCache.put(cacheId, linker)
}
} else {
linker = compile(template, vm.$options, true)
}
this.linker = linker
}
/**
* Create a fragment instance with given host and scope.
*
* @param {Vue} host
* @param {Object} scope
* @param {Fragment} parentFrag
*/
FragmentFactory.prototype.create = function (host, scope, parentFrag) {
var frag = cloneNode(this.template)
return new Fragment(this.linker, this.vm, frag, host, scope, parentFrag)
}
``` | /content/code_sandbox/public/vendor/vue/src/fragment/factory.js | javascript | 2016-03-03T01:33:10 | 2024-08-16T12:05:02 | Attendize | Attendize/Attendize | 3,955 | 393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.