diff options
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/pages/directory_init.js | 11 | ||||
| -rw-r--r-- | static/js/pages/expandable_login_init.js | 11 | ||||
| -rw-r--r-- | static/js/pages/fullscreen_front_run.js | 7 | ||||
| -rw-r--r-- | static/js/pages/scroll_pane_init.js | 13 | ||||
| -rw-r--r-- | static/js/pages/search_files_init.js | 13 |
5 files changed, 55 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/fullscreen_front_run.js b/static/js/pages/fullscreen_front_run.js new file mode 100644 index 0000000..1116b7a --- /dev/null +++ b/static/js/pages/fullscreen_front_run.js @@ -0,0 +1,7 @@ +// Runs `initFullscreen()` for `template/fullscreen_front.st` without inline JS. +(function() { + if (typeof window.initFullscreen === 'function') { + window.initFullscreen(); + } +})(); + 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(); + } + }); +})(); + |
