Merge branch 'develop' into issues/509

# Conflicts:
#	public/js/ff/transactions/list.js
This commit is contained in:
Victor Mosin
2017-12-30 11:49:42 +01:00
192 changed files with 2979 additions and 3011 deletions

View File

@@ -92,7 +92,6 @@ function storeReconcile() {
transactions: ids,
cleared: cleared,
};
console.log
var uri = overviewUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: chartUri, incomeCategoryUri, expenseCategoryUri, expenseBudgetUri */
/** global: chartUri, incomeCategoryUri, expenseCategoryUri, expenseBudgetUri, token */
var fixHelper = function (e, tr) {
"use strict";

View File

@@ -18,6 +18,8 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: updateCheckUri */
$(function () {
"use strict";
@@ -31,7 +33,7 @@ function checkUpdate() {
// do post update check:
$.post(updateCheckUri).done(function (data) {
alert(data.result);
}).fail(function() {
}).fail(function () {
alert('Error while checking.');
});

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: infoIncomeUri, spent, budgeted, available, currencySymbol, budgetIndexUri, updateIncomeUri, periodStart, periodEnd, budgetAmountUri, accounting */
/** global: infoIncomeUri, token, spent, budgeted, available, currencySymbol, budgetIndexUri, updateIncomeUri, periodStart, periodEnd, budgetAmountUri, accounting */
/**
*
*/
@@ -104,7 +104,7 @@ function updateBudgetedAmounts(e) {
var target = $(e.target);
var id = target.data('id');
var leftCell = $('td[class$="left"][data-id="' + id + '"]');
var link = $('a[data-id="'+id+'"][class="budget-link"]');
var link = $('a[data-id="' + id + '"][class="budget-link"]');
var value = target.val();
var original = target.data('original');
@@ -112,7 +112,7 @@ function updateBudgetedAmounts(e) {
target.prop('disabled', true);
// replace link (for now)
link.attr('href','#');
link.attr('href', '#');
// replace "left" with spinner.
leftCell.empty().html('<i class="fa fa-fw fa-spin fa-spinner"></i>');

View File

@@ -29,40 +29,37 @@
* @param maxwidth
* @returns {Array}
*/
function formatLabel(str, maxwidth){
function formatLabel(str, maxwidth) {
var sections = [];
var words = str.split(" ");
var temp = "";
words.forEach(function(item, index){
if(temp.length > 0)
{
words.forEach(function (item, index) {
if (temp.length > 0) {
var concat = temp + ' ' + item;
if(concat.length > maxwidth){
if (concat.length > maxwidth) {
sections.push(temp);
temp = "";
}
else{
if(index === (words.length-1))
{
else {
if (index === (words.length - 1)) {
sections.push(concat);
return;
}
else{
else {
temp = concat;
return;
}
}
}
if(index === (words.length-1))
{
if (index === (words.length - 1)) {
sections.push(item);
return;
}
if(item.length < maxwidth) {
if (item.length < maxwidth) {
temp = item;
}
else {

View File

@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: token */
$(function () {
"use strict";
$('#help').click(showHelp);

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: langImportSingleError, langImportMultiError, jobStartUrl, langImportTimeOutError, langImportFinished, langImportFatalError */
/** global: job, langImportSingleError, langImportMultiError, jobStartUrl, langImportTimeOutError, langImportFinished, langImportFatalError */
var timeOutId;
var startInterval = 1000;
@@ -34,10 +34,12 @@ var knownErrors = 0;
$(function () {
"use strict";
console.log('in start');
timeOutId = setTimeout(checkJobStatus, startInterval);
$('.start-job').click(startJob);
if (job.configuration['auto-start']) {
console.log('Called startJob()!');
startJob();
}
});
@@ -46,6 +48,7 @@ $(function () {
* Downloads some JSON and responds to its content to see what the status is of the current import.
*/
function checkJobStatus() {
console.log('in checkJobStatus');
$.getJSON(jobStatusUri).done(reportOnJobStatus).fail(reportFailedJob);
}
@@ -53,6 +56,7 @@ function checkJobStatus() {
* This method is called when the JSON query returns an error. If possible, this error is relayed to the user.
*/
function reportFailedJob(jqxhr, textStatus, error) {
console.log('in reportFailedJob');
// hide all possible boxes:
$('.statusbox').hide();
@@ -72,6 +76,7 @@ function reportFailedJob(jqxhr, textStatus, error) {
* @param data
*/
function reportOnJobStatus(data) {
console.log('in reportOnJobStatus: ' + data.status);
switch (data.status) {
case "configured":
@@ -80,6 +85,10 @@ function reportOnJobStatus(data) {
$('.statusbox').hide();
$('.status_configured').show();
}
if (job.configuration['auto-start']) {
console.log('Job is auto start. Check status again in 500ms.');
timeOutId = setTimeout(checkJobStatus, interval);
}
break;
case "running":
// job is running! Show the running box:
@@ -122,7 +131,13 @@ function reportOnJobStatus(data) {
// show the fatal error box:
$('.fatal_error').show();
break;
case "configuring":
// redirect back to configure screen.
console.log('Will now redirect to ' + jobConfigureUri);
window.location = jobConfigureUri;
break;
default:
console.error('Cannot handle job status ' + data.status);
break;
}

View File

@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: token */
var fixHelper = function (e, tr) {
"use strict";
var $originals = tr.children();

View File

@@ -1,4 +1,3 @@
/*
* month.js
* Copyright (c) 2017 thegrumpydictator@gmail.com
@@ -18,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: spentUri, categoryUri, budgetUri, expenseUri, incomeUri, mainUri */
$(function () {
"use strict";
drawChart();
doubleYChart(mainUri, 'in-out-chart');
loadAjaxPartial('inOutAccounts', spentUri);
loadAjaxPartial('inOutCategory', categoryUri);
@@ -31,9 +30,3 @@ $(function () {
});
function drawChart() {
"use strict";
// month view:
doubleYChart(mainUri, 'in-out-chart');
}

View File

@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: startDate, endDate, accountIds */
function loadAjaxPartial(holder, uri) {
"use strict";
$.get(uri).done(function (data) {

View File

@@ -139,7 +139,6 @@ function setOptionalFromCookies() {
$('#inputExpRevAccounts').multiselect(defaultMultiSelect);
}
function catchSubmit() {
@@ -161,7 +160,7 @@ function catchSubmit() {
createCookie('report-categories', categories, 365);
createCookie('report-budgets', budgets, 365);
createCookie('report-tags', tags, 365);
createCookie('report-exp-rev', expRev , 365);
createCookie('report-exp-rev', expRev, 365);
createCookie('report-start', moment(picker.startDate).format("YYYYMMDD"), 365);
createCookie('report-end', moment(picker.endDate).format("YYYYMMDD"), 365);

View File

@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: token */
var fixHelper = function (e, tr) {
"use strict";
var $originals = tr.children();

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: searchQuery,searchUri */
/** global: searchQuery,searchUri,token */

View File

@@ -48,7 +48,7 @@ $(function () {
}).addTo(mymap);
if (doPlaceMarker) {
var marker = L.marker([latitude, longitude]).addTo(mymap);
L.marker([latitude, longitude]).addTo(mymap);
}
}
});

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: edit_selected_txt, edit_bulk_selected_txt, delete_selected_txt */
/** global: edit_selected_txt, edit_bulk_selected_txt, delete_selected_txt, token */
/**
*