app/Resources/static-src/common/utils.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

import 'jquery-base64';

const Browser = {};
let userAgent = navigator.userAgent.toLowerCase();
let s;

(s = userAgent.match(/msie ([\d.]+)/)) ? Browser.ie = s[1]:
  (s = userAgent.match(/firefox\/([\d.]+)/)) ? Browser.firefox = s[1] :
    (s = userAgent.match(/chrome\/([\d.]+)/)) ? Browser.chrome = s[1] :
      (s = userAgent.match(/opera.([\d.]+)/)) ? Browser.opera = s[1] :
        (s = userAgent.match(/version\/([\d.]+).*safari/)) ? Browser.safari = s[1] : 0;

Browser.ie10 = /MSIE\s+10.0/i.test(navigator.userAgent);
Browser.ie11 = (/Trident\/7\./).test(navigator.userAgent);
Browser.edge = /Edge\/13./i.test(navigator.userAgent);


const isMobileDevice = () => {
  return navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i);
};

const delHtmlTag = (str) => {
  return str.replace(/<[^>]+>/g, '').replace(/&nbsp;/ig, '');
};

const initTooltips = () => {
  $('[data-toggle="tooltip"]').tooltip({
    html: true,
  });
};

const initPopover = () => {
  $('[data-toggle="popover"]').popover({
    html: true,
  });
};

const sec2Time = (sec) => {
  let time = '';
  let h = parseInt((sec % 86400) / 3600);
  let s = parseInt((sec % 3600) / 60);
  let m = sec % 60;
  if (h > 0) {
    time += h + ':';
  }
  if (s.toString().length < 2) {
    time += '0' + s + ':';
  } else {
    time += s + ':';
  }
  if (m.toString().length < 2) {
    time += '0' + m;
  } else {
    time += m;
  }
  return time;
};

const time2Sec = (time) => {
  let arry = time.split(':');

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。