You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
* 增加上传历史记录
* 2023-01-31 v2.7.0 dev - 增加上传历史记录 - 增加粘贴上传状态 - 增加广场非图片图标 - 增加前端显示缩略图链接 - 增加每日获取Bing图片背景 - 增加图片详细信息管理登录后显示更多信息 - 修复图片详细信息中随机图片排版混乱 - 替换访问生成缩略图代码 - 更新一些组件 - 优化代码
This commit is contained in:
@@ -232,9 +232,60 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic
|
||||
});
|
||||
})();
|
||||
|
||||
/** 导航状态 */
|
||||
$('.nav-pills').find('a').each(function () {
|
||||
if (this.href == document.location.href) {
|
||||
$(this).parent().addClass('active'); // this.className = 'active';
|
||||
}
|
||||
});
|
||||
/** javascript parseUrl函数解析url获取网址url参数
|
||||
* https://www.cnblogs.com/lazb/p/10144471.html
|
||||
*/
|
||||
|
||||
function parseURL(url) {
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
return {
|
||||
source: url,
|
||||
protocol: a.protocol.replace(':', ''),
|
||||
host: a.hostname,
|
||||
port: a.port,
|
||||
query: a.search,
|
||||
params: (function () {
|
||||
var ret = {},
|
||||
seg = a.search.replace(/^\?/, '').split('&'),
|
||||
len = seg.length, i = 0, s;
|
||||
for (; i < len; i++) {
|
||||
if (!seg[i]) { continue; }
|
||||
s = seg[i].split('=');
|
||||
ret[s[0]] = s[1];
|
||||
}
|
||||
return ret;
|
||||
})(),
|
||||
file: (a.pathname.match(/\/([^\/?#]+)$/i) || [, ''])[1],
|
||||
hash: a.hash.replace('#', ''),
|
||||
path: a.pathname.replace(/^([^\/])/, '/$1'),
|
||||
relative: (a.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ''])[1],
|
||||
segments: a.pathname.replace(/^\//, '').split('/')
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
使用实例:
|
||||
var myURL = parseURL('http://abc.com:8080/dir/index.html?id=255&m=hello#top');
|
||||
myURL.file; // = 'index.html'
|
||||
myURL.hash; // = 'top'
|
||||
myURL.host; // = 'abc.com'
|
||||
myURL.query; // = '?id=255&m=hello'
|
||||
myURL.params; // = Object = { id: 255, m: hello }
|
||||
myURL.path; // = '/dir/index.html'
|
||||
myURL.segments; // = Array = ['dir', 'index.html']
|
||||
myURL.port; // = '8080'
|
||||
myURL.protocol; // = 'http'
|
||||
myURL.source; // = 'http://abc.com:8080/dir/index.html?id=255&m=hello#top'
|
||||
*/
|
||||
|
||||
|
||||
/** jQuery 读取文件 readTxt('../admin/version.php'); */
|
||||
function readTxt(filePath) {
|
||||
$.get(filePath, function (data) {
|
||||
var lines = data.split("\n"); //按行读取
|
||||
$.each(lines, function (i, v) {
|
||||
console.log(v);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user