diff --git a/public/js/ff/accounts/show.js b/public/js/ff/accounts/show.js index 1d53f11c1b..fc41371659 100644 --- a/public/js/ff/accounts/show.js +++ b/public/js/ff/accounts/show.js @@ -8,6 +8,8 @@ * See the LICENSE file for details. */ +/** global: chartUri, incomeCategoryUri, expenseCategoryUri, expenseBudgetUri */ + var fixHelper = function (e, tr) { "use strict"; var $originals = tr.children(); @@ -53,8 +55,6 @@ $(function () { } } ).disableSelection(); - } else { - console.log('its null'); } }); @@ -62,7 +62,6 @@ $(function () { function sortStop(event, ui) { "use strict"; var current = $(ui.item); - console.log('sort stop'); var thisDate = current.data('date'); var originalBG = current.css('backgroundColor'); @@ -86,7 +85,7 @@ function sortStop(event, ui) { }); // do extra animation when done? - $.post('transactions/reorder', {items: submit, date: thisDate, _token: token}); + $.post('transactions/reorder', {items: submit, date: thisDate}); current.animate({backgroundColor: "#5cb85c"}, 200, function () { $(this).animate({backgroundColor: originalBG}, 200); diff --git a/public/js/ff/bills/show.js b/public/js/ff/bills/show.js index 3964f90dcb..f67c246ca2 100644 --- a/public/js/ff/bills/show.js +++ b/public/js/ff/bills/show.js @@ -8,7 +8,7 @@ * See the LICENSE file for details. */ -/* global comboChart, billID */ +/** global: billUri */ $(function () { "use strict"; diff --git a/public/js/ff/budgets/index.js b/public/js/ff/budgets/index.js index 95a4eca219..1f8ee67597 100644 --- a/public/js/ff/budgets/index.js +++ b/public/js/ff/budgets/index.js @@ -8,6 +8,8 @@ * See the LICENSE file for details. */ +/** global: spent, budgeted, available, currencySymbol */ + function drawSpentBar() { "use strict"; if ($('.spentBar').length > 0) { @@ -79,11 +81,6 @@ function updateBudgetedAmounts(e) { } }); } - - - console.log('Budget id is ' + id); - console.log('Difference = ' + (value - original )); - } $(function () { @@ -102,17 +99,6 @@ $(function () { */ $('input[type="number"]').on('input', updateBudgetedAmounts); - - /* - Draw the charts, if necessary: - */ - if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') { - columnChart('chart/budget/' + budgetID, 'budgetOverview'); - } - if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') { - lineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview'); - } - }); function updateIncome() { diff --git a/public/js/ff/budgets/show.js b/public/js/ff/budgets/show.js index 1e7fb668dc..07cf18ed9e 100644 --- a/public/js/ff/budgets/show.js +++ b/public/js/ff/budgets/show.js @@ -8,6 +8,8 @@ * See the LICENSE file for details. */ +/** global: budgetChartUri */ + $(function () { "use strict"; diff --git a/public/js/ff/categories/show-by-date.js b/public/js/ff/categories/show-by-date.js index 6b5ee6b775..e97dab4db8 100644 --- a/public/js/ff/categories/show-by-date.js +++ b/public/js/ff/categories/show-by-date.js @@ -8,6 +8,8 @@ * See the LICENSE file for details. */ +/** global: specific */ + $(function () { "use strict"; columnChart(specific, 'period-specific-period'); diff --git a/public/js/ff/charts.js b/public/js/ff/charts.js index de470ba9e4..82977288d2 100644 --- a/public/js/ff/charts.js +++ b/public/js/ff/charts.js @@ -125,7 +125,6 @@ function doubleYChart(URI, container) { ]; options.stacked = true; options.scales.xAxes[0].stacked = true; - // console.log(options); var chartType = 'bar'; @@ -240,7 +239,6 @@ function pieChart(URI, container) { */ function drawAChart(URI, container, chartType, options, colorData) { if ($('#' + container).length === 0) { - console.log('No container called ' + container + ' was found.'); return; } @@ -249,7 +247,6 @@ function drawAChart(URI, container, chartType, options, colorData) { if (data.labels.length === 0) { - console.log(chartType + " chart in " + container + " has no data."); // remove the chart container + parent var holder = $('#' + container).parent().parent(); if (holder.hasClass('box') || holder.hasClass('box-body')) { @@ -261,8 +258,6 @@ function drawAChart(URI, container, chartType, options, colorData) { boxBody = holder; } boxBody.empty().append($('
').append($('').text(noDataForChart)));
- } else {
- console.log("Want to add text but holder has classes: " + holder.attr("class"));
}
return;
}
@@ -273,13 +268,11 @@ function drawAChart(URI, container, chartType, options, colorData) {
}
if (allCharts.hasOwnProperty(container)) {
- console.log('Will draw updated ' + chartType + ' chart');
allCharts[container].data.datasets = data.datasets;
allCharts[container].data.labels = data.labels;
allCharts[container].update();
} else {
// new chart!
- console.log('Will draw new ' + chartType + 'chart');
var ctx = document.getElementById(container).getContext("2d");
allCharts[container] = new Chart(ctx, {
type: chartType,
@@ -289,8 +282,6 @@ function drawAChart(URI, container, chartType, options, colorData) {
}
}).fail(function () {
- console.log('Failed to draw ' + chartType + ' in container ' + container);
$('#' + container).addClass('general-chart-error');
});
- console.log('URL for ' + chartType + ' chart : ' + URI);
}
diff --git a/public/js/ff/export/index.js b/public/js/ff/export/index.js
index eeed44981f..e1699c3c8d 100644
--- a/public/js/ff/export/index.js
+++ b/public/js/ff/export/index.js
@@ -24,7 +24,6 @@ $(function () {
function startExport() {
"use strict";
- console.log('Start export...');
hideForm();
showLoading();
hideError();
@@ -75,15 +74,12 @@ function showError(text) {
function callExport() {
"use strict";
- console.log('Start callExport()...')
var data = $('#export').serialize();
// call status, keep calling it until response is "finished"?
intervalId = window.setInterval(checkStatus, 500);
$.post('export/submit', data).done(function (data) {
- console.log('Export hath succeeded!');
-
// stop polling:
window.clearTimeout(intervalId);
@@ -114,7 +110,6 @@ function callExport() {
function checkStatus() {
"use strict";
- console.log('get status...');
$.getJSON('export/status/' + jobKey).done(function (data) {
putStatusText(data.status);
});
diff --git a/public/js/ff/firefly.js b/public/js/ff/firefly.js
index 2b105d4386..c35bd4fbe8 100644
--- a/public/js/ff/firefly.js
+++ b/public/js/ff/firefly.js
@@ -11,6 +11,12 @@
$(function () {
"use strict";
+ $.ajaxSetup({
+ headers: {
+ 'X-CSRF-Token': $('meta[name="_token"]').attr('content')
+ }
+ });
+
// when you click on a currency, this happens:
$('.currency-option').click(currencySelect);
@@ -49,18 +55,12 @@ $(function () {
$.post(dateRangeConfig.URL, {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
- label: label,
- _token: token
+ label: label
}).done(function () {
- console.log('Succesfully sent new date range [' + start.format('YYYY-MM-DD') + '-' + end.format('YYYY-MM-DD') + '].');
window.location.reload(true);
}).fail(function () {
- console.log('Could not send new date range.');
alert('Could not change date range');
-
});
-
- //alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
}
);
@@ -133,7 +133,6 @@ function triggerList(e) {
"use strict";
var link = $(e.target);
var table = link.parent().parent().parent().parent();
- console.log('data-hidden = ' + table.attr('data-hidden'));
if (table.attr('data-hidden') === 'no') {
// hide all elements, return false.
table.find('.overListLength').hide();
diff --git a/public/js/ff/import/status.js b/public/js/ff/import/status.js
index 0b24c0c7f5..2b15cac1b6 100644
--- a/public/js/ff/import/status.js
+++ b/public/js/ff/import/status.js
@@ -28,20 +28,17 @@ $(function () {
function checkImportStatus() {
"use strict";
- console.log('checkImportStatus()');
$.getJSON(jobImportUrl).done(reportOnJobImport).fail(failedJobImport);
}
function importComplete(data) {
"use strict";
- console.log('importComplete()');
var bar = $('#import-status-bar');
bar.removeClass('active');
}
function updateBar(data) {
"use strict";
- console.log('updateBar()');
var bar = $('#import-status-bar');
if (data.showPercentage) {
bar.addClass('progress-bar-success').removeClass('progress-bar-info');
@@ -63,7 +60,6 @@ function updateBar(data) {
function reportErrors(data) {
"use strict";
- console.log('reportErrors()');
if (data.errors.length == 1) {
$('#import-status-error-intro').text(langImportSingleError);
//'An error has occured during the import. The import can continue, however.'
@@ -83,21 +79,18 @@ function reportErrors(data) {
function reportStatus(data) {
"use strict";
- console.log('reportStatus()');
$('#import-status-txt').removeClass('text-danger').text(data.statusText);
}
function kickStartJob() {
"use strict";
- console.log('kickStartJob()');
- $.post(jobStartUrl, {_token: token});
+ $.post(jobStartUrl);
startedTheImport();
startedImport = true;
}
function updateTimeout(data) {
"use strict";
- console.log('updateTimeout()');
if (data.stepsDone != stepCount) {
stepCount = data.stepsDone;
currentLimit = 0;
@@ -105,12 +98,10 @@ function updateTimeout(data) {
}
currentLimit = currentLimit + interval;
- // console.log("stepCount: " + stepCount + ", stepsDone: " + data.stepsDone + ", currentLimit: " + currentLimit);
}
function timeoutError() {
"use strict";
- console.log('timeoutError()');
// set status
$('#import-status-txt').addClass('text-danger').text(langImportTimeOutError);
@@ -121,13 +112,11 @@ function timeoutError() {
function importJobFinished(data) {
"use strict";
- console.log('importJobFinished() = ' + data.finished);
return data.finished;
}
function finishedJob(data) {
"use strict";
- console.log('finishedJob()');
// "There was an error during the import routine. Please check the log files. The error seems to be: '"
$('#import-status-txt').removeClass('text-danger').addClass('text-success').text(langImportFinished);
@@ -142,7 +131,6 @@ function finishedJob(data) {
function reportOnJobImport(data) {
"use strict";
- console.log('reportOnJobImport()');
updateBar(data);
reportErrors(data);
reportStatus(data);
@@ -173,13 +161,11 @@ function reportOnJobImport(data) {
function startedTheImport() {
"use strict";
- console.log('startedTheImport()');
setTimeout(checkImportStatus, interval);
}
function failedJobImport(jqxhr, textStatus, error) {
"use strict";
- console.log('failedJobImport()');
// set status
// "There was an error during the import routine. Please check the log files. The error seems to be: '"
$('#import-status-txt').addClass('text-danger').text(langImportFatalError + ' ' + textStatus + ' ' + error);
diff --git a/public/js/ff/index.js b/public/js/ff/index.js
index 27d69d5bc0..04a17e9133 100644
--- a/public/js/ff/index.js
+++ b/public/js/ff/index.js
@@ -24,8 +24,6 @@ $(function () {
tour.init();
// Start the tour
tour.start();
- }).fail(function () {
- console.log('Already had tour.');
});
}
@@ -34,7 +32,7 @@ $(function () {
function endTheTour() {
"use strict";
- $.post('json/end-tour', {_token: token});
+ $.post('json/end-tour');
}
@@ -69,5 +67,4 @@ function putData(data) {
function failData() {
"use strict";
- console.log('Failed to get box!');
}
\ No newline at end of file
diff --git a/public/js/ff/piggy-banks/index.js b/public/js/ff/piggy-banks/index.js
index 486f93d41e..70630ad6d5 100644
--- a/public/js/ff/piggy-banks/index.js
+++ b/public/js/ff/piggy-banks/index.js
@@ -78,7 +78,7 @@ function stopSorting() {
var id = holder.data('id');
order.push(id);
});
- $.post('piggy-banks/sort', {_token: token, order: order}).done(function () {
+ $.post('piggy-banks/sort', {order: order}).done(function () {
$('.loadSpin').removeClass('fa fa-refresh fa-spin');
});
}
\ No newline at end of file
diff --git a/public/js/ff/reports/audit/all.js b/public/js/ff/reports/audit/all.js
index 2c58e0ac54..dc28051a29 100644
--- a/public/js/ff/reports/audit/all.js
+++ b/public/js/ff/reports/audit/all.js
@@ -18,7 +18,6 @@ $(function () {
arr.forEach(function (val) {
$('input[type="checkbox"][value="' + val + '"]').prop('checked', true);
});
- console.log('arr from cookie is ' + arr)
} else {
// no cookie? read list, store in array 'arr'
// all account ids:
@@ -45,7 +44,6 @@ function clickColumnOption() {
function storeCheckboxes(checkboxes) {
"use strict";
// store new cookie with those options:
- console.log('Store new cookie with those options: ' + checkboxes);
createCookie('audit-option-checkbox', checkboxes, 365);
}
@@ -59,7 +57,6 @@ function readCheckboxes() {
checkboxes.push(c.val());
}
});
- console.log('arr is now (default): ' + checkboxes);
return checkboxes;
}
@@ -69,11 +66,9 @@ function showOnlyColumns(checkboxes) {
for (var i = 0; i < hideable.length; i++) {
var opt = hideable[i];
if(checkboxes.indexOf(opt) > -1) {
- console.log(opt + ' is in checkboxes');
$('td.hide-' + opt).show();
$('th.hide-' + opt).show();
} else {
- console.log(opt + ' is NOT in checkboxes');
$('th.hide-' + opt).hide();
$('td.hide-' + opt).hide();
}
diff --git a/public/js/ff/reports/budget/month.js b/public/js/ff/reports/budget/month.js
index c103e00dff..c7aad72832 100644
--- a/public/js/ff/reports/budget/month.js
+++ b/public/js/ff/reports/budget/month.js
@@ -47,7 +47,6 @@ function redrawPieChart(container, uri) {
others = '1';
}
uri = uri.replace('OTHERS', others);
- console.log('URI for ' + container + ' is ' + uri);
pieChart(uri, container);
diff --git a/public/js/ff/reports/category/month.js b/public/js/ff/reports/category/month.js
index 607d635205..d8ba767acd 100644
--- a/public/js/ff/reports/category/month.js
+++ b/public/js/ff/reports/category/month.js
@@ -57,7 +57,6 @@ function redrawPieChart(container, uri) {
others = '1';
}
uri = uri.replace('OTHERS', others);
- console.log('URI for ' + container + ' is ' + uri);
pieChart(uri, container);
diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.js
index b5e4bf970e..351b4b30bf 100644
--- a/public/js/ff/reports/default/all.js
+++ b/public/js/ff/reports/default/all.js
@@ -62,7 +62,6 @@ function respondInfoButton(data) {
function loadAjaxPartial(holder, uri) {
"use strict";
- console.log('Going to grab URI ' + uri);
$.get(uri).done(function (data) {
displayAjaxPartial(data, holder);
}).fail(function () {
@@ -72,7 +71,6 @@ function loadAjaxPartial(holder, uri) {
function displayAjaxPartial(data, holder) {
"use strict";
- console.log('Display stuff in ' + holder);
var obj = $('#' + holder);
obj.removeClass('loading').html(data);
@@ -98,7 +96,6 @@ function displayAjaxPartial(data, holder) {
function failAjaxPartial(uri, holder) {
"use strict";
- console.log('Failed to load: ' + uri);
$('#' + holder).removeClass('loading').addClass('general-chart-error');
}
diff --git a/public/js/ff/reports/index.js b/public/js/ff/reports/index.js
index f146d78bf3..5033aecef0 100644
--- a/public/js/ff/reports/index.js
+++ b/public/js/ff/reports/index.js
@@ -26,7 +26,6 @@ $(function () {
// set values from cookies, if any:
if (!(readCookie('report-type') === null)) {
- console.log(readCookie('report-type'));
$('select[name="report_type"]').val(readCookie('report-type'));
}
@@ -61,7 +60,6 @@ function getReportOptions() {
var reportType = $('select[name="report_type"]').val();
$('#extra-options').empty();
$('#extra-options').addClass('loading');
- console.log('Changed report type to ' + reportType);
$.getJSON('reports/options/' + reportType, function (data) {
$('#extra-options').removeClass('loading').html(data.html);
diff --git a/public/js/ff/rules/create-edit.js b/public/js/ff/rules/create-edit.js
index 98b77e9b4d..889777d7bf 100644
--- a/public/js/ff/rules/create-edit.js
+++ b/public/js/ff/rules/create-edit.js
@@ -11,12 +11,6 @@
var triggerCount = 0;
var actionCount = 0;
-$(function () {
- "use strict";
- console.log('edit-create');
-});
-
-
function addNewTrigger() {
"use strict";
triggerCount++;
@@ -41,7 +35,6 @@ function addNewAction() {
actionCount++;
$.getJSON('json/action', {count: actionCount}).done(function (data) {
- //console.log(data.html);
$('tbody.rule-action-tbody').append(data.html);
// add action things.
diff --git a/public/js/ff/rules/create.js b/public/js/ff/rules/create.js
index 1ad133f9d7..739762d228 100644
--- a/public/js/ff/rules/create.js
+++ b/public/js/ff/rules/create.js
@@ -10,7 +10,6 @@
$(function () {
"use strict";
- console.log("create");
if (triggerCount === 0) {
addNewTrigger();
}
diff --git a/public/js/ff/rules/edit.js b/public/js/ff/rules/edit.js
index 16191e2ae8..7ff822a186 100644
--- a/public/js/ff/rules/edit.js
+++ b/public/js/ff/rules/edit.js
@@ -10,8 +10,6 @@
$(function () {
"use strict";
- console.log("edit");
-
if (triggerCount === 0) {
addNewTrigger();
}
diff --git a/public/js/ff/rules/index.js b/public/js/ff/rules/index.js
index c8642209e2..b9b4045b5c 100644
--- a/public/js/ff/rules/index.js
+++ b/public/js/ff/rules/index.js
@@ -48,7 +48,6 @@ function sortStop(event, ui) {
var ruleId = current.parent().data('id');
var entries = [];
// who am i?
- console.log('Rule: #' + current.parent().data('id'));
$.each(parent.children(), function (i, v) {
var trigger = $(v);
@@ -58,11 +57,11 @@ function sortStop(event, ui) {
});
if (parent.hasClass('rule-triggers')) {
- $.post('rules/trigger/order/' + ruleId, {_token: token, triggers: entries}).fail(function () {
+ $.post('rules/trigger/order/' + ruleId, {triggers: entries}).fail(function () {
alert('Could not re-order rule triggers. Please refresh the page.');
});
} else {
- $.post('rules/action/order/' + ruleId, {_token: token, actions: entries}).fail(function () {
+ $.post('rules/action/order/' + ruleId, {actions: entries}).fail(function () {
alert('Could not re-order rule actions. Please refresh the page.');
});
diff --git a/public/js/ff/split/journal/from-store.js b/public/js/ff/split/journal/from-store.js
index ef3480f827..03ceb49ba5 100644
--- a/public/js/ff/split/journal/from-store.js
+++ b/public/js/ff/split/journal/from-store.js
@@ -18,19 +18,16 @@ $(function () {
$.getJSON('json/expense-accounts').done(function (data) {
destAccounts = data;
- console.log('destAccounts length is now ' + destAccounts.length);
$('input[name$="destination_account_name]"]').typeahead({source: destAccounts});
});
$.getJSON('json/revenue-accounts').done(function (data) {
srcAccounts = data;
- console.log('srcAccounts length is now ' + srcAccounts.length);
$('input[name$="source_account_name]"]').typeahead({source: srcAccounts});
});
$.getJSON('json/categories').done(function (data) {
categories = data;
- console.log('categories length is now ' + categories.length);
$('input[name$="category]"]').typeahead({source: categories});
});
@@ -45,12 +42,10 @@ function removeRow(e) {
"use strict";
var rows = $('table.split-table tbody tr');
if (rows.length === 1) {
- console.log('Will not remove last split');
return false;
}
var row = $(e.target);
var index = row.data('split');
- console.log('Trying to remove row with split ' + index);
$('table.split-table tbody tr[data-split="' + index + '"]').remove();
@@ -70,16 +65,13 @@ function cloneRow() {
source.find('input[name$="][amount]"]').val("").on('input', calculateSum);
if (destAccounts.length > 0) {
- console.log('Will be able to extend dest-accounts.');
source.find('input[name$="destination_account_name]"]').typeahead({source: destAccounts});
}
if (destAccounts.length > 0) {
- console.log('Will be able to extend src-accounts.');
source.find('input[name$="source_account_name]"]').typeahead({source: srcAccounts});
}
if (categories.length > 0) {
- console.log('Will be able to extend categories.');
source.find('input[name$="category]"]').typeahead({source: categories});
}
@@ -103,7 +95,6 @@ function resetSplits() {
$.each($('table.split-table tbody tr'), function (i, v) {
var row = $(v);
row.attr('data-split', i);
- console.log('Row is now ' + row.data('split'));
});
// loop each remove button, update the index
@@ -111,7 +102,6 @@ function resetSplits() {
var button = $(v);
button.attr('data-split', i);
button.find('i').attr('data-split', i);
- console.log('Remove button index is now ' + button.data('split'));
});
@@ -120,7 +110,6 @@ function resetSplits() {
var cell = $(v);
var index = i + 1;
cell.text('#' + index);
- console.log('Cell is now ' + cell.text());
});
// loop each possible field.
@@ -129,37 +118,31 @@ function resetSplits() {
$.each($('input[name$="][description]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][description]');
- console.log('description is now ' + input.attr('name'));
});
// ends with ][destination_account_name]
$.each($('input[name$="][destination_account_name]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][destination_account_name]');
- console.log('destination_account_name is now ' + input.attr('name'));
});
// ends with ][source_account_name]
$.each($('input[name$="][source_account_name]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][source_account_name]');
- console.log('source_account_name is now ' + input.attr('name'));
});
// ends with ][amount]
$.each($('input[name$="][amount]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][amount]');
- console.log('amount is now ' + input.attr('name'));
});
// ends with ][budget_id]
$.each($('select[name$="][budget_id]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][budget_id]');
- console.log('budget_id is now ' + input.attr('name'));
});
// ends with ][category]
$.each($('input[name$="][category]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transactions[' + i + '][category]');
- console.log('category is now ' + input.attr('name'));
});
}
@@ -173,10 +156,8 @@ function calculateSum() {
}
sum = Math.round(sum * 100) / 100;
- console.log("Sum is now " + sum);
$('.amount-warning').remove();
if (sum != originalSum) {
- console.log(sum + ' does not match ' + originalSum);
var holder = $('#journal_amount_holder');
var par = holder.find('p.form-control-static');
var amount = $('').text(' (' + accounting.formatMoney(sum) + ')').addClass('text-danger amount-warning').appendTo(par);
diff --git a/public/js/ff/transactions/create.js b/public/js/ff/transactions/create.js
index e059fdf127..c2e38f6b6d 100644
--- a/public/js/ff/transactions/create.js
+++ b/public/js/ff/transactions/create.js
@@ -111,7 +111,6 @@ function updateButtons() {
if (button.data('what') == what) {
button.removeClass('btn-default').addClass('btn-info').html(' ' + txt[button.data('what')]);
- console.log('Now displaying form for ' + what);
} else {
button.removeClass('btn-info').addClass('btn-default').text(txt[button.data('what')]);
}
diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twig
index 0295b5059c..aff6f9491d 100644
--- a/resources/views/layout/default.twig
+++ b/resources/views/layout/default.twig
@@ -3,6 +3,7 @@
+