PageSourceSearch

https://techlineopt.ru/assets/components/mspnnotify/js/web/pn/default.js?v=1

js techlineopt.ru collected 2026-10-04 03:09:14 UTC 7,364 bytes, 278 lines download raw bytes

1if (typeof(modPNotify) == 'undefined') {
2	modPNotify = {
3		Init: false
4	};
5}
6
7modPNotifyConfig = {
8	assetsUrl: '/assets/components/mspnnotify/js/pn/',
9	defaults: {
10		message: {
11			title: {
12				success: 'Успешно',
13				error: 'Ошибка',
14				info: 'Внимание'
15			}
16		},
17		yes: 'Да',
18		no: 'Нет'
19	}
20};
21
22modPNotify = {
23	initialize: function () {
24
25		$(document).ready(function () {
26			PNotify.prototype.options.styling = "brighttheme";
27			//PNotify.prototype.options.history.history = true;
28			//PNotify.prototype.options.history.maxonscreen = 1;
29		});
30		modPNotify.Init = true;
31
32	}
33};
34
35
36
37modPNotify.Message = {
38	defaults: {
39		delay: 4000,
40		addclass: 'modPNotify-message',
41		styling: 'brighttheme',
42		icons: 'brighttheme',
43	},
44	success: function (title, message) {
45		if (!message) return false;
46		var notify = {};
47		notify.type = 'success';
48		notify.text = message;
49		notify.title = (!title) ? 'Успешно' : title;
50		new PNotify($.extend({}, this.defaults, notify));
51	},
52	error: function (title, message) {
53		if (!message) return false;
54		var notify = {};
55		notify.type = 'error';
56		notify.text = message;
57		notify.title = (!title) ? 'Ошибка' : title;
58		new PNotify($.extend({}, this.defaults, notify));
59	},
60	info: function (title, message) {
61		if (!message) return false;
62		var notify = {};
63		notify.type = 'info';
64		notify.text = message;
65		notify.title = (!title) ? 'Внимание' : title;
66		new PNotify($.extend({}, this.defaults, notify));
67	},
68	remove: function () {
69		PNotify.closeAll();
70	}
71};
72
73modPNotify.Confirm = {
74	defaults: {
75		hide: false,
76		addclass: 'modPNotify-сonfirm',
77		icon: 'glyphicon glyphicon-question-sign',
78		confirm: {
79			confirm: true,
80			buttons: [{
81				text: modPNotifyConfig.defaults.yes,
82				addClass: 'btn-primary'
83
84			}, {
85				text: modPNotifyConfig.defaults.no,
86				addClass: 'btn-danger'
87
88			}]
89		},
90		buttons: {
91			closer: false,
92			sticker: false
93		},
94		history: {
95			history: false
96		}
97	},
98	success: function (title, message) {
99		if (!message) return false;
100		var notify = {};
101		notify.type = 'success';
102		notify.text = message;
103		notify.title = (!title) ? modPNotifyConfig.defaults.confirm.title.success : title;
104		return new PNotify($.extend({}, this.defaults, notify));
105	},
106	error: function (title, message) {
107		if (!message) return false;
108		var notify = {};
109		notify.type = 'error';
110		notify.text = message;
111		notify.title = (!title) ? modPNotifyConfig.defaults.confirm.title.error : title;
112		return new PNotify($.extend({}, this.defaults, notify));
113	},
114	info: function (title, message) {
115		if (!message) return false;
116		var notify = {};
117		notify.type = 'info';
118		notify.text = message;
119		notify.title = (!title) ? modPNotifyConfig.defaults.confirm.title.info : title;
120		return new PNotify($.extend({}, this.defaults, notify));
121	},
122	form: function (form, type, title, message) {
123		if (!type) return false;
124		if (form) {
125			$.extend(this.defaults, {
126				before_init: function (opts) {
127					$(form).find('input[type="button"], button, a').attr('disabled', true);
128				},
129				after_close: function (PNotify, timer_hide) {
130					$(form).find('input[type="button"], button, a').attr('disabled', false);
131				}
132			});
133		}
134
135		switch (type) {
136			case 'success':
137				return this.success(title, message);
138			default:
139			case 'error':
140				return this.error(title, message);
141			case 'info':
142				return this.info(title, message);
143		}
144	},
145	remove: function () {
146		return PNotify.removeAll();
147	}
148};
149
150modPNotify.initialize();
151
152jQuery(document).ready(function($) {
153	if (typeof(miniShop2) != 'undefined') {
154        miniShop2.Message = {
155            initialize: function() {
156                miniShop2.Message.close = function() {};
157                miniShop2.Message.show = function(message) {
158                    if (message != '') {
159                        alert(message);
160                    }
161                };
162    
163    
164                miniShop2.Message.close = function() {
165                    PNotify.removeAll()
166                };
167                miniShop2.Message.show = function(message, options) {
168                    if (message != '') {
169                        new PNotify(options);
170                    }
171                };
172                miniShop2.Message.hardRemove = function() {
173                	$.each(PNotify.notices, function(i, notice){
174						        if (notice.remove) {
175						          $(notice).remove();
176						        }
177						      });
178                }
179    
180            },
181            success: function(message) {
182            		miniShop2.Message.hardRemove();
183                miniShop2.Message.show(message, {
184                  addclass: 'modPNotify-message',
185      						styling: 'brighttheme',
186          				icons: 'brighttheme',
187                  delay: 2000,
188                  text: message,
189                  type: 'success',
190                  title: 'Успешно',
191                  hide: true,
192                  history: {
193										history: false,
194										maxonscreen: 1
195									},
196									animate: {
197										animate: false,
198										out_class: 'd-none'
199									},
200									before_close: function(event) {
201										var element = event.elem[0];
202										$(element).addClass('api-pnotify-is-closing');
203									},
204                });
205            },
206            error: function(message) {
207                miniShop2.Message.show(message, {
208                addclass: 'modPNotify-message',
209					   		styling: 'brighttheme',
210          			icons: 'brighttheme',
211                delay: 2000,
212                text: message,
213                type: 'error',
214                title: 'Ошибка',
215                hide: true,
216                before_close: function(event) {
217									var element = event.elem[0];
218									$(element).addClass('api-pnotify-is-closing');
219								},
220              });
221            },
222            info: function(message) {
223                miniShop2.Message.show(message, {
224                addclass: 'modPNotify-message',
225            		styling: 'brighttheme',
226            		icons: 'brighttheme',
227                delay: 2000,
228                text: message,
229                type: 'info',
230                title: 'Внимание',
231                hide: true,
232                before_close: function(event) {
233									var element = event.elem[0];
234									$(element).addClass('api-pnotify-is-closing');
235								},
236              });
237            }
238        };
239	}
240	if (typeof(Office) != 'undefined') {
241		Office.Message = {
242		    success: function (message, sticky) {
243		        modPNotify.Message.success('',message);
244		    },
245		    error: function (message, sticky) {
246		        modPNotify.Message.error('',message);
247		    },
248		    info: function (message, sticky) {
249		        modPNotify.Message.info('',message);
250		    },
251		    close: function () {
252		        PNotify.removeAll();
253		    }
254		};
255	}
256	if (typeof(AjaxForm) != 'undefined') {
257		AjaxForm.Message = {
258		    success: function (message, sticky) {
259		        if (message) {
260		            modPNotify.Message.success('',message);
261		        }
262		    },
263		    error: function (message, sticky) {
264		        if (message) {
265		            modPNotify.Message.error('',message);
266		        }
267		    },
268		    info: function (message, sticky) {
269		        if (message) {
270		            modPNotify.Message.info('',message);
271		        }
272		    },
273		    close: function () {
274		       	PNotify.removeAll();
275		    },
276		};
277	}
278});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.