Code:
$(document).ready(function() {
$("#acs-tabset").tabs({ show: function(event, ui) { resizeStuff() } }).data("lastpanel", "1");
initializeTab();
$("#acs-close-tracker").button({ text: false, icons: { primary: "ui-icon-triangle-1-s"} }).click(function() {
$("#acs-work").removeClass("acs-work-full-size");
$("#acs-tracker").toggle(0, trackerToggle);
return false;
});
$("#acs-show-binder").button({ text: true, icons: { primary: "ui-icon-triangle-1-e"} }).attr('disabled', 'disabled').click(function() {
//$("#acs-work").removeClass("acs-work-full-size");
if ($("#acs-tracker").is(':hidden')) {
$("#acs-work").removeClass("acs-work-full-size");
$("#acs-tracker").toggle(0, trackerToggle);
}
$("#acs-binder-panel").toggle(0, binderToggle);
return false;
});
$("#acs-logout").button({ text: true, icons: { primary: "ui-icon-power"} }).attr('disabled', 'disabled').click(function() {
$("#acs-binder-info").html('Logging out...<img src="Images/ajax-loader-small.gif" />');
closeAll();
$("#acs-binder-info").html('');
g_warning = false;
return false;
});
$("#acs-show-reflectors").button({ text: false, icons: { primary: "ui-icon-gear"} }).click(function() {
showReflectors();
return false;
});
$("#acs-clear-spcache").button({ text: false, icons: { primary: "ui-icon-wrench"} }).click(function() {
ctrlWebService("spcache", "clear", "", "");
return false;
});
$('.acs-panel-btn-add').live('click', addClick);
$('.acs-panel-btn-delete').live('click', deleteClick);
$('.acs-panel-btn-edit').live('click', editClick);
$('.acs-panel-btn-open').live('click', openClick);
$('.acs-operator-button-event').live('click', operatorClick);
$('.acs-panel-btn-clear').live('click', clearClick);
$('.acs-panel-btn-sort').live('click', sortClick);
$('.acs-panel-btn-reader').live('click', readerClick);
$('.acs-panel-btn-next').live('click', nextClick);
$('.acs-panel-btn-prev').live('click', prevClick);
$('.acs-panel-btn-reader-next').live('click', nextReaderClick);
$('.acs-panel-btn-reader-prev').live('click', prevReaderClick);
$('.acs-panel-btn-close').live('click', closeClick);
$('.acs-panel-btn-newwindow').live('click', newwindowClick);
$('.acs-panel-btn-closetab').live('click', closetabClick);
$('.acs-panel-btn-save').live('click', saveClick);
$('.acs-panel-btn-undo').live('click', undoClick);
$('.acs-panel-btn-popup').live('click', popupClick);
$('.acs-panel-btn-refresh').live('click', refreshClick);
$('.acs-panel-btn-print').live('click', printClick);
$('.acs-panel-btn-run').live('click', runClick);
$('.acs-reader-aggbtn').live('click', aggbtnClick);
$('.acs-input-field').live('focusin', focusinField);
$('.acs-input-field').live('change', changeField);
$('.acs-input-setThisPay').live('change', setThisPay);
$('.awc-prob').live('change', setThisPay);
$('.acs-panel-btn-page').live('click', pageClick);
$('.acs-grid-btn-reqapp').live('click', reqappClick);
$('.acs-grid-btn-operator').live('click', gridOperatorClick);
$('.acs-grid-chk-hdr').live('click', checkboxhdrClick);
$('.slick-cell-checkboxsel').live('click', checkboxClick);
$('.acs-sproc-button').live('click', sprocClick);
$('.acs-saveadd-button').live('click', saveaddClick);
$('.acs-saveclose-button').live('click', savecloseClick);
$('.acs-savenext-button').live('click', savenextClick);
$('.awc-prob').live('click', probClick);
$('.acs-download').live('click', downloadClick);
$('#acs-error').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work"} });
$('#acs-prompt').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work"} });
$('#acs-formula').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work" }, minWidth: 970 });
$('#dlgChartType').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work"} });
$('#dlgAddWhat').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work"} });
$('#dlgChoice').dialog({ autoOpen: false, modal: true, closeOnEscape: false, position: { my: "left top", at: "left center", of: "#acs-work"} });
$('#dlgReloadGrid').dialog({ autoOpen: false, modal: true, position: { my: "left top", at: "left center", of: "#acs-work"} });
var options = {};
options.drop = dropOn;
$('#acs-panel1').parent().droppable(options);
$(window).resize(resizeStuff);
resetWindowSize();
$.extend($.ui.autocomplete, {
escapeRegex: function(value) {
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
},
filter: function(array, term) {
var matcher = new RegExp($.ui.autocomplete.escapeRegex(term), "i");
var arraytoreturn = $.grep(array, function(value) {
return matcher.test(value.label || value.value || value);
});
if (arraytoreturn.length > 200) {
arraytoreturn = [{ label: "Please be more specific - " + arraytoreturn.length + " matching entries!", value: ""}];
}
return arraytoreturn;
}
});
urlParams.id = urlParams.id || "";
$("#acs-username,#acs-password").keyup(function(e) {
loginKeyUp(e, this);
});
if (urlParams.id === "") {
$('#dlgLogin').dialog({ title: 'Log in', modal: true, closeOnEscape: false, buttons: { 'Log in': function() { loginClick(this) } } });
} else {
$("#acs-login-error").html('<img src="Images/ajax-loader-small.gif" />');
ctrlWebService("userid", urlParams.id, "", "");
}
window.onbeforeunload = function() {
if (g_warning) {
return 'You have made changes on this page that you have not yet confirmed. If you navigate away from this page you will lose your unsaved changes';
}
}
});