From ae996b75f19626397fc70c976e0db97aad5f98ef Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 18 Oct 2016 20:52:43 +0300 Subject: [PATCH] Updated: dependencies + small fixes --- .cmds | 1 - .github/ISSUE_TEMPLATE.md | 8 +-- dev/Common/Booter.js | 63 ++++++++++--------- dev/Common/Globals.js | 2 +- dev/Component/Abstract.js | 4 +- dev/Knoin/AbstractBoot.js | 4 +- dev/Knoin/AbstractModel.js | 7 +-- dev/Knoin/AbstractScreen.js | 6 +- dev/Knoin/AbstractViewNext.js | 4 +- dev/Knoin/Knoin.js | 2 +- dev/Promises/AbstractBasic.js | 7 +-- dev/Screen/AbstractSettings.js | 2 +- gulpfile.js | 1 - package.json | 8 +-- .../0.0.0/app/libraries/RainLoop/Actions.php | 2 +- webpack.config.builder.js | 5 +- 16 files changed, 59 insertions(+), 67 deletions(-) diff --git a/.cmds b/.cmds index 190988c94..c66dd8e86 100644 --- a/.cmds +++ b/.cmds @@ -4,7 +4,6 @@ tx pull -a # dependencies checker npm-check --skip-unused --save-exact -npm dedupe # dependencies locker npm shrinkwrap --dev diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8005890b5..81dcc5649 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,8 @@ -### RainLoop version, browser, OS: +**RainLoop version, browser, OS:** -### Expected behavior and actual behavior: +**Expected behavior and actual behavior:** -### Steps to reproduce the problem: +**Steps to reproduce the problem:** -### Logs or screenshots: +**Logs or screenshots:** diff --git a/dev/Common/Booter.js b/dev/Common/Booter.js index 2b9ec2005..7d1ad0ed0 100644 --- a/dev/Common/Booter.js +++ b/dev/Common/Booter.js @@ -25,33 +25,36 @@ const useJsNextBundle = (function() { } /* eslint-disable */ - try { - - eval(` - // let + const -const x = 5; let y = 4; var z = 4; - - // Arrow Function -const f = () => 'rainloop'; - - // Default + Rest + Spread -const d = (test = 1, ...t) => 'rainloop'; -d(...[1, 2, 3]); - -// Destructuring -let [a, b] = [1, 2]; -({a, b} = {a: 1, b: 2}); - -// Class -class Q1 { constructor() {} } - -// Class extends + super -class Q2 extends Q1 { constructor() { super() } } - -`); - return true; - } - catch (e) {} +// try { +// +// (function() { +// eval(` +// // let + const +//const x = 5; let y = 4; var z = 4; +// +// // Arrow Function +//const f = () => 'rainloop'; +// +// // Default + Rest + Spread +//const d = (test = 1, ...t) => 'rainloop'; +//d(...[1, 2, 3]); +// +//// Destructuring +//let [a, b] = [1, 2]; +//({a, b} = {a: 1, b: 2}); +// +//// Class +//class Q1 { constructor() {} } +// +//// Class extends + super +//class Q2 extends Q1 { constructor() { super() } } +// +//`); +// }()); +// +// return true; +// } +// catch (e) {} return false; /* eslint-enable */ @@ -65,7 +68,7 @@ class Q2 extends Q1 { constructor() { super() } } function getComputedStyle(id, name) { const element = window.document.getElementById(id); - return element.currentStyle ? element.currentStyle[name] : + return element && element.currentStyle ? element.currentStyle[name] : (window.getComputedStyle ? window.getComputedStyle(element, null).getPropertyValue(name) : null); } @@ -106,7 +109,9 @@ function includeLayout() } /** - * @param {mixed} data + * @param {boolean} admin = false + * @param {boolean} mobile = false + * @param {boolean} mobileDevice = false * @returns {void} */ function includeAppScr({admin = false, mobile = false, mobileDevice = false}) diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js index dd0a036fd..f979ee9a1 100644 --- a/dev/Common/Globals.js +++ b/dev/Common/Globals.js @@ -180,7 +180,7 @@ if (bAllowPdfPreview && window.navigator && window.navigator.mimeTypes) export {bAllowPdfPreview}; -export const aViewModels = { +export const VIEW_MODELS = { settings: [], 'settings-removed': [], 'settings-disabled': [] diff --git a/dev/Component/Abstract.js b/dev/Component/Abstract.js index e1bdebec1..6140e543b 100644 --- a/dev/Component/Abstract.js +++ b/dev/Component/Abstract.js @@ -1,7 +1,9 @@ import $ from '$'; import ko from 'ko'; + import {isUnd} from 'Common/Utils'; +import {i18nToNodes} from 'Common/Translator'; class AbstractComponent { @@ -35,7 +37,7 @@ const componentExportHelper = (ClassObject, templateID = '') => ({ params.component = componentInfo; params.element = $(componentInfo.element); - require('Common/Translator').i18nToNodes(params.element); + i18nToNodes(params.element); if (!isUnd(params.inline) && ko.unwrap(params.inline)) { diff --git a/dev/Knoin/AbstractBoot.js b/dev/Knoin/AbstractBoot.js index be58999d0..6b6c37e89 100644 --- a/dev/Knoin/AbstractBoot.js +++ b/dev/Knoin/AbstractBoot.js @@ -1,7 +1,5 @@ -class AbstractBoot +export class AbstractBoot { bootstart() {/* no-empty */} } - -export {AbstractBoot, AbstractBoot as default}; diff --git a/dev/Knoin/AbstractModel.js b/dev/Knoin/AbstractModel.js index f170b123b..57372c4d6 100644 --- a/dev/Knoin/AbstractModel.js +++ b/dev/Knoin/AbstractModel.js @@ -1,8 +1,7 @@ -import _ from '_'; import {isArray, disposeObject} from 'Common/Utils'; -class AbstractModel +export class AbstractModel { sModelName = ''; disposables = []; @@ -18,7 +17,7 @@ class AbstractModel regDisposables(value) { if (isArray(value)) { - _.each(value, (item) => { + value.forEach((item) => { this.disposables.push(item); }); } @@ -32,5 +31,3 @@ class AbstractModel disposeObject(this); } } - -export {AbstractModel, AbstractModel as default}; diff --git a/dev/Knoin/AbstractScreen.js b/dev/Knoin/AbstractScreen.js index 6d3acb373..5d6896741 100644 --- a/dev/Knoin/AbstractScreen.js +++ b/dev/Knoin/AbstractScreen.js @@ -3,7 +3,7 @@ import _ from '_'; import crossroads from 'crossroads'; import {isArray, isNonEmptyArray, noop} from 'Common/Utils'; -class AbstractScreen +export class AbstractScreen { oCross = null; sScreenName; @@ -57,7 +57,7 @@ class AbstractScreen fMatcher = _.bind(this.onRoute || noop, this); route = crossroads.create(); - _.each(routes, (item) => { + routes.forEach((item) => { if (item && route) { route.addRoute(item[0], fMatcher).rules = item[1]; @@ -68,5 +68,3 @@ class AbstractScreen } } } - -export {AbstractScreen, AbstractScreen as default}; diff --git a/dev/Knoin/AbstractViewNext.js b/dev/Knoin/AbstractViewNext.js index 6adc66eb2..13ecf6617 100644 --- a/dev/Knoin/AbstractViewNext.js +++ b/dev/Knoin/AbstractViewNext.js @@ -5,7 +5,7 @@ import {delegateRun, inFocus} from 'Common/Utils'; import {KeyState, EventKeyCode} from 'Common/Enums'; import {$win, keyScope} from 'Common/Globals'; -class AbstractViewNext +export class AbstractViewNext { bDisabeCloseOnEsc = false; sDefaultKeyScope = KeyState.None; @@ -58,5 +58,3 @@ class AbstractViewNext cancelCommand() {} // eslint-disable-line no-empty-function closeCommand() {} // eslint-disable-line no-empty-function } - -export {AbstractViewNext, AbstractViewNext as default}; diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index 69a7e7b02..a7b8f79f4 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -6,7 +6,7 @@ import hasher from 'hasher'; import crossroads from 'crossroads'; import {runHook} from 'Common/Plugins'; -import {$html, aViewModels as VIEW_MODELS, popupVisibilityNames} from 'Common/Globals'; +import {$html, VIEW_MODELS, popupVisibilityNames} from 'Common/Globals'; import { isArray, isUnd, pString, log, isFunc, diff --git a/dev/Promises/AbstractBasic.js b/dev/Promises/AbstractBasic.js index 8dc62062a..8b1207ed5 100644 --- a/dev/Promises/AbstractBasic.js +++ b/dev/Promises/AbstractBasic.js @@ -1,9 +1,8 @@ -import _ from '_'; import Promise from 'Promise'; import {isArray} from 'Common/Utils'; -class AbstractBasicPromises +export class AbstractBasicPromises { oPromisesStack = {}; @@ -24,7 +23,7 @@ class AbstractBasicPromises if (trigger) { value = !!value; - _.each(isArray(trigger) ? trigger : [trigger], (fTrigger) => { + (isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => { if (fTrigger) { fTrigger(value); @@ -33,5 +32,3 @@ class AbstractBasicPromises } } } - -export {AbstractBasicPromises, AbstractBasicPromises as default}; diff --git a/dev/Screen/AbstractSettings.js b/dev/Screen/AbstractSettings.js index 10c25a7a1..11cbf35ff 100644 --- a/dev/Screen/AbstractSettings.js +++ b/dev/Screen/AbstractSettings.js @@ -3,7 +3,7 @@ import _ from '_'; import $ from '$'; import ko from 'ko'; -import {aViewModels as VIEW_MODELS} from 'Common/Globals'; +import {VIEW_MODELS} from 'Common/Globals'; import {delegateRun, windowResize, log, isUnd, pString} from 'Common/Utils'; import {settings} from 'Common/Links'; diff --git a/gulpfile.js b/gulpfile.js index 016da8d09..61f9acc54 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -409,7 +409,6 @@ gulp.task('js:es5:min', ['js:app', 'js:admin'], function() { gulp.task('js:es6:min', ['js:app', 'js:admin'], function() { return cfg.next ? gulp.src(cfg.paths.staticJS + '*.next.js') .pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"')) - // TODO .pipe(eol('\n', true)) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest(cfg.paths.staticMinJS)) diff --git a/package.json b/package.json index 62402d153..7cbeaebba 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ }, "devDependencies": { "Progress.js": "github:usablica/progress.js", - "autolinker": "^1.1.0", - "babel-core": "^6.16.0", + "autolinker": "^1.2.0", + "babel-core": "^6.17.0", "babel-eslint": "^7.0.0", "babel-loader": "^6.2.5", "babel-plugin-transform-decorators-legacy": "^1.3.4", @@ -102,7 +102,7 @@ "moment": "^2.15.1", "node-fs": "^0.1.7", "node-notifier": "4.6.1", - "normalize.css": "^4.2.0", + "normalize.css": "^5.0.0", "openpgp": "^2.3.3", "opentip": "^2.4.3", "pikaday": "^1.4.0", @@ -114,7 +114,7 @@ "style-loader": "^0.13.1", "tinycon": "github:tommoor/tinycon", "underscore": "^1.8.3", - "webpack": "2.1.0-beta.22", + "webpack": "^2.1.0-beta.25", "webpack-notifier": "1.4.1" } } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 48e0a3f9f..2acff064d 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1954,7 +1954,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack $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'); $aResult['StaticEditorJsLink'] = $this->StaticPath('ckeditor/ckeditor.js'); $aResult['EditorDefaultType'] = \in_array($aResult['EditorDefaultType'], array('Plain', 'Html', 'HtmlForced', 'PlainForced')) ? diff --git a/webpack.config.builder.js b/webpack.config.builder.js index 00cc0b179..0df21f008 100644 --- a/webpack.config.builder.js +++ b/webpack.config.builder.js @@ -40,7 +40,7 @@ module.exports = function(publicPath, pro, es6) { ], resolve: { modules: [devPath, 'node_modules'], - extensions: ['', '.js'], + extensions: ['.js'], alias: { 'Opentip': __dirname + '/dev/External/Opentip.js', 'ko': __dirname + '/dev/External/ko.js' @@ -52,7 +52,7 @@ module.exports = function(publicPath, pro, es6) { test: /\.js$/, loader: 'babel', include: [devPath], - query: !es6 ? { + options: !es6 ? { cacheDirectory: true, presets: [['es2015', {loose: loose, modules: false}], 'es2016', 'stage-0'], plugins: ['transform-runtime', 'transform-decorators-legacy'] @@ -120,7 +120,6 @@ module.exports = function(publicPath, pro, es6) { } ] }, - eslint: {}, externals: { 'window': 'window', 'progressJs': 'window.progressJs',