summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authoryo momma <shutup@oops.wtf>2026-02-03 21:30:24 +0000
committeryo momma <shutup@oops.wtf>2026-02-03 21:30:24 +0000
commit263677a46ee031277fae07109acac17b5ef821c4 (patch)
tree0bbd6da3ca4fc9e4809f20be713161d39a5a525a /static/js
parentb3928bc192cdf729d4b9e53ff5603905ae446fb7 (diff)
Refactor: extract page init snippets
Diffstat (limited to 'static/js')
-rw-r--r--static/js/pages/directory_init.js11
-rw-r--r--static/js/pages/expandable_login_init.js11
-rw-r--r--static/js/pages/scroll_pane_init.js13
-rw-r--r--static/js/pages/search_files_init.js13
4 files changed, 48 insertions, 0 deletions
diff --git a/static/js/pages/directory_init.js b/static/js/pages/directory_init.js
new file mode 100644
index 0000000..70f2017
--- /dev/null
+++ b/static/js/pages/directory_init.js
@@ -0,0 +1,11 @@
+// Directory page initializer.
+// Keeps templates mostly data-only.
+
+(function() {
+ if (typeof jQuery !== 'function') { return; }
+
+ jQuery(function() {
+ if (typeof initDirectory === 'function') { initDirectory(); }
+ });
+})();
+
diff --git a/static/js/pages/expandable_login_init.js b/static/js/pages/expandable_login_init.js
new file mode 100644
index 0000000..669836f
--- /dev/null
+++ b/static/js/pages/expandable_login_init.js
@@ -0,0 +1,11 @@
+// Expandable login-form initializer (used by $form_login()$).
+// Keeps templates mostly data-only.
+
+(function() {
+ if (typeof jQuery !== 'function') { return; }
+
+ jQuery(function() {
+ if (typeof initExpandableLoginForm === 'function') { initExpandableLoginForm(); }
+ });
+})();
+
diff --git a/static/js/pages/scroll_pane_init.js b/static/js/pages/scroll_pane_init.js
new file mode 100644
index 0000000..1508418
--- /dev/null
+++ b/static/js/pages/scroll_pane_init.js
@@ -0,0 +1,13 @@
+// Optional jScrollPane initializer for legacy pages that use `.scroll-pane`.
+// Keep it defensive: some pages may not load the plugin.
+
+(function() {
+ if (typeof jQuery !== 'function') { return; }
+
+ jQuery(function() {
+ if (jQuery.fn && typeof jQuery.fn.jScrollPane === 'function') {
+ jQuery('.scroll-pane').jScrollPane();
+ }
+ });
+})();
+
diff --git a/static/js/pages/search_files_init.js b/static/js/pages/search_files_init.js
new file mode 100644
index 0000000..661da63
--- /dev/null
+++ b/static/js/pages/search_files_init.js
@@ -0,0 +1,13 @@
+// Full-page search initializer.
+// Keeps templates mostly data-only.
+
+(function() {
+ if (typeof jQuery !== 'function') { return; }
+
+ jQuery(function() {
+ if (window.Search && typeof window.Search.initFullpage === 'function') {
+ window.Search.initFullpage();
+ }
+ });
+})();
+