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 7.6.8 7.6.9 7.7.0 7.8.0 7.8.1 7.8.10 7.8.11 7.8.12 7.8.13 7.8.14 7.8.15 7.8.16 7.8.17 7.8.18 7.8.2 7.8.3 7.8.4 7.8.5 7.8.5.1 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1 7.9.10 7.9.11 7.9.2 7.9.3 7.9.4 7.9.5 7.9.6 7.9.7 7.9.8 7.9.9 8.0.0 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.0.6 8.0.7 8.0.8 8.1.0 8.1.1 8.1.2 8.1.3 8.1.4 8.2.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.2.0 3.3.0 3.4.0 3.5.0 3.6.1 3.7.0 3.8.0 3.9.0 3.9.1 3.9.2 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.1 4.8.2 4.8.3 4.9.0 4.9.1 4.9.2 4.9.3 5.0.0
admin-site-enhancements / assets / js / admin-page.js
admin-site-enhancements / assets / js Last commit date
codemirror 3 years ago admin-page.js 3 years ago custom-admin-menu.js 3 years ago hide-admin-notices.js 3 years ago jBox.all.min.js 3 years ago jquery.jsticky.mod.js 3 years ago jquery.jsticky.mod.min.js 3 years ago media-replace.js 3 years ago toggle-hidden-menu.js 3 years ago
admin-page.js
296 lines
1 (function( $ ) {
2 'use strict';
3
4 $(document).ready( function() {
5
6 // Make page header sticky on scroll. Using https://github.com/AndrewHenderson/jSticky
7 $('#asenha-header').sticky({
8 topSpacing: 0, // Space between element and top of the viewport (in pixels)
9 zIndex: 100, // z-index
10 stopper: '', // Id, class, or number value
11 stickyClass: 'asenha-sticky' // Class applied to element when it's stuck. Class name or false.
12 })
13
14 // Clicking on header save button triggers click of the hidden form submit button
15 $('.asenha-save-button').click( function(e) {
16 e.preventDefault();
17 $('input[type="submit"]').click();
18 });
19
20 // Show all / less toggler for field options | Modified from https://codepen.io/symonsays/pen/rzgEgY
21 $('.asenha-field-with-options.field-show-more > .show-more').click(function(e) {
22
23 e.preventDefault();
24
25 var $this = $(this);
26 $this.toggleClass('show-more');
27
28 if ($this.hasClass('show-more')) {
29 $this.next().removeClass('opened',0);
30 $this.html('Expand ▼');
31 } else {
32 $this.next().addClass('opened',0);
33 $this.html('Collapse ▲');
34 }
35
36 });
37
38 // Place fields into the "Content Management" tab
39 $('.enable-duplication').appendTo('.fields-content-management tbody');
40 $('.enable-media-replacement').appendTo('.fields-content-management tbody');
41 $('.enhance-list-tables').appendTo('.fields-content-management tbody');
42 $('.show-featured-image-column').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
43 $('.show-excerpt-column').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
44 $('.show-id-column').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
45 $('.hide-comments-column').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
46 $('.hide-post-tags-column').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
47 $('.show-custom-taxonomy-filters').appendTo('.fields-content-management .enhance-list-tables .asenha-subfields');
48
49 // Place fields into "Admin Interface" tab
50 $('.hide-admin-notices').appendTo('.fields-admin-interface tbody');
51 $('.view-admin-as-role').appendTo('.fields-admin-interface tbody');
52 $('.customize-admin-menu').appendTo('.fields-admin-interface tbody');
53 $('.custom-menu-order').appendTo('.fields-admin-interface .customize-admin-menu .asenha-subfields');
54 $('.hide-modify-elements').appendTo('.fields-admin-interface tbody');
55 $('.hide-ab-wp-logo-menu').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
56 $('.hide-ab-customize-menu').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
57 $('.hide-ab-updates-menu').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
58 $('.hide-ab-comments-menu').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
59 $('.hide-ab-new-content-menu').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
60 $('.hide-ab-howdy').appendTo('.fields-admin-interface .hide-modify-elements .asenha-subfields');
61 $('.hide-admin-bar').appendTo('.fields-admin-interface tbody');
62 $('.hide-admin-bar-for').appendTo('.fields-admin-interface .hide-admin-bar .asenha-subfields');
63
64 // Place fields into "Security" tab
65 $('.change-login-url').appendTo('.fields-security tbody');
66 $('.custom-login-slug').appendTo('.fields-security .change-login-url .asenha-subfields');
67 $('.obfuscate-author-slugs').appendTo('.fields-security tbody');
68 $('.disable-xmlrpc').appendTo('.fields-security tbody');
69
70 // Place fields into "Utilities" tab
71 $('.redirect-after-login').appendTo('.fields-utilities tbody');
72 $('.redirect-after-login-to-slug').appendTo('.fields-utilities .redirect-after-login .asenha-subfields');
73 $('.redirect-after-login-for').appendTo('.fields-utilities .redirect-after-login .asenha-subfields');
74 $('.redirect-after-logout').appendTo('.fields-utilities tbody');
75 $('.redirect-after-logout-to-slug').appendTo('.fields-utilities .redirect-after-logout .asenha-subfields');
76 $('.redirect-after-logout-for').appendTo('.fields-utilities .redirect-after-logout .asenha-subfields');
77 $('.redirect-404-to-homepage').appendTo('.fields-utilities tbody');
78 $('.enable-custom-admin-css').appendTo('.fields-utilities tbody');
79 $('.custom-admin-css').appendTo('.fields-utilities .enable-custom-admin-css .asenha-subfields');
80
81 // Place fields into the "Disable Components" tab
82
83 // Remove empty .form-table that originally holds the fields
84 const formTableCount = $('.form-table').length;
85 // $('.form-table')[formTableCount-1].remove();
86
87 // Enable Custom Admin CSS => Initialize CodeMirror
88 var adminCssTextarea = document.getElementById("admin_site_enhancements[custom_admin_css]");
89 var adminCssEditor = CodeMirror.fromTextArea(adminCssTextarea, {
90 mode: "css",
91 lineNumbers: true,
92 lineWrapping: true
93 });
94
95 adminCssEditor.setSize("100%",600);
96
97 // Show and hide corresponding fields on tab clicks
98
99 $('#tab-content-management + label').click( function() {
100 $('.fields-content-management').show();
101 $('.asenha-fields:not(.fields-content-management)').hide();
102 // window.location.hash = 'content-management';
103 });
104
105 $('#tab-admin-interface + label').click( function() {
106 $('.fields-admin-interface').show();
107 $('.asenha-fields:not(.fields-admin-interface)').hide();
108 // window.location.hash = 'admin-interface';
109 });
110
111 $('#tab-security + label').click( function() {
112 $('.fields-security').show();
113 $('.asenha-fields:not(.fields-security)').hide();
114 // window.location.hash = 'security';
115 });
116
117 $('#tab-utilities + label').click( function() {
118 $('.fields-utilities').show();
119 $('.asenha-fields:not(.fields-utilities)').hide();
120 // window.location.hash = 'utilities';
121 adminCssEditor.refresh(); // Custom Admin CSS >> CodeMirror
122 });
123
124 // $('#tab-disable-components + label').click( function() {
125 // $('.fields-disable-components').show();
126 // $('.asenha-fields:not(.fields-disable-components)').hide();
127 // window.location.hash = 'utilities';
128 // });
129
130 // Open Content Management tab on document ready
131 $('#tab-content-management + label').trigger('click');
132
133 // Open tab by URL hash. Defaults to Content Management tab.
134 // var hash = decodeURI(window.location.hash).substr(1); // get hash without the # character
135
136 // Enhance List Tables => show/hide subfields on document ready
137 if ( document.getElementById('admin_site_enhancements[enhance_list_tables]').checked ) {
138 $('.enhance-list-tables .asenha-subfields').show();
139 $('.asenha-toggle.enhance-list-tables td .asenha-field-with-options').addClass('is-enabled');
140 } else {
141 $('.enhance-list-tables .asenha-subfields').hide();
142 }
143
144 // Enhance List Tables => show/hide subfields on toggle click
145 document.getElementById('admin_site_enhancements[enhance_list_tables]').addEventListener('click', event => {
146 if (event.target.checked) {
147 $('.enhance-list-tables .asenha-subfields').fadeIn();
148 $('.enhance-list-tables .asenha-field-with-options').toggleClass('is-enabled');
149 } else {
150 $('.enhance-list-tables .asenha-subfields').hide();
151 $('.enhance-list-tables .asenha-field-with-options').toggleClass('is-enabled');
152 }
153 });
154
155 // Hide Admin Bar => show/hide roles checkboxes on document ready
156 if ( document.getElementById('admin_site_enhancements[hide_admin_bar]').checked ) {
157 $('.hide-admin-bar .asenha-subfields').show();
158 $('.asenha-toggle.hide-admin-bar td .asenha-field-with-options').addClass('is-enabled');
159 } else {
160 $('.hide-admin-bar .asenha-subfields').hide();
161 }
162
163 // Hide Admin Bar => show/hide roles checkboxes on toggle click
164 document.getElementById('admin_site_enhancements[hide_admin_bar]').addEventListener('click', event => {
165 if (event.target.checked) {
166 $('.hide-admin-bar .asenha-subfields').fadeIn();
167 $('.hide-admin-bar .asenha-field-with-options').toggleClass('is-enabled');
168 } else {
169 $('.hide-admin-bar .asenha-subfields').hide();
170 $('.hide-admin-bar .asenha-field-with-options').toggleClass('is-enabled');
171 }
172 });
173
174 // Hide or Modify Elements => show/hide subfields on document ready
175 if ( document.getElementById('admin_site_enhancements[hide_modify_elements]').checked ) {
176 $('.hide-modify-elements .asenha-subfields').show();
177 $('.asenha-toggle.hide-modify-elements td .asenha-field-with-options').addClass('is-enabled');
178 } else {
179 $('.hide-modify-elements .asenha-subfields').hide();
180 }
181
182 // Hide or Modify Elements => show/hide subfields on toggle click
183 document.getElementById('admin_site_enhancements[hide_modify_elements]').addEventListener('click', event => {
184 if (event.target.checked) {
185 $('.hide-modify-elements .asenha-subfields').fadeIn();
186 $('.hide-modify-elements .asenha-field-with-options').toggleClass('is-enabled');
187 } else {
188 $('.hide-modify-elements .asenha-subfields').hide();
189 $('.hide-modify-elements .asenha-field-with-options').toggleClass('is-enabled');
190 }
191 });
192
193 // Customize Admin Menu => show/hide subfields on document ready
194 if ( document.getElementById('admin_site_enhancements[customize_admin_menu]').checked ) {
195 $('.customize-admin-menu .asenha-subfields').show();
196 $('.asenha-toggle.customize-admin-menu td .asenha-field-with-options').addClass('is-enabled');
197 } else {
198 $('.customize-admin-menu .asenha-subfields').hide();
199 }
200
201 // Customize Admin Menu => show/hide subfields on toggle click
202 document.getElementById('admin_site_enhancements[customize_admin_menu]').addEventListener('click', event => {
203 if (event.target.checked) {
204 $('.customize-admin-menu .asenha-subfields').fadeIn();
205 $('.customize-admin-menu .asenha-field-with-options').toggleClass('is-enabled');
206
207 // Initialize sortable elements: https://api.jqueryui.com/sortable/
208 $('#custom-admin-menu').sortable();
209
210 } else {
211 $('.customize-admin-menu .asenha-subfields').hide();
212 $('.customize-admin-menu .asenha-field-with-options').toggleClass('is-enabled');
213 }
214 });
215
216 // Change Login URL => show/hide custom slug input on document ready
217 if ( document.getElementById('admin_site_enhancements[change_login_url]').checked ) {
218 $('.change-login-url .asenha-subfields').show();
219 $('.asenha-toggle.change-login-url td .asenha-field-with-options').addClass('is-enabled');
220 } else {
221 $('.change-login-url .asenha-subfields').hide();
222 }
223
224 // Change Login URL => show/hide custom slug input on toggle click
225 document.getElementById('admin_site_enhancements[change_login_url]').addEventListener('click', event => {
226 if (event.target.checked) {
227 $('.change-login-url .asenha-subfields').fadeIn();
228 $('.change-login-url .asenha-field-with-options').toggleClass('is-enabled');
229 } else {
230 $('.change-login-url .asenha-subfields').hide();
231 $('.change-login-url .asenha-field-with-options').toggleClass('is-enabled');
232 }
233 });
234
235 // Redirect After Login => show/hide roles checkboxes on document ready
236 if ( document.getElementById('admin_site_enhancements[redirect_after_login]').checked ) {
237 $('.redirect-after-login .asenha-subfields').show();
238 $('.asenha-toggle.redirect-after-login td .asenha-field-with-options').addClass('is-enabled');
239 } else {
240 $('.redirect-after-login .asenha-subfields').hide();
241 }
242
243 // Redirect After Login => show/hide roles checkboxes on toggle click
244 document.getElementById('admin_site_enhancements[redirect_after_login]').addEventListener('click', event => {
245 if (event.target.checked) {
246 $('.redirect-after-login .asenha-subfields').fadeIn();
247 $('.redirect-after-login .asenha-field-with-options').toggleClass('is-enabled');
248 } else {
249 $('.redirect-after-login .asenha-subfields').hide();
250 $('.redirect-after-login .asenha-field-with-options').toggleClass('is-enabled');
251 }
252 });
253
254 // Redirect After Logout => show/hide roles checkboxes on document ready
255 if ( document.getElementById('admin_site_enhancements[redirect_after_logout]').checked ) {
256 $('.redirect-after-logout .asenha-subfields').show();
257 $('.asenha-toggle.redirect-after-logout td .asenha-field-with-options').addClass('is-enabled');
258 } else {
259 $('.redirect-after-logout .asenha-subfields').hide();
260 }
261
262 // Redirect After Logout => show/hide roles checkboxes on toggle click
263 document.getElementById('admin_site_enhancements[redirect_after_logout]').addEventListener('click', event => {
264 if (event.target.checked) {
265 $('.redirect-after-logout .asenha-subfields').fadeIn();
266 $('.redirect-after-logout .asenha-field-with-options').toggleClass('is-enabled');
267 } else {
268 $('.redirect-after-logout .asenha-subfields').hide();
269 $('.redirect-after-logout .asenha-field-with-options').toggleClass('is-enabled');
270 }
271 });
272
273 // Enable Custom Admin CSS => show/hide CSS textarea on document ready
274 if ( document.getElementById('admin_site_enhancements[enable_custom_admin_css]').checked ) {
275 $('.enable-custom-admin-css .asenha-subfields').show();
276 $('.asenha-toggle.enable-custom-admin-css td .asenha-field-with-options').addClass('is-enabled');
277 adminCssEditor.refresh();
278 } else {
279 $('.enable-custom-admin-css .asenha-subfields').hide();
280 }
281
282 // Enable Custom Admin CSS => show/hide CSS textarea on toggle click
283 document.getElementById('admin_site_enhancements[enable_custom_admin_css]').addEventListener('click', event => {
284 if (event.target.checked) {
285 $('.enable-custom-admin-css .asenha-subfields').fadeIn();
286 $('.enable-custom-admin-css .asenha-field-with-options').toggleClass('is-enabled');
287 adminCssEditor.refresh();
288 } else {
289 $('.enable-custom-admin-css .asenha-subfields').hide();
290 $('.enable-custom-admin-css .asenha-field-with-options').toggleClass('is-enabled');
291 }
292 });
293
294 });
295
296 })( jQuery );