forked from EVOgeek/Vmeda.Online
		
	
						commit
						91dfc0b9f8
					
				
							
								
								
									
										4356
									
								
								licenses.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4356
									
								
								licenses.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1195,12 +1195,14 @@ | ||||
|     "@types/cordova": { | ||||
|       "version": "0.0.34", | ||||
|       "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", | ||||
|       "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" | ||||
|       "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "@types/cordova-plugin-file": { | ||||
|       "version": "4.3.2", | ||||
|       "resolved": "https://registry.npmjs.org/@types/cordova-plugin-file/-/cordova-plugin-file-4.3.2.tgz", | ||||
|       "integrity": "sha512-kCvVcLxo2M6NxBCngW8JuFlS3YpsqE6VcH9PKnOdWwtpCBTi7WXhQU9kb0h0/TVX5Bp8ab+qLz0mm9wSkcXdXg==", | ||||
|       "dev": true, | ||||
|       "requires": { | ||||
|         "cordova-plugin-file": "*" | ||||
|       } | ||||
| @ -1209,6 +1211,7 @@ | ||||
|       "version": "0.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/@types/cordova-plugin-file-transfer/-/cordova-plugin-file-transfer-0.0.3.tgz", | ||||
|       "integrity": "sha1-u6d+jQTQejlRR5eiA8JXxbECNoA=", | ||||
|       "dev": true, | ||||
|       "requires": { | ||||
|         "@types/cordova-plugin-file": "*" | ||||
|       } | ||||
| @ -1216,12 +1219,14 @@ | ||||
|     "@types/cordova-plugin-globalization": { | ||||
|       "version": "0.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/@types/cordova-plugin-globalization/-/cordova-plugin-globalization-0.0.3.tgz", | ||||
|       "integrity": "sha1-ySA6HENtPS0DBXiffJwrq6i6KK0=" | ||||
|       "integrity": "sha1-ySA6HENtPS0DBXiffJwrq6i6KK0=", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "@types/cordova-plugin-network-information": { | ||||
|       "version": "0.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/@types/cordova-plugin-network-information/-/cordova-plugin-network-information-0.0.3.tgz", | ||||
|       "integrity": "sha1-+iycaufkxX8Tt39pXaTtuzr6oBY=" | ||||
|       "integrity": "sha1-+iycaufkxX8Tt39pXaTtuzr6oBY=", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "@types/events": { | ||||
|       "version": "3.0.0", | ||||
| @ -1251,7 +1256,8 @@ | ||||
|     "@types/promise.prototype.finally": { | ||||
|       "version": "2.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/@types/promise.prototype.finally/-/promise.prototype.finally-2.0.2.tgz", | ||||
|       "integrity": "sha512-Fs99h+iFQZ4ZY2vO3+uJCrx+5KQnJ4FPerZ3oT/1L5aA7vnmK/d7Z/Ml1yHtNCh9UQcjFTR4Xo/Jss2f39Fgtw==" | ||||
|       "integrity": "sha512-Fs99h+iFQZ4ZY2vO3+uJCrx+5KQnJ4FPerZ3oT/1L5aA7vnmK/d7Z/Ml1yHtNCh9UQcjFTR4Xo/Jss2f39Fgtw==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "abbrev": { | ||||
|       "version": "1.1.1", | ||||
|  | ||||
							
								
								
									
										12
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								package.json
									
									
									
									
									
								
							| @ -73,12 +73,6 @@ | ||||
|     "@ionic-native/zip": "^4.17.0", | ||||
|     "@ngx-translate/core": "^8.0.0", | ||||
|     "@ngx-translate/http-loader": "^2.0.1", | ||||
|     "@types/cordova": "^0.0.34", | ||||
|     "@types/cordova-plugin-file-transfer": "^0.0.3", | ||||
|     "@types/cordova-plugin-globalization": "^0.0.3", | ||||
|     "@types/cordova-plugin-network-information": "^0.0.3", | ||||
|     "@types/node": "^8.10.19", | ||||
|     "@types/promise.prototype.finally": "^2.0.2", | ||||
|     "ajv": "^6.10.2", | ||||
|     "chart.js": "^2.7.2", | ||||
|     "com-darryncampbell-cordova-plugin-intent": "^1.3.0", | ||||
| @ -127,6 +121,12 @@ | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@ionic/app-scripts": "3.2.2", | ||||
|     "@types/cordova": "^0.0.34", | ||||
|     "@types/cordova-plugin-file-transfer": "^0.0.3", | ||||
|     "@types/cordova-plugin-globalization": "^0.0.3", | ||||
|     "@types/cordova-plugin-network-information": "^0.0.3", | ||||
|     "@types/node": "^8.10.19", | ||||
|     "@types/promise.prototype.finally": "^2.0.2", | ||||
|     "electron-builder-lib": "^20.23.1", | ||||
|     "electron-rebuild": "^1.8.1", | ||||
|     "gulp": "4.0.2", | ||||
|  | ||||
| @ -19,6 +19,40 @@ if [ "$TRAVIS_BRANCH" == 'master' ] && [ ! -z $GIT_TOKEN ] && [ "$TRAVIS_REPO_SL | ||||
|     git add */en.json | ||||
|     git add src/config.json | ||||
|     git commit -m 'Update lang files [ci skip]' | ||||
| 
 | ||||
|     print_title "Update Licenses" | ||||
|     npm install -g license-checker | ||||
| 
 | ||||
|     jq --version | ||||
|     license-checker --json --production --relativeLicensePath > licenses.json | ||||
|     jq 'del(.[].path)' licenses.json > licenses_old.json | ||||
|     mv licenses_old.json licenses.json | ||||
|     licenses=`jq -r 'keys[]' licenses.json` | ||||
|     echo "{" > licensesurl.json | ||||
|     first=1 | ||||
|     for license in $licenses; do | ||||
|         obj=`jq --arg lic $license '.[$lic]' licenses.json` | ||||
|         licensePath=`echo $obj | jq -r '.licenseFile'` | ||||
|         file="" | ||||
|         if [[ ! -z "$licensePath" ]] || [[ "$licensePath" != "null" ]]; then | ||||
|             file=$(basename $licensePath) | ||||
|             if [ $first -eq 1 ] ; then | ||||
|                 first=0 | ||||
|                 echo "\"$license\" : { \"licenseFile\" : \"$file\"}" >> licensesurl.json | ||||
|             else | ||||
|                 echo ",\"$license\" : { \"licenseFile\" : \"$file\"}" >> licensesurl.json | ||||
|             fi | ||||
|         fi | ||||
|     done | ||||
|     echo "}" >> licensesurl.json | ||||
| 
 | ||||
|     jq -s '.[0] * .[1]' licenses.json licensesurl.json > licenses_old.json | ||||
|     mv licenses_old.json licenses.json | ||||
|     rm licensesurl.json | ||||
| 
 | ||||
|     git add licenses.json | ||||
|     git commit -m 'Update licenses [ci skip]' | ||||
| 
 | ||||
|     git push origin HEAD:$TRAVIS_BRANCH | ||||
| fi | ||||
| 
 | ||||
|  | ||||
| @ -1322,12 +1322,12 @@ | ||||
|   "core.all": "moodle", | ||||
|   "core.allgroups": "moodle", | ||||
|   "core.allparticipants": "moodle", | ||||
|   "core.android": "local_moodlemobileapp", | ||||
|   "core.answer": "moodle", | ||||
|   "core.answered": "quiz", | ||||
|   "core.areyousure": "moodle", | ||||
|   "core.back": "moodle", | ||||
|   "core.block.blocks": "moodle", | ||||
|   "core.browser": "local_moodlemobileapp", | ||||
|   "core.cancel": "moodle", | ||||
|   "core.cannotconnect": "local_moodlemobileapp", | ||||
|   "core.cannotdownloadfiles": "local_moodlemobileapp", | ||||
| @ -1465,6 +1465,7 @@ | ||||
|   "core.deleteduser": "bulkusers", | ||||
|   "core.deleting": "local_moodlemobileapp", | ||||
|   "core.description": "moodle", | ||||
|   "core.desktop": "local_moodlemobileapp", | ||||
|   "core.dfdaymonthyear": "local_moodlemobileapp", | ||||
|   "core.dfdayweekmonth": "local_moodlemobileapp", | ||||
|   "core.dffulldate": "local_moodlemobileapp", | ||||
| @ -1651,7 +1652,6 @@ | ||||
|   "core.imageviewer": "local_moodlemobileapp", | ||||
|   "core.info": "moodle", | ||||
|   "core.invalidformdata": "error", | ||||
|   "core.ios": "local_moodlemobileapp", | ||||
|   "core.labelsep": "langconfig", | ||||
|   "core.lastaccess": "moodle", | ||||
|   "core.lastdownloaded": "local_moodlemobileapp", | ||||
| @ -1890,7 +1890,7 @@ | ||||
|   "core.sending": "chat", | ||||
|   "core.serverconnection": "error", | ||||
|   "core.settings.about": "local_moodlemobileapp", | ||||
|   "core.settings.appready": "local_moodlemobileapp", | ||||
|   "core.settings.appversion": "local_moodlemobileapp", | ||||
|   "core.settings.cannotsyncoffline": "local_moodlemobileapp", | ||||
|   "core.settings.cannotsyncwithoutwifi": "local_moodlemobileapp", | ||||
|   "core.settings.colorscheme": "local_moodlemobileapp", | ||||
| @ -1898,6 +1898,7 @@ | ||||
|   "core.settings.colorscheme-dark": "local_moodlemobileapp", | ||||
|   "core.settings.colorscheme-light": "local_moodlemobileapp", | ||||
|   "core.settings.compilationinfo": "local_moodlemobileapp", | ||||
|   "core.settings.copyinfo": "local_moodlemobileapp", | ||||
|   "core.settings.cordovadevicemodel": "local_moodlemobileapp", | ||||
|   "core.settings.cordovadeviceosversion": "local_moodlemobileapp", | ||||
|   "core.settings.cordovadeviceplatform": "local_moodlemobileapp", | ||||
| @ -1910,7 +1911,6 @@ | ||||
|   "core.settings.deletesitefilestitle": "local_moodlemobileapp", | ||||
|   "core.settings.deviceinfo": "local_moodlemobileapp", | ||||
|   "core.settings.deviceos": "local_moodlemobileapp", | ||||
|   "core.settings.devicewebworkers": "local_moodlemobileapp", | ||||
|   "core.settings.disableall": "message", | ||||
|   "core.settings.disabled": "lesson", | ||||
|   "core.settings.displayformat": "local_moodlemobileapp", | ||||
| @ -1939,19 +1939,21 @@ | ||||
|   "core.settings.navigatorlanguage": "local_moodlemobileapp", | ||||
|   "core.settings.navigatoruseragent": "local_moodlemobileapp", | ||||
|   "core.settings.networkstatus": "local_moodlemobileapp", | ||||
|   "core.settings.opensourcelicenses": "local_moodlemobileapp", | ||||
|   "core.settings.privacypolicy": "local_moodlemobileapp", | ||||
|   "core.settings.publisher": "local_moodlemobileapp", | ||||
|   "core.settings.pushid": "local_moodlemobileapp", | ||||
|   "core.settings.reportinbackground": "local_moodlemobileapp", | ||||
|   "core.settings.screen": "local_moodlemobileapp", | ||||
|   "core.settings.settings": "moodle", | ||||
|   "core.settings.showdownloadoptions": "local_moodlemobileapp", | ||||
|   "core.settings.siteinfo": "local_moodlemobileapp", | ||||
|   "core.settings.sites": "moodle", | ||||
|   "core.settings.spaceusage": "local_moodlemobileapp", | ||||
|   "core.settings.synchronization": "local_moodlemobileapp", | ||||
|   "core.settings.synchronizenow": "local_moodlemobileapp", | ||||
|   "core.settings.syncsettings": "local_moodlemobileapp", | ||||
|   "core.settings.total": "moodle", | ||||
|   "core.settings.versioncode": "local_moodlemobileapp", | ||||
|   "core.settings.versionname": "local_moodlemobileapp", | ||||
|   "core.settings.wificonnection": "local_moodlemobileapp", | ||||
|   "core.sharedfiles.chooseaccountstorefile": "local_moodlemobileapp", | ||||
|   "core.sharedfiles.chooseactionrepeatedfile": "local_moodlemobileapp", | ||||
| @ -2069,7 +2071,6 @@ | ||||
|   "core.whoops": "local_moodlemobileapp", | ||||
|   "core.whyisthishappening": "local_moodlemobileapp", | ||||
|   "core.whyisthisrequired": "moodle", | ||||
|   "core.windowsphone": "local_moodlemobileapp", | ||||
|   "core.wsfunctionnotavailable": "local_moodlemobileapp", | ||||
|   "core.year": "moodle", | ||||
|   "core.years": "moodle", | ||||
|  | ||||
| @ -205,6 +205,10 @@ ion-app.app-root { | ||||
|     background-color: $gray-light; | ||||
|   } | ||||
| 
 | ||||
|   ion-note.core-note-block { | ||||
|     display: block; | ||||
|   } | ||||
| 
 | ||||
|   // Form items | ||||
|   // ------------------------- | ||||
| 
 | ||||
|  | ||||
| @ -1322,12 +1322,12 @@ | ||||
|     "core.all": "All", | ||||
|     "core.allgroups": "All groups", | ||||
|     "core.allparticipants": "All participants", | ||||
|     "core.android": "Android", | ||||
|     "core.answer": "Answer", | ||||
|     "core.answered": "Answered", | ||||
|     "core.areyousure": "Are you sure?", | ||||
|     "core.back": "Back", | ||||
|     "core.block.blocks": "Blocks", | ||||
|     "core.browser": "Browser", | ||||
|     "core.cancel": "Cancel", | ||||
|     "core.cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle {{$a}} or later.", | ||||
|     "core.cannotdownloadfiles": "File downloading is disabled. Please contact your site administrator.", | ||||
| @ -1465,6 +1465,7 @@ | ||||
|     "core.deleteduser": "Deleted user", | ||||
|     "core.deleting": "Deleting", | ||||
|     "core.description": "Description", | ||||
|     "core.desktop": "Desktop", | ||||
|     "core.dfdaymonthyear": "MM-DD-YYYY", | ||||
|     "core.dfdayweekmonth": "ddd, D MMM", | ||||
|     "core.dffulldate": "dddd, D MMMM YYYY h[:]mm A", | ||||
| @ -1651,7 +1652,6 @@ | ||||
|     "core.imageviewer": "Image viewer", | ||||
|     "core.info": "Information", | ||||
|     "core.invalidformdata": "Incorrect form data", | ||||
|     "core.ios": "iOS", | ||||
|     "core.labelsep": ":", | ||||
|     "core.lastaccess": "Last access", | ||||
|     "core.lastdownloaded": "Last downloaded", | ||||
| @ -1890,7 +1890,7 @@ | ||||
|     "core.sending": "Sending", | ||||
|     "core.serverconnection": "Error connecting to the server", | ||||
|     "core.settings.about": "About", | ||||
|     "core.settings.appready": "App ready", | ||||
|     "core.settings.appversion": "App version", | ||||
|     "core.settings.cannotsyncoffline": "Cannot synchronise offline.", | ||||
|     "core.settings.cannotsyncwithoutwifi": "Cannot synchronise because the current settings only allow to synchronise when connected to Wi-Fi. Please connect to a Wi-Fi network.", | ||||
|     "core.settings.colorscheme": "Color Scheme", | ||||
| @ -1898,6 +1898,7 @@ | ||||
|     "core.settings.colorscheme-dark": "Dark", | ||||
|     "core.settings.colorscheme-light": "Light", | ||||
|     "core.settings.compilationinfo": "Compilation info", | ||||
|     "core.settings.copyinfo": "Copy device info on the clipboard", | ||||
|     "core.settings.cordovadevicemodel": "Cordova device model", | ||||
|     "core.settings.cordovadeviceosversion": "Cordova device OS version", | ||||
|     "core.settings.cordovadeviceplatform": "Cordova device platform", | ||||
| @ -1910,7 +1911,6 @@ | ||||
|     "core.settings.deletesitefilestitle": "Delete site files", | ||||
|     "core.settings.deviceinfo": "Device info", | ||||
|     "core.settings.deviceos": "Device OS", | ||||
|     "core.settings.devicewebworkers": "Device web workers supported", | ||||
|     "core.settings.disableall": "Disable notifications", | ||||
|     "core.settings.disabled": "Disabled", | ||||
|     "core.settings.displayformat": "Display format", | ||||
| @ -1930,7 +1930,7 @@ | ||||
|     "core.settings.forcedsetting": "This setting has been forced by your site configuration.", | ||||
|     "core.settings.general": "General", | ||||
|     "core.settings.language": "Language", | ||||
|     "core.settings.license": "Licence", | ||||
|     "core.settings.license": "License", | ||||
|     "core.settings.localnotifavailable": "Local notifications available", | ||||
|     "core.settings.locationhref": "Web view URL", | ||||
|     "core.settings.locked": "Locked", | ||||
| @ -1939,19 +1939,21 @@ | ||||
|     "core.settings.navigatorlanguage": "Navigator language", | ||||
|     "core.settings.navigatoruseragent": "Navigator userAgent", | ||||
|     "core.settings.networkstatus": "Internet connection status", | ||||
|     "core.settings.opensourcelicenses": "Open Source Licences", | ||||
|     "core.settings.privacypolicy": "Privacy policy", | ||||
|     "core.settings.publisher": "Publisher", | ||||
|     "core.settings.pushid": "Push notifications ID", | ||||
|     "core.settings.reportinbackground": "Report errors automatically", | ||||
|     "core.settings.screen": "Screen information", | ||||
|     "core.settings.settings": "Settings", | ||||
|     "core.settings.showdownloadoptions": "Show download options", | ||||
|     "core.settings.siteinfo": "Site info", | ||||
|     "core.settings.sites": "Sites", | ||||
|     "core.settings.spaceusage": "Space usage", | ||||
|     "core.settings.synchronization": "Synchronisation", | ||||
|     "core.settings.synchronizenow": "Synchronise now", | ||||
|     "core.settings.syncsettings": "Synchronisation settings", | ||||
|     "core.settings.total": "Total", | ||||
|     "core.settings.versioncode": "Version code", | ||||
|     "core.settings.versionname": "Version name", | ||||
|     "core.settings.wificonnection": "Wi-Fi connection", | ||||
|     "core.sharedfiles.chooseaccountstorefile": "Choose an account to store the file in.", | ||||
|     "core.sharedfiles.chooseactionrepeatedfile": "A file with this name already exists. Do you want to replace the existing file or rename it to \"{{$a}}\"?", | ||||
| @ -2069,7 +2071,6 @@ | ||||
|     "core.whoops": "Oops!", | ||||
|     "core.whyisthishappening": "Why is this happening?", | ||||
|     "core.whyisthisrequired": "Why is this required?", | ||||
|     "core.windowsphone": "Windows Phone", | ||||
|     "core.wsfunctionnotavailable": "The web service function is not available.", | ||||
|     "core.year": "year", | ||||
|     "core.years": "years", | ||||
|  | ||||
| @ -8,8 +8,8 @@ | ||||
|         <a ion-item core-user-link [userId]="siteInfo.userid" text-wrap> | ||||
|             <ion-avatar core-user-avatar [user]="siteInfo" item-start></ion-avatar> | ||||
|             <h2>{{siteInfo.fullname}}</h2> | ||||
|             <ion-note><core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true"></core-format-text></ion-note> | ||||
|             <ion-note>{{ siteUrl }}</ion-note> | ||||
|             <ion-note class="core-note-block"><core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true"></core-format-text></ion-note> | ||||
|             <ion-note class="core-note-block">{{ siteUrl }}</ion-note> | ||||
|         </a> | ||||
|         <ion-item-divider></ion-item-divider> | ||||
|         <ion-item text-center *ngIf="(!handlers || !handlers.length) && !handlersLoaded"> | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| { | ||||
|     "about": "About", | ||||
|     "appready": "App ready", | ||||
|     "appversion": "App version", | ||||
|     "cannotsyncoffline": "Cannot synchronise offline.", | ||||
|     "cannotsyncwithoutwifi": "Cannot synchronise because the current settings only allow to synchronise when connected to Wi-Fi. Please connect to a Wi-Fi network.", | ||||
|     "colorscheme": "Color Scheme", | ||||
| @ -8,6 +8,7 @@ | ||||
|     "colorscheme-dark": "Dark", | ||||
|     "colorscheme-light": "Light", | ||||
|     "compilationinfo": "Compilation info", | ||||
|     "copyinfo": "Copy device info on the clipboard", | ||||
|     "cordovadevicemodel": "Cordova device model", | ||||
|     "cordovadeviceosversion": "Cordova device OS version", | ||||
|     "cordovadeviceplatform": "Cordova device platform", | ||||
| @ -20,7 +21,6 @@ | ||||
|     "deletesitefilestitle": "Delete site files", | ||||
|     "deviceinfo": "Device info", | ||||
|     "deviceos": "Device OS", | ||||
|     "devicewebworkers": "Device web workers supported", | ||||
|     "disableall": "Disable notifications", | ||||
|     "disabled": "Disabled", | ||||
|     "displayformat": "Display format", | ||||
| @ -39,7 +39,8 @@ | ||||
|     "forcedsetting": "This setting has been forced by your site configuration.", | ||||
|     "general": "General", | ||||
|     "language": "Language", | ||||
|     "license": "Licence", | ||||
|     "license": "License", | ||||
|     "opensourcelicenses": "Open Source Licences", | ||||
|     "localnotifavailable": "Local notifications available", | ||||
|     "locationhref": "Web view URL", | ||||
|     "locked": "Locked", | ||||
| @ -49,18 +50,19 @@ | ||||
|     "navigatoruseragent": "Navigator userAgent", | ||||
|     "networkstatus": "Internet connection status", | ||||
|     "privacypolicy": "Privacy policy", | ||||
|     "publisher": "Publisher", | ||||
|     "pushid": "Push notifications ID", | ||||
|     "reportinbackground": "Report errors automatically", | ||||
|     "entriesincache": "{{$a}} entries in cache", | ||||
|     "screen": "Screen information", | ||||
|     "settings": "Settings", | ||||
|     "showdownloadoptions": "Show download options", | ||||
|     "siteinfo": "Site info", | ||||
|     "sites": "Sites", | ||||
|     "spaceusage": "Space usage", | ||||
|     "synchronization": "Synchronisation", | ||||
|     "synchronizenow": "Synchronise now", | ||||
|     "syncsettings": "Synchronisation settings", | ||||
|     "total": "Total", | ||||
|     "versioncode": "Version code", | ||||
|     "versionname": "Version name", | ||||
|     "wificonnection": "Wi-Fi connection" | ||||
| } | ||||
|  | ||||
| @ -7,120 +7,16 @@ | ||||
|     <ion-item text-wrap> | ||||
|         <h2>{{ appName }} {{ versionName }}</h2> | ||||
|     </ion-item> | ||||
|     <ion-item-group> | ||||
|         <ion-item-divider text-wrap> | ||||
|             {{ 'core.settings.license' | translate }} | ||||
|         </ion-item-divider> | ||||
|         <ion-item text-wrap> | ||||
|             <h2>Apache 2.0</h2> | ||||
|             <p><a href="http://www.apache.org/licenses/LICENSE-2.0" core-link auto-login="no">http://www.apache.org/licenses/LICENSE-2.0</a></p> | ||||
|         </ion-item> | ||||
|     </ion-item-group> | ||||
|     <ion-item-group *ngIf="privacyPolicy"> | ||||
|         <ion-item-divider text-wrap> | ||||
|     <a ion-item text-wrap (click)="openPage('CoreSettingsLicensesPage')" [title]="'core.settings.opensourcelicenses' | translate"> | ||||
|         <core-icon name="fa-copyright" item-start></core-icon> | ||||
|         {{ 'core.settings.opensourcelicenses' | translate }} | ||||
|     </a> | ||||
|     <a ion-item text-wrap *ngIf="privacyPolicy" [href]="privacyPolicy" core-link auto-login="no"> | ||||
|         <core-icon name="fa-user-secret" item-start></core-icon> | ||||
|         {{ 'core.settings.privacypolicy' | translate }} | ||||
|         </ion-item-divider> | ||||
|         <ion-item text-wrap> | ||||
|             <p><a [href]="privacyPolicy" core-link auto-login="no">{{ privacyPolicy }}</a></p> | ||||
|         </ion-item> | ||||
|     </ion-item-group> | ||||
|     <ion-item-group *ngIf="siteUrl"> | ||||
|         <ion-item-divider text-wrap> | ||||
|             {{ 'core.login.siteurl' | translate }}<ng-container *ngIf="isPrefixedUrl"> *</ng-container> | ||||
|         </ion-item-divider> | ||||
|         <ion-item text-wrap> | ||||
|             <p><a [href]="siteUrl" core-link auto-login="yes">{{ siteUrl }}</a></p> | ||||
|         </ion-item> | ||||
|     </ion-item-group> | ||||
|     <ion-item-group> | ||||
|         <ion-item-divider text-wrap> | ||||
|             {{ 'core.settings.deviceinfo' | translate }} | ||||
|         </ion-item-divider> | ||||
|         <ion-item text-wrap *ngIf="versionName"> | ||||
|             <h2>{{ 'core.settings.versionname' | translate}}</h2> | ||||
|             <p>{{ versionName }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="versionCode"> | ||||
|             <h2>{{ 'core.settings.versioncode' | translate}}</h2> | ||||
|             <p>{{ versionCode }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="compilationTime || lastCommit"> | ||||
|             <h2>{{ 'core.settings.compilationinfo' | translate }}</h2> | ||||
|             <p *ngIf="compilationTime">{{ compilationTime | coreFormatDate: "LLL Z": false }}</p> | ||||
|             <p *ngIf="lastCommit">{{ lastCommit }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="fileSystemRoot"> | ||||
|             <h2>{{ 'core.settings.filesystemroot' | translate}}</h2> | ||||
|             <p><a *ngIf="fsClickable" [href]="fileSystemRoot" core-link auto-login="no">{{ fileSystemRoot }}</a></p> | ||||
|             <p *ngIf="!fsClickable">{{ fileSystemRoot }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="navigator && navigator.userAgent"> | ||||
|             <h2>{{ 'core.settings.navigatoruseragent' | translate}}</h2> | ||||
|             <p>{{ navigator.userAgent }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="navigator && navigator.language"> | ||||
|             <h2>{{ 'core.settings.navigatorlanguage' | translate}}</h2> | ||||
|             <p>{{ navigator.language }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="locationHref"> | ||||
|             <h2>{{ 'core.settings.locationhref' | translate}}</h2> | ||||
|             <p>{{ locationHref }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="appReady"> | ||||
|             <h2>{{ 'core.settings.appready' | translate}}</h2> | ||||
|             <p>{{ appReady | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="deviceType"> | ||||
|             <h2>{{ 'core.settings.displayformat' | translate}}</h2> | ||||
|             <p>{{ deviceType | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="deviceOs"> | ||||
|             <h2>{{ 'core.settings.deviceos' | translate}}</h2> | ||||
|             <p>{{ deviceOs | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="currentLanguage"> | ||||
|             <h2>{{ 'core.settings.currentlanguage' | translate}}</h2> | ||||
|             <p>{{ currentLanguage }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="networkStatus"> | ||||
|             <h2>{{ 'core.settings.networkstatus' | translate}}</h2> | ||||
|             <p>{{ networkStatus | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="wifiConnection"> | ||||
|             <h2>{{ 'core.settings.wificonnection' | translate}}</h2> | ||||
|             <p>{{ wifiConnection | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="deviceWebWorkers"> | ||||
|             <h2>{{ 'core.settings.devicewebworkers' | translate}}</h2> | ||||
|             <p>{{ deviceWebWorkers | translate }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="device && device.cordova"> | ||||
|             <h2>{{ 'core.settings.cordovaversion' | translate}}</h2> | ||||
|             <p>{{ device.cordova }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="device && device.platform"> | ||||
|             <h2>{{ 'core.settings.cordovadeviceplatform' | translate}}</h2> | ||||
|             <p>{{ device.platform }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="device && device.version"> | ||||
|             <h2>{{ 'core.settings.cordovadeviceosversion' | translate}}</h2> | ||||
|             <p>{{ device.version }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="device && device.model"> | ||||
|             <h2>{{ 'core.settings.cordovadevicemodel' | translate}}</h2> | ||||
|             <p>{{ device.model }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="device && device.uuid"> | ||||
|             <h2>{{ 'core.settings.cordovadeviceuuid' | translate}}</h2> | ||||
|             <p>{{ device.uuid }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="pushId"> | ||||
|             <h2>{{ 'core.settings.pushid' | translate}}</h2> | ||||
|             <p>{{ pushId }}</p> | ||||
|         </ion-item> | ||||
|         <ion-item text-wrap *ngIf="localNotifAvailable"> | ||||
|             <h2>{{ 'core.settings.localnotifavailable' | translate}}</h2> | ||||
|             <p>{{ localNotifAvailable | translate }}</p> | ||||
|         </ion-item> | ||||
|     </ion-item-group> | ||||
|     </a> | ||||
|     <a ion-item (click)="openPage('CoreSettingsDeviceInfoPage')" [title]="'core.settings.deviceinfo' | translate"> | ||||
|         <ion-icon name="phone-portrait" item-start></ion-icon> | ||||
|         <p>{{ 'core.settings.deviceinfo' | translate }}</p> | ||||
|     </a> | ||||
| </ion-content> | ||||
|  | ||||
| @ -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); | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										96
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,96 @@ | ||||
| <ion-header> | ||||
|     <ion-navbar core-back-button> | ||||
|         <ion-title>{{ 'core.settings.deviceinfo' | translate }}</ion-title> | ||||
|         <ion-buttons end> | ||||
|             <button ion-button icon-only (click)="copyInfo()" [attr.aria-label]="'core.settings.copyinfo' | translate"> | ||||
|                 <ion-icon name="copy"></ion-icon> | ||||
|             </button> | ||||
|         </ion-buttons> | ||||
|     </ion-navbar> | ||||
| </ion-header> | ||||
| <ion-content> | ||||
|     <ion-item text-wrap (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.appversion' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.versionName }} ({{ deviceInfo.versionCode }})</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.compilationinfo' | translate }}</h2> | ||||
|         <p *ngIf="deviceInfo.compilationTime">{{ deviceInfo.compilationTime | coreFormatDate: "LLL Z": false }}</p> | ||||
|         <p *ngIf="deviceInfo.lastCommit">{{ deviceInfo.lastCommit }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.siteUrl" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.siteinfo' | translate }}<ng-container *ngIf="deviceInfo.isPrefixedUrl"> *</ng-container></h2> | ||||
|         <p><a [href]="deviceInfo.siteUrl" core-link auto-login="yes">{{ deviceInfo.siteUrl }}</a></p> | ||||
|         <p *ngIf="deviceInfo.siteVersion">{{ deviceInfo.siteVersion }}</p> | ||||
|         <p *ngIf="deviceInfo.siteId">{{ deviceInfo.siteId }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.fileSystemRoot" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.filesystemroot' | translate}}</h2> | ||||
|         <p><a *ngIf="fsClickable" [href]="deviceInfo.fileSystemRoot" core-link auto-login="no">{{ deviceInfo.fileSystemRoot }}</a></p> | ||||
|         <p *ngIf="!fsClickable">{{ deviceInfo.fileSystemRoot }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.userAgent" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.navigatoruseragent' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.userAgent }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.browserLanguage" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.navigatorlanguage' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.browserLanguage }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.currentLanguage" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.currentlanguage' | translate}}</h2> | ||||
|         <p>{{ currentLangName }} ({{ deviceInfo.currentLanguage }})</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.locationHref" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.locationhref' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.locationHref }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.deviceType" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.displayformat' | translate}}</h2> | ||||
|         <p>{{ 'core.' + deviceInfo.deviceType | translate }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.deviceOs" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.deviceos' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.deviceOsTranslated }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.screen" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.screen' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.screen | translate }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.networkstatus' | translate}}</h2> | ||||
|         <p>{{ 'core.' + deviceInfo.networkStatus | translate }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.wificonnection' | translate}}</h2> | ||||
|         <p>{{ 'core.' + deviceInfo.wifiConnection | translate }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.cordovaVersion" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.cordovaversion' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.cordovaVersion }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.platform" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.cordovadeviceplatform' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.platform }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.osVersion" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.cordovadeviceosversion' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.osVersion }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.model" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.cordovadevicemodel' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.model }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.uuid" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.cordovadeviceuuid' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.uuid }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap *ngIf="deviceInfo.pushId" (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.pushid' | translate}}</h2> | ||||
|         <p>{{ deviceInfo.pushId }}</p> | ||||
|     </ion-item> | ||||
|     <ion-item text-wrap (longPress)="copyItemInfo($event)"> | ||||
|         <h2>{{ 'core.settings.localnotifavailable' | translate}}</h2> | ||||
|         <p>{{ 'core.' + deviceInfo.localNotifAvailable | translate }}</p> | ||||
|     </ion-item> | ||||
| </ion-content> | ||||
							
								
								
									
										35
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.module.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | ||||
| // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||
| //
 | ||||
| // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||
| // you may not use this file except in compliance with the License.
 | ||||
| // You may obtain a copy of the License at
 | ||||
| //
 | ||||
| //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||
| //
 | ||||
| // Unless required by applicable law or agreed to in writing, software
 | ||||
| // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||
| // See the License for the specific language governing permissions and
 | ||||
| // limitations under the License.
 | ||||
| 
 | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { IonicPageModule } from 'ionic-angular'; | ||||
| import { TranslateModule } from '@ngx-translate/core'; | ||||
| import { CoreSettingsDeviceInfoPage } from './deviceinfo'; | ||||
| import { CoreComponentsModule } from '@components/components.module'; | ||||
| import { CoreDirectivesModule } from '@directives/directives.module'; | ||||
| import { CorePipesModule } from '@pipes/pipes.module'; | ||||
| 
 | ||||
| @NgModule({ | ||||
|     declarations: [ | ||||
|         CoreSettingsDeviceInfoPage | ||||
|     ], | ||||
|     imports: [ | ||||
|         CoreComponentsModule, | ||||
|         CoreDirectivesModule, | ||||
|         CorePipesModule, | ||||
|         IonicPageModule.forChild(CoreSettingsDeviceInfoPage), | ||||
|         TranslateModule.forChild() | ||||
|     ], | ||||
| }) | ||||
| export class CoreSettingsDeviceInfoPageModule {} | ||||
							
								
								
									
										5
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.scss
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| page-core-settings-deviceinfo { | ||||
|     .item { | ||||
|         user-select: text; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										237
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										237
									
								
								src/core/settings/pages/deviceinfo/deviceinfo.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,237 @@ | ||||
| // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||
| //
 | ||||
| // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||
| // you may not use this file except in compliance with the License.
 | ||||
| // You may obtain a copy of the License at
 | ||||
| //
 | ||||
| //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||
| //
 | ||||
| // Unless required by applicable law or agreed to in writing, software
 | ||||
| // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||
| // See the License for the specific language governing permissions and
 | ||||
| // limitations under the License.
 | ||||
| 
 | ||||
| import { Component, NgZone } from '@angular/core'; | ||||
| import { IonicPage, Platform } from 'ionic-angular'; | ||||
| import { Device } from '@ionic-native/device'; | ||||
| import { Network } from '@ionic-native/network'; | ||||
| import { TranslateService } from '@ngx-translate/core'; | ||||
| import { CoreAppProvider } from '@providers/app'; | ||||
| import { CoreFileProvider } from '@providers/file'; | ||||
| import { CoreInitDelegate } from '@providers/init'; | ||||
| import { CoreLangProvider } from '@providers/lang'; | ||||
| import { CoreUtilsProvider } from '@providers/utils/utils'; | ||||
| import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; | ||||
| import { CoreSitesProvider } from '@providers/sites'; | ||||
| import { CoreConfigConstants } from '../../../../configconstants'; | ||||
| import { CorePushNotificationsProvider } from '@core/pushnotifications/providers/pushnotifications'; | ||||
| 
 | ||||
| /** | ||||
|  * Device Info to be shown and copied to clipboard. | ||||
|  */ | ||||
| interface CoreSettingsDeviceInfo { | ||||
|     versionName: string; | ||||
|     versionCode: number; | ||||
|     compilationTime: number; | ||||
|     lastCommit: string; | ||||
|     siteUrl?: string; | ||||
|     isPrefixedUrl?: boolean; | ||||
|     siteId?: string; | ||||
|     siteVersion?: number; | ||||
|     fileSystemRoot?: string; | ||||
|     userAgent?: string; | ||||
|     deviceOs?: string; | ||||
|     browserLanguage?: string; | ||||
|     currentLanguage?: string; | ||||
|     locationHref?: string; | ||||
|     deviceType?: string; | ||||
|     screen?: string; | ||||
|     networkStatus: string; | ||||
|     wifiConnection: string; | ||||
|     cordovaVersion?: string; | ||||
|     platform?: string; | ||||
|     osVersion?: string; | ||||
|     model?: string; | ||||
|     uuid?: string; | ||||
|     pushId: string; | ||||
|     localNotifAvailable: string; | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * Page that displays the device information. | ||||
|  */ | ||||
| @IonicPage({segment: 'core-settings-deviceinfo'}) | ||||
| @Component({ | ||||
|     selector: 'page-core-settings-deviceinfo', | ||||
|     templateUrl: 'deviceinfo.html', | ||||
| }) | ||||
| export class CoreSettingsDeviceInfoPage { | ||||
| 
 | ||||
|     deviceInfo: CoreSettingsDeviceInfo; | ||||
|     deviceOsTranslated: string; | ||||
|     currentLangName: string; | ||||
|     fsClickable: boolean; | ||||
| 
 | ||||
|     protected onlineObserver: any; | ||||
| 
 | ||||
|     constructor(platform: Platform, | ||||
|             device: Device, | ||||
|             network: Network, | ||||
|             zone: NgZone, | ||||
|             appProvider: CoreAppProvider, | ||||
|             fileProvider: CoreFileProvider, | ||||
|             initDelegate: CoreInitDelegate, | ||||
|             langProvider: CoreLangProvider, | ||||
|             sitesProvider: CoreSitesProvider, | ||||
|             localNotificationsProvider: CoreLocalNotificationsProvider, | ||||
|             pushNotificationsProvider: CorePushNotificationsProvider, | ||||
|             protected utils: CoreUtilsProvider, | ||||
|             protected translate: TranslateService) { | ||||
| 
 | ||||
|         this.deviceInfo = { | ||||
|             versionName: CoreConfigConstants.versionname, | ||||
|             versionCode: CoreConfigConstants.versioncode, | ||||
|             compilationTime: CoreConfigConstants.compilationtime, | ||||
|             lastCommit: CoreConfigConstants.lastcommit, | ||||
|             networkStatus: appProvider.isOnline() ? 'online' : 'offline', | ||||
|             wifiConnection: appProvider.isWifi() ? 'yes' : 'no', | ||||
|             localNotifAvailable: localNotificationsProvider.isAvailable() ? 'yes' : 'no', | ||||
|             pushId: pushNotificationsProvider.getPushId(), | ||||
|         }; | ||||
| 
 | ||||
|         if (window.location && window.location.href) { | ||||
|             const url = window.location.href; | ||||
|             this.deviceInfo.locationHref = url.substr(0, url.indexOf('#')); | ||||
|         } | ||||
| 
 | ||||
|         const navigator = window.navigator; | ||||
|         if (navigator) { | ||||
|             if (navigator.userAgent) { | ||||
|                 this.deviceInfo.userAgent = navigator.userAgent; | ||||
|             } | ||||
| 
 | ||||
|             if (navigator.language) { | ||||
|                 this.deviceInfo.browserLanguage = navigator.language; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (device) { | ||||
|             if (device.cordova) { | ||||
|                 this.deviceInfo.cordovaVersion = device.cordova; | ||||
|             } | ||||
|             if (device.platform) { | ||||
|                 this.deviceInfo.platform = device.platform; | ||||
|             } | ||||
|             if (device.version) { | ||||
|                 this.deviceInfo.osVersion = device.version; | ||||
|             } | ||||
|             if (device.model) { | ||||
|                 this.deviceInfo.model = device.model; | ||||
|             } | ||||
|             if (device.uuid) { | ||||
|                 this.deviceInfo.uuid = device.uuid; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (appProvider.isMobile()) { | ||||
|             this.deviceInfo.deviceType = platform.is('tablet') ? 'tablet' : 'phone'; | ||||
|             if (appProvider.isAndroid()) { | ||||
|                 this.deviceInfo.deviceOs = 'android'; | ||||
|                 this.deviceOsTranslated = 'Android'; | ||||
|             } else if (appProvider.isIOS()) { | ||||
|                 this.deviceInfo.deviceOs = 'ios'; | ||||
|                 this.deviceOsTranslated = 'iOS'; | ||||
|             } else { | ||||
|                 const matches = navigator.userAgent.match(/\(([^\)]*)\)/); | ||||
|                 if (matches && matches.length > 1) { | ||||
|                     this.deviceInfo.deviceOs = matches[1]; | ||||
|                     this.deviceOsTranslated = matches[1]; | ||||
|                 } else { | ||||
|                     this.deviceInfo.deviceOs = 'unknown'; | ||||
|                     this.deviceOsTranslated = this.translate.instant('core.unknown'); | ||||
|                 } | ||||
|             } | ||||
|         } else { | ||||
|             this.deviceInfo.deviceType = appProvider.isDesktop() ? 'desktop' : 'browser'; | ||||
|             if (appProvider.isLinux()) { | ||||
|                 this.deviceInfo.deviceOs = 'linux'; | ||||
|                 this.deviceOsTranslated = 'Linux'; | ||||
|             } else if (appProvider.isMac()) { | ||||
|                 this.deviceInfo.deviceOs = 'mac'; | ||||
|                 this.deviceOsTranslated = 'MacOS'; | ||||
|             } else if (appProvider.isWindows()) { | ||||
|                 this.deviceInfo.deviceOs = 'windows'; | ||||
|                 this.deviceOsTranslated = 'Windows'; | ||||
|             } else { | ||||
|                 const matches = navigator.userAgent.match(/\(([^\)]*)\)/); | ||||
|                 if (matches && matches.length > 1) { | ||||
|                     this.deviceInfo.deviceOs = matches[1]; | ||||
|                     this.deviceOsTranslated = matches[1]; | ||||
|                 } else { | ||||
|                     this.deviceInfo.deviceOs = 'unknown'; | ||||
|                     this.deviceOsTranslated = this.translate.instant('core.unknown'); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         langProvider.getCurrentLanguage().then((lang) => { | ||||
|             this.deviceInfo.currentLanguage =  lang; | ||||
|             this.currentLangName = CoreConfigConstants.languages[lang]; | ||||
|         }); | ||||
| 
 | ||||
|         if (fileProvider.isAvailable()) { | ||||
|             fileProvider.getBasePath().then((basepath) => { | ||||
|                 this.deviceInfo.fileSystemRoot = basepath; | ||||
|                 this.fsClickable = fileProvider.usesHTMLAPI(); | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         if (window.screen) { | ||||
|             this.deviceInfo.screen = window.innerWidth + 'x' + window.innerHeight + | ||||
|                 ' (' + window.screen.width + 'x' + window.screen.height + ')'; | ||||
|         } | ||||
| 
 | ||||
|         const currentSite = sitesProvider.getCurrentSite(); | ||||
| 
 | ||||
|         this.deviceInfo.siteUrl = (currentSite && currentSite.getURL()) || | ||||
|             (typeof CoreConfigConstants.siteurl == 'string' && CoreConfigConstants.siteurl); | ||||
|         this.deviceInfo.isPrefixedUrl = !!CoreConfigConstants.siteurl; | ||||
|         this.deviceInfo.siteId = currentSite && currentSite.getId(); | ||||
|         this.deviceInfo.siteVersion = currentSite && currentSite.getInfo().release; | ||||
| 
 | ||||
|         // Refresh online status when changes.
 | ||||
|         this.onlineObserver = network.onchange().subscribe(() => { | ||||
|             // Execute the callback in the Angular zone, so change detection doesn't stop working.
 | ||||
|             zone.run(() => { | ||||
|                 this.deviceInfo.networkStatus = appProvider.isOnline() ? 'online' : 'offline'; | ||||
|             }); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Copies device info into the clipboard. | ||||
|      */ | ||||
|     copyInfo(): void { | ||||
|         this.utils.copyToClipboard(JSON.stringify(this.deviceInfo)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Copies device info item into the clipboard. | ||||
|      * | ||||
|      * @param e Event. | ||||
|      */ | ||||
|     copyItemInfo(e: Event): void { | ||||
|         e.preventDefault(); | ||||
| 
 | ||||
|         const el = <Element> e.target; | ||||
|         this.utils.copyToClipboard(el.closest('ion-item').textContent.trim()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Page destroyed. | ||||
|      */ | ||||
|     ngOnDestroy(): void { | ||||
|         this.onlineObserver && this.onlineObserver.unsubscribe(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										26
									
								
								src/core/settings/pages/licenses/licenses.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/core/settings/pages/licenses/licenses.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | ||||
| <ion-header> | ||||
|     <ion-navbar core-back-button> | ||||
|         <ion-title>{{ 'core.settings.opensourcelicenses' | translate }}</ion-title> | ||||
|     </ion-navbar> | ||||
| </ion-header> | ||||
| <ion-content> | ||||
|     <core-loading [hideUntil]="loaded"> | ||||
|         <a *ngIf="error" ion-item text-wrap [href]="licensesUrl" core-link auto-login="no"> | ||||
|             {{ 'core.settings.opensourcelicenses' | translate }} | ||||
|         </a> | ||||
| 
 | ||||
|         <ng-container *ngIf="!error"> | ||||
|             <ion-item *ngFor="let license of licenses" text-wrap> | ||||
|                 <h2> | ||||
|                     <a *ngIf="license.repository" [href]="license.repository" core-link auto-login="no">{{ license.name }}</a> | ||||
|                     <ng-container *ngIf="!license.repository">{{ license.name }}</ng-container> - {{ license.version }} | ||||
|                 </h2> | ||||
|                 <h3 *ngIf="license.publisher">{{ 'core.settings.publisher' | translate }}{{ 'core.labelsep' | translate }} {{ license.publisher }}</h3> | ||||
|                 <p>{{ 'core.settings.license' | translate }}{{ 'core.labelsep' | translate }} {{ license.licenses }}</p> | ||||
|                 <p><a *ngIf="license.url" [href]="license.url" core-link auto-login="no">{{ license.url }}</a></p> | ||||
|                 <p><a *ngIf="license.email" [href]="'mailto:' +license.email" core-link auto-login="no">{{ license.email }}</a></p> | ||||
|                 <a *ngIf="license.licenseUrl" [href]="license.licenseUrl" target="_blank" ion-button ion-button clear item-end>{{ 'core.view' | translate }}</a> | ||||
|             </ion-item> | ||||
|         </ng-container> | ||||
|     </core-loading> | ||||
| </ion-content> | ||||
							
								
								
									
										35
									
								
								src/core/settings/pages/licenses/licenses.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/core/settings/pages/licenses/licenses.module.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | ||||
| // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||
| //
 | ||||
| // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||
| // you may not use this file except in compliance with the License.
 | ||||
| // You may obtain a copy of the License at
 | ||||
| //
 | ||||
| //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||
| //
 | ||||
| // Unless required by applicable law or agreed to in writing, software
 | ||||
| // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||
| // See the License for the specific language governing permissions and
 | ||||
| // limitations under the License.
 | ||||
| 
 | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { IonicPageModule } from 'ionic-angular'; | ||||
| import { TranslateModule } from '@ngx-translate/core'; | ||||
| import { CoreSettingsLicensesPage } from './licenses'; | ||||
| import { CoreComponentsModule } from '@components/components.module'; | ||||
| import { CoreDirectivesModule } from '@directives/directives.module'; | ||||
| import { CorePipesModule } from '@pipes/pipes.module'; | ||||
| 
 | ||||
| @NgModule({ | ||||
|     declarations: [ | ||||
|         CoreSettingsLicensesPage | ||||
|     ], | ||||
|     imports: [ | ||||
|         CoreComponentsModule, | ||||
|         CoreDirectivesModule, | ||||
|         CorePipesModule, | ||||
|         IonicPageModule.forChild(CoreSettingsLicensesPage), | ||||
|         TranslateModule.forChild() | ||||
|     ], | ||||
| }) | ||||
| export class CoreSettingsLicensesPageModule {} | ||||
							
								
								
									
										88
									
								
								src/core/settings/pages/licenses/licenses.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								src/core/settings/pages/licenses/licenses.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,88 @@ | ||||
| // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||
| //
 | ||||
| // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||
| // you may not use this file except in compliance with the License.
 | ||||
| // You may obtain a copy of the License at
 | ||||
| //
 | ||||
| //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||
| //
 | ||||
| // Unless required by applicable law or agreed to in writing, software
 | ||||
| // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||
| // See the License for the specific language governing permissions and
 | ||||
| // limitations under the License.
 | ||||
| 
 | ||||
| import { Component } from '@angular/core'; | ||||
| import { IonicPage } from 'ionic-angular'; | ||||
| import { HttpClient } from '@angular/common/http'; | ||||
| import { CoreConfigConstants } from '../../../../configconstants'; | ||||
| 
 | ||||
| /** | ||||
|  * Defines license info | ||||
|  */ | ||||
| interface CoreSettingsLicense { | ||||
|     name: string; | ||||
|     version: string; | ||||
|     licenses: string; | ||||
|     repository?: string; | ||||
|     publisher?: string; | ||||
|     url?: string; | ||||
|     email?: string; | ||||
|     licenseUrl?: string; | ||||
|     licenseFile?: string; | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * Page that displays the open source licenses information. | ||||
|  */ | ||||
| @IonicPage({segment: 'core-settings-licenses'}) | ||||
| @Component({ | ||||
|     selector: 'page-core-settings-licenses', | ||||
|     templateUrl: 'licenses.html', | ||||
| }) | ||||
| export class CoreSettingsLicensesPage { | ||||
| 
 | ||||
|     licensesUrl: string; | ||||
|     loaded = false; | ||||
|     licenses: CoreSettingsLicense[]; | ||||
|     error = false; | ||||
| 
 | ||||
|     constructor(protected http: HttpClient) { | ||||
|         let version = 'v' + CoreConfigConstants.versionname; | ||||
|         if (version.indexOf('-') > 0) { | ||||
|             version = 'integration'; | ||||
|         } | ||||
| 
 | ||||
|         this.licensesUrl = 'https://raw.githubusercontent.com/moodlehq/moodleapp/' + version + '/licenses.json'; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * View loaded. | ||||
|      */ | ||||
|     ionViewDidLoad(): void { | ||||
|         this.http.get(this.licensesUrl).toPromise().then((licenses) => { | ||||
|             this.licenses = Object.keys(licenses).map((name) => { | ||||
|                 const license = licenses[name]; | ||||
| 
 | ||||
|                 const nameSplit = name.lastIndexOf('@'); | ||||
|                 license.name = name.substring(0, nameSplit); | ||||
|                 license.version = name.substring(nameSplit + 1); | ||||
| 
 | ||||
|                 if (license.repository) { | ||||
|                     license.repository = license.repository.replace('git://', 'https://'); | ||||
|                     if (license.repository.indexOf('github.com') > 0) { | ||||
|                         license.licenseUrl = license.repository + '/blob/' + license.version + '/' + license.licenseFile; | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 return license; | ||||
|             }); | ||||
| 
 | ||||
|             this.error = false; | ||||
|         }).catch(() => { | ||||
|             this.error = true; | ||||
|         }).finally(() => { | ||||
|             this.loaded = true; | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| @ -6,11 +6,11 @@ | ||||
|     "all": "All", | ||||
|     "allgroups": "All groups", | ||||
|     "allparticipants": "All participants", | ||||
|     "android": "Android", | ||||
|     "answer": "Answer", | ||||
|     "answered": "Answered", | ||||
|     "areyousure": "Are you sure?", | ||||
|     "back": "Back", | ||||
|     "browser": "Browser", | ||||
|     "cancel": "Cancel", | ||||
|     "cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle {{$a}} or later.", | ||||
|     "cannotdownloadfiles": "File downloading is disabled. Please contact your site administrator.", | ||||
| @ -63,6 +63,7 @@ | ||||
|     "deleteduser": "Deleted user", | ||||
|     "deleting": "Deleting", | ||||
|     "description": "Description", | ||||
|     "desktop": "Desktop", | ||||
|     "dfdaymonthyear": "MM-DD-YYYY", | ||||
|     "dfdayweekmonth": "ddd, D MMM", | ||||
|     "dffulldate": "dddd, D MMMM YYYY h[:]mm A", | ||||
| @ -118,7 +119,6 @@ | ||||
|     "imageviewer": "Image viewer", | ||||
|     "info": "Information", | ||||
|     "invalidformdata": "Incorrect form data", | ||||
|     "ios": "iOS", | ||||
|     "labelsep": ":", | ||||
|     "filter": "Filter", | ||||
|     "lastaccess": "Last access", | ||||
| @ -295,7 +295,6 @@ | ||||
|     "whoops": "Oops!", | ||||
|     "whyisthishappening": "Why is this happening?", | ||||
|     "whyisthisrequired": "Why is this required?", | ||||
|     "windowsphone": "Windows Phone", | ||||
|     "wsfunctionnotavailable": "The web service function is not available.", | ||||
|     "year": "year", | ||||
|     "years": "years", | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user