PluginProbe
WP Directory Kit / 1.3.2
WP Directory Kit v1.3.2
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / public / js / wdk-notify.js

wdk-notify.js in WP Directory Kit 1.3.2, at public/js/wdk-notify.js

41 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const wdk_log_notify = (text, type, popup_place) => {
2 var $ = jQuery;
3 if (!$('.wdk_log_notify-box').length) $('body').append('<div class="wdk_log_notify-box"></div>')
4 if (typeof text == "undefined") var text = 'Undefined text';
5 if (typeof type == "undefined") var type = 'success';
6 if (typeof popup_place == "undefined") var popup_place = $('.wdk_log_notify-box');
7 var el_class = '';
8 var el_timer = 5000;
9 switch (type) {
10 case "success":
11 el_class = "success";
12 break
13 case "error":
14 el_class = "error";
15 break
16 case "loading":
17 el_class = "loading";
18 el_timer = 2000;
19 break
20 default:
21 el_class = "success";
22 break
23 }
24
25 /* notify */
26 var html = '';
27 html = '<div class="wdk_log_notify ' + el_class + '">\n\
28 ' + text + '\n\
29 </div>';
30 var notification = $(html).appendTo(popup_place).delay(100).queue(function() {
31 $(this).addClass('show')
32 setTimeout(function() {
33 notification.removeClass('show')
34 setTimeout(function() {
35 notification.remove();
36 }, 1000);
37 }, el_timer);
38 })
39 /* end notify */
40 }
41