r34 theme-specific stuff to theme/script.js
This commit is contained in:
parent
e6ec2340af
commit
e0519bb125
3 changed files with 48 additions and 48 deletions
|
@ -55,21 +55,21 @@ class Home extends Extension
|
|||
$length = strlen($strtotal);
|
||||
for ($n=0; $n<$length; $n++) {
|
||||
$cur = $strtotal[$n];
|
||||
$counter_text .= " <img alt='$cur' src='$base_href/ext/home/counters/$counter_dir/$cur.gif' /> ";
|
||||
$counter_text .= "<img alt='$cur' src='$base_href/ext/home/counters/$counter_dir/$cur.gif' />";
|
||||
}
|
||||
|
||||
// get the homelinks and process them
|
||||
if (strlen($config->get_string('home_links', '')) > 0) {
|
||||
$main_links = $config->get_string('home_links');
|
||||
} else {
|
||||
$main_links = '[url=site://post/list]Posts[/url] [url=site://comment/list]Comments[/url] [url=site://tags]Tags[/url]';
|
||||
$main_links = '[url=site://post/list]Posts[/url][url=site://comment/list]Comments[/url][url=site://tags]Tags[/url]';
|
||||
if (class_exists("Pools")) {
|
||||
$main_links .= ' [url=site://pool]Pools[/url]';
|
||||
$main_links .= '[url=site://pool]Pools[/url]';
|
||||
}
|
||||
if (class_exists("Wiki")) {
|
||||
$main_links .= ' [url=site://wiki]Wiki[/url]';
|
||||
$main_links .= '[url=site://wiki]Wiki[/url]';
|
||||
}
|
||||
$main_links .= ' [url=site://ext_doc]Documentation[/url]';
|
||||
$main_links .= '[url=site://ext_doc]Documentation[/url]';
|
||||
}
|
||||
$main_links = format_text($main_links);
|
||||
$main_text = $config->get_string('home_text', '');
|
||||
|
|
|
@ -35,46 +35,3 @@ function image_hash_ban(id) {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
var navHidden = false;
|
||||
function toggleNav() {
|
||||
if(navHidden) {
|
||||
$('BODY').removeClass('navHidden');
|
||||
Cookies.set("ui-shownav", "true");
|
||||
}
|
||||
else {
|
||||
$('BODY').addClass('navHidden');
|
||||
Cookies.set("ui-shownav", "false");
|
||||
}
|
||||
navHidden = !navHidden;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if(Cookies.get("ui-shownav") === "false") {
|
||||
toggleNav();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var forceDesktop = false;
|
||||
function toggleDesktop() {
|
||||
if(forceDesktop) {
|
||||
let viewport = document.querySelector("meta[name=viewport]");
|
||||
viewport.setAttribute('content', 'width=512');
|
||||
Cookies.set("ui-desktop", "false");
|
||||
}
|
||||
else {
|
||||
let viewport = document.querySelector("meta[name=viewport]");
|
||||
viewport.setAttribute('content', 'width=1024, initial-scale=0.4');
|
||||
Cookies.set("ui-desktop", "true");
|
||||
navHidden = true;
|
||||
toggleNav();
|
||||
}
|
||||
forceDesktop = !forceDesktop;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if(Cookies.get("ui-desktop") === "true") {
|
||||
toggleDesktop();
|
||||
}
|
||||
});
|
||||
|
|
43
themes/rule34v2/script.js
Normal file
43
themes/rule34v2/script.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
|
||||
var navHidden = false;
|
||||
function toggleNav() {
|
||||
if(navHidden) {
|
||||
$('BODY').removeClass('navHidden');
|
||||
Cookies.set("ui-shownav", "true");
|
||||
}
|
||||
else {
|
||||
$('BODY').addClass('navHidden');
|
||||
Cookies.set("ui-shownav", "false");
|
||||
}
|
||||
navHidden = !navHidden;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if(Cookies.get("ui-shownav") === "false") {
|
||||
toggleNav();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var forceDesktop = false;
|
||||
function toggleDesktop() {
|
||||
if(forceDesktop) {
|
||||
let viewport = document.querySelector("meta[name=viewport]");
|
||||
viewport.setAttribute('content', 'width=512');
|
||||
Cookies.set("ui-desktop", "false");
|
||||
}
|
||||
else {
|
||||
let viewport = document.querySelector("meta[name=viewport]");
|
||||
viewport.setAttribute('content', 'width=1024, initial-scale=0.4');
|
||||
Cookies.set("ui-desktop", "true");
|
||||
navHidden = true;
|
||||
toggleNav();
|
||||
}
|
||||
forceDesktop = !forceDesktop;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if(Cookies.get("ui-desktop") === "true") {
|
||||
toggleDesktop();
|
||||
}
|
||||
});
|
Reference in a new issue