@markus.hardardt/js_hmi 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.gitattributes +2 -0
  2. package/.vscode/launch.json +17 -0
  3. package/README.md +2 -0
  4. package/config/db_access.json +8 -0
  5. package/config/db_config.json +44 -0
  6. package/config/icons/export.gif +0 -0
  7. package/config/icons/folder.gif +0 -0
  8. package/config/icons/htm.gif +0 -0
  9. package/config/icons/jso.gif +0 -0
  10. package/config/icons/lab.gif +0 -0
  11. package/config/icons/refresh.gif +0 -0
  12. package/config/icons/txt.gif +0 -0
  13. package/config/js_hmi_config_create.sql +91 -0
  14. package/config.json +19 -0
  15. package/ext/jquery/ajaxblob.js +80 -0
  16. package/ext/jquery/dataTables.pageResize.min.js +8 -0
  17. package/ext/jquery/dataTables.scrollResize.min.js +8 -0
  18. package/ext/jquery/jquery.layout-latest.js +5126 -0
  19. package/ext/jquery/jquery.transform2d.js +551 -0
  20. package/ext/jquery/jquery.ui.touch-punch.js +160 -0
  21. package/ext/jquery/layout-default-latest.css +228 -0
  22. package/images/arrows/arrow-down.png +0 -0
  23. package/images/arrows/arrow-left-right.png +0 -0
  24. package/images/arrows/arrow-left.png +0 -0
  25. package/images/arrows/arrow-right.png +0 -0
  26. package/images/arrows/arrow-up-down.png +0 -0
  27. package/images/arrows/arrow-up.png +0 -0
  28. package/images/favicon.ico +0 -0
  29. package/images/question/question-balloon.png +0 -0
  30. package/images/question/question-button.png +0 -0
  31. package/images/question/question-frame.png +0 -0
  32. package/images/question/question.png +0 -0
  33. package/main.js +307 -0
  34. package/package.json +21 -0
  35. package/src/BrowserMain.js +132 -0
  36. package/ui/arrow-down.png +0 -0
  37. package/ui/arrow-left-right.png +0 -0
  38. package/ui/arrow-left.png +0 -0
  39. package/ui/arrow-right.png +0 -0
  40. package/ui/arrow-up-down.png +0 -0
  41. package/ui/arrow-up.png +0 -0
  42. package/ui/hmi_styles.css +333 -0
  43. package/ui/scrollbar-desktop.css +117 -0
  44. package/ui/scrollbar-touch.css +117 -0
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,17 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "node",
9
+ "request": "launch",
10
+ "name": "Launch Program",
11
+ "skipFiles": [
12
+ "<node_internals>/**"
13
+ ],
14
+ "program": "${workspaceFolder}\\main.js"
15
+ }
16
+ ]
17
+ }
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # js_hmi
2
+
@@ -0,0 +1,8 @@
1
+ {
2
+ "host": "localhost",
3
+ "user": "js_hmi_config",
4
+ "password": "js_hmi_config",
5
+ "database": "js_hmi_config",
6
+ "port": 3306,
7
+ "_socketPath": "The path to a unix domain socket to connect to. When used host and port are ignored."
8
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "icon_dir": "./config/icons",
3
+ "folder_icon": "folder.gif",
4
+ "max_parallel_queries" : 8,
5
+ "languages" : [
6
+ "de",
7
+ "en",
8
+ "es",
9
+ "fr",
10
+ "it"
11
+ ],
12
+ "tables": [
13
+ {
14
+ "name": "jso",
15
+ "extension": "j",
16
+ "key_column": "key",
17
+ "JsonFX": true,
18
+ "value_column": "value",
19
+ "icon": "jso.gif"
20
+ },
21
+ {
22
+ "name": "txt",
23
+ "extension": "t",
24
+ "key_column": "key",
25
+ "value_column": "value",
26
+ "icon": "txt.gif"
27
+ },
28
+ {
29
+ "name": "lab",
30
+ "extension": "l",
31
+ "key_column": "key",
32
+ "value_column_prefix": "value_",
33
+ "multiedit": true,
34
+ "icon": "lab.gif"
35
+ },
36
+ {
37
+ "name": "htm",
38
+ "extension": "h",
39
+ "key_column": "key",
40
+ "value_column_prefix": "value_",
41
+ "icon": "htm.gif"
42
+ }
43
+ ]
44
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,91 @@
1
+ -- --------------------------------------------------------
2
+ -- Host: 127.0.0.1
3
+ -- Server-Version: 11.6.2-MariaDB - mariadb.org binary distribution
4
+ -- Server-Betriebssystem: Win64
5
+ -- HeidiSQL Version: 12.8.0.6908
6
+ -- --------------------------------------------------------
7
+
8
+ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9
+ /*!40101 SET NAMES utf8 */;
10
+ /*!50503 SET NAMES utf8mb4 */;
11
+ /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12
+ /*!40103 SET TIME_ZONE='+00:00' */;
13
+ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
14
+ /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
15
+ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
16
+
17
+
18
+ -- Exportiere Datenbank-Struktur für js_hmi_config
19
+ CREATE DATABASE IF NOT EXISTS `js_hmi_config` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
20
+ USE `js_hmi_config`;
21
+
22
+ -- Exportiere Struktur von Tabelle js_hmi_config.exe
23
+ CREATE TABLE IF NOT EXISTS `exe` (
24
+ `key` varchar(384) NOT NULL,
25
+ `autostart` bit(1) NOT NULL DEFAULT b'0',
26
+ `description` text DEFAULT NULL,
27
+ UNIQUE KEY `key` (`key`)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
29
+
30
+ -- Daten-Export vom Benutzer nicht ausgewählt
31
+
32
+ -- Exportiere Struktur von Tabelle js_hmi_config.hmi
33
+ CREATE TABLE IF NOT EXISTS `hmi` (
34
+ `key` varchar(384) NOT NULL,
35
+ `url` tinytext NOT NULL,
36
+ `enable` bit(1) NOT NULL DEFAULT b'0',
37
+ `description` text DEFAULT NULL,
38
+ UNIQUE KEY `key` (`key`)
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
40
+
41
+ -- Daten-Export vom Benutzer nicht ausgewählt
42
+
43
+ -- Exportiere Struktur von Tabelle js_hmi_config.htm
44
+ CREATE TABLE IF NOT EXISTS `htm` (
45
+ `key` varchar(384) NOT NULL,
46
+ `value_de` mediumtext DEFAULT NULL,
47
+ `value_en` mediumtext DEFAULT NULL,
48
+ `value_es` mediumtext DEFAULT NULL,
49
+ `value_fr` mediumtext DEFAULT NULL,
50
+ `value_it` mediumtext DEFAULT NULL,
51
+ UNIQUE KEY `key` (`key`)
52
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
53
+
54
+ -- Daten-Export vom Benutzer nicht ausgewählt
55
+
56
+ -- Exportiere Struktur von Tabelle js_hmi_config.jso
57
+ CREATE TABLE IF NOT EXISTS `jso` (
58
+ `key` varchar(384) NOT NULL,
59
+ `value` mediumtext NOT NULL,
60
+ UNIQUE KEY `key` (`key`)
61
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
62
+
63
+ -- Daten-Export vom Benutzer nicht ausgewählt
64
+
65
+ -- Exportiere Struktur von Tabelle js_hmi_config.lab
66
+ CREATE TABLE IF NOT EXISTS `lab` (
67
+ `key` varchar(384) NOT NULL,
68
+ `value_de` tinytext DEFAULT NULL,
69
+ `value_en` tinytext DEFAULT NULL,
70
+ `value_es` tinytext DEFAULT NULL,
71
+ `value_fr` tinytext DEFAULT NULL,
72
+ `value_it` tinytext DEFAULT NULL,
73
+ UNIQUE KEY `key` (`key`)
74
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
75
+
76
+ -- Daten-Export vom Benutzer nicht ausgewählt
77
+
78
+ -- Exportiere Struktur von Tabelle js_hmi_config.txt
79
+ CREATE TABLE IF NOT EXISTS `txt` (
80
+ `key` varchar(384) NOT NULL,
81
+ `value` mediumtext NOT NULL,
82
+ UNIQUE KEY `key` (`key`)
83
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;
84
+
85
+ -- Daten-Export vom Benutzer nicht ausgewählt
86
+
87
+ /*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
88
+ /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
89
+ /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
90
+ /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
91
+ /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
package/config.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "staticClientFiles": [],
3
+ "webServerPort": 8080,
4
+ "webSocketPort": 8081,
5
+ "autoConnect": true,
6
+ "serverCycleMillis": 250,
7
+ "clientRequestAnimationFrameCycle": 3,
8
+ "_secureKeyFile": "./cert/cert.key",
9
+ "_secureCertFile": "./cert/cert.cert",
10
+ "closedConnectionDisposeTimeout": 6000,
11
+ "subscribeDelay": 200,
12
+ "unsubscribeDelay": 5000,
13
+ "sendDelay": 200,
14
+ "jsonfx_pretty": true,
15
+ "touch": false,
16
+ "scrollbar_config": "./ui/scrollbar-desktop.css",
17
+ "scrollbar_hmi": "./ui/scrollbar-touch.css",
18
+ "simulationCycleMillis": 500
19
+ }
@@ -0,0 +1,80 @@
1
+ // taken from: https://artandlogic.com/2013/11/jquery-ajax-blobs-and-array-buffers/
2
+ (function($) {
3
+ /**
4
+ * Register ajax transports for blob send/recieve and array buffer
5
+ * send/receive via XMLHttpRequest Level 2 within the comfortable framework of
6
+ * the jquery ajax request, with full support for promises.
7
+ *
8
+ * Notice the +* in the dataType string? The + indicates we want this
9
+ * transport to be prepended to the list of potential transports (so it gets
10
+ * first dibs if the request passes the conditions within to provide the ajax
11
+ * transport, preventing the standard transport from hogging the request), and
12
+ * the * indicates that potentially any request with any dataType might want
13
+ * to use the transports provided herein.
14
+ *
15
+ * Remember to specify 'processData:false' in the ajax options when attempting
16
+ * to send a blob or arraybuffer - otherwise jquery will try (and fail) to
17
+ * convert the blob or buffer into a query string.
18
+ *
19
+ * This revision now includes sending headers, resolves the stack overflow in
20
+ * abort(), and sets the status text into the response if the request is
21
+ * unsuccessful.
22
+ */
23
+ $.ajaxTransport("+*", function(options, originalOptions, jqXHR) {
24
+ // Test for the conditions that mean we can/want to send/receive blobs or
25
+ // arraybuffers - we need XMLHttpRequest
26
+ // level 2 (so feature-detect against window.FormData), feature detect
27
+ // against window.Blob or window.ArrayBuffer,
28
+ // and then check to see if the dataType is blob/arraybuffer or the data
29
+ // itself is a Blob/ArrayBuffer
30
+ if (window.FormData && ((options.dataType && (options.dataType == 'blob' || options.dataType == 'arraybuffer')) || (options.data && ((window.Blob && options.data instanceof Blob) || (window.ArrayBuffer && options.data instanceof ArrayBuffer))))) {
31
+ var xhr;
32
+
33
+ return {
34
+ /**
35
+ * Return a transport capable of sending and/or receiving blobs - in
36
+ * this case, we instantiate a new XMLHttpRequest and use it to
37
+ * actually perform the request, and funnel the result back into the
38
+ * jquery complete callback (such as the success function, done
39
+ * blocks, etc.)
40
+ *
41
+ * @param headers
42
+ * @param completeCallback
43
+ */
44
+ send : function(headers, completeCallback) {
45
+ var url = options.url || window.location.href, type = options.type || 'GET', dataType = options.dataType || 'text', data = options.data || null, async = options.async || true;
46
+
47
+ xhr = new XMLHttpRequest();
48
+ xhr.addEventListener('load', function() {
49
+ var res = {}, success = xhr.status >= 200 && xhr.status < 300 || xhr.status === 304;
50
+
51
+ if (success) {
52
+ res[dataType] = xhr.response;
53
+ }
54
+ else {
55
+ res.text = xhr.statusText;
56
+ }
57
+
58
+ completeCallback(xhr.status, xhr.statusText, res, xhr.getAllResponseHeaders());
59
+ });
60
+
61
+ xhr.open(type, url, async);
62
+ xhr.responseType = dataType;
63
+
64
+ for ( var key in headers) {
65
+ if (headers.hasOwnProperty(key)) {
66
+ xhr.setRequestHeader(key, headers[key]);
67
+ }
68
+ }
69
+
70
+ xhr.send(data);
71
+ },
72
+ abort : function() {
73
+ if (xhr) {
74
+ xhr.abort();
75
+ }
76
+ }
77
+ };
78
+ }
79
+ });
80
+ })(jQuery);
@@ -0,0 +1,8 @@
1
+ /*!
2
+ PageResize for DataTables v1.0.0
3
+ 2015 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return b(e,window,document)}):"object"===typeof exports?module.exports=function(e,c){e||(e=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(e,c).$;return b(c,e,e.document)}:b(jQuery,window,document)})(function(b,e,c){var g=function(a,h){var d=a.table();this.s={dt:a,host:b(d.container()).parent(),header:b(d.header()),footer:b(d.footer()),body:b(d.body()),container:b(d.container()),table:b(d.node()),
6
+ delta:h};d=this.s.host;"static"===d.css("position")&&d.css("position","relative");this._attach();this._size()};g.prototype={_size:function(){var a=this.s,h=a.dt,d=h.table(),e=b(a.table).offset().top,c=b("tr",a.body),c=c.eq(1<c.length?1:0).height(),f=a.host.height(),g=d.header().parentNode!==d.body().parentNode,i=a.delta;g||(d.header()&&(f-=a.header.height()),d.footer()&&(f-=a.footer.height()));f=f-e-(a.container.height()-(e+a.table.height()));!isNaN(parseFloat(i))&&isFinite(i)&&(f-=i);a=Math.floor(f/
7
+ c);Infinity!==a&&(-Infinity!==a&&!isNaN(a)&&0<a&&a!==h.page.len())&&h.page.len(a).draw()},_attach:function(){var a=this,c=b("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");c[0].onload=function(){var d=this.contentDocument.body,b=d.offsetHeight;this.contentDocument.defaultView.onresize=function(){var c=d.clientHeight||d.offsetHeight;c!==b&&(b=c,a._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};b.fn.dataTable.PageResize=
8
+ g;b.fn.DataTable.PageResize=g;b(c).on("init.dt",function(a,c){if("dt"===a.namespace){var d=new b.fn.dataTable.Api(c);(b(d.table().node()).hasClass("pageResize")||c.oInit.pageResize||b.fn.dataTable.defaults.pageResize)&&new g(d,c.oInit.pageResizeManualDelta)}})});
@@ -0,0 +1,8 @@
1
+ /*!
2
+ ScrollResize for DataTables v1.0.0
3
+ 2015 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(b,c).$;return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c){var g=function(e){var f=this,d=e.table();this.s={dt:e,host:a(d.container()).parent(),header:a(d.header()),footer:a(d.footer()),body:a(d.body()),container:a(d.container()),table:a(d.node())};
6
+ d=this.s.host;"static"===d.css("position")&&d.css("position","relative");e.on("draw",function(){f._size()});this._attach();this._size()};g.prototype={_size:function(){var e=this.s,f=e.dt,d=f.table(),b=a(e.table).offset().top,h=e.host.height(),c=a("div.dataTables_scrollBody",d.container()),h=h-b-(e.container.height()-(b+c.height()));a("div.dataTables_scrollBody",d.container()).css({maxHeight:h,height:h});f.fixedColumns&&f.fixedColumns().relayout()},_attach:function(){var e=this,b=a("<iframe/>").css({position:"absolute",
7
+ top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");b[0].onload=function(){var a=this.contentDocument.body,b=a.offsetHeight,c=this.contentDocument;(c.defaultView||c.parentWindow).onresize=function(){var f=a.clientHeight||a.offsetHeight,g=c.documentElement.clientHeight;!f&&g&&(f=g);f!==b&&(b=f,e._size())}};b.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=g;a.fn.DataTable.ScrollResize=g;a(c).on("init.dt",function(b,
8
+ c){if("dt"===b.namespace){var d=new a.fn.dataTable.Api(c);(c.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new g(d)}})});