622 lines
18 KiB
JavaScript
622 lines
18 KiB
JavaScript
(function ($) {
|
|
'use strict';
|
|
|
|
/**
|
|
* All of the code for your public-facing JavaScript source
|
|
* should reside in this file.
|
|
*
|
|
* Note: It has been assumed you will write jQuery code here, so the
|
|
* $ function reference has been prepared for usage within the scope
|
|
* of this function.
|
|
*
|
|
* This enables you to define handlers, for when the DOM is ready:
|
|
*
|
|
* $(function() {
|
|
*
|
|
* });
|
|
*
|
|
* When the window is loaded:
|
|
*
|
|
* $( window ).load(function() {
|
|
*
|
|
* });
|
|
*
|
|
* ...and/or other possibilities.
|
|
*
|
|
* Ideally, it is not considered best practise to attach more than a
|
|
* single DOM-ready or window-load handler for a particular page.
|
|
* Although scripts in the WordPress core, Plugins and Themes may be
|
|
* practising this, we should strive to set a better example in our own work.
|
|
*/
|
|
var OCVM = {
|
|
UI: {
|
|
initialized: 0,
|
|
idwizard: '#ocvm-parent-wrap',
|
|
ajaxurl: ocvmObj.ajaxurl,
|
|
adminurl: ocvmObj.adminurl,
|
|
clstab: '#ocvm-parent-wrap .onecom_tab',
|
|
clstabcontainer: '.onecom_tabs_container',
|
|
clstabpanel: '.onecom_tabs_panel',
|
|
clsEmailNotificationCard: '.emailNotificationCard',
|
|
clschangeUpdate: '.changeUpdate',
|
|
clsNotifyAdmin: '.notifyAdmin',
|
|
clsocvmbullet: '.ocvm-bullet',
|
|
clsocmarkdismiss: '.oc-mark-dismiss',
|
|
clsocmarkdismissHigh: 'button.gv-notice-close.oc-mark-dismiss-high',
|
|
idAutoUpdate: '#ocvm_autoupdate_enable',
|
|
idEmailNotificationEnable: '#ocvm_emailnotification_enable',
|
|
idNotifyAdmin: '#ocvm-notifyAdmin',
|
|
emailNotificationCheck: 'ocvm_emailnotification_enable',
|
|
iddetectvm: '#ocvm_vmdetectvunerability',
|
|
idfixedvm: '#ocvm_vmautofix',
|
|
clstextDesc: '.otherEmail .textDesc',
|
|
disabledSettingsWrap: '#settings.disabledSection',
|
|
settingsBtn:'#vm_setting_btn',
|
|
historyLogBtn:'#vm_history_log_btn',
|
|
vmListsWrap:'.vulnerabiltiy_lists_wrap',
|
|
settingsWrap:'#settings',
|
|
vmLogWrap:'#vm_history_log',
|
|
backToVm:'.back_to_vm a',
|
|
getStarted:'.getStarted',
|
|
showUpSellBanner: '.upsell-mwp-banner-show'
|
|
},
|
|
/**
|
|
* Call at first loading and initialized object
|
|
*/
|
|
_init: function () {
|
|
|
|
if (OCVM.UI.initialized) {
|
|
return;
|
|
}
|
|
OCVM.UI.initialized = 1;
|
|
|
|
this.firstLoading();
|
|
},
|
|
/**
|
|
* Call after first loading _init
|
|
*/
|
|
firstLoading: function () {
|
|
//bind all the elements
|
|
OCVM.bindElement();
|
|
},
|
|
bindElement: function () {
|
|
//tab panel click handle
|
|
$(document).on('click', OCVM.UI.clstab, function (e) {
|
|
OCVM.handleTabClick($(this));
|
|
});
|
|
|
|
|
|
//Update form
|
|
$(document).on('change', OCVM.UI.clschangeUpdate, function (e) {
|
|
//Restrict specific field for change on nonmWP
|
|
let restrictField = $.inArray($(this).attr('name'), ["ocvm_autoUpdateEnable", "ocvm_vmautofix"]);
|
|
if ( ! parseInt(ocvmObj.isPremium) && restrictField > -1 ) {
|
|
//disable check status
|
|
OCVM.disableFields(this);
|
|
|
|
OCVM.getPlugindependentPopup($(this),e);//add new popup on settings
|
|
OCVM.spinnerShow(this);
|
|
OCVM.updateSettingsCall(this);
|
|
return false;
|
|
}
|
|
|
|
//check status
|
|
if ($(this).is(':checked')) {
|
|
OCVM.enableFields(this);
|
|
} else {
|
|
OCVM.disableFields(this);
|
|
}
|
|
OCVM.emailNotificationSettings(this);
|
|
OCVM.spinnerShow(this);
|
|
OCVM.updateSettingsCall(this);
|
|
});
|
|
|
|
//vulnerability list
|
|
$(document).on('click', OCVM.UI.clsocvmbullet, function (e) {
|
|
OCVM.toggleBulletMessage($(this), e);
|
|
});
|
|
|
|
//dismiss notifications
|
|
$(document).on('click', OCVM.UI.clsocmarkdismiss, function (e) {
|
|
OCVM.dismissNotifications($(this), e);
|
|
});
|
|
|
|
//dismiss high notifications
|
|
$(document).on('click', OCVM.UI.clsocmarkdismissHigh, function (e) {
|
|
OCVM.dismissNotificationsHigh($(this), e);
|
|
});
|
|
|
|
|
|
//settings btn click
|
|
$(document).on('click', OCVM.UI.settingsBtn, function (e) {
|
|
OCVM.showSettings($(this), e);
|
|
});
|
|
|
|
// VM log btn click
|
|
$(document).on('click', OCVM.UI.historyLogBtn, function (e) {
|
|
OCVM.showVMLog($(this), e);
|
|
// Trigger DataTables to recalculate column widths
|
|
$('#vm-log-table').DataTable().columns.adjust().draw();
|
|
});
|
|
|
|
//back to vm click
|
|
$(document).on('click', OCVM.UI.backToVm, function (e) {
|
|
OCVM.backTovmlists($(this), e);
|
|
});
|
|
|
|
//on get started click vm
|
|
$(document).on('click',OCVM.UI.getStarted,function(e){
|
|
OCVM.getPlugindependentPopup($(this),e);
|
|
});
|
|
|
|
//show popup on learn more click
|
|
$(document).on('click',OCVM.UI.showUpSellBanner,function(e){
|
|
OCVM.getPlugindependentPopup($(this),e);
|
|
});
|
|
|
|
},
|
|
scrollMenu: function () {
|
|
/**
|
|
* Horizontal Scrolable/Drag menu
|
|
* https://codepen.io/thenutz/pen/VwYeYEE
|
|
*/
|
|
if ($('.h-parent').length ) {
|
|
const slider = document.querySelector('.h-parent');
|
|
let isDown = false;
|
|
let startX;
|
|
let scrollLeft;
|
|
|
|
slider.addEventListener('mousedown', (e) => {
|
|
isDown = true;
|
|
slider.classList.add('active');
|
|
startX = e.pageX - slider.offsetLeft;
|
|
scrollLeft = slider.scrollLeft;
|
|
});
|
|
slider.addEventListener('mouseleave', () => {
|
|
isDown = false;
|
|
slider.classList.remove('active');
|
|
});
|
|
slider.addEventListener('mouseup', () => {
|
|
isDown = false;
|
|
slider.classList.remove('active');
|
|
});
|
|
slider.addEventListener('mousemove', (e) => {
|
|
if ( ! isDown) return;
|
|
e.preventDefault();
|
|
const x = e.pageX - slider.offsetLeft;
|
|
const walk = (x - startX) * 3; //scroll-fast
|
|
slider.scrollLeft = scrollLeft - walk;
|
|
// console.log(walk);
|
|
});
|
|
}
|
|
},
|
|
switchVM: function () {
|
|
// Switch to vulnerablity monitor tab based on URL
|
|
let path = window.location.href.split("#")[1];
|
|
|
|
// If #vm-settings exists in URL, switch to VM settings tab
|
|
if (path === 'vm-settings') {
|
|
$(OCVM.UI.clstabpanel).fadeOut(function () {
|
|
$(OCVM.UI.clstabcontainer).find('.active').removeClass('active');
|
|
$(OCVM.UI.clstabcontainer).find('[data-tab="vulnerability"]').addClass('active');
|
|
$(OCVM.UI.clstabpanel + '#vulnerability').fadeIn();
|
|
$(OCVM.UI.vmListsWrap).addClass('oc_hidden');
|
|
$(OCVM.UI.settingsWrap).removeClass('oc_hidden');
|
|
});
|
|
} else if (path === 'vm-page') {
|
|
$(OCVM.UI.clstabpanel).fadeOut(function () {
|
|
$(OCVM.UI.clstabcontainer).find('.active').removeClass('active');
|
|
$(OCVM.UI.clstabcontainer).find('[data-tab="vulnerability"]').addClass('active');
|
|
$(OCVM.UI.clstabpanel + '#vulnerability').fadeIn();
|
|
});
|
|
}
|
|
},
|
|
emailNotificationSettings: function (thisobj) {
|
|
if ($(thisobj).attr('id') === OCVM.UI.emailNotificationCheck && $(thisobj).is(':checked')) {
|
|
OCVM.enableFields(OCVM.UI.iddetectvm);
|
|
(parseInt(ocvmObj.isPremium)) ? OCVM.enableFields(OCVM.UI.idfixedvm) : '';
|
|
OCVM.enableFields('#ocvm-notifyAdmin');
|
|
} else if ($(thisobj).attr('id') === OCVM.UI.emailNotificationCheck && $(thisobj).is(':not(:checked)')) {
|
|
OCVM.disableFields(OCVM.UI.iddetectvm);
|
|
OCVM.disableFields(OCVM.UI.idfixedvm);
|
|
OCVM.disableFields('#ocvm-notifyAdmin');
|
|
}
|
|
if ($(OCVM.UI.iddetectvm).is(':not(:checked)') && $(OCVM.UI.idfixedvm).is(':not(:checked)')) {
|
|
OCVM.disableFields(OCVM.UI.idEmailNotificationEnable);
|
|
OCVM.disableFields('#ocvm-notifyAdmin');
|
|
//$(OCVM.UI.clschangeUpdate).trigger('change');
|
|
}
|
|
},
|
|
spinnerShow: function (thisObj) {
|
|
$(thisObj).closest('.checkSpinner').find('.spinner').addClass('is-active');
|
|
},
|
|
updateSettingsCall: function (thisObj) {
|
|
var data = OCVM.getFormData();
|
|
OCVM.ajax(data,
|
|
function (response) {
|
|
var result = response;
|
|
|
|
if (typeof result.success != 'undefined' && result.success === true) {
|
|
//success messgae
|
|
$(thisObj).closest('.checkSpinner').find('.spinner').removeClass('is-active').addClass('success');
|
|
setTimeout(OCVM.removeClassSpinner, 1200, thisObj, 'success');
|
|
} else {
|
|
//failed message
|
|
$(thisObj).closest('.checkSpinner').find('.spinner').removeClass('is-active').addClass('error');
|
|
setTimeout(OCVM.removeClassSpinner, 1200, thisObj, 'error');
|
|
}
|
|
},
|
|
"json",
|
|
true,
|
|
0
|
|
);
|
|
},
|
|
removeClassSpinner: function (thisObj, removeClassName) {
|
|
$(thisObj).closest('.checkSpinner').find('.spinner').removeClass(removeClassName);
|
|
//$('#ocvm_otherEmailWrap').find('.spinner').removeClass(removeClassName);
|
|
},
|
|
getFormData() {
|
|
var action = '&action=ocvm_updateSettings';
|
|
var Formdata = $('#ocvmForm').serialize() + action;
|
|
return Formdata;
|
|
},
|
|
/**
|
|
* Handle tab click
|
|
* @param {Object} el
|
|
*/
|
|
handleTabClick: function (el) {
|
|
let target = $(el).attr('data-tab');
|
|
$(OCVM.UI.clstabpanel).fadeOut(function () {
|
|
$(el).parent().find('.active').removeClass('active');
|
|
$(el).addClass('active');
|
|
$('#' + target).fadeIn();
|
|
});
|
|
},
|
|
/**
|
|
* Disable Auto update features
|
|
*/
|
|
disableFields: function (field) {
|
|
$(field).prop('checked', false);
|
|
$(field).val(0);
|
|
|
|
//disable on change
|
|
if ($(field).attr('id') === OCVM.UI.emailNotificationCheck && parseInt(ocvmObj.isPremium)) {
|
|
$(OCVM.UI.clsNotifyAdmin).addClass('disabledSection');
|
|
$('#ocvm-parent-wrap .notifyMeCard').addClass('disabledSection');
|
|
} else if ($(field).attr('id') === OCVM.UI.emailNotificationCheck) {
|
|
$(OCVM.UI.clsNotifyAdmin).addClass('disabledSection');
|
|
$('#ocvm-parent-wrap .notifyMeCard .ocvm_vmdetectvunerabilityLabel').addClass('disabledSection');
|
|
}
|
|
},
|
|
/**
|
|
* Enable Auto update features
|
|
*/
|
|
enableFields: function (field) {
|
|
$(field).prop('checked', true);
|
|
$(field).val(1);
|
|
|
|
//Enable on change
|
|
if ($(field).attr('id') === OCVM.UI.emailNotificationCheck && parseInt(ocvmObj.isPremium)) {
|
|
$(OCVM.UI.clsNotifyAdmin).removeClass('disabledSection');
|
|
$('#ocvm-parent-wrap .notifyMeCard').removeClass('disabledSection');
|
|
} else if ($(field).attr('id') === OCVM.UI.emailNotificationCheck) {
|
|
$(OCVM.UI.clsNotifyAdmin).removeClass('disabledSection');
|
|
$('#ocvm-parent-wrap .notifyMeCard .ocvm_vmdetectvunerabilityLabel').removeClass('disabledSection');
|
|
}
|
|
},
|
|
/**
|
|
* Hide/Show vulnerability
|
|
* @param {Object} thisObj
|
|
*/
|
|
toggleBulletMessage: function (el, e = null) {
|
|
|
|
if (e === null) {
|
|
return;
|
|
}
|
|
|
|
const clickArea = ["wrap-vm-title","vm-title-wrap-tag","vul-version-details","ocvm-scan-title onecom__scan-title-bg","onecom_tag"];
|
|
if (jQuery.inArray($(e.target).attr('class'),clickArea) === -1) {
|
|
return;
|
|
}
|
|
$(el).toggleClass('expanded');
|
|
},
|
|
/**
|
|
* Dismiss notifications
|
|
* @param {Object} thisobj
|
|
* @param {Object} e
|
|
*/
|
|
dismissNotifications: function (thisobj, e) {
|
|
$(thisobj).next().addClass('is-active');
|
|
var dismissType = $(thisobj).attr('data-dismiss-name');
|
|
var data = {action: "ocvm_dismissNotification", dismisstype: dismissType};
|
|
OCVM.ajax(data,
|
|
function (response) {
|
|
var result = response;
|
|
if (typeof result.success != 'undefined' && result.success === true) {
|
|
//success messgae
|
|
$('a[data-dismiss-name="' + dismissType + '"]').closest('li').remove();
|
|
var vulCount = $('#ocvm_count').attr('data-count');
|
|
vulCount = vulCount - 1;
|
|
$('#ocvm_count').text(vulCount);
|
|
$('#ocvm_count').attr('data-count', vulCount);
|
|
if ( ! vulCount) {
|
|
$('#no_ocvm_vulneribilityFound').removeClass('hidden');
|
|
}
|
|
} else {
|
|
//failed message
|
|
|
|
}
|
|
},
|
|
"json",
|
|
true,
|
|
0
|
|
);
|
|
},
|
|
/**
|
|
* Dismiss notifications
|
|
* @param {Object} thisobj
|
|
* @param {Object} e
|
|
*/
|
|
dismissNotificationsHigh: function (thisobj, e) {
|
|
var data = {action: "ocvm_dismissNotificationHigh", dismisstype: 'data-dismiss-high'};
|
|
e.preventDefault();
|
|
OCVM.ajax(data,
|
|
function (response) {
|
|
var result = response;
|
|
if (typeof result.success != 'undefined' && result.success === true) {
|
|
$(thisobj).parent().hide();
|
|
console.log('Notice dismissed');
|
|
} else {
|
|
//failed message
|
|
console.log('Error during notice dismissed');
|
|
}
|
|
},
|
|
"json",
|
|
true,
|
|
0
|
|
);
|
|
},
|
|
|
|
/**
|
|
* Show settings tab
|
|
* @param thisobj
|
|
* @param e
|
|
*/
|
|
showSettings: function (thisobj,e){
|
|
$(OCVM.UI.vmListsWrap).addClass('oc_hidden');
|
|
$(OCVM.UI.settingsWrap).removeClass('oc_hidden');
|
|
},
|
|
|
|
/**
|
|
* Show settings tab
|
|
* @param thisobj
|
|
* @param e
|
|
*/
|
|
showVMLog: function (){
|
|
$(OCVM.UI.vmListsWrap).addClass('oc_hidden');
|
|
$(OCVM.UI.vmLogWrap).removeClass('oc_hidden');
|
|
},
|
|
|
|
/**
|
|
* Back to vm lists
|
|
* @param thisobj
|
|
* @param e
|
|
*/
|
|
backTovmlists: function(thisobj,e){
|
|
$(OCVM.UI.settingsWrap).addClass('oc_hidden');
|
|
$(OCVM.UI.vmLogWrap).addClass('oc_hidden')
|
|
$(OCVM.UI.vmListsWrap).removeClass('oc_hidden');
|
|
},
|
|
|
|
/**
|
|
* Show plugin dependent popup
|
|
* @param thisobj
|
|
* @param e
|
|
*/
|
|
getPlugindependentPopup: function (thisobj,e) {
|
|
|
|
const popupContent = ocvmObj.popupContent;
|
|
jQuery.ajax({
|
|
url: OCVM.UI.ajaxurl,
|
|
type: "POST",
|
|
data: {
|
|
action: 'show_plugin_dependent_popup',
|
|
popupContent: popupContent
|
|
},
|
|
success: function(response){
|
|
var result = response;
|
|
if (typeof result.success != 'undefined' && result.success === true) {
|
|
//success message
|
|
if ( ! parseInt(ocvmObj.isPremium)) {
|
|
$('#oc_um_overlay').html(result.data);
|
|
var referrer = location.search;
|
|
$('#oc_um_overlay').show();
|
|
ocSetModalData({
|
|
isPremium: ocvmObj.isPremium,
|
|
feature: 'vulnerability_monitor',
|
|
featureAction: 'getStarted',
|
|
referrer: referrer
|
|
});
|
|
}
|
|
} else {
|
|
//failed message
|
|
}
|
|
},
|
|
error: function (xhr, textStatus, errorThrown) {
|
|
//error log
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* Ajax Requests
|
|
* @param {Object} data
|
|
* @param {Function} callback
|
|
* @param {String} dataType
|
|
* @param {Boolean} showErrors
|
|
* @param {Boolean} tryCount
|
|
*/
|
|
ajax: function (data, callback, dataType, showErrors, tryCount) {
|
|
// show loader
|
|
//OCOP.spinnerToggle(1);
|
|
|
|
if ("undefined" === typeof (dataType)) {
|
|
dataType = "json";
|
|
}
|
|
|
|
if (false !== showErrors) {
|
|
showErrors = true;
|
|
}
|
|
|
|
tryCount = "undefined" === typeof (tryCount) ? 0 : tryCount;
|
|
|
|
var retryLimit = 0;
|
|
|
|
var retryTimeout = 10000 * tryCount;
|
|
|
|
jQuery.ajax({
|
|
url: OCVM.UI.ajaxurl,
|
|
type: "POST",
|
|
dataType: dataType,
|
|
cache: false,
|
|
data: data,
|
|
error: function (xhr, textStatus, errorThrown) {
|
|
//hide loader
|
|
//OCOP.spinnerToggle(0);
|
|
|
|
console.log(xhr.status + ' ' + xhr.statusText + '---' + textStatus + '---' + errorThrown);
|
|
// Reject the Promise with error message to show as content
|
|
//OCM.reject( false );
|
|
//try again after 10 seconds
|
|
tryCount++;
|
|
if (tryCount <= retryLimit) {
|
|
setTimeout(function () {
|
|
OCVM.ajax(data, callback, dataType, showErrors, tryCount);
|
|
return;
|
|
}, retryTimeout);
|
|
|
|
} else {
|
|
var errorCode = "undefined" === typeof (xhr.status) ? "Unknown" : xhr.status;
|
|
/*OCOP.showMessage("error",
|
|
"Fatal Error: " + errorCode
|
|
);*/
|
|
}
|
|
|
|
|
|
},
|
|
success: function (response) {
|
|
//hide loader
|
|
//OCOP.spinnerToggle(0);
|
|
|
|
if ("function" === typeof (callback)) {
|
|
// Resolve the Promise with the content
|
|
//OCM.resolve(true);
|
|
callback(response);
|
|
} else if ("" === callback) {
|
|
return response;
|
|
}
|
|
},
|
|
statusCode: {
|
|
404: function (response) {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Error 404 - Can't find ajax request URL!");
|
|
}
|
|
},
|
|
500: function () {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Fatal Error 500 - Internal server error while processing the request!");
|
|
}
|
|
},
|
|
504: function () {
|
|
if (tryCount > retryLimit) {
|
|
// OCOP.showMessage("error", "Error 504 - It looks like your server is rate limiting ajax requests.\n\ ");
|
|
}
|
|
|
|
},
|
|
502: function () {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Error 502 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute.");
|
|
}
|
|
},
|
|
503: function () {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Error 503 - It looks like your server is rate limiting ajax requests. Please try to resume after a minute.");
|
|
}
|
|
},
|
|
429: function () {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Error 429 - It looks like your server is rate limiting ajax requests.");
|
|
}
|
|
},
|
|
403: function () {
|
|
if (tryCount >= retryLimit) {
|
|
// OCOP.showMessage("error", "Refresh page or login again! The process should be finished successfully. \n\ ");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
},
|
|
};
|
|
|
|
//entry point
|
|
jQuery(document).ready(function () {
|
|
|
|
// Reload page if the page access from browser history
|
|
OCVM._init();
|
|
OCVM.scrollMenu();
|
|
// Switch to VM settings view if applicable
|
|
OCVM.switchVM();
|
|
|
|
$('#ocvm_otherEmail').tagEditor({
|
|
initialTags: [],
|
|
placeholder: 'Add email',
|
|
//removeDuplicates: false,
|
|
//delimiter: ', ',
|
|
onChange: emailCheck,
|
|
beforeTagSave: function (field, editor, tags, tag, val) {
|
|
|
|
},
|
|
beforeTagDelete: function (field, editor, tags, val) {
|
|
/* var q = confirm('Remove tag "'+val+'"?');
|
|
if (q) $('#ocvmEmailResponse').prepend('Tag <i>'+val+'</i> deleted.<hr>');
|
|
else $('#ocvmEmailResponse').prepend('Removal of <i>'+val+'</i> discarded.<hr>');
|
|
return q; */
|
|
//return tags;
|
|
}
|
|
});
|
|
|
|
function emailCheck(field, editor, tags) {
|
|
var flag = false;
|
|
var emailErrorMsg = $(OCVM.UI.clstextDesc).attr('data-error');
|
|
var helpMsg = $(OCVM.UI.clstextDesc).attr('data-msg');
|
|
$('li', editor).each(function () {
|
|
var li = $(this);
|
|
var currEmail = li.find('.tag-editor-tag').text();
|
|
|
|
if (typeof currEmail != 'undefined' && currEmail != null && currEmail != '') {
|
|
|
|
const re = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,30}|[0-9]{1,30})(\]?)$/;
|
|
var emailStatus = re.test(String(currEmail).toLowerCase());
|
|
if ( ! emailStatus) {
|
|
li.remove();
|
|
$(OCVM.UI.clstextDesc).text(emailErrorMsg).addClass('errorEmail');
|
|
flag = false;
|
|
setTimeout(function () {
|
|
$(OCVM.UI.clstextDesc).text(helpMsg).removeClass('errorEmail');
|
|
}, 2000);
|
|
} else {
|
|
flag = true;
|
|
$(OCVM.UI.clstextDesc).text(helpMsg).removeClass('errorEmail');
|
|
}
|
|
}
|
|
});
|
|
|
|
if (flag) {
|
|
//update settings call
|
|
OCVM.spinnerShow(field);
|
|
OCVM.updateSettingsCall(field);
|
|
}
|
|
}
|
|
});
|
|
})(jQuery);
|