making more improvements in js. files
This commit is contained in:
@@ -986,7 +986,21 @@ class G
|
|||||||
|
|
||||||
$typearray = explode ( '.', $file );
|
$typearray = explode ( '.', $file );
|
||||||
$typefile = $typearray[ count($typearray) -1 ];
|
$typefile = $typearray[ count($typearray) -1 ];
|
||||||
|
$namearray = explode ( '/', $typearray[0] );
|
||||||
$filename = $file;
|
$filename = $file;
|
||||||
|
|
||||||
|
//trick to generate the translation.language.js file , merging two files and then minified the content.
|
||||||
|
if ( strtolower ($typefile ) == 'js' && $namearray[ count($namearray) -1 ] == 'translation' ) {
|
||||||
|
G::sendHeaders ( $filename , 'text/javascript', $download, $downloadFileName );
|
||||||
|
$output = '';
|
||||||
|
$locale = $typearray[1]; //here we have the language , for example translation.en.js
|
||||||
|
G::LoadTranslationObject($locale);
|
||||||
|
global $translation;
|
||||||
|
$output .= JSMin::minify ( 'var TRANSLATIONS = ' . G::json_encode($translation) . ';' );
|
||||||
|
print $output;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( file_exists ( $filename ) ) {
|
if ( file_exists ( $filename ) ) {
|
||||||
switch ( strtolower ($typefile ) ) {
|
switch ( strtolower ($typefile ) ) {
|
||||||
case 'swf' :
|
case 'swf' :
|
||||||
@@ -1061,9 +1075,11 @@ class G
|
|||||||
$pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP;
|
$pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP;
|
||||||
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ext-all.js' ) );
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ext-all.js' ) );
|
||||||
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux/ux-all.js' ) );
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux/ux-all.js' ) );
|
||||||
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux/miframe.js' ) );
|
||||||
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.locationbar/Ext.ux.LocationBar.js' ) );
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.locationbar/Ext.ux.LocationBar.js' ) );
|
||||||
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.statusbar/ext-statusbar.js' ) );
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.statusbar/ext-statusbar.js' ) );
|
||||||
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js' ) );
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js' ) );
|
||||||
|
$output .= JSMin::minify ( file_get_contents ( $pathJs . 'ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js' ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'maborak.js' :
|
case 'maborak.js' :
|
||||||
@@ -1203,7 +1219,10 @@ class G
|
|||||||
|
|
||||||
header('Pragma: cache');
|
header('Pragma: cache');
|
||||||
|
|
||||||
$mtime = filemtime($filename);
|
if ( file_exists($filename) )
|
||||||
|
$mtime = filemtime($filename);
|
||||||
|
else
|
||||||
|
$mtime = date('U');
|
||||||
$gmt_mtime = gmdate("D, d M Y H:i:s", $mtime ) . " GMT";
|
$gmt_mtime = gmdate("D, d M Y H:i:s", $mtime ) . " GMT";
|
||||||
header('ETag: "' . md5 ($mtime . $filename ) . '"' );
|
header('ETag: "' . md5 ($mtime . $filename ) . '"' );
|
||||||
header("Last-Modified: " . $gmt_mtime );
|
header("Last-Modified: " . $gmt_mtime );
|
||||||
|
|||||||
@@ -185,9 +185,7 @@ class headPublisher {
|
|||||||
if ($this->disableHeaderScripts)
|
if ($this->disableHeaderScripts)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
// die(SYS_LANG);
|
|
||||||
$this->addScriptFile ( "/js/widgets/js-calendar/lang/" . SYS_LANG . ".js" );
|
$this->addScriptFile ( "/js/widgets/js-calendar/lang/" . SYS_LANG . ".js" );
|
||||||
//$this->addScriptFile ( '/gulliver/loader?t=js-translations&locale='.SYS_LANG);
|
|
||||||
|
|
||||||
$head = '';
|
$head = '';
|
||||||
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
|
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
|
||||||
@@ -276,14 +274,15 @@ class headPublisher {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
||||||
/*
|
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/wz_jsgraphics.js'></script>\n";
|
//$head .= " <script type='text/javascript' src='/js/ext/wz_jsgraphics.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/mootools.js'></script>\n";
|
//$head .= " <script type='text/javascript' src='/js/ext/mootools.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/moocanvas.js'></script>\n";
|
//$head .= " <script type='text/javascript' src='/js/ext/moocanvas.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
//$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/pmos-common.js'></script>\n";
|
//$head .= " <script type='text/javascript' src='/js/ext/pmos-common.js'></script>\n";
|
||||||
*/
|
//$head .= " <script type='text/javascript' src='/gulliver/loader?t=js-translations&locale=".SYS_LANG."'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/gulliver/loader?t=js-translations&locale=".SYS_LANG."'></script>\n";
|
|
||||||
|
$head .= " <script type='text/javascript' src='/js/ext/translation.".SYS_LANG.".js'></script>\n";
|
||||||
|
|
||||||
if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') {
|
if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') {
|
||||||
$this->extJsSkin = 'xtheme-gray';
|
$this->extJsSkin = 'xtheme-gray';
|
||||||
|
|||||||
Reference in New Issue
Block a user