├── .babelrc ├── .gitignore ├── README.md ├── app.js ├── dist ├── bundle.js ├── index.html └── js │ ├── es5-sham.js │ ├── es5-sham.map │ ├── es5-sham.min.js │ ├── es5-shim.js │ ├── es5-shim.map │ ├── es5-shim.min.js │ ├── hack.js │ ├── html5shiv-printshiv.min.js │ ├── html5shiv.min.js │ └── respond.min.js ├── package-lock.json ├── package.json ├── src ├── assets │ ├── iconfont │ │ ├── demo.css │ │ ├── demo_fontclass.html │ │ ├── demo_symbol.html │ │ ├── demo_unicode.html │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.js │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ └── imgs │ │ ├── aaa.png │ │ ├── acti-01.png │ │ ├── acti-02.png │ │ ├── acti-03.png │ │ ├── barner-01.png │ │ ├── barner-02.png │ │ ├── barner-03.png │ │ ├── barner-04.png │ │ ├── down_code.png │ │ ├── index_act_01.png │ │ ├── index_act_02.png │ │ ├── logo.png │ │ ├── logoicon.png │ │ ├── mall-barner-01.png │ │ ├── mall-barner-02.png │ │ ├── mall-barner-03.png │ │ └── sprite.png ├── common │ ├── common.css │ └── hack │ │ ├── hack.js │ │ ├── html5shiv-printshiv.min.js │ │ ├── html5shiv.min.js │ │ └── respond.min.js ├── components │ ├── Login │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── LoginInfo │ │ ├── boy.png │ │ ├── girl.png │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Menu │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── PageTab │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── StatusBar │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── TopBar │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ └── index.js ├── index.css ├── index.html ├── index.js ├── pages │ ├── Home │ │ ├── actions.js │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page101 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page102 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page103 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page104 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page201 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page202 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page203 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page204 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page301 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page302 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page303 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page304 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page401 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page402 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page403 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page404 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page501 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page502 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page503 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ ├── Page504 │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ └── index.js ├── route.config.js ├── services │ ├── animate │ │ └── index.js │ ├── createPage.js │ ├── createStroe.js │ ├── index.js │ ├── parseCssModule.js │ └── routes │ │ ├── HashRouter │ │ └── index.js │ │ ├── NavLink │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ │ ├── Page │ │ ├── index.css │ │ ├── index.html │ │ └── index.js │ │ ├── Route │ │ └── index.js │ │ ├── index.js │ │ └── router.js └── vmodels │ ├── app.vm.js │ └── index.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets":["es2015"], 3 | "plugins": [ 4 | "add-module-exports", 5 | "transform-es3-member-expression-literals", 6 | "transform-es3-property-literals" 7 | ] 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directories 2 | node_modules/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # avalon-spa-app 2 | 3 | 1.git clone https://github.com/Levan-Du/avalon-spa-app.git 4 | 5 | 2.npm install 6 | 7 | 3.npm start 8 | 9 | 4.打开浏览器 http://localhost:8030 10 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var Koa = require('koa'), 2 | serve = require('koa-static'); 3 | 4 | var app = new Koa(); 5 | 6 | app.use(serve('./dist')); 7 | 8 | app.listen(3000, () => { 9 | console.log('listening...'); 10 | }) 11 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | avalon spa demo
-------------------------------------------------------------------------------- /dist/js/es5-sham.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * https://github.com/es-shims/es5-shim 3 | * @license es5-shim Copyright 2009-2015 by contributors, MIT License 4 | * see https://github.com/es-shims/es5-shim/blob/master/LICENSE 5 | */ 6 | 7 | // vim: ts=4 sts=4 sw=4 expandtab 8 | 9 | // Add semicolon to prevent IIFE from being passed as argument to concatenated code. 10 | ; 11 | 12 | // UMD (Universal Module Definition) 13 | // see https://github.com/umdjs/umd/blob/master/templates/returnExports.js 14 | (function (root, factory) { 15 | 'use strict'; 16 | 17 | /* global define, exports, module */ 18 | if (typeof define === 'function' && define.amd) { 19 | // AMD. Register as an anonymous module. 20 | define(factory); 21 | } else if (typeof exports === 'object') { 22 | // Node. Does not work with strict CommonJS, but 23 | // only CommonJS-like enviroments that support module.exports, 24 | // like Node. 25 | module.exports = factory(); 26 | } else { 27 | // Browser globals (root is window) 28 | root.returnExports = factory(); 29 | } 30 | }(this, function () { 31 | 32 | var call = Function.call; 33 | var prototypeOfObject = Object.prototype; 34 | var owns = call.bind(prototypeOfObject.hasOwnProperty); 35 | var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); 36 | var toStr = call.bind(prototypeOfObject.toString); 37 | 38 | // If JS engine supports accessors creating shortcuts. 39 | var defineGetter; 40 | var defineSetter; 41 | var lookupGetter; 42 | var lookupSetter; 43 | var supportsAccessors = owns(prototypeOfObject, '__defineGetter__'); 44 | if (supportsAccessors) { 45 | /* eslint-disable no-underscore-dangle, no-restricted-properties */ 46 | defineGetter = call.bind(prototypeOfObject.__defineGetter__); 47 | defineSetter = call.bind(prototypeOfObject.__defineSetter__); 48 | lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); 49 | lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); 50 | /* eslint-enable no-underscore-dangle, no-restricted-properties */ 51 | } 52 | 53 | var isPrimitive = function isPrimitive(o) { 54 | return o == null || (typeof o !== 'object' && typeof o !== 'function'); 55 | }; 56 | 57 | // ES5 15.2.3.2 58 | // http://es5.github.com/#x15.2.3.2 59 | if (!Object.getPrototypeOf) { 60 | // https://github.com/es-shims/es5-shim/issues#issue/2 61 | // http://ejohn.org/blog/objectgetprototypeof/ 62 | // recommended by fschaefer on github 63 | // 64 | // sure, and webreflection says ^_^ 65 | // ... this will nerever possibly return null 66 | // ... Opera Mini breaks here with infinite loops 67 | Object.getPrototypeOf = function getPrototypeOf(object) { 68 | // eslint-disable-next-line no-proto 69 | var proto = object.__proto__; 70 | if (proto || proto === null) { 71 | return proto; 72 | } else if (toStr(object.constructor) === '[object Function]') { 73 | return object.constructor.prototype; 74 | } else if (object instanceof Object) { 75 | return prototypeOfObject; 76 | } else { 77 | // Correctly return null for Objects created with `Object.create(null)` 78 | // (shammed or native) or `{ __proto__: null}`. Also returns null for 79 | // cross-realm objects on browsers that lack `__proto__` support (like 80 | // IE <11), but that's the best we can do. 81 | return null; 82 | } 83 | }; 84 | } 85 | 86 | // ES5 15.2.3.3 87 | // http://es5.github.com/#x15.2.3.3 88 | 89 | var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) { 90 | try { 91 | object.sentinel = 0; 92 | return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0; 93 | } catch (exception) { 94 | return false; 95 | } 96 | }; 97 | 98 | // check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially. 99 | if (Object.defineProperty) { 100 | var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({}); 101 | var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' || 102 | doesGetOwnPropertyDescriptorWork(document.createElement('div')); 103 | if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) { 104 | var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor; 105 | } 106 | } 107 | 108 | if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) { 109 | var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: '; 110 | 111 | /* eslint-disable no-proto */ 112 | Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { 113 | if (isPrimitive(object)) { 114 | throw new TypeError(ERR_NON_OBJECT + object); 115 | } 116 | 117 | // make a valiant attempt to use the real getOwnPropertyDescriptor 118 | // for I8's DOM elements. 119 | if (getOwnPropertyDescriptorFallback) { 120 | try { 121 | return getOwnPropertyDescriptorFallback.call(Object, object, property); 122 | } catch (exception) { 123 | // try the shim if the real one doesn't work 124 | } 125 | } 126 | 127 | var descriptor; 128 | 129 | // If object does not owns property return undefined immediately. 130 | if (!owns(object, property)) { 131 | return descriptor; 132 | } 133 | 134 | // If object has a property then it's for sure `configurable`, and 135 | // probably `enumerable`. Detect enumerability though. 136 | descriptor = { 137 | enumerable: isEnumerable(object, property), 138 | configurable: true 139 | }; 140 | 141 | // If JS engine supports accessor properties then property may be a 142 | // getter or setter. 143 | if (supportsAccessors) { 144 | // Unfortunately `__lookupGetter__` will return a getter even 145 | // if object has own non getter property along with a same named 146 | // inherited getter. To avoid misbehavior we temporary remove 147 | // `__proto__` so that `__lookupGetter__` will return getter only 148 | // if it's owned by an object. 149 | var prototype = object.__proto__; 150 | var notPrototypeOfObject = object !== prototypeOfObject; 151 | // avoid recursion problem, breaking in Opera Mini when 152 | // Object.getOwnPropertyDescriptor(Object.prototype, 'toString') 153 | // or any other Object.prototype accessor 154 | if (notPrototypeOfObject) { 155 | object.__proto__ = prototypeOfObject; 156 | } 157 | 158 | var getter = lookupGetter(object, property); 159 | var setter = lookupSetter(object, property); 160 | 161 | if (notPrototypeOfObject) { 162 | // Once we have getter and setter we can put values back. 163 | object.__proto__ = prototype; 164 | } 165 | 166 | if (getter || setter) { 167 | if (getter) { 168 | descriptor.get = getter; 169 | } 170 | if (setter) { 171 | descriptor.set = setter; 172 | } 173 | // If it was accessor property we're done and return here 174 | // in order to avoid adding `value` to the descriptor. 175 | return descriptor; 176 | } 177 | } 178 | 179 | // If we got this far we know that object has an own property that is 180 | // not an accessor so we set it as a value and return descriptor. 181 | descriptor.value = object[property]; 182 | descriptor.writable = true; 183 | return descriptor; 184 | }; 185 | /* eslint-enable no-proto */ 186 | } 187 | 188 | // ES5 15.2.3.4 189 | // http://es5.github.com/#x15.2.3.4 190 | if (!Object.getOwnPropertyNames) { 191 | Object.getOwnPropertyNames = function getOwnPropertyNames(object) { 192 | return Object.keys(object); 193 | }; 194 | } 195 | 196 | // ES5 15.2.3.5 197 | // http://es5.github.com/#x15.2.3.5 198 | if (!Object.create) { 199 | 200 | // Contributed by Brandon Benvie, October, 2012 201 | var createEmpty; 202 | var supportsProto = !({ __proto__: null } instanceof Object); 203 | // the following produces false positives 204 | // in Opera Mini => not a reliable check 205 | // Object.prototype.__proto__ === null 206 | 207 | // Check for document.domain and active x support 208 | // No need to use active x approach when document.domain is not set 209 | // see https://github.com/es-shims/es5-shim/issues/150 210 | // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 211 | /* global ActiveXObject */ 212 | var shouldUseActiveX = function shouldUseActiveX() { 213 | // return early if document.domain not set 214 | if (!document.domain) { 215 | return false; 216 | } 217 | 218 | try { 219 | return !!new ActiveXObject('htmlfile'); 220 | } catch (exception) { 221 | return false; 222 | } 223 | }; 224 | 225 | // This supports IE8 when document.domain is used 226 | // see https://github.com/es-shims/es5-shim/issues/150 227 | // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 228 | var getEmptyViaActiveX = function getEmptyViaActiveX() { 229 | var empty; 230 | var xDoc; 231 | 232 | xDoc = new ActiveXObject('htmlfile'); 233 | 234 | var script = 'script'; 235 | xDoc.write('<' + script + '>'); 236 | xDoc.close(); 237 | 238 | empty = xDoc.parentWindow.Object.prototype; 239 | xDoc = null; 240 | 241 | return empty; 242 | }; 243 | 244 | // The original implementation using an iframe 245 | // before the activex approach was added 246 | // see https://github.com/es-shims/es5-shim/issues/150 247 | var getEmptyViaIFrame = function getEmptyViaIFrame() { 248 | var iframe = document.createElement('iframe'); 249 | var parent = document.body || document.documentElement; 250 | var empty; 251 | 252 | iframe.style.display = 'none'; 253 | parent.appendChild(iframe); 254 | // eslint-disable-next-line no-script-url 255 | iframe.src = 'javascript:'; 256 | 257 | empty = iframe.contentWindow.Object.prototype; 258 | parent.removeChild(iframe); 259 | iframe = null; 260 | 261 | return empty; 262 | }; 263 | 264 | /* global document */ 265 | if (supportsProto || typeof document === 'undefined') { 266 | createEmpty = function () { 267 | return { __proto__: null }; 268 | }; 269 | } else { 270 | // In old IE __proto__ can't be used to manually set `null`, nor does 271 | // any other method exist to make an object that inherits from nothing, 272 | // aside from Object.prototype itself. Instead, create a new global 273 | // object and *steal* its Object.prototype and strip it bare. This is 274 | // used as the prototype to create nullary objects. 275 | createEmpty = function () { 276 | // Determine which approach to use 277 | // see https://github.com/es-shims/es5-shim/issues/150 278 | var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame(); 279 | 280 | delete empty.constructor; 281 | delete empty.hasOwnProperty; 282 | delete empty.propertyIsEnumerable; 283 | delete empty.isPrototypeOf; 284 | delete empty.toLocaleString; 285 | delete empty.toString; 286 | delete empty.valueOf; 287 | 288 | var Empty = function Empty() {}; 289 | Empty.prototype = empty; 290 | // short-circuit future calls 291 | createEmpty = function () { 292 | return new Empty(); 293 | }; 294 | return new Empty(); 295 | }; 296 | } 297 | 298 | Object.create = function create(prototype, properties) { 299 | 300 | var object; 301 | var Type = function Type() {}; // An empty constructor. 302 | 303 | if (prototype === null) { 304 | object = createEmpty(); 305 | } else { 306 | if (prototype !== null && isPrimitive(prototype)) { 307 | // In the native implementation `parent` can be `null` 308 | // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) 309 | // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` 310 | // like they are in modern browsers. Using `Object.create` on DOM elements 311 | // is...err...probably inappropriate, but the native version allows for it. 312 | throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome 313 | } 314 | Type.prototype = prototype; 315 | object = new Type(); 316 | // IE has no built-in implementation of `Object.getPrototypeOf` 317 | // neither `__proto__`, but this manually setting `__proto__` will 318 | // guarantee that `Object.getPrototypeOf` will work as expected with 319 | // objects created using `Object.create` 320 | // eslint-disable-next-line no-proto 321 | object.__proto__ = prototype; 322 | } 323 | 324 | if (properties !== void 0) { 325 | Object.defineProperties(object, properties); 326 | } 327 | 328 | return object; 329 | }; 330 | } 331 | 332 | // ES5 15.2.3.6 333 | // http://es5.github.com/#x15.2.3.6 334 | 335 | // Patch for WebKit and IE8 standard mode 336 | // Designed by hax 337 | // related issue: https://github.com/es-shims/es5-shim/issues#issue/5 338 | // IE8 Reference: 339 | // http://msdn.microsoft.com/en-us/library/dd282900.aspx 340 | // http://msdn.microsoft.com/en-us/library/dd229916.aspx 341 | // WebKit Bugs: 342 | // https://bugs.webkit.org/show_bug.cgi?id=36423 343 | 344 | var doesDefinePropertyWork = function doesDefinePropertyWork(object) { 345 | try { 346 | Object.defineProperty(object, 'sentinel', {}); 347 | return 'sentinel' in object; 348 | } catch (exception) { 349 | return false; 350 | } 351 | }; 352 | 353 | // check whether defineProperty works if it's given. Otherwise, 354 | // shim partially. 355 | if (Object.defineProperty) { 356 | var definePropertyWorksOnObject = doesDefinePropertyWork({}); 357 | var definePropertyWorksOnDom = typeof document === 'undefined' || 358 | doesDefinePropertyWork(document.createElement('div')); 359 | if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { 360 | var definePropertyFallback = Object.defineProperty, 361 | definePropertiesFallback = Object.defineProperties; 362 | } 363 | } 364 | 365 | if (!Object.defineProperty || definePropertyFallback) { 366 | var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: '; 367 | var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: '; 368 | var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine'; 369 | 370 | Object.defineProperty = function defineProperty(object, property, descriptor) { 371 | if (isPrimitive(object)) { 372 | throw new TypeError(ERR_NON_OBJECT_TARGET + object); 373 | } 374 | if (isPrimitive(descriptor)) { 375 | throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); 376 | } 377 | // make a valiant attempt to use the real defineProperty 378 | // for I8's DOM elements. 379 | if (definePropertyFallback) { 380 | try { 381 | return definePropertyFallback.call(Object, object, property, descriptor); 382 | } catch (exception) { 383 | // try the shim if the real one doesn't work 384 | } 385 | } 386 | 387 | // If it's a data property. 388 | if ('value' in descriptor) { 389 | // fail silently if 'writable', 'enumerable', or 'configurable' 390 | // are requested but not supported 391 | /* 392 | // alternate approach: 393 | if ( // can't implement these features; allow false but not true 394 | ('writable' in descriptor && !descriptor.writable) || 395 | ('enumerable' in descriptor && !descriptor.enumerable) || 396 | ('configurable' in descriptor && !descriptor.configurable) 397 | )) 398 | throw new RangeError( 399 | 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' 400 | ); 401 | */ 402 | 403 | if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { 404 | // As accessors are supported only on engines implementing 405 | // `__proto__` we can safely override `__proto__` while defining 406 | // a property to make sure that we don't hit an inherited 407 | // accessor. 408 | /* eslint-disable no-proto */ 409 | var prototype = object.__proto__; 410 | object.__proto__ = prototypeOfObject; 411 | // Deleting a property anyway since getter / setter may be 412 | // defined on object itself. 413 | delete object[property]; 414 | object[property] = descriptor.value; 415 | // Setting original `__proto__` back now. 416 | object.__proto__ = prototype; 417 | /* eslint-enable no-proto */ 418 | } else { 419 | object[property] = descriptor.value; 420 | } 421 | } else { 422 | var hasGetter = 'get' in descriptor; 423 | var hasSetter = 'set' in descriptor; 424 | if (!supportsAccessors && (hasGetter || hasSetter)) { 425 | throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); 426 | } 427 | // If we got that far then getters and setters can be defined !! 428 | if (hasGetter) { 429 | defineGetter(object, property, descriptor.get); 430 | } 431 | if (hasSetter) { 432 | defineSetter(object, property, descriptor.set); 433 | } 434 | } 435 | return object; 436 | }; 437 | } 438 | 439 | // ES5 15.2.3.7 440 | // http://es5.github.com/#x15.2.3.7 441 | if (!Object.defineProperties || definePropertiesFallback) { 442 | Object.defineProperties = function defineProperties(object, properties) { 443 | // make a valiant attempt to use the real defineProperties 444 | if (definePropertiesFallback) { 445 | try { 446 | return definePropertiesFallback.call(Object, object, properties); 447 | } catch (exception) { 448 | // try the shim if the real one doesn't work 449 | } 450 | } 451 | 452 | Object.keys(properties).forEach(function (property) { 453 | if (property !== '__proto__') { 454 | Object.defineProperty(object, property, properties[property]); 455 | } 456 | }); 457 | return object; 458 | }; 459 | } 460 | 461 | // ES5 15.2.3.8 462 | // http://es5.github.com/#x15.2.3.8 463 | if (!Object.seal) { 464 | Object.seal = function seal(object) { 465 | if (Object(object) !== object) { 466 | throw new TypeError('Object.seal can only be called on Objects.'); 467 | } 468 | // this is misleading and breaks feature-detection, but 469 | // allows "securable" code to "gracefully" degrade to working 470 | // but insecure code. 471 | return object; 472 | }; 473 | } 474 | 475 | // ES5 15.2.3.9 476 | // http://es5.github.com/#x15.2.3.9 477 | if (!Object.freeze) { 478 | Object.freeze = function freeze(object) { 479 | if (Object(object) !== object) { 480 | throw new TypeError('Object.freeze can only be called on Objects.'); 481 | } 482 | // this is misleading and breaks feature-detection, but 483 | // allows "securable" code to "gracefully" degrade to working 484 | // but insecure code. 485 | return object; 486 | }; 487 | } 488 | 489 | // detect a Rhino bug and patch it 490 | try { 491 | Object.freeze(function () {}); 492 | } catch (exception) { 493 | Object.freeze = (function (freezeObject) { 494 | return function freeze(object) { 495 | if (typeof object === 'function') { 496 | return object; 497 | } else { 498 | return freezeObject(object); 499 | } 500 | }; 501 | }(Object.freeze)); 502 | } 503 | 504 | // ES5 15.2.3.10 505 | // http://es5.github.com/#x15.2.3.10 506 | if (!Object.preventExtensions) { 507 | Object.preventExtensions = function preventExtensions(object) { 508 | if (Object(object) !== object) { 509 | throw new TypeError('Object.preventExtensions can only be called on Objects.'); 510 | } 511 | // this is misleading and breaks feature-detection, but 512 | // allows "securable" code to "gracefully" degrade to working 513 | // but insecure code. 514 | return object; 515 | }; 516 | } 517 | 518 | // ES5 15.2.3.11 519 | // http://es5.github.com/#x15.2.3.11 520 | if (!Object.isSealed) { 521 | Object.isSealed = function isSealed(object) { 522 | if (Object(object) !== object) { 523 | throw new TypeError('Object.isSealed can only be called on Objects.'); 524 | } 525 | return false; 526 | }; 527 | } 528 | 529 | // ES5 15.2.3.12 530 | // http://es5.github.com/#x15.2.3.12 531 | if (!Object.isFrozen) { 532 | Object.isFrozen = function isFrozen(object) { 533 | if (Object(object) !== object) { 534 | throw new TypeError('Object.isFrozen can only be called on Objects.'); 535 | } 536 | return false; 537 | }; 538 | } 539 | 540 | // ES5 15.2.3.13 541 | // http://es5.github.com/#x15.2.3.13 542 | if (!Object.isExtensible) { 543 | Object.isExtensible = function isExtensible(object) { 544 | // 1. If Type(O) is not Object throw a TypeError exception. 545 | if (Object(object) !== object) { 546 | throw new TypeError('Object.isExtensible can only be called on Objects.'); 547 | } 548 | // 2. Return the Boolean value of the [[Extensible]] internal property of O. 549 | var name = ''; 550 | while (owns(object, name)) { 551 | name += '?'; 552 | } 553 | object[name] = true; 554 | var returnValue = owns(object, name); 555 | delete object[name]; 556 | return returnValue; 557 | }; 558 | } 559 | 560 | })); 561 | -------------------------------------------------------------------------------- /dist/js/es5-sham.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["es5-sham.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","call","Function","prototypeOfObject","Object","prototype","owns","bind","hasOwnProperty","isEnumerable","propertyIsEnumerable","toStr","toString","defineGetter","defineSetter","lookupGetter","lookupSetter","supportsAccessors","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","isPrimitive","o","getPrototypeOf","object","proto","__proto__","constructor","doesGetOwnPropertyDescriptorWork","sentinel","getOwnPropertyDescriptor","value","exception","defineProperty","getOwnPropertyDescriptorWorksOnObject","getOwnPropertyDescriptorWorksOnDom","document","createElement","getOwnPropertyDescriptorFallback","ERR_NON_OBJECT","property","TypeError","descriptor","enumerable","configurable","notPrototypeOfObject","getter","setter","get","set","writable","getOwnPropertyNames","keys","create","createEmpty","supportsProto","shouldUseActiveX","domain","ActiveXObject","getEmptyViaActiveX","empty","xDoc","script","write","close","parentWindow","getEmptyViaIFrame","iframe","parent","body","documentElement","style","display","appendChild","src","contentWindow","removeChild","isPrototypeOf","toLocaleString","valueOf","Empty","properties","Type","defineProperties","doesDefinePropertyWork","definePropertyWorksOnObject","definePropertyWorksOnDom","definePropertyFallback","definePropertiesFallback","ERR_NON_OBJECT_DESCRIPTOR","ERR_NON_OBJECT_TARGET","ERR_ACCESSORS_NOT_SUPPORTED","hasGetter","hasSetter","forEach","seal","freeze","freezeObject","preventExtensions","isSealed","isFrozen","isExtensible","name","returnValue"],"mappings":";;;;;CAaC,SAAUA,EAAMC,GACb,YAGA,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAE5CD,OAAOD,OACJ,UAAWG,WAAY,SAAU,CAIpCC,OAAOD,QAAUH,QACd,CAEHD,EAAKM,cAAgBL,OAE3BM,KAAM,WAEJ,GAAIC,GAAOC,SAASD,IACpB,IAAIE,GAAoBC,OAAOC,SAC/B,IAAIC,GAAOL,EAAKM,KAAKJ,EAAkBK,eACvC,IAAIC,GAAeR,EAAKM,KAAKJ,EAAkBO,qBAC/C,IAAIC,GAAQV,EAAKM,KAAKJ,EAAkBS,SAGxC,IAAIC,EACJ,IAAIC,EACJ,IAAIC,EACJ,IAAIC,EACJ,IAAIC,GAAoBX,EAAKH,EAAmB,mBAChD,IAAIc,EAAmB,CAEnBJ,EAAeZ,EAAKM,KAAKJ,EAAkBe,iBAC3CJ,GAAeb,EAAKM,KAAKJ,EAAkBgB,iBAC3CJ,GAAed,EAAKM,KAAKJ,EAAkBiB,iBAC3CJ,GAAef,EAAKM,KAAKJ,EAAkBkB,kBAI/C,GAAIC,GAAc,QAASA,aAAYC,GACnC,MAAOA,IAAK,YAAgBA,KAAM,gBAAmBA,KAAM,WAK/D,KAAKnB,OAAOoB,eAAgB,CAQxBpB,OAAOoB,eAAiB,QAASA,gBAAeC,GAE5C,GAAIC,GAAQD,EAAOE,SAEnB,IAAID,GAASA,IAAU,KAAM,CACzB,MAAOA,OACJ,IAAIf,EAAMc,EAAOG,eAAiB,oBAAqB,CAC1D,MAAOH,GAAOG,YAAYvB,cACvB,IAAIoB,YAAkBrB,QAAQ,CACjC,MAAOD,OACJ,CAKH,MAAO,QAQnB,GAAI0B,GAAmC,QAASA,kCAAiCJ,GAC7E,IACIA,EAAOK,SAAW,CAClB,OAAO1B,QAAO2B,yBAAyBN,EAAQ,YAAYO,QAAU,EACvE,MAAOC,GACL,MAAO,QAKf,IAAI7B,OAAO8B,eAAgB,CACvB,GAAIC,GAAwCN,KAC5C,IAAIO,SAA4CC,YAAa,aAC7DR,EAAiCQ,SAASC,cAAc,OACxD,KAAKF,IAAuCD,EAAuC,CAC/E,GAAII,GAAmCnC,OAAO2B,0BAItD,IAAK3B,OAAO2B,0BAA4BQ,EAAkC,CACtE,GAAIC,GAAiB,0DAGrBpC,QAAO2B,yBAA2B,QAASA,0BAAyBN,EAAQgB,GACxE,GAAInB,EAAYG,GAAS,CACrB,KAAM,IAAIiB,WAAUF,EAAiBf,GAKzC,GAAIc,EAAkC,CAClC,IACI,MAAOA,GAAiCtC,KAAKG,OAAQqB,EAAQgB,GAC/D,MAAOR,KAKb,GAAIU,EAGJ,KAAKrC,EAAKmB,EAAQgB,GAAW,CACzB,MAAOE,GAKXA,GACIC,WAAYnC,EAAagB,EAAQgB,GACjCI,aAAc,KAKlB,IAAI5B,EAAmB,CAMnB,GAAIZ,GAAYoB,EAAOE,SACvB,IAAImB,GAAuBrB,IAAWtB,CAItC,IAAI2C,EAAsB,CACtBrB,EAAOE,UAAYxB,EAGvB,GAAI4C,GAAShC,EAAaU,EAAQgB,EAClC,IAAIO,GAAShC,EAAaS,EAAQgB,EAElC,IAAIK,EAAsB,CAEtBrB,EAAOE,UAAYtB,EAGvB,GAAI0C,GAAUC,EAAQ,CAClB,GAAID,EAAQ,CACRJ,EAAWM,IAAMF,EAErB,GAAIC,EAAQ,CACRL,EAAWO,IAAMF,EAIrB,MAAOL,IAMfA,EAAWX,MAAQP,EAAOgB,EAC1BE,GAAWQ,SAAW,IACtB,OAAOR,IAOf,IAAKvC,OAAOgD,oBAAqB,CAC7BhD,OAAOgD,oBAAsB,QAASA,qBAAoB3B,GACtD,MAAOrB,QAAOiD,KAAK5B,IAM3B,IAAKrB,OAAOkD,OAAQ,CAGhB,GAAIC,EACJ,IAAIC,MAAoB7B,UAAW,eAAkBvB,QAUrD,IAAIqD,GAAmB,QAASA,oBAE5B,IAAKpB,SAASqB,OAAQ,CAClB,MAAO,OAGX,IACI,QAAS,GAAIC,eAAc,YAC7B,MAAO1B,GACL,MAAO,QAOf,IAAI2B,GAAqB,QAASA,sBAC9B,GAAIC,EACJ,IAAIC,EAEJA,GAAO,GAAIH,eAAc,WAEzB,IAAII,GAAS,QACbD,GAAKE,MAAM,IAAMD,EAAS,MAAQA,EAAS,IAC3CD,GAAKG,OAELJ,GAAQC,EAAKI,aAAa9D,OAAOC,SACjCyD,GAAO,IAEP,OAAOD,GAMX,IAAIM,GAAoB,QAASA,qBAC7B,GAAIC,GAAS/B,SAASC,cAAc,SACpC,IAAI+B,GAAShC,SAASiC,MAAQjC,SAASkC,eACvC,IAAIV,EAEJO,GAAOI,MAAMC,QAAU,MACvBJ,GAAOK,YAAYN,EAEnBA,GAAOO,IAAM,aAGbd,GAAQO,EAAOQ,cAAcxE,OAAOC,SACpCgE,GAAOQ,YAAYT,EACnBA,GAAS,IAET,OAAOP,GAIX,IAAIL,SAAwBnB,YAAa,YAAa,CAClDkB,EAAc,WACV,OAAS5B,UAAW,WAErB,CAMH4B,EAAc,WAGV,GAAIM,GAAQJ,IAAqBG,IAAuBO,UAEjDN,GAAMjC,kBACNiC,GAAMrD,qBACNqD,GAAMnD,2BACNmD,GAAMiB,oBACNjB,GAAMkB,qBACNlB,GAAMjD,eACNiD,GAAMmB,OAEb,IAAIC,GAAQ,QAASA,UACrBA,GAAM5E,UAAYwD,CAElBN,GAAc,WACV,MAAO,IAAI0B,GAEf,OAAO,IAAIA,IAInB7E,OAAOkD,OAAS,QAASA,QAAOjD,EAAW6E,GAEvC,GAAIzD,EACJ,IAAI0D,GAAO,QAASA,SAEpB,IAAI9E,IAAc,KAAM,CACpBoB,EAAS8B,QACN,CACH,GAAIlD,IAAc,MAAQiB,EAAYjB,GAAY,CAM9C,KAAM,IAAIqC,WAAU,kDAExByC,EAAK9E,UAAYA,CACjBoB,GAAS,GAAI0D,EAMb1D,GAAOE,UAAYtB,EAIvB,GAAI6E,QAAoB,GAAG,CACvB9E,OAAOgF,iBAAiB3D,EAAQyD,GAGpC,MAAOzD,IAgBf,GAAI4D,GAAyB,QAASA,wBAAuB5D,GACzD,IACIrB,OAAO8B,eAAeT,EAAQ,cAC9B,OAAO,YAAcA,GACvB,MAAOQ,GACL,MAAO,QAMf,IAAI7B,OAAO8B,eAAgB,CACvB,GAAIoD,GAA8BD,KAClC,IAAIE,SAAkClD,YAAa,aAC/CgD,EAAuBhD,SAASC,cAAc,OAClD,KAAKgD,IAAgCC,EAA0B,CAC3D,GAAIC,GAAyBpF,OAAO8B,eAChCuD,EAA2BrF,OAAOgF,kBAI9C,IAAKhF,OAAO8B,gBAAkBsD,EAAwB,CAClD,GAAIE,GAA4B,0CAChC,IAAIC,GAAwB,8CAC5B,IAAIC,GAA8B,gEAElCxF,QAAO8B,eAAiB,QAASA,gBAAeT,EAAQgB,EAAUE,GAC9D,GAAIrB,EAAYG,GAAS,CACrB,KAAM,IAAIiB,WAAUiD,EAAwBlE,GAEhD,GAAIH,EAAYqB,GAAa,CACzB,KAAM,IAAID,WAAUgD,EAA4B/C,GAIpD,GAAI6C,EAAwB,CACxB,IACI,MAAOA,GAAuBvF,KAAKG,OAAQqB,EAAQgB,EAAUE,GAC/D,MAAOV,KAMb,GAAI,SAAWU,GAAY,CAevB,GAAI1B,IAAsBF,EAAaU,EAAQgB,IAAazB,EAAaS,EAAQgB,IAAY,CAMzF,GAAIpC,GAAYoB,EAAOE,SACvBF,GAAOE,UAAYxB,QAGZsB,GAAOgB,EACdhB,GAAOgB,GAAYE,EAAWX,KAE9BP,GAAOE,UAAYtB,MAEhB,CACHoB,EAAOgB,GAAYE,EAAWX,WAE/B,CACH,GAAI6D,GAAY,OAASlD,EACzB,IAAImD,GAAY,OAASnD,EACzB,KAAK1B,IAAsB4E,GAAaC,GAAY,CAChD,KAAM,IAAIpD,WAAUkD,GAGxB,GAAIC,EAAW,CACXhF,EAAaY,EAAQgB,EAAUE,EAAWM,KAE9C,GAAI6C,EAAW,CACXhF,EAAaW,EAAQgB,EAAUE,EAAWO,MAGlD,MAAOzB,IAMf,IAAKrB,OAAOgF,kBAAoBK,EAA0B,CACtDrF,OAAOgF,iBAAmB,QAASA,kBAAiB3D,EAAQyD,GAExD,GAAIO,EAA0B,CAC1B,IACI,MAAOA,GAAyBxF,KAAKG,OAAQqB,EAAQyD,GACvD,MAAOjD,KAKb7B,OAAOiD,KAAK6B,GAAYa,QAAQ,SAAUtD,GACtC,GAAIA,IAAa,YAAa,CAC1BrC,OAAO8B,eAAeT,EAAQgB,EAAUyC,EAAWzC,MAG3D,OAAOhB,IAMf,IAAKrB,OAAO4F,KAAM,CACd5F,OAAO4F,KAAO,QAASA,MAAKvE,GACxB,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,8CAKxB,MAAOjB,IAMf,IAAKrB,OAAO6F,OAAQ,CAChB7F,OAAO6F,OAAS,QAASA,QAAOxE,GAC5B,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,gDAKxB,MAAOjB,IAKf,IACIrB,OAAO6F,OAAO,cAChB,MAAOhE,GACL7B,OAAO6F,OAAU,SAAUC,GACvB,MAAO,SAASD,QAAOxE,GACnB,SAAWA,KAAW,WAAY,CAC9B,MAAOA,OACJ,CACH,MAAOyE,GAAazE,MAG9BrB,OAAO6F,QAKb,IAAK7F,OAAO+F,kBAAmB,CAC3B/F,OAAO+F,kBAAoB,QAASA,mBAAkB1E,GAClD,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,2DAKxB,MAAOjB,IAMf,IAAKrB,OAAOgG,SAAU,CAClBhG,OAAOgG,SAAW,QAASA,UAAS3E,GAChC,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,kDAExB,MAAO,QAMf,IAAKtC,OAAOiG,SAAU,CAClBjG,OAAOiG,SAAW,QAASA,UAAS5E,GAChC,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,kDAExB,MAAO,QAMf,IAAKtC,OAAOkG,aAAc,CACtBlG,OAAOkG,aAAe,QAASA,cAAa7E,GAExC,GAAIrB,OAAOqB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,sDAGxB,GAAI6D,GAAO,EACX,OAAOjG,EAAKmB,EAAQ8E,GAAO,CACvBA,GAAQ,IAEZ9E,EAAO8E,GAAQ,IACf,IAAIC,GAAclG,EAAKmB,EAAQ8E,SACxB9E,GAAO8E,EACd,OAAOC"} -------------------------------------------------------------------------------- /dist/js/es5-sham.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * https://github.com/es-shims/es5-shim 3 | * @license es5-shim Copyright 2009-2015 by contributors, MIT License 4 | * see https://github.com/es-shims/es5-shim/blob/v4.4.1/LICENSE 5 | */ 6 | (function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r===null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}var u=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var p=u({});var s=typeof document==="undefined"||u(document.createElement("div"));if(!s||!p){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var O="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(O+e)}if(b){try{return b.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var s=f(e,o);var y=a(e,o);if(p){e.__proto__=u}if(s||y){if(s){c.get=s}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var d=!({__proto__:null}instanceof Object);var j=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var v=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");t.write("");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var _=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(d||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=j()?v():_();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else{if(typeof e!=="object"&&typeof e!=="function"){throw new TypeError("Object prototype may only be an Object or null")}n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var w=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var m=w({});var P=typeof document==="undefined"||w(document.createElement("div"));if(!m||!P){var E=Object.defineProperty,h=Object.defineProperties}}if(!Object.defineProperty||E){var g="Property description must be an object: ";var z="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(z+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(g+n)}if(E){try{return E.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=u}else{e[r]=n.value}}else{if(!l&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){i(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||h){Object.defineProperties=function defineProperties(e,t){if(h){try{return h.call(Object,e,t)}catch(r){}}Object.keys(t).forEach(function(r){if(r!=="__proto__"){Object.defineProperty(e,r,t[r])}});return e}}if(!Object.seal){Object.seal=function seal(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function freeze(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(x){Object.freeze=function(e){return function freeze(t){if(typeof t==="function"){return t}else{return e(t)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function isSealed(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(e){if(Object(e)!==e){throw new TypeError("Object.isExtensible can only be called on Objects.")}var t="";while(r(e,t)){t+="?"}e[t]=true;var n=r(e,t);delete e[t];return n}}}); 7 | //# sourceMappingURL=es5-sham.map -------------------------------------------------------------------------------- /dist/js/es5-shim.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * https://github.com/es-shims/es5-shim 3 | * @license es5-shim Copyright 2009-2015 by contributors, MIT License 4 | * see https://github.com/es-shims/es5-shim/blob/v4.4.1/LICENSE 5 | */ 6 | (function(r,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{r.returnExports=t()}})(this,function(){var r=Array;var t=r.prototype;var e=Object;var n=e.prototype;var i=Function.prototype;var a=String;var o=a.prototype;var u=Number;var f=u.prototype;var l=t.slice;var s=t.splice;var c=t.push;var v=t.unshift;var p=t.concat;var h=i.call;var g=i.apply;var y=Math.max;var d=Math.min;var m=n.toString;var w=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var b;var T=Function.prototype.toString,x=function tryFunctionObject(r){try{T.call(r);return true}catch(t){return false}},O="[object Function]",S="[object GeneratorFunction]";b=function isCallable(r){if(typeof r!=="function"){return false}if(w){return x(r)}var t=m.call(r);return t===O||t===S};var E;var j=RegExp.prototype.exec,I=function tryRegexExec(r){try{j.call(r);return true}catch(t){return false}},D="[object RegExp]";E=function isRegex(r){if(typeof r!=="object"){return false}return w?I(r):m.call(r)===D};var N;var k=String.prototype.valueOf,M=function tryStringObject(r){try{k.call(r);return true}catch(t){return false}},U="[object String]";N=function isString(r){if(typeof r==="string"){return true}if(typeof r!=="object"){return false}return w?M(r):m.call(r)===U};var R=e.defineProperty&&function(){try{var r={};e.defineProperty(r,"x",{enumerable:false,value:r});for(var t in r){return false}return r.x===r}catch(n){return false}}();var F=function(r){var t;if(R){t=function(r,t,n,i){if(!i&&t in r){return}e.defineProperty(r,t,{configurable:true,enumerable:false,writable:true,value:n})}}else{t=function(r,t,e,n){if(!n&&t in r){return}r[t]=e}}return function defineProperties(e,n,i){for(var a in n){if(r.call(n,a)){t(e,a,n[a],i)}}}}(n.hasOwnProperty);var A=function isPrimitive(r){var t=typeof r;return r===null||t!=="object"&&t!=="function"};var P=u.isNaN||function(r){return r!==r};var $={ToInteger:function ToInteger(r){var t=+r;if(P(t)){t=0}else if(t!==0&&t!==1/0&&t!==-(1/0)){t=(t>0||-1)*Math.floor(Math.abs(t))}return t},ToPrimitive:function ToPrimitive(r){var t,e,n;if(A(r)){return r}e=r.valueOf;if(b(e)){t=e.call(r);if(A(t)){return t}}n=r.toString;if(b(n)){t=n.call(r);if(A(t)){return t}}throw new TypeError},ToObject:function(r){if(r==null){throw new TypeError("can't convert "+r+" to object")}return e(r)},ToUint32:function ToUint32(r){return r>>>0}};var C=function Empty(){};F(i,{bind:function bind(r){var t=this;if(!b(t)){throw new TypeError("Function.prototype.bind called on incompatible "+t)}var n=l.call(arguments,1);var i;var a=function(){if(this instanceof i){var a=t.apply(this,p.call(n,l.call(arguments)));if(e(a)===a){return a}return this}else{return t.apply(r,p.call(n,l.call(arguments)))}};var o=y(0,t.length-n.length);var u=[];for(var f=0;f1){a=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n1){o=arguments[1]}if(!b(t)){throw new TypeError("Array.prototype.map callback must be a function")}for(var u=0;u1){o=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var u=0;u1){i=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a1){i=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a=2){a=arguments[1]}else{do{if(i in e){a=e[i++];break}if(++i>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i=2){i=arguments[1]}else{do{if(a in e){i=e[a--];break}if(--a<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(a<0){return i}do{if(a in e){i=r(i,e[a],a,t)}}while(a--);return i}},!tr);var er=t.indexOf&&[0,1].indexOf(1,2)!==-1;F(t,{indexOf:function indexOf(r){var t=W&&N(this)?H(this,""):$.ToObject(this);var e=$.ToUint32(t.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=$.ToInteger(arguments[1])}n=n>=0?n:y(0,e+n);for(;n1){n=d(n,$.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in t&&r===t[n]){return n}}return-1}},nr);var ir=function(){var r=[1,2];var t=r.splice();return r.length===2&&K(t)&&t.length===0}();F(t,{splice:function splice(r,t){if(arguments.length===0){return[]}else{return s.apply(this,arguments)}}},!ir);var ar=function(){var r={};t.splice.call(r,0,0,1);return r.length===1}();F(t,{splice:function splice(r,t){if(arguments.length===0){return[]}var e=arguments;this.length=y($.ToInteger(this.length),0);if(arguments.length>0&&typeof t!=="number"){e=z(arguments);if(e.length<2){X(e,this.length-r)}else{e[1]=$.ToInteger(t)}}return s.apply(this,e)}},!ar);var or=function(){var t=new r(1e5);t[8]="x";t.splice(1,1);return t.indexOf("x")===7}();var ur=function(){var r=256;var t=[];t[r]="a";t.splice(r+1,0,"b");return t[r]==="a"}();F(t,{splice:function splice(r,t){var e=$.ToObject(this);var n=[];var i=$.ToUint32(e.length);var o=$.ToInteger(r);var u=o<0?y(i+o,0):d(o,i);var f=d(y($.ToInteger(t),0),i-u);var l=0;var s;while(li-f+v){delete e[l-1];l-=1}}else if(v>f){l=i-f;while(l>u){s=a(l+f-1);p=a(l+v-1);if(Z(e,s)){e[p]=e[s]}else{delete e[p]}l-=1}}l=u;for(var h=0;h=0&&!K(r)&&b(r.callee)};var Nr=Ir(arguments)?Ir:Dr;F(e,{keys:function keys(r){var t=b(r);var e=Nr(r);var n=r!==null&&typeof r==="object";var i=n&&N(r);if(!n&&!t&&!e){throw new TypeError("Object.keys called on a non-object")}var o=[];var u=wr&&t;if(i&&br||e){for(var f=0;f9999?"+":"")+G("00000"+Math.abs(n),0<=n&&n<=9999?-4:-6);t=r.length;while(t--){e=r[t];if(e<10){r[t]="0"+e}}return n+"-"+z(r,0,2).join("-")+"T"+z(r,2).join(":")+"."+G("000"+this.getUTCMilliseconds(),-3)+"Z"}},Ar||Pr);var $r=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(Rr).toJSON().indexOf(Fr)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(r){return false}}();if(!$r){Date.prototype.toJSON=function toJSON(r){var t=e(this);var n=$.ToPrimitive(t);if(typeof n==="number"&&!isFinite(n)){return null}var i=t.toISOString;if(!b(i)){throw new TypeError("toISOString property is not callable")}return i.call(t)}}var Cr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var Zr=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));var Jr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(Jr||Zr||!Cr){var zr=Math.pow(2,31)-1;var Br=P(new Date(1970,0,1,0,0,0,zr+1).getTime());Date=function(r){var t=function Date(e,n,i,o,u,f,l){var s=arguments.length;var c;if(this instanceof r){var v=f;var p=l;if(Br&&s>=7&&l>zr){var h=Math.floor(l/zr)*zr;var g=Math.floor(h/1e3);v+=g;p-=g*1e3}c=s===1&&a(e)===e?new r(t.parse(e)):s>=7?new r(e,n,i,o,u,v,p):s>=6?new r(e,n,i,o,u,v):s>=5?new r(e,n,i,o,u):s>=4?new r(e,n,i,o):s>=3?new r(e,n,i):s>=2?new r(e,n):s>=1?new r(e):new r}else{c=r.apply(this,arguments)}if(!A(c)){F(c,{constructor:t},true)}return c};var e=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var n=[0,31,59,90,120,151,181,212,243,273,304,334,365];var i=function dayFromMonth(r,t){var e=t>1?1:0;return n[t]+Math.floor((r-1969+e)/4)-Math.floor((r-1901+e)/100)+Math.floor((r-1601+e)/400)+365*(r-1970)};var o=function toUTC(t){var e=0;var n=t;if(Br&&n>zr){var i=Math.floor(n/zr)*zr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new r(1970,0,1,0,0,e,n))};for(var f in r){if(Z(r,f)){t[f]=r[f]}}F(t,{now:r.now,UTC:r.UTC},true);t.prototype=r.prototype;F(t.prototype,{constructor:t},true);var l=function parse(t){var n=e.exec(t);if(n){var a=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),p=Math.floor(u(n[7]||0)*1e3),h=Boolean(n[4]&&!n[8]),g=n[9]==="-"?1:-1,y=u(n[10]||0),d=u(n[11]||0),m;var w=c>0||v>0||p>0;if(s<(w?24:25)&&c<60&&v<60&&p<1e3&&f>-1&&f<12&&y<24&&d<60&&l>-1&&l=0){e+=Hr.data[t];Hr.data[t]=Math.floor(e/r);e=e%r*Hr.base}},numToString:function numToString(){var r=Hr.size;var t="";while(--r>=0){if(t!==""||r===0||Hr.data[r]!==0){var e=a(Hr.data[r]);if(t===""){t=e}else{t+=G("0000000",0,7-e.length)+e}}}return t},pow:function pow(r,t,e){return t===0?e:t%2===1?pow(r,t-1,e*r):pow(r*r,t/2,e)},log:function log(r){var t=0;var e=r;while(e>=4096){t+=12;e/=4096}while(e>=2){t+=1;e/=2}return t}};var Lr=function toFixed(r){var t,e,n,i,o,f,l,s;t=u(r);t=P(t)?0:Math.floor(t);if(t<0||t>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(P(e)){return"NaN"}if(e<=-1e21||e>=1e21){return a(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){o=Hr.log(e*Hr.pow(2,69,1))-69;f=o<0?e*Hr.pow(2,-o,1):e/Hr.pow(2,o,1);f*=4503599627370496;o=52-o;if(o>0){Hr.multiply(0,f);l=t;while(l>=7){Hr.multiply(1e7,0);l-=7}Hr.multiply(Hr.pow(10,l,1),0);l=o-1;while(l>=23){Hr.divide(1<<23);l-=23}Hr.divide(1<0){s=i.length;if(s<=t){i=n+G("0.0000000000000000000",0,t-s+2)+i}else{i=n+G(i,0,s-t)+"."+G(i,s-t)}}else{i=n+i}return i};F(f,{toFixed:Lr},Gr);var Xr=function(){try{return 1..toPrecision(undefined)==="1"}catch(r){return true}}();var Yr=f.toPrecision;F(f,{toPrecision:function toPrecision(r){return typeof r==="undefined"?Yr.call(this):Yr.call(this,r)}},Xr);if("ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1){(function(){var r=typeof/()??/.exec("")[1]==="undefined";var t=Math.pow(2,32)-1;o.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!E(e)){return H(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f,l,s,v;var p=new RegExp(e.source,o+"g");if(!r){f=new RegExp("^"+p.source+"$(?!\\s)",o)}var h=typeof n==="undefined"?t:$.ToUint32(n);l=p.exec(i);while(l){s=l.index+l[0].length;if(s>u){X(a,G(i,u,l.index));if(!r&&l.length>1){l[0].replace(f,function(){for(var r=1;r1&&l.index=h){break}}if(p.lastIndex===l.index){p.lastIndex++}l=p.exec(i)}if(u===i.length){if(v||!p.test("")){X(a,"")}}else{X(a,G(i,u))}return a.length>h?G(a,0,h):a}})()}else if("0".split(void 0,0).length){o.split=function split(r,t){if(typeof r==="undefined"&&t===0){return[]}return H(this,r,t)}}var qr=o.replace;var Kr=function(){var r=[];"x".replace(/x(.)?/g,function(t,e){X(r,e)});return r.length===1&&typeof r[0]==="undefined"}();if(!Kr){o.replace=function replace(r,t){var e=b(t);var n=E(r)&&/\)[*?]/.test(r.source);if(!e||!n){return qr.call(this,r,t)}else{var i=function(e){var n=arguments.length;var i=r.lastIndex;r.lastIndex=0;var a=r.exec(e)||[];r.lastIndex=i;X(a,arguments[n-2],arguments[n-1]);return t.apply(this,a)};return qr.call(this,r,i)}}}var Qr=o.substr;var Vr="".substr&&"0b".substr(-1)!=="b";F(o,{substr:function substr(r,t){var e=r;if(r<0){e=y(this.length+r,0)}return Qr.call(this,e,t)}},Vr);var Wr=" \n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var _r="\u200b";var rt="["+Wr+"]";var tt=new RegExp("^"+rt+rt+"*");var et=new RegExp(rt+rt+"*$");var nt=o.trim&&(Wr.trim()||!_r.trim());F(o,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return a(this).replace(tt,"").replace(et,"")}},nt);var it=o.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;F(o,{lastIndexOf:function lastIndexOf(r){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=a(this);var e=a(r);var n=arguments.length>1?u(arguments[1]):NaN;var i=P(n)?Infinity:$.ToInteger(n);var o=d(y(i,0),t.length);var f=e.length;var l=o+f;while(l>0){l=y(0,l-f);var s=L(G(t,l,o+f),e);if(s!==-1){return l+s}}return-1}},it);var at=o.lastIndexOf;F(o,{lastIndexOf:function lastIndexOf(r){return at.apply(this,arguments)}},o.lastIndexOf.length!==1);if(parseInt(Wr+"08")!==8||parseInt(Wr+"0x16")!==22){parseInt=function(r){var t=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=a(e).trim();var o=u(n)||(t.test(i)?16:10);return r(i,o)}}(parseInt)}if(String(new RangeError("test"))!=="RangeError: test"){var ot=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=this.name;if(typeof r==="undefined"){r="Error"}else if(typeof r!=="string"){r=a(r)}var t=this.message;if(typeof t==="undefined"){t=""}else if(typeof t!=="string"){t=a(t)}if(!r){return t}if(!t){return r}return r+": "+t};Error.prototype.toString=ot}if(R){var ut=function(r,t){if(Y(r,t)){var e=Object.getOwnPropertyDescriptor(r,t);e.enumerable=false;Object.defineProperty(r,t,e)}};ut(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}ut(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var ft=function toString(){var r="/"+this.source+"/";if(this.global){r+="g"}if(this.ignoreCase){r+="i"}if(this.multiline){r+="m"}return r};RegExp.prototype.toString=ft}}); 7 | //# sourceMappingURL=es5-shim.map -------------------------------------------------------------------------------- /dist/js/hack.js: -------------------------------------------------------------------------------- 1 | if (!Array.prototype.forEach) { 2 | Array.prototype.forEach = function(callback) { 3 | var _arr = this; 4 | for (var i in _arr) { 5 | if (_arr.hasOwnProperty(i)) { 6 | callback(_arr[i], parseInt(i), _arr); 7 | } 8 | } 9 | } 10 | } 11 | 12 | if (!Array.prototype.map) { 13 | Array.prototype.map = function(callback) { 14 | var _arr = []; 15 | this.forEach(function(el, i, arr) { 16 | _arr.push(callback(el, i, arr)); 17 | }); 18 | return _arr; 19 | } 20 | } 21 | 22 | if (!Array.prototype.filter) { 23 | Array.prototype.filter = function(callback) { 24 | var _arr = []; 25 | this.forEach(function(el, i, arr) { 26 | if (callback(el, i, arr)) { 27 | _arr.push(el); 28 | } 29 | }); 30 | return _arr; 31 | } 32 | } 33 | 34 | if (!Array.prototype.find) { 35 | Array.prototype.find = function(callback) { 36 | var _arr = this; 37 | for (var i in _arr) { 38 | if (_arr.hasOwnProperty(i) && callback(_arr[i], parseInt(i), _arr)) { 39 | return _arr[i]; 40 | } 41 | } 42 | return null; 43 | } 44 | } 45 | 46 | 47 | if (!Array.prototype.findIndex) { 48 | Array.prototype.findIndex = function(callback) { 49 | var _arr = this; 50 | for (var i in _arr) { 51 | var j = parseInt(i) 52 | if (_arr.hasOwnProperty(i) && callback(_arr[i], j, _arr)) { 53 | return j; 54 | } 55 | } 56 | return -1; 57 | } 58 | } 59 | 60 | if (!Array.prototype.reduce) { 61 | Array.prototype.reduce = function(callback) { 62 | var _arr = this, 63 | r = callback(_arr[0], _arr[1], 0, _arr); 64 | for (var i = 1; i < _arr.length - 2; i++) { 65 | if (_arr.hasOwnProperty(i)) { 66 | r = callback(r, _arr[i + 1], i, _arr); 67 | } 68 | } 69 | return r; 70 | } 71 | } 72 | 73 | if (!Array.prototype.some) { 74 | Array.prototype.some = function(callback) { 75 | var _arr = this; 76 | for (var i in _arr) { 77 | if (_arr.hasOwnProperty(i) && callback(_arr[i], parseInt(i), _arr)) { 78 | return true; 79 | } 80 | } 81 | return false; 82 | } 83 | } 84 | 85 | if (!Array.prototype.every) { 86 | Array.prototype.every = function(callback) { 87 | var _arr = this; 88 | for (var i in _arr) { 89 | if (_arr.hasOwnProperty(i) && !callback(_arr[i], parseInt(i), _arr)) { 90 | return false; 91 | } 92 | } 93 | return true; 94 | } 95 | } 96 | 97 | if (!Array.prototype.indexOf) { 98 | Array.prototype.indexOf = function(el) { 99 | var _arr = this; 100 | for (var i in _arr) { 101 | if (_arr.hasOwnProperty(i) && arr[i] === el) { 102 | return parseInt(i); 103 | } 104 | } 105 | return -1; 106 | } 107 | } 108 | 109 | 110 | if (!Function.prototype.bind) { 111 | Function.prototype.bind = function(thisValue) { 112 | var _this = this; 113 | return function() { 114 | _this.call(thisValue, arguments); 115 | } 116 | } 117 | } 118 | 119 | 120 | ! function() { 121 | var objT = { toString: 1 }, 122 | DONT_ENUM = "propertyIsEnumerable,isPrototypeOf,hasOwnProperty,toLocaleString,toString,valueOf,constructor".split(","), 123 | hasOwn = (objT).hasOwnProperty; 124 | for (var i in objT) { 125 | DONT_ENUM = false; 126 | } 127 | 128 | 129 | Object.keys = Object.keys || function(obj) { //ecma262v5 15.2.3.14 130 | var result = []; 131 | for (var key in obj) 132 | if (hasOwn.call(obj, key)) { 133 | result.push(key); 134 | } 135 | if (DONT_ENUM && obj) { 136 | for (var i = 0; key = DONT_ENUM[i++];) { 137 | if (hasOwn.call(obj, key)) { 138 | result.push(key); 139 | } 140 | } 141 | } 142 | return result; 143 | }; 144 | }(); 145 | 146 | -------------------------------------------------------------------------------- /dist/js/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /dist/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /dist/js/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill 2 | * Copyright 2014 Scott Jehl 3 | * Licensed under MIT 4 | * https://j.mp/respondjs */ 5 | 6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b, 正淳 9 | */ 10 | 11 | /** 清除内外边距 **/ 12 | body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, /* structural elements 结构元素 */ 13 | dl, dt, dd, ul, ol, li, /* list elements 列表元素 */ 14 | pre, /* text formatting elements 文本格式元素 */ 15 | form, fieldset, legend, button, input, textarea, /* form elements 表单元素 */ 16 | th, td /* table elements 表格元素 */ { 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | /** 设置默认字体 **/ 22 | body, 23 | button, input, select, textarea /* for ie */ { 24 | font: 12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif; 25 | } 26 | h1, h2, h3, h4, h5, h6 { font-size: 100%; } 27 | address, cite, dfn, em, var { font-style: normal; } /* 将斜体扶正 */ 28 | code, kbd, pre, samp { font-family: courier new, courier, monospace; } /* 统一等宽字体 */ 29 | small { font-size: 12px; } /* 小于 12px 的中文很难阅读,让 small 正常化 */ 30 | 31 | /** 重置列表元素 **/ 32 | ul, ol { list-style: none; } 33 | 34 | /** 重置文本格式元素 **/ 35 | a { text-decoration: none; } 36 | a:hover { text-decoration: underline; } 37 | 38 | 39 | /** 重置表单元素 **/ 40 | legend { color: #000; } /* for ie6 */ 41 | fieldset, img { border: 0; } /* img 搭车:让链接里的 img 无边框 */ 42 | button, input, select, textarea { font-size: 100%; } /* 使得表单元素在 ie 下能继承字体大小 */ 43 | /* 注:optgroup 无法扶正 */ 44 | 45 | /** 重置表格元素 **/ 46 | table { border-collapse: collapse; border-spacing: 0; } 47 | 48 | /* 清除浮动 */ 49 | .ks-clear:after, .clear:after { 50 | content: '\20'; 51 | display: block; 52 | height: 0; 53 | clear: both; 54 | } 55 | .ks-clear, .clear { 56 | *zoom: 1; 57 | } 58 | 59 | .main { 60 | padding: 30px 100px; 61 | width: 960px; 62 | margin: 0 auto; 63 | } 64 | .main h1{font-size:36px; color:#333; text-align:left;margin-bottom:30px; border-bottom: 1px solid #eee;} 65 | 66 | .helps{margin-top:40px;} 67 | .helps pre{ 68 | padding:20px; 69 | margin:10px 0; 70 | border:solid 1px #e7e1cd; 71 | background-color: #fffdef; 72 | overflow: auto; 73 | } 74 | 75 | .icon_lists{ 76 | width: 100% !important; 77 | 78 | } 79 | 80 | .icon_lists li{ 81 | float:left; 82 | width: 100px; 83 | height:180px; 84 | text-align: center; 85 | list-style: none !important; 86 | } 87 | .icon_lists .icon{ 88 | font-size: 42px; 89 | line-height: 100px; 90 | margin: 10px 0; 91 | color:#333; 92 | -webkit-transition: font-size 0.25s ease-out 0s; 93 | -moz-transition: font-size 0.25s ease-out 0s; 94 | transition: font-size 0.25s ease-out 0s; 95 | 96 | } 97 | .icon_lists .icon:hover{ 98 | font-size: 100px; 99 | } 100 | 101 | 102 | 103 | .markdown { 104 | color: #666; 105 | font-size: 14px; 106 | line-height: 1.8; 107 | } 108 | 109 | .highlight { 110 | line-height: 1.5; 111 | } 112 | 113 | .markdown img { 114 | vertical-align: middle; 115 | max-width: 100%; 116 | } 117 | 118 | .markdown h1 { 119 | color: #404040; 120 | font-weight: 500; 121 | line-height: 40px; 122 | margin-bottom: 24px; 123 | } 124 | 125 | .markdown h2, 126 | .markdown h3, 127 | .markdown h4, 128 | .markdown h5, 129 | .markdown h6 { 130 | color: #404040; 131 | margin: 1.6em 0 0.6em 0; 132 | font-weight: 500; 133 | clear: both; 134 | } 135 | 136 | .markdown h1 { 137 | font-size: 28px; 138 | } 139 | 140 | .markdown h2 { 141 | font-size: 22px; 142 | } 143 | 144 | .markdown h3 { 145 | font-size: 16px; 146 | } 147 | 148 | .markdown h4 { 149 | font-size: 14px; 150 | } 151 | 152 | .markdown h5 { 153 | font-size: 12px; 154 | } 155 | 156 | .markdown h6 { 157 | font-size: 12px; 158 | } 159 | 160 | .markdown hr { 161 | height: 1px; 162 | border: 0; 163 | background: #e9e9e9; 164 | margin: 16px 0; 165 | clear: both; 166 | } 167 | 168 | .markdown p, 169 | .markdown pre { 170 | margin: 1em 0; 171 | } 172 | 173 | .markdown > p, 174 | .markdown > blockquote, 175 | .markdown > .highlight, 176 | .markdown > ol, 177 | .markdown > ul { 178 | width: 80%; 179 | } 180 | 181 | .markdown ul > li { 182 | list-style: circle; 183 | } 184 | 185 | .markdown > ul li, 186 | .markdown blockquote ul > li { 187 | margin-left: 20px; 188 | padding-left: 4px; 189 | } 190 | 191 | .markdown > ul li p, 192 | .markdown > ol li p { 193 | margin: 0.6em 0; 194 | } 195 | 196 | .markdown ol > li { 197 | list-style: decimal; 198 | } 199 | 200 | .markdown > ol li, 201 | .markdown blockquote ol > li { 202 | margin-left: 20px; 203 | padding-left: 4px; 204 | } 205 | 206 | .markdown code { 207 | margin: 0 3px; 208 | padding: 0 5px; 209 | background: #eee; 210 | border-radius: 3px; 211 | } 212 | 213 | .markdown pre { 214 | border-radius: 6px; 215 | background: #f7f7f7; 216 | padding: 20px; 217 | } 218 | 219 | .markdown pre code { 220 | border: none; 221 | background: #f7f7f7; 222 | margin: 0; 223 | } 224 | 225 | .markdown strong, 226 | .markdown b { 227 | font-weight: 600; 228 | } 229 | 230 | .markdown > table { 231 | border-collapse: collapse; 232 | border-spacing: 0px; 233 | empty-cells: show; 234 | border: 1px solid #e9e9e9; 235 | width: 95%; 236 | margin-bottom: 24px; 237 | } 238 | 239 | .markdown > table th { 240 | white-space: nowrap; 241 | color: #333; 242 | font-weight: 600; 243 | 244 | } 245 | 246 | .markdown > table th, 247 | .markdown > table td { 248 | border: 1px solid #e9e9e9; 249 | padding: 8px 16px; 250 | text-align: left; 251 | } 252 | 253 | .markdown > table th { 254 | background: #F7F7F7; 255 | } 256 | 257 | .markdown blockquote { 258 | font-size: 90%; 259 | color: #999; 260 | border-left: 4px solid #e9e9e9; 261 | padding-left: 0.8em; 262 | margin: 1em 0; 263 | font-style: italic; 264 | } 265 | 266 | .markdown blockquote p { 267 | margin: 0; 268 | } 269 | 270 | .markdown .anchor { 271 | opacity: 0; 272 | transition: opacity 0.3s ease; 273 | margin-left: 8px; 274 | } 275 | 276 | .markdown .waiting { 277 | color: #ccc; 278 | } 279 | 280 | .markdown h1:hover .anchor, 281 | .markdown h2:hover .anchor, 282 | .markdown h3:hover .anchor, 283 | .markdown h4:hover .anchor, 284 | .markdown h5:hover .anchor, 285 | .markdown h6:hover .anchor { 286 | opacity: 1; 287 | display: inline-block; 288 | } 289 | 290 | .markdown > br, 291 | .markdown > p > br { 292 | clear: both; 293 | } 294 | 295 | 296 | .hljs { 297 | display: block; 298 | background: white; 299 | padding: 0.5em; 300 | color: #333333; 301 | overflow-x: auto; 302 | } 303 | 304 | .hljs-comment, 305 | .hljs-meta { 306 | color: #969896; 307 | } 308 | 309 | .hljs-string, 310 | .hljs-variable, 311 | .hljs-template-variable, 312 | .hljs-strong, 313 | .hljs-emphasis, 314 | .hljs-quote { 315 | color: #df5000; 316 | } 317 | 318 | .hljs-keyword, 319 | .hljs-selector-tag, 320 | .hljs-type { 321 | color: #a71d5d; 322 | } 323 | 324 | .hljs-literal, 325 | .hljs-symbol, 326 | .hljs-bullet, 327 | .hljs-attribute { 328 | color: #0086b3; 329 | } 330 | 331 | .hljs-section, 332 | .hljs-name { 333 | color: #63a35c; 334 | } 335 | 336 | .hljs-tag { 337 | color: #333333; 338 | } 339 | 340 | .hljs-title, 341 | .hljs-attr, 342 | .hljs-selector-id, 343 | .hljs-selector-class, 344 | .hljs-selector-attr, 345 | .hljs-selector-pseudo { 346 | color: #795da3; 347 | } 348 | 349 | .hljs-addition { 350 | color: #55a532; 351 | background-color: #eaffea; 352 | } 353 | 354 | .hljs-deletion { 355 | color: #bd2c00; 356 | background-color: #ffecec; 357 | } 358 | 359 | .hljs-link { 360 | text-decoration: underline; 361 | } 362 | 363 | pre{ 364 | background: #fff; 365 | } 366 | 367 | 368 | 369 | 370 | 371 | -------------------------------------------------------------------------------- /src/assets/iconfont/demo_fontclass.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IconFont 7 | 8 | 9 | 10 | 11 |
12 |

IconFont 图标

13 |
    14 | 15 |
  • 16 | 17 |
    18 |
    .icon-ren
    19 |
  • 20 | 21 |
  • 22 | 23 |
    qq
    24 |
    .icon-iconfontqq
    25 |
  • 26 | 27 |
  • 28 | 29 |
    微信
    30 |
    .icon-weixin
    31 |
  • 32 | 33 |
  • 34 | 35 |
    36 |
    .icon-lock-fill
    37 |
  • 38 | 39 |
  • 40 | 41 |
    未勾选
    42 |
    .icon-weigouxuan
    43 |
  • 44 | 45 |
  • 46 | 47 |
    48 |
    .icon-cha
    49 |
  • 50 | 51 |
  • 52 | 53 |
    三角形
    54 |
    .icon-sanjiaoxing
    55 |
  • 56 | 57 |
  • 58 | 59 |
    勾选
    60 |
    .icon-icon162
    61 |
  • 62 | 63 |
  • 64 | 65 |
    叹号
    66 |
    .icon-tanhao
    67 |
  • 68 | 69 |
  • 70 | 71 |
    三角形
    72 |
    .icon-triangle
    73 |
  • 74 | 75 |
  • 76 | 77 |
    钻石
    78 |
    .icon-zuanshi
    79 |
  • 80 | 81 |
  • 82 | 83 |
    房卡
    84 |
    .icon-fangqia
    85 |
  • 86 | 87 |
88 | 89 |

font-class引用

90 |
91 | 92 |

font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。

93 |

与unicode使用方式相比,具有如下特点:

94 |
    95 |
  • 兼容性良好,支持ie8+,及所有现代浏览器。
  • 96 |
  • 相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。
  • 97 |
  • 因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。
  • 98 |
  • 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
  • 99 |
100 |

使用步骤如下:

101 |

第一步:引入项目下面生成的fontclass代码:

102 | 103 | 104 |
<link rel="stylesheet" type="text/css" href="./iconfont.css">
105 |

第二步:挑选相应图标并获取类名,应用于页面:

106 |
<i class="iconfont icon-xxx"></i>
107 |
108 |

"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。

109 |
110 |
111 | 112 | 113 | -------------------------------------------------------------------------------- /src/assets/iconfont/demo_symbol.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IconFont 7 | 8 | 9 | 10 | 24 | 25 | 26 |
27 |

IconFont 图标

28 |
    29 | 30 |
  • 31 | 34 |
    35 |
    #icon-ren
    36 |
  • 37 | 38 |
  • 39 | 42 |
    qq
    43 |
    #icon-iconfontqq
    44 |
  • 45 | 46 |
  • 47 | 50 |
    微信
    51 |
    #icon-weixin
    52 |
  • 53 | 54 |
  • 55 | 58 |
    59 |
    #icon-lock-fill
    60 |
  • 61 | 62 |
  • 63 | 66 |
    未勾选
    67 |
    #icon-weigouxuan
    68 |
  • 69 | 70 |
  • 71 | 74 |
    75 |
    #icon-cha
    76 |
  • 77 | 78 |
  • 79 | 82 |
    三角形
    83 |
    #icon-sanjiaoxing
    84 |
  • 85 | 86 |
  • 87 | 90 |
    勾选
    91 |
    #icon-icon162
    92 |
  • 93 | 94 |
  • 95 | 98 |
    叹号
    99 |
    #icon-tanhao
    100 |
  • 101 | 102 |
  • 103 | 106 |
    三角形
    107 |
    #icon-triangle
    108 |
  • 109 | 110 |
  • 111 | 114 |
    钻石
    115 |
    #icon-zuanshi
    116 |
  • 117 | 118 |
  • 119 | 122 |
    房卡
    123 |
    #icon-fangqia
    124 |
  • 125 | 126 |
127 | 128 | 129 |

symbol引用

130 |
131 | 132 |

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 133 | 这种用法其实是做了一个svg的集合,与另外两种相比具有如下特点:

134 |
    135 |
  • 支持多色图标了,不再受单色限制。
  • 136 |
  • 通过一些技巧,支持像字体那样,通过font-size,color来调整样式。
  • 137 |
  • 兼容性较差,支持 ie9+,及现代浏览器。
  • 138 |
  • 浏览器渲染svg的性能一般,还不如png。
  • 139 |
140 |

使用步骤如下:

141 |

第一步:引入项目下面生成的symbol代码:

142 |
<script src="./iconfont.js"></script>
143 |

第二步:加入通用css代码(引入一次就行):

144 |
<style type="text/css">
145 | .icon {
146 |    width: 1em; height: 1em;
147 |    vertical-align: -0.15em;
148 |    fill: currentColor;
149 |    overflow: hidden;
150 | }
151 | </style>
152 |

第三步:挑选相应图标并获取类名,应用于页面:

153 |
<svg class="icon" aria-hidden="true">
154 |   <use xlink:href="#icon-xxx"></use>
155 | </svg>
156 |         
157 |
158 | 159 | 160 | -------------------------------------------------------------------------------- /src/assets/iconfont/demo_unicode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IconFont 7 | 8 | 9 | 29 | 30 | 31 |
32 |

IconFont 图标

33 |
    34 | 35 |
  • 36 | 37 |
    38 |
    &#xe628;
    39 |
  • 40 | 41 |
  • 42 | 43 |
    qq
    44 |
    &#xe649;
    45 |
  • 46 | 47 |
  • 48 | 49 |
    微信
    50 |
    &#xe603;
    51 |
  • 52 | 53 |
  • 54 | 55 |
    56 |
    &#xe615;
    57 |
  • 58 | 59 |
  • 60 | 61 |
    未勾选
    62 |
    &#xe623;
    63 |
  • 64 | 65 |
  • 66 | 67 |
    68 |
    &#xe60a;
    69 |
  • 70 | 71 |
  • 72 | 73 |
    三角形
    74 |
    &#xe6bc;
    75 |
  • 76 | 77 |
  • 78 | 79 |
    勾选
    80 |
    &#xe6a0;
    81 |
  • 82 | 83 |
  • 84 | 85 |
    叹号
    86 |
    &#xe61d;
    87 |
  • 88 | 89 |
  • 90 | 91 |
    三角形
    92 |
    &#xe501;
    93 |
  • 94 | 95 |
  • 96 | 97 |
    钻石
    98 |
    &#xe6d2;
    99 |
  • 100 | 101 |
  • 102 | 103 |
    房卡
    104 |
    &#xe76c;
    105 |
  • 106 | 107 |
108 |

unicode引用

109 |
110 | 111 |

unicode是字体在网页端最原始的应用方式,特点是:

112 |
    113 |
  • 兼容性最好,支持ie6+,及所有现代浏览器。
  • 114 |
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • 115 |
  • 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
  • 116 |
117 |
118 |

注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式

119 |
120 |

unicode使用步骤如下:

121 |

第一步:拷贝项目下面生成的font-face

122 |
@font-face {
123 |   font-family: 'iconfont';
124 |   src: url('iconfont.eot');
125 |   src: url('iconfont.eot?#iefix') format('embedded-opentype'),
126 |   url('iconfont.woff') format('woff'),
127 |   url('iconfont.ttf') format('truetype'),
128 |   url('iconfont.svg#iconfont') format('svg');
129 | }
130 | 
131 |

第二步:定义使用iconfont的样式

132 |
.iconfont{
133 |   font-family:"iconfont" !important;
134 |   font-size:16px;font-style:normal;
135 |   -webkit-font-smoothing: antialiased;
136 |   -webkit-text-stroke-width: 0.2px;
137 |   -moz-osx-font-smoothing: grayscale;
138 | }
139 | 
140 |

第三步:挑选相应图标并获取字体编码,应用于页面

141 |
<i class="iconfont">&#x33;</i>
142 | 143 |
144 |

"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。

145 |
146 |
147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1496283707824'); /* IE9*/ 4 | src: url('iconfont.eot?t=1496283707824#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('iconfont.woff?t=1496283707824') format('woff'), /* chrome, firefox */ 6 | url('iconfont.ttf?t=1496283707824') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('iconfont.svg?t=1496283707824#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-ren:before { content: "\e628"; } 19 | 20 | .icon-iconfontqq:before { content: "\e649"; } 21 | 22 | .icon-weixin:before { content: "\e603"; } 23 | 24 | .icon-lock-fill:before { content: "\e615"; } 25 | 26 | .icon-weigouxuan:before { content: "\e623"; } 27 | 28 | .icon-cha:before { content: "\e60a"; } 29 | 30 | .icon-sanjiaoxing:before { content: "\e6bc"; } 31 | 32 | .icon-icon162:before { content: "\e6a0"; } 33 | 34 | .icon-tanhao:before { content: "\e61d"; } 35 | 36 | .icon-triangle:before { content: "\e501"; } 37 | 38 | .icon-zuanshi:before { content: "\e6d2"; } 39 | 40 | .icon-fangqia:before { content: "\e76c"; } 41 | 42 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/iconfont/iconfont.eot -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.js: -------------------------------------------------------------------------------- 1 | (function(window){var svgSprite=""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+""+""+"";var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Thu Jun 1 10:21:47 2017 6 | By admin 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 34 | 38 | 42 | 46 | 51 | 54 | 57 | 59 | 61 | 64 | 66 | 68 | 71 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /src/assets/imgs/aaa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/aaa.png -------------------------------------------------------------------------------- /src/assets/imgs/acti-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/acti-01.png -------------------------------------------------------------------------------- /src/assets/imgs/acti-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/acti-02.png -------------------------------------------------------------------------------- /src/assets/imgs/acti-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/acti-03.png -------------------------------------------------------------------------------- /src/assets/imgs/barner-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/barner-01.png -------------------------------------------------------------------------------- /src/assets/imgs/barner-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/barner-02.png -------------------------------------------------------------------------------- /src/assets/imgs/barner-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/barner-03.png -------------------------------------------------------------------------------- /src/assets/imgs/barner-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/barner-04.png -------------------------------------------------------------------------------- /src/assets/imgs/down_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/down_code.png -------------------------------------------------------------------------------- /src/assets/imgs/index_act_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/index_act_01.png -------------------------------------------------------------------------------- /src/assets/imgs/index_act_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/index_act_02.png -------------------------------------------------------------------------------- /src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /src/assets/imgs/logoicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/logoicon.png -------------------------------------------------------------------------------- /src/assets/imgs/mall-barner-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/mall-barner-01.png -------------------------------------------------------------------------------- /src/assets/imgs/mall-barner-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/mall-barner-02.png -------------------------------------------------------------------------------- /src/assets/imgs/mall-barner-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/mall-barner-03.png -------------------------------------------------------------------------------- /src/assets/imgs/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/assets/imgs/sprite.png -------------------------------------------------------------------------------- /src/common/common.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | input, 8 | select { 9 | outline: none; 10 | } 11 | 12 | ul, 13 | li { 14 | padding: 0; 15 | margin: 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/hack/hack.js: -------------------------------------------------------------------------------- 1 | if (!Array.prototype.forEach) { 2 | Array.prototype.forEach = function(callback) { 3 | var _arr = this; 4 | for (var i in _arr) { 5 | if (_arr.hasOwnProperty(i)) { 6 | callback(_arr[i], parseInt(i), _arr); 7 | } 8 | } 9 | } 10 | } 11 | 12 | if (!Array.prototype.map) { 13 | Array.prototype.map = function(callback) { 14 | var _arr = []; 15 | this.forEach(function(el, i, arr) { 16 | _arr.push(callback(el, i, arr)); 17 | }); 18 | return _arr; 19 | } 20 | } 21 | 22 | if (!Array.prototype.filter) { 23 | Array.prototype.filter = function(callback) { 24 | var _arr = []; 25 | this.forEach(function(el, i, arr) { 26 | if (callback(el, i, arr)) { 27 | _arr.push(el); 28 | } 29 | }); 30 | return _arr; 31 | } 32 | } 33 | 34 | if (!Array.prototype.find) { 35 | Array.prototype.find = function(callback) { 36 | var _arr = this; 37 | for (var i in _arr) { 38 | if (_arr.hasOwnProperty(i) && callback(_arr[i], parseInt(i), _arr)) { 39 | return _arr[i]; 40 | } 41 | } 42 | return null; 43 | } 44 | } 45 | 46 | 47 | if (!Array.prototype.findIndex) { 48 | Array.prototype.findIndex = function(callback) { 49 | var _arr = this; 50 | for (var i in _arr) { 51 | var j = parseInt(i) 52 | if (_arr.hasOwnProperty(i) && callback(_arr[i], j, _arr)) { 53 | return j; 54 | } 55 | } 56 | return -1; 57 | } 58 | } 59 | 60 | if (!Array.prototype.reduce) { 61 | Array.prototype.reduce = function(callback) { 62 | var _arr = this, 63 | r = callback(_arr[0], _arr[1], 0, _arr); 64 | for (var i = 1; i < _arr.length - 2; i++) { 65 | if (_arr.hasOwnProperty(i)) { 66 | r = callback(r, _arr[i + 1], i, _arr); 67 | } 68 | } 69 | return r; 70 | } 71 | } 72 | 73 | if (!Array.prototype.some) { 74 | Array.prototype.some = function(callback) { 75 | var _arr = this; 76 | for (var i in _arr) { 77 | if (_arr.hasOwnProperty(i) && callback(_arr[i], parseInt(i), _arr)) { 78 | return true; 79 | } 80 | } 81 | return false; 82 | } 83 | } 84 | 85 | if (!Array.prototype.every) { 86 | Array.prototype.every = function(callback) { 87 | var _arr = this; 88 | for (var i in _arr) { 89 | if (_arr.hasOwnProperty(i) && !callback(_arr[i], parseInt(i), _arr)) { 90 | return false; 91 | } 92 | } 93 | return true; 94 | } 95 | } 96 | 97 | if (!Array.prototype.indexOf) { 98 | Array.prototype.indexOf = function(el) { 99 | var _arr = this; 100 | for (var i in _arr) { 101 | if (_arr.hasOwnProperty(i) && arr[i] === el) { 102 | return parseInt(i); 103 | } 104 | } 105 | return -1; 106 | } 107 | } 108 | 109 | 110 | if (!Function.prototype.bind) { 111 | Function.prototype.bind = function(thisValue) { 112 | var _this = this; 113 | return function() { 114 | _this.call(thisValue, arguments); 115 | } 116 | } 117 | } 118 | 119 | 120 | ! function() { 121 | var objT = { toString: 1 }, 122 | DONT_ENUM = "propertyIsEnumerable,isPrototypeOf,hasOwnProperty,toLocaleString,toString,valueOf,constructor".split(","), 123 | hasOwn = (objT).hasOwnProperty; 124 | for (var i in objT) { 125 | DONT_ENUM = false; 126 | } 127 | 128 | 129 | Object.keys = Object.keys || function(obj) { //ecma262v5 15.2.3.14 130 | var result = []; 131 | for (var key in obj) 132 | if (hasOwn.call(obj, key)) { 133 | result.push(key); 134 | } 135 | if (DONT_ENUM && obj) { 136 | for (var i = 0; key = DONT_ENUM[i++];) { 137 | if (hasOwn.call(obj, key)) { 138 | result.push(key); 139 | } 140 | } 141 | } 142 | return result; 143 | }; 144 | }(); 145 | 146 | -------------------------------------------------------------------------------- /src/common/hack/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /src/common/hack/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /src/common/hack/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill 2 | * Copyright 2014 Scott Jehl 3 | * Licensed under MIT 4 | * https://j.mp/respondjs */ 5 | 6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b * { 35 | vertical-align: middle; 36 | } 37 | 38 | .row.row-noborder { 39 | padding: 0; 40 | border: 0; 41 | } 42 | 43 | .iconfont { 44 | padding: 0 5px; 45 | } 46 | 47 | .title { 48 | height: 2rem; 49 | background: #eee; 50 | } 51 | 52 | .title > * { 53 | vertical-align: middle; 54 | } 55 | 56 | .title img { 57 | height: 100%; 58 | margin-right: 10px; 59 | } 60 | 61 | .btn { 62 | padding: 3px 10px; 63 | border: solid 1px #ccc; 64 | background: #fff; 65 | } 66 | 67 | .btn-submit { 68 | width: 100%; 69 | background: #2c2; 70 | font-size: 1.1rem; 71 | color: #fff; 72 | } 73 | -------------------------------------------------------------------------------- /src/components/Login/index.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /src/components/Login/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import '../../assets/iconfont/iconfont.css'; 3 | import './index.css'; 4 | 5 | component('ms-login', { 6 | template: require('./index.html'), 7 | defaults: { 8 | onSubmit(e) { 9 | e.preventDefault(); 10 | this.onSubmited(); 11 | }, 12 | onSubmited(e) { 13 | 14 | } 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /src/components/LoginInfo/boy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Levan-Du/avalon-spa-app/7eb48969f21cac4e63a49334d7b7f86f71632348/src/components/LoginInfo/boy.png -------------------------------------------------------------------------------- /src/components/LoginInfo/girl.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/LoginInfo/index.css: -------------------------------------------------------------------------------- 1 | .logininfo { 2 | height: 100%; 3 | padding-left: 2rem; 4 | } 5 | 6 | .logininfo .row { 7 | width: 7rem; 8 | line-height: 1; 9 | margin: 0; 10 | border: none; 11 | text-align: center; 12 | font-size: 12px; 13 | } 14 | 15 | .row.avator { 16 | height: 7rem; 17 | margin-top: 1rem; 18 | } 19 | 20 | .avator img { 21 | width: 100%; 22 | height: 100%; 23 | border-radius: 4rem; 24 | } 25 | 26 | .floatleft { 27 | float: left; 28 | } 29 | 30 | .overflowhidden { 31 | overflow: hidden; 32 | } 33 | -------------------------------------------------------------------------------- /src/components/LoginInfo/index.html: -------------------------------------------------------------------------------- 1 |
2 |

头像

3 |

4 |

5 |
6 | -------------------------------------------------------------------------------- /src/components/LoginInfo/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import '../../assets/iconfont/iconfont.css'; 3 | import './index.css'; 4 | 5 | component('ms-logininfo', { 6 | template: require('./index.html'), 7 | defaults: { 8 | id: 0, 9 | name: '怡红公子', 10 | role: '管理员', 11 | avator: require('./boy.png') 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /src/components/Menu/index.css: -------------------------------------------------------------------------------- 1 | .menu {} 2 | 3 | .menu__item:hover { 4 | background: #2a3845; 5 | color: #eee; 6 | } 7 | 8 | .menu__item.checked { 9 | background: #2a3845; 10 | } 11 | 12 | .menu .nav-link { 13 | display: block; 14 | color: #aab; 15 | text-decoration: none; 16 | } 17 | 18 | .menu .nav-link:hover { 19 | color: #eee; 20 | } 21 | 22 | .menu__item > .menu__title .nav-link { 23 | font-size: 16px; 24 | font-weight: 600; 25 | padding: 1rem 2rem; 26 | } 27 | 28 | .menu__item > .menu__title .nav-link .glyphicon.left { 29 | float: left; 30 | display: block; 31 | height: 1.5rem; 32 | line-height: 1.5rem; 33 | margin-right: 1rem; 34 | } 35 | 36 | .menu__item > .menu__title .nav-link .glyphicon.right { 37 | float: right; 38 | display: block; 39 | height: 1.5rem; 40 | line-height: 1.5rem; 41 | } 42 | 43 | .menu__item > .menu__title .nav-link .text { 44 | display: block; 45 | overflow: hidden; 46 | height: 1.5rem; 47 | line-height: 1.5rem; 48 | } 49 | 50 | .menu__item.checked > .menu__title .nav-link { 51 | color: #eee; 52 | } 53 | 54 | .submenu { 55 | color: #ddd; 56 | padding-bottom: 1rem; 57 | /*display: none;*/ 58 | } 59 | 60 | .submenu.checked { 61 | /*display: block;*/ 62 | background: #2a3845; 63 | } 64 | 65 | .submenu__item .nav-link { 66 | padding: .5rem; 67 | padding-left: 4.5rem; 68 | font-weight: 300; 69 | font-size: 14px; 70 | } 71 | 72 | .submenu__item.checked .nav-link { 73 | color: #fff; 74 | } 75 | -------------------------------------------------------------------------------- /src/components/Menu/index.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/components/Menu/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import './index.css'; 3 | import { menus, submenus } from '../../route.config'; 4 | 5 | 6 | var submenuArr = {}; 7 | menus.forEach((m) => { 8 | submenuArr[m.id] = submenus.filter(s => s.pid === m.id && s.id !== 0); 9 | }); 10 | var selectedSubMenuItem = submenuArr[1][0]; 11 | 12 | component('ms-menu', { 13 | template: require('./index.html'), 14 | defaults: { 15 | menus: menus.map(el => { 16 | el.aniAction = 'leave'; 17 | return el 18 | }), 19 | submenus: submenus.filter(s => s.id !== 0), 20 | submenuArr, 21 | selectedSubMenuItem, 22 | aniAction: 'leave', 23 | menuItemClick(e, item) { 24 | var preIndex = this.menus.findIndex(el => el.checked); 25 | var currIndex = this.menus.findIndex(el => item.id === el.id); 26 | 27 | if (preIndex === currIndex) { 28 | this.menus[currIndex].checked = !this.menus[currIndex].checked; 29 | this.menus[currIndex].aniAction = this.menus[currIndex].aniAction === 'leave' ? 'enter' : 'leave'; 30 | return false; 31 | } 32 | 33 | this.menus[currIndex].checked = preIndex > 0 && preIndex === currIndex ? !this.menus[preIndex].checked : true; 34 | this.menus[currIndex].aniAction = this.menus[currIndex].aniAction === 'leave' ? 'enter' : 'leave'; 35 | if (preIndex >= 0) { 36 | this.menus[preIndex].checked = false; 37 | this.menus[preIndex].aniAction = this.menus[preIndex].aniAction === 'leave' ? 'enter' : 'leave'; 38 | } 39 | }, 40 | subMenuItemClick(e) { 41 | var prePid = this.selectedSubMenuItem.pid, 42 | currItem = this.submenus.find(el => el.path === e.to); 43 | 44 | var preIndex = this.submenuArr[prePid].findIndex(el => el.checked); 45 | var currIndex = this.submenuArr[currItem.pid].findIndex(el => currItem.id === el.id); 46 | 47 | if (preIndex >= 0) { 48 | this.submenuArr[prePid][preIndex].checked = false; 49 | } 50 | this.submenuArr[currItem.pid][currIndex].checked = true; 51 | this.selectedSubMenuItem = this.submenuArr[currItem.pid][currIndex]; 52 | }, 53 | onInit(e) { 54 | this.aniAction = 'enter'; 55 | }, 56 | onReady(e) { 57 | 58 | } 59 | } 60 | }) 61 | -------------------------------------------------------------------------------- /src/components/PageTab/index.css: -------------------------------------------------------------------------------- 1 | .pagetab { 2 | width: 100%; 3 | height: 100%; 4 | list-style: none; 5 | position: relative; 6 | } 7 | 8 | .pagetab ul, 9 | .pagetab li { 10 | list-style: none; 11 | padding: 0; 12 | margin: 0; 13 | } 14 | 15 | .pagetab__header { 16 | position: absolute; 17 | left: 0; 18 | right: 0; 19 | top: 0; 20 | height: 3.5rem; 21 | line-height: 3.4rem; 22 | border-bottom: solid .2rem #203040; 23 | } 24 | 25 | .pagetab__header .left { 26 | float: left; 27 | border-right: solid 1px #e7e7e7; 28 | } 29 | 30 | .pagetab__header .glyphicon { 31 | padding: 0 .3rem; 32 | } 33 | 34 | .pagetab__header .link { 35 | display: block; 36 | float: left; 37 | height: 100%; 38 | padding: 0 1rem; 39 | border-right: solid 1px #e7e7e7; 40 | color: #999; 41 | cursor: pointer; 42 | } 43 | 44 | .pagetab__header .dropdown-menu { 45 | border-radius: 0; 46 | } 47 | 48 | .pagetab__header a { 49 | color: #999; 50 | text-decoration: none; 51 | } 52 | 53 | .pagetab__header .link:hover { 54 | background: #eee; 55 | } 56 | 57 | .pagetab__header .mid { 58 | overflow: hidden; 59 | } 60 | 61 | .pagetab__header .right { 62 | float: right; 63 | border-left: solid 1px #e7e7e7; 64 | } 65 | 66 | .pagetab__title__wrapper { 67 | height: 100%; 68 | width: 1000rem; 69 | } 70 | 71 | .pagetab__title { 72 | float: left; 73 | display: block; 74 | border-right: solid 1px #eee; 75 | } 76 | 77 | .pagetab__title .nav-link { 78 | display: block; 79 | width: 100%; 80 | height: 100%; 81 | padding: 0 .6rem; 82 | text-decoration: none; 83 | color: #999; 84 | } 85 | 86 | .pagetab__title.checked .nav-link { 87 | background: #203040; 88 | color:#eee; 89 | } 90 | 91 | .pagetab__content { 92 | position: absolute; 93 | left: 0; 94 | right: 0; 95 | top: 3.5rem; 96 | bottom: 0; 97 | z-index: 101; 98 | overflow: auto; 99 | } 100 | -------------------------------------------------------------------------------- /src/components/PageTab/index.html: -------------------------------------------------------------------------------- 1 |
2 | 33 |
34 | 35 |
36 |
37 | -------------------------------------------------------------------------------- /src/components/PageTab/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import './index.css'; 3 | import createPage from '../../services/createPage'; 4 | import Router from '../../services/routes/router'; 5 | import { submenus } from '../../route.config'; 6 | 7 | 8 | component('ms-pagetab', { 9 | template: require('./index.html'), 10 | defaults: { 11 | name: 'pagetab', 12 | items: [submenus.find(el => el.id === 0)], 13 | onTabTitleClick(e) { 14 | var preIndex = this.items.findIndex(el => el.checked); 15 | var currIndex = this.items.findIndex(el => e.to === el.path); 16 | 17 | this.items[preIndex].checked = false; 18 | this.items[currIndex].checked = true; 19 | }, 20 | getItemStyle(item) { 21 | if (item.id === 0) { 22 | return { padding: '0 1.5rem' } 23 | } 24 | return {}; 25 | }, 26 | removeItem(e) { 27 | e.preventDefault(); 28 | e.stopPropagation(); 29 | 30 | Router.removeHistory(e.to); 31 | var i = this.items.findIndex(el => el.path === e.to); 32 | this.items.removeAt(i); 33 | var path = ''; 34 | if (i > 0) { 35 | path = this.items[i - 1].path; 36 | } else { 37 | path = '/home'; 38 | } 39 | Router.redirect(path); 40 | }, 41 | tabTitlesWidth: 0, 42 | tabTitlesBoxWidth: 0, 43 | tabTitleWrapperMarginLeft: 0, 44 | moveLeft(e) { 45 | if (this.tabTitlesBoxWidth < this.tabTitlesWidth) { 46 | var off = this.tabTitlesWidth - this.tabTitlesBoxWidth + this.tabTitleWrapperMarginLeft; 47 | if (off > 100) { 48 | this.tabTitleWrapperMarginLeft += -100; 49 | } else { 50 | this.tabTitleWrapperMarginLeft += -off; 51 | } 52 | } 53 | }, 54 | moveRight(e) { 55 | if (this.tabTitleWrapperMarginLeft < 0) { 56 | if (this.tabTitleWrapperMarginLeft < -100) { 57 | this.tabTitleWrapperMarginLeft += 100; 58 | } else { 59 | this.tabTitleWrapperMarginLeft += -this.tabTitleWrapperMarginLeft; 60 | } 61 | } 62 | }, 63 | calcTitlesWidth() { 64 | var width = 0, 65 | tabELes = $('#' + this.$id + ' .pagetab__title'); 66 | 67 | tabELes.each((i, el) => width += $(el).width()) 68 | 69 | this.tabTitlesWidth = width; 70 | this.tabTitlesBoxWidth = $('#' + this.$id + ' .pagetab__header .mid').width(); 71 | }, 72 | routeCallback() { 73 | var _this = this; 74 | var items = submenus.filter(el => Router.history.some(h => el.path === h.path)); 75 | 76 | if (!items.length) { 77 | return; 78 | } 79 | 80 | items.forEach(el => { 81 | var query = Router.history.find(h => h.path === el.path).query; 82 | el.query = query; 83 | var iteIndex = _this.items.findIndex(ite => ite.id === el.id); 84 | if (iteIndex < 0) { 85 | _this.items.push(el); 86 | } else { 87 | _this.items[iteIndex].query = el.query; 88 | } 89 | }) 90 | 91 | var currItem = submenus.find(el => el.path === Router.currentUrl); 92 | if (!currItem) { 93 | return; 94 | } 95 | 96 | var currId = currItem.id, 97 | currIndex = _this.items.findIndex(el => el.id === currId), 98 | preIndex = _this.items.findIndex(el => el.checked === true); 99 | 100 | if (preIndex >= 0) { 101 | _this.items[preIndex].checked = false; 102 | } 103 | _this.items[currIndex].checked = true; 104 | }, 105 | onInit(e) { 106 | var _this = this; 107 | 108 | Router.describe(this.routeCallback.bind(this)); 109 | 110 | this.routeCallback(); 111 | }, 112 | onReady(e) { 113 | this.calcTitlesWidth(); 114 | }, 115 | onViewChange(e) { 116 | this.calcTitlesWidth(); 117 | } 118 | } 119 | }) 120 | -------------------------------------------------------------------------------- /src/components/StatusBar/index.css: -------------------------------------------------------------------------------- 1 | .statusbar { 2 | width: 100%; 3 | height: 100%; 4 | border-top: solid 1px #ddd; 5 | text-align: right; 6 | } 7 | 8 | .statusbar .produceby { 9 | padding: 1rem; 10 | vertical-align: bottom; 11 | } 12 | -------------------------------------------------------------------------------- /src/components/StatusBar/index.html: -------------------------------------------------------------------------------- 1 |
2 | produce by levan@2017 3 |
4 | -------------------------------------------------------------------------------- /src/components/StatusBar/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import './index.css'; 3 | 4 | component('ms-statusbar', { 5 | template: require('./index.html'), 6 | defaults: { 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /src/components/TopBar/index.css: -------------------------------------------------------------------------------- 1 | .topbar { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | margin: auto; 6 | text-align: center; 7 | } 8 | 9 | .topbar img { 10 | height: 80%; 11 | } 12 | 13 | .topbar .left { 14 | position: absolute; 15 | left: 0; 16 | top: 0; 17 | bottom: 0; 18 | } 19 | 20 | .topbar .mid { 21 | position: absolute; 22 | left: 0; 23 | right: 0; 24 | top: 0; 25 | bottom: 0; 26 | margin: auto; 27 | } 28 | 29 | .topbar .right { 30 | position: absolute; 31 | right: 0; 32 | top: 0; 33 | bottom: 0; 34 | } 35 | -------------------------------------------------------------------------------- /src/components/TopBar/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 | -------------------------------------------------------------------------------- /src/components/TopBar/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import './index.css'; 3 | 4 | component('ms-topbar', { 5 | template: require('./index.html'), 6 | defaults: { 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | 2 | import './Login'; 3 | import './Menu'; 4 | import './Topbar'; 5 | import './StatusBar'; 6 | import './PageTab'; 7 | import './LoginInfo'; 8 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body > .container-full { 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | .sidebar { 7 | float: left; 8 | width: 19rem; 9 | height: 100%; 10 | background: #2f4050; 11 | position: relative; 12 | color: #aaa; 13 | } 14 | 15 | .sidebar ul { 16 | list-style: none; 17 | margin: 0; 18 | } 19 | 20 | .sidebar__header { 21 | height: 13rem; 22 | line-height: 13rem; 23 | background: #2a3845; 24 | } 25 | 26 | .sidebar__nav { 27 | position: absolute; 28 | top: 13rem; 29 | bottom: 0; 30 | left: 0; 31 | right: 0; 32 | overflow: auto; 33 | padding-top: 1rem; 34 | } 35 | 36 | .main { 37 | overflow: hidden; 38 | height: 100%; 39 | position: relative; 40 | } 41 | 42 | .main .main__top { 43 | position: absolute; 44 | left: 0; 45 | right: 0; 46 | top: 0; 47 | height: 5rem; 48 | background: #f2f3f5; 49 | border-bottom: solid 1px #e7e7e7; 50 | } 51 | 52 | .main .main__content { 53 | position: absolute; 54 | left: 0; 55 | right: 0; 56 | top: 5rem; 57 | bottom: 3.5rem; 58 | margin: 0; 59 | padding: 0; 60 | overflow: hidden; 61 | } 62 | 63 | .main .main__footer { 64 | position: absolute; 65 | left: 0; 66 | right: 0; 67 | bottom: 0; 68 | height: 3.5rem; 69 | line-height: 3.5rem; 70 | } 71 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | avalon spa demo 9 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.min.css'; 2 | import 'bootstrap'; 3 | import './common/common.css'; 4 | import './index.css'; 5 | import './components'; 6 | import './services'; 7 | import './services/routes'; 8 | import './pages'; 9 | import './vmodels'; 10 | -------------------------------------------------------------------------------- /src/pages/Home/actions.js: -------------------------------------------------------------------------------- 1 | export const BOOKS_ADD = 'BOOKS_ADD'; 2 | export const BOOKS_UPDATE = 'BOOKS_UPDATE'; 3 | export const BOOKS_DELETE = 'BOOKS_DELETE'; 4 | -------------------------------------------------------------------------------- /src/pages/Home/index.css: -------------------------------------------------------------------------------- 1 | .homepage { 2 | padding: 1rem; 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/Home/index.html: -------------------------------------------------------------------------------- 1 |
2 | homepage 3 |
4 | -------------------------------------------------------------------------------- /src/pages/Home/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-home', { 8 | template: require('./index.html'), 9 | defaults: {} 10 | }) 11 | -------------------------------------------------------------------------------- /src/pages/Page101/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page101/index.html: -------------------------------------------------------------------------------- 1 |
2 |

{{queryString ?'id:'+query.id+' name:'+query.name:''}}

3 |

this is page101.

4 |

this is page101.

5 |
6 | -------------------------------------------------------------------------------- /src/pages/Page101/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page101', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e) { 13 | // console.log(this.query.$model); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page102/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page102/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page102.

3 |

this is page102.

4 |
-------------------------------------------------------------------------------- /src/pages/Page102/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page102', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page103/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page103/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page103.

3 |

this is page103.

4 |
-------------------------------------------------------------------------------- /src/pages/Page103/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page103', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page104/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page104/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page104.

3 |

this is page104.

4 |
-------------------------------------------------------------------------------- /src/pages/Page104/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page104', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page201/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page201/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page201.

3 |

this is page201.

4 |
-------------------------------------------------------------------------------- /src/pages/Page201/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page201', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page202/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page202/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page202.

3 |

this is page202.

4 |
-------------------------------------------------------------------------------- /src/pages/Page202/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page202', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page203/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page203/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page203.

3 |

this is page203.

4 |
-------------------------------------------------------------------------------- /src/pages/Page203/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page203', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page204/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page204/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page204.

3 |

this is page204.

4 |
-------------------------------------------------------------------------------- /src/pages/Page204/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page204', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page301/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page301/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page301.

3 |

this is page301.

4 |
-------------------------------------------------------------------------------- /src/pages/Page301/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page301', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page302/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page302/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page302.

3 |

this is page302.

4 |
-------------------------------------------------------------------------------- /src/pages/Page302/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page302', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page303/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page303/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page303.

3 |

this is page303.

4 |
-------------------------------------------------------------------------------- /src/pages/Page303/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page303', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page304/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page304/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page304.

3 |

this is page304.

4 |
-------------------------------------------------------------------------------- /src/pages/Page304/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page304', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page401/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page401/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page401.

3 |

this is page401.

4 |
-------------------------------------------------------------------------------- /src/pages/Page401/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page401', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page402/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page402/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page402.

3 |

this is page402.

4 |
-------------------------------------------------------------------------------- /src/pages/Page402/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page402', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page403/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page403/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page403.

3 |

this is page403.

4 |
-------------------------------------------------------------------------------- /src/pages/Page403/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page403', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page404/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page404/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page404.

3 |

this is page404.

4 |
-------------------------------------------------------------------------------- /src/pages/Page404/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page404', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page501/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page501/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page501.

3 |

this is page501.

4 |
-------------------------------------------------------------------------------- /src/pages/Page501/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page501', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page502/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page502/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page502.

3 |

this is page502.

4 |
-------------------------------------------------------------------------------- /src/pages/Page502/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page502', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page503/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page503/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page503.

3 |

this is page503.

4 |
-------------------------------------------------------------------------------- /src/pages/Page503/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page503', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/Page504/index.css: -------------------------------------------------------------------------------- 1 | article {} 2 | -------------------------------------------------------------------------------- /src/pages/Page504/index.html: -------------------------------------------------------------------------------- 1 |
2 |

this is page504.

3 |

this is page504.

4 |
-------------------------------------------------------------------------------- /src/pages/Page504/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import avalon, { component } from 'avalon2'; 3 | import { parseCssModule } from '../../services/parseCssModule'; 4 | 5 | // console.log(parseCssModule(styles, require('./index.html')); 6 | 7 | component('ms-page504', { 8 | template: require('./index.html'), 9 | defaults: { 10 | query: {}, 11 | queryString: '', 12 | onInit(e){ 13 | // console.log(this.shown); 14 | } 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import './Home'; 2 | import './Page101'; 3 | import './Page102'; 4 | import './Page103'; 5 | import './Page104'; 6 | import './Page201'; 7 | import './Page202'; 8 | import './Page203'; 9 | import './Page204'; 10 | import './Page301'; 11 | import './Page302'; 12 | import './Page303'; 13 | import './Page304'; 14 | import './Page401'; 15 | import './Page402'; 16 | import './Page403'; 17 | import './Page404'; 18 | import './Page501'; 19 | import './Page502'; 20 | import './Page503'; 21 | import './Page504'; 22 | -------------------------------------------------------------------------------- /src/route.config.js: -------------------------------------------------------------------------------- 1 | import createPage from './services/createPage'; 2 | 3 | var pages = []; 4 | 5 | [1, 2, 3, 4, 5].forEach(i => { 6 | pages.push(createPage(i, 0, 'page' + i, 'page' + i)); 7 | [1, 2, 3, 4].forEach(j => { 8 | pages.push(createPage(i * 100 + j, i, 'page' + i + '0' + j, 'page' + i + '0' + j)); 9 | }) 10 | }); 11 | 12 | pages.push(createPage(0, 1, 'home', '首页')); 13 | // pages = pages.concat([ 14 | // createPage(0, 1, 'home', '首页'), 15 | // createPage(101, 1, 'page101', 'page101'), 16 | // createPage(102, 1, 'page102', 'page102'), 17 | // createPage(103, 1, 'page103', 'page103'), 18 | // createPage(201, 2, 'page201', 'page201'), 19 | // createPage(202, 2, 'page202', 'page202'), 20 | // createPage(301, 3, 'page301', 'page301'), 21 | // createPage(302, 3, 'page302', 'page302'), 22 | // createPage(303, 3, 'page303', 'page303'), 23 | // createPage(304, 3, 'page304', 'page304') 24 | // ]); 25 | 26 | 27 | export var menus = pages.filter(el => el.pid === 0); 28 | export var submenus = pages.filter(el => el.pid !== 0); 29 | 30 | export default { pages, menus, submenus }; 31 | -------------------------------------------------------------------------------- /src/services/animate/index.js: -------------------------------------------------------------------------------- 1 | import avalon from 'avalon2'; 2 | 3 | 4 | avalon.effect('fade', { 5 | enter: function(el, done) { 6 | $(el).fadeIn('fast', done); 7 | }, 8 | leave: function(el, done) { 9 | $(el).hide(); 10 | } 11 | }); 12 | 13 | avalon.effect('slide', { 14 | enter: function(el, done) { 15 | $(el).show(); 16 | var _height = $(el).children().length * 32 + 10; 17 | $(el).animate({ height: _height + 'px' }, 200, 'swing', done); 18 | }, 19 | leave: function(el, done) { 20 | $(el).animate({ height: 0 }, 200, 'swing', () => { 21 | $(el).hide(); 22 | }); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/services/createPage.js: -------------------------------------------------------------------------------- 1 | export default (id, pid, page, title) => { 2 | var o = { 3 | id, 4 | name: page, 5 | title: title, 6 | path: '/' + page, 7 | tmpl: ``, 8 | checked: page === 'home' ? true : false, 9 | pid 10 | }; 11 | return o; 12 | }; 13 | -------------------------------------------------------------------------------- /src/services/createStroe.js: -------------------------------------------------------------------------------- 1 | const createStore = (reducer) => { 2 | let state; 3 | let listeners = []; 4 | 5 | const getState = () => state; 6 | 7 | const dispatch = (action) => { 8 | state = reducer(state, action); 9 | listeners.forEach(listener => listener()); 10 | }; 11 | 12 | const subscribe = (listener) => { 13 | listeners.push(listener); 14 | return () => { 15 | listeners = listeners.filter(l => l !== listener); 16 | } 17 | }; 18 | 19 | return { getState, dispatch, subscribe }; 20 | }; 21 | 22 | export default createStore; 23 | -------------------------------------------------------------------------------- /src/services/index.js: -------------------------------------------------------------------------------- 1 | import './animate'; 2 | -------------------------------------------------------------------------------- /src/services/parseCssModule.js: -------------------------------------------------------------------------------- 1 | export var parseCssModule = (styles, tmpl) => { 2 | var div = document.createElement('div'); 3 | div.innerHTML = tmpl; 4 | 5 | var eles = div.getElementsByTagName('*'); 6 | for (var l = eles.length; l--;) { 7 | var ele = eles[l], 8 | cla = ele.getAttribute('class'), 9 | newCla = cla; 10 | 11 | if (cla) { 12 | var clas = cla.split(' '); 13 | clas.forEach(c => { 14 | if (styles[c]) { 15 | newCla = newCla.replace(c, styles[c]); 16 | } 17 | }); 18 | 19 | ele.setAttribute('class', newCla); 20 | } 21 | }; 22 | 23 | return div.innerHTML; 24 | } 25 | -------------------------------------------------------------------------------- /src/services/routes/HashRouter/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import Router from '../router'; 3 | 4 | 5 | component('ms-hashrouter', { 6 | template: '
', 7 | defaults: { 8 | styles: { 9 | width: '100%', 10 | height: '100%' 11 | }, 12 | component: '', 13 | visiblePath: '', 14 | routes: {}, 15 | onInit(e) { 16 | Router.routerComponent = e.vmodel; 17 | }, 18 | onReady(e) { 19 | 20 | }, 21 | onViewChange(e) {} 22 | }, 23 | soleSlot: 'component' 24 | }) 25 | -------------------------------------------------------------------------------- /src/services/routes/NavLink/index.css: -------------------------------------------------------------------------------- 1 | .nav-link.checked { 2 | background: #203040; 3 | color: #fff; 4 | } 5 | 6 | .nav-link .glyphicon { 7 | display: none; 8 | font-size: 12px; 9 | } 10 | 11 | .nav-link.checked .glyphicon { 12 | display: inline-block; 13 | } 14 | -------------------------------------------------------------------------------- /src/services/routes/NavLink/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/services/routes/NavLink/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import Router from '../router'; 3 | import './index.css'; 4 | 5 | 6 | component('ms-navlink', { 7 | template: ` 8 | 9 | 10 | 11 | 12 | `, 13 | defaults: { 14 | style: {}, 15 | class: '', 16 | to: '', 17 | label: '', 18 | data: {}, 19 | iconVisible:false, 20 | click(e) {}, 21 | iconClick(e) {}, 22 | getHref(to) { 23 | return '#' + to; 24 | }, 25 | onClick(e) { 26 | e.to = this.to; 27 | this.click(e); 28 | }, 29 | onIconClick(e) { 30 | e.to = this.to; 31 | this.iconClick(e); 32 | }, 33 | onInit(e) { 34 | // console.log(this.class); 35 | } 36 | }, 37 | soleSlot: 'text' 38 | }); 39 | -------------------------------------------------------------------------------- /src/services/routes/Page/index.css: -------------------------------------------------------------------------------- 1 | .page { 2 | width: 100%; 3 | height: 100%; 4 | } 5 | -------------------------------------------------------------------------------- /src/services/routes/Page/index.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /src/services/routes/Page/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import './index.css'; 3 | import { menus, submenus } from '../../../route.config'; 4 | 5 | 6 | component('ms-page', { 7 | template: require('./index.html'), 8 | defaults: { 9 | pages: submenus, 10 | onInit(e) { 11 | var pages = this.pages.$model; 12 | // pages.forEach(el => console.log(el.path, el.name)); 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /src/services/routes/Route/index.js: -------------------------------------------------------------------------------- 1 | import avalon, { component } from 'avalon2'; 2 | import Router from '../router'; 3 | 4 | component('ms-route', { 5 | template: ` 6 |
8 |
9 | `, 10 | defaults: { 11 | styles: { 12 | width: '100%', 13 | height: '100%', 14 | display: 'none' 15 | }, 16 | path: '', 17 | component: '', 18 | visible: false, 19 | visibleComponent: '', 20 | cached: true, 21 | query: {}, 22 | queryString: '', 23 | childRoute: '', 24 | animation: 'fade', 25 | aniAction: 'leave', 26 | aniActionEnter() { 27 | 28 | }, 29 | aniActionLeave() {}, 30 | onInit(e) { 31 | var _this = this; 32 | 33 | var routerComp = Router.routerComponent; 34 | routerComp.routes[_this.path] = e.vmodel; 35 | 36 | Router.route(_this.path, () => { 37 | var urlsplits1 = routerComp.visiblePath.match(/\/[\w-]+/g), 38 | path1 = ''; 39 | if (urlsplits1) { 40 | urlsplits1.forEach(el => { 41 | path1 += el; 42 | var routeVmodel = routerComp.routes[path1]; 43 | if (routeVmodel) { 44 | if (!routeVmodel.cached) { 45 | routeVmodel.visibleComponent = ''; 46 | } 47 | routeVmodel.visible = false; 48 | routeVmodel.styles.display = 'none'; 49 | routeVmodel.aniAction = 'leave'; 50 | } 51 | }); 52 | } 53 | 54 | this.routeCallback(routerComp); 55 | }); 56 | }, 57 | routeCallback(routerComponent) { 58 | var routerComp = routerComponent || Router.routerComponent; 59 | var urlsplits = Router.currentUrl.match(/\/[\w-]+/g), 60 | visiblePath = '', 61 | path = ''; 62 | if (!urlsplits) return; 63 | urlsplits.forEach(el => { 64 | path += el; 65 | var routeVmodel = routerComp.routes[path]; 66 | if (routeVmodel) { 67 | visiblePath = path; 68 | routeVmodel.queryString = Router.query; 69 | routeVmodel.query = Router.getQuery() || {}; 70 | routeVmodel.visible = true; 71 | routeVmodel.aniAction = 'enter'; 72 | var vc = '<' + routeVmodel.component + ' ms-widget="{query:query,queryString:queryString}" />'; 73 | if (!routeVmodel.cached) { 74 | routeVmodel.visibleComponent = vc; 75 | } else if (!routeVmodel.visibleComponent) { 76 | routeVmodel.visibleComponent = vc; 77 | } 78 | } 79 | }); 80 | routerComp.visiblePath = visiblePath; 81 | }, 82 | onReady(e) { 83 | this.routeCallback(); 84 | }, 85 | onDispose(e) {} 86 | } 87 | }) 88 | -------------------------------------------------------------------------------- /src/services/routes/index.js: -------------------------------------------------------------------------------- 1 | import './HashRouter'; 2 | import './Route'; 3 | import './NavLink'; 4 | import './Page'; 5 | import './router'; 6 | -------------------------------------------------------------------------------- /src/services/routes/router.js: -------------------------------------------------------------------------------- 1 | class Router { 2 | constructor() { 3 | this.routes = {}; 4 | this.currentUrl = ''; 5 | this.query = ''; 6 | this.routerComponent = {}; 7 | this.history = []; 8 | this.listeners = []; 9 | } 10 | 11 | route(path, callback) { 12 | this.routes[path] = callback || function() {}; 13 | } 14 | 15 | refresh() { 16 | var _this = this; 17 | 18 | var url = location.hash.slice(1) || '/'; 19 | var index = url.indexOf('?'); 20 | index = index < 0 ? url.length : index; 21 | _this.currentUrl = url.substr(0, index); 22 | _this.query = url.substr(index + 1, url.length) || ''; 23 | 24 | var cb = _this.routes[_this.currentUrl]; 25 | cb && cb(); 26 | 27 | if (!_this.history.some(h => _this.currentUrl === h.path)) { 28 | _this.history.push({ path: _this.currentUrl, query: _this.query }); 29 | } else { 30 | var i = _this.history.findIndex(el => el.path === _this.currentUrl); 31 | _this.history[i].query = _this.query; 32 | } 33 | 34 | this.listeners.forEach(l => l()) 35 | } 36 | 37 | clearHistory() { 38 | this.history = []; 39 | this.listeners = []; 40 | } 41 | 42 | removeHistory(path) { 43 | this.history = this.history.filter(el => el.path !== path); 44 | } 45 | 46 | describe(listener) { 47 | this.listeners.push(listener); 48 | } 49 | 50 | redirect(path) { 51 | location.hash = path; 52 | } 53 | 54 | init() { 55 | window.addEventListener('load', this.refresh.bind(this), false); 56 | window.addEventListener('hashchange', this.refresh.bind(this), false); 57 | } 58 | 59 | getQuery() { 60 | if (!this.query) { 61 | return {} 62 | }; 63 | 64 | var result = this.query.match(new RegExp('[\?\&]?[^\?\&]+=[^\?\&]+', 'g')); 65 | if (!result) return {}; 66 | 67 | var oo = {}; 68 | for (var i in result) { 69 | var ss = result[i].toString().split('='); 70 | oo[ss[0].replace('&', '')] = ss[1]; 71 | } 72 | return oo; 73 | } 74 | } 75 | 76 | 77 | var router = new Router(); 78 | export default router; 79 | 80 | router.init(); 81 | -------------------------------------------------------------------------------- /src/vmodels/app.vm.js: -------------------------------------------------------------------------------- 1 | import avalon, { define } from 'avalon2'; 2 | import Router from '../services/routes/router'; 3 | 4 | define({ 5 | $id: 'app' 6 | }); 7 | -------------------------------------------------------------------------------- /src/vmodels/index.js: -------------------------------------------------------------------------------- 1 | import './app.vm'; 2 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'), 2 | path = require('path'), 3 | HtmlWebpackPlugin = require('html-webpack-plugin'), 4 | TransferWebpackPlugin = require('transfer-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: path.join(__dirname, 'src/index.js'), 8 | output: { 9 | path: path.join(__dirname, 'dist'), 10 | filename: 'bundle.js' 11 | }, 12 | module: { 13 | rules: [{ 14 | test: /\.js$/, 15 | use: ['es3ify-loader', 'babel-loader'] 16 | }, { 17 | test: /\.html$/, 18 | use: ['html-withimg-loader'] 19 | }, { 20 | test: /\.css$/, 21 | use: ['style-loader', 'css-loader'] 22 | }, { 23 | test: /\.(png|jpg|svg|gif)$/, 24 | use: 'url-loader?name=/images/[hash:6].[name].[ext]' 25 | }, { 26 | test: /\.(woff|woff2|ttf|svg|eot)$/, 27 | use: 'url-loader?name=/iconfont/[hash:6].[name].[ext]' 28 | }] 29 | }, 30 | plugins: [ 31 | new webpack.ProvidePlugin({ 32 | $: 'jquery', 33 | jQuery: 'jquery' 34 | }), 35 | new HtmlWebpackPlugin({ 36 | template: 'html-withimg-loader!' + path.join(__dirname, 'src/index.html'), 37 | filename: 'index.html', 38 | inject: true 39 | }), 40 | new TransferWebpackPlugin([ 41 | { from: 'common/hack', to: 'js' } 42 | ], path.join(__dirname, 'src')) 43 | ], 44 | devServer: { 45 | contentBase: path.join(__dirname, 'dist'), 46 | inline: true, 47 | port: 8030 48 | } 49 | } 50 | --------------------------------------------------------------------------------