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
parent
ce145b8203
commit
f257def4d1
|
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
|
||||
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
|
||||
<title>jQuery xtr.js plugin Demo</title>
|
||||
<style>
|
||||
body { font-family:'Roboto'; background-color:#333; color:#fafafa;}
|
||||
#wrapper {
|
||||
margin: 150px auto;
|
||||
width: 400px;
|
||||
text-align: center
|
||||
}
|
||||
#wrapper div {
|
||||
color:#fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jquery-script-menu">
|
||||
<div class="jquery-script-center">
|
||||
<ul>
|
||||
<li><a href="http://www.jqueryscript.net/text/jQuery-Client-side-Translation-xtr/">Download This Plugin</a></li>
|
||||
<li><a href="http://www.jqueryscript.net/">Back To jQueryScript.Net</a></li>
|
||||
</ul>
|
||||
<div class="jquery-script-ads"><script type="text/javascript"><!--
|
||||
google_ad_client = "ca-pub-2783044520727903";
|
||||
/* jQuery_demo */
|
||||
google_ad_slot = "2780937993";
|
||||
google_ad_width = 728;
|
||||
google_ad_height = 90;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script></div>
|
||||
<div class="jquery-script-clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wrapper">
|
||||
<h1>jQuery xtr.js plugin Demo</h1>
|
||||
<div xtr>Welcome</div>
|
||||
<div xtr>Hello</div>
|
||||
<div data-xtr-key="bye">Good Bye</div>
|
||||
|
||||
<label for="lang">Current language</label>
|
||||
<select name="lang" id="lang">
|
||||
<option value="reset">EN</option>
|
||||
<option value="de">DE</option>
|
||||
<option value="fr">FR</option>
|
||||
<option value="es">ES</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
|
||||
<script src="../jquery.xtr.min.js"></script>
|
||||
<script>
|
||||
$('body').xtr({t: data});
|
||||
|
||||
$('#lang').on('change', function() {
|
||||
$('body').data('plugin_xtr').lang($(this).val());
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-36251023-1']);
|
||||
_gaq.push(['_setDomainName', 'jqueryscript.net']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
var data = {
|
||||
"close": {
|
||||
en: "close",
|
||||
hu: "Bezar",
|
||||
it: "Vicino"
|
||||
},
|
||||
|
||||
};
|
||||
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
Loading…
Reference in New Issue