Skip to content

Commit

Permalink
refactor: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfong committed Jan 9, 2022
1 parent cf9a600 commit 6a64753
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 222 deletions.
4 changes: 0 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { IonicStorageModule } from '@ionic/storage-angular';
//import { Clipboard } from '@ionic-native/clipboard/ngx';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { CallNumber } from '@ionic-native/call-number/ngx';
import { SMS } from '@ionic-native/sms/ngx';
import { ThemeDetection } from '@ionic-native/theme-detection/ngx';
//import { Device } from '@ionic-native/device/ngx';
import { AppVersion } from '@ionic-native/app-version/ngx';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
//import { Camera } from '@ionic-native/camera/ngx';
import { File } from '@ionic-native/file/ngx';

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand Down Expand Up @@ -70,7 +67,6 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
AppVersion,
CallNumber,
// Camera,
DatePipe,
DeviceMotion,
File,
Expand Down
57 changes: 0 additions & 57 deletions src/app/pages/history/history.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ export class HistoryPage {
}

async ionViewDidEnter() {
// const loading = await this.presentLoading(this.translate.instant("PLEASE_WAIT"));
await this.loadItems();
// loading.dismiss();
this.firstLoad = false;
if (this.env.notShowHistoryTutorial === false) {
this.env.notShowHistoryTutorial = true;
Expand Down Expand Up @@ -209,61 +207,6 @@ export class HistoryPage {
}
}

// async openMenu(ev: Event) {
// const menuItems = [];

// const tutorialMenuItem = new MenuItem();
// tutorialMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'book',
// color: 'primary'
// };
// tutorialMenuItem.label = 'TUTORIAL';
// tutorialMenuItem.action = 'tutorial';
// menuItems.push(tutorialMenuItem);

// const removeAllMenuItem = new MenuItem();
// removeAllMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'trash',
// color: 'danger'
// };
// removeAllMenuItem.label = 'REMOVE_ALL';
// removeAllMenuItem.action = 'remove';
// menuItems.push(removeAllMenuItem);

// const popover = await this.popoverController.create({
// component: MenuComponent,
// mode: "ios",
// animated: true,
// event: ev,
// translucent: false,
// showBackdrop: true,
// componentProps: { menuItems }
// });
// popover.onWillDismiss().then(
// async (result) => {
// if (result.data != null && result.data?.action != null) {
// const action = result.data?.action as 'tutorial' | 'remove';
// switch (action) {
// case 'tutorial':
// const modal = await this.modalController.create({
// component: HistoryTutorialPage,
// cssClass: 'tutorial-modal-page',
// componentProps: {
// }
// });
// modal.present();
// break;
// case 'remove':
// await this.removeAll();
// break;
// }
// }
// });
// await popover.present();
// }

async presentAlert(msg: string, head: string, buttonText: string, buttonless: boolean = false): Promise<HTMLIonAlertElement> {
let alert: any;
if (!buttonless) {
Expand Down
1 change: 0 additions & 1 deletion src/app/pages/import-image/import-image.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class ImportImagePage {
private alertController: AlertController,
private loadingController: LoadingController,
private toastController: ToastController,
// private camera: Camera,
private router: Router,
) { }

Expand Down
161 changes: 1 addition & 160 deletions src/app/pages/result/result.page.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { CallNumber } from '@ionic-native/call-number/ngx';
// import { Clipboard } from '@ionic-native/clipboard/ngx';
import { Clipboard } from '@capacitor/clipboard';
import { Contacts, ContactType, EmailAddress, NewContact, PhoneNumber } from '@capacitor-community/contacts'
import { SMS } from '@ionic-native/sms/ngx';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { Haptics, ImpactStyle, NotificationType } from '@capacitor/haptics';
import { Haptics, ImpactStyle } from '@capacitor/haptics';
import { AlertController, LoadingController, ModalController, Platform, PopoverController, ToastController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core';
import { NgxQrcodeElementTypes, NgxQrcodeErrorCorrectionLevels } from '@techiediaries/ngx-qrcode';
import { VCardContact } from 'src/app/models/v-card-contact';
import { EnvService } from 'src/app/services/env.service';
import { MenuItem } from 'src/app/models/menu-item';
import { MenuComponent } from 'src/app/components/menu/menu.component';
import { QrcodeComponent } from 'src/app/components/qrcode/qrcode.component';

@Component({
Expand Down Expand Up @@ -50,8 +47,6 @@ export class ResultPage implements OnInit {
base64Decoded: boolean = false;
base64DecodedText: string = "";

// webToast: HTMLIonToastElement;

bookmarked: boolean = false;

constructor(
Expand Down Expand Up @@ -89,58 +84,11 @@ export class ResultPage implements OnInit {
}, 200
);
}
// if (this.contentType === "url") {
// this.webToast = await this.toastController.create({
// header: this.translate.instant('WEBSITE'),
// message: `${this.qrCodeContent}`,
// duration: 3000,
// mode: "ios",
// color: "light",
// position: "top",
// buttons: [
// {
// text: this.translate.instant('OPEN'),
// side: 'end',
// handler: () => {
// this.browseWebsite();
// this.webToast.dismiss();
// }
// }
// ]
// });
// this.webToast.present();
// }
// if (this.contentType === "wifi") {
// if (this.wifiSSID) {
// this.webToast = await this.toastController.create({
// header: this.translate.instant('WIFI_NETWORK'),
// message: `SSID: ${this.wifiSSID}`,
// duration: 3000,
// mode: "ios",
// color: "light",
// position: "top",
// buttons: [
// {
// text: this.translate.instant('CONNECT'),
// side: 'end',
// handler: async () => {
// await this.connectWifi();
// }
// }
// ]
// });
// this.webToast.present();
// }
// }
}

async ionViewWillLeave(): Promise<void> {
this.base64Decoded = false;
this.base64Encoded = false;
// if (this.webToast) {
// this.webToast.dismiss();
// this.webToast = undefined;
// }
}

setContentType(): void {
Expand Down Expand Up @@ -182,12 +130,10 @@ export class ResultPage implements OnInit {
}

get qrColorDark(): string {
// return this.env.colorTheme === "dark" ? "#ffffff" : "#222428";
return "#222428";
}

get qrColorLight(): string {
// return this.env.colorTheme === "dark" ? "#121212" : "#ffffff";
return "#ffffff";
}

Expand Down Expand Up @@ -692,111 +638,6 @@ export class ResultPage implements OnInit {
}
}

// async openMenu(ev: Event) {
// const menuItems = [];

// const browseWebsiteMenuItem = new MenuItem();
// browseWebsiteMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'globe',
// color: 'primary'
// };
// browseWebsiteMenuItem.label = 'BROWSE_WEBSITE';
// browseWebsiteMenuItem.action = 'browse';

// const addContactMenuItem = new MenuItem();
// addContactMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'person-add-sharp',
// color: 'primary'
// };
// addContactMenuItem.label = 'ADD_CONTACT';
// addContactMenuItem.action = 'contact';

// const callMenuItem = new MenuItem();
// callMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'call',
// color: 'primary'
// };
// callMenuItem.label = 'CALL';
// callMenuItem.action = 'call';

// const sendMessageMenuItem = new MenuItem();
// sendMessageMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'send',
// color: 'primary'
// };
// sendMessageMenuItem.label = 'SEND_MESSAGE';
// sendMessageMenuItem.action = 'message';

// const sendEmailMenuItem = new MenuItem();
// sendEmailMenuItem.icon = {
// nameOrSrc: 'name',
// ref: 'mail',
// color: 'primary'
// };
// sendEmailMenuItem.label = 'SEND_EMAIL';
// sendEmailMenuItem.action = 'email';

// switch (this.contentType) {
// case "url":
// menuItems.push(browseWebsiteMenuItem);
// break;
// case "contact":
// menuItems.push(addContactMenuItem);
// break;
// case "phone":
// menuItems.push(callMenuItem);
// menuItems.push(addContactMenuItem);
// break;
// case "sms":
// if (this.smsContent) {
// menuItems.push(sendMessageMenuItem);
// }
// menuItems.push(addContactMenuItem);
// break;
// case "email":
// menuItems.push(sendEmailMenuItem);
// break;
// }

// const popover = await this.popoverController.create({
// component: MenuComponent,
// mode: "ios",
// animated: true,
// event: ev,
// translucent: false,
// showBackdrop: true,
// componentProps: { menuItems }
// });
// popover.onWillDismiss().then(
// async (result) => {
// if (result.data != null && result.data?.action != null) {
// const action = result.data?.action as 'browse' | 'contact' | 'call' | 'message' | 'email';
// switch (action) {
// case 'browse':
// this.browseWebsite();
// break;
// case 'contact':
// this.addContact();
// break;
// case 'call':
// this.callPhone();
// break;
// case 'message':
// this.sendSms();
// break;
// case 'email':
// this.sendEmail();
// break;
// }
// }
// });
// await popover.present();
// }

async presentToast(msg: string, msTimeout: number, pos: "top" | "middle" | "bottom", align: "left" | "center", size: "short" | "long") {
if (size === "long") {
if (align === "left") {
Expand Down

0 comments on commit 6a64753

Please sign in to comment.