You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
91 KiB

5 years ago
/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multipl
/* cookie-js2@iotcat v1.0.1 */
var cookie={set:function(e,r,a){if(a==undefined)var a=3e3;var t=new Date;t.setTime(t.getTime()+a*24*60*60*1e3);document.cookie=e+"="+escape(r)+";expires="+t.toGMTString()+";path=/"},get:function(e){var r,a=new RegExp("(^| )"+e+"=([^;]*)(;|$)");if(r=document.cookie.match(a)){return unescape(r[2])}else{return null}},del:function(e){var r=new Date;r.setTime(r.getTime()-1);var a,t=new RegExp("(^| )"+e+"=([^;]*)(;|$)");if(a=document.cookie.match(t)){var n=unescape(a[2])}else{var n=null}if(n!=null){document.cookie=e+"="+n+";expires="+r.toGMTString()}}}
4 years ago
4 years ago
/* HTML decoder */
function htmlDecode(str){
var s = "";
if(str.length == 0) return "";
s = str.replace(/&amp;/g,"&");
s = s.replace(/&lt;/g,"<");
s = s.replace(/&gt;/g,">");
s = s.replace(/&nbsp;/g," ");
s = s.replace(/&#39;/g,"\'");
s = s.replace(/&quot;/g,"\"");
return s;
}
4 years ago
/* rand string */
function randomStr(length) {
var result = '', chars = '0123456789abcdefghijklmnopqrstuvwxyz';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
5 years ago
/* include css */
4 years ago
if(/*typeof block_aplayer == "undefined"*/true){
5 years ago
if(window.screen.width < 600) document.write('<link rel="stylesheet" href="https://cdn.yimian.xyz/ushio-js/ushio-js.mobile.min.css">');
else document.write('<link rel="stylesheet" href="https://cdn.yimian.xyz/ushio-js/ushio-js.min.css">');
}
5 years ago
if(typeof block_tips == "undefined"){
document.write('<link rel="stylesheet" href="https://cdn.yimian.xyz/ushio-js/ushio-js.tips.min.css">');
}
5 years ago
5 years ago
/* global default page config */
var page = {
url: window.location.href,
title: 'Lovely Ushio',
icon: 'https://cdn.yimian.xyz/img/head/head3r.ico',
5 years ago
path: window.location.pathname,
5 years ago
host: window.location.host,
hostname: window.location.hostname,
5 years ago
session: {},
4 years ago
auth: [],
4 years ago
lang: [],
nolang: [],
tran: {},
group: [],
4 years ago
proj: 'iotcat/ushio',
4 years ago
ushio: true,
window: true,
LastWindowOpenTime: new Date().valueOf(),
5 years ago
openTime: Date.parse(new Date()) / 1000,
Timer: 0,
TimerObj: null,
params: function() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&#]*)/gi,
function(m,key,value) {
vars[key] = value;
}
);
return vars;
}(),
copyright: {
year: "© 2018-" + (new Date()).getFullYear(),
name: '<a id="ushio-iotcat" href="https://iotcat.me">iotcat</a>',
full: "© 2018-" + (new Date()).getFullYear() + ' ' + '<a id="ushio-iotcat" href="https://iotcat.me">iotcat</a>'
},
5 years ago
};
4 years ago
/* add listener */
setInterval(function(){
if(window.location.href != page.url){
page.url = window.location.href;
page.path = window.location.pathname;
page.host = window.location.host;
page.hostname = window.location.hostname;
}
}, 500);
4 years ago
/* check cookie */
var _t_ran_cookie = randomStr(16);
cookie.set('_t_ran_cookie', _t_ran_cookie);
if(cookie.get('_t_ran_cookie') != _t_ran_cookie && typeof allow_no_cookie == "undefined"){
4 years ago
if((navigator.language||navigator.userLanguage).substr(0, 2) == 'zh') alert('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>Cookie<EFBFBD><EFBFBD>Ushio<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ..');
else alert('Your browser does not support cookie, Ushio service will quit..');
4 years ago
page.ushio = false;
throw new Error('ushio::Not support cookie!');
}
/* get mask */
if(cookie.get('_mask') && cookie.get('_mask').length == 64){
page.mask = cookie.get('_mask');
}else{
page.mask = randomStr(64);
cookie.set('_mask', page.mask);
}
/* set flag */
page.flag = randomStr(64);
4 years ago
/* Get Pre Language */
if(cookie.get('_lang')){
page.lang = JSON.parse(atob(cookie.get('_lang')));
}else{
page.lang.push((navigator.language||navigator.userLanguage).substr(0, 2));
}
/* translater */
;(function(){
if(typeof lang != "undefined" && lang.length > 0){
var l = lang[0];
for(var i = 0; i < lang.length; i++){
if(page.lang.indexOf(lang[i]) != -1){
l = lang[i];
break;
}
}
page.tran.setLang = function(l){
4 years ago
if(!l && page.tran.hasOwnProperty('getLang')){
l = page.tran.getLang();
}
4 years ago
lang.forEach(function(item){
4 years ago
$('.\\.'+item).hide();
4 years ago
});
4 years ago
$('.\\.'+l).show();
4 years ago
page.tran.getLang = function(){return l;}
}
4 years ago
page.tran.getLang = function(){return (navigator.language||navigator.userLanguage).substr(0, 2);}
4 years ago
$(function(){
page.tran.setLang(l);
});
4 years ago
}else{
page.tran.setLang = function(){}
page.tran.getLang = function(){return 'zh';}
4 years ago
}
})();
4 years ago
5 years ago
/* session ini */
var session = {};
4 years ago
session.onload = function(f, isFirst){
if(session.status){
if(isFirst == true){
session_wait(f);
}else{
f();
}
}else{
setTimeout(session.onload, 30, f, true);
}
}
5 years ago
5 years ago
/* page config merge */
if($('title').length){
4 years ago
page.title = htmlDecode($('title').html());
5 years ago
};
if($('[rel="icon"]').length){
page.icon = $('[rel="icon"]').attr("href");
}
/* page reload */
if(window.location.protocol == 'http:' && window.location.hostname != 'localhost' && window.location.hostname != '127.0.0.1' ){
5 years ago
window.location.href = window.location.href.replace(/^http/,"https");
}
4 years ago
/* css addition */
document.write('\
<style>\
@-webkit-keyframes rotation{\
from {-webkit-transform: rotate(0deg);}\
to {-webkit-transform: rotate(360deg);}\
}\
\
.imgRotate{\
-webkit-transform: rotate(360deg);\
animation: rotation 30s linear infinite;\
-moz-animation: rotation 30s linear infinite;\
-webkit-animation: rotation 30s linear infinite;\
-o-animation: rotation 30s linear infinite;\
}\
</style>\
');
5 years ago
/* Start Timer */
page.TimerObj = setInterval("page.Timer++", 1000);
console.log(page);