support of ie11 is added
This commit is contained in:
parent
09148e04bb
commit
d5aae2d958
|
@ -41,6 +41,8 @@
|
|||
"with": "projects/ucap-webmessenger-app/src/environments/environment-browser.dev.ts"
|
||||
}
|
||||
],
|
||||
"polyfills": "projects/ucap-webmessenger-app/src/polyfills-es5.ts",
|
||||
"tsConfig": "projects/ucap-webmessenger-app/tsconfig-es5.app.json",
|
||||
"optimization": false,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": true,
|
||||
|
@ -70,6 +72,8 @@
|
|||
"with": "projects/ucap-webmessenger-app/src/environments/environment-browser.prod.ts"
|
||||
}
|
||||
],
|
||||
"polyfills": "projects/ucap-webmessenger-app/src/polyfills-es5.ts",
|
||||
"tsConfig": "projects/ucap-webmessenger-app/tsconfig-es5.app.json",
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
|
@ -155,7 +159,8 @@
|
|||
"serve": {
|
||||
"builder": "@angular-builders/custom-webpack:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "ucap-webmessenger-app:build"
|
||||
"browserTarget": "ucap-webmessenger-app:build",
|
||||
"disableHostCheck": true
|
||||
},
|
||||
"configurations": {
|
||||
"browser-development": {
|
||||
|
|
|
@ -13,6 +13,6 @@ export function getEnviroments() {
|
|||
__DEV__: channel === 'development',
|
||||
'process.platform': s(process.platform),
|
||||
'process.env.NODE_ENV': s(process.env.NODE_ENV || 'development'),
|
||||
'process.env.TEST_ENV': s(process.env.TEST_ENV)
|
||||
'process.env.TEST_ENV': s(process.env.TEST_ENV),
|
||||
};
|
||||
}
|
||||
|
|
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -4184,6 +4184,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"classlist.js": {
|
||||
"version": "1.1.20150312",
|
||||
"resolved": "https://registry.npmjs.org/classlist.js/-/classlist.js-1.1.20150312.tgz",
|
||||
"integrity": "sha1-HXCEL3Ai8I2awIbOaeWyUPLFd4k=",
|
||||
"dev": true
|
||||
},
|
||||
"clean-css": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz",
|
||||
|
@ -15387,6 +15393,12 @@
|
|||
"minimalistic-assert": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"web-animations-js": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.2.tgz",
|
||||
"integrity": "sha512-TOMFWtQdxzjWp8qx4DAraTWTsdhxVSiWa6NkPFSaPtZ1diKUxTn4yTix73A1euG1WbSOMMPcY51cnjTIHrGtDA==",
|
||||
"dev": true
|
||||
},
|
||||
"webdriver-js-extender": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz",
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"start:main": "wait-on http-get://localhost:4200/ && npm run build:main:development && electron --nolazy --inspect-brk=9229 .",
|
||||
"start:renderer": "cross-env UCAP_ENV_RUNTIME=ELECTRON ng serve -c renderer-development",
|
||||
"start:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng serve -c browser-development -o",
|
||||
"build": "npm-run-all -p build:renderer build:main:production",
|
||||
"build:renderer": "cross-env NODE_ENV=production ng build --base-href ./",
|
||||
"build:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng build -c browser-development",
|
||||
"build:main:development": "cross-env NODE_ENV=development TS_NODE_PROJECT='./config/tsconfig.webpack.json' parallel-webpack --config=config/main.webpack.config.ts",
|
||||
|
@ -62,6 +63,7 @@
|
|||
"@types/webpack-node-externals": "^1.6.3",
|
||||
"awesome-node-loader": "^1.1.1",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"classlist.js": "^1.1.20150312",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^5.0.4",
|
||||
"codelyzer": "^5.0.0",
|
||||
|
@ -107,6 +109,7 @@
|
|||
"tslint": "~5.15.0",
|
||||
"typescript": "~3.5.3",
|
||||
"wait-on": "^3.3.0",
|
||||
"web-animations-js": "^2.3.2",
|
||||
"webpack": "4.39.2",
|
||||
"webpack-cli": "^3.3.7",
|
||||
"webpack-node-externals": "^1.7.2",
|
||||
|
|
92
projects/ucap-webmessenger-app/src/polyfills-es5.ts
Normal file
92
projects/ucap-webmessenger-app/src/polyfills-es5.ts
Normal file
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||
* You can add your own extra polyfills to this file.
|
||||
*
|
||||
* This file is divided into 2 sections:
|
||||
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||
* file.
|
||||
*
|
||||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||
*
|
||||
* Learn more in https://angular.io/guide/browser-support
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
/** IE9, IE10 and IE11 requires all of the following polyfills. */
|
||||
// import 'core-js/es/symbol';
|
||||
// import 'core-js/es/object';
|
||||
// import 'core-js/es/function';
|
||||
// import 'core-js/es/parse-int';
|
||||
// import 'core-js/es/parse-float';
|
||||
// import 'core-js/es/number';
|
||||
// import 'core-js/es/math';
|
||||
// import 'core-js/es/string';
|
||||
// import 'core-js/es/date';
|
||||
// import 'core-js/es/array';
|
||||
// import 'core-js/es/regexp';
|
||||
// import 'core-js/es/map';
|
||||
// import 'core-js/es/weak-map';
|
||||
// import 'core-js/es/set';
|
||||
|
||||
if (!Element.prototype.matches) {
|
||||
Element.prototype.matches =
|
||||
(Element.prototype as any).matchesSelector ||
|
||||
(Element.prototype as any).mozMatchesSelector ||
|
||||
(Element.prototype as any).msMatchesSelector ||
|
||||
(Element.prototype as any).oMatchesSelector ||
|
||||
(Element.prototype as any).webkitMatchesSelector ||
|
||||
function(s) {
|
||||
const matches = (this.document || this.ownerDocument).querySelectorAll(s);
|
||||
let i = matches.length;
|
||||
while (--i >= 0 && matches.item(i) !== this) {}
|
||||
return i > -1;
|
||||
};
|
||||
}
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/**
|
||||
* Web Animations `@angular/platform-browser/animations`
|
||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||
*/
|
||||
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||
* will put import in the top of bundle, so user need to create a separate file
|
||||
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||
* into that file, and then add the following code before importing zone.js.
|
||||
* import './zone-flags.ts';
|
||||
*
|
||||
* The flags allowed in zone-flags.ts are listed here.
|
||||
*
|
||||
* The following flags will work for all browsers.
|
||||
*
|
||||
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||
*
|
||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||
*
|
||||
* (window as any).__Zone_enable_cross_context_check = true;
|
||||
*
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
6
projects/ucap-webmessenger-app/tsconfig-es5.app.json
Normal file
6
projects/ucap-webmessenger-app/tsconfig-es5.app.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "./tsconfig.app.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
|
@ -14,11 +14,14 @@ export abstract class UrlConfig {
|
|||
}
|
||||
|
||||
private static getUrl(hotConfig: HostConfig, pathname: string): string {
|
||||
const url = new URL(
|
||||
`${hotConfig.protocol}://${hotConfig.domain}:${String(hotConfig.port)}`
|
||||
);
|
||||
url.pathname = pathname;
|
||||
// const url = new URL(
|
||||
// `${hotConfig.protocol}://${hotConfig.domain}:${String(hotConfig.port)}`
|
||||
// );
|
||||
// url.pathname = pathname;
|
||||
|
||||
return url.href;
|
||||
// return url.href;
|
||||
return `${hotConfig.protocol}://${hotConfig.domain}:${String(
|
||||
hotConfig.port
|
||||
)}${pathname}`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,12 @@ export class NotificationService {
|
|||
}
|
||||
|
||||
notify(noti: NotificationRequest, click?: () => void) {
|
||||
if (!this.isSupported()) {
|
||||
return;
|
||||
}
|
||||
const notification = new Notification(noti.title, {
|
||||
body: noti.contents,
|
||||
icon: noti.image || 'assets/images/img_nophoto_50.png'
|
||||
icon: noti.image || 'assets/images/img_nophoto_50.png',
|
||||
});
|
||||
notification.onclick = e => {
|
||||
console.log('notification.onclick');
|
||||
|
|
|
@ -2,7 +2,11 @@ import { TranslateLoader } from '@ngx-translate/core';
|
|||
import { Observable } from 'rxjs';
|
||||
import { NativeService } from '@ucap-webmessenger/native';
|
||||
import { take, map } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TranslateLoaderService implements TranslateLoader {
|
||||
constructor(
|
||||
private nativeService: NativeService,
|
||||
|
|
|
@ -2,7 +2,11 @@ import { TranslateLoader } from '@ngx-translate/core';
|
|||
import { Observable } from 'rxjs';
|
||||
import { NativeService } from '@ucap-webmessenger/native';
|
||||
import { take, map } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TranslateLoaderService implements TranslateLoader {
|
||||
constructor(
|
||||
private nativeService: NativeService,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"importHelpers": true,
|
||||
"target": "es5",
|
||||
"target": "es2015",
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"lib": ["es2018", "dom"],
|
||||
"paths": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user