mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
4954de2a96
This is a very big commit that does an initial job of upgrading everything to the latest version. TSLint gets replaced by ESLint. Instead of plain node, now ts-node is being used. Old modules also get replaced with new ones (mostly ng2 to ngx). Also obsolete configs have been replaced with how it's used today with Angular. This includes: * Upgrade to: ** Angular 12 ** Typescript 4 ** ESLint 7 and replace TSLint ** Bootstrap 5 ** Eerything connected to these * Run with ts-node * Convert wepack config to angular config * Remove typescript-ioc * Update tsconfigs * Run a git command instead of using a library for sshort hash * Move assets to a new location align with default Angular settings * Database migration for new avatarUrl locations * Simplify Model extension align with newest sequelize version * Remove breadcrumb hack * Fix homeserver typo * A few general fixes that are necessary with newest Typescript rules * Define Express.User interface
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { environment } from './environments/environment';
|
|
import { enableProdMode } from "@angular/core";
|
|
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
|
|
import { AppModule } from "./app/app.module";
|
|
import fontawesome from '@fortawesome/fontawesome';
|
|
import solid from '@fortawesome/fontawesome-free-solid';
|
|
import regular from '@fortawesome/fontawesome-free-regular';
|
|
import brands from '@fortawesome/fontawesome-free-brands';
|
|
|
|
fontawesome.library.add(regular, solid, brands);
|
|
|
|
// depending on the env mode, enable prod mode or add debugging modules
|
|
//noinspection TypeScriptUnresolvedVariable
|
|
if (environment.production) {
|
|
enableProdMode();
|
|
}
|
|
|
|
export function main() {
|
|
return platformBrowserDynamic().bootstrapModule(AppModule);
|
|
}
|
|
|
|
if (document.readyState === "complete") {
|
|
main();
|
|
} else {
|
|
document.addEventListener("DOMContentLoaded", main);
|
|
}
|
|
|
|
(<any>String.prototype).hashCode = function () {
|
|
let hash = 0, i, chr;
|
|
if (this.length === 0) return hash;
|
|
for (i = 0; i < this.length; i++) {
|
|
chr = this.charCodeAt(i);
|
|
hash = ((hash << 5) - hash) + chr;
|
|
hash |= 0; // Convert to 32bit integer
|
|
}
|
|
return hash;
|
|
};
|
|
|
|
// HACK: Work around .opener not being available
|
|
if (!window.opener && window.parent) window.opener = window.parent;
|