Use json_encode for JS variables in views

This commit is contained in:
Hillel Coren 2018-03-27 12:52:37 +03:00
parent d1218f0b1c
commit ff05d41ca3
28 changed files with 85 additions and 85 deletions

View File

@ -39,7 +39,7 @@ class PaymentTermApiController extends BaseAPIController
* @SWG\Response(
* response=200,
* description="A list of payment terms",
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/PaymentTerms"))
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/PaymentTerm"))
* ),
* @SWG\Response(
* response="default",
@ -73,7 +73,7 @@ class PaymentTermApiController extends BaseAPIController
* @SWG\Response(
* response=200,
* description="A single payment term",
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/PaymentTerms"))
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/PaymentTerm"))
* ),
* @SWG\Response(
* response="default",

View File

@ -52,8 +52,8 @@
invoice_settings:{{ Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS) ? 'true' : 'false' }}
};
invoice.account.hide_paid_to_date = {!! Auth::user()->account->hide_paid_to_date ? 'true' : 'false' !!};
NINJA.primaryColor = '{!! Auth::user()->account->primary_color !!}';
NINJA.secondaryColor = '{!! Auth::user()->account->secondary_color !!}';
NINJA.primaryColor = {!! json_encode(Auth::user()->account->primary_color) !!};
NINJA.secondaryColor = {!! json_encode(Auth::user()->account->secondary_color) !!};
NINJA.fontSize = {!! Auth::user()->account->font_size !!};
NINJA.headerFont = {!! json_encode(Auth::user()->account->getHeaderFontName()) !!};
NINJA.bodyFont = {!! json_encode(Auth::user()->account->getBodyFontName()) !!};

View File

@ -498,7 +498,7 @@
function setQuoteNumberEnabled() {
var disabled = $('#share_counter').prop('checked');
$('#quote_number_counter').prop('disabled', disabled);
$('#quote_number_counter').val(disabled ? '' : '{!! $account->quote_number_counter !!}');
$('#quote_number_counter').val(disabled ? '' : {!! json_encode($account->quote_number_counter) !!});
}
function onNumberTypeChange(entityType) {

View File

@ -98,7 +98,7 @@
$('#reportrange').css('color', '#000');
$('#reportrange').css('pointer-events', 'auto');
}
var url = "{!! url('/clients/statement/' . $client->public_id) !!}/" + statusId + '/' +
var url = '{{ url('/clients/statement/' . $client->public_id) }}' + '/' + statusId + '/' +
statementStartDate.format('YYYY-MM-DD') + '/' + statementEndDate.format('YYYY-MM-DD') + '?json=true';
$.get(url, function(response) {
invoice = currentInvoice = JSON.parse(response);

View File

@ -5,7 +5,7 @@
@include('money_script')
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script>
<script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}" rel="stylesheet" type="text/css"/>
@ -171,7 +171,7 @@
function loadData() {
var includeExpenses = "{{ $showExpenses ? 'true' : 'false' }}";
var url = "{!! url('/dashboard_chart_data') !!}/" + chartGroupBy + '/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD') + '/' + chartCurrencyId + '/' + includeExpenses;
var url = '{{ url('/dashboard_chart_data') }}/' + chartGroupBy + '/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD') + '/' + chartCurrencyId + '/' + includeExpenses;
$.get(url, function(response) {
response = JSON.parse(response);
loadChart(response.data);

View File

@ -15,7 +15,7 @@
"broker": {
"@type": "Organization",
"name": "Invoice Ninja",
"url": "{!! NINJA_WEB_URL !!}"
"url": "{{ NINJA_WEB_URL }}"
},
"totalPaymentDue": {
"@type": "PriceSpecification",
@ -23,7 +23,7 @@
},
"action": {
"@type": "ViewAction",
"url": "{!! $link !!}"
"url": "{{ $link }}"
}
},
@endif
@ -32,8 +32,8 @@
"@type": "EmailMessage",
"action": {
"@type": "ViewAction",
"url": "{!! $link !!}",
"name": "{{ trans("texts.view_{$entityType}") }}"
"url": "{{ $link }}",
"name": {!! json_encode(trans("texts.view_{$entityType}")) !!}
}
}
]

View File

@ -5,8 +5,8 @@
"@type": "EmailMessage",
"action": {
"@type": "ViewAction",
"url": "{!! $invoiceLink !!}",
"name": "{{ trans("texts.view_{$entityType}") }}"
"url": "{{ $invoiceLink }}",
"name": {!! json_encode(trans("texts.view_{$entityType}")) !!}
}
}
]

View File

@ -272,7 +272,7 @@
function onFormSubmit(event) {
if (window.countUploadingDocuments > 0) {
swal("{!! trans('texts.wait_for_upload') !!}");
swal({!! json_encode(trans('texts.wait_for_upload')) !!});
return false;
}

View File

@ -365,7 +365,7 @@
</nav>
<div id="wrapper" class='{!! session(SESSION_LEFT_SIDEBAR) ? 'toggled-left' : '' !!} {!! session(SESSION_RIGHT_SIDEBAR, true) ? 'toggled-right' : '' !!}'>
<div id="wrapper" class='{{ session(SESSION_LEFT_SIDEBAR) ? 'toggled-left' : '' }} {{ session(SESSION_RIGHT_SIDEBAR, true) ? 'toggled-right' : '' }}'>
<!-- Sidebar -->
<div id="left-sidebar-wrapper" class="hide-phone">

View File

@ -893,11 +893,11 @@
@if ($account->invoice_taxes)
@if (! empty($account->tax_name1))
model.invoice().tax_rate1("{{ $account->tax_rate1 }}");
model.invoice().tax_name1("{!! addslashes($account->tax_name1) !!}");
model.invoice().tax_name1({!! json_encode($account->tax_name1) !!});
@endif
@if (! empty($account->tax_name2))
model.invoice().tax_rate2("{{ $account->tax_rate2 }}");
model.invoice().tax_name2("{!! addslashes($account->tax_name2) !!}");
model.invoice().tax_name2({!! json_encode($account->tax_name2) !!});
@endif
@endif
@ -1169,8 +1169,8 @@
invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true});
if (invoice.is_recurring) {
invoice.invoice_number = "{!! trans('texts.assigned_when_sent') !!}";
invoice.due_date = "{!! trans('texts.assigned_when_sent') !!}";
invoice.invoice_number = {!! json_encode(trans('texts.assigned_when_sent')) !!};
invoice.due_date = {!! json_encode(trans('texts.assigned_when_sent')) !!};
if (invoice.start_date) {
invoice.invoice_date = invoice.start_date;
} else {
@ -1265,7 +1265,7 @@
var design = getDesignJavascript();
if (!design) return;
var doc = generatePDF(invoice, design, true);
var type = invoice.is_quote ? '{!! trans('texts.'.ENTITY_QUOTE) !!}' : '{!! trans('texts.'.ENTITY_INVOICE) !!}';
var type = invoice.is_quote ? {!! json_encode(trans('texts.'.ENTITY_QUOTE)) !!} : {!! json_encode(trans('texts.'.ENTITY_INVOICE)) !!};
doc.save(type + '-' + $('#invoice_number').val() + '.pdf');
}
@ -1292,23 +1292,23 @@
function onEmailClick() {
if (!NINJA.isRegistered) {
swal("{!! trans('texts.registration_required') !!}");
swal({!! json_encode(trans('texts.registration_required')) !!});
return;
}
var clientId = parseInt($('input[name=client]').val(), 10) || 0;
if (clientId == 0 ) {
swal("{!! trans('texts.no_client_selected') !!}");
swal({!! json_encode(trans('texts.no_client_selected')) !!});
return;
}
if (!isContactSelected()) {
swal("{!! trans('texts.no_contact_selected') !!}");
swal({!! json_encode(trans('texts.no_contact_selected')) !!});
return;
}
if (!isEmailValid()) {
swal("{!! trans('texts.provide_email') !!}");
swal({!! json_encode(trans('texts.provide_email')) !!});
return;
}
@ -1344,9 +1344,9 @@
}
@if ($account->auto_email_invoice)
var title = "{!! trans("texts.confirm_recurring_email_invoice") !!}";
var title = {!! json_encode(trans("texts.confirm_recurring_email_invoice")) !!};
@else
var title = "{!! trans("texts.confirm_recurring_email_invoice_not_sent") !!}";
var title = {!! json_encode(trans("texts.confirm_recurring_email_invoice_not_sent")) !!};
@endif
var text = '\n' + getSendToEmails();
@ -1355,13 +1355,13 @@
// warn invoice will be emailed when saving new recurring invoice
if (model.invoice().start_date() == "{{ Utils::fromSqlDate(date('Y-m-d')) }}") {
@if ($account->auto_email_invoice)
text += '\n\n' + "{!! trans("texts.confirm_recurring_timing") !!}";
text += '\n\n' + {!! json_encode(trans("texts.confirm_recurring_timing")) !!};
@else
text += '\n\n' + "{!! trans("texts.confirm_recurring_timing_not_sent") !!}";
text += '\n\n' + {!! json_encode(trans("texts.confirm_recurring_timing_not_sent")) !!};
@endif
// check if the start date is in the future
} else if (startDate.isAfter(moment(), 'day')) {
var message = "{!! trans("texts.email_will_be_sent_on") !!}";
var message = {!! json_encode(trans("texts.email_will_be_sent_on")) !!};
text += '\n\n' + message.replace(':date', model.invoice().start_date());
}
@ -1380,12 +1380,12 @@
@if ($invoice->id)
if (model.invoice().is_recurring()) {
if (model.invoice().start_date() != model.invoice().start_date_orig()) {
var text = "{!! trans("texts.original_start_date") !!}: " + model.invoice().start_date_orig() + '\n'
+ "{!! trans("texts.new_start_date") !!}: " + model.invoice().start_date();
var text = {!! json_encode(trans("texts.original_start_date")) !!} + ': ' + model.invoice().start_date_orig() + '\n'
+ {!! json_encode(trans("texts.new_start_date")) !!} + ': ' + model.invoice().start_date();
@if ($account->auto_email_invoice)
var title = "{!! trans("texts.warn_start_date_changed") !!}";
var title = {!! json_encode(trans("texts.warn_start_date_changed")) !!};
@else
var title = "{!! trans("texts.warn_start_date_changed_not_sent") !!}";
var title = {!! json_encode(trans("texts.warn_start_date_changed_not_sent")) !!};
@endif
sweetConfirm(function() {
submitAction('');
@ -1396,7 +1396,7 @@
@endif
@if (!empty($autoBillChangeWarning))
var text = "{!! trans('texts.warn_change_auto_bill') !!}";
var text = {!! json_encode(trans('texts.warn_change_auto_bill')) !!};
sweetConfirm(function() {
submitAction('');
}, text);
@ -1444,7 +1444,7 @@
function onFormSubmit(event) {
if (window.countUploadingDocuments > 0) {
swal("{!! trans('texts.wait_for_upload') !!}");
swal({!! json_encode(trans('texts.wait_for_upload')) !!});
return false;
}
@ -1470,7 +1470,7 @@
var expenseCurrencyId = model.expense_currency_id();
var clientCurrencyId = model.invoice().client().currency_id() || {{ $account->getCurrencyId() }};
if (expenseCurrencyId && expenseCurrencyId != clientCurrencyId) {
swal("{!! trans('texts.expense_error_mismatch_currencies') !!}");
swal({!! json_encode(trans('texts.expense_error_mismatch_currencies')) !!});
return false;
}
@ -1503,7 +1503,7 @@
if (data) {
var error = firstJSONError(data.responseJSON) || data.statusText;
}
swal("{!! trans('texts.invoice_save_error') !!}", error);
swal({!! json_encode(trans('texts.invoice_save_error')) !!}, error);
}
function submitBulkAction(value) {
@ -1572,7 +1572,7 @@
@if (!empty($autoBillChangeWarning))
sweetConfirm(function() {
window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}';
}, "{!! trans('texts.warn_change_auto_bill') !!}");
}, {!! json_encode(trans('texts.warn_change_auto_bill')) !!});
@else
window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}';
@endif

View File

@ -168,7 +168,7 @@
@if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@elseif (count($paymentTypes) == 1)
<a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }} {!! $invoice->present()->gatewayFee($gatewayTypeId) !!}</a>
<a href='{{ $paymentURL }}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }} {!! $invoice->present()->gatewayFee($gatewayTypeId) !!}</a>
@endif
@else
{!! Button::normal(trans('texts.download'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}

View File

@ -2,7 +2,7 @@
@section('head')
@if (!empty($clientauth) && $fontsUrl = Utils::getAccountFontsUrl())
<link href="{!! $fontsUrl !!}" rel="stylesheet" type="text/css">
<link href="{{ $fontsUrl }}" rel="stylesheet" type="text/css">
@endif
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('css/bootstrap.min.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>

View File

@ -111,14 +111,14 @@
// http://t4t5.github.io/sweetalert/
function sweetConfirm(successCallback, text, title, cancelCallback) {
title = title || "{!! trans("texts.are_you_sure") !!}";
title = title || {!! json_encode(trans("texts.are_you_sure")) !!};
swal({
//type: "warning",
//confirmButtonColor: "#DD6B55",
title: title,
text: text,
cancelButtonText: "{!! trans("texts.no") !!}",
confirmButtonText: "{!! trans("texts.yes") !!}",
cancelButtonText: {!! json_encode(trans("texts.no")) !!},
confirmButtonText: {!! json_encode(trans("texts.yes")) !!},
showCancelButton: true,
closeOnConfirm: false,
allowOutsideClick: true,

View File

@ -8,14 +8,14 @@
<script type="text/javascript">
function submitForm_{{ $entityType }}(action, id) {
if (action == 'delete') {
if (!confirm('{!! trans("texts.are_you_sure") !!}')) {
if (!confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
return;
}
}
@if (in_array($entityType, [ENTITY_ACCOUNT_GATEWAY]))
if (action == 'archive') {
if (!confirm('{!! trans("texts.are_you_sure") !!}')) {
if (!confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
return;
}
}

View File

@ -11,7 +11,7 @@ window.dropzone = new Dropzone('#document-upload .dropzone', {
addRemoveLinks: true,
dictRemoveFileConfirmation: "{{trans('texts.are_you_sure')}}",
@foreach(['default_message', 'fallback_message', 'fallback_text', 'file_too_big', 'invalid_file_type', 'response_error', 'cancel_upload', 'cancel_upload_confirmation', 'remove_file'] as $key)
"dict{{ Utils::toClassCase($key) }}" : "{!! strip_tags(addslashes(trans('texts.dropzone_'.$key))) !!}",
"dict{{ Utils::toClassCase($key) }}" : {!! json_encode(trans('texts.dropzone_'.$key)) !!},
@endforeach
maxFilesize: {{ floatval(MAX_DOCUMENT_SIZE/1000) }},
parallelUploads: 1,
@ -99,5 +99,5 @@ function handleDocumentCanceled() {
function handleDocumentError(file) {
dropzone.removeFile(file);
window.countUploadingDocuments--;
swal("{!! trans('texts.error_refresh_page') !!}");
swal({!! json_encode(trans('texts.error_refresh_page')) !!});
}

View File

@ -6,17 +6,17 @@
}
if (invoice && invoice.invoice_type_id == {{ INVOICE_TYPE_QUOTE }} || entityType == '{{ ENTITY_QUOTE }}') {
var viewButton = '{!! Form::flatButton('view_quote', '#0b4d78') !!}$password';
var viewButton = {!! json_encode(Form::flatButton('view_quote', '#0b4d78')) !!} + '$password';
} else if (entityType == '{{ ENTITY_PROPOSAL }}') {
var viewButton = '{!! Form::flatButton('view_proposal', '#0b4d78') !!}$password';
var viewButton = {!! json_encode(Form::flatButton('view_proposal', '#0b4d78')) !!} + '$password';
} else {
var viewButton = '{!! Form::flatButton('view_invoice', '#0b4d78') !!}$password';
var viewButton = {!! json_encode(Form::flatButton('view_invoice', '#0b4d78')) !!} + '$password';
}
var passwordHtml = "{!! $account->isPro() && $account->enable_portal_password && $account->send_portal_password?'<br/>'.trans('texts.password').': XXXXXXXXX<br/>':'' !!}";
var passwordHtml = {!! $account->isPro() && $account->enable_portal_password && $account->send_portal_password ? json_encode('<br/>' . trans('texts.password') . ': XXXXXXXXX<br/>') : json_encode('') !!};
@if ($account->isPro())
var documentsHtml = "{!! trans('texts.email_documents_header').'<ul><li><a>'.trans('texts.email_documents_example_1').'</a></li><li><a>'.trans('texts.email_documents_example_2').'</a></li></ul>' !!}";
var documentsHtml = {!! json_encode(trans('texts.email_documents_header') . '<ul><li><a>' . trans('texts.email_documents_example_1') . '</a></li><li><a>' . trans('texts.email_documents_example_2') . '</a></li></ul>') !!};
@else
var documentsHtml = "";
@endif
@ -44,10 +44,10 @@
'viewLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password',
'viewButton': viewButton,
'paymentLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password',
'paymentButton': '{!! Form::flatButton('pay_now', '#36c157') !!}$password',
'paymentButton': {!! json_encode(Form::flatButton('pay_now', '#36c157')) !!} + '$password',
'autoBill': '{{ trans('texts.auto_bill_notification_placeholder') }}',
'portalLink': "{{ auth()->user()->account->getBaseUrl() . '/...' }}",
'portalButton': '{!! Form::flatButton('view_portal', '#36c157') !!}',
'portalButton': {!! json_encode(Form::flatButton('view_portal', '#36c157')) !!},
'customClient1': invoice ? invoice.client.custom_value1 : 'custom value',
'customClient2': invoice ? invoice.client.custom_value2 : 'custom value',
'customContact1': invoice ? invoice.client.contacts[0].custom_value1 : 'custom value',

View File

@ -234,7 +234,7 @@
'g u m' => 'user_management',
] as $key => $val)
Mousetrap.bind('{{ $key }}', function(e) {
location.href = "{!! url('/settings/' . $val) !!}";
location.href = "{{ url('/settings/' . $val) }}";
});
@endforeach

View File

@ -66,7 +66,7 @@
function showUpgradeModal() {
@if ( ! Auth::check() || ! Auth::user()->registered)
swal("{!! trans('texts.please_register') !!}");
swal({!! json_encode(trans('texts.please_register')) !!});
return;
@elseif ( ! Auth::check() || ! Auth::user()->confirmed)
swal({!! json_encode(trans('texts.confirmation_required', ['link' => link_to('/resend_confirmation', trans('texts.click_here'))])) !!});

View File

@ -5,7 +5,7 @@
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script>
<script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
@stop
@ -151,7 +151,7 @@
}
function onDeleteClick() {
if (confirm("{!! trans('texts.are_you_sure') !!}")) {
if (confirm({!! json_encode(trans('texts.are_you_sure')) !!})) {
$('#action').val('delete');
$('.mainForm').submit();
}

View File

@ -2,7 +2,7 @@
@section('head')
@if (!empty($clientFontUrl))
<link href="{!! $clientFontUrl !!}" rel="stylesheet" type="text/css">
<link href="{{ $clientFontUrl }}" rel="stylesheet" type="text/css">
@endif
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<style type="text/css">{!! !empty($account)?$account->clientViewCSS():'' !!}</style>

View File

@ -117,7 +117,7 @@ $(function() {
@if (isset($redirectTo))
setTimeout(function() {
location.href = "{!! $redirectTo !!}";
location.href = {!! json_encode($redirectTo) !!};
}, 3000);
@endif

View File

@ -4,7 +4,7 @@
@parent
@include('money_script')
<script src="{!! asset('js/d3.min.js') !!}" type="text/javascript"></script>
<script src="{{ asset('js/d3.min.js') }}" type="text/javascript"></script>
<style type="text/css">

View File

@ -3,7 +3,7 @@
@section('head')
@parent
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script>
<script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
@stop
@ -157,7 +157,7 @@
});
function loadData() {
var url = "{!! url('/reports/emails_report') !!}/" + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD');
var url = '{{ url('/reports/emails_report') }}/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD');
$.get(url, function(response) {
loadChart(response.data);
$('#totalSentDiv').html(response.totals['sent']);

View File

@ -5,7 +5,7 @@
@include('money_script')
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script>
<script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>

View File

@ -298,7 +298,7 @@
}
function onDeleteClick() {
if (confirm('{!! trans("texts.are_you_sure") !!}')) {
if (confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
submitAction('delete');
}
}

View File

@ -1,13 +1,13 @@
<table id="{!! $id !!}" class="{!! $class !!}">
<table id="{{ $id }}" class="{{ $class }}">
<colgroup>
@for ($i = 0; $i < count($columns); $i++)
<col class="con{!! $i !!}" />
<col class="con{{ $i }}" />
@endfor
</colgroup>
<thead>
<tr>
@foreach($columns as $i => $c)
<th align="center" valign="middle" class="head{!! $i !!}">{!! $c !!}</th>
<th align="center" valign="middle" class="head{{ $i }}">{{ $c }}</th>
@endforeach
</tr>
</thead>
@ -15,7 +15,7 @@
@foreach($data as $d)
<tr>
@foreach($d as $dd)
<td>{!! $dd !!}</td>
<td>{{ $dd }}</td>
@endforeach
</tr>
@endforeach

View File

@ -48,7 +48,7 @@ header("Access-Control-Allow-Headers: X-Requested-With");
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "{!! $urlToDocs !!}";
url = '{{ $urlToDocs }}';
}
// Pre load translate...
@ -64,7 +64,7 @@ header("Access-Control-Allow-Headers: X-Requested-With");
log("Loaded SwaggerUI");
@if (isset($requestHeaders))
@foreach($requestHeaders as $requestKey => $requestValue)
window.authorizations.add("{!!$requestKey!!}", new ApiKeyAuthorization("{!!$requestKey!!}", "{!!$requestValue!!}", "header"));
window.authorizations.add({!! json_encode($requestKey) !!}, new ApiKeyAuthorization({!! json_encode($requestKey) !!}, {!! json_encode($requestValue) !!}, "header"));
@endforeach
@endif

View File

@ -212,7 +212,7 @@
}
function onDeleteClick() {
if (confirm("{!! trans('texts.are_you_sure') !!}")) {
if (confirm({!! json_encode(trans('texts.are_you_sure')) !!})) {
$('#action').val('delete');
$('.mainForm').submit();
}