|
|
@ -6,14 +6,14 @@ import {
|
|
|
|
Platform,
|
|
|
|
Platform,
|
|
|
|
PopoverController,
|
|
|
|
PopoverController,
|
|
|
|
LoadingController,
|
|
|
|
LoadingController,
|
|
|
|
ToastController
|
|
|
|
ToastController, NavController
|
|
|
|
} from '@ionic/angular';
|
|
|
|
} from '@ionic/angular';
|
|
|
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
|
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
|
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
|
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
|
|
import { ApiService } from './service/api.service';
|
|
|
|
import { ApiService } from './service/api.service';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
import {TREE_ACTIONS, TreeComponent} from '@circlon/angular-tree-component';
|
|
|
|
import {TREE_ACTIONS, TreeComponent} from '@circlon/angular-tree-component';
|
|
|
|
import {BehaviorSubject, Observable} from 'rxjs';
|
|
|
|
import {BehaviorSubject, fromEvent, Observable} from 'rxjs';
|
|
|
|
import {OptionPickerComponent} from './components/option-picker/option-picker.component';
|
|
|
|
import {OptionPickerComponent} from './components/option-picker/option-picker.component';
|
|
|
|
import {OptionMenuComponent} from './components/option-menu/option-menu.component';
|
|
|
|
import {OptionMenuComponent} from './components/option-menu/option-menu.component';
|
|
|
|
import {SelectorComponent} from './components/sharing/selector/selector.component';
|
|
|
|
import {SelectorComponent} from './components/sharing/selector/selector.component';
|
|
|
@ -83,6 +83,7 @@ export class AppComponent implements OnInit {
|
|
|
|
protected versionInterval?: any;
|
|
|
|
protected versionInterval?: any;
|
|
|
|
protected showedNewVersionAlert = false;
|
|
|
|
protected showedNewVersionAlert = false;
|
|
|
|
protected showedOfflineAlert = false;
|
|
|
|
protected showedOfflineAlert = false;
|
|
|
|
|
|
|
|
protected backbuttonSubscription: any;
|
|
|
|
protected initialized$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
|
|
|
protected initialized$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
constructor(
|
|
|
@ -90,6 +91,7 @@ export class AppComponent implements OnInit {
|
|
|
|
private splashScreen: SplashScreen,
|
|
|
|
private splashScreen: SplashScreen,
|
|
|
|
private statusBar: StatusBar,
|
|
|
|
private statusBar: StatusBar,
|
|
|
|
public readonly api: ApiService,
|
|
|
|
public readonly api: ApiService,
|
|
|
|
|
|
|
|
protected navCtrl: NavController,
|
|
|
|
protected router: Router,
|
|
|
|
protected router: Router,
|
|
|
|
protected alerts: AlertController,
|
|
|
|
protected alerts: AlertController,
|
|
|
|
protected popover: PopoverController,
|
|
|
|
protected popover: PopoverController,
|
|
|
@ -129,6 +131,17 @@ export class AppComponent implements OnInit {
|
|
|
|
this.initializeApp();
|
|
|
|
this.initializeApp();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@HostListener('window:popstate', ['$event'])
|
|
|
|
|
|
|
|
dismissModal(event) {
|
|
|
|
|
|
|
|
const modal = this.modal.getTop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( modal ) {
|
|
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
|
|
|
this.modal.dismiss();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showOptions($event) {
|
|
|
|
showOptions($event) {
|
|
|
|
this.popover.create({
|
|
|
|
this.popover.create({
|
|
|
|
event: $event,
|
|
|
|
event: $event,
|
|
|
@ -152,8 +165,16 @@ export class AppComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
const modal = await this.modal.create({
|
|
|
|
const modal = await this.modal.create({
|
|
|
|
component: SearchComponent,
|
|
|
|
component: SearchComponent,
|
|
|
|
|
|
|
|
cssClass: 'modal-med',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const modalState = {
|
|
|
|
|
|
|
|
modal : true,
|
|
|
|
|
|
|
|
desc : 'Search everything'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
history.pushState(modalState, null);
|
|
|
|
|
|
|
|
|
|
|
|
this.hasSearchOpen = true;
|
|
|
|
this.hasSearchOpen = true;
|
|
|
|
await modal.present();
|
|
|
|
await modal.present();
|
|
|
|
|
|
|
|
|
|
|
@ -208,10 +229,18 @@ export class AppComponent implements OnInit {
|
|
|
|
if ( result.data === 'share' ) {
|
|
|
|
if ( result.data === 'share' ) {
|
|
|
|
this.modal.create({
|
|
|
|
this.modal.create({
|
|
|
|
component: SelectorComponent,
|
|
|
|
component: SelectorComponent,
|
|
|
|
|
|
|
|
cssClass: 'modal-med',
|
|
|
|
componentProps: {
|
|
|
|
componentProps: {
|
|
|
|
node: this.menuTarget.data,
|
|
|
|
node: this.menuTarget.data,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).then(modal => {
|
|
|
|
}).then(modal => {
|
|
|
|
|
|
|
|
const modalState = {
|
|
|
|
|
|
|
|
modal : true,
|
|
|
|
|
|
|
|
desc : 'Share page'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
history.pushState(modalState, null);
|
|
|
|
|
|
|
|
|
|
|
|
modal.present();
|
|
|
|
modal.present();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if ( result.data === 'export_html' ) {
|
|
|
|
} else if ( result.data === 'export_html' ) {
|
|
|
|