{{ versionName }}
-{{ versionCode }}
-{{ compilationTime | coreFormatDate: "LLL Z": false }}
-{{ lastCommit }}
-{{ fileSystemRoot }}
-{{ navigator.userAgent }}
-{{ navigator.language }}
-{{ locationHref }}
-{{ appReady | translate }}
-{{ deviceType | translate }}
-{{ deviceOs | translate }}
-{{ currentLanguage }}
-{{ networkStatus | translate }}
-{{ wifiConnection | translate }}
-{{ deviceWebWorkers | translate }}
-{{ device.cordova }}
-{{ device.platform }}
-{{ device.version }}
-{{ device.model }}
-{{ device.uuid }}
-{{ pushId }}
-{{ localNotifAvailable | translate }}
-{{ 'core.settings.deviceinfo' | translate }}
+ diff --git a/src/core/settings/pages/about/about.ts b/src/core/settings/pages/about/about.ts index 4f4474d0a..4c6241663 100644 --- a/src/core/settings/pages/about/about.ts +++ b/src/core/settings/pages/about/about.ts @@ -12,17 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, } from '@angular/core'; -import { IonicPage, Platform } from 'ionic-angular'; -import { Device } from '@ionic-native/device'; +import { Component, Optional } from '@angular/core'; +import { IonicPage, NavController } from 'ionic-angular'; import { CoreAppProvider } from '@providers/app'; -import { CoreFileProvider } from '@providers/file'; -import { CoreInitDelegate } from '@providers/init'; -import { CoreLangProvider } from '@providers/lang'; -import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; import { CoreSitesProvider } from '@providers/sites'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; import { CoreConfigConstants } from '../../../../configconstants'; -import { CorePushNotificationsProvider } from '@core/pushnotifications/providers/pushnotifications'; /** * Page that displays the about settings. @@ -36,89 +31,30 @@ export class CoreSettingsAboutPage { appName: string; versionName: string; - versionCode: number; - compilationTime: number; - lastCommit: string; privacyPolicy: string; - navigator: Navigator; - locationHref: string; - appReady: string; - deviceType: string; - deviceOs: string; - currentLanguage: string; - networkStatus: string; - wifiConnection: string; - deviceWebWorkers: string; - device: Device; - fileSystemRoot: string; - fsClickable: boolean; - storageType: string; - localNotifAvailable: string; - pushId: string; - siteUrl: string; - isPrefixedUrl: boolean; - constructor(platform: Platform, device: Device, appProvider: CoreAppProvider, fileProvider: CoreFileProvider, - initDelegate: CoreInitDelegate, langProvider: CoreLangProvider, sitesProvider: CoreSitesProvider, - localNotificationsProvider: CoreLocalNotificationsProvider, pushNotificationsProvider: CorePushNotificationsProvider) { + constructor(appProvider: CoreAppProvider, + sitesProvider: CoreSitesProvider, + @Optional() private svComponent: CoreSplitViewComponent, + protected navCtrl: NavController) { const currentSite = sitesProvider.getCurrentSite(); this.appName = appProvider.isDesktop() ? CoreConfigConstants.desktopappname : CoreConfigConstants.appname; this.versionName = CoreConfigConstants.versionname; - this.versionCode = CoreConfigConstants.versioncode; - this.compilationTime = CoreConfigConstants.compilationtime; - this.lastCommit = CoreConfigConstants.lastcommit; // Calculate the privacy policy to use. this.privacyPolicy = (currentSite && (currentSite.getStoredConfig('tool_mobile_apppolicy') || currentSite.getStoredConfig('sitepolicy'))) || CoreConfigConstants.privacypolicy; + } - this.navigator = window.navigator; - if (window.location && window.location.href) { - const url = window.location.href; - this.locationHref = url.substr(0, url.indexOf('#')); - } - - this.appReady = initDelegate.isReady() ? 'core.yes' : 'core.no'; - this.deviceType = platform.is('tablet') ? 'core.tablet' : 'core.phone'; - - if (platform.is('android')) { - this.deviceOs = 'core.android'; - } else if (platform.is('ios')) { - this.deviceOs = 'core.ios'; - } else if (platform.is('windows')) { - this.deviceOs = 'core.windowsphone'; - } else { - const matches = navigator.userAgent.match(/\(([^\)]*)\)/); - if (matches && matches.length > 1) { - this.deviceOs = matches[1]; - } else { - this.deviceOs = 'core.unknown'; - } - } - - langProvider.getCurrentLanguage().then((lang) => { - this.currentLanguage = lang; - }); - - this.networkStatus = appProvider.isOnline() ? 'core.online' : 'core.offline'; - this.wifiConnection = appProvider.isWifi() ? 'core.yes' : 'core.no'; - this.deviceWebWorkers = !!window['Worker'] && !!window['URL'] ? 'core.yes' : 'core.no'; - this.device = device; - - if (fileProvider.isAvailable()) { - fileProvider.getBasePath().then((basepath) => { - this.fileSystemRoot = basepath; - this.fsClickable = fileProvider.usesHTMLAPI(); - }); - } - - this.localNotifAvailable = localNotificationsProvider.isAvailable() ? 'core.yes' : 'core.no'; - this.pushId = pushNotificationsProvider.getPushId(); - - this.siteUrl = (currentSite && currentSite.getURL()) || - (typeof CoreConfigConstants.siteurl == 'string' && CoreConfigConstants.siteurl); - this.isPrefixedUrl = !!CoreConfigConstants.siteurl; + /** + * Opens a page. + * + * @param page The component deeplink name you want to push onto the navigation stack. + */ + openPage(page: string): void { + const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; + navCtrl.push(page); } } diff --git a/src/core/settings/pages/deviceinfo/deviceinfo.html b/src/core/settings/pages/deviceinfo/deviceinfo.html new file mode 100644 index 000000000..3dc0d042b --- /dev/null +++ b/src/core/settings/pages/deviceinfo/deviceinfo.html @@ -0,0 +1,96 @@ +{{ deviceInfo.versionName }} ({{ deviceInfo.versionCode }})
+{{ deviceInfo.compilationTime | coreFormatDate: "LLL Z": false }}
+{{ deviceInfo.lastCommit }}
+{{ deviceInfo.siteVersion }}
+{{ deviceInfo.siteId }}
+{{ deviceInfo.fileSystemRoot }}
+{{ deviceInfo.fileSystemRoot }}
+{{ deviceInfo.userAgent }}
+{{ deviceInfo.browserLanguage }}
+{{ currentLangName }} ({{ deviceInfo.currentLanguage }})
+{{ deviceInfo.locationHref }}
+{{ 'core.' + deviceInfo.deviceType | translate }}
+{{ deviceInfo.deviceOsTranslated }}
+{{ deviceInfo.screen | translate }}
+{{ 'core.' + deviceInfo.networkStatus | translate }}
+{{ 'core.' + deviceInfo.wifiConnection | translate }}
+{{ deviceInfo.cordovaVersion }}
+{{ deviceInfo.platform }}
+{{ deviceInfo.osVersion }}
+{{ deviceInfo.model }}
+{{ deviceInfo.uuid }}
+{{ deviceInfo.pushId }}
+{{ 'core.' + deviceInfo.localNotifAvailable | translate }}
+{{ 'core.settings.license' | translate }}{{ 'core.labelsep' | translate }} {{ license.licenses }}
+ + + {{ 'core.view' | translate }} +