diff --git a/bower.json b/bower.json index 4e10c8b..9feb366 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "strolch-wc-plc", "description": "Strolch PLC WebComponents", - "version": "0.1.0", + "version": "0.2.0", "authors": ["Robert von Burg"], "keywords": [ "strolch", diff --git a/locales.json b/locales.json index 563f130..0610b1e 100644 --- a/locales.json +++ b/locales.json @@ -30,9 +30,15 @@ "stop": "Stoppen", "reconfigure": "Neu Konfigurieren", "info": "Info", - "reconnect": "Wiederhestellen" + "reconnect": "Wiederhestellen", + "lastUpdate": "Letzte Aktualisierung", + "confirmActionWarning": "Aktionswarnung", + "confirmActionWarningMsg": "Beim Auslösen von Befehlen können Aktoren eingeschaltet werden. Wollen Sie diese Aktion wirklich ausführen?" }, "en": { + "confirmActionWarning": "Action Warning", + "confirmActionWarningMsg": "Sending commands can turn on actuators. Do you really want to execute this action?", + "lastUpdate": "Last Update", "info": "Info", "start": "Start", "stop": "Stop", diff --git a/strolch-wc-plc-behavior.html b/strolch-wc-plc-behavior.html index 750e85c..ae2f435 100644 --- a/strolch-wc-plc-behavior.html +++ b/strolch-wc-plc-behavior.html @@ -7,6 +7,10 @@ localesPath: { type: String, value: './locales.json' + }, + warningConfirmed: { + type: Boolean, + value: false } }, @@ -77,7 +81,29 @@ onRequestError: function (e) { this.fire("strolch-ajax-request-error", e.detail); - } + }, + confirmActionWarning: function (callback) { + var bound = callback.bind(this); + + if (this.warningConfirmed) { + bound(); + return; + } + + var confirmedCallback = function (confirmed) { + if (confirmed) { + this.warningConfirmed = true; + bound(); + } + }.bind(this); + + this.fire("cx-show-confirmation", { + title: this.localize('confirmActionWarning'), + text: this.localize('confirmActionWarningMsg'), + callback: confirmedCallback, + bind: this + }); + } } \ No newline at end of file diff --git a/strolch-wc-plc-connections.html b/strolch-wc-plc-connections.html index 3d26bd2..9b6835a 100644 --- a/strolch-wc-plc-connections.html +++ b/strolch-wc-plc-connections.html @@ -28,7 +28,7 @@ @@ -111,7 +111,7 @@ diff --git a/strolch-wc-plc-logical-device.html b/strolch-wc-plc-logical-device.html index b75a0d5..95e3af6 100644 --- a/strolch-wc-plc-logical-device.html +++ b/strolch-wc-plc-logical-device.html @@ -33,7 +33,7 @@ -

[[device.name]]

+

[[device.description]]

@@ -42,8 +42,10 @@