Skip to content

Commit

Permalink
pack them javascript in the right order..... yall
Browse files Browse the repository at this point in the history
  • Loading branch information
tm1000 committed Apr 5, 2018
1 parent d5d9ab9 commit 63fde0f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
array(
'name' => $rawname,
'description' => "Module of FreePBX (".trim($name).") :: ".trim(strip_tags(str_replace(array("\r", "\n"), '', $description))),
'default_branch' => 'release/13.0',
'default_branch' => 'release/'.$options['updatemaster'],
'homepage' => 'http://www.freepbx.org',
"has_issues" => false,
"has_wiki" => false,
Expand Down
23 changes: 12 additions & 11 deletions pack_javascripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
exec("ls $dir/bootstrap-table-extensions-dev/*.js",$output2,$ret);
$output = array_merge($output,$output2);
}
$final=$finalB=array();
$final=$firstJS=$lastJS=array();
/*
* to order js files: files will be appened to the array in the order they appear
* in the switch statmenet below. To give a file priority, create a case for it and
* add it to the $finalB array. All other files will be appended to the $final array.
* $finalB is then merged with $final, with $finalB being put first
* add it to the $firstJS array. All other files will be appended to the $final array.
* $firstJS is then merged with $final, with $firstJS being put first
*/
/*
Array
Expand Down Expand Up @@ -118,7 +118,7 @@
"|$dir/module_admin\.js|",
"|$dir/eventsource-.*\.min\.js|",
);
$finalB = array();
$firstJS = array();
}

foreach ($output as $file) {
Expand All @@ -135,10 +135,10 @@
//add files
switch(true){
case preg_match("|$dir/jquery\.cookie\.js|",$file):
$finalB[] = $file;
$firstJS[] = $file;
break;
case $file==$dir.'/script.legacy.js'://legacy script
$finalB[] = $file;
$firstJS[] = $file;
break;
case $file != $dir.'/script.legacy.js'://default
$final[] = $file;
Expand All @@ -148,13 +148,13 @@
//add files
switch(true){
case preg_match("|$dir/moment-duration-format-.*\.js|",$file):
$finalB[] = $file;
$lastJS[] = $file;
break;
case preg_match("|$dir/moment-with-locales-.*\.min\.js|",$file):
$finalB[] = $file;
$firstJS[] = $file;
break;
case $file==$dir.'/script.legacy.js'://legacy script
$finalB[] = $file;
$firstJS[] = $file;
break;
case $file != $dir.'/script.legacy.js'://default
$final[] = $file;
Expand All @@ -163,10 +163,11 @@
}
}

sort($finalB);
sort($lastJS);
sort($firstJS);
sort($final);

$final=array_merge($finalB,$final);
$final=array_merge($firstJS,$final,$lastJS);

echo "\narray(\n";
foreach($final as $f) {
Expand Down

0 comments on commit 63fde0f

Please sign in to comment.