|
@@ -14,6 +14,14 @@ var hideMask = function () {
|
|
|
$('#mask').hide();
|
|
|
}
|
|
|
|
|
|
+var showMoeFormMask = function () {
|
|
|
+ $('#moe-form-mask').show();
|
|
|
+}
|
|
|
+
|
|
|
+var hideMoeFormMask = function () {
|
|
|
+ $('#moe-form-mask').hide();
|
|
|
+}
|
|
|
+
|
|
|
$(document).ready(function () {
|
|
|
hideMask();
|
|
|
});
|
|
@@ -225,6 +233,13 @@ $(function () {
|
|
|
|
|
|
jQuery(document).ready(function () {
|
|
|
var $ = jQuery;
|
|
|
+ $('body').mousedown(function(e){
|
|
|
+ if($(e.target).closest('[moe]').length){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('[moe] form:not([show])').hide();
|
|
|
+ hideMoeFormMask();
|
|
|
+ });
|
|
|
|
|
|
$('[moe]').each(function () {
|
|
|
var moe = $(this);
|
|
@@ -264,7 +279,13 @@ jQuery(document).ready(function () {
|
|
|
$(realForm).css('display', 'inline');
|
|
|
formToggle = true;
|
|
|
} else {
|
|
|
+ var isRealFormVisible = $(realForm).is(':visible');
|
|
|
$(realForm).toggle(100);
|
|
|
+ if(isRealFormVisible){
|
|
|
+ hideMoeFormMask();
|
|
|
+ }else{
|
|
|
+ showMoeFormMask();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (!infoToggle && info && $(info).attr('show') == null) {
|
|
@@ -299,6 +320,7 @@ jQuery(document).ready(function () {
|
|
|
if (start && $(start).attr('show') == null) {
|
|
|
$(start).show(100);
|
|
|
}
|
|
|
+ hideMoeFormMask();
|
|
|
});
|
|
|
}
|
|
|
$(submit).click(function (e) {
|
|
@@ -343,8 +365,8 @@ jQuery(document).ready(function () {
|
|
|
window.history.back();
|
|
|
} else {
|
|
|
var host = window.location.host;
|
|
|
- if (redir.indexOf('[uid]') > -1) {
|
|
|
- redir = redir.replace('[uid]', data)
|
|
|
+ if (redir.indexOf('[data]') > -1) {
|
|
|
+ redir = redir.replace('[data]', data)
|
|
|
window.location.href = '/' + redir;
|
|
|
} else {
|
|
|
window.location.href = '/' + redir;
|
|
@@ -634,90 +656,12 @@ $('a[aller]').click(function () {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
-$('button[batcher]').click(function () {
|
|
|
- var url = $(this).attr('batcher');
|
|
|
- var rid = $(this).attr('rid');
|
|
|
- batcher(url, rid);
|
|
|
- return false;
|
|
|
-});
|
|
|
-
|
|
|
-var batcherGoing = false;
|
|
|
-
|
|
|
-var batcher = function (url, recordIdName) {
|
|
|
- if (batcherGoing) {
|
|
|
- return;
|
|
|
- }
|
|
|
- batcherGoing = true;
|
|
|
- var jobs = [];
|
|
|
- $('input[type=checkbox][job]').each(function () {
|
|
|
- if (this.checked) {
|
|
|
- jobs.push(this);
|
|
|
- }
|
|
|
- });
|
|
|
- console.log('JOBS', jobs);
|
|
|
- var pointer = 0;
|
|
|
- var doJob = function () {
|
|
|
- var job = jobs[pointer];
|
|
|
- if (job) {
|
|
|
- pointer++;
|
|
|
- var recordID = $(job).attr('job');
|
|
|
- var data = {
|
|
|
- isBatch: true
|
|
|
- };
|
|
|
- data[recordIdName] = recordID;
|
|
|
- doAjax(url, data,
|
|
|
- function () {
|
|
|
- var messageCell = $(job).closest('td')[0];
|
|
|
- if (messageCell) {
|
|
|
- $(messageCell).find('.errorMessage').remove();
|
|
|
- }
|
|
|
- $(job).closest('tr').css('background', 'gray');
|
|
|
- },
|
|
|
- function () {
|
|
|
- doJob();
|
|
|
- },
|
|
|
- function (res) {
|
|
|
- $(job).closest('tr').css('background', '#83D3C1');
|
|
|
- $(job).prop('checked', false);
|
|
|
- $(job).prop('disabled', true);
|
|
|
- var messageCell = $(job).closest('td')[0];
|
|
|
- if (messageCell) {
|
|
|
- $(messageCell).find('.errorMessage').remove();
|
|
|
- $(messageCell).append('<span class="errorMessage">success!</span>');
|
|
|
- }
|
|
|
- },
|
|
|
- function (mess) {
|
|
|
- var tr = $(job).closest('tr');
|
|
|
- $(tr).css('background', '#ED4337');
|
|
|
- var messageCell = $(job).closest('td')[0];
|
|
|
- if (messageCell) {
|
|
|
- $(messageCell).find('.errorMessage').remove();
|
|
|
- $(messageCell).append('<span class="errorMessage"> ' + mess + '</span>');
|
|
|
- }
|
|
|
- var shouldContinue = confirm('Error processing record ID: ' + recordID + '\n\nMessage: ' + mess + '\n\nContinue?');
|
|
|
- if (shouldContinue) {
|
|
|
- //carry on...
|
|
|
- } else {
|
|
|
- jobs = [];
|
|
|
- }
|
|
|
- }, true);
|
|
|
- } else {
|
|
|
- batcherGoing = false;
|
|
|
- }
|
|
|
- }
|
|
|
- doJob();
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
$(function () {
|
|
|
-
|
|
|
$('.showOnLoad').show();
|
|
|
-
|
|
|
});
|
|
|
|
|
|
$(function () {
|
|
|
var i = 0;
|
|
|
-
|
|
|
function pulsate() {
|
|
|
$(".urgentIndicator").
|
|
|
animate({
|
|
@@ -877,29 +821,6 @@ $(function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-$(document).ready(function () {
|
|
|
- $('[bulk-batcher]').on('click', function () {
|
|
|
- var url = $(this).attr('url');
|
|
|
- var ridname = $(this).attr('rid');
|
|
|
- var ids = [];
|
|
|
- var target = $(this).attr('target');
|
|
|
- $('[job]:checked').each(function () {
|
|
|
- ids.push($(this).attr('job'));
|
|
|
- });
|
|
|
- console.log(ids);
|
|
|
- var data = {};
|
|
|
- data[ridname] = JSON.stringify(ids);
|
|
|
- console.log(data);
|
|
|
- doAjax(url, data, null, null, function (batchID) {
|
|
|
- if (target) {
|
|
|
- window.open('/' + target + batchID, new Date().getTime(), "height=500,width=500");
|
|
|
- } else {
|
|
|
- window.location.href = '/batch-process?id=' + batchID;
|
|
|
- }
|
|
|
- }, null, false, null, true);
|
|
|
- });
|
|
|
-});
|
|
|
-
|
|
|
$(document).ready(function () {
|
|
|
// setInterval(function () {
|
|
|
// doAjax('/api/session/test', null, null, null, null, function () {
|
|
@@ -920,40 +841,6 @@ $(function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-$(function () {
|
|
|
- $('[point=percentCalc]').each(function () {
|
|
|
- var pc = this;
|
|
|
- var calculateTotalAmount = function () {
|
|
|
- var table = $(pc).closest('table');
|
|
|
- var total = 0;
|
|
|
- $(table).find('[point=itemPercent]').each(function () {
|
|
|
- var ip = this;
|
|
|
- var percent = $(ip).val();
|
|
|
- var amount = $(ip).attr('amount');
|
|
|
- var itemTotal = 0;
|
|
|
- if (percent) {
|
|
|
- itemTotal = (amount * percent * .01);
|
|
|
- }
|
|
|
- itemTotal = parseFloat(itemTotal);
|
|
|
- total += itemTotal;
|
|
|
- $(ip).closest('tr').find('[point=itemAmount]').html('$' + itemTotal.toFixed(2));
|
|
|
- });
|
|
|
- T = total;
|
|
|
- $(table).find('[point=mainAmount]').html('$' + total.toFixed(2));
|
|
|
- }
|
|
|
- $(pc).closest('table').find('[point=applyAll]').click(function () {
|
|
|
- var val = $(this).closest('td').find('[point=itemPercent]').val();
|
|
|
- var table = $(this).closest('table');
|
|
|
- $(table).find('[point=itemPercent]').val(val);
|
|
|
- calculateTotalAmount();
|
|
|
- });
|
|
|
- $(pc).find('[point=itemPercent]').change(function () {
|
|
|
- calculateTotalAmount();
|
|
|
- });
|
|
|
- });
|
|
|
-});
|
|
|
-
|
|
|
-
|
|
|
$(function () {
|
|
|
$('input[type=file][ajaxload]').each(function () {
|
|
|
var me = this;
|