-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
43 lines (40 loc) · 1.15 KB
/
app.js
File metadata and controls
43 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const getRealPath = (pathname, desc = false) => {
if (!pathname) {
pathname = window.location.pathname;
}
let names = pathname.split("/");
if (desc === false) {
for (let i = names.length - 1; i >= 0; --i) {
let name = names[i].trim();
if (name.length > 0 && name !== "/" && name !== "index.html") {
return name;
}
}
} else {
for (let i = 0; i < names.length; ++i) {
let name = names[i].trim();
if (name.length > 0 && name !== "/" && name !== "index.html") {
return name;
}
}
}
return "/";
};
let links = document.querySelectorAll(".nexmoe-list-item");
let rootRealPath = getRealPath(window.location.pathname, true);
for (let link of links) {
let linkPath = link.getAttribute("href");
if (linkPath && getRealPath(linkPath, true) === rootRealPath) {
link.className = "active nexmoe-list-item mdui-list-item mdui-ripple";
}
}
var $ = mdui.JQ;
$("table")
.has("img")
.addClass("nexmoe-album");
$("#nexmoe-sidebar a").addClass("mdui-ripple");
mdui.mutation();
function search() {
window.open($("#search_form").attr("action_e") + " " + $("#search_value").val());
return false;
}