1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

Merge pull request #1667 from bitwarden/SafariDateTime

patched date & time inputs on safari
This commit is contained in:
Addison Beck 2021-03-08 16:10:08 -05:00 committed by GitHub
commit bb6112bd39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 17789 deletions

2
jslib

@ -1 +1 @@
Subproject commit b7acbcf3a7766eb0a52f21fe90505a69b4c19444 Subproject commit 125de0dd4704909f036dbad374a4cd71719de09e

17827
package-lock.json generated

File diff suppressed because it is too large Load Diff

3
src/popup/polyfills.ts Normal file
View File

@ -0,0 +1,3 @@
/* tslint:disable */
require('date-input-polyfill');
/* tslint:enable */

View File

@ -212,3 +212,9 @@ $fa-font-path: "~font-awesome/fonts";
} }
} }
} }
date-input-polyfill {
&[data-open="true"] {
z-index: 10000 !important;
}
}

View File

@ -125,9 +125,12 @@
<input id="deletionDateCustomFallback" type="date" <input id="deletionDateCustomFallback" type="date"
name="DeletionDateFallback" [(ngModel)]="deletionDateFallback" required name="DeletionDateFallback" [(ngModel)]="deletionDateFallback" required
placeholder="MM/DD/YYYY" [readOnly]="disableSend"> placeholder="MM/DD/YYYY" [readOnly]="disableSend">
<input id="deletionTimeCustomFallback" type="time" <input *ngIf="!isSafari" id="deletionTimeCustomFallback" type="time"
name="DeletionTimeDate" [(ngModel)]="deletionTimeFallback" required name="DeletionTimeDate" [(ngModel)]="deletionTimeFallback" required
placeholder="HH:MM AM/PM" [readOnly]="disableSend"> placeholder="HH:MM AM/PM" [readOnly]="disableSend">
<select *ngIf="isSafari" id="deletionTimeCustomFallback" [(ngModel)]="safariDeletionTime" name="SafariDeletionTime">
<option *ngFor="let o of safariTimeOptions('deletion')" [value]="o.military">{{o.standard}}</option>
</select>
</div> </div>
</ng-template> </ng-template>
<div class="box-content-row" *ngIf="!editMode"> <div class="box-content-row" *ngIf="!editMode">
@ -166,9 +169,12 @@
<input id="expirationDateCustomFallback" type="date" <input id="expirationDateCustomFallback" type="date"
name="ExpirationDateFallback" [(ngModel)]="expirationDateFallback" [required]="!editMode" name="ExpirationDateFallback" [(ngModel)]="expirationDateFallback" [required]="!editMode"
placeholder="MM/DD/YYYY" [readOnly]="disableSend"> placeholder="MM/DD/YYYY" [readOnly]="disableSend">
<input id="expirationTimeCustomFallback" type="time" <input *ngIf="!isSafari" id="expirationTimeCustomFallback" type="time"
name="ExpirationTimeFallback" [(ngModel)]="expirationTimeFallback" [required]="!editMode" name="ExpirationTimeFallback" [(ngModel)]="expirationTimeFallback" [required]="!editMode"
placeholder="HH:MM AM/PM" [readOnly]="disableSend"> placeholder="HH:MM AM/PM" [readOnly]="disableSend">
<select *ngIf="isSafari" id="expirationTimeCustomFallback" [(ngModel)]="safariExpirationTime" name="SafariExpirationTime">
<option *ngFor="let o of safariTimeOptions('deletion')" [value]="o.military">{{o.standard}}</option>
</select>
</div> </div>
</ng-template> </ng-template>
<div class="box-content-row" *ngIf="!editMode"> <div class="box-content-row" *ngIf="!editMode">

View File

@ -31,7 +31,6 @@ export class SendAddEditComponent extends BaseAddEditComponent {
showOptions = false; showOptions = false;
// File visibility // File visibility
isFirefox = false; isFirefox = false;
isSafari = false;
inPopout = false; inPopout = false;
inSidebar = false; inSidebar = false;
@ -69,7 +68,6 @@ export class SendAddEditComponent extends BaseAddEditComponent {
async ngOnInit() { async ngOnInit() {
// File visilibity // File visilibity
this.isFirefox = this.platformUtilsService.isFirefox(); this.isFirefox = this.platformUtilsService.isFirefox();
this.isSafari = this.platformUtilsService.isSafari();
this.inPopout = this.popupUtilsService.inPopout(window); this.inPopout = this.popupUtilsService.inPopout(window);
this.inSidebar = this.popupUtilsService.inSidebar(window); this.inSidebar = this.popupUtilsService.inSidebar(window);

View File

@ -75,7 +75,7 @@ const plugins = [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/popup/index.html', template: './src/popup/index.html',
filename: 'popup/index.html', filename: 'popup/index.html',
chunks: ['popup/vendor-angular', 'popup/vendor', 'popup/main'], chunks: ['popup/polyfills', 'popup/vendor-angular', 'popup/vendor', 'popup/main'],
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './src/background.html', template: './src/background.html',
@ -130,6 +130,7 @@ const config = {
mode: ENV, mode: ENV,
devtool: false, devtool: false,
entry: { entry: {
'popup/polyfills': './src/popup/polyfills.ts',
'popup/main': './src/popup/main.ts', 'popup/main': './src/popup/main.ts',
'background': './src/background.ts', 'background': './src/background.ts',
'content/autofill': './src/content/autofill.js', 'content/autofill': './src/content/autofill.js',