# wpdirectorykit/1.3.6/public/js/wdk-notify.js

WP Directory Kit, version 1.3.6. 41 lines.

- Page: https://pluginprobe.com/plugins/wpdirectorykit/1.3.6/code/public/js/wdk-notify.js
- Raw: https://pluginprobe.com/plugins/wpdirectorykit/1.3.6/raw/public/js/wdk-notify.js
- Modified: 2024-07-09T15:04:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpdirectorykit/1.3.6/code/public/js/wdk-notify.js#L10-L20`.

```javascript
const wdk_log_notify = (text, type, popup_place) => {
	var $ = jQuery;
	if (!$('.wdk_log_notify-box').length) $('body').append('<div class="wdk_log_notify-box"></div>')
	if (typeof text == "undefined") var text = 'Undefined text';
	if (typeof type == "undefined") var type = 'success';
	if (typeof popup_place == "undefined") var popup_place = $('.wdk_log_notify-box');
	var el_class = '';
	var el_timer = 5000;
	switch (type) {
		case "success":
			el_class = "success";
			break
		case "error":
			el_class = "error";
			break
		case "loading":
			el_class = "loading";
			el_timer = 2000;
			break
		default:
			el_class = "success";
			break
	}

	/* notify */
	var html = '';
	html = '<div class="wdk_log_notify ' + el_class + '">\n\
				' + text + '\n\
		</div>';
	var notification = $(html).appendTo(popup_place).delay(100).queue(function() {
			$(this).addClass('show')
			setTimeout(function() {
				notification.removeClass('show')
				setTimeout(function() {
					notification.remove();
				}, 1000);
			}, el_timer);
		})
		/* end notify */
}

```
