This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^[\u4e00-\u9fa5]$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name sinaimg | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match *://*.sinaimg.cn/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ios 时间转时间戳 | |
// 兼容所有浏览器 | |
// ios 使用 new Date("2010-03-15 10:30:00").getTime() 获取时间戳报错 | |
// @time "2010-03-15 10:30:00" | |
function getTs(time){ | |
var arr = time.split(/[- :]/), | |
_date = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]), | |
timeStr = Date.parse(_date) | |
return timeStr | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touchToBottom: function(fn){ | |
if($(window).height() + $(window).scrollTop() >= $(document).height() - 80){ | |
fn && fn(); | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 检查微信浏览器版本号 | |
const browserVersion = Number(/micromessenger\/(\d)/i.exec(navigator.userAgent)[1]) //return 4 or 5 or 6 ... | |
// 检查浏览器平台 | |
const platform = /android/i.test(navigator.userAgent) ? 'android' : 'ios' // return android or ios | |
// 检查是否是微信浏览器 | |
const isWxBrowser = /micromessenger/i.test(navigator.userAgent) //return true or false |