Commit 3572684b authored by 神楽坂玲奈's avatar 神楽坂玲奈

android 4.4 fix

parent 9b48080f
...@@ -74,6 +74,7 @@ md-card-content { ...@@ -74,6 +74,7 @@ md-card-content {
.icon { .icon {
font-size: 20px; font-size: 20px;
line-height: 24px;
} }
#avatar /deep/ .mat-button-wrapper { #avatar /deep/ .mat-button-wrapper {
......
<!--https://github.com/google/material-design-icons/blob/master/iconfont/codepoints-->
<md-toolbar color="primary"> <md-toolbar color="primary">
<button id="menu" md-icon-button (click)="ygopro.openDrawer()"> <button id="menu" md-icon-button (click)="ygopro.openDrawer()">
<md-icon>menu</md-icon> <md-icon>menu</md-icon>
...@@ -44,13 +46,13 @@ ...@@ -44,13 +46,13 @@
<md-icon>games</md-icon> <md-icon>games</md-icon>
<br>房间列表</a></md-grid-tile> <br>房间列表</a></md-grid-tile>
<md-grid-tile><a md-raised-button color="primary" routerLink="/ygopro/rooms/new"> <md-grid-tile><a md-raised-button color="primary" routerLink="/ygopro/rooms/new">
<md-icon>add_box</md-icon> <md-icon>&#xe146;</md-icon><!--add_box-->
<br>创建房间</a></md-grid-tile> <br>创建房间</a></md-grid-tile>
<md-grid-tile><a md-raised-button routerLink="/ygopro/windbot"> <md-grid-tile><a md-raised-button routerLink="/ygopro/windbot">
<md-icon>airplanemode_active</md-icon> <md-icon>&#xe195;</md-icon><!-- airplanemode_active -->
<br>单人模式</a></md-grid-tile> <br>单人模式</a></md-grid-tile>
<md-grid-tile><a md-raised-button routerLink="/ygopro/watch"> <md-grid-tile><a md-raised-button routerLink="/ygopro/watch">
<md-icon>remove_red_eye</md-icon> <md-icon>&#xe417;</md-icon><!--remove_red_eye-->
<br>观战</a></md-grid-tile> <br>观战</a></md-grid-tile>
<!--<md-grid-tile>--> <!--<md-grid-tile>-->
<!--<button md-raised-button (click)="ygopro.watch_replay()">--> <!--<button md-raised-button (click)="ygopro.watch_replay()">-->
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
</md-input-container> </md-input-container>
<md-input-container *ngIf="room.private" class="full-width"> <md-input-container *ngIf="room.private" class="full-width">
<md-placeholder> <md-placeholder>
<md-icon>vpn_key</md-icon> <md-icon>&#xe0da;</md-icon><!-- vpn_key -->
<span>房间密码</span> <span>房间密码</span>
</md-placeholder> </md-placeholder>
<input #hostPasswordInput mdInput name="title" [(ngModel)]="host_password" readonly> <input #hostPasswordInput mdInput name="title" [(ngModel)]="host_password" readonly>
<button type="button" md-icon-button mdSuffix (click)="copy(host_password)"> <button type="button" md-icon-button mdSuffix (click)="copy(host_password)">
<md-icon>content_copy</md-icon> <md-icon>&#xe14d;</md-icon><!-- content_copy -->
</button> </button>
<button type="button" md-icon-button mdSuffix (click)="share(host_password)"> <button type="button" md-icon-button mdSuffix (click)="share(host_password)">
<md-icon>share</md-icon> <md-icon>share</md-icon>
......
<md-toolbar color="primary"> <md-toolbar color="primary">
<button md-icon-button (click)="history.back()"><md-icon>arrow_back</md-icon></button> <button md-icon-button (click)="history.back()">
<md-icon>&#xe5c4;</md-icon><!--arrow_back--></button>
<span><ng-content></ng-content></span> <span><ng-content></ng-content></span>
</md-toolbar> </md-toolbar>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<md-list> <md-list>
<h3 md-subheader>选择对手</h3> <h3 md-subheader>选择对手</h3>
<md-list-item (click)="ygopro.join_windbot()"> <md-list-item (click)="ygopro.join_windbot()">
<md-icon md-list-icon>airplanemode_active</md-icon> <md-icon md-list-icon>&#xe195;</md-icon><!-- airplanemode_active -->
<h4 md-line>随机</h4> <h4 md-line>随机</h4>
</md-list-item> </md-list-item>
<md-list-item *ngFor="let windbot of ygopro.windbot" (click)="ygopro.join_windbot(windbot)"> <md-list-item *ngFor="let windbot of ygopro.windbot" (click)="ygopro.join_windbot(windbot)">
......
...@@ -207,28 +207,19 @@ export class YGOProService { ...@@ -207,28 +207,19 @@ export class YGOProService {
// 那些兼容性的垃圾事儿 // 那些兼容性的垃圾事儿
// https://www.html5rocks.com/en/tutorials/pagevisibility/intro/ // https://www.html5rocks.com/en/tutorials/pagevisibility/intro/
function getHiddenProp() {
const prefixes = ['webkit', 'moz', 'ms', 'o'];
// if 'hidden' is natively supported just return it const hidden = ['hidden', 'webkitHidden', 'mozHidden', 'msHidden', 'oHidden'].find((prop) => prop in document);
if ('hidden' in document) return 'hidden'; if (hidden) {
const evtname = hidden.replace(/[H|h]idden/, '') + 'visibilitychange';
// otherwise loop over all the known prefixes until we find one Observable.fromEvent(document, evtname).subscribe(() => {
for (let i = 0; i < prefixes.length; i++) { if (!document[hidden]) {
if ((prefixes[i] + 'Hidden') in document) this.load_result();
return prefixes[i] + 'Hidden';
}
// otherwise it's not supported
return null;
} }
});
const visProp = getHiddenProp();
if (visProp) {
const evtname = visProp.replace(/[H|h]idden/, '') + 'visibilitychange';
Observable.fromEvent(document, evtname).subscribe(async () => !document[visProp] && this.load_result());
} else { } else {
alert('调试信息1,看到的话请联系zh99998@gmail.com'); Observable.fromEvent(window, 'focus').subscribe(() => {
this.load_result();
});
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"node_modules/@types" "node_modules/@types"
], ],
"lib": [ "lib": [
"es2016", "es2017",
"dom.iterable" "dom.iterable"
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment