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
10 changes: 10 additions & 0 deletions PACKAGE_PROBLEMS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package updates known problems
=================

@ionic/app-scripts 3.2.3 shows error Cannot find type definition file for '@types'. on ngc build.

com-darryncampbell-cordova-plugin-intent 2.0.0 onwards needs Android X Support. Unsupported on PGB.

typescript is needed to be less than 2.7 for @angular/compiler-cli

cordova-plugin-ionic-keyboard has problems on greater verisons than 2.1.3
6,490 changes: 3,127 additions & 3,363 deletions package-lock.json

Large diffs are not rendered by default.

109 changes: 54 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,57 +40,56 @@
"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.10",
"@angular/common": "^5.2.10",
"@angular/compiler": "^5.2.10",
"@angular/compiler-cli": "^5.2.10",
"@angular/core": "^5.2.10",
"@angular/forms": "^5.2.10",
"@angular/http": "^5.2.10",
"@angular/platform-browser": "^5.2.10",
"@angular/platform-browser-dynamic": "^5.2.10",
"@ionic-native/badge": "^4.17.0",
"@ionic-native/camera": "^4.17.0",
"@ionic-native/clipboard": "^4.17.0",
"@ionic-native/core": "^4.11.0",
"@ionic-native/device": "^4.17.0",
"@ionic-native/file": "^4.17.0",
"@ionic-native/file-opener": "^4.17.0",
"@ionic-native/file-transfer": "^4.17.0",
"@ionic-native/geolocation": "^4.17.0",
"@ionic-native/globalization": "^4.17.0",
"@ionic-native/in-app-browser": "^4.17.0",
"@ionic-native/keyboard": "^4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/media-capture": "^4.17.0",
"@ionic-native/network": "^4.17.0",
"@ionic-native/push": "^4.17.0",
"@ionic-native/screen-orientation": "^4.17.0",
"@ionic-native/splash-screen": "^4.17.0",
"@ionic-native/sqlite": "^4.17.0",
"@ionic-native/status-bar": "^4.17.0",
"@ionic-native/web-intent": "^4.17.0",
"@ionic-native/zip": "^4.17.0",
"@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/clipboard": "^4.20.0",
"@ionic-native/core": "^4.20.0",
"@ionic-native/device": "^4.20.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/in-app-browser": "^4.20.0",
"@ionic-native/keyboard": "^4.20.0",
"@ionic-native/local-notifications": "^4.20.0",
"@ionic-native/media-capture": "^4.20.0",
"@ionic-native/network": "^4.20.0",
"@ionic-native/push": "^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.10.2",
"chart.js": "^2.7.2",
"ajv": "^6.11.0",
"chart.js": "^2.9.3",
"com-darryncampbell-cordova-plugin-intent": "^1.3.0",
"cordova": "9.0.0",
"cordova-android": "8.0.0",
"cordova-android": "^8.1.0",
"cordova-android-support-gradle-release": "^3.0.1",
"cordova-clipboard": "^1.3.0",
"cordova-ios": "5.0.1",
"cordova-ios": "^5.1.1",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-customurlscheme": "^4.4.0",
"cordova-plugin-customurlscheme": "^5.0.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^2.2.1",
"cordova-plugin-file-opener2": "^3.0.0",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-plugin-inappbrowser": "^3.2.0",
"cordova-plugin-ionic-keyboard": "2.1.3",
"cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle",
"cordova-plugin-media-capture": "^3.0.3",
Expand All @@ -100,48 +99,48 @@
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-zip": "^3.1.0",
"cordova-sqlite-storage": "^3.4.0",
"cordova-support-google-services": "^1.2.1",
"cordova-sqlite-storage": "^4.0.0",
"cordova-support-google-services": "^1.3.2",
"es6-promise-plugin": "^4.2.2",
"font-awesome": "^4.7.0",
"ionic-angular": "3.9.3",
"ionic-angular": "3.9.9",
"ionicons": "^3.0.0",
"jszip": "^3.1.5",
"jszip": "^3.2.2",
"mathjax": "2.7.7",
"moment": "^2.22.2",
"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.11",
"promise.prototype.finally": "3.1.0",
"rxjs": "^5.5.12",
"sw-toolbox": "^3.6.0",
"ts-md5": "^1.2.4",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.26"
"ts-md5": "^1.2.7",
"web-animations-js": "^2.3.2",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.2",
"@ionic/app-scripts": "3.2.3",
"@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",
"@types/node": "^8.10.59",
"@types/promise.prototype.finally": "^2.0.3",
"electron-builder-lib": "^20.23.1",
"electron-rebuild": "^1.8.1",
"electron-rebuild": "^1.10.0",
"gulp": "4.0.2",
"gulp-clip-empty-files": "^0.1.2",
"gulp-concat": "^2.6.1",
"gulp-flatten": "^0.4.0",
"gulp-htmlmin": "^5.0.1",
"gulp-rename": "^1.3.0",
"gulp-rename": "^2.0.0",
"gulp-slash": "^1.1.3",
"lodash.template": "^4.5.0",
"node-loader": "^0.6.0",
"through": "^2.3.8",
"typescript": "^2.6.2",
"typescript": "~2.6.2",
"vinyl": "^2.2.0",
"webpack-merge": "^4.1.2"
"webpack-merge": "^4.2.2"
},
"browser": {
"electron": false
Expand Down
35 changes: 16 additions & 19 deletions src/addon/mod/book/providers/book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { CoreFileProvider } from '@providers/file';
import { CoreFilepoolProvider } from '@providers/filepool';
import { CoreLoggerProvider } from '@providers/logger';
Expand All @@ -25,7 +24,7 @@ import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseLogHelperProvider } from '@core/course/providers/log-helper';
import { CoreSite } from '@classes/site';
import { CoreTagItem } from '@core/tag/providers/tag';
import { CoreWSExternalWarning, CoreWSExternalFile } from '@providers/ws';
import { CoreWSProvider, CoreWSExternalWarning, CoreWSExternalFile } from '@providers/ws';

/**
* Service that provides some features for books.
Expand All @@ -37,10 +36,16 @@ export class AddonModBookProvider {
protected ROOT_CACHE_KEY = 'mmaModBook:';
protected logger;

constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private textUtils: CoreTextUtilsProvider,
private fileProvider: CoreFileProvider, private filepoolProvider: CoreFilepoolProvider, private http: Http,
private utils: CoreUtilsProvider, private courseProvider: CoreCourseProvider, private domUtils: CoreDomUtilsProvider,
private logHelper: CoreCourseLogHelperProvider) {
constructor(logger: CoreLoggerProvider,
protected sitesProvider: CoreSitesProvider,
protected textUtils: CoreTextUtilsProvider,
protected fileProvider: CoreFileProvider,
protected filepoolProvider: CoreFilepoolProvider,
protected wsProvider: CoreWSProvider,
protected utils: CoreUtilsProvider,
protected courseProvider: CoreCourseProvider,
protected domUtils: CoreDomUtilsProvider,
protected logHelper: CoreCourseLogHelperProvider) {
this.logger = logger.getInstance('AddonModBookProvider');
}

Expand Down Expand Up @@ -128,19 +133,11 @@ export class AddonModBookProvider {
return this.sitesProvider.getCurrentSite().checkAndFixPluginfileURL(indexUrl);
}

return promise.then((url) => {
// Fetch the URL content.
const promise = this.http.get(url).toPromise();

return promise.then((response: Response): any => {
const content = response.text();
if (typeof content !== 'string') {
return Promise.reject(null);
} else {
// Now that we have the content, we update the SRC to point back to the external resource.
return this.domUtils.restoreSourcesInHtml(content, contentsMap[chapterId].paths);
}
});
return promise.then(async (url) => {
const content = await this.wsProvider.getText(url);

// Now that we have the content, we update the SRC to point back to the external resource.
return this.domUtils.restoreSourcesInHtml(content, contentsMap[chapterId].paths);
});
}

Expand Down
31 changes: 13 additions & 18 deletions src/addon/mod/page/providers/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CoreFilepoolProvider } from '@providers/filepool';
import { AddonModPageProvider } from './page';
import { CoreFileProvider } from '@providers/file';
import { CoreSitesProvider } from '@providers/sites';
import { Http, Response } from '@angular/http';
import { CoreWSProvider } from '@providers/ws';

/**
* Service that provides some features for page.
Expand All @@ -30,9 +30,13 @@ export class AddonModPageHelperProvider {

protected logger;

constructor(logger: CoreLoggerProvider, private domUtils: CoreDomUtilsProvider, private filepoolProvider: CoreFilepoolProvider,
private fileProvider: CoreFileProvider, private textUtils: CoreTextUtilsProvider, private http: Http,
private sitesProvider: CoreSitesProvider) {
constructor(logger: CoreLoggerProvider,
protected domUtils: CoreDomUtilsProvider,
protected filepoolProvider: CoreFilepoolProvider,
protected fileProvider: CoreFileProvider,
protected textUtils: CoreTextUtilsProvider,
protected wsProvider: CoreWSProvider,
protected sitesProvider: CoreSitesProvider) {
this.logger = logger.getInstance('AddonModPageHelperProvider');
}

Expand Down Expand Up @@ -79,21 +83,12 @@ export class AddonModPageHelperProvider {
promise = this.sitesProvider.getCurrentSite().checkAndFixPluginfileURL(indexUrl);
}

return promise.then((url) => {
return promise.then(async (url) => {
const content = await this.wsProvider.getText(url);

// Fetch the URL content.
const promise = this.http.get(url).toPromise();

return promise.then((response: Response): any => {
const content = response.text();
if (typeof content !== 'string') {
return Promise.reject(null);
}

// Now that we have the content, we update the SRC to point back to the external resource.
// That will be caught by core-format-text.
return this.domUtils.restoreSourcesInHtml(content, paths);
});
// Now that we have the content, we update the SRC to point back to the external resource.
// That will be caught by core-format-text.
return this.domUtils.restoreSourcesInHtml(content, paths);
});
}

Expand Down
50 changes: 22 additions & 28 deletions src/addon/remotethemes/providers/remotethemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { CoreWSProvider } from '@providers/ws';
import { CoreAppProvider } from '@providers/app';
import { CoreFileProvider } from '@providers/file';
import { CoreFilepoolProvider } from '@providers/filepool';
Expand All @@ -34,9 +34,13 @@ export class AddonRemoteThemesProvider {
protected logger;
protected stylesEls: {[siteId: string]: {element: HTMLStyleElement, hash: string}} = {};

constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private fileProvider: CoreFileProvider,
private filepoolProvider: CoreFilepoolProvider, private http: Http, private utils: CoreUtilsProvider,
private appProvider: CoreAppProvider) {
constructor(logger: CoreLoggerProvider,
protected sitesProvider: CoreSitesProvider,
protected fileProvider: CoreFileProvider,
protected filepoolProvider: CoreFilepoolProvider,
protected wsProvider: CoreWSProvider,
protected utils: CoreUtilsProvider,
protected appProvider: CoreAppProvider) {
this.logger = logger.getInstance('AddonRemoteThemesProvider');
}

Expand Down Expand Up @@ -174,18 +178,13 @@ export class AddonRemoteThemesProvider {
return;
}

return promise.then((url) => {
return promise.then(async (url) => {
this.logger.debug('Loading styles from: ', url);

// Get the CSS content using HTTP because we will treat the styles before saving them in the file.
return this.http.get(url).toPromise();
}).then((response): any => {
const text = response && response.text();
if (typeof text == 'string') {
return {fileUrl: fileUrl, styles: this.get35Styles(text)};
} else {
return Promise.reject(null);
}
const text = await this.wsProvider.getText(url);

return {fileUrl: fileUrl, styles: this.get35Styles(text)};
});
});
}
Expand Down Expand Up @@ -263,23 +262,18 @@ export class AddonRemoteThemesProvider {
return Promise.resolve();
}

return this.http.get(url).toPromise().then((response) => {
let text = response && response.text();
if (typeof text == 'string') {
text = this.get35Styles(text);
return this.wsProvider.getText(url).then((text) => {
text = this.get35Styles(text);

const styleEl = document.createElement('style');
styleEl.setAttribute('id', 'mobilecssurl-tmpsite');
styleEl.innerHTML = text;
const styleEl = document.createElement('style');
styleEl.setAttribute('id', 'mobilecssurl-tmpsite');
styleEl.innerHTML = text;

document.head.appendChild(styleEl);
this.stylesEls.tmpsite = {
element: styleEl,
hash: ''
};
} else {
return Promise.reject(null);
}
document.head.appendChild(styleEl);
this.stylesEls.tmpsite = {
element: styleEl,
hash: ''
};
});
}

Expand Down
2 changes: 0 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, COMPILER_OPTIONS } from '@angular/core';
import { IonicApp, IonicModule, Platform, Content, ScrollEvent, Config, Refresher } from 'ionic-angular';
import { assert } from 'ionic-angular/util/util';
import { HttpModule } from '@angular/http';
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { JitCompilerFactory } from '@angular/platform-browser-dynamic';
import { LocationStrategy } from '@angular/common';
Expand Down Expand Up @@ -202,7 +201,6 @@ export const WP_PROVIDER: any = null;
BrowserModule,
BrowserAnimationsModule,
HttpClientModule, // HttpClient is used to make JSON requests. It fails for HEAD requests because there is no content.
HttpModule,
IonicModule.forRoot(MoodleMobileApp, {
pageTransition: 'core-page-transition'
}),
Expand Down
Loading