From f257def4d11fd27f13fa24945d090870fafd54e4 Mon Sep 17 00:00:00 2001 From: Balazs Birtalan Date: Thu, 2 Nov 2023 19:18:06 +0000 Subject: [PATCH] Log Message write in the logs/{date}.log file, Now there are a lot of different state (alert, failed, warning, console, info etc.). It use byCode (RSD1000X etc.) which make easier. There is a console display window now when it starts and logging there as well. There is now the opportunity to choose the debug level, turn on or of the debug and event displays. Added an admin template into the admin --- .../js/xtr-translator/demo/index.html | 82 +++++++++++++++++ .../js/xtr-translator/demo/styles.css | 27 ++++++ .../js/xtr-translator/demo/styles.less | 23 +++++ .../js/xtr-translator/dictonary.js | 8 ++ .../js/xtr-translator/jquery.xtr.js | 88 +++++++++++++++++++ .../js/xtr-translator/jquery.xtr.min.js | 1 + 6 files changed, 229 insertions(+) create mode 100644 core/template_files/js/xtr-translator/demo/index.html create mode 100644 core/template_files/js/xtr-translator/demo/styles.css create mode 100644 core/template_files/js/xtr-translator/demo/styles.less create mode 100644 core/template_files/js/xtr-translator/dictonary.js create mode 100644 core/template_files/js/xtr-translator/jquery.xtr.js create mode 100644 core/template_files/js/xtr-translator/jquery.xtr.min.js diff --git a/core/template_files/js/xtr-translator/demo/index.html b/core/template_files/js/xtr-translator/demo/index.html new file mode 100644 index 0000000..db1e695 --- /dev/null +++ b/core/template_files/js/xtr-translator/demo/index.html @@ -0,0 +1,82 @@ + + + + + + + + +jQuery xtr.js plugin Demo + + + +
+
+ +
+
+
+
+
+
+

jQuery xtr.js plugin Demo

+
Welcome
+
Hello
+
Good Bye
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/core/template_files/js/xtr-translator/demo/styles.css b/core/template_files/js/xtr-translator/demo/styles.css new file mode 100644 index 0000000..a6ed151 --- /dev/null +++ b/core/template_files/js/xtr-translator/demo/styles.css @@ -0,0 +1,27 @@ + +#wrapper { + font: 16px/18px Calibri; + margin: 0 auto; + width: 200px; + text-align: center +} + +#wrapper div { + background: #28b7ff; + padding: 15px; + margin: 10px; + text-align: center +} + +label { + font-weight: 700; + margin: 25px 0 5px; + display: block +} + +select { + width: 100%; + height: 30px; + outline: 0; + cursor: pointer +} diff --git a/core/template_files/js/xtr-translator/demo/styles.less b/core/template_files/js/xtr-translator/demo/styles.less new file mode 100644 index 0000000..a26f8be --- /dev/null +++ b/core/template_files/js/xtr-translator/demo/styles.less @@ -0,0 +1,23 @@ +#wrapper { + font: 16px / 18px Calibri; + margin: 0 auto; + width: 200px; + text-align: center; + div { + background: #28b7ff; + padding: 15px; + margin: 10px; + text-align: center; + } +} +label { + font-weight: bold; + margin: 25px 0 5px; + display: block; +} +select { + width: 100%; + height: 30px; + outline: none; + cursor: pointer; +} \ No newline at end of file diff --git a/core/template_files/js/xtr-translator/dictonary.js b/core/template_files/js/xtr-translator/dictonary.js new file mode 100644 index 0000000..ff3df08 --- /dev/null +++ b/core/template_files/js/xtr-translator/dictonary.js @@ -0,0 +1,8 @@ +var data = { + "close": { + en: "close", + hu: "Bezar", + it: "Vicino" + }, + +}; diff --git a/core/template_files/js/xtr-translator/jquery.xtr.js b/core/template_files/js/xtr-translator/jquery.xtr.js new file mode 100644 index 0000000..90458ba --- /dev/null +++ b/core/template_files/js/xtr-translator/jquery.xtr.js @@ -0,0 +1,88 @@ +/*! + * July 2017 + * xtr 1.0.0 + * @author Mario Vidov + * @url http://vidov.it + * @twitter MarioVidov + * MIT license +*/ + +(function($) { + var pluginName = 'xtr'; + + var settings = { + default: 'en', + lang: 'en', + regExp: { + '': /\s/g, + '_': /[&<>"'`\/=]/g + } + }; + + var config = { + defaultClass: 'data-xtr-default', + langClass: 'data-xtr-lang', + langKey : 'data-xtr-key', + langOrig : 'data-xtr-original' + }; + + function Plugin(element, options) { + options = options || {}; + this.$element = $(element); + this.options = $.extend(true, {}, settings, options); + this.selector = '[xtr]'; + this.regExp = this.options.regExp; + this.default = this.options.default; + this.t = this.options.t; + this.l = this.options.lang; + + this.$element.attr(config.langClass, this.l) + .attr(config.defaultClass, this.default); + this.init(); + } + + Plugin.prototype.lang = function(l) { + if (l && l === 'reset') { + this.l = this.default; + } else if (l) { + this.l = l; + } + this.init(); + }; + + Plugin.prototype.set = function(index) { + var $el = $('[' + config.langKey + '="' + index + '"]'); + var original = $el && $el.attr(config.langOrig) || index; + return (this.t && this.t[index] && this.t[index][this.l]) ? this.t[index][this.l] : original; + }; + + Plugin.prototype.init = function() { + var self = this; + this.$element.attr(config.langClass, this.l); + $(self.selector).add('[' + config.langKey + ']').each(function () { + var $this = $(this); + var key = $this.attr(config.langKey); + var original = $this.attr(config.langOrig); + var text = $this.text(); + if (!key) { + key = text; + for (var i in self.regExp) { + key = key.replace(self.regExp[i], i); + } + $this.attr(config.langKey, key); + } + if (!original) { + $this.attr(config.langOrig, text); + } + $this.html(self.set(key)); + }); + }; + + $.fn[pluginName] = function (options) { + return this.each(function () { + if (!$.data(this, 'plugin_' + pluginName)) { + $.data(this, 'plugin_' + pluginName, new Plugin(this, options)); + } + }); + }; +})(jQuery); diff --git a/core/template_files/js/xtr-translator/jquery.xtr.min.js b/core/template_files/js/xtr-translator/jquery.xtr.min.js new file mode 100644 index 0000000..9a8431b --- /dev/null +++ b/core/template_files/js/xtr-translator/jquery.xtr.min.js @@ -0,0 +1 @@ +(function(t){var i="xtr";var a={"default":"en",lang:"en",regExp:{"":/\s/g,_:/[&<>"'`\/=]/g}};var e={defaultClass:"data-xtr-default",langClass:"data-xtr-lang",langKey:"data-xtr-key",langOrig:"data-xtr-original"};function s(i,s){s=s||{};this.$element=t(i);this.options=t.extend(true,{},a,s);this.selector="[xtr]";this.regExp=this.options.regExp;this.default=this.options.default;this.t=this.options.t;this.l=this.options.lang;this.$element.attr(e.langClass,this.l).attr(e.defaultClass,this.default);this.init()}s.prototype.lang=function(t){if(t&&t==="reset"){this.l=this.default}else if(t){this.l=t}this.init()};s.prototype.set=function(i){var a=t("["+e.langKey+'="'+i+'"]');var s=a&&a.attr(e.langOrig)||i;return this.t&&this.t[i]&&this.t[i][this.l]?this.t[i][this.l]:s};s.prototype.init=function(){var i=this;this.$element.attr(e.langClass,this.l);t(i.selector).add("["+e.langKey+"]").each(function(){var a=t(this);var s=a.attr(e.langKey);var n=a.attr(e.langOrig);var r=a.text();if(!s){s=r;for(var l in i.regExp){s=s.replace(i.regExp[l],l)}a.attr(e.langKey,s)}if(!n){a.attr(e.langOrig,r)}a.html(i.set(s))})};t.fn[i]=function(a){return this.each(function(){if(!t.data(this,"plugin_"+i)){t.data(this,"plugin_"+i,new s(this,a))}})}})(jQuery); \ No newline at end of file