Various Javascript related fixes.

This commit is contained in:
James Cole 2016-11-25 16:54:13 +01:00
parent b34e4cd31b
commit 6c9990e0be
7 changed files with 18 additions and 16 deletions

View File

@ -11,7 +11,7 @@ $(function () {
}
}
if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) {
if (typeof categoryID !== 'undefined' && typeof categoryDate !== 'undefined') {
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
}

View File

@ -11,7 +11,7 @@ $(function () {
}
}
if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) {
if (typeof categoryID !== 'undefined' && typeof categoryDate !== 'undefined') {
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
}

View File

@ -6,7 +6,7 @@
* of the MIT license. See the LICENSE file for details.
*/
/* globals $, Chart, currencySymbol,mon_decimal_point ,accounting, mon_thousands_sep, frac_digits */
/* globals $, Chart, currencySymbol,mon_decimal_point ,accounting, mon_thousands_sep, frac_digits, noDataForChart */
var allCharts = {};
@ -155,8 +155,10 @@ function drawAChart(URI, container, chartType, options, colorData) {
// remove the chart container + parent
var holder = $('#' + container).parent().parent();
if (holder.hasClass('box')) {
// remove box
holder.remove();
// find box-body:
var boxBody = holder.find('.box-body');
boxBody.empty().append($('<p>').append($('<em>').text(noDataForChart)));
//holder.remove();
}
return;
}

View File

@ -39,7 +39,7 @@
{% block scripts %}
<script type="text/javascript">
var what = '{{ what }}';
var what = '{{ what|escape }}';
</script>
<script type="text/javascript" src="js/lib/bootstrap-sortable.js"></script>
{% endblock %}

View File

@ -91,7 +91,7 @@
{% block scripts %}
<script type="text/javascript">
var accountID = {{ account.id }};
var dateString = "{{ date }}";
var dateString = "{{ date|escape }}";
// uri's for charts:
var incomeByCategoryUri = '{{ route('chart.account.incomeByCategory', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';

View File

@ -98,7 +98,7 @@
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var jobKey = "{{ job.key }}";
var jobKey = "{{ job.key|escape }}";
</script>
<script type="text/javascript" src="js/ff/export/index.js"></script>
{% endblock %}

View File

@ -180,23 +180,23 @@
currentPeriod: "{{ dpCurrent }}",
previousPeriod: "{{ dpPrevious }}",
nextPeriod: "{{ dpNext }}",
everything: '{{ 'everything'|_ }}',
customRangeLabel: '{{ 'customRange'|_ }}',
applyLabel: '{{ 'apply'|_ }}',
cancelLabel: '{{ 'cancel'|_ }}',
fromLabel: '{{ 'from'|_ }}',
toLabel: '{{ 'to'|_ }}',
everything: '{{ 'everything'|_|escape }}',
customRangeLabel: '{{ 'customRange'|_|escape }}',
applyLabel: '{{ 'apply'|_|escape }}',
cancelLabel: '{{ 'cancel'|_|escape }}',
fromLabel: '{{ 'from'|_|escape }}',
toLabel: '{{ 'to'|_|escape }}',
ranges: {{ dpRanges|json_encode|raw }}
};
var token = "{{ csrf_token() }}";
var language = "{{ language }}";
var language = "{{ language|escape }}";
var currencyCode = '{{ getCurrencyCode()|escape('js') }}';
var currencySymbol = '{{ getCurrencySymbol()|escape('js') }}';
var mon_decimal_point = "{{ localeconv.mon_decimal_point|escape('js') }}";
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep|escape('js') }}";
var frac_digits = {{ localeconv.frac_digits }};
var noDataForChart = '{{ trans('firefly.no_data_for_chart')|escape }}';
var showFullList = '{{ trans('firefly.show_full_list') }}';
var showOnlyTop = '{{ trans('firefly.show_only_top',{number:listLength}) }}';