mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-18 01:09:03 +00:00
Initial commit.
This commit is contained in:
1895
nyaa/static/js/bootstrap-select.js
vendored
Normal file
1895
nyaa/static/js/bootstrap-select.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
nyaa/static/js/bootstrap.min.js
vendored
Normal file
7
nyaa/static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
nyaa/static/js/jquery.min.js
vendored
Normal file
4
nyaa/static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
62
nyaa/static/js/main.js
Normal file
62
nyaa/static/js/main.js
Normal file
@@ -0,0 +1,62 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) { // wait for content to load because this script is above the link
|
||||
document.getElementById('themeToggle').addEventListener('click', function(e) { // listen for click event
|
||||
e.preventDefault(); // keep link from default action, which going to top of the page
|
||||
toggleDarkMode(); // toggle theme
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Credit: https://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3
|
||||
// We can attach the `fileselect` event to all file inputs on the page
|
||||
$(document).on('change', ':file', function() {
|
||||
var input = $(this),
|
||||
numFiles = input.get(0).files ? input.get(0).files.length : 1,
|
||||
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
|
||||
input.trigger('fileselect', [numFiles, label]);
|
||||
});
|
||||
|
||||
|
||||
// We can watch for our custom `fileselect` event like this
|
||||
$(document).ready(function() {
|
||||
$(':file').on('fileselect', function(event, numFiles, label) {
|
||||
|
||||
var input = $(this).parent().prev().find(':text'),
|
||||
log = numFiles > 1 ? numFiles + ' files selected' : label;
|
||||
|
||||
if (input.length) {
|
||||
input.val(log);
|
||||
} else {
|
||||
if (log) alert(log);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//
|
||||
// This is the unminified version of the theme changer script in the layout.html @ line: 21
|
||||
// ===========================================================
|
||||
// if (typeof(Storage) !== 'undefined') {
|
||||
// var bsThemeLink = document.getElementById('bsThemeLink');
|
||||
|
||||
// if (localStorage.getItem('theme') === 'dark') {
|
||||
// setThemeDark();
|
||||
// }
|
||||
|
||||
// function toggleDarkMode() {
|
||||
// if (localStorage.getItem('theme') === 'dark') {
|
||||
// setThemeLight();
|
||||
// } else {
|
||||
// setThemeDark();
|
||||
// }
|
||||
// }
|
||||
|
||||
// function setThemeDark() {
|
||||
// bsThemeLink.href = '/static/css/bootstrap-dark.min.css';
|
||||
// localStorage.setItem('theme', 'dark');
|
||||
// }
|
||||
|
||||
// function setThemeLight() {
|
||||
// bsThemeLink.href = '/static/css/bootstrap.min.css';
|
||||
// localStorage.setItem('theme', 'light');
|
||||
// }
|
||||
// }
|
||||
13
nyaa/static/js/npm.js
Normal file
13
nyaa/static/js/npm.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
|
||||
require('../../js/transition.js')
|
||||
require('../../js/alert.js')
|
||||
require('../../js/button.js')
|
||||
require('../../js/carousel.js')
|
||||
require('../../js/collapse.js')
|
||||
require('../../js/dropdown.js')
|
||||
require('../../js/modal.js')
|
||||
require('../../js/tooltip.js')
|
||||
require('../../js/popover.js')
|
||||
require('../../js/scrollspy.js')
|
||||
require('../../js/tab.js')
|
||||
require('../../js/affix.js')
|
||||
Reference in New Issue
Block a user