mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
This should fix most Javascript errors.
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: accounting */
|
||||||
|
|
||||||
var defaultChartOptions = {
|
var defaultChartOptions = {
|
||||||
scales: {
|
scales: {
|
||||||
xAxes: [
|
xAxes: [
|
||||||
@@ -20,7 +22,7 @@ var defaultChartOptions = {
|
|||||||
yAxes: [{
|
yAxes: [{
|
||||||
display: true,
|
display: true,
|
||||||
ticks: {
|
ticks: {
|
||||||
callback: function (tickValue, index, ticks) {
|
callback: function (tickValue) {
|
||||||
"use strict";
|
"use strict";
|
||||||
return accounting.formatMoney(tickValue);
|
return accounting.formatMoney(tickValue);
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
/** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart */
|
||||||
var allCharts = {};
|
var allCharts = {};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -97,7 +97,7 @@ function doubleYChart(URI, container) {
|
|||||||
{
|
{
|
||||||
display: true,
|
display: true,
|
||||||
ticks: {
|
ticks: {
|
||||||
callback: function (tickValue, index, ticks) {
|
callback: function (tickValue) {
|
||||||
"use strict";
|
"use strict";
|
||||||
return accounting.formatMoney(tickValue);
|
return accounting.formatMoney(tickValue);
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ function doubleYChart(URI, container) {
|
|||||||
{
|
{
|
||||||
display: true,
|
display: true,
|
||||||
ticks: {
|
ticks: {
|
||||||
callback: function (tickValue, index, ticks) {
|
callback: function (tickValue) {
|
||||||
"use strict";
|
"use strict";
|
||||||
return accounting.formatMoney(tickValue);
|
return accounting.formatMoney(tickValue);
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: jobKey */
|
||||||
|
|
||||||
var intervalId = 0;
|
var intervalId = 0;
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
@@ -79,7 +81,7 @@ function callExport() {
|
|||||||
// call status, keep calling it until response is "finished"?
|
// call status, keep calling it until response is "finished"?
|
||||||
intervalId = window.setInterval(checkStatus, 500);
|
intervalId = window.setInterval(checkStatus, 500);
|
||||||
|
|
||||||
$.post('export/submit', data).done(function (data) {
|
$.post('export/submit', data).done(function () {
|
||||||
// stop polling:
|
// stop polling:
|
||||||
window.clearTimeout(intervalId);
|
window.clearTimeout(intervalId);
|
||||||
|
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
*
|
*
|
||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
/** global: moment, dateRangeConfig, accounting, currencySymbol, mon_decimal_point, frac_digits, showFullList, showOnlyTop */
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: jobImportUrl, langImportSingleError, langImportMultiError, jobStartUrl, langImportTimeOutError, langImportFinished, langImportFatalError */
|
||||||
|
|
||||||
var startedImport = false;
|
var startedImport = false;
|
||||||
var startInterval = 2000;
|
var startInterval = 2000;
|
||||||
var interval = 500;
|
var interval = 500;
|
||||||
@@ -31,7 +33,7 @@ function checkImportStatus() {
|
|||||||
$.getJSON(jobImportUrl).done(reportOnJobImport).fail(failedJobImport);
|
$.getJSON(jobImportUrl).done(reportOnJobImport).fail(failedJobImport);
|
||||||
}
|
}
|
||||||
|
|
||||||
function importComplete(data) {
|
function importComplete() {
|
||||||
"use strict";
|
"use strict";
|
||||||
var bar = $('#import-status-bar');
|
var bar = $('#import-status-bar');
|
||||||
bar.removeClass('active');
|
bar.removeClass('active');
|
||||||
|
@@ -8,11 +8,13 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: Tour, showTour, accountFrontpageUri, billCount, accountExpenseUri, accountRevenueUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
// do chart JS stuff.
|
// do chart JS stuff.
|
||||||
drawChart();
|
drawChart();
|
||||||
if (showTour) {
|
if (showTour == true) {
|
||||||
$.getJSON('json/tour').done(function (data) {
|
$.getJSON('json/tour').done(function (data) {
|
||||||
var tour = new Tour(
|
var tour = new Tour(
|
||||||
{
|
{
|
||||||
@@ -55,6 +57,9 @@ function getBoxAmounts() {
|
|||||||
"use strict";
|
"use strict";
|
||||||
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
||||||
for (var x in boxes) {
|
for (var x in boxes) {
|
||||||
|
if (!boxes.hasOwnProperty(x)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var box = boxes[x];
|
var box = boxes[x];
|
||||||
$.getJSON('json/box/' + box).done(putData).fail(failData);
|
$.getJSON('json/box/' + box).done(putData).fail(failData);
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*
|
*
|
||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
/** global: piggyBankID, lineChart */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: hideable */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -65,7 +67,7 @@ function showOnlyColumns(checkboxes) {
|
|||||||
|
|
||||||
for (var i = 0; i < hideable.length; i++) {
|
for (var i = 0; i < hideable.length; i++) {
|
||||||
var opt = hideable[i];
|
var opt = hideable[i];
|
||||||
if(checkboxes.indexOf(opt) > -1) {
|
if (checkboxes.indexOf(opt) > -1) {
|
||||||
$('td.hide-' + opt).show();
|
$('td.hide-' + opt).show();
|
||||||
$('th.hide-' + opt).show();
|
$('th.hide-' + opt).show();
|
||||||
} else {
|
} else {
|
||||||
@@ -96,8 +98,12 @@ function readCookie(name) {
|
|||||||
var ca = document.cookie.split(';');
|
var ca = document.cookie.split(';');
|
||||||
for (var i = 0; i < ca.length; i++) {
|
for (var i = 0; i < ca.length; i++) {
|
||||||
var c = ca[i];
|
var c = ca[i];
|
||||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
while (c.charAt(0) === ' ') {
|
||||||
if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
c = c.substring(1, c.length);
|
||||||
|
}
|
||||||
|
if (c.indexOf(nameEQ) === 0) {
|
||||||
|
return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: budgetExpenseUri, accountExpenseUri, mainUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: categoryIncomeUri, categoryExpenseUri, accountIncomeUri, accountExpenseUri, mainUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: accountReportUri, incomeReportUri, expenseReportUri, incExpReportUri, startDate, endDate, accountIds */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -45,7 +47,7 @@ function clickInfoButton(e) {
|
|||||||
$.getJSON('popup/general', {attributes: attributes}).done(respondInfoButton).fail(errorInfoButton);
|
$.getJSON('popup/general', {attributes: attributes}).done(respondInfoButton).fail(errorInfoButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
function errorInfoButton(data) {
|
function errorInfoButton() {
|
||||||
"use strict";
|
"use strict";
|
||||||
// remove wait cursor
|
// remove wait cursor
|
||||||
$('body').removeClass('waiting');
|
$('body').removeClass('waiting');
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: categoryReportUri, budgetReportUri, balanceReportUri, accountChartUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: budgetPeriodReportUri, categoryExpenseUri, categoryIncomeUri, netWorthUri, opChartUri, sumChartUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: budgetPeriodReportUri, categoryExpenseUri, categoryIncomeUri, netWorthUri, opChartUri, sumChartUri */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
@@ -8,12 +8,14 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: minDate */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
if ($('#inputDateRange').length > 0) {
|
if ($('#inputDateRange').length > 0) {
|
||||||
|
|
||||||
picker = $('#inputDateRange').daterangepicker(
|
var picker = $('#inputDateRange').daterangepicker(
|
||||||
{
|
{
|
||||||
locale: {
|
locale: {
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
@@ -168,8 +170,12 @@ function readCookie(name) {
|
|||||||
var ca = document.cookie.split(';');
|
var ca = document.cookie.split(';');
|
||||||
for (var i = 0; i < ca.length; i++) {
|
for (var i = 0; i < ca.length; i++) {
|
||||||
var c = ca[i];
|
var c = ca[i];
|
||||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
while (c.charAt(0) === ' ') {
|
||||||
if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
c = c.substring(1, c.length);
|
||||||
|
}
|
||||||
|
if (c.indexOf(nameEQ) === 0) {
|
||||||
|
return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -52,14 +52,14 @@ function addNewAction() {
|
|||||||
function removeTrigger(e) {
|
function removeTrigger(e) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var target = $(e.target);
|
var target = $(e.target);
|
||||||
if(target.prop("tagName") == "I") {
|
if (target.prop("tagName") == "I") {
|
||||||
target = target.parent();
|
target = target.parent();
|
||||||
}
|
}
|
||||||
// remove grand parent:
|
// remove grand parent:
|
||||||
target.parent().parent().remove();
|
target.parent().parent().remove();
|
||||||
|
|
||||||
// if now at zero, immediatly add one again:
|
// if now at zero, immediatly add one again:
|
||||||
if($('.rule-trigger-tbody tr').length == 0) {
|
if ($('.rule-trigger-tbody tr').length == 0) {
|
||||||
addNewTrigger();
|
addNewTrigger();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,14 +67,14 @@ function removeTrigger(e) {
|
|||||||
function removeAction(e) {
|
function removeAction(e) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var target = $(e.target);
|
var target = $(e.target);
|
||||||
if(target.prop("tagName") == "I") {
|
if (target.prop("tagName") == "I") {
|
||||||
target = target.parent();
|
target = target.parent();
|
||||||
}
|
}
|
||||||
// remove grand parent:
|
// remove grand parent:
|
||||||
target.parent().parent().remove();
|
target.parent().parent().remove();
|
||||||
|
|
||||||
// if now at zero, immediatly add one again:
|
// if now at zero, immediatly add one again:
|
||||||
if($('.rule-action-tbody tr').length == 0) {
|
if ($('.rule-action-tbody tr').length == 0) {
|
||||||
addNewAction();
|
addNewAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,26 +83,25 @@ function testRuleTriggers() {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Serialize all trigger data
|
// Serialize all trigger data
|
||||||
var triggerData = $( ".rule-trigger-tbody" ).find( "input[type=text], input[type=checkbox], select" ).serializeArray();
|
var triggerData = $(".rule-trigger-tbody").find("input[type=text], input[type=checkbox], select").serializeArray();
|
||||||
|
|
||||||
// Find a list of existing transactions that match these triggers
|
// Find a list of existing transactions that match these triggers
|
||||||
$.get('rules/test', triggerData).done(function (data) {
|
$.get('rules/test', triggerData).done(function (data) {
|
||||||
var modal = $( "#testTriggerModal" );
|
var modal = $("#testTriggerModal");
|
||||||
var numTriggers = $( ".rule-trigger-body > tr" ).length;
|
|
||||||
|
|
||||||
// Set title and body
|
// Set title and body
|
||||||
modal.find( ".transactions-list" ).html(data.html);
|
modal.find(".transactions-list").html(data.html);
|
||||||
|
|
||||||
// Show warning if appropriate
|
// Show warning if appropriate
|
||||||
if( data.warning ) {
|
if (data.warning) {
|
||||||
modal.find( ".transaction-warning .warning-contents" ).text(data.warning);
|
modal.find(".transaction-warning .warning-contents").text(data.warning);
|
||||||
modal.find( ".transaction-warning" ).show();
|
modal.find(".transaction-warning").show();
|
||||||
} else {
|
} else {
|
||||||
modal.find( ".transaction-warning" ).hide();
|
modal.find(".transaction-warning").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the modal dialog
|
// Show the modal dialog
|
||||||
$( "#testTriggerModal" ).modal();
|
$("#testTriggerModal").modal();
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
alert('Cannot get transactions for given triggers.');
|
alert('Cannot get transactions for given triggers.');
|
||||||
});
|
});
|
||||||
|
@@ -8,6 +8,9 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: triggerCount, actionCount */
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
if (triggerCount === 0) {
|
if (triggerCount === 0) {
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: triggerCount, actionCount */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
if (triggerCount === 0) {
|
if (triggerCount === 0) {
|
||||||
|
@@ -52,7 +52,6 @@ function sortStop(event, ui) {
|
|||||||
$.each(parent.children(), function (i, v) {
|
$.each(parent.children(), function (i, v) {
|
||||||
var trigger = $(v);
|
var trigger = $(v);
|
||||||
var id = trigger.data('id');
|
var id = trigger.data('id');
|
||||||
var order = i + 1;
|
|
||||||
entries.push(id);
|
entries.push(id);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: originalSum, amount, accounting */
|
||||||
|
|
||||||
var destAccounts = {};
|
var destAccounts = {};
|
||||||
var srcAccounts = {};
|
var srcAccounts = {};
|
||||||
var categories = {};
|
var categories = {};
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: zoomLevel, latitude, longitude, google */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -60,12 +62,12 @@ function initialize() {
|
|||||||
Respond to zoom event.
|
Respond to zoom event.
|
||||||
*/
|
*/
|
||||||
google.maps.event.addListener(map, 'zoom_changed', function () {
|
google.maps.event.addListener(map, 'zoom_changed', function () {
|
||||||
saveZoomLevel(event);
|
saveZoomLevel();
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
Maybe place marker?
|
Maybe place marker?
|
||||||
*/
|
*/
|
||||||
if(doPlaceMarker) {
|
if(doPlaceMarker == true) {
|
||||||
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
||||||
var fakeEvent = {};
|
var fakeEvent = {};
|
||||||
fakeEvent.latLng = myLatlng;
|
fakeEvent.latLng = myLatlng;
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*
|
*
|
||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
/** global: zoomLevel, latitude, longitude, google */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
@@ -60,12 +61,12 @@ function initialize() {
|
|||||||
Respond to zoom event.
|
Respond to zoom event.
|
||||||
*/
|
*/
|
||||||
google.maps.event.addListener(map, 'zoom_changed', function () {
|
google.maps.event.addListener(map, 'zoom_changed', function () {
|
||||||
saveZoomLevel(event);
|
saveZoomLevel();
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
Maybe place marker?
|
Maybe place marker?
|
||||||
*/
|
*/
|
||||||
if(doPlaceMarker) {
|
if(doPlaceMarker == true) {
|
||||||
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
||||||
var fakeEvent = {};
|
var fakeEvent = {};
|
||||||
fakeEvent.latLng = myLatlng;
|
fakeEvent.latLng = myLatlng;
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: zoomLevel, latitude, longitude, google */
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -60,12 +62,12 @@ function initialize() {
|
|||||||
Respond to zoom event.
|
Respond to zoom event.
|
||||||
*/
|
*/
|
||||||
google.maps.event.addListener(map, 'zoom_changed', function () {
|
google.maps.event.addListener(map, 'zoom_changed', function () {
|
||||||
saveZoomLevel(event);
|
saveZoomLevel();
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
Maybe place marker?
|
Maybe place marker?
|
||||||
*/
|
*/
|
||||||
if(doPlaceMarker) {
|
if(doPlaceMarker == true) {
|
||||||
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
var myLatlng = new google.maps.LatLng(latitude,longitude);
|
||||||
var fakeEvent = {};
|
var fakeEvent = {};
|
||||||
fakeEvent.latLng = myLatlng;
|
fakeEvent.latLng = myLatlng;
|
||||||
|
@@ -58,19 +58,19 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('input[name="description"]').length > 0 && what !== undefined) {
|
if ($('input[name="description"]').length > 0 && !(typeof what === "undefined")) {
|
||||||
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
||||||
$('input[name="description"]').typeahead({source: data});
|
$('input[name="description"]').typeahead({source: data});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// also for multi input:
|
// also for multi input:
|
||||||
if ($('input[name="description[]"]').length > 0 && what !== undefined) {
|
if ($('input[name="description[]"]').length > 0 && !(typeof what === "undefined")) {
|
||||||
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
||||||
$('input[name="description[]"]').typeahead({source: data});
|
$('input[name="description[]"]').typeahead({source: data});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// and for the (rare) journal_description:
|
// and for the (rare) journal_description:
|
||||||
if ($('input[name="journal_description"]').length > 0 && what !== undefined) {
|
if ($('input[name="journal_description"]').length > 0 && !(typeof what === "undefined")) {
|
||||||
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
||||||
$('input[name="journal_description"]').typeahead({source: data});
|
$('input[name="journal_description"]').typeahead({source: data});
|
||||||
});
|
});
|
||||||
|
@@ -8,12 +8,14 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: what, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt */
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// respond to switch buttons when
|
// respond to switch buttons when
|
||||||
// creating stuff:
|
// creating stuff:
|
||||||
if (doSwitch) {
|
if (doSwitch == true) {
|
||||||
updateButtons();
|
updateButtons();
|
||||||
updateForm();
|
updateForm();
|
||||||
updateLayout();
|
updateLayout();
|
||||||
@@ -35,6 +37,7 @@ function updateForm() {
|
|||||||
|
|
||||||
$('input[name="what"]').val(what);
|
$('input[name="what"]').val(what);
|
||||||
switch (what) {
|
switch (what) {
|
||||||
|
default:
|
||||||
case 'withdrawal':
|
case 'withdrawal':
|
||||||
// show source_id and dest_name:
|
// show source_id and dest_name:
|
||||||
$('#source_account_id_holder').show();
|
$('#source_account_id_holder').show();
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: edit_selected_txt, delete_selected_txt */
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
$('.mass_edit_all').show();
|
$('.mass_edit_all').show();
|
||||||
|
Reference in New Issue
Block a user