which uses a dynamically fetched padding-top property
175 | // based on the video's w/h dimensions
176 | var wrap = document.createElement('div');
177 | wrap.className = 'fluid-vids';
178 | wrap.style.position = 'relative';
179 | wrap.style.marginBottom = '20px';
180 | wrap.style.width = '100%';
181 | wrap.style.paddingTop = videoRatio + '%';
182 | // Fix for appear inside tabs tag.
183 | (wrap.style.paddingTop === '') && (wrap.style.paddingTop = '50%');
184 |
185 | // Add the iframe inside our newly created
186 | var iframeParent = iframe.parentNode;
187 | iframeParent.insertBefore(wrap, iframe);
188 | wrap.appendChild(iframe);
189 |
190 | // Additional adjustments for 163 Music
191 | if (this.src.search('music.163.com') > 0) {
192 | newDimension = getDimension($iframe);
193 | var shouldRecalculateAspect = newDimension.width > oldDimension.width
194 | || newDimension.height < oldDimension.height;
195 |
196 | // 163 Music Player has a fixed height, so we need to reset the aspect radio
197 | if (shouldRecalculateAspect) {
198 | wrap.style.paddingTop = getAspectRadio(newDimension.width, oldDimension.height) + '%';
199 | }
200 | }
201 | }
202 | });
203 |
204 | },
205 |
206 | hasMobileUA: function() {
207 | var nav = window.navigator;
208 | var ua = nav.userAgent;
209 | var pa = /iPad|iPhone|Android|Opera Mini|BlackBerry|webOS|UCWEB|Blazer|PSP|IEMobile|Symbian/g;
210 |
211 | return pa.test(ua);
212 | },
213 |
214 | isTablet: function() {
215 | return window.screen.width < 992 && window.screen.width > 767 && this.hasMobileUA();
216 | },
217 |
218 | isMobile: function() {
219 | return window.screen.width < 767 && this.hasMobileUA();
220 | },
221 |
222 | isDesktop: function() {
223 | return !this.isTablet() && !this.isMobile();
224 | },
225 |
226 | /**
227 | * Escape meta symbols in jQuery selectors.
228 | *
229 | * @param selector
230 | * @returns {string|void|XML|*}
231 | */
232 | escapeSelector: function(selector) {
233 | return selector.replace(/[!"$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, '\\$&');
234 | },
235 |
236 | displaySidebar: function() {
237 | if (!this.isDesktop() || this.isPisces() || this.isGemini()) {
238 | return;
239 | }
240 | $('.sidebar-toggle').trigger('click');
241 | },
242 |
243 | isMist: function() {
244 | return CONFIG.scheme === 'Mist';
245 | },
246 |
247 | isPisces: function() {
248 | return CONFIG.scheme === 'Pisces';
249 | },
250 |
251 | isGemini: function() {
252 | return CONFIG.scheme === 'Gemini';
253 | },
254 |
255 | getScrollbarWidth: function() {
256 | var $div = $('
').addClass('scrollbar-measure').prependTo('body');
257 | var div = $div[0];
258 | var scrollbarWidth = div.offsetWidth - div.clientWidth;
259 |
260 | $div.remove();
261 |
262 | return scrollbarWidth;
263 | },
264 |
265 | getContentVisibilityHeight: function() {
266 | var docHeight = $('#content').height();
267 | var winHeight = $(window).height();
268 | var contentVisibilityHeight = docHeight > winHeight ? docHeight - winHeight : $(document).height() - winHeight;
269 | return contentVisibilityHeight;
270 | },
271 |
272 | getSidebarb2tHeight: function() {
273 | //var sidebarb2tHeight = (CONFIG.sidebar.b2t) ? document.getElementsByClassName('back-to-top')[0].clientHeight : 0;
274 | var sidebarb2tHeight = CONFIG.sidebar.b2t ? $('.back-to-top').height() : 0;
275 | return sidebarb2tHeight;
276 | },
277 |
278 | getSidebarSchemePadding: function() {
279 | var sidebarNavHeight = $('.sidebar-nav').css('display') === 'block' ? $('.sidebar-nav').outerHeight(true) : 0;
280 | var sidebarInner = $('.sidebar-inner');
281 | var sidebarPadding = sidebarInner.innerWidth() - sidebarInner.width();
282 | var sidebarOffset = CONFIG.sidebar.offset ? CONFIG.sidebar.offset : 12;
283 | var sidebarSchemePadding = this.isPisces() || this.isGemini()
284 | ? (sidebarPadding * 2) + sidebarNavHeight + sidebarOffset + this.getSidebarb2tHeight()
285 | : (sidebarPadding * 2) + (sidebarNavHeight / 2);
286 | return sidebarSchemePadding;
287 | }
288 |
289 | };
290 |
291 | $(document).ready(function() {
292 |
293 | /**
294 | * Init Sidebar & TOC inner dimensions on all pages and for all schemes.
295 | * Need for Sidebar/TOC inner scrolling if content taller then viewport.
296 | */
297 |
298 | function updateSidebarHeight(height) {
299 | height = height || 'auto';
300 | $('.site-overview, .post-toc').css('max-height', height);
301 | }
302 |
303 | function initSidebarDimension() {
304 | var updateSidebarHeightTimer;
305 |
306 | $(window).on('resize', function() {
307 | updateSidebarHeightTimer && clearTimeout(updateSidebarHeightTimer);
308 |
309 | updateSidebarHeightTimer = setTimeout(function() {
310 | var sidebarWrapperHeight = document.body.clientHeight - NexT.utils.getSidebarSchemePadding();
311 |
312 | updateSidebarHeight(sidebarWrapperHeight);
313 | }, 0);
314 | });
315 |
316 | // Initialize Sidebar & TOC Width.
317 | var scrollbarWidth = NexT.utils.getScrollbarWidth();
318 | if ($('.site-overview-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
319 | $('.site-overview').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
320 | }
321 | if ($('.post-toc-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
322 | $('.post-toc').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
323 | }
324 |
325 | // Initialize Sidebar & TOC Height.
326 | updateSidebarHeight(document.body.clientHeight - NexT.utils.getSidebarSchemePadding());
327 | }
328 |
329 | initSidebarDimension();
330 |
331 | });
332 |
--------------------------------------------------------------------------------
/js/src/motion.js:
--------------------------------------------------------------------------------
1 | /* global NexT, CONFIG */
2 |
3 | $(document).ready(function() {
4 | NexT.motion = {};
5 |
6 | var sidebarToggleLines = {
7 | lines: [],
8 | push : function(line) {
9 | this.lines.push(line);
10 | },
11 | init: function() {
12 | this.lines.forEach(function(line) {
13 | line.init();
14 | });
15 | },
16 | arrow: function() {
17 | this.lines.forEach(function(line) {
18 | line.arrow();
19 | });
20 | },
21 | close: function() {
22 | this.lines.forEach(function(line) {
23 | line.close();
24 | });
25 | }
26 | };
27 |
28 | function SidebarToggleLine(settings) {
29 | this.el = $(settings.el);
30 | this.status = $.extend({}, {
31 | init: {
32 | width : '100%',
33 | opacity: 1,
34 | left : 0,
35 | rotateZ: 0,
36 | top : 0
37 | }
38 | }, settings.status);
39 | }
40 |
41 | SidebarToggleLine.prototype.init = function() {
42 | this.transform('init');
43 | };
44 | SidebarToggleLine.prototype.arrow = function() {
45 | this.transform('arrow');
46 | };
47 | SidebarToggleLine.prototype.close = function() {
48 | this.transform('close');
49 | };
50 | SidebarToggleLine.prototype.transform = function(status) {
51 | this.el.velocity('stop').velocity(this.status[status]);
52 | };
53 |
54 | var sidebarToggleLine1st = new SidebarToggleLine({
55 | el : '.sidebar-toggle-line-first',
56 | status: {
57 | arrow: {width: '50%', rotateZ: '-45deg', top: '2px'},
58 | close: {width: '100%', rotateZ: '-45deg', top: '5px'}
59 | }
60 | });
61 | var sidebarToggleLine2nd = new SidebarToggleLine({
62 | el : '.sidebar-toggle-line-middle',
63 | status: {
64 | arrow: {width: '90%'},
65 | close: {opacity: 0}
66 | }
67 | });
68 | var sidebarToggleLine3rd = new SidebarToggleLine({
69 | el : '.sidebar-toggle-line-last',
70 | status: {
71 | arrow: {width: '50%', rotateZ: '45deg', top: '-2px'},
72 | close: {width: '100%', rotateZ: '45deg', top: '-5px'}
73 | }
74 | });
75 |
76 | sidebarToggleLines.push(sidebarToggleLine1st);
77 | sidebarToggleLines.push(sidebarToggleLine2nd);
78 | sidebarToggleLines.push(sidebarToggleLine3rd);
79 |
80 | var SIDEBAR_WIDTH = CONFIG.sidebar.width ? CONFIG.sidebar.width : '320px';
81 | var SIDEBAR_DISPLAY_DURATION = 200;
82 | var xPos, yPos;
83 |
84 | var sidebarToggleMotion = {
85 | toggleEl : $('.sidebar-toggle'),
86 | dimmerEl : $('#sidebar-dimmer'),
87 | sidebarEl : $('.sidebar'),
88 | isSidebarVisible: false,
89 | init : function() {
90 | this.toggleEl.on('click', this.clickHandler.bind(this));
91 | this.dimmerEl.on('click', this.clickHandler.bind(this));
92 | this.toggleEl.on('mouseenter', this.mouseEnterHandler.bind(this));
93 | this.toggleEl.on('mouseleave', this.mouseLeaveHandler.bind(this));
94 | this.sidebarEl.on('touchstart', this.touchstartHandler.bind(this));
95 | this.sidebarEl.on('touchend', this.touchendHandler.bind(this));
96 | this.sidebarEl.on('touchmove', function(e) { e.preventDefault(); });
97 |
98 | $(document)
99 | .on('sidebar.isShowing', function() {
100 | NexT.utils.isDesktop() && $('body').velocity('stop').velocity(
101 | {paddingRight: SIDEBAR_WIDTH},
102 | SIDEBAR_DISPLAY_DURATION
103 | );
104 | })
105 | .on('sidebar.isHiding', function() {
106 | });
107 | },
108 | clickHandler: function() {
109 | this.isSidebarVisible ? this.hideSidebar() : this.showSidebar();
110 | this.isSidebarVisible = !this.isSidebarVisible;
111 | },
112 | mouseEnterHandler: function() {
113 | if (this.isSidebarVisible) {
114 | return;
115 | }
116 | sidebarToggleLines.arrow();
117 | },
118 | mouseLeaveHandler: function() {
119 | if (this.isSidebarVisible) {
120 | return;
121 | }
122 | sidebarToggleLines.init();
123 | },
124 | touchstartHandler: function(e) {
125 | xPos = e.originalEvent.touches[0].clientX;
126 | yPos = e.originalEvent.touches[0].clientY;
127 | },
128 | touchendHandler: function(e) {
129 | var _xPos = e.originalEvent.changedTouches[0].clientX;
130 | var _yPos = e.originalEvent.changedTouches[0].clientY;
131 | if (_xPos - xPos > 30 && Math.abs(_yPos - yPos) < 20) {
132 | this.clickHandler();
133 | }
134 | },
135 | showSidebar: function() {
136 | var self = this;
137 |
138 | sidebarToggleLines.close();
139 |
140 | this.sidebarEl.velocity('stop').velocity({
141 | width: SIDEBAR_WIDTH
142 | }, {
143 | display : 'block',
144 | duration: SIDEBAR_DISPLAY_DURATION,
145 | begin : function() {
146 | $('.sidebar .motion-element').velocity(
147 | 'transition.slideRightIn',
148 | {
149 | stagger : 50,
150 | drag : true,
151 | complete: function() {
152 | self.sidebarEl.trigger('sidebar.motion.complete');
153 | }
154 | }
155 | );
156 | },
157 | complete: function() {
158 | self.sidebarEl.addClass('sidebar-active');
159 | self.sidebarEl.trigger('sidebar.didShow');
160 | }
161 | }
162 | );
163 |
164 | this.sidebarEl.trigger('sidebar.isShowing');
165 | },
166 | hideSidebar: function() {
167 | NexT.utils.isDesktop() && $('body').velocity('stop').velocity({paddingRight: 0});
168 | this.sidebarEl.find('.motion-element').velocity('stop').css('display', 'none');
169 | this.sidebarEl.velocity('stop').velocity({width: 0}, {display: 'none'});
170 |
171 | sidebarToggleLines.init();
172 |
173 | this.sidebarEl.removeClass('sidebar-active');
174 | this.sidebarEl.trigger('sidebar.isHiding');
175 |
176 | // Prevent adding TOC to Overview if Overview was selected when close & open sidebar.
177 | if ($('.post-toc-wrap')) {
178 | if ($('.site-overview-wrap').css('display') === 'block') {
179 | $('.post-toc-wrap').removeClass('motion-element');
180 | } else {
181 | $('.post-toc-wrap').addClass('motion-element');
182 | }
183 | }
184 | }
185 | };
186 | sidebarToggleMotion.init();
187 |
188 | NexT.motion.integrator = {
189 | queue : [],
190 | cursor: -1,
191 | add : function(fn) {
192 | this.queue.push(fn);
193 | return this;
194 | },
195 | next: function() {
196 | this.cursor++;
197 | var fn = this.queue[this.cursor];
198 | $.isFunction(fn) && fn(NexT.motion.integrator);
199 | },
200 | bootstrap: function() {
201 | this.next();
202 | }
203 | };
204 |
205 | NexT.motion.middleWares = {
206 | logo: function(integrator) {
207 | var sequence = [];
208 | var $brand = $('.brand');
209 | var $title = $('.site-title');
210 | var $subtitle = $('.site-subtitle');
211 | var $logoLineTop = $('.logo-line-before i');
212 | var $logoLineBottom = $('.logo-line-after i');
213 |
214 | $brand.length > 0 && sequence.push({
215 | e: $brand,
216 | p: {opacity: 1},
217 | o: {duration: 200}
218 | });
219 |
220 | /**
221 | * Check if $elements exist.
222 | * @param {jQuery|Array} $elements
223 | * @returns {boolean}
224 | */
225 | function hasElement($elements) {
226 | $elements = Array.isArray($elements) ? $elements : [$elements];
227 | return $elements.every(function($element) {
228 | return $element.length > 0;
229 | });
230 | }
231 |
232 | function getMistLineSettings(element, translateX) {
233 | return {
234 | e: $(element),
235 | p: {translateX: translateX},
236 | o: {
237 | duration : 500,
238 | sequenceQueue: false
239 | }
240 | };
241 | }
242 |
243 | NexT.utils.isMist() && hasElement([$logoLineTop, $logoLineBottom])
244 | && sequence.push(
245 | getMistLineSettings($logoLineTop, '100%'),
246 | getMistLineSettings($logoLineBottom, '-100%')
247 | );
248 |
249 | hasElement($title) && sequence.push({
250 | e: $title,
251 | p: {opacity: 1, top: 0},
252 | o: { duration: 200 }
253 | });
254 |
255 | hasElement($subtitle) && sequence.push({
256 | e: $subtitle,
257 | p: {opacity: 1, top: 0},
258 | o: {duration: 200}
259 | });
260 |
261 | if (CONFIG.motion.async) {
262 | integrator.next();
263 | }
264 |
265 | if (sequence.length > 0) {
266 | sequence[sequence.length - 1].o.complete = function() {
267 | integrator.next();
268 | };
269 | /* eslint-disable */
270 | $.Velocity.RunSequence(sequence);
271 | /* eslint-enable */
272 | } else {
273 | integrator.next();
274 | }
275 | },
276 |
277 | menu: function(integrator) {
278 |
279 | if (CONFIG.motion.async) {
280 | integrator.next();
281 | }
282 |
283 | $('.menu-item').velocity('transition.slideDownIn', {
284 | display : null,
285 | duration: 200,
286 | complete: function() {
287 | integrator.next();
288 | }
289 | });
290 | },
291 |
292 | postList: function(integrator) {
293 |
294 | //var $post = $('.post');
295 | var $postBlock = $('.post-block, .pagination, .comments');
296 | var $postBlockTransition = CONFIG.motion.transition.post_block;
297 | var $postHeader = $('.post-header');
298 | var $postHeaderTransition = CONFIG.motion.transition.post_header;
299 | var $postBody = $('.post-body');
300 | var $postBodyTransition = CONFIG.motion.transition.post_body;
301 | var $collHeader = $('.collection-title, .archive-year');
302 | var $collHeaderTransition = CONFIG.motion.transition.coll_header;
303 | var $sidebarAffix = $('.sidebar-inner');
304 | var $sidebarAffixTransition = CONFIG.motion.transition.sidebar;
305 | var hasPost = $postBlock.length > 0;
306 |
307 | function postMotion() {
308 | var postMotionOptions = window.postMotionOptions || {
309 | stagger: 100,
310 | drag : true
311 | };
312 | postMotionOptions.complete = function() {
313 | // After motion complete need to remove transform from sidebar to let affix work on Pisces | Gemini.
314 | if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) {
315 | $sidebarAffix.css({ 'transform': 'initial' });
316 | }
317 | integrator.next();
318 | };
319 |
320 | //$post.velocity('transition.slideDownIn', postMotionOptions);
321 | if (CONFIG.motion.transition.post_block) {
322 | $postBlock.velocity('transition.' + $postBlockTransition, postMotionOptions);
323 | }
324 | if (CONFIG.motion.transition.post_header) {
325 | $postHeader.velocity('transition.' + $postHeaderTransition, postMotionOptions);
326 | }
327 | if (CONFIG.motion.transition.post_body) {
328 | $postBody.velocity('transition.' + $postBodyTransition, postMotionOptions);
329 | }
330 | if (CONFIG.motion.transition.coll_header) {
331 | $collHeader.velocity('transition.' + $collHeaderTransition, postMotionOptions);
332 | }
333 | // Only for Pisces | Gemini.
334 | if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) {
335 | $sidebarAffix.velocity('transition.' + $sidebarAffixTransition, postMotionOptions);
336 | }
337 | }
338 |
339 | hasPost ? postMotion() : integrator.next();
340 |
341 | if (CONFIG.motion.async) {
342 | integrator.next();
343 | }
344 | },
345 |
346 | sidebar: function(integrator) {
347 | if (CONFIG.sidebar.display === 'always') {
348 | NexT.utils.displaySidebar();
349 | }
350 | integrator.next();
351 | }
352 | };
353 |
354 | });
355 |
--------------------------------------------------------------------------------
/js/src/axios.js:
--------------------------------------------------------------------------------
1 | /* axios v0.18.0 | (c) 2018 by Matt Zabriskie */
2 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new s(e),n=i(s.prototype.request,t);return o.extend(n,s.prototype,t),o.extend(n,t),n}var o=n(2),i=n(3),s=n(5),u=n(6),a=r(u);a.Axios=s,a.create=function(e){return r(o.merge(u,e))},a.Cancel=n(23),a.CancelToken=n(24),a.isCancel=n(20),a.all=function(e){return Promise.all(e)},a.spread=n(25),e.exports=a,e.exports.default=a},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"[object ArrayBuffer]"===R.call(e)}function i(e){return"undefined"!=typeof FormData&&e instanceof FormData}function s(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function u(e){return"string"==typeof e}function a(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===R.call(e)}function d(e){return"[object File]"===R.call(e)}function l(e){return"[object Blob]"===R.call(e)}function h(e){return"[object Function]"===R.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n
6 | * @license MIT
7 | */
8 | e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new s,response:new s}}var o=n(6),i=n(2),s=n(17),u=n(18);r.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(o,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[u,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},i.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof XMLHttpRequest?e=n(8):"undefined"!=typeof process&&(e=n(8)),e}var i=n(2),s=n(7),u={"Content-Type":"application/x-www-form-urlencoded"},a={adapter:o(),transformRequest:[function(e,t){return s(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){a.headers[e]={}}),i.forEach(["post","put","patch"],function(e){a.headers[e]=i.merge(u)}),e.exports=a},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(9),i=n(12),s=n(13),u=n(14),a=n(10),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(15);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in l||u(e.url)||(l=new window.XDomainRequest,h="onload",m=!0,l.onprogress=function(){},l.ontimeout=function(){}),e.auth){var y=e.auth.username||"",w=e.auth.password||"";d.Authorization="Basic "+c(y+":"+w)}if(l.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l[h]=function(){if(l&&(4===l.readyState||m)&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:r,status:1223===l.status?204:l.status,statusText:1223===l.status?"No Content":l.statusText,headers:n,config:e,request:l};o(t,f,i),l=null}},l.onerror=function(){f(a("Network Error",e,null,l)),l=null},l.ontimeout=function(){f(a("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=n(16),v=(e.withCredentials||u(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var s=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),i=s.join("&")}return i&&(e+=(e.indexOf("?")===-1?"?":"&")+i),e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([n]):s[t]=s[t]?s[t]+", "+n:n}}),s):s}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}function r(e){for(var t,r,i=String(e),s="",u=0,a=o;i.charAt(0|u)||(a="=",u%1);s+=a.charAt(63&t>>8-u%1*8)){if(r=i.charCodeAt(u+=.75),r>255)throw new n;t=t<<8|r}return s}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=r},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),i=n(19),s=n(20),u=n(6),a=n(21),c=n(22);e.exports=function(e){r(e),e.baseURL&&!a(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||u.adapter;return t(e).then(function(t){return r(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return s(t)||(r(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])});
9 | //# sourceMappingURL=axios.min.map
--------------------------------------------------------------------------------
/lib/ua-parser-js/dist/ua-parser.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * UAParser.js v0.7.9
3 | * Lightweight JavaScript-based User-Agent string parser
4 | * https://github.com/faisalman/ua-parser-js
5 | *
6 | * Copyright © 2012-2015 Faisal Salman
7 | * Dual licensed under GPLv2 & MIT
8 | */
9 | (function(window,undefined){"use strict";var LIBVERSION="0.7.9",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){for(var i in extensions){if("browser cpu device engine os".indexOf(i)!==-1&&extensions[i].length%2===0){regexes[i]=extensions[i].concat(regexes[i])}}return regexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.split(".")[0]:undefined}};var mapper={rgx:function(){var result,i=0,j,k,p,q,matches,match,args=arguments;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){result[q[0]]=q[1].call(this,match)}else{result[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){result[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{result[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){result[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{result[q]=match?match:undefined}}}}i+=2}return result},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j