function scJQGeneralAdd() { scLoadScInput('input:text.sc-js-input'); scLoadScInput('input:password.sc-js-input'); scLoadScInput('input:checkbox.sc-js-input'); scLoadScInput('input:radio.sc-js-input'); scLoadScInput('select.sc-js-input'); scLoadScInput('textarea.sc-js-input'); } // scJQGeneralAdd function scFocusField(sField) { var $oField = $('#id_sc_field_' + sField); if (0 == $oField.length) { $oField = $('input[name=' + sField + ']'); } if (0 == $oField.length && document.F1.elements[sField]) { $oField = $(document.F1.elements[sField]); } if ($("#id_ac_" + sField).length > 0) { if ($oField.hasClass("select2-hidden-accessible")) { if (false == scSetFocusOnField($oField, sField)) { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } else { if (false == scSetFocusOnField($oField, sField)) { if (false == scSetFocusOnField($("#id_ac_" + sField, sField))) { setTimeout(function() { scSetFocusOnField($("#id_ac_" + sField, sField)); }, 500); } } else { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } } else { setTimeout(function() { scSetFocusOnField($oField, sField); }, 500); } } // scFocusField function scSetFocusOnField($oField, sField) { if ($oField.length > 0 && $oField[0].offsetHeight > 0 && $oField[0].offsetWidth > 0 && !$oField[0].disabled) { $oField[0].focus(); return true; } return false; } // scSetFocusOnField function scEventControl_init(iSeqRow) { scEventControl_data["picture" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["login" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["name" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["email" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["phone" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; scEventControl_data["role" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""}; } function scEventControl_active(iSeqRow) { if (scEventControl_data["login" + iSeqRow] && scEventControl_data["login" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["login" + iSeqRow] && scEventControl_data["login" + iSeqRow]["change"]) { return true; } if (scEventControl_data["name" + iSeqRow] && scEventControl_data["name" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["name" + iSeqRow] && scEventControl_data["name" + iSeqRow]["change"]) { return true; } if (scEventControl_data["email" + iSeqRow] && scEventControl_data["email" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["email" + iSeqRow] && scEventControl_data["email" + iSeqRow]["change"]) { return true; } if (scEventControl_data["phone" + iSeqRow] && scEventControl_data["phone" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["phone" + iSeqRow] && scEventControl_data["phone" + iSeqRow]["change"]) { return true; } if (scEventControl_data["role" + iSeqRow] && scEventControl_data["role" + iSeqRow]["blur"]) { return true; } if (scEventControl_data["role" + iSeqRow] && scEventControl_data["role" + iSeqRow]["change"]) { return true; } return false; } // scEventControl_active function scEventControl_onFocus(oField, iSeq) { var fieldId, fieldName; fieldId = $(oField).attr("id"); fieldName = fieldId.substr(12); scEventControl_data[fieldName]["blur"] = true; scEventControl_data[fieldName]["change"] = false; } // scEventControl_onFocus function scEventControl_onBlur(sFieldName) { scEventControl_data[sFieldName]["blur"] = false; if (scEventControl_data[sFieldName]["change"]) { if (scEventControl_data[sFieldName]["original"] == $("#id_sc_field_" + sFieldName).val() || scEventControl_data[sFieldName]["calculated"] == $("#id_sc_field_" + sFieldName).val()) { scEventControl_data[sFieldName]["change"] = false; } } } // scEventControl_onBlur function scEventControl_onChange(sFieldName) { scEventControl_data[sFieldName]["change"] = false; } // scEventControl_onChange function scEventControl_onAutocomp(sFieldName) { scEventControl_data[sFieldName]["autocomp"] = false; } // scEventControl_onChange var scEventControl_data = {}; function scJQEventsAdd(iSeqRow) { $('#id_sc_field_login' + iSeqRow).bind('blur', function() { setTimeout(function() {sc_app_my_info_login_onblur('#id_sc_field_login' + iSeqRow, iSeqRow, event);}, 300) }) .bind('change', function() { sc_app_my_info_login_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_login_onfocus(this, iSeqRow, event) }); $('#id_sc_field_pswd' + iSeqRow).bind('change', function() { sc_app_my_info_pswd_onchange(this, iSeqRow, event) }); $('#id_sc_field_name' + iSeqRow).bind('blur', function() { setTimeout(function() {sc_app_my_info_name_onblur('#id_sc_field_name' + iSeqRow, iSeqRow, event);}, 300) }) .bind('change', function() { sc_app_my_info_name_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_name_onfocus(this, iSeqRow, event) }); $('#id_sc_field_email' + iSeqRow).bind('blur', function() { setTimeout(function() {sc_app_my_info_email_onblur('#id_sc_field_email' + iSeqRow, iSeqRow, event);}, 300) }) .bind('change', function() { sc_app_my_info_email_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_email_onfocus(this, iSeqRow, event) }); $('#id_sc_field_active' + iSeqRow).bind('change', function() { sc_app_my_info_active_onchange(this, iSeqRow, event) }); $('#id_sc_field_activation_code' + iSeqRow).bind('change', function() { sc_app_my_info_activation_code_onchange(this, iSeqRow, event) }); $('#id_sc_field_priv_admin' + iSeqRow).bind('change', function() { sc_app_my_info_priv_admin_onchange(this, iSeqRow, event) }); $('#id_sc_field_mfa' + iSeqRow).bind('change', function() { sc_app_my_info_mfa_onchange(this, iSeqRow, event) }); $('#id_sc_field_picture' + iSeqRow).bind('blur', function() { sc_app_my_info_picture_onblur('#id_sc_field_picture' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_app_my_info_picture_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_picture_onfocus(this, iSeqRow, event) }); $('#id_sc_field_role' + iSeqRow).bind('blur', function() { sc_app_my_info_role_onblur('#id_sc_field_role' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_app_my_info_role_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_role_onfocus(this, iSeqRow, event) }); $('#id_sc_field_phone' + iSeqRow).bind('blur', function() { sc_app_my_info_phone_onblur('#id_sc_field_phone' + iSeqRow, iSeqRow, event) }) .bind('change', function() { sc_app_my_info_phone_onchange(this, iSeqRow, event) }) .bind('focus', function() { sc_app_my_info_phone_onfocus(this, iSeqRow, event) }); $('#id_sc_field_pswd_last_updated' + iSeqRow).bind('change', function() { sc_app_my_info_pswd_last_updated_onchange(this, iSeqRow, event) }); } // scJQEventsAdd Upload_Cancel = false; function sc_app_my_info_login_onblur(oThis, iSeqRow, event) { do_ajax_app_my_info_validate_login(); scCssBlur(oThis); } function sc_app_my_info_login_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_login_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_app_my_info_pswd_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_name_onblur(oThis, iSeqRow, event) { do_ajax_app_my_info_validate_name(); scCssBlur(oThis); } function sc_app_my_info_name_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_name_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_app_my_info_email_onblur(oThis, iSeqRow, event) { do_ajax_app_my_info_validate_email(); scCssBlur(oThis); } function sc_app_my_info_email_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_email_onfocus(oThis, iSeqRow, event) { scEventControl_onFocus(oThis, iSeqRow); scCssFocus(oThis); } function sc_app_my_info_active_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_activation_code_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_priv_admin_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_mfa_onchange(oThis, iSeqRow, event) { scMarkFormAsChanged(); } function sc_app_my_info_picture_onblur(oThis, iSeqRow, event) { scCssBlur(oThis); } function sc_app_my_info_picture_onchange(oThis, iSeqRow, event) { File_Event = event.target; File_Arr = File_Event.files; if (File_Arr.length > 0) { File_Name = File_Arr[0].name; if (File_Name.indexOf('*') != -1) { scJs_alert (File_Name + '