Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 76 additions & 76 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,96 +47,96 @@
"windows.store": "npx electron-windows-store --input-directory .\\desktop\\dist\\win-unpacked --output-directory .\\desktop\\store -a .\\resources\\desktop -m .\\desktop\\assets\\windows\\AppXManifest.xml --package-version 0.0.0.0 --package-name MoodleDesktop"
},
"dependencies": {
"@angular/animations": "^5.2.11",
"@angular/common": "^5.2.11",
"@angular/compiler": "^5.2.11",
"@angular/compiler-cli": "^5.2.11",
"@angular/core": "^5.2.11",
"@angular/forms": "^5.2.11",
"@angular/platform-browser": "^5.2.11",
"@angular/platform-browser-dynamic": "^5.2.11",
"@ionic-native/badge": "^4.20.0",
"@ionic-native/camera": "^4.20.0",
"@ionic-native/chooser": "^4.20.0",
"@ionic-native/clipboard": "^4.20.0",
"@ionic-native/core": "^4.20.0",
"@ionic-native/device": "^4.20.0",
"@ionic-native/diagnostic": "^4.2.0",
"@ionic-native/file": "^4.20.0",
"@ionic-native/file-opener": "^4.20.0",
"@ionic-native/file-transfer": "^4.20.0",
"@ionic-native/geolocation": "^4.20.0",
"@ionic-native/globalization": "^4.20.0",
"@ionic-native/http": "^4.20.0",
"@ionic-native/in-app-browser": "^4.20.0",
"@ionic-native/keyboard": "^4.20.0",
"@ionic-native/local-notifications": "^4.20.0",
"@ionic-native/media": "^4.20.0",
"@ionic-native/media-capture": "^4.20.0",
"@ionic-native/network": "^4.20.0",
"@ionic-native/push": "^4.20.0",
"@ionic-native/qr-scanner": "^4.20.0",
"@ionic-native/screen-orientation": "^4.20.0",
"@ionic-native/splash-screen": "^4.20.0",
"@ionic-native/sqlite": "^4.20.0",
"@ionic-native/status-bar": "^4.20.0",
"@ionic-native/web-intent": "^4.20.0",
"@ionic-native/zip": "^4.20.0",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^2.0.1",
"ajv": "^6.11.0",
"chart.js": "^2.9.3",
"com-darryncampbell-cordova-plugin-intent": "^1.3.0",
"cordova": "^10.0.0",
"cordova-android": "^8.1.0",
"cordova-android-support-gradle-release": "^3.0.1",
"cordova-clipboard": "^1.3.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-advanced-http": "^2.4.1",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-chooser": "^1.3.2",
"cordova-plugin-customurlscheme": "^5.0.1",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.4",
"cordova-plugin-file-transfer": "^1.7.1",
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/badge": "4.20.0",
"@ionic-native/camera": "4.20.0",
"@ionic-native/chooser": "4.20.0",
"@ionic-native/clipboard": "4.20.0",
"@ionic-native/core": "4.20.0",
"@ionic-native/device": "4.20.0",
"@ionic-native/diagnostic": "4.2.0",
"@ionic-native/file": "4.20.0",
"@ionic-native/file-opener": "4.20.0",
"@ionic-native/file-transfer": "4.20.0",
"@ionic-native/geolocation": "4.20.0",
"@ionic-native/globalization": "4.20.0",
"@ionic-native/http": "4.20.0",
"@ionic-native/in-app-browser": "4.20.0",
"@ionic-native/keyboard": "4.20.0",
"@ionic-native/local-notifications": "4.20.0",
"@ionic-native/media": "4.20.0",
"@ionic-native/media-capture": "4.20.0",
"@ionic-native/network": "4.20.0",
"@ionic-native/push": "4.20.0",
"@ionic-native/qr-scanner": "4.20.0",
"@ionic-native/screen-orientation": "4.20.0",
"@ionic-native/splash-screen": "4.20.0",
"@ionic-native/sqlite": "4.20.0",
"@ionic-native/status-bar": "4.20.0",
"@ionic-native/web-intent": "4.20.0",
"@ionic-native/zip": "4.20.0",
"@ngx-translate/core": "8.0.0",
"@ngx-translate/http-loader": "2.0.1",
"ajv": "6.11.0",
"chart.js": "2.9.3",
"com-darryncampbell-cordova-plugin-intent": "1.3.0",
"cordova": "10.0.0",
"cordova-android": "8.1.0",
"cordova-android-support-gradle-release": "3.0.1",
"cordova-clipboard": "1.3.0",
"cordova-ios": "5.1.1",
"cordova-plugin-advanced-http": "2.4.1",
"cordova-plugin-badge": "0.8.8",
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-chooser": "1.3.2",
"cordova-plugin-customurlscheme": "5.0.1",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
"cordova-plugin-file-transfer": "1.7.1",
"cordova-plugin-geolocation": "git+https://github.com/apache/cordova-plugin-geolocation.git#89cf51d222e8f225bdfb661965b3007d669c40ff",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-globalization": "1.11.0",
"cordova-plugin-inappbrowser": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle",
"cordova-plugin-ionic-keyboard": "2.1.3",
"cordova-plugin-ionic-webview": "git+https://github.com/moodlemobile/cordova-plugin-ionic-webview.git#500-moodle",
"cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle",
"cordova-plugin-media": "^5.0.3",
"cordova-plugin-media-capture": "^3.0.3",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-media": "5.0.3",
"cordova-plugin-media-capture": "3.0.3",
"cordova-plugin-network-information": "2.0.2",
"cordova-plugin-qrscanner": "git+https://github.com/moodlemobile/cordova-plugin-qrscanner.git#dist",
"cordova-plugin-screen-orientation": "^3.0.2",
"cordova-plugin-splashscreen": "^6.0.0",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-screen-orientation": "3.0.2",
"cordova-plugin-splashscreen": "6.0.0",
"cordova-plugin-statusbar": "2.4.3",
"cordova-plugin-whitelist": "1.3.4",
"cordova-plugin-wkuserscript": "git+https://github.com/moodlemobile/cordova-plugin-wkuserscript.git",
"cordova-plugin-wkwebview-cookies": "git+https://github.com/moodlemobile/cordova-plugin-wkwebview-cookies.git",
"cordova-plugin-zip": "^3.1.0",
"cordova-sqlite-storage": "^4.0.0",
"cordova-support-google-services": "^1.3.2",
"es6-promise-plugin": "^4.2.2",
"font-awesome": "^4.7.0",
"cordova-plugin-zip": "3.1.0",
"cordova-sqlite-storage": "4.0.0",
"cordova-support-google-services": "1.3.2",
"es6-promise-plugin": "4.2.2",
"font-awesome": "4.7.0",
"inquirer": "^7.3.2",
"ionic-angular": "3.9.9",
"ionicons": "3.0.0",
"jszip": "^3.1.5",
"jszip": "3.1.5",
"mathjax": "2.7.7",
"moment": "^2.24.0",
"nl.kingsquare.cordova.background-audio": "^1.0.1",
"phonegap-plugin-multidex": "^1.0.0",
"moment": "2.24.0",
"nl.kingsquare.cordova.background-audio": "1.0.1",
"phonegap-plugin-multidex": "1.0.0",
"phonegap-plugin-push": "git+https://github.com/moodlemobile/phonegap-plugin-push.git#moodle-v3",
"promise.prototype.finally": "3.1.0",
"rxjs": "^5.5.12",
"sw-toolbox": "^3.6.0",
"ts-md5": "^1.2.7",
"web-animations-js": "^2.3.2",
"zone.js": "^0.8.29"
"rxjs": "5.5.12",
"sw-toolbox": "3.6.0",
"ts-md5": "1.2.7",
"web-animations-js": "2.3.2",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.3",
Expand Down
22 changes: 1 addition & 21 deletions src/components/iframe/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import { CoreUrlUtilsProvider } from '@providers/utils/url';
import { CoreIframeUtilsProvider } from '@providers/utils/iframe';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
import { CoreUrl } from '@singletons/url';
import { CoreApp } from '@providers/app';
import { WKWebViewCookiesWindow } from 'cordova-plugin-wkwebview-cookies';

@Component({
selector: 'core-iframe',
Expand Down Expand Up @@ -107,24 +104,7 @@ export class CoreIframeComponent implements OnChanges {
if (changes.src) {
const url = this.urlUtils.getYoutubeEmbedUrl(changes.src.currentValue) || changes.src.currentValue;

if (CoreApp.instance.isIOS() && url && !this.urlUtils.isLocalFileUrl(url)) {
// Save a "fake" cookie for the iframe's domain to fix a bug in WKWebView.
try {
const win = <WKWebViewCookiesWindow> window;
const urlParts = CoreUrl.parse(url);

if (urlParts.domain) {
await win.WKWebViewCookies.setCookie({
name: 'MoodleAppCookieForWKWebView',
value: '1',
domain: urlParts.domain,
});
}
} catch (err) {
// Ignore errors.
this.logger.error('Error setting cookie', err);
}
}
await this.iframeUtils.fixIframeCookies(url);

this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(CoreFile.instance.convertFileSrc(url));

Expand Down
2 changes: 1 addition & 1 deletion src/core/contentlinks/providers/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class CoreContentLinksDelegate {

// Add them to the list.
linkActions.push({
priority: handler.priority,
priority: handler.priority || 0,
actions: actions
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/course/providers/options-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
promises.push(Promise.resolve(getFunction.call(handler, injector, course)).then((data) => {
handlersToDisplay.push({
data: data,
priority: handler.priority,
priority: handler.priority || 0,
prefetch: handler.prefetch && handler.prefetch.bind(handler),
name: handler.name
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, AfterContentInit, OnDestroy, Optional }
from '@angular/core';
import { TextInput, Content, Platform, Slides } from 'ionic-angular';
import { Device } from '@ionic-native/device';
import { CoreApp } from '@providers/app';
import { CoreSitesProvider } from '@providers/sites';
import { CoreFilepoolProvider } from '@providers/filepool';
Expand Down Expand Up @@ -118,7 +119,8 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe
protected events: CoreEventsProvider,
protected utils: CoreUtilsProvider,
protected platform: Platform,
protected editorOffline: CoreEditorOfflineProvider) {
protected editorOffline: CoreEditorOfflineProvider,
protected device: Device) {
this.contentChanged = new EventEmitter<string>();
this.element = elementRef.nativeElement as HTMLDivElement;
this.pageInstance = 'app_' + Date.now(); // Generate a "unique" ID based on timestamp.
Expand Down Expand Up @@ -236,7 +238,7 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe
if (CoreApp.instance.isAndroid()) {
// In Android we ignore the keyboard height because it is not part of the web view.
height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element);
} else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && this.platform.version().major < 12) {
} else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && Number(this.device.version.split('.')[0]) < 12) {
// Keyboard open in iOS 11 or previous. The window height changes when the keyboard is open.
height = window.innerHeight - this.getSurroundingHeight(this.element);

Expand Down
2 changes: 1 addition & 1 deletion src/core/fileuploader/providers/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class CoreFileUploaderDelegate extends CoreDelegate {
}

const data: CoreFileUploaderHandlerDataToReturn = handler.getData();
data.priority = handler.priority;
data.priority = handler.priority || 0;
data.mimetypes = supportedMimetypes;
handlers.push(data);
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/fileuploader/providers/file-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export class CoreFileUploaderFileHandler implements CoreFileUploaderHandler {
* @return True or promise resolved with true if enabled.
*/
isEnabled(): boolean | Promise<boolean> {
return CoreApp.instance.isAndroid() || !CoreApp.instance.isMobile() ||
(CoreApp.instance.isIOS() && this.platform.version().major >= 9);
return true;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/core/mainmenu/pages/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class CoreMainMenuPage implements OnDestroy {
protected urlToOpen: string;
protected mainMenuId: number;
protected keyboardObserver: any;
protected resizeFunction;

@ViewChild('mainTabs') mainTabs: CoreIonTabsComponent;

Expand Down Expand Up @@ -115,7 +116,8 @@ export class CoreMainMenuPage implements OnDestroy {
}
});

window.addEventListener('resize', this.initHandlers.bind(this));
this.resizeFunction = this.initHandlers.bind(this);
window.addEventListener('resize', this.resizeFunction);

if (CoreApp.instance.isIOS()) {
// In iOS, the resize event is triggered before the keyboard is opened/closed and not triggered again once done.
Expand Down Expand Up @@ -241,7 +243,7 @@ export class CoreMainMenuPage implements OnDestroy {
ngOnDestroy(): void {
this.subscription && this.subscription.unsubscribe();
this.redirectObs && this.redirectObs.off();
window.removeEventListener('resize', this.initHandlers.bind(this));
window.removeEventListener('resize', this.resizeFunction);
CoreApp.instance.setMainMenuOpen(this.mainMenuId, false);
this.keyboardObserver && this.keyboardObserver.off();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/mainmenu/providers/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class CoreMainMenuDelegate extends CoreDelegate {
handlersData.push({
name: name,
data: data,
priority: handler.priority
priority: handler.priority || 0,
});
}

Expand Down
1 change: 1 addition & 0 deletions src/core/pushnotifications/providers/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class CorePushNotificationsDelegate {

this.logger.log(`Registered addon '${handler.name}'`);
this.clickHandlers[handler.name] = handler;
handler.priority = handler.priority || 0;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/settings/providers/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class CoreSettingsDelegate extends CoreDelegate {

handlersData.push({
data: data,
priority: handler.priority
priority: handler.priority || 0,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CoreSitePluginsCourseOptionHandler extends CoreSitePluginsBaseHandl
protected utils: CoreUtilsProvider) {
super(name);

this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
this.isMenuHandler = !!handlerSchema.ismenuhandler;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/siteplugins/classes/handlers/main-menu-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i
protected initResult: any) {
super(name);

this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CoreSitePluginsMessageOutputHandler extends CoreSitePluginsBaseHand
*/
getDisplayData(): AddonMessageOutputHandlerData {
return {
priority: this.handlerSchema.priority,
priority: this.handlerSchema.priority || 0,
label: this.title,
icon: this.handlerSchema.displaydata.icon,
page: 'CoreSitePluginsPluginPage',
Expand Down
2 changes: 1 addition & 1 deletion src/core/siteplugins/classes/handlers/settings-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class CoreSitePluginsSettingsHandler extends CoreSitePluginsBaseHandler i
protected initResult: any) {
super(name);

this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/siteplugins/classes/handlers/user-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle
protected utils: CoreUtilsProvider) {
super(name);

this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;

// Only support TYPE_COMMUNICATION and TYPE_NEW_PAGE.
this.type = handlerSchema.type != CoreUserDelegate.TYPE_COMMUNICATION ?
Expand Down
2 changes: 1 addition & 1 deletion src/core/user/providers/user-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class CoreUserDelegate extends CoreDelegate {
userData.handlers.push({
name: name,
data: handler.getDisplayData(user, courseId),
priority: handler.priority,
priority: handler.priority || 0,
type: handler.type || CoreUserDelegate.TYPE_NEW_PAGE
});
}
Expand Down
Loading