/[smeserver]/rpms/smeserver-manager/sme10/smeserver-manager-0.1.4-Save-and-restore-menu-configuration.patch
ViewVC logotype

Contents of /rpms/smeserver-manager/sme10/smeserver-manager-0.1.4-Save-and-restore-menu-configuration.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Feb 12 11:38:42 2024 UTC (9 months, 1 week ago) by brianr
Branch: MAIN
CVS Tags: smeserver-manager-0_1_4-31_el7_sme, smeserver-manager-0_1_4-34_el7_sme, smeserver-manager-0_1_4-29_el7_sme, smeserver-manager-0_1_4-33_el7_sme, smeserver-manager-0_1_4-27_el7_sme, smeserver-manager-0_1_4-26_el7_sme, smeserver-manager-0_1_4-28_el7_sme, smeserver-manager-0_1_4-32_el7_sme, HEAD
* Mon Feb 12 2024 Brian Read <brianr@koozali.org> 0.1.4-26.sme
- Save and Restore menu configuration [SME: 12464]

1 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep
2 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2024-02-12 11:07:52.707843873 +0000
3 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2024-02-12 11:06:00.000000000 +0000
4 @@ -31,22 +31,6 @@
5 %= stylesheet '/js/buttons.print.min.js'
6
7 %= stylesheet '/css/sme-jquery-overrides.css'
8 -
9 -
10 - <!--><script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
11 - <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
12 - <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
13 - <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
14 - <script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
15 - <script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.print.min.js"></script>
16 - -->
17 -
18 -
19 - <!-- ><link href="https://cdn.datatables.net/v/dt/dt-1.13.8/datatables.min.css" rel="stylesheet">
20 - <script src="https://cdn.datatables.net/v/dt/dt-1.13.8/datatables.min.js"></script>
21 - <link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
22 - <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>-->
23 -
24
25 </head>
26
27 @@ -76,6 +60,7 @@
28 %= include 'partials/_navig2'
29 % }
30 </div>
31 +
32 <div id="main" class="col-md-9">
33
34 %= include 'partials/_info'
35 @@ -106,6 +91,48 @@
36 % }
37
38 %= javascript '/js/sme-dataTable-setup.js'
39 +
40 +%= javascript begin
41 +//Set menu to initial condition based on localStorage
42 +$(document).ready(function() {
43 + let menunavflag = window.localStorage.getItem('menunav');
44 + if (menunavflag != "false"){
45 + $('#menunav').toggle(true);
46 + } else {
47 + $('#menunav').toggle(false);
48 + }
49 +
50 + let menuadmflag = window.localStorage.getItem('menuadm');
51 + if (menuadmflag != "false"){
52 + $('#menuadm').toggle(true);
53 + } else {
54 + $('#menuadm').toggle(false);
55 + }
56 +
57 + let menuuserflag = window.localStorage.getItem('menuuser');
58 + if (menuuserflag != "false"){
59 + $('#menuuser').toggle(true);
60 + } else {
61 + $('#menuuser').toggle(false);
62 + }
63 +
64 + var sections = document.getElementsByClassName("section-title");
65 + for (var i = 0, len = sections.length; i < len; i++) {
66 + var jqObj = $(sections[i]);
67 + var $section = jqObj.parent().next('div');
68 + if(!$section.length){
69 + return false;
70 + }
71 + let localStorageTag = "admSection-"+sections[i].innerHTML;
72 + if (window.localStorage.getItem(localStorageTag) != "false"){
73 + $section.toggle(true);
74 + } else {
75 + $section.toggle(false);
76 + }
77 + }
78 +})
79 +%end
80 +
81
82 </body>
83 </html>
84 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep
85 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2024-02-12 11:07:52.364833679 +0000
86 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2024-02-12 11:06:00.000000000 +0000
87 @@ -23,29 +23,41 @@
88 % end
89 % end
90
91 +
92 <!--*** toggle hide/unhide menu contents navigation menu ***-->
93
94 % content_for 'js_toggleMenu' => begin
95 %= javascript begin
96
97 $(document).ready(function() {
98 - $('#tognav').click(function() {
99 - $('#menunav').toggle({ duration: 300 });
100 - });
101 - $('#toguser').click(function() {
102 - $('#menuuser').toggle({ duration: 300 });
103 - });
104 - $('#togadm').click(function() {
105 - $('#menuadm').toggle({ duration: 300 });
106 - });
107 - $('.section-title').click(function() {
108 - var $section = $(this).parent().next('div');
109 - if(!$section.length){
110 - // alert('No element found!');
111 - return false;
112 - }
113 - $section.toggle({ duration: 600 });
114 - })
115 + $('#tognav').click(function() {
116 + //alert('click1:'+window.localStorage.getItem('menunav'));
117 + window.localStorage.setItem('menunav',!$('#menunav').is(':visible'));
118 + //alert('click2:'+window.localStorage.getItem('menunav'));
119 + $('#menunav').toggle({ duration: 300 });
120 + });
121 +
122 + $('#toguser').click(function() {
123 + window.localStorage.setItem('menuuser',!$('#menuuser').is(':visible'));
124 + $('#menuuser').toggle({ duration: 300 });
125 + });
126 +
127 + $('#togadm').click(function() {
128 + window.localStorage.setItem('menuadm',!$('#menuadm').is(':visible'));
129 + $('#menuadm').toggle({ duration: 300 });
130 + });
131 +
132 +
133 + $('.section-title').click(function() {
134 + var $section = $(this).parent().next('div');
135 + if(!$section.length){
136 + return false;
137 + }
138 + let localStorageTag = "admSection-"+this.innerHTML;
139 + var jqObj = $($section);
140 + window.localStorage.setItem(localStorageTag,!jqObj.is(':visible'));
141 + $section.toggle({ duration: 600 });
142 + })
143 });
144
145 % end

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed