|
@@ -181,8 +181,6 @@ function getJSON(url, successHandler, errorHandler) {
|
|
|
|
|
|
function checkNotify() {
|
|
|
( getCookie('netsettings_changed') == 'true' ) ? apply_settings.init() : apply_settings.close();
|
|
|
- ( getCookie('profilaction_changed') == 'true' ) ? device_profilaction.init() : device_profilaction.close();
|
|
|
- ( getCookie('need_confirm') == 'true' ) ? settings_uppload_confirm.init() : settings_uppload_confirm.close();
|
|
|
}
|
|
|
function getParam(e,x) {
|
|
|
switch (x) {
|
|
@@ -222,37 +220,37 @@ function NotificationBox (id, options) {
|
|
|
if(! ('message' in this.options)) this.options.message = 'NotificationBox: Hello World!';
|
|
|
if(! ('bgcolor' in this.options)) this.options.bgcolor = '#009966';
|
|
|
if(! ('textcolor' in this.options)) this.options.textcolor = '#fff';
|
|
|
+ if(! ('show' in this.options)) this.options.show = true;
|
|
|
if(! ('url' in this.options)) console.log('NotificationBox: Please add confirm URL in options');
|
|
|
}
|
|
|
|
|
|
NotificationBox.prototype.init = function(){
|
|
|
if (!$(this.id)) {
|
|
|
- var maindiv = document.createElement('div');
|
|
|
- maindiv.id = this.id;
|
|
|
- maindiv.className = 'notify-box';
|
|
|
- maindiv.style.backgroundColor = this.options.bgcolor;
|
|
|
- maindiv.style.color = this.options.textcolor;
|
|
|
-
|
|
|
- var string = document.createElement('p');
|
|
|
- string.textContent = this.options.message;
|
|
|
- maindiv.appendChild(string);
|
|
|
-
|
|
|
- var confirm = document.createElement('button');
|
|
|
- confirm.className = 'btn btn-danger-inverted';
|
|
|
- confirm.textContent = 'Подтвердить';
|
|
|
- confirm.setAttribute('onclick', 'loadXMLDoc(\''+ this.options.url +'\',\'GET\', updatepage)');
|
|
|
- maindiv.appendChild(confirm);
|
|
|
-
|
|
|
- if (this.options.cancelButton) {
|
|
|
- var cancel = document.createElement('button');
|
|
|
- cancel.className = 'btn btn-warning-inverted';
|
|
|
- cancel.style.marginLeft = '5px';
|
|
|
- cancel.textContent = 'Отмена';
|
|
|
- cancel.setAttribute('onclick', 'loadXMLDoc(\''+ this.options.cancelUrl +'\',\'GET\', updatepage)');
|
|
|
- maindiv.appendChild(cancel);
|
|
|
+ if (this.options.show) {
|
|
|
+ var maindiv = document.createElement('div');
|
|
|
+ maindiv.id = this.id;
|
|
|
+ maindiv.className = 'notify-box';
|
|
|
+ maindiv.style.backgroundColor = this.options.bgcolor;
|
|
|
+ maindiv.style.color = this.options.textcolor;
|
|
|
+ var string = document.createElement('p');
|
|
|
+ string.textContent = this.options.message;
|
|
|
+ maindiv.appendChild(string);
|
|
|
+ var confirm = document.createElement('button');
|
|
|
+ confirm.className = 'btn btn-danger-inverted';
|
|
|
+ confirm.textContent = 'Подтвердить';
|
|
|
+ confirm.setAttribute('onclick', 'loadXMLDoc(\''+ this.options.url +'\',\'GET\', updatepage)');
|
|
|
+ maindiv.appendChild(confirm);
|
|
|
+ if (this.options.cancelButton) {
|
|
|
+ var cancel = document.createElement('button');
|
|
|
+ cancel.className = 'btn btn-warning-inverted';
|
|
|
+ cancel.style.marginLeft = '5px';
|
|
|
+ cancel.textContent = 'Отмена';
|
|
|
+ cancel.setAttribute('onclick', 'loadXMLDoc(\''+ this.options.cancelUrl +'\',\'GET\', updatepage)');
|
|
|
+ maindiv.appendChild(cancel);
|
|
|
+ }
|
|
|
+ document.body.insertBefore(maindiv, document.body.childNodes[0]);
|
|
|
+ fadeIn($(this.id));
|
|
|
}
|
|
|
- document.body.insertBefore(maindiv, document.body.childNodes[0]);
|
|
|
- window.fadeIn($(this.id));
|
|
|
}
|
|
|
};
|
|
|
|