Replace uri with url

This commit is contained in:
James Cole
2022-04-12 18:19:30 +02:00
parent ac5c11a8d7
commit 50f87a210a
101 changed files with 449 additions and 486 deletions

View File

@@ -18,8 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: overviewUri, transactionsUri, indexUri,accounting */
var balanceDifference = 0;
var difference = 0;
var selectedAmount = 0;
@@ -142,10 +140,10 @@ function storeReconcile() {
journals: ids,
cleared: cleared,
};
var uri = overviewUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
var url = overviewUrl.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
$.getJSON(uri, variables).done(function (data) {
$.getJSON(url, variables).done(function (data) {
$('#defaultModal').empty().html(data.html).modal('show');
});
}
@@ -197,11 +195,11 @@ function getTransactionsForRange() {
console.log('in getTransactionsForRange()');
// clear out the box:
$('#transactions_holder').empty().append($('<p>').addClass('text-center').html('<span class="fa fa-fw fa-spin fa-spinner"></span>'));
var uri = transactionsUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
var index = indexUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
var url = transactionsUrl.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
var index = indexUrl.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());
window.history.pushState('object or string', "Reconcile account", index);
$.getJSON(uri).done(placeTransactions).catch(exceptionHandling)
$.getJSON(url).done(placeTransactions).catch(exceptionHandling)
}
function exceptionHandling() {
$('#transactions_holder').empty().append($('<p>').addClass('text-center lead').html(selectRangeAndBalance));

View File

@@ -18,8 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: chartUri, incomeCategoryUri, showAll, expenseCategoryUri, expenseBudgetUri, token */
var fixHelper = function (e, tr) {
"use strict";
var $originals = tr.children();
@@ -33,12 +31,12 @@ var fixHelper = function (e, tr) {
$(function () {
"use strict";
//lineChart(chartUri, 'overview-chart');
lineNoStartZeroChart(chartUri, 'overview-chart');
//lineChart(chartUrl, 'overview-chart');
lineNoStartZeroChart(chartUrl, 'overview-chart');
if (!showAll) {
multiCurrencyPieChart(incomeCategoryUri, 'account-cat-in');
multiCurrencyPieChart(expenseCategoryUri, 'account-cat-out');
multiCurrencyPieChart(expenseBudgetUri, 'account-budget-out');
multiCurrencyPieChart(incomeCategoryUrl, 'account-cat-in');
multiCurrencyPieChart(expenseCategoryUrl, 'account-cat-out');
multiCurrencyPieChart(expenseBudgetUrl, 'account-budget-out');
}
// sortable!

View File

@@ -18,8 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: updateCheckUri */
$(function () {
"use strict";

View File

@@ -18,11 +18,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: billUri */
$(function () {
"use strict";
configAccounting(billCurrencySymbol);
columnChart(billUri, 'bill-overview');
columnChart(billUrl, 'bill-overview');
}
);

View File

@@ -44,8 +44,8 @@ $(function () {
$('.selectPeriod').change(function (e) {
var selected = $(e.currentTarget);
if (selected.find(":selected").val() !== "x") {
var newUri = budgetIndexUri.replace("START", selected.find(":selected").data('start')).replace('END', selected.find(":selected").data('end'));
window.location.assign(newUri);
var newUrl = budgetIndexUrl.replace("START", selected.find(":selected").data('start')).replace('END', selected.find(":selected").data('end'));
window.location.assign(newUrl);
}
});
@@ -85,7 +85,7 @@ function updateBudgetedAmount(e) {
var currencyId = parseInt(input.data('currency'));
input.prop('disabled', true);
if (0 === budgetLimitId) {
$.post(storeBudgetLimitUri, {
$.post(storeBudgetLimitUrl, {
_token: token,
budget_id: budgetId,
transaction_currency_id: currencyId,
@@ -108,7 +108,7 @@ function updateBudgetedAmount(e) {
console.error('I failed :(');
});
} else {
$.post(updateBudgetLimitUri.replace('REPLACEME', budgetLimitId.toString()), {
$.post(updateBudgetLimitUrl.replace('REPLACEME', budgetLimitId.toString()), {
_token: token,
amount: input.val(),
}).done(function (data) {
@@ -134,7 +134,7 @@ function updateTotalBudgetedAmount(currencyId) {
});
// get new amount:
$.get(totalBudgetedUri.replace('REPLACEME', currencyId)).done(function (data) {
$.get(totalBudgetedUrl.replace('REPLACEME', currencyId)).done(function (data) {
// set thing:
$('span.budgeted_amount[data-currency="' + currencyId + '"]')
.html(data.budgeted_formatted)
@@ -201,7 +201,7 @@ function sortStop(event, ui) {
function createBudgetLimit(e) {
var button = $(e.currentTarget);
var budgetId = button.data('id');
$('#defaultModal').empty().load(createBudgetLimitUri.replace('REPLACEME', budgetId.toString()), function () {
$('#defaultModal').empty().load(createBudgetLimitUrl.replace('REPLACEME', budgetId.toString()), function () {
$('#defaultModal').modal('show');
});
return false;
@@ -220,7 +220,7 @@ function deleteBudgetLimit(e) {
}
function createAltAvailableBudget(e) {
$('#defaultModal').empty().load(createAltAvailableBudgetUri, function () {
$('#defaultModal').empty().load(createAltAvailableBudgetUrl, function () {
$('#defaultModal').modal('show');
});
return false;
@@ -230,13 +230,13 @@ function updateAvailableBudget(e) {
var button = $(e.currentTarget);
var abId = parseInt(button.data('id'));
if (0 === abId) {
$('#defaultModal').empty().load(createAvailableBudgetUri, function () {
$('#defaultModal').empty().load(createAvailableBudgetUrl, function () {
$('#defaultModal').modal('show');
});
}
if (abId > 0) {
// edit URL.
$('#defaultModal').empty().load(editAvailableBudgetUri.replace('REPLACEME', abId), function () {
$('#defaultModal').empty().load(editAvailableBudgetUrl.replace('REPLACEME', abId), function () {
$('#defaultModal').modal('show');
});
}

View File

@@ -18,20 +18,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: budgetChartUri, expenseCategoryUri, expenseAssetUri, expenseExpenseUri, budgetLimitID */
$(function () {
"use strict";
if (budgetLimitID > 0) {
otherCurrencyLineChart(budgetChartUri, 'budgetOverview', currencySymbol);
multiCurrencyPieChart(expenseCategoryUri, 'budget-cat-out');
multiCurrencyPieChart(expenseAssetUri, 'budget-asset-out');
multiCurrencyPieChart(expenseExpenseUri, 'budget-expense-out');
otherCurrencyLineChart(budgetChartUrl, 'budgetOverview', currencySymbol);
multiCurrencyPieChart(expenseCategoryUrl, 'budget-cat-out');
multiCurrencyPieChart(expenseAssetUrl, 'budget-asset-out');
multiCurrencyPieChart(expenseExpenseUrl, 'budget-expense-out');
}
if (budgetLimitID === 0) {
columnChart(budgetChartUri, 'budgetOverview');
multiCurrencyPieChart(expenseCategoryUri, 'budget-cat-out');
multiCurrencyPieChart(expenseAssetUri, 'budget-asset-out');
multiCurrencyPieChart(expenseExpenseUri, 'budget-expense-out');
columnChart(budgetChartUrl, 'budgetOverview');
multiCurrencyPieChart(expenseCategoryUrl, 'budget-cat-out');
multiCurrencyPieChart(expenseAssetUrl, 'budget-asset-out');
multiCurrencyPieChart(expenseExpenseUrl, 'budget-expense-out');
}
});

View File

@@ -76,25 +76,25 @@ function colorizeData(data) {
/**
* Function to draw a line chart:
* @param URI
* @param URL
* @param container
*/
function lineChart(URI, container) {
function lineChart(URL, container) {
"use strict";
var colorData = true;
var options = $.extend(true, {}, defaultChartOptions);
var chartType = 'line';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
* Function to draw a line chart that doesn't start at ZERO.
* @param URI
* @param URL
* @param container
*/
function lineNoStartZeroChart(URI, container) {
function lineNoStartZeroChart(URL, container) {
"use strict";
var colorData = true;
@@ -102,16 +102,16 @@ function lineNoStartZeroChart(URI, container) {
var chartType = 'line';
options.scales.yAxes[0].ticks.beginAtZero = false;
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
* Overrules the currency the line chart is drawn in.
*
* @param URI
* @param URL
* @param container
*/
function otherCurrencyLineChart(URI, container, currencySymbol) {
function otherCurrencyLineChart(URL, container, currencySymbol) {
"use strict";
var colorData = true;
@@ -153,16 +153,16 @@ function otherCurrencyLineChart(URI, container, currencySymbol) {
console.log(options);
var chartType = 'line';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
* Function to draw a chart with double Y Axes and stacked columns.
*
* @param URI
* @param URL
* @param container
*/
function doubleYChart(URI, container) {
function doubleYChart(URL, container) {
"use strict";
var colorData = true;
@@ -203,16 +203,16 @@ function doubleYChart(URI, container) {
var chartType = 'bar';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
* Function to draw a chart with double Y Axes and non stacked columns.
*
* @param URI
* @param URL
* @param container
*/
function doubleYNonStackedChart(URI, container) {
function doubleYNonStackedChart(URL, container) {
"use strict";
var colorData = true;
@@ -250,47 +250,47 @@ function doubleYNonStackedChart(URI, container) {
];
var chartType = 'bar';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
*
* @param URI
* @param URL
* @param container
*/
function columnChart(URI, container) {
function columnChart(URL, container) {
"use strict";
var colorData = true;
var options = $.extend(true, {}, defaultChartOptions);
var chartType = 'bar';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
*
* @param URI
* @param URL
* @param container
*/
function columnChartCustomColours(URI, container) {
function columnChartCustomColours(URL, container) {
"use strict";
var colorData = false;
var options = $.extend(true, {}, defaultChartOptions);
var chartType = 'bar';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
*
* @param URI
* @param URL
* @param container
*/
function stackedColumnChart(URI, container) {
function stackedColumnChart(URL, container) {
"use strict";
var colorData = true;
@@ -302,60 +302,60 @@ function stackedColumnChart(URI, container) {
var chartType = 'bar';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
*
* @param URI
* @param URL
* @param container
*/
function pieChart(URI, container) {
function pieChart(URL, container) {
"use strict";
var colorData = false;
var options = $.extend(true, {}, defaultPieOptions);
var chartType = 'pie';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
*
* @param URI
* @param URL
* @param container
*/
function multiCurrencyPieChart(URI, container) {
function multiCurrencyPieChart(URL, container) {
"use strict";
var colorData = false;
var options = $.extend(true, {}, pieOptionsWithCurrency);
var chartType = 'pie';
drawAChart(URI, container, chartType, options, colorData);
drawAChart(URL, container, chartType, options, colorData);
}
/**
* @param URI
* @param URL
* @param container
* @param chartType
* @param options
* @param colorData
* @param today
*/
function drawAChart(URI, container, chartType, options, colorData) {
function drawAChart(URL, container, chartType, options, colorData) {
var containerObj = $('#' + container);
if (containerObj.length === 0) {
return;
}
$.getJSON(URI).done(function (data) {
$.getJSON(URL).done(function (data) {
containerObj.removeClass('general-chart-error');
// if result is empty array, or the labels array is empty, show error.
// console.log(URI);
// console.log(URL);
// console.log(data.length);
// console.log(typeof data.labels);
// console.log(data.labels.length);

View File

@@ -69,7 +69,7 @@ $(function () {
function (start, end, label) {
// send post.
$.post(dateRangeMeta.uri, {
$.post(dateRangeMeta.url, {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
label: label,

View File

@@ -18,7 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: accountFrontpageUri, today, piggyInfoUri, token, billCount, accountExpenseUri, accountRevenueUri */
$(function () {
"use strict";
@@ -29,15 +28,15 @@ $(function () {
function drawChart() {
"use strict";
lineChart(accountFrontpageUri, 'accounts-chart');
lineChart(accountFrontpageUrl, 'accounts-chart');
if (billCount > 0) {
multiCurrencyPieChart('chart/bill/frontpage', 'bills-chart');
}
stackedColumnChart('chart/budget/frontpage', 'budgets-chart');
columnChart('chart/category/frontpage', 'categories-chart');
columnChart(accountExpenseUri, 'expense-accounts-chart');
columnChart(accountRevenueUri, 'revenue-accounts-chart');
columnChart(accountExpenseUrl, 'expense-accounts-chart');
columnChart(accountRevenueUrl, 'revenue-accounts-chart');
// get balance box:
getBalanceBox();
@@ -53,7 +52,7 @@ function drawChart() {
*
*/
function getPiggyBanks() {
$.getJSON(piggyInfoUri).done(function (data) {
$.getJSON(piggyInfoUrl).done(function (data) {
if (data.html.length > 0) {
$('#piggy_bank_overview').html(data.html);
}

View File

@@ -34,7 +34,7 @@ function startRunningCommands() {
}
function runCommand(index) {
$.post(runCommandUri, {_token: token, index: index}).done(function (data) {
$.post(runCommandUrl, {_token: token, index: index}).done(function (data) {
if (data.error === false) {
// increase index
index++;
@@ -60,7 +60,7 @@ function runCommand(index) {
function startMigration() {
$.post(migrateUri, {_token: token}).done(function (data) {
$.post(migrateUrl, {_token: token}).done(function (data) {
if (data.error === false) {
// move to decrypt routine.
startDecryption();
@@ -75,7 +75,7 @@ function startMigration() {
function startDecryption() {
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Setting up DB #2...');
$.post(decryptUri, {_token: token}).done(function (data) {
$.post(decryptUrl, {_token: token}).done(function (data) {
if (data.error === false) {
// move to decrypt routine.
startPassport();
@@ -93,7 +93,7 @@ function startDecryption() {
*/
function startPassport() {
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Setting up OAuth2...');
$.post(keysUri, {_token: token}).done(function (data) {
$.post(keysUrl, {_token: token}).done(function (data) {
if (data.error === false) {
startUpgrade();
} else {
@@ -110,7 +110,7 @@ function startPassport() {
*/
function startUpgrade() {
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Upgrading database...');
$.post(upgradeUri, {_token: token}).done(function (data) {
$.post(upgradeUrl, {_token: token}).done(function (data) {
if (data.error === false) {
startVerify();
} else {
@@ -126,7 +126,7 @@ function startUpgrade() {
*/
function startVerify() {
$('#status-box').html('<span class="fa fa-spin fa-spinner"></span> Verify database integrity...');
$.post(verifyUri, {_token: token}).done(function (data) {
$.post(verifyUrl, {_token: token}).done(function (data) {
if (data.error === false) {
completeDone();
} else {
@@ -143,7 +143,7 @@ function startVerify() {
function completeDone() {
$('#status-box').html('<span class="fa fa-thumbs-up"></span> Installation + upgrade complete! Wait to be redirected...');
setTimeout(function () {
window.location = homeUri;
window.location = homeUrl;
}, 3000);
}

View File

@@ -18,11 +18,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: nextLabel, prevLabel,skipLabel,doneLabel routeForTour, token, routeStepsUri, routeForFinishedTour, forceDemoOff */
$(function () {
"use strict";
if (!forceDemoOff) {
$.getJSON(routeStepsUri).done(setupIntro)
$.getJSON(routeStepsUrl).done(setupIntro)
}
});

View File

@@ -65,19 +65,19 @@ $(document).ready(function () {
function showRepCalendar() {
// pre-append URL with repetition info:
var newEventsUri = eventsUri + '?type=' + $('#ffInput_repetition_type').val();
newEventsUri += '&skip=' + $('#ffInput_skip').val();
newEventsUri += '&ends=' + $('#ffInput_repetition_end').val();
newEventsUri += '&end_date=' + $('#ffInput_repeat_until').val();
newEventsUri += '&reps=' + $('#ffInput_repetitions').val();
newEventsUri += '&first_date=' + $('#ffInput_first_date').val();
newEventsUri += '&weekend=' + $('#ffInput_weekend').val();
var newEventsUrl = eventsUrl + '?type=' + $('#ffInput_repetition_type').val();
newEventsUrl += '&skip=' + $('#ffInput_skip').val();
newEventsUrl += '&ends=' + $('#ffInput_repetition_end').val();
newEventsUrl += '&end_date=' + $('#ffInput_repeat_until').val();
newEventsUrl += '&reps=' + $('#ffInput_repetitions').val();
newEventsUrl += '&first_date=' + $('#ffInput_first_date').val();
newEventsUrl += '&weekend=' + $('#ffInput_weekend').val();
// remove all event sources from calendar:
calendar.fullCalendar('removeEventSources');
// add a new one:
calendar.fullCalendar('addEventSource', newEventsUri);
calendar.fullCalendar('addEventSource', newEventsUrl);
$('#calendarModal').modal('show');
return false;
@@ -116,7 +116,7 @@ function respondToFirstDateChange() {
preSelected = select.val();
}
$.getJSON(suggestUri, {date: date,pre_select: preSelected}).fail(function () {
$.getJSON(suggestUrl, {date: date,pre_select: preSelected}).fail(function () {
console.error('Could not load repetition suggestions');
alert('Could not load repetition suggestions');
}).done(parseRepetitionSuggestions);

View File

@@ -65,19 +65,19 @@ $(document).ready(function () {
function showRepCalendar() {
// pre-append URL with repetition info:
var newEventsUri = eventsUri + '?type=' + $('#ffInput_repetition_type').val();
newEventsUri += '&skip=' + $('#ffInput_skip').val();
newEventsUri += '&ends=' + $('#ffInput_repetition_end').val();
newEventsUri += '&end_date=' + $('#ffInput_repeat_until').val();
newEventsUri += '&reps=' + $('#ffInput_repetitions').val();
newEventsUri += '&first_date=' + $('#ffInput_first_date').val();
newEventsUri += '&weekend=' + $('#ffInput_weekend').val();
var newEventsUrl = eventsUrl + '?type=' + $('#ffInput_repetition_type').val();
newEventsUrl += '&skip=' + $('#ffInput_skip').val();
newEventsUrl += '&ends=' + $('#ffInput_repetition_end').val();
newEventsUrl += '&end_date=' + $('#ffInput_repeat_until').val();
newEventsUrl += '&reps=' + $('#ffInput_repetitions').val();
newEventsUrl += '&first_date=' + $('#ffInput_first_date').val();
newEventsUrl += '&weekend=' + $('#ffInput_weekend').val();
// remove all event sources from calendar:
calendar.fullCalendar('removeEventSources');
// add a new one:
calendar.fullCalendar('addEventSource', newEventsUri);
calendar.fullCalendar('addEventSource', newEventsUrl);
$('#calendarModal').modal('show');
return false;
@@ -117,7 +117,7 @@ function respondToFirstDateChange() {
preSelected = select.val();
}
$.getJSON(suggestUri, {date: date, pre_select: preSelected, past: true}).fail(function () {
$.getJSON(suggestUrl, {date: date, pre_select: preSelected, past: true}).fail(function () {
console.error('Could not load repetition suggestions');
alert('Could not load repetition suggestions');
}).done(parseRepetitionSuggestions);

View File

@@ -18,16 +18,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: startDate, endDate, accountIds */
function loadAjaxPartial(holder, uri) {
function loadAjaxPartial(holder, url) {
"use strict";
$.get(uri).done(function (data) {
$.get(url).done(function (data) {
displayAjaxPartial(data, holder);
}).fail(function () {
failAjaxPartial(uri, holder);
failAjaxPartial(url, holder);
});
}
function failAjaxPartial(uri, holder) {
function failAjaxPartial(url, holder) {
"use strict";
var holderObject = $('#' + holder);
holderObject.parent().find('.overlay').remove();

View File

@@ -22,12 +22,12 @@ $(function () {
"use strict";
drawChart();
loadAjaxPartial('accountsHolder', accountsUri);
loadAjaxPartial('budgetsHolder', budgetsUri);
loadAjaxPartial('accountPerbudgetHolder', accountPerBudgetUri);
loadAjaxPartial('accountsHolder', accountsUrl);
loadAjaxPartial('budgetsHolder', budgetsUrl);
loadAjaxPartial('accountPerbudgetHolder', accountPerBudgetUrl);
loadAjaxPartial('topExpensesHolder', topExpensesUri);
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
loadAjaxPartial('topExpensesHolder', topExpensesUrl);
loadAjaxPartial('avgExpensesHolder', avgExpensesUrl);
});
@@ -42,15 +42,15 @@ function drawChart() {
});
// draw pie chart of income, depending on "show other transactions too":
redrawPieChart('budgets-out-pie-chart', budgetExpenseUri);
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
redrawPieChart('source-accounts-pie-chart', sourceExpenseUri);
redrawPieChart('dest-accounts-pie-chart', destinationExpenseUri);
redrawPieChart('budgets-out-pie-chart', budgetExpenseUrl);
redrawPieChart('categories-out-pie-chart', categoryExpenseUrl);
redrawPieChart('source-accounts-pie-chart', sourceExpenseUrl);
redrawPieChart('dest-accounts-pie-chart', destinationExpenseUrl);
}
function redrawPieChart(container, uri) {
function redrawPieChart(container, url) {
"use strict";
multiCurrencyPieChart(uri, container);
multiCurrencyPieChart(url, container);
}

View File

@@ -20,26 +20,26 @@
$(function () {
"use strict";
loadAjaxPartial('accountsHolder', accountsUri);
loadAjaxPartial('categoriesHolder', categoriesUri);
loadAjaxPartial('accountPerCategoryHolder', accountPerCategoryUri);
loadAjaxPartial('accountsHolder', accountsUrl);
loadAjaxPartial('categoriesHolder', categoriesUrl);
loadAjaxPartial('accountPerCategoryHolder', accountPerCategoryUrl);
$.each($('.main_category_canvas'), function (i, v) {
var canvas = $(v);
columnChart(canvas.data('url'), canvas.attr('id'));
});
multiCurrencyPieChart(categoryOutUri, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUri, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUri, 'budgets-out-pie-chart');
multiCurrencyPieChart(sourceOutUri, 'source-out-pie-chart');
multiCurrencyPieChart(sourceInUri, 'source-in-pie-chart');
multiCurrencyPieChart(destOutUri, 'dest-out-pie-chart');
multiCurrencyPieChart(destInUri, 'dest-in-pie-chart');
multiCurrencyPieChart(categoryOutUrl, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUrl, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUrl, 'budgets-out-pie-chart');
multiCurrencyPieChart(sourceOutUrl, 'source-out-pie-chart');
multiCurrencyPieChart(sourceInUrl, 'source-in-pie-chart');
multiCurrencyPieChart(destOutUrl, 'dest-out-pie-chart');
multiCurrencyPieChart(destInUrl, 'dest-in-pie-chart');
loadAjaxPartial('topExpensesHolder', topExpensesUri);
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
loadAjaxPartial('topIncomeHolder', topIncomeUri);
loadAjaxPartial('avgIncomeHolder', avgIncomeUri);
loadAjaxPartial('topExpensesHolder', topExpensesUrl);
loadAjaxPartial('avgExpensesHolder', avgExpensesUrl);
loadAjaxPartial('topIncomeHolder', topIncomeUrl);
loadAjaxPartial('avgIncomeHolder', avgIncomeUrl);
});

View File

@@ -18,19 +18,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: accountReportUri, incomeReportUri, expenseReportUri, incExpReportUri, startDate, endDate, accountIds */
$(function () {
"use strict";
// load the account report, which this report shows:
loadAjaxPartial('accountReport', accountReportUri);
loadAjaxPartial('accountReport', accountReportUrl);
// load income and expense reports:
loadAjaxPartial('incomeReport', incomeReportUri);
loadAjaxPartial('expenseReport', expenseReportUri);
loadAjaxPartial('incomeVsExpenseReport', incExpReportUri);
loadAjaxPartial('billReport', billReportUri);
loadAjaxPartial('incomeReport', incomeReportUrl);
loadAjaxPartial('expenseReport', expenseReportUrl);
loadAjaxPartial('incomeVsExpenseReport', incExpReportUrl);
loadAjaxPartial('billReport', billReportUrl);
});

View File

@@ -18,14 +18,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: categoryReportUri, budgetReportUri, balanceReportUri, accountChartUri */
$(function () {
"use strict";
lineChart(accountChartUri, 'account-balances-chart');
lineChart(accountChartUrl, 'account-balances-chart');
loadAjaxPartial('categoryReport', categoryReportUri);
loadAjaxPartial('budgetReport', budgetReportUri);
loadAjaxPartial('balanceReport', balanceReportUri);
loadAjaxPartial('categoryReport', categoryReportUrl);
loadAjaxPartial('budgetReport', budgetReportUrl);
loadAjaxPartial('balanceReport', balanceReportUrl);
});

View File

@@ -18,15 +18,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: budgetPeriodReportUri, categoryExpenseUri, categoryIncomeUri, netWorthUri, opChartUri */
$(function () {
"use strict";
lineChart(netWorthUri, 'net-worth');
columnChartCustomColours(opChartUri, 'income-expenses-chart');
lineChart(netWorthUrl, 'net-worth');
columnChartCustomColours(opChartUrl, 'income-expenses-chart');
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
loadAjaxPartial('categoryExpense', categoryExpenseUri);
loadAjaxPartial('categoryIncome', categoryIncomeUri);
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUrl);
loadAjaxPartial('categoryExpense', categoryExpenseUrl);
loadAjaxPartial('categoryIncome', categoryIncomeUrl);
});

View File

@@ -18,15 +18,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: budgetPeriodReportUri, categoryExpenseUri, categoryIncomeUri, netWorthUri, opChartUri */
$(function () {
"use strict";
lineChart(netWorthUri, 'net-worth');
columnChartCustomColours(opChartUri, 'income-expenses-chart');
lineChart(netWorthUrl, 'net-worth');
columnChartCustomColours(opChartUrl, 'income-expenses-chart');
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
loadAjaxPartial('categoryExpense', categoryExpenseUri);
loadAjaxPartial('categoryIncome', categoryIncomeUri);
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUrl);
loadAjaxPartial('categoryExpense', categoryExpenseUrl);
loadAjaxPartial('categoryIncome', categoryIncomeUrl);
});

View File

@@ -20,24 +20,24 @@
$(function () {
"use strict";
loadAjaxPartial('opsAccounts', opsAccountsUri);
loadAjaxPartial('opsAccountsAsset', opsAccountsAssetUri);
loadAjaxPartial('opsAccounts', opsAccountsUrl);
loadAjaxPartial('opsAccountsAsset', opsAccountsAssetUrl);
multiCurrencyPieChart(categoryOutUri, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUri, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUri, 'budgets-out-pie-chart');
multiCurrencyPieChart(tagOutUri, 'tag-out-pie-chart');
multiCurrencyPieChart(tagInUri, 'tag-in-pie-chart');
multiCurrencyPieChart(categoryOutUrl, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUrl, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUrl, 'budgets-out-pie-chart');
multiCurrencyPieChart(tagOutUrl, 'tag-out-pie-chart');
multiCurrencyPieChart(tagInUrl, 'tag-in-pie-chart');
$.each($('.main_double_canvas'), function (i, v) {
var canvas = $(v);
columnChart(canvas.data('url'), canvas.attr('id'));
});
loadAjaxPartial('topExpensesHolder', topExpensesUri);
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
loadAjaxPartial('topIncomeHolder', topIncomeUri);
loadAjaxPartial('avgIncomeHolder', avgIncomeUri);
loadAjaxPartial('topExpensesHolder', topExpensesUrl);
loadAjaxPartial('avgExpensesHolder', avgExpensesUrl);
loadAjaxPartial('topIncomeHolder', topIncomeUrl);
loadAjaxPartial('avgIncomeHolder', avgIncomeUrl);
});

View File

@@ -20,29 +20,29 @@
$(function () {
"use strict";
loadAjaxPartial('accountsHolder', accountsUri);
loadAjaxPartial('tagsHolder', tagsUri);
loadAjaxPartial('accountPerTagHolder', accountPerTagUri);
loadAjaxPartial('accountsHolder', accountsUrl);
loadAjaxPartial('tagsHolder', tagsUrl);
loadAjaxPartial('accountPerTagHolder', accountPerTagUrl);
$.each($('.main_tag_canvas'), function (i, v) {
var canvas = $(v);
columnChart(canvas.data('url'), canvas.attr('id'));
});
multiCurrencyPieChart(tagOutUri, 'tag-out-pie-chart');
multiCurrencyPieChart(tagInUri, 'tag-in-pie-chart');
multiCurrencyPieChart(categoryOutUri, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUri, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUri, 'budgets-out-pie-chart');
multiCurrencyPieChart(sourceOutUri, 'source-out-pie-chart');
multiCurrencyPieChart(sourceInUri, 'source-in-pie-chart');
multiCurrencyPieChart(destOutUri, 'dest-out-pie-chart');
multiCurrencyPieChart(destInUri, 'dest-in-pie-chart');
multiCurrencyPieChart(tagOutUrl, 'tag-out-pie-chart');
multiCurrencyPieChart(tagInUrl, 'tag-in-pie-chart');
multiCurrencyPieChart(categoryOutUrl, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUrl, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUrl, 'budgets-out-pie-chart');
multiCurrencyPieChart(sourceOutUrl, 'source-out-pie-chart');
multiCurrencyPieChart(sourceInUrl, 'source-in-pie-chart');
multiCurrencyPieChart(destOutUrl, 'dest-out-pie-chart');
multiCurrencyPieChart(destInUrl, 'dest-in-pie-chart');
loadAjaxPartial('topExpensesHolder', topExpensesUri);
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
loadAjaxPartial('topIncomeHolder', topIncomeUri);
loadAjaxPartial('avgIncomeHolder', avgIncomeUri);
loadAjaxPartial('topExpensesHolder', topExpensesUrl);
loadAjaxPartial('avgExpensesHolder', avgExpensesUrl);
loadAjaxPartial('topIncomeHolder', topIncomeUrl);
loadAjaxPartial('avgIncomeHolder', avgIncomeUrl);
});

View File

@@ -376,14 +376,14 @@ function updateTriggerInput(selectList) {
/**
* Create actual autocomplete
* @param input
* @param URI
* @param URL
*/
function createAutoComplete(input, URI) {
console.log('Now in createAutoComplete("' + URI + '").');
function createAutoComplete(input, URL) {
console.log('Now in createAutoComplete("' + URL + '").');
input.typeahead('destroy');
// append URI:
var lastChar = URI[URI.length -1];
// append URL:
var lastChar = URL[URL.length -1];
var urlParamSplit = '?';
if('&' === lastChar) {
urlParamSplit = '';
@@ -392,7 +392,7 @@ function createAutoComplete(input, URI) {
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: URI + urlParamSplit + 'uid=' + uid,
url: URL + urlParamSplit + 'uid=' + uid,
filter: function (list) {
return $.map(list, function (item) {
return {name: item.name};
@@ -400,7 +400,7 @@ function createAutoComplete(input, URI) {
}
},
remote: {
url: URI + urlParamSplit + 'query=%QUERY&uid=' + uid,
url: URL + urlParamSplit + 'query=%QUERY&uid=' + uid,
wildcard: '%QUERY',
filter: function (list) {
return $.map(list, function (item) {

View File

@@ -18,8 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: searchQuery,searchUri,token */
$(function () {
@@ -29,7 +27,7 @@ $(function () {
});
function startSearch(query) {
$.post(searchUri, {query: query, _token: token}).done(presentSearchResults).fail(searchFailure);
$.post(searchUrl, {query: query, _token: token}).done(presentSearchResults).fail(searchFailure);
}
function searchFailure() {

View File

@@ -21,9 +21,9 @@
$(function () {
"use strict";
if (!showAll) {
multiCurrencyPieChart(categoryChartUri, 'category_chart');
multiCurrencyPieChart(budgetChartUri, 'budget_chart');
multiCurrencyPieChart(destinationChartUri, 'destination_chart');
multiCurrencyPieChart(sourceChartUri, 'source_chart');
multiCurrencyPieChart(categoryChartUrl, 'category_chart');
multiCurrencyPieChart(budgetChartUrl, 'budget_chart');
multiCurrencyPieChart(destinationChartUrl, 'destination_chart');
multiCurrencyPieChart(sourceChartUrl, 'source_chart');
}
});

View File

@@ -18,8 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** global: autoCompleteUri */
$(function () {
"use strict";
$('.link-modal').click(getLinkModal);
@@ -33,7 +31,7 @@ $(function () {
function getLinkModal(e) {
var button = $(e.currentTarget);
var journalId = parseInt(button.data('journal'));
var url = modalDialogURI.replace('%JOURNAL%', journalId);
var url = modalDialogURL.replace('%JOURNAL%', journalId);
console.log(url);
$.get(url).done(function (data) {
$('#linkJournalModal').html(data).modal('show');
@@ -53,7 +51,7 @@ function makeAutoComplete() {
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: acURI + '?uid=' + uid,
url: acURL + '?uid=' + uid,
filter: function (list) {
return $.map(list, function (item) {
return item;
@@ -61,7 +59,7 @@ function makeAutoComplete() {
}
},
remote: {
url: acURI + '?query=%QUERY&uid=' + uid,
url: acURL + '?query=%QUERY&uid=' + uid,
wildcard: '%QUERY',
filter: function (list) {
return $.map(list, function (item) {
@@ -78,7 +76,7 @@ function makeAutoComplete() {
function selectedJournal(event, journal) {
$('#journal-selector').hide();
$('#journal-selection').show();
$('#selected-journal').html('<a href="' + groupURI.replace('%GROUP%', journal.transaction_group_id) + '">' + journal.description + '</a>').show();
$('#selected-journal').html('<a href="' + groupURL.replace('%GROUP%', journal.transaction_group_id) + '">' + journal.description + '</a>').show();
$('input[name="opposing"]').val(journal.id);
}