Fix build system.

This commit is contained in:
Pierre HUBERT 2019-01-26 16:46:36 +01:00
parent 5276790afe
commit faba9b36cb
7 changed files with 57 additions and 23 deletions

View File

@ -694,7 +694,7 @@ ComunicWeb.components.calls.callWindow = {
call.signalClient.sendSignal(member.user_call_id, JSON.stringify(data)); call.signalClient.sendSignal(member.user_call_id, JSON.stringify(data));
}); });
peer.on("message", message => { peer.on("message", function(message){
console.log("Message from remote peer: " + message); console.log("Message from remote peer: " + message);
}); });
@ -788,7 +788,7 @@ ComunicWeb.components.calls.callWindow = {
/** /**
* @type {HTMLVideoElement} * @type {HTMLVideoElement}
*/ */
let video = createElem2({ var video = createElem2({
appendTo: call.window.videosTarget, appendTo: call.window.videosTarget,
type: "video" type: "video"
}); });

View File

@ -94,7 +94,7 @@ ComunicWeb.components.calls.controller = {
* *
* @return Cached calls configuration * @return Cached calls configuration
*/ */
getConfig() { getConfig: function() {
return ComunicWeb.components.calls.__config; return ComunicWeb.components.calls.__config;
}, },

View File

@ -42,7 +42,7 @@ ComunicWeb.components.calls.currentList = {
* @param {number} id The ID of the call to add * @param {number} id The ID of the call to add
*/ */
addCallToList: function(id){ addCallToList: function(id){
let list = this.getCurrentCallsList(); var list = this.getCurrentCallsList();
if(!list.includes(""+id)) if(!list.includes(""+id))
list.push(id); list.push(id);
@ -57,7 +57,7 @@ ComunicWeb.components.calls.currentList = {
*/ */
removeCallFromList: function(id){ removeCallFromList: function(id){
let list = this.getCurrentCallsList(); var list = this.getCurrentCallsList();
while(list.includes(""+id)) while(list.includes(""+id))
list.splice(list.indexOf(""+id), 1); list.splice(list.indexOf(""+id), 1);

View File

@ -586,7 +586,7 @@ ComunicWeb.components.conversations.chatWindows = {
//for conversation of two people //for conversation of two people
//Add the call button //Add the call button
let button = createElem2({ var button = createElem2({
insertBefore: conversation.box.boxTools.firstChild, insertBefore: conversation.box.boxTools.firstChild,
type: "button", type: "button",
class: "btn btn-box-tool", class: "btn btn-box-tool",

40
builder
View File

@ -63,11 +63,12 @@ function files_to_file(array $files, string $target) : bool {
/** /**
* Copy an array of files into a specific target file using uglifyJS * Copy an array of files into a specific target file using uglifyJS
* *
* @param string $begin_path The begining of each path
* @param array $files The name of the source file * @param array $files The name of the source file
* @param string $target The target file * @param string $target The target file
* @return bool TRUE in case of success / FALSE in case of failure * @return bool TRUE in case of success / FALSE in case of failure
*/ */
function js_files_to_file(array $files, string $target){ function js_files_to_file(string $begin_path, array $files, string $target){
$source = ""; $source = "";
@ -77,7 +78,28 @@ function js_files_to_file(array $files, string $target){
foreach($files as $file){ foreach($files as $file){
$uglifyjs = true;
//Check if file entry is an array or a string
if(is_string($file))
$file = $begin_path.$file;
//It is an array
else if(is_array($file)) {
//Check if we have special information for uglifyjs
if(isset($file["uglifyjs"]))
$uglifyjs = $file["uglifyjs"];
$file = $begin_path.$file["path"];
}
//Else the kind of entry is not supported
else
throw new Exception("Excepted string or array, got something else for javascript entry!");
//Compress file //Compress file
if($uglifyjs){
notice("Parsing with UGLIFYJS: ".$file); notice("Parsing with UGLIFYJS: ".$file);
exec("/usr/bin/uglifyjs '".$file."' -c -o ".TEMP_FILE, $output, $exit_code); exec("/usr/bin/uglifyjs '".$file."' -c -o ".TEMP_FILE, $output, $exit_code);
@ -88,6 +110,14 @@ function js_files_to_file(array $files, string $target){
notice("An error (".$exit_code.") occured while parsing file ".$file, TRUE); notice("An error (".$exit_code.") occured while parsing file ".$file, TRUE);
exit(10); exit(10);
} }
}
//Else we take the file as is
else
$source .= "\n".file_get_contents($file);
} }
//Delete the temp file //Delete the temp file
@ -192,9 +222,8 @@ files_to_file($thirdPartyDebugFiles, $targetThirdPartyCSS);
//3rd party JS //3rd party JS
notice("Third Party JS"); notice("Third Party JS");
$thirdPartyDebugFiles = array_put_begining($path_debug_assets, $debug::THIRD_PARTY_JS);
$targetThirdPartyJS = $path_release_assets.$release::THIRD_PARTY_JS; $targetThirdPartyJS = $path_release_assets.$release::THIRD_PARTY_JS;
js_files_to_file($thirdPartyDebugFiles, $targetThirdPartyJS); js_files_to_file($path_debug_assets, $debug::THIRD_PARTY_JS, $targetThirdPartyJS);
//App CSS //App CSS
notice("App CSS"); notice("App CSS");
@ -204,9 +233,8 @@ files_to_file($appDebugFiles, $targetAppCSS);
//App JS //App JS
notice("App JS"); notice("App JS");
$appDebugFiles = array_put_begining($path_debug_assets, $debug::APP_JS);
$targetAppJS = $path_release_assets.$release::APP_JS; $targetAppJS = $path_release_assets.$release::APP_JS;
js_files_to_file($appDebugFiles, $targetAppJS); js_files_to_file($path_debug_assets, $debug::APP_JS, $targetAppJS);
//Make some adpations on third party files //Make some adpations on third party files
@ -231,6 +259,8 @@ rcopy($path_debug_assets."3rdparty/adminLTE/plugins/iCheck/flat/icheck-flat-imgs
rcopy($path_debug_assets."img/", $path_release_assets."img/"); rcopy($path_debug_assets."img/", $path_release_assets."img/");
rcopy($path_debug_assets."templates/", $path_release_assets."templates/"); rcopy($path_debug_assets."templates/", $path_release_assets."templates/");
//Copy songs
rcopy($path_debug_assets."audio/", $path_release_assets."audio/");
//Copy dark theme //Copy dark theme
rcopy($path_debug_assets."css/dark_theme.css", $path_release_assets."css/dark_theme.css"); rcopy($path_debug_assets."css/dark_theme.css", $path_release_assets."css/dark_theme.css");

View File

@ -161,8 +161,8 @@ class Dev {
"3rdparty/js-bbcode-parser/bbcode-parser.js", "3rdparty/js-bbcode-parser/bbcode-parser.js",
//Simple peer //Simple peer
"3rdparty/simplepeer/simplepeer.min.js", array("path" => "3rdparty/simplepeer/simplepeer.min.js", "uglifyjs" => false),
"3rdparty/SignalExchangerClient/SignalExchangerClient.js" array("path" => "3rdparty/SignalExchangerClient/SignalExchangerClient.js", "uglifyjs" => false)
); );
/** /**
@ -320,7 +320,7 @@ class Dev {
"js/common/formChecker.js", "js/common/formChecker.js",
"js/common/date.js", "js/common/date.js",
"js/common/system.js", "js/common/system.js",
"js/common/songPlayer.js", array("path" => "js/common/songPlayer.js", "uglifyjs" => false),
//Languages //Languages
"js/langs/en.inc.js", "js/langs/en.inc.js",

View File

@ -134,6 +134,10 @@ function src_inc_list_js(string $assets_url, array $files) : string {
//Process the list of files //Process the list of files
foreach($files as $file){ foreach($files as $file){
if(is_array($file))
$file = $file["path"];
$source .= src_inc_js($assets_url.$file)."\n\t\t"; $source .= src_inc_js($assets_url.$file)."\n\t\t";
} }