*.jsx -> *.js

This commit is contained in:
RainLoop Team 2016-08-11 02:34:09 +03:00
parent 0a2b826f71
commit e88c193334
98 changed files with 341 additions and 340 deletions

View file

@ -26,7 +26,7 @@ window.progressJs.onbeforeend(() => {
require('json3'); require('json3');
require('../vendors/modernizr/modernizr-custom.js'); require('../vendors/modernizr/modernizr-custom.js');
require('Common/Booter.jsx'); require('Common/Booter');
if (window.__runBoot) if (window.__runBoot)
{ {

View file

@ -185,11 +185,8 @@ function signFileTask(callback) {
} }
}; };
cfg.paths.globjs = 'dev/**/*.{js,jsx,html,css}'; cfg.paths.globall = 'dev/**/*.{js,html,css}';
cfg.paths.globjsonly = 'dev/**/*.js'; cfg.paths.globjs = 'dev/**/*.{js}';
cfg.paths.globjsxonly = 'dev/**/*.jsx';
cfg.paths.globjsall = 'dev/**/*.{js,jsx}';
cfg.paths.globtsonly = 'dev/**/*.ts';
cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/'; cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/';
cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/';
cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/'; cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/';
@ -445,6 +442,7 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() {
return gulp.src(cfg.paths.staticJS + '*.js') return gulp.src(cfg.paths.staticJS + '*.js')
.pipe(ignore.exclude('*.next.js')) .pipe(ignore.exclude('*.next.js'))
.pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"')) .pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify({ .pipe(uglify({
mangle: true, mangle: true,
compress: true compress: true
@ -456,7 +454,7 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() {
// lint // lint
gulp.task('js:eslint', function() { gulp.task('js:eslint', function() {
return gulp.src(cfg.paths.globjsall) return gulp.src(cfg.paths.globjs)
.pipe(cache('eslint')) .pipe(cache('eslint'))
.pipe(eslint()) .pipe(eslint())
.pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))) .pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")})))
@ -684,7 +682,7 @@ gulp.task('watch', ['fast'], function() {
cfg.watch = true; cfg.watch = true;
livereload.listen(); livereload.listen();
gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']); gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']);
gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']); gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:validate']);
gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']); gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']);
}); });

View file

@ -1945,8 +1945,11 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$bAppJsDebug = !!$this->Config()->Get('labs', 'use_app_debug_js', false); $bAppJsDebug = !!$this->Config()->Get('labs', 'use_app_debug_js', false);
$aResult['StaticLibJsLink'] = $this->StaticPath('js/'.($bAppJsDebug ? '' : 'min/').'libs.js'); $aResult['StaticLibJsLink'] = $this->StaticPath('js/'.($bAppJsDebug ? '' : 'min/').
$aResult['StaticAppJsLink'] = $this->StaticPath('js/'.($bAppJsDebug ? '' : 'min/').($bAdmin ? 'admin' : 'app').'.js'); 'libs'.($bAppJsDebug ? '' : '.min').'.js');
$aResult['StaticAppJsLink'] = $this->StaticPath('js/'.($bAppJsDebug ? '' : 'min/').
($bAdmin ? 'admin' : 'app').($bAppJsDebug ? '' : '.min').'.js');
$aResult['StaticAppJsNextLink'] = $this->StaticPath('js/'.($bAdmin ? 'admin' : 'app').'.next.js'); // todo min $aResult['StaticAppJsNextLink'] = $this->StaticPath('js/'.($bAdmin ? 'admin' : 'app').'.next.js'); // todo min
$aResult['StaticEditorJsLink'] = $this->StaticPath('ckeditor/ckeditor.js'); $aResult['StaticEditorJsLink'] = $this->StaticPath('ckeditor/ckeditor.js');

View file

@ -1,323 +1,323 @@
<?php <?php
namespace RainLoop; namespace RainLoop;
class Service class Service
{ {
/** /**
* @var \MailSo\Base\Http * @var \MailSo\Base\Http
*/ */
private $oHttp; private $oHttp;
/** /**
* @var \RainLoop\Actions * @var \RainLoop\Actions
*/ */
private $oActions; private $oActions;
/** /**
* @var \RainLoop\ServiceActions * @var \RainLoop\ServiceActions
*/ */
private $oServiceActions; private $oServiceActions;
/** /**
* @return void * @return void
*/ */
private function __construct() private function __construct()
{ {
$this->oHttp = \MailSo\Base\Http::SingletonInstance(); $this->oHttp = \MailSo\Base\Http::SingletonInstance();
$this->oActions = \RainLoop\Api::Actions(); $this->oActions = \RainLoop\Api::Actions();
$this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions); $this->oServiceActions = new \RainLoop\ServiceActions($this->oHttp, $this->oActions);
if ($this->oActions->Config()->Get('debug', 'enable', false)) if ($this->oActions->Config()->Get('debug', 'enable', false))
{ {
\error_reporting(E_ALL); \error_reporting(E_ALL);
\ini_set('display_errors', 1); \ini_set('display_errors', 1);
} }
$sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', '')); $sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', ''));
if (0 < \strlen($sServer)) if (0 < \strlen($sServer))
{ {
@\header('Server: '.$sServer, true); @\header('Server: '.$sServer, true);
} }
$sXFrameOptionsHeader = \trim($this->oActions->Config()->Get('security', 'x_frame_options_header', '')); $sXFrameOptionsHeader = \trim($this->oActions->Config()->Get('security', 'x_frame_options_header', ''));
if (0 < \strlen($sXFrameOptionsHeader)) if (0 < \strlen($sXFrameOptionsHeader))
{ {
@\header('X-Frame-Options: '.$sXFrameOptionsHeader, true); @\header('X-Frame-Options: '.$sXFrameOptionsHeader, true);
} }
if ($this->oActions->Config()->Get('labs', 'force_https', false) && !$this->oHttp->IsSecure()) if ($this->oActions->Config()->Get('labs', 'force_https', false) && !$this->oHttp->IsSecure())
{ {
@\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true); @\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true);
exit(0); exit(0);
} }
$this->localHandle(); $this->localHandle();
} }
/** /**
* @return bool * @return bool
*/ */
public function RunResult() public function RunResult()
{ {
return true; return true;
} }
/** /**
* @staticvar bool $bOne * @staticvar bool $bOne
* @return bool * @return bool
*/ */
public static function Handle() public static function Handle()
{ {
static $bOne = null; static $bOne = null;
if (null === $bOne) if (null === $bOne)
{ {
$oService = null; $oService = null;
if (\class_exists('MailSo\Version')) if (\class_exists('MailSo\Version'))
{ {
$oService = new self(); $oService = new self();
} }
$bOne = $oService->RunResult(); $bOne = $oService->RunResult();
} }
return $bOne; return $bOne;
} }
/** /**
* @return \RainLoop\Service * @return \RainLoop\Service
*/ */
private function localHandle() private function localHandle()
{ {
if (!\class_exists('MailSo\Version')) if (!\class_exists('MailSo\Version'))
{ {
return $this; return $this;
} }
$this->oActions->BootStart(); $this->oActions->BootStart();
$sResult = ''; $sResult = '';
$bCached = false; $bCached = false;
$sQuery = $this->oActions->ParseQueryAuthString(); $sQuery = $this->oActions->ParseQueryAuthString();
$this->oActions->Plugins()->RunHook('filter.http-query', array(&$sQuery)); $this->oActions->Plugins()->RunHook('filter.http-query', array(&$sQuery));
$aPaths = \explode('/', $sQuery); $aPaths = \explode('/', $sQuery);
$this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths)); $this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths));
$bAdmin = false; $bAdmin = false;
$sAdminPanelHost = $this->oActions->Config()->Get('security', 'admin_panel_host', ''); $sAdminPanelHost = $this->oActions->Config()->Get('security', 'admin_panel_host', '');
if (empty($sAdminPanelHost)) if (empty($sAdminPanelHost))
{ {
$sAdminPanelKey = \strtolower($this->oActions->Config()->Get('security', 'admin_panel_key', 'admin')); $sAdminPanelKey = \strtolower($this->oActions->Config()->Get('security', 'admin_panel_key', 'admin'));
$bAdmin = !empty($aPaths[0]) && \strtolower($aPaths[0]) === $sAdminPanelKey; $bAdmin = !empty($aPaths[0]) && \strtolower($aPaths[0]) === $sAdminPanelKey;
} }
else if (empty($aPaths[0]) && else if (empty($aPaths[0]) &&
\MailSo\Base\Utils::StrToLowerIfAscii($sAdminPanelHost) === \MailSo\Base\Utils::StrToLowerIfAscii($this->oHttp->GetHost())) \MailSo\Base\Utils::StrToLowerIfAscii($sAdminPanelHost) === \MailSo\Base\Utils::StrToLowerIfAscii($this->oHttp->GetHost()))
{ {
$bAdmin = true; $bAdmin = true;
} }
if ($this->oHttp->IsPost()) if ($this->oHttp->IsPost())
{ {
$this->oHttp->ServerNoCache(); $this->oHttp->ServerNoCache();
} }
if ($bAdmin && !$this->oActions->Config()->Get('security', 'allow_admin_panel', true)) if ($bAdmin && !$this->oActions->Config()->Get('security', 'allow_admin_panel', true))
{ {
echo $this->oServiceActions->ErrorTemplates('Access Denied.', echo $this->oServiceActions->ErrorTemplates('Access Denied.',
'Access to the RainLoop Webmail Admin Panel is not allowed!', true); 'Access to the RainLoop Webmail Admin Panel is not allowed!', true);
return $this; return $this;
} }
$bIndex = true; $bIndex = true;
if (0 < \count($aPaths) && !empty($aPaths[0]) && !$bAdmin && 'index' !== \strtolower($aPaths[0])) if (0 < \count($aPaths) && !empty($aPaths[0]) && !$bAdmin && 'index' !== \strtolower($aPaths[0]))
{ {
$bIndex = false; $bIndex = false;
$sMethodName = 'Service'.\preg_replace('/@.+$/', '', $aPaths[0]); $sMethodName = 'Service'.\preg_replace('/@.+$/', '', $aPaths[0]);
$sMethodExtra = 0 < \strpos($aPaths[0], '@') ? \preg_replace('/^[^@]+@/', '', $aPaths[0]) : ''; $sMethodExtra = 0 < \strpos($aPaths[0], '@') ? \preg_replace('/^[^@]+@/', '', $aPaths[0]) : '';
if (\method_exists($this->oServiceActions, $sMethodName) && if (\method_exists($this->oServiceActions, $sMethodName) &&
\is_callable(array($this->oServiceActions, $sMethodName))) \is_callable(array($this->oServiceActions, $sMethodName)))
{ {
$this->oServiceActions->SetQuery($sQuery)->SetPaths($aPaths); $this->oServiceActions->SetQuery($sQuery)->SetPaths($aPaths);
$sResult = \call_user_func(array($this->oServiceActions, $sMethodName), $sMethodExtra); $sResult = \call_user_func(array($this->oServiceActions, $sMethodName), $sMethodExtra);
} }
else if (!$this->oActions->Plugins()->RunAdditionalPart($aPaths[0], $aPaths)) else if (!$this->oActions->Plugins()->RunAdditionalPart($aPaths[0], $aPaths))
{ {
$bIndex = true; $bIndex = true;
} }
} }
$bMobile = false; $bMobile = false;
$bMobileDevice = false; $bMobileDevice = false;
if ($this->oActions->Config()->Get('labs', 'allow_mobile_version', false)) if ($this->oActions->Config()->Get('labs', 'allow_mobile_version', false))
{ {
$oMobileDetect = new \Detection\MobileDetect(); $oMobileDetect = new \Detection\MobileDetect();
$bMobileDevice = $oMobileDetect->isMobile() && !$oMobileDetect->isTablet(); $bMobileDevice = $oMobileDetect->isMobile() && !$oMobileDetect->isTablet();
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0])); $bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
} }
if ($bIndex && !$bMobile) if ($bIndex && !$bMobile)
{ {
$iMobileKey = (int) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 0); $iMobileKey = (int) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 0);
if (1 !== $iMobileKey) if (1 !== $iMobileKey)
{ {
if ($bMobileDevice) if ($bMobileDevice)
{ {
$this->oActions->Location('./?/Mobile/'); $this->oActions->Location('./?/Mobile/');
return $this; return $this;
} }
} }
} }
if ($bIndex) if ($bIndex)
{ {
@\header('Content-Security-Policy:'); @\header('Content-Security-Policy:');
@\header_remove('Content-Security-Policy'); @\header_remove('Content-Security-Policy');
@header('Content-Type: text/html; charset=utf-8'); @header('Content-Type: text/html; charset=utf-8');
$this->oHttp->ServerNoCache(); $this->oHttp->ServerNoCache();
if (!@\is_dir(APP_DATA_FOLDER_PATH) || !@\is_writable(APP_DATA_FOLDER_PATH)) if (!@\is_dir(APP_DATA_FOLDER_PATH) || !@\is_writable(APP_DATA_FOLDER_PATH))
{ {
echo $this->oServiceActions->ErrorTemplates( echo $this->oServiceActions->ErrorTemplates(
'Permission denied!', 'Permission denied!',
'RainLoop Webmail cannot access to the data folder "'.APP_DATA_FOLDER_PATH.'"' 'RainLoop Webmail cannot access to the data folder "'.APP_DATA_FOLDER_PATH.'"'
); );
return $this; return $this;
} }
$aTemplateParameters = $this->indexTemplateParameters($bAdmin, $bMobile, $bMobileDevice); $aTemplateParameters = $this->indexTemplateParameters($bAdmin, $bMobile, $bMobileDevice);
$sCacheFileName = ''; $sCacheFileName = '';
if ($this->oActions->Config()->Get('labs', 'cache_system_data', true) && !empty($aTemplateParameters['{{BaseHash}}'])) if ($this->oActions->Config()->Get('labs', 'cache_system_data', true) && !empty($aTemplateParameters['{{BaseHash}}']))
{ {
$sCacheFileName = 'TMPL:'.$aTemplateParameters['{{BaseHash}}']; $sCacheFileName = 'TMPL:'.$aTemplateParameters['{{BaseHash}}'];
$sResult = $this->oActions->Cacher()->Get($sCacheFileName); $sResult = $this->oActions->Cacher()->Get($sCacheFileName);
} }
if (0 === \strlen($sResult)) if (0 === \strlen($sResult))
{ {
// $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); // $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false);
$sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters); $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters);
$sResult = \RainLoop\Utils::ClearHtmlOutput($sResult); $sResult = \RainLoop\Utils::ClearHtmlOutput($sResult);
if (0 < \strlen($sCacheFileName)) if (0 < \strlen($sCacheFileName))
{ {
$this->oActions->Cacher()->Set($sCacheFileName, $sResult); $this->oActions->Cacher()->Set($sCacheFileName, $sResult);
} }
} }
else else
{ {
$bCached = true; $bCached = true;
} }
$sResult .= '<!--'; $sResult .= '<!--';
$sResult .= '[time:'.\substr(\microtime(true) - APP_START, 0, 6); $sResult .= '[time:'.\substr(\microtime(true) - APP_START, 0, 6);
// $sResult .= '][version:'.APP_VERSION; // $sResult .= '][version:'.APP_VERSION;
if ($this->oActions->IsOpen()) if ($this->oActions->IsOpen())
{ {
$sResult .= '][AGPLv3'; $sResult .= '][AGPLv3';
} }
$sResult .= '][cached:'.($bCached ? 'true' : 'false'); $sResult .= '][cached:'.($bCached ? 'true' : 'false');
// $sResult .= '][hash:'.$aTemplateParameters['{{BaseHash}}']; // $sResult .= '][hash:'.$aTemplateParameters['{{BaseHash}}'];
// $sResult .= '][session:'.\md5(\RainLoop\Utils::GetShortToken()); // $sResult .= '][session:'.\md5(\RainLoop\Utils::GetShortToken());
if ($bMobile) if ($bMobile)
{ {
$sResult .= '][mobile:true'; $sResult .= '][mobile:true';
} }
if (\RainLoop\Utils::IsOwnCloud()) if (\RainLoop\Utils::IsOwnCloud())
{ {
$sResult .= '][owncloud:true'; $sResult .= '][owncloud:true';
} }
$sResult .= ']-->'; $sResult .= ']-->';
} }
// Output result // Output result
echo $sResult; echo $sResult;
unset($sResult); unset($sResult);
$this->oActions->BootEnd(); $this->oActions->BootEnd();
return $this; return $this;
} }
/** /**
* @param string $sPath * @param string $sPath
* *
* @return string * @return string
*/ */
private function staticPath($sPath) private function staticPath($sPath)
{ {
return $this->oActions->StaticPath($sPath); return $this->oActions->StaticPath($sPath);
} }
/** /**
* @param bool $bAdmin = false * @param bool $bAdmin = false
* @param bool $bMobile = false * @param bool $bMobile = false
* @param bool $bMobileDevice = false * @param bool $bMobileDevice = false
* *
* @return array * @return array
*/ */
private function indexTemplateParameters($bAdmin = false, $bMobile = false, $bMobileDevice = false) private function indexTemplateParameters($bAdmin = false, $bMobile = false, $bMobileDevice = false)
{ {
$sLanguage = 'en'; $sLanguage = 'en';
$sTheme = 'Default'; $sTheme = 'Default';
list($sLanguage, $sTheme) = $this->oActions->GetLanguageAndTheme($bAdmin, $bMobile); list($sLanguage, $sTheme) = $this->oActions->GetLanguageAndTheme($bAdmin, $bMobile);
$bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false); $bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false);
$bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false); $bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false);
$sFaviconUrl = (string) $this->oActions->Config()->Get('webmail', 'favicon_url', ''); $sFaviconUrl = (string) $this->oActions->Config()->Get('webmail', 'favicon_url', '');
$sFaviconPngLink = $sFaviconUrl ? $sFaviconUrl : $this->staticPath('apple-touch-icon.png'); $sFaviconPngLink = $sFaviconUrl ? $sFaviconUrl : $this->staticPath('apple-touch-icon.png');
$sAppleTouchLink = $sFaviconUrl ? '' : $this->staticPath('apple-touch-icon.png'); $sAppleTouchLink = $sFaviconUrl ? '' : $this->staticPath('apple-touch-icon.png');
$sContentSecurityPolicy = $this->oActions->Config()->Get('security', 'content_security_policy', ''); $sContentSecurityPolicy = $this->oActions->Config()->Get('security', 'content_security_policy', '');
$aTemplateParameters = array( $aTemplateParameters = array(
'{{BaseAppFaviconPngLinkTag}}' => $sFaviconPngLink ? '<link type="image/png" rel="shortcut icon" href="'.$sFaviconPngLink.'" />' : '', '{{BaseAppFaviconPngLinkTag}}' => $sFaviconPngLink ? '<link type="image/png" rel="shortcut icon" href="'.$sFaviconPngLink.'" />' : '',
'{{BaseAppFaviconTouchLinkTag}}' => $sAppleTouchLink ? '<link type="image/png" rel="apple-touch-icon" href="'.$sAppleTouchLink.'" />' : '', '{{BaseAppFaviconTouchLinkTag}}' => $sAppleTouchLink ? '<link type="image/png" rel="apple-touch-icon" href="'.$sAppleTouchLink.'" />' : '',
'{{BaseAppMainCssLink}}' => $this->staticPath('css/app'.($bAppCssDebug ? '' : '.min').'.css'), '{{BaseAppMainCssLink}}' => $this->staticPath('css/app'.($bAppCssDebug ? '' : '.min').'.css'),
'{{BaseAppThemeCssLink}}' => $this->oActions->ThemeLink($sTheme, $bAdmin), '{{BaseAppThemeCssLink}}' => $this->oActions->ThemeLink($sTheme, $bAdmin),
'{{BaseAppBootScriptLink}}' => $this->staticPath('js/'.($bAppJsDebug ? '' : 'min/').'boot.js'), '{{BaseAppBootScriptLink}}' => $this->staticPath('js/'.($bAppJsDebug ? '' : 'min/').'boot'.($bAppJsDebug ? '' : '.min').'.js'),
'{{BaseViewport}}' => $bMobile ? 'width=device-width,initial-scale=1,user-scalable=no' : 'width=950,maximum-scale=2', '{{BaseViewport}}' => $bMobile ? 'width=device-width,initial-scale=1,user-scalable=no' : 'width=950,maximum-scale=2',
'{{BaseContentSecurityPolicy}}' => $sContentSecurityPolicy ? '{{BaseContentSecurityPolicy}}' => $sContentSecurityPolicy ?
'<meta http-equiv="Content-Security-Policy" content="'.$sContentSecurityPolicy.'" />' : '', '<meta http-equiv="Content-Security-Policy" content="'.$sContentSecurityPolicy.'" />' : '',
'{{BaseDir}}' => false && \in_array($sLanguage, array('ar', 'he', 'ur')) ? 'rtl' : 'ltr', '{{BaseDir}}' => false && \in_array($sLanguage, array('ar', 'he', 'ur')) ? 'rtl' : 'ltr',
'{{BaseAppManifestLink}}' => $this->staticPath('manifest.json') '{{BaseAppManifestLink}}' => $this->staticPath('manifest.json')
); );
$aTemplateParameters['{{RainloopBootData}}'] = \json_encode(array( $aTemplateParameters['{{RainloopBootData}}'] = \json_encode(array(
'admin' => $bAdmin, 'admin' => $bAdmin,
'language' => $sLanguage, 'language' => $sLanguage,
'theme' => $sTheme, 'theme' => $sTheme,
'mobile' => $bMobile, 'mobile' => $bMobile,
'mobileDevice' => $bMobileDevice 'mobileDevice' => $bMobileDevice
)); ));
$aTemplateParameters['{{BaseHash}}'] = \md5( $aTemplateParameters['{{BaseHash}}'] = \md5(
\implode('~', array( \implode('~', array(
$bAdmin ? '1' : '0', $bAdmin ? '1' : '0',
\md5($this->oActions->Config()->Get('cache', 'index', '')), \md5($this->oActions->Config()->Get('cache', 'index', '')),
$this->oActions->Plugins()->Hash(), $this->oActions->Plugins()->Hash(),
\RainLoop\Utils::WebVersionPath(), \RainLoop\Utils::WebVersionPath(),
APP_VERSION, APP_VERSION,
)). )).
\implode('~', $aTemplateParameters) \implode('~', $aTemplateParameters)
); );
return $aTemplateParameters; return $aTemplateParameters;
} }
} }

View file

@ -7,12 +7,12 @@ var
module.exports = function(es6) { module.exports = function(es6) {
return { return {
entry: es6 ? { entry: es6 ? {
'app.next': __dirname + '/dev/app.jsx', 'app.next': __dirname + '/dev/app.js',
'admin.next': __dirname + '/dev/admin.jsx' 'admin.next': __dirname + '/dev/admin.js'
} : { } : {
'boot': __dirname + '/dev/boot.jsx', 'boot': __dirname + '/dev/boot.js',
'app': __dirname + '/dev/app.jsx', 'app': __dirname + '/dev/app.js',
'admin': __dirname + '/dev/admin.jsx' 'admin': __dirname + '/dev/admin.js'
}, },
output: { output: {
pathinfo: true, pathinfo: true,
@ -25,7 +25,7 @@ module.exports = function(es6) {
], ],
resolve: { resolve: {
modules: [devPath, 'node_modules'], modules: [devPath, 'node_modules'],
extensions: ['', '.js', '.jsx'], extensions: ['', '.js'],
alias: { alias: {
'Opentip': __dirname + '/dev/External/Opentip.js', 'Opentip': __dirname + '/dev/External/Opentip.js',
'ko': __dirname + '/dev/External/ko.js' 'ko': __dirname + '/dev/External/ko.js'
@ -121,5 +121,5 @@ module.exports = function(es6) {
'Promise': 'window.Promise', 'Promise': 'window.Promise',
'$': 'window.jQuery' '$': 'window.jQuery'
} }
} };
}; };