PageSourceSearch

https://vise.lnh.edu.pk/JMS/js/styleSwitcher.js

js lnh.edu.pk collected 2026-10-01 12:10:55 UTC 3,154 bytes, 95 lines download raw bytes

1(function($) {
2    "use strict"
3
4    const versionSelect = $('#theme_version');
5    const layoutSelect = $('#theme_layout');
6    const sidebarStyleSelect = $('#sidebar_style');
7    const sidebarPositionSelect = $('#sidebar_position');
8    const headerPositionSelect = $('#header_position');
9    const containerLayoutSelect = $('#container_layout');
10    const themeDirectionSelect = $('#theme_direction');
11
12    versionSelect.on('change', function() {
13        $('body').attr('data-theme-version', this.value);
14    });
15
16    sidebarPositionSelect.on('change', function() {
17        $('body').attr('data-sidebar-position', this.value);
18    });
19
20    headerPositionSelect.on('change', function() {
21        $('body').attr('data-header-position', this.value);
22    });
23
24    themeDirectionSelect.on('change', function() {
25        $('html').attr('dir', this.value);
26        $('html').attr('class', '');
27        $('html').addClass(this.value);
28        $('body').attr('direction', this.value);
29    });
30
31    layoutSelect.on('change', function() {
32        if($('body').attr('data-sidebar-style') === 'overlay') {
33            $('body').attr('data-sidebar-style', 'full');
34            $('body').attr('data-layout', this.value);
35            return;
36        }
37
38        $('body').attr('data-layout', this.value);
39    });
40
41    containerLayoutSelect.on('change', function() {
42        if(this.value === "boxed") {
43            // if($('body').attr('data-sidebar-style') === "overlay" && $('body').attr('data-layout') === "horizontal") {
44            //     $('body').attr('data-sidebar-style', 'full');
45            //     $('body').attr('data-container', this.value);
46            //     return;
47            // }
48
49            if($('body').attr('data-layout') === "vertical" && $('body').attr('data-sidebar-style') === "full") {
50                $('body').attr('data-sidebar-style', 'overlay');
51                $('body').attr('data-container', this.value);
52                return;
53            }
54        }
55
56        $('body').attr('data-container', this.value);
57    });
58
59    sidebarStyleSelect.on('change', function() {
60        if($('body').attr('data-layout') === "horizontal") {
61            if(this.value === "overlay") {
62                alert("Sorry! Overlay is not possible in Horizontal layout.");
63                return;
64            }
65        }
66
67        if($('body').attr('data-layout') === "vertical") {
68            if($('body').attr('data-container') === "boxed" && this.value === "full") {
69                alert("Sorry! Full menu is not available in Vertical Boxed layout.");
70                return;
71            }
72        }
73
74        $('body').attr('data-sidebar-style', this.value);
75    });
76
77    $('input[name="navigation_header"]').on('click', function() {
78        $('body').attr('data-nav-headerbg', this.value);
79    });
80
81    $('input[name="header_bg"]').on('click', function() {
82        $('body').attr('data-headerbg', this.value);
83    });
84
85    $('input[name="sidebar_bg"]').on('click', function() {
86        $('body').attr('data-sibebarbg', this.value);
87    });
88
89
90
91
92
93
94
95})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.