PluginProbe
Gianism / 3.2.2
Gianism v3.2.2
4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.4.0 5.0.0 5.0.1 5.0.2 5.1.0 5.2.1 5.2.2 5.3.0 6.0.0 6.0.1 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 65 releases
gianism / src / js / admin-helper.js

admin-helper.js in Gianism 3.2.2, at src/js/admin-helper.js

29 lines 746 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!
2 * Admin screen helper for Gianism
3 */
4
5 jQuery(document).ready(function ($) {
6
7 "use strict";
8
9 // Create appendix
10 $('.gianism-wrap').find('h3,caption').each(function (index, elt) {
11 $(elt).attr('id', 'index_' + index);
12 $('#index-list').append('<li><a href="#index_' + index + '">' + $(elt).text() + '</a></li>');
13 });
14
15 // Notice dismiss
16 $('.gianism-admin-notice').click(function(e){
17 e.preventDefault();
18 var $btn = $(this);
19 $.get( $btn.attr('data-endpoint') ).done(function(response){
20 if ( response.success ) {
21 $btn.parents('div.error').remove();
22 } else {
23 window.alert( 'Error' );
24 }
25 }).fail(function(response){
26 window.alert(response.responseJSON.data);
27 });
28 });
29 });