/* */
/* Copyright 2003-2016 */
/* copyright@slipt.net|copyright@dccollc.com */
/* DCCO LLC., The Media Trust Company */
/* */
/* This is proprietary software. Any unauthorized distribution or */
/* modification is strictly forbidden and will be prosecuted to the */
/* fullest extent of the law. */
/* */
/* Front-End Development Team Version 7 */
/* */
function CommCenter()
{
this.remote_read_filter = new UserPref("remote_comm_read_filter");
this.notifications_setting = new UserPref("comm_email_notify");
}
CommCenter.prototype.init = function()
{
var comm_center = this;
$("#main_wrapper")
.on("click touchend", ".mc_sel, .mc_item .btn", function(event) { event.stopPropagation(); })
.on("click touchend", ".mc_sel", function(event) { comm_center.toggleMarkAsRead(event); })
.on("click touchend", ".mc_sel_all", function(event) { comm_center.selectAllMessages(event); comm_center.toggleMarkAsRead(event); })
.on("click touchend", ".mc_item", function(event) { comm_center.markAsRead(event); comm_center.viewMessageInbox(event); })
//.on("click touchend", ".mc_item", function(event) { comm_center.markAsRead(event); comm_center.markMsg(event); })
.on("click touchend", ".mc_btns .mc_mark", function(event) { comm_center.markAsReadMass(event); })
.on("click touchend", ".mc_btns .mc_notify", function(event) { comm_center.toggleEmailSettings(event); }) //comm_center.commSettings('mini')
.on("change touchend", ".mc_filter > select", function(event) { comm_center.filterByRead(event); })
.on("keyup", ".mc_search input", function(event) { comm_center.filterBySearch(event); })
;
$(document).on("click touchend", ".vidblk", function(event) { comm_center.drawVideoPlayer(event); });
$(document).on("click touchend", ".filter_item span.ico-close", function (event)
{
var itm = $(event.target).parent().data("item");
var cls = $(event.target).parent().parent().attr("id");
$(event.target).parent().remove();
if (!$("#"+cls).children(".filter_item").length) { $("#"+cls).hide(); }
});
setTimeout(page.request.rewriteHrefs({'title':btoa('Communications')}), 1000);
};
CommCenter.prototype.drawVideoPlayer = function(event)
{
var comm_center = this;
var vid = "";
var idx = 0;
if ($(event.target).hasClass(".vidblk")) {
var vid = $(event.target).data("video");
var idx = $(event.target).index();
} else {
var vid = $(event.target).parents(".vidblk").data("video");
var idx = $(event.target).parents(".vidblk").index();
}
$("#dialog_asktmt").hide();
$("#dialog_overlay").remove();
$("body").append("
- System Overview
- Service Introduction - Security
- Malware Overview
- Malware Incident Details
- Ad Tag Management
");
$("#videoplayer").attr("aria-hidden", "false").removeAttr("style");
$("#playlist li").each(function() {
var bg = "url(" + $(this).data("img") + ")";
$(this).css("background-image", bg);
});
$("#playlist li").on("click", function() {
$("#screen").attr({
"src": $(this).data("vid"),
"poster": $(this).data("img"),
"autoplay": "autoplay"
})
})
$("#videoplayer").click(function(e){
if(e.target == this) {
comm_center.closeVideoPlayer();
}
});
$("#screen").attr({
"src": $("#playlist li").eq(idx).data("vid"),
"poster": $("#playlist li").eq(idx).data("img")
})
$("#screen").get(0).play();
var $el = $(".vidstage");
var elHeight = $el.outerHeight();
var elWidth = $el.outerWidth();
var $wrapper = $("#videoplayer");
function doResize(event, ui) {
var scale, origin;
scale = Math.min(
$wrapper.width() / (elWidth * 1.15),
$wrapper.height() / (elHeight * 1.15)
);
if ( scale < 1 ) {
$el.css({
"transform": "scale(" + scale + ") " + "translate(-1%, -" + parseInt(((1-scale)*100)-4) + "%)"
});
} else {
$el.css({
"transform": "scale(1) " + "translate(-1%, -1%)"
});
}
}
doResize();
$(window).resize(function() {
doResize();
});
return false;
};
CommCenter.prototype.viewMessageInbox = function(event)
{
if ( GeneralUtility.prototype.getParameterByName("sub_mode") == "comm_center" )
{
var comm_center_main = new CommCenterMain();
comm_center_main.loadMessageFromRemote($(event.target).parents(".mc_item").data("id"));
}
else
{
var obj = {};
obj.transport = "comm_center";
obj.label = "Communications";
obj.msg_id = $(event.target).parents(".mc_item").data("id");
page.request.partialPostback(event, obj.transport, obj);
}
};
CommCenter.prototype.closeVideoPlayer = function()
{
$("#screen").get(0).pause();
$('#videoplayer').remove();
$("body").css("overflow","auto");
return false;
};
//autocomplete for Comm Center recipients
CommCenter.prototype.autoCompMsgRecipients = function(text_field, hidden_field)
{
var comm_center = this;
if ( $("#"+text_field).val() == "" ) { $("#"+hidden_field).val(""); }
//params: inputField, hiddenField_id, authKey, type, delay_msec, minChars, autoSubmit, callback, filter_query, allow_csv, extras (array)
var autocomp_obj = {};
autocomp_obj.inputField = text_field; autocomp_obj.hiddenField_id = hidden_field; autocomp_obj.type = "comm_center_recipients"; autocomp_obj.delay_msec = 500; autocomp_obj.minChars = 3; autocomp_obj.autoSubmit = 0; autocomp_obj.filters = null; autocomp_obj.allow_csv = null; autocomp_obj.extras = null;
GeneralUtility.prototype.autoCompleteHiddenField(autocomp_obj);
$("#"+autocomp_obj.inputField).unbind("autocompleteselect").bind("autocompleteselect", comm_center.selectRecipients);
};
//autocomplete for Comm Center recipients
CommCenter.prototype.autoCompMsgRecipientsVersion9 = function(text_field, hidden_field)
{
var comm_center = this;
if ( $("#"+text_field).val() == "" ) { $("#"+hidden_field).val(""); }
//params: inputField, hiddenField_id, authKey, type, delay_msec, minChars, autoSubmit, callback, filter_query, allow_csv, extras (array)
var autocomp_obj = {};
autocomp_obj.inputField = text_field; autocomp_obj.hiddenField_id = hidden_field; autocomp_obj.type = "comm_center_recipients_v9"; autocomp_obj.delay_msec = 500; autocomp_obj.minChars = 3; autocomp_obj.autoSubmit = 0; autocomp_obj.filters = null; autocomp_obj.allow_csv = null; autocomp_obj.extras = null;
GeneralUtility.prototype.autoCompleteHiddenField(autocomp_obj);
$("#"+autocomp_obj.inputField).unbind("autocompleteselect").bind("autocompleteselect", comm_center.selectRecipientsVersion9);
};
CommCenter.prototype.autoCompMsgFromVersion9 = function (text_field, hidden_field)
{
var comm_center = this;
if ( $("#"+text_field).val() == "" ) { $("#"+hidden_field).val(""); }
//params: inputField, hiddenField_id, authKey, type, delay_msec, minChars, autoSubmit, callback, filter_query, allow_csv, extras (array)
var autocomp_obj = {};
autocomp_obj.dts_only = 't'; autocomp_obj.show_cancelled = 'f'; autocomp_obj.inputField = text_field; autocomp_obj.hiddenField_id = hidden_field; autocomp_obj.type = "gid"; autocomp_obj.delay_msec = 500; autocomp_obj.minChars = 3; autocomp_obj.autoSubmit = 0; autocomp_obj.filters = null; autocomp_obj.allow_csv = null; autocomp_obj.extras = null;
GeneralUtility.prototype.autoCompleteHiddenField(autocomp_obj);
$("#" + autocomp_obj.inputField).unbind("autocompleteselect").bind("autocompleteselect", CommCenter.prototype.selectFrom);
};
//autocomplete for Comm Center recipients
CommCenter.prototype.autoCompMsgRecipientsVersion9 = function(text_field, hidden_field)
{
var comm_center = this;
if ( $("#"+text_field).val() == "" ) { $("#"+hidden_field).val(""); }
//params: inputField, hiddenField_id, authKey, type, delay_msec, minChars, autoSubmit, callback, filter_query, allow_csv, extras (array)
var autocomp_obj = {};
autocomp_obj.inputField = text_field; autocomp_obj.hiddenField_id = hidden_field; autocomp_obj.type = "comm_center_recipients_v9"; autocomp_obj.delay_msec = 500; autocomp_obj.minChars = 3; autocomp_obj.autoSubmit = 0; autocomp_obj.filters = null; autocomp_obj.allow_csv = null; autocomp_obj.extras = null;
GeneralUtility.prototype.autoCompleteHiddenField(autocomp_obj);
$("#"+autocomp_obj.inputField).unbind("autocompleteselect").bind("autocompleteselect", comm_center.selectRecipientsVersion9);
};
//autocomplete for Comm Center recipients
CommCenter.prototype.autoCompGid = function(text_field, hidden_field)
{
var comm_center = this;
if ( $("#"+text_field).val() == "" ) { $("#"+hidden_field).val(""); }
//params: inputField, hiddenField_id, authKey, type, delay_msec, minChars, autoSubmit, callback, filter_query, allow_csv, extras (array)
var autocomp_obj = {};
autocomp_obj.inputField = text_field; autocomp_obj.hiddenField_id = hidden_field; autocomp_obj.type = "gid"; autocomp_obj.delay_msec = 500; autocomp_obj.minChars = 3; autocomp_obj.autoSubmit = 0; autocomp_obj.filters = null; autocomp_obj.allow_csv = null; autocomp_obj.extras = null;
GeneralUtility.prototype.autoCompleteHiddenField(autocomp_obj);
$("#"+autocomp_obj.inputField).unbind("autocompleteselect").bind("autocompleteselect", CommCenter.prototype.SelectGid);
};
CommCenter.prototype.SelectGid = function(event, ui)
{
var group_name = ui.item.group_name;
setTimeout(function() {
$("#" + event.target.id).val(group_name).prev().val(val);
}, 1);
};
CommCenter.prototype.selectFrom = function(event, ui)
{
var group_name = ui.item.group_name;
var gid = ui.item.value;
setTimeout(function() {
$("#" + event.target.id).val(group_name);
$("#" + event.target.id).parents('.version_9_send_form').find("input[name='scan_gid']").val(gid);
$("#" + event.target.id).parents('.version_9_send_form').find("input[name='scan_gid_name']").val(group_name);
}, 1);
};
CommCenter.prototype.selectRecipients = function(event, ui)
{
var recipient_id = ui.item.value;
var recipient_name = ui.item.label;
var output = "";
output += "";
$("#msg_recipient_list").append(output);
$("#msg_recipient_list").show();
setTimeout(function() {
$("#msg_form_recipient").select();
}, 100);
};
CommCenter.prototype.getRecipients = function()
{
if ( !$("#msg_recipient_list .filter_item").length ) { return false; }
var recipients = [];
$("#msg_recipient_list .filter_item").each(function()
{
recipients.push($(this).data("id"));
});
return recipients;
};
CommCenter.prototype.selectRecipientsVersion9 = function(event, ui)
{
var recipient_id = ui.item.value;
var recipient_name = ui.item.label;
var output = "";
output += "";
let input = $(event.target).attr('id');
$("#"+input).next().next().append(output);
$("#"+input).next().next().show();
setTimeout(function() {
$("input[id^='msg_form_recipient']").select();
}, 100);
};
CommCenter.prototype.getRecipientsVersion9 = function()
{
if ( !$("div[id^='msg_recipient_list'] .filter_item").length ) { return false; }
var recipients = [];
$("div[id^='msg_recipient_list'] .filter_item").each(function()
{
recipients.push($(this).data("id"));
});
return recipients;
};
CommCenter.prototype.filterByRead = function(event, pref)
{
var comm_center = this;
( pref ) ? pref.save($(event.target).val()) : comm_center.remote_read_filter.save($(event.target).val());
//comm_center.remote_read_filter.save($(event.target).val());
var obj = {};
obj.action = "filter_by_read";
obj.read_filter = $(event.target).val();
if ( !$(".mc_search input").val() || $(".mc_search input").val().length >= 3 )
{
obj.search_filter = $(".mc_search input").val();
}
var callback = function(html)
{
if ( html )
{
$(".mc_items").html("").html(html);
}
}
page.request.getRender("comm/comm_center_rendering_html-v7", obj, callback);
};
CommCenter.prototype.filterBySearch = function(event)
{
var obj = {};
obj.action = "filter_by_search";
if ( !$(event.target).val() || $(event.target).val().length >= 3 )
{
obj.search_filter = $(event.target).val();
obj.read_filter = $("#comm_center_dialog_filter").val();
var callback = function(html)
{
if ( html )
{
$(".mc_items").html("").html(html);
}
}
setTimeout(function()
{
page.request.getRender("comm/comm_center_rendering_html-v7", obj, callback);
}, 250);
}
};
CommCenter.prototype.selectAllMessages = function(event)
{
if ($(".mc_sel_all").prop("checked"))
{
$(".mc_item.new .mc_sel").prop("checked", true);
}
else
{
$(".mc_sel").prop("checked", false);
}
};
CommCenter.prototype.toggleMarkAsRead = function(event)
{
if ( $(".mc_sel_all").is(":checked") && $(".mc_item").hasClass("new") )
{
$(".mc_mark").removeClass("disabled");
}
else if ( $(".mc_sel").is(":checked") && $(event.target).parents(".mc_item").hasClass("new") )
{
$(".mc_mark").removeClass("disabled");
}
else
{
$(".mc_mark").addClass("disabled");
}
}
CommCenter.prototype.markMsg = function(event)
{
//console.log(event.target);
//console.log($(event.target).hasClass(".mc_sel"));
//console.log($(event.target).hasClass(".btn"));
if (!$(event.target).hasClass(".mc_sel") && !$(event.target).hasClass(".btn"))
{
$(".mc_item.on").removeClass("on");
$(event.target).parents(".mc_item").addClass("on").removeClass("new");
}
};
CommCenter.prototype.markAsRead = function(event)
{
if ( $(event.target).parents(".mc_item").hasClass("new") )
{
var obj = {};
obj.action = "mark_as_read";
obj.msg_id = $(event.target).parents(".mc_item").data("id");
var callback = function(json)
{
if ( json && json.success )
{
$(event.target).parents(".mc_item").removeClass("new");
$(event.target).parents(".mc_item").find(".mc_sel").addClass("disabled");
page.sendMessageTov9('updateHeaderCounts');
}
}
page.request.postDataJSON("comm/comm_center_processing_json-v7", obj, callback);
}
};
CommCenter.prototype.markAsReadMass = function(event)
{
if ( $(".mc_check input:checkbox:checked") )
{
var obj = {};
obj.action = "mark_as_read_mass";
var ids = [];
$(".mc_check input:checkbox:checked").each(function()
{
ids.push($(this).parents(".mc_item").data("id"));
});
obj.msg_ids = ( ids.length ) ? ids : null;
var callback = function(json)
{
if ( json && json.success )
{
$(".mc_check input:checkbox:checked").each(function()
{
$(this).parents(".mc_item").removeClass("new");
$(this).prop("checked", false).addClass("disabled");
//$(this).addClass("disabled");
});
$(".mc_sel_all").prop("checked", false);
$(".mc_mark").addClass("disabled");
page.sendMessageTov9('updateHeaderCounts');
}
}
page.request.postDataJSON("comm/comm_center_processing_json-v7", obj, callback);
}
};
CommCenter.prototype.toggleEmailSettings = function(event)
{
if ( $(event.target).parents(".mc_settings") )
{
if ($(".mc_items").is(":visible"))
{
$(".mc_items").css("display","none");
$(".mc_settings").css("display","inline-block");
}
else
{
$(".mc_items").css("display","inline-block");
$(".mc_settings").css("display","none");
}
}
else
{
Dialog.prototype.showModal("#comm_center_settings_dialog");
}
$(".mc_settings").scrollTop(0);
};
CommCenter.prototype.saveEmailSettings = function(event)
{
var comm_center = this;
$(event.target).addClass("disabled").prop("disabled", true);
var notifications = {};
$("#comm_center_notifications_form .comm_email_notify").each(function()
{
var value = ( $(this).is(":checked") ) ? 1 : 0
notifications[this.name] = value;
});
//console.log(notifications);
comm_center.notifications_setting.save(notifications);
setTimeout(function()
{
$("#comm_center_notifications_form .form_response_msg").html("Your selections have been saved");
}, 250);
if ( $("#comm_center_settings_dialog").length && $("#comm_center_settings_dialog").is(":visible") )
{
setTimeout(function()
{
$("#comm_center_notifications_form .form_response_msg").html("");
$(event.target).removeClass("disabled").prop("disabled", false);
Dialog.prototype.hideModal("#comm_center_settings_dialog");
}, 2000);
}
else if ( $(".mc_settings").length && $(".mc_settings").is(":visible") )
{
setTimeout(function()
{
$("#comm_center_notifications_form .form_response_msg").html("");
$(event.target).removeClass("disabled").prop("disabled", false);
$(".mc_settings").hide();
$(".mc_items").show();
}, 2000);
}
else
{
setTimeout(function()
{
$("#comm_center_notifications_form .form_response_msg").html("");
$(event.target).removeClass("disabled").prop("disabled", false);
}, 3000);
}
};
CommCenter.prototype.processRequest = function(event, callback)
{
var comm_center = this;
var obj = {};
var src = $(event.target).data("pa");
$.extend(obj, event.target.dataset);
if ( callback )
{
var pr_callback = function(json)
{
if ( json && json.success )
{
callback(event);
}
else
{
if ( $(event.target).parents(".mc_item").find(".response_msg").length )
{
$(event.target).parents(".mc_item").find(".response_msg").addClass("red");
$(event.target).parents(".mc_item").find(".response_msg").html(json.message).show();
setTimeout(function() { $(event.target).parents(".mc_item").find(".response_msg").html("").hide(); }, 2000);
}
else
{
$(event.target).parents("td").find(".response_msg").addClass("red");
$(event.target).parents("td").find(".response_msg").html(json.message);
setTimeout(function() { $(event.target).parents("td").find(".response_msg").html(""); }, 2000);
}
}
}
}
else
{
var pr_callback = function(json)
{
if ( json && json.success )
{
$(event.target).parents(".mc_item").find(".response_msg").html(json.message).show();
setTimeout(function()
{
$(event.target).parents(".mc_item").find(".response_msg").html("").hide();
}, 2000);
}
else
{
if ( $(event.target).parents(".mc_item").find(".response_msg").length )
{
$(event.target).parents(".mc_item").find(".response_msg").addClass("red");
$(event.target).parents(".mc_item").find(".response_msg").html(json.message).show();
setTimeout(function() { $(event.target).parents(".mc_item").find(".response_msg").html("").hide(); }, 2000);
}
else
{
$(event.target).parents("td").find(".response_msg").addClass("red");
$(event.target).parents("td").find(".response_msg").html(json.message);
setTimeout(function() { $(event.target).parents("td").find(".response_msg").html(""); }, 2000);
}
}
}
}
page.request.postDataJSON(src, obj, pr_callback);
};
//Connections Inbox connect/decline actions
CommCenter.prototype.processConnectRequest = function(event)
{
var obj = {};
var src = $(event.target).data("pa");
$.extend(obj, event.target.dataset);
var callback = function(json)
{
if ( json && json.success )
{
$(event.target).parents(".mf_req").find(".response_msg").html(json.message).show();
setTimeout(function()
{
$(event.target).parents(".mf_req").find(".response_msg").html("").hide();
$("#dialog_wrapper").html("").hide();
$("#remote_connect").trigger("click");
}, 2000);
}
else
{
$(event.target).parents(".mf_req").find(".response_msg").addClass("red");
$(event.target).parents(".mf_req").find(".response_msg").html(json.message).show();
}
}
page.request.postDataJSON(src, obj, callback);
};
//Ask TMT dialog
CommCenter.prototype.displayAskTMT = function(event, _callback)
{
var data = {};
var obj = {};
$.extend(data, event.target.dataset);
obj.action = $(event.target).data("action");
obj.ask_type = $(event.target).data("ask_type");
obj.ask_title = $(event.target).data("ask_title");
obj.ask_data = data;
var callback = function (html)
{
if (html)
{
$("#dialog_asktmt .modal").html("").html(html);
Dialog.prototype.showModal("#dialog_asktmt", false);
}
if ( _callback ) {
_callback(event);
}
};
page.request.getRender("comm/comm_center_rendering_html-v7", obj, callback);
};
CommCenter.prototype.submitAskTMT = function(event)
{
var comm_center = this;
var form = $(event.target).parents("form").attr("id");
$(event.target).addClass("disabled").prop("disabled", true);
$("#"+form).find(".form_response_msg").html("").html("Sending...");
var callback = function(json)
{
if ( json && json.success )
{
$("#dialog_asktmt_email, #dialog_asktmt_thankyou").toggle();
$(event.target).removeClass("disabled").prop("disabled", false);
$("#"+form).find(".form_response_msg").html("");
}
else
{
$("#"+form).find(".form_response_msg").html(json.message);
$(event.target).removeClass("disabled").prop("disabled", false);
}
}
page.request.formSubmit("comm/comm_center_processing_json-v7", form, callback);
};
CommCenter.prototype.submitPolicyNotification = function(event)
{
var comm_center = this;
var form = $(event.target).parents("form").attr("id");
var scan_id = $("#"+form).find("input[name='scan_id']").val();
var obj = {};
obj.action = "submit_policy_notify";
if ( comm_center.getRecipients() )
{
obj.recipients = comm_center.getRecipients();
}
else
{
$("#"+form).find(".form_response_msg").html("").html("Please type and select at least one recipient");
return;
}
if ( !$("input[name='violation_subject']").val() )
{
$("#"+form).find(".form_response_msg").html("").html("Please enter a subject");
return;
}
if ( !$("input[name='violation_type']").is(":checked") )
{
$("#"+form).find(".form_response_msg").html("").html("Please choose a violation type");
return;
}
if ( !$("textarea[name='violation_summary']").val() || $("textarea[name='violation_summary']").val().length < 6 )
{
$("#"+form).find(".form_response_msg").html("").html("Please enter a summary for the violation (at least 6 characters)");
return;
}
$(event.target).addClass("disabled").prop("disabled", true);
var callback = function(json)
{
if ( json && json.success )
{
$("#"+form).find(".form_response_msg").html(json.message);
setTimeout(function()
{
$("#"+form).find(".form_response_msg").html("");
Dialog.prototype.hideModal("#policy_notify_"+scan_id);
$(event.target).removeClass("disabled").prop("disabled", false);
}, 2000);
}
else
{
$("#"+form).find(".form_response_msg").html(json.message);
$(event.target).removeClass("disabled").prop("disabled", false);
}
};
if ( $("input[name='violation_type']:checked").val() == "cqa" )
{
//console.log("creative_qa");
page.request.formSubmitExtend("creative_qa/cqa_processing_json-v7", form, callback, obj);
}
else if ( $("input[name='violation_type']:checked").val() == "data_compliance" )
{
//console.log("data_compliance");
page.request.formSubmitExtend("data_compliance/data_compliance_processing_json-v7", form, callback, obj);
}
};
CommCenter.prototype.hideVersion9Modal = function(id)
{
$(id).html("");
Dialog.prototype.hideModal(id);
}
CommCenter.prototype.submitVersion9Send = function(event)
{
var comm_center = this;
var form = $(event.target).parents("form").attr("id");
var itemid = $("#"+form).find("input[name='itemid']").val();
var csid = $("#"+form).find("input[name='csid']").val();
var action = $("#"+form).find("input[name='action']").val();
//var sid = $("#"+form).find("input[name='sid']").val();
//var scan_gid = $("#"+form).find("input[name='scan_gid']").val();
var obj = {};
if (!action)
{
obj.action = "send_version_9_scan_message";
}
if ( comm_center.getRecipientsVersion9() )
{
obj.recipients = comm_center.getRecipientsVersion9();
}
else
{
$("#"+form).find(".form_response_msg").html("").html("Please type and select at least one recipient");
return;
}
if ( !$("#"+form).find("input[name='version_9_send_subject']").val() )
{
$("#"+form).find(".form_response_msg").html("").html("Please enter a subject");
return;
}
// if ( !$("textarea[name='version_9_send_message']").val() || $("textarea[name='version_9_send_message']").val().length < 6 )
// {
// $("#"+form).find(".form_response_msg").html("").html("Please enter a message");
// return;
// }
$(event.target).addClass("disabled").prop("disabled", true);
var callback = function(json)
{
if ( json && json.success )
{
$("#"+form).find(".form_response_msg").html(json.message);
setTimeout(function()
{
$("#"+form).find(".form_response_msg").html("");
Dialog.prototype.hideModal("#version_9_send_"+itemid);
$("#version_9_send_"+itemid).html("");
$(event.target).removeClass("disabled").prop("disabled", false);
}, 2000);
}
else
{
$("#"+form).find(".form_response_msg").html(json.message);
$(event.target).removeClass("disabled").prop("disabled", false);
}
};
page.request.formSubmitExtend("comm/comm_center_processing_json-v7", form, callback, obj);
};
//---------- Callback methods ----------//
CommCenter.prototype.toggleActionMsgButtonText = function(event, obj)
{
if ( $(event.target).text() == obj.text1 )
{
$(event.target).text(obj.text2);
$(event.target).removeData("action");
$(event.target).data("action", obj.action2);
$(event.target).removeAttr("data-action");
$(event.target).attr("data-action", obj.action2);
}
else if ( $(event.target).text() == obj.text2 )
{
$(event.target).text(obj.text1);
$(event.target).removeData("action");
$(event.target).data("action", obj.action1);
$(event.target).removeAttr("data-action");
$(event.target).attr("data-action", obj.action1);
}
if ( $(event.target).hasClass("confirm") )
{
$(event.target).css("visibility", "").siblings(".confirm_action, .cancel_action").remove();
}
};
CommCenter.prototype.hideMsgButton = function(event)
{
if ( $(event.target).hasClass("confirm") )
{
$(event.target).css("visibility", "").siblings(".confirm_action, .cancel_action").remove();
}
$(event.target).remove();
};
CommCenter.prototype.showMsgButton = function(id)
{
$('#'+id).show();
};