Skip to content

Commit

Permalink
### 4.6.14 (2020-05-19)
Browse files Browse the repository at this point in the history
* (bluefox) IDs with dot are not allowed any more
* (bluefox) "schedule" name is not allowed for CRON
* (bluefox) Convert strings to Date by formatDate
  • Loading branch information
GermanBluefox committed May 19, 2020
1 parent 092c923 commit 5e35a46
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 45 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ And then call "npm run build".
- ...

## Changelog
### 4.6.14 (2020-05-19)
* (bluefox) IDs with dot are not allowed any more
* (bluefox) "schedule" name is not allowed for CRON
* (bluefox) Convert strings to Date by formatDate

### 4.6.13 (2020-05-19)
* (bluefox) Fixed blockly blocks because of deprecated functions
* (bluefox) Corrected schedule wizard
* (bluefox) Corrected schedule wizard
* (AlCazone) Update monaco editor

### 4.6.4 (2020-05-15)
* (bluefox) Corrected block: request, exec
Expand Down
10 changes: 5 additions & 5 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"files": {
"main.css": "/static/css/main.ec63fb86.chunk.css",
"main.js": "/static/js/main.3fbbcb42.chunk.js",
"main.js.map": "/static/js/main.3fbbcb42.chunk.js.map",
"main.js": "/static/js/main.05429a24.chunk.js",
"main.js.map": "/static/js/main.05429a24.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.a500de04.js",
"runtime-main.js.map": "/static/js/runtime-main.a500de04.js.map",
"static/css/2.93e5c0a0.chunk.css": "/static/css/2.93e5c0a0.chunk.css",
"static/js/2.38f4fe4b.chunk.js": "/static/js/2.38f4fe4b.chunk.js",
"static/js/2.38f4fe4b.chunk.js.map": "/static/js/2.38f4fe4b.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.a6a00a007a677c1af992af2a8e446a2e.js": "/precache-manifest.a6a00a007a677c1af992af2a8e446a2e.js",
"precache-manifest.6e4a5f684da66cec91f6502115d3ea88.js": "/precache-manifest.6e4a5f684da66cec91f6502115d3ea88.js",
"service-worker.js": "/service-worker.js",
"static/css/2.93e5c0a0.chunk.css.map": "/static/css/2.93e5c0a0.chunk.css.map",
"static/css/main.ec63fb86.chunk.css.map": "/static/css/main.ec63fb86.chunk.css.map",
"static/js/2.38f4fe4b.chunk.js.LICENSE.txt": "/static/js/2.38f4fe4b.chunk.js.LICENSE.txt",
"static/js/main.3fbbcb42.chunk.js.LICENSE.txt": "/static/js/main.3fbbcb42.chunk.js.LICENSE.txt",
"static/js/main.05429a24.chunk.js.LICENSE.txt": "/static/js/main.05429a24.chunk.js.LICENSE.txt",
"static/media/copy-content.svg": "/static/media/copy-content.6fe0b363.svg"
},
"entrypoints": [
"static/js/runtime-main.a500de04.js",
"static/css/2.93e5c0a0.chunk.css",
"static/js/2.38f4fe4b.chunk.js",
"static/css/main.ec63fb86.chunk.css",
"static/js/main.3fbbcb42.chunk.js"
"static/js/main.05429a24.chunk.js"
]
}
8 changes: 6 additions & 2 deletions admin/google-blockly/own/blocks_trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ Blockly.Trigger.findLegalName = function(name, block) {
// Collision with another procedure.
var r = name.match(/^(.*?)(\d+)$/);
if (!r) {
name += '2';
name += '1';
} else {
name = r[1] + (parseInt(r[2], 10) + 1);
}
Expand All @@ -591,6 +591,10 @@ Blockly.Trigger.findLegalName = function(name, block) {
* @private
*/
Blockly.Trigger.isLegalName_ = function(name, workspace, opt_exclude) {
if (name === 'schedule') {
return false;
}

var blocks = workspace.getAllBlocks();
// Iterate through every block and check the name.
for (var i = 0; i < blocks.length; i++) {
Expand Down Expand Up @@ -673,7 +677,7 @@ Blockly.Trigger.getAllSchedules = function (workspace) {
}
}

// BF(2020.05.16) : for back compatibility. Remove it after 5 years
// BF(2020.05.16): for back compatibility. Remove it after 5 years
if (window.scripts.loading) {
var variables = workspace.getVariablesOfType('');
variables.forEach(v => !result.find(it => it[0] === v.name) && result.push([v.name, v.name]));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "5e6a0c6149cca62663b39af8ea7786b4",
"revision": "4e937f5f5188cb73fb034989b4c27fd9",
"url": "/index.html"
},
{
"revision": "8d569d128bda24afefd5",
"url": "/static/css/2.93e5c0a0.chunk.css"
},
{
"revision": "23de946e83f0a313d1c6",
"revision": "4b64650e7e451ac1b3c2",
"url": "/static/css/main.ec63fb86.chunk.css"
},
{
Expand All @@ -20,12 +20,12 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/2.38f4fe4b.chunk.js.LICENSE.txt"
},
{
"revision": "23de946e83f0a313d1c6",
"url": "/static/js/main.3fbbcb42.chunk.js"
"revision": "4b64650e7e451ac1b3c2",
"url": "/static/js/main.05429a24.chunk.js"
},
{
"revision": "578fa69920ac4a551e6d340a37256bed",
"url": "/static/js/main.3fbbcb42.chunk.js.LICENSE.txt"
"url": "/static/js/main.05429a24.chunk.js.LICENSE.txt"
},
{
"revision": "b29e1786341933b579da",
Expand Down
2 changes: 1 addition & 1 deletion admin/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/precache-manifest.a6a00a007a677c1af992af2a8e446a2e.js"
"/precache-manifest.6e4a5f684da66cec91f6502115d3ea88.js"
);

self.addEventListener('message', (event) => {
Expand Down
3 changes: 3 additions & 0 deletions admin/static/js/main.05429a24.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/main.05429a24.chunk.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions admin/static/js/main.3fbbcb42.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion admin/static/js/main.3fbbcb42.chunk.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion admin/tab.html

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"name": "javascript",
"version": "4.6.13",
"version": "4.6.14",
"title": "Script Engine",
"titleLang": {
"en": "Script Engine",
Expand All @@ -22,6 +22,18 @@
"AlCalzone"
],
"news": {
"4.6.14": {
"en": "IDs with dot are not allowed any more\n\"schedule\" name is not allowed for CRON\nConvert strings to Date by formatDate",
"de": "IDs mit Punkt sind nicht mehr erlaubt\nDer Name \"Zeitplan\" ist für CRON nicht zulässig\nKonvertieren Sie Zeichenfolgen nach FormatDate in Datum",
"ru": "Идентификаторы с точкой больше не разрешены\nимя \"расписание\" не допускается для CRON\nПреобразовать строки в дату по formatDate",
"pt": "IDs com ponto não são mais permitidos\no nome \"horário\" não é permitido para CRON\nConverta seqüências de caracteres para Data por formatoData",
"nl": "ID's met punt zijn niet meer toegestaan\n\"planning\" naam is niet toegestaan voor CRON\nConverteer strings naar datum door formatDate",
"fr": "Les identifiants avec un point ne sont plus autorisés\nle nom \"horaire\" n'est pas autorisé pour CRON\nConvertir des chaînes en Date par formatDate",
"it": "Gli ID con punto non sono più consentiti\nIl nome \"programma\" non è consentito per CRON\nConverti le stringhe in Date per formatDate",
"es": "Las identificaciones con punto ya no están permitidas\nel nombre \"horario\" no está permitido para CRON\nConvertir cadenas a Fecha por formato Fecha",
"pl": "Identyfikatory z kropką nie są już dozwolone\nNazwa „harmonogram” nie jest dozwolona w przypadku CRON\nKonwertuj ciągi na datę według formatDate",
"zh-cn": "带点号的ID不再被允许\nCRON不允许使用“时间表”名称\n通过formatDate将字符串转换为Date"
},
"4.6.13": {
"en": "Fixed blockly blocks because of deprecated functions",
"de": "Blockierte Blöcke wegen veralteter Funktionen behoben",
Expand Down
2 changes: 1 addition & 1 deletion lib/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,7 @@ function sandBox(script, name, verbose, debug, context) {
language = 'de';
}
}
if (typeof date == 'number') {
if (typeof date === 'number' || typeof date === 'string') {
date = new Date(date);
} else if (!(date instanceof Date)) {
sandbox.log('Invalid date object provided: ' + JSON.stringify(date), 'error');
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.javascript",
"version": "4.6.13",
"version": "4.6.14",
"description": "Javascript/Coffescript Script Engine for ioBroker",
"author": "bluefox <[email protected]>",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js",
"version": "4.6.11",
"version": "4.6.13",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.14",
Expand Down
6 changes: 5 additions & 1 deletion src/public/google-blockly/own/blocks_trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ Blockly.Trigger.findLegalName = function(name, block) {
// Collision with another procedure.
var r = name.match(/^(.*?)(\d+)$/);
if (!r) {
name += '2';
name += '1';
} else {
name = r[1] + (parseInt(r[2], 10) + 1);
}
Expand All @@ -591,6 +591,10 @@ Blockly.Trigger.findLegalName = function(name, block) {
* @private
*/
Blockly.Trigger.isLegalName_ = function(name, workspace, opt_exclude) {
if (name === 'schedule') {
return false;
}

var blocks = workspace.getAllBlocks();
// Iterate through every block and check the name.
for (var i = 0; i < blocks.length; i++) {
Expand Down
27 changes: 13 additions & 14 deletions src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,24 +323,23 @@ class App extends Component {
onExpertModeChange(expertMode) {
if (this.state.expertMode !== expertMode) {
window.localStorage && window.localStorage.setItem('App.expertMode', expertMode ? 'true' : 'false');
this.setState({expertMode});
this.setState({ expertMode });
}
}

showError(err) {
this.setState({errorText: err});
this.setState({ errorText: err });
}

showMessage(message) {
this.setState({message});
this.setState({ message });
}

onDelete(id) {
this.socket.delObject(id)
.then(() => {})
.catch(err => {
this.showError(err);
});
.catch(err =>
this.showError(err));
}

onEdit(id) {
Expand All @@ -364,12 +363,12 @@ class App extends Component {
expert: true
},
type: 'channel'
}).then(() => {
setTimeout(() => this.setState({menuSelectId: id}, () =>
setTimeout(() => this.setState({menuSelectId: ''})), 300), 1000);
}).catch(err => {
this.showError(err);
});
})
.then(() =>
setTimeout(() => this.setState({menuSelectId: id}, () =>
setTimeout(() => this.setState({menuSelectId: ''})), 300), 1000))
.catch(err =>
this.showError(err));
} else {
this.socket.setObject(id, {
common: {
Expand Down Expand Up @@ -627,8 +626,8 @@ class App extends Component {
}}
runningInstances={this.state.runningInstances}
onExpertModeChange={this.onExpertModeChange.bind(this)}
onDelete={this.onDelete.bind(this)}
onAddNew={this.onAddNew.bind(this)}
onDelete={this.onDelete.bind(this) }
onAddNew={ this.onAddNew.bind(this) }
onEnableDisable={this.onEnableDisable.bind(this)}
onExport={this.onExport.bind(this)}
width={this.menuSize}
Expand Down
2 changes: 1 addition & 1 deletion src/src/Dialogs/New.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DialogNew extends React.Component {

getId(name) {
name = name || this.state.name || '';
name = name.replace(/[\\/\][*,;'"`<>?\s]/g, '_');
name = name.replace(/[\\/\][.*,;'"`<>?\s]/g, '_');
return (this.state ? this.state.parent : this.props.parent) + '.' + name;
}

Expand Down
10 changes: 5 additions & 5 deletions src/src/SideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ class SideDrawer extends React.Component {
}

// eslint-disable-next-line
while (this.state.listItems.find(it => it.id === this.parent + '.' + word.replace(/\s/g, '_') + i)) {
while (this.state.listItems.find(it => it.id === this.parent + '.' + word.replace(/\.\s/g, '_') + i)) {
i++;
}
/*ignore jslint end*/
Expand Down Expand Up @@ -1392,9 +1392,9 @@ class SideDrawer extends React.Component {
key="dialog-new-script"
onClose={() => this.setState({creatingScript: false})}
title={I18n.t('Create new script')}
name={this.getUniqueName()}
parents={this.getFolders()}
folder={false}
name={ this.getUniqueName() }
parents={ this.getFolders() }
folder={ false }
existingItems={this.state.listItems.map(item => item.id)}
instance={this.props.instances[0] || 0}
instances={this.props.instances}
Expand All @@ -1408,7 +1408,7 @@ class SideDrawer extends React.Component {
key="dialog-copy-script"
onClose={() => this.setState({copingScript: ''})}
title={I18n.t('Copy script')}
name={this.getUniqueName(this.state.copingScript)}
name={ this.getUniqueName(this.state.copingScript) }
parents={this.getFolders()}
folder={false}
instance={parseInt((copingItem && copingItem.common && copingItem.common.engine && copingItem.common.engine.split('.').pop()) || 0, 10)}
Expand Down

0 comments on commit 5e35a46

Please sign in to comment.