Fixed build scripts :)
This commit is contained in:
parent
17d543e711
commit
05642f3fbe
5 changed files with 37 additions and 22 deletions
|
@ -12,6 +12,10 @@ function generate_link() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function replace_tribble() {
|
||||||
|
#${1} => file name
|
||||||
|
echo "$(cat ${1} | sed -E 's/\/\/\/[ ]+<reference [a-zA-Z.-=_ ]+\/>.*/\n/')" > ${1}
|
||||||
|
}
|
||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
cd "$BASEDIR/../"
|
cd "$BASEDIR/../"
|
||||||
|
|
||||||
|
@ -21,10 +25,12 @@ cd "$BASEDIR/../"
|
||||||
|
|
||||||
#Web
|
#Web
|
||||||
execute_tsc -p web/tsconfig/tsdeclaration.json
|
execute_tsc -p web/tsconfig/tsdeclaration.json
|
||||||
|
replace_tribble web/declarations/exports.d.ts
|
||||||
echo "Generated web declarations"
|
echo "Generated web declarations"
|
||||||
|
|
||||||
#Shared
|
#Shared
|
||||||
execute_tsc -p shared/tsconfig/tsdeclaration.json
|
execute_tsc -p shared/tsconfig/tsdeclaration.json
|
||||||
|
replace_tribble shared/declarations/exports.d.ts
|
||||||
echo "Generated shared declarations"
|
echo "Generated shared declarations"
|
||||||
|
|
||||||
#Now build the merged declaration for the shared project
|
#Now build the merged declaration for the shared project
|
||||||
|
|
|
@ -50,8 +50,9 @@ namespace ppt {
|
||||||
return result.substr(3);
|
return result.substr(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
export declare function initialize() : Promise<void>;
|
export declare function initialize() : Promise<void>;
|
||||||
export declare function finalize(); /* most the times not really required */
|
export declare function finalize(); // most the times not really required
|
||||||
|
|
||||||
export declare function register_key_listener(listener: (_: KeyEvent) => any);
|
export declare function register_key_listener(listener: (_: KeyEvent) => any);
|
||||||
export declare function unregister_key_listener(listener: (_: KeyEvent) => any);
|
export declare function unregister_key_listener(listener: (_: KeyEvent) => any);
|
||||||
|
@ -60,4 +61,5 @@ namespace ppt {
|
||||||
export declare function unregister_key_hook(hook: KeyHook);
|
export declare function unregister_key_hook(hook: KeyHook);
|
||||||
|
|
||||||
export declare function key_pressed(code: string | SpecialKey) : boolean;
|
export declare function key_pressed(code: string | SpecialKey) : boolean;
|
||||||
|
*/
|
||||||
}
|
}
|
|
@ -52,6 +52,34 @@ namespace app {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* define that here */
|
||||||
|
let impl_display_critical_error: (message: string) => any;
|
||||||
|
|
||||||
|
interface Window {
|
||||||
|
impl_display_critical_error: (_: string) => any;
|
||||||
|
}
|
||||||
|
if(!window.impl_display_critical_error) { /* default impl */
|
||||||
|
impl_display_critical_error = message => {
|
||||||
|
if(typeof(createErrorModal) !== 'undefined') {
|
||||||
|
createErrorModal("A critical error occurred while loading the page!", message, {closeable: false}).open();
|
||||||
|
} else {
|
||||||
|
let tag = document.getElementById("critical-load");
|
||||||
|
let detail = tag.getElementsByClassName("detail")[0];
|
||||||
|
detail.innerHTML = message;
|
||||||
|
|
||||||
|
tag.style.display = "block";
|
||||||
|
}
|
||||||
|
fadeoutLoader();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function displayCriticalError(message: string) {
|
||||||
|
if(window.impl_display_critical_error)
|
||||||
|
window.impl_display_critical_error(message);
|
||||||
|
else
|
||||||
|
console.error("Could not display a critical message: " + message); /* this shall never happen! */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function load_scripts(paths: (string | string[])[]) : {path: string, promise: Promise<Boolean>}[] {
|
function load_scripts(paths: (string | string[])[]) : {path: string, promise: Promise<Boolean>}[] {
|
||||||
let result = [];
|
let result = [];
|
||||||
for(let path of paths)
|
for(let path of paths)
|
||||||
|
@ -362,21 +390,6 @@ if(typeof Module === "undefined")
|
||||||
app.initialize();
|
app.initialize();
|
||||||
app.loadedListener.push(fadeoutLoader);
|
app.loadedListener.push(fadeoutLoader);
|
||||||
|
|
||||||
if(!window.displayCriticalError) { /* Declare this function here only because its required before load */
|
|
||||||
window.displayCriticalError = function(message: string) {
|
|
||||||
if(typeof(createErrorModal) !== 'undefined') {
|
|
||||||
createErrorModal("A critical error occurred while loading the page!", message, {closeable: false}).open();
|
|
||||||
} else {
|
|
||||||
let tag = document.getElementById("critical-load");
|
|
||||||
let detail = tag.getElementsByClassName("detail")[0];
|
|
||||||
detail.innerHTML = message;
|
|
||||||
|
|
||||||
tag.style.display = "block";
|
|
||||||
}
|
|
||||||
fadeoutLoader();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
navigator.browserSpecs = (function(){
|
navigator.browserSpecs = (function(){
|
||||||
let ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
let ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
||||||
if(/trident/i.test(M[1])){
|
if(/trident/i.test(M[1])){
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
/// <reference path="ui/modal/ModalBanClient.ts" />
|
/// <reference path="ui/modal/ModalBanClient.ts" />
|
||||||
/// <reference path="ui/modal/ModalYesNo.ts" />
|
/// <reference path="ui/modal/ModalYesNo.ts" />
|
||||||
/// <reference path="ui/modal/ModalBanList.ts" />
|
/// <reference path="ui/modal/ModalBanList.ts" />
|
||||||
/// <reference path="codec/CodecWrapper.ts" />
|
|
||||||
/// <reference path="settings.ts" />
|
/// <reference path="settings.ts" />
|
||||||
/// <reference path="log.ts" />
|
/// <reference path="log.ts" />
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
interface Window {
|
|
||||||
displayCriticalError: typeof displayCriticalError;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare function displayCriticalError(message: string); /* fun fact: is implemented within loader.js, but only because we cant override that file */
|
|
Loading…
Add table
Reference in a new issue