4import "jquery-ui/ui/keycode";
5import "jquery-ui/ui/widgets/tabs";
6$(() => {
7 if(window.location.pathname != webroot + "manage/filebans") 8 return;
9 $("div#fileban-tabs").tabs();
10});
12
13export function getPageThread() {
14 let pathname = window.location.pathname;
15 if(typeof webroot == "string" && webroot != "/") {16 pathname = pathname.slice(webroot.length);
17 if(pathname === "" || pathname[0] != '/') {
18 pathname = "/" + pathname;
13export function getPageThread() {
14 let pathname = window.location.pathname;
15 if(typeof webroot == "string" && webroot != "/") {
16 pathname = pathname.slice(webroot.length);17 if(pathname === "" || pathname[0] != '/') {
18 pathname = "/" + pathname;
19 }
37 let thread = {board: currentBoard(), thread: 0};
38 let pathname = location.pathname;
39 if(typeof webroot == "string" && webroot != "/") {
40 pathname = pathname.slice(webroot.length);41 if(pathname === "" || pathname[0] != '/') {
42 pathname = "/" + pathname;
43 }
36 // returns the board and thread ID if we are viewing a thread
37 let thread = {board: currentBoard(), thread: 0};
38 let pathname = location.pathname;
39 if(typeof webroot == "string" && webroot != "/") {40 pathname = pathname.slice(webroot.length);
41 if(pathname === "" || pathname[0] != '/') {
42 pathname = "/" + pathname;
Variables that aren't defined, but accessed may throw reference errors at runtime.
Potential ReferenceError
s may result from misspellings of variable and parameter names, or accidental implicit globals (for example, forgetting the var
keyword in a for
loop initializer).
Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/
comment, or specified in the globals key in the configuration file.
A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
const foo = someFunction();
const bar = a + 1; // 'a' is undeclared
/*global someFunction, a*/
/*eslint no-undef: "error"*/
const foo = someFunction();
const bar = a + 1;