1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Corrected form autocomplete behavior

This commit is contained in:
Hillel Coren 2015-11-09 16:53:18 +02:00
parent 7542cb479f
commit 02aa10e41d
8 changed files with 152 additions and 91 deletions

View File

@ -31628,7 +31628,7 @@ function GetPdfMake(invoice, javascript, callback) {
}
// only show the footer on the last page
if (key === 'footer') {
if (invoice.is_pro && key === 'footer') {
return function(page, pages) {
return page === pages ? val : '';
}
@ -31638,6 +31638,7 @@ function GetPdfMake(invoice, javascript, callback) {
if (key === 'text') {
val = NINJA.parseMarkdownText(val, true);
}
/*
if (key === 'stack') {
val = NINJA.parseMarkdownStack(val);

View File

@ -55,7 +55,7 @@ function GetPdfMake(invoice, javascript, callback) {
}
// only show the footer on the last page
if (key === 'footer') {
if (invoice.is_pro && key === 'footer') {
return function(page, pages) {
return page === pages ? val : '';
}
@ -65,6 +65,7 @@ function GetPdfMake(invoice, javascript, callback) {
if (key === 'text') {
val = NINJA.parseMarkdownText(val, true);
}
/*
if (key === 'stack') {
val = NINJA.parseMarkdownStack(val);

View File

@ -18,9 +18,12 @@
</style>
{!! Former::open_for_files()->addClass('warn-on-exit')->rules(array(
'name' => 'required',
)) !!}
{!! Former::open_for_files()
->addClass('warn-on-exit')
->autocomplete('on')
->rules([
'name' => 'required'
]) !!}
{{ Former::populate($account) }}
@ -62,12 +65,13 @@
</div>
<div class="panel-body form-padding-right">
{!! Former::text('address1') !!}
{!! Former::text('address2') !!}
{!! Former::text('city') !!}
{!! Former::text('state') !!}
{!! Former::text('postal_code') !!}
{!! Former::select('country_id')->addOption('','')
{!! Former::text('address1')->autocomplete('address-line1') !!}
{!! Former::text('address2')->autocomplete('address-line2') !!}
{!! Former::text('city')->autocomplete('address-level2') !!}
{!! Former::text('state')->autocomplete('address-level1') !!}
{!! Former::text('postal_code')->autocomplete('postal-code') !!}
{!! Former::select('country_id')
->addOption('','')
->fromQuery($countries, 'name', 'id') !!}
</div>

View File

@ -14,11 +14,14 @@
<div class="row">
{!! Former::open($url)
->autocomplete('off')
->rules(
['email' => 'email']
)->addClass('col-md-12 warn-on-exit')
->method($method) !!}
@include('partials.autocomplete_fix')
@if ($client)
{!! Former::populate($client) !!}
{!! Former::hidden('public_id') !!}

View File

@ -539,7 +539,7 @@
<div style="background-color: #fff; padding-right:20px" id="signUpDiv" onkeyup="validateSignUp()" onclick="validateSignUp()" onkeydown="checkForEnter(event)">
<br/>
{!! Former::open('signup/submit')->addClass('signUpForm') !!}
{!! Former::open('signup/submit')->addClass('signUpForm')->autocomplete('on') !!}
@if (Auth::check())
{!! Former::populateField('new_first_name', Auth::user()->first_name) !!}
@ -580,10 +580,23 @@
@endif
{{ Former::setOption('TwitterBootstrap3.labelWidths.large', 1) }}
{{ Former::setOption('TwitterBootstrap3.labelWidths.small', 1) }}
{!! Former::text('new_first_name')->placeholder(trans('texts.first_name'))->label(' ') !!}
{!! Former::text('new_last_name')->placeholder(trans('texts.last_name'))->label(' ') !!}
{!! Former::text('new_email')->placeholder(trans('texts.email'))->label(' ') !!}
{!! Former::password('new_password')->placeholder(trans('texts.password'))->label(' ') !!}
{!! Former::text('new_first_name')
->placeholder(trans('texts.first_name'))
->autocomplete('given-name')
->label(' ') !!}
{!! Former::text('new_last_name')
->placeholder(trans('texts.last_name'))
->autocomplete('family-name')
->label(' ') !!}
{!! Former::text('new_email')
->placeholder(trans('texts.email'))
->autocomplete('email')
->label(' ') !!}
{!! Former::password('new_password')
->placeholder(trans('texts.password'))
->label(' ') !!}
{{ Former::setOption('TwitterBootstrap3.labelWidths.large', 4) }}
{{ Former::setOption('TwitterBootstrap3.labelWidths.small', 4) }}
</div>

View File

@ -30,12 +30,17 @@
</ol>
@endif
{!! Former::open($url)->method($method)->addClass('warn-on-exit')->rules(array(
{!! Former::open($url)
->method($method)
->addClass('warn-on-exit')
->autocomplete('off')
->rules(array(
'client' => 'required',
'invoice_number' => 'required',
'product_key' => 'max:255'
)) !!}
@include('partials.autocomplete_fix')
<input type="submit" style="display:none" name="submitButton" id="submitButton">

View File

@ -0,0 +1,4 @@
<!-- http://stackoverflow.com/a/30873633/497368 -->
<div style="display: none;">
<input type="text" id="PreventChromeAutocomplete" name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>

View File

@ -133,7 +133,9 @@ header h3 em {
</style>
{!! Former::vertical_open($url)->rules(array(
{!! Former::vertical_open($url)
->autocomplete('on')
->rules(array(
'first_name' => 'required',
'last_name' => 'required',
'card_number' => 'required',
@ -191,16 +193,25 @@ header h3 em {
<h3>{{ trans('texts.contact_information') }}</h3>
<div class="row">
<div class="col-md-6">
{!! Former::text('first_name')->placeholder(trans('texts.first_name'))->label('') !!}
{!! Former::text('first_name')
->placeholder(trans('texts.first_name'))
->autocomplete('given-name')
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('last_name')->placeholder(trans('texts.last_name'))->label('') !!}
{!! Former::text('last_name')
->placeholder(trans('texts.last_name'))
->autocomplete('family-name')
->label('') !!}
</div>
</div>
@if (isset($paymentTitle))
<div class="row">
<div class="col-md-12">
{!! Former::text('email')->placeholder(trans('texts.email'))->label('') !!}
{!! Former::text('email')
->placeholder(trans('texts.email'))
->autocomplete('email')
->label('') !!}
</div>
</div>
@endif
@ -211,26 +222,45 @@ header h3 em {
<h3>{{ trans('texts.billing_address') }} &nbsp;<span class="help">{{ trans('texts.payment_footer1') }}</span></h3>
<div class="row">
<div class="col-md-6">
{!! Former::text('address1')->placeholder(trans('texts.address1'))->label('') !!}
{!! Former::text('address1')
->autocomplete('address-line1')
->placeholder(trans('texts.address1'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('address2')->placeholder(trans('texts.address2'))->label('') !!}
{!! Former::text('address2')
->autocomplete('address-line2')
->placeholder(trans('texts.address2'))
->label('') !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Former::text('city')->placeholder(trans('texts.city'))->label('') !!}
{!! Former::text('city')
->autocomplete('address-level2')
->placeholder(trans('texts.city'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('state')->placeholder(trans('texts.state'))->label('') !!}
{!! Former::text('state')
->autocomplete('address-level1')
->placeholder(trans('texts.state'))
->label('') !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Former::text('postal_code')->placeholder(trans('texts.postal_code'))->label('') !!}
{!! Former::text('postal_code')
->autocomplete('postal-code')
->placeholder(trans('texts.postal_code'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::select('country_id')->placeholder(trans('texts.country_id'))->fromQuery($countries, 'name', 'id')->label('')->addGroupClass('country-select') !!}
{!! Former::select('country_id')
->placeholder(trans('texts.country_id'))
->fromQuery($countries, 'name', 'id')
->addGroupClass('country-select')
->label('') !!}
</div>
</div>
@ -240,15 +270,23 @@ header h3 em {
<h3>{{ trans('texts.billing_method') }}</h3>
<div class="row">
<div class="col-md-9">
{!! Former::text('card_number')->placeholder(trans('texts.card_number'))->label('') !!}
{!! Former::text('card_number')
->placeholder(trans('texts.card_number'))
->autocomplete('cc-number')
->label('') !!}
</div>
<div class="col-md-3">
{!! Former::text('cvv')->placeholder(trans('texts.cvv'))->label('') !!}
{!! Former::text('cvv')
->placeholder(trans('texts.cvv'))
->autocomplete('off')
->label('') !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Former::select('expiration_month')->placeholder(trans('texts.expiration_month'))
{!! Former::select('expiration_month')
->autocomplete('cc-exp-month')
->placeholder(trans('texts.expiration_month'))
->addOption('01 - January', '1')
->addOption('02 - February', '2')
->addOption('03 - March', '3')
@ -264,7 +302,9 @@ header h3 em {
!!}
</div>
<div class="col-md-6">
{!! Former::select('expiration_year')->placeholder(trans('texts.expiration_year'))
{!! Former::select('expiration_year')
->autocomplete('cc-exp-year')
->placeholder(trans('texts.expiration_year'))
->addOption('2015', '2015')
->addOption('2016', '2016')
->addOption('2017', '2017')
@ -322,16 +362,6 @@ header h3 em {
</div>
<!--
@if (isset($paymentTitle))
<h2>{{ $paymentTitle }}<br/>
@if (isset($paymentSubtitle))
<small>{{ $paymentSubtitle }}</small>
@endif
</h2>&nbsp;<p/>
@endif
-->
{!! Former::close() !!}
<script type="text/javascript">