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,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);
});