PluginProbe
WP Directory Kit / 1.3.3
WP Directory Kit v1.3.3
1.5.9 1.5.7 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 All 37 releases
wpdirectorykit / public / js / dist / wdk-notify.dev.js

wdk-notify.dev.js in WP Directory Kit 1.3.3, at public/js/dist/wdk-notify.dev.js

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