*.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

@ -291,7 +291,7 @@ class Service
'{{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.'" />' : '',

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'
} }
} };
}; };