Commit 9cb25896 by jhrabal

wip

parent 497c0081
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="28" height="32" viewBox="0 0 28 32">
<path fill="#FFFFFF" d="M0.992 8.256h26.016c0.544 0 0.992-0.448 0.992-0.992v-2.528c0-0.544-0.448-0.992-0.992-0.992h-26.016c-0.544 0-0.992 0.448-0.992 0.992v2.528c0 0.544 0.448 0.992 0.992 0.992zM0.992 18.24h26.016c0.544 0 0.992-0.448 0.992-0.992v-2.496c0-0.544-0.448-0.992-0.992-0.992h-26.016c-0.544 0-0.992 0.448-0.992 0.992v2.496c0 0.544 0.448 0.992 0.992 0.992zM0.992 28.256h26.016c0.544 0 0.992-0.448 0.992-0.992v-2.528c0-0.544-0.448-0.992-0.992-0.992h-26.016c-0.544 0-0.992 0.448-0.992 0.992v2.528c0 0.544 0.448 0.992 0.992 0.992z"></path>
</svg>
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>envelope</title>
<path d="M31.392 11.936c0.256-0.192 0.608-0.032 0.608 0.288v12.768c0 1.664-1.344 3.008-3.008 3.008h-25.984c-1.664 0-3.008-1.344-3.008-3.008v-12.768c0-0.32 0.352-0.48 0.608-0.288 1.408 1.088 3.264 2.464 9.632 7.104 1.312 0.96 3.552 2.976 5.76 2.976 2.24 0 4.512-2.048 5.76-2.976 6.4-4.64 8.224-6.016 9.632-7.104zM16 20c1.44 0.032 3.552-1.824 4.576-2.592 8.32-6.016 8.928-6.528 10.848-8.032 0.352-0.288 0.576-0.736 0.576-1.184v-1.184c0-1.664-1.344-3.008-3.008-3.008h-25.984c-1.664 0-3.008 1.344-3.008 3.008v1.184c0 0.448 0.224 0.896 0.576 1.184 1.92 1.472 2.56 2.016 10.848 8.032 1.056 0.768 3.136 2.624 4.576 2.592z"></path>
</svg>
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="19" height="32" viewBox="0 0 19 32">
<path fill="#f79239" d="M18.624 13.216v11.392q0 1.024-1.024 1.024h-16.576q-1.024 0-1.024-1.024v-11.392q0-0.32 0.096-0.544t0.224-0.32 0.384-0.16 0.416-0.064 0.512 0 0.448 0.032v-4.064h0.032q0.288-2.784 2.368-4.512t4.896-1.696 4.832 1.984 2.272 4.864h0.032l0.064 3.424q0.128 0 0.48-0.032t0.48 0 0.416 0.064 0.384 0.16 0.192 0.32 0.096 0.544zM13.472 8.032q0-1.632-1.184-2.368t-2.912-0.736q-1.696 0-2.944 0.8t-1.248 2.464v3.968h8.288v-4.128z"></path>
</svg>
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>phone</title>
<path d="M30.848 1.536l-6.496-1.504c-0.736-0.16-1.44 0.224-1.728 0.864l-3.008 7.008c-0.075 0.172-0.118 0.373-0.118 0.584 0 0.475 0.22 0.898 0.563 1.173l0.003 0.002 3.776 3.104c-2.24 4.768-6.176 8.768-11.072 11.072l-3.104-3.776c-0.278-0.346-0.701-0.566-1.176-0.566-0.211 0-0.412 0.043-0.594 0.122l0.010-0.004-7.008 3.008c-0.64 0.288-1.024 0.992-0.864 1.696l1.504 6.528c0.16 0.672 0.768 1.152 1.472 1.152 16 0 28.992-12.96 28.992-28.992 0-0.704-0.48-1.312-1.152-1.472z"></path>
</svg>
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="28" height="32" viewBox="0 0 28 32">
<title>skype</title>
<path d="M26.56 18.72c0.16-0.864 0.288-1.792 0.288-2.72 0-7.104-5.76-12.832-12.832-12.832-0.928 0-1.856 0.096-2.752 0.288-1.184-0.928-2.656-1.472-4.256-1.472-3.872 0-7.008 3.136-7.008 7.008 0 1.6 0.544 3.072 1.472 4.256-0.192 0.896-0.32 1.824-0.32 2.752 0 7.104 5.76 12.832 12.832 12.832 0.928 0 1.856-0.096 2.752-0.288 1.184 0.896 2.656 1.44 4.256 1.44 3.872 0 7.008-3.136 7.008-6.976 0-1.6-0.544-3.104-1.44-4.288zM14.368 24.448c-4.096 0-7.52-1.824-7.52-4.064 0-0.992 0.576-1.92 1.856-1.92 1.952 0 2.112 2.816 5.504 2.816 1.6 0 2.624-0.704 2.624-1.632 0-1.184-0.992-1.344-2.624-1.76-3.904-0.96-7.36-1.376-7.36-5.44 0-3.712 3.68-5.088 6.816-5.088 3.456 0 6.944 1.376 6.944 3.488 0 1.056-0.704 1.984-1.888 1.984-1.792 0-1.824-2.112-4.704-2.112-1.6 0-2.624 0.448-2.624 1.408 0 1.248 1.312 1.376 4.32 2.080 2.592 0.576 5.664 1.664 5.664 4.832 0 3.712-3.552 5.408-7.008 5.408z"></path>
</svg>
window.login = {
login: function(user, opts) {
jh.post('/api/auth/login', user, function(status, data) {
if (status > 199 && status < 300) {
var user = data;
if (typeof opts.onSuccess == "function") {
opts.onSuccess(user);
}
} else {
if (typeof opts.onError == "function") {
var err = data;
if (err) {
if (!(err instanceof Array)) {
err = [err];
}
var errs = [];
var i = null;
for (i = 0; i < err.length; i++) {
errs.push(err[i] || { code: 'UnexpectedError' });
}
opts.onError(errs);
}
}
}
});
},
form: function(opts) {
if (!opts) {
opts = {};
}
var
that = this,
formId = opts.formId || "loginForm",
usernameId = opts.usernameId || "loginUsername",
passwordId = opts.passwordId || "loginPassword",
loginErrorId = opts.loginErrorId || "loginErrorId",
loginButtonId = opts.loginButtonId || "loginButton",
activityIndicatorId = opts.activityIndicatorId || "authActivityIndicator",
onSubmitHandler = typeof opts.onSubmitHandler == "function" ? opts.onSubmitHandler : function() {},
onSuccessHandler = typeof opts.onSuccessHandler == "function" ? opts.onSuccessHandler : function() {
window.location= '/';
},
onErrorHandler = typeof opts.onErrorHandler == "function" ? opts.onErrorHandler : function(errs) {
if (!errs || !errs.length) {
return;
}
var
e = null,
i = null,
el = null,
field = null,
errEl = null;
for (i = 0; i < errs.length; i++) {
e = errs[i];
if (e.field) {
if (e.field == "username") {
field = usernameId;
} else if (e.field == "password") {
field = passwordId;
}
}
if (field) {
el = jh.dom(field);
jh.addClass(el, "error");
errEl = jh.dom(field + 'Error');
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
} else {
errEl = jh.dom(signupErrorId);
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
}
}
},
clearErrors = typeof opts.clearErrors == "function" ? opts.clearErrors : function() {
clearError(usernameId + "Error");
clearError(passwordId + "Error");
clearError(loginErrorId);
},
clearError = typeof opts.clearError == "function" ? opts.clearError : function (id) {
var el = jh.dom(id);
el.innerHTML = "";
jh.hide(el);
},
disable = function() {
jh.disable(loginButtonId);
jh.disable(usernameId);
jh.disable(passwordId);
jh.show(activityIndicatorId);
},
enable = function() {
jh.enable(loginButtonId);
jh.enable(usernameId);
jh.enable(passwordId);
jh.hide(activityIndicatorId);
},
form = jh.dom(formId),
username = jh.dom(usernameId),
password = jh.dom(passwordId),
translate = typeof opts.translate === "function" ? opts.translate : function(key) {
if (window.__labels) {
return window.__labels[key] || key;
}
return key;
};
form.onsubmit = function() {
var
user = {};
user.username = username.value;
user.password = password.value;
disable();
clearErrors();
onSubmitHandler(user);
var errors = [];
if (!user.username) {
errors.push({
error: translate('UsernameRequired'),
field: "username"
});
}
if (!user.password) {
errors.push({
error: translate('PasswordRequired'),
field: "password"
});
}
if (errors.length) {
onErrorHandler(errors);
enable();
return false;
}
//clear errors
that.login(user, {
onSuccess: function(user) {
onSuccessHandler(user);
enable();
},
onError: function(errors) {
var
errs = [];
for (var i = 0; i < errors.length; i++) {
err = errors[i] || {};
var label = translate(err.code || 'UnexpectedError');
errs.push({
field: err.field,
label: label
});
}
onErrorHandler(errs);
enable();
}
});
return false;
};
}
};
//class list
if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
//inject jh plugin
if (!window.jh) {
window.jh = {
dom: function(id) {
return document.getElementById(id) || {};
},
_visibility: function(el, visible, method) {
if (el && el.style) {
if (visible) {
el.style.display = method || 'block';
} else {
el.style.display = 'none';
}
}
},
_dom: function(el) {
return typeof el === "string" ? this.dom(el) : el;
},
enable: function(el) {
var el = this._dom(el);
if (el) {
el.disabled = false;//!enabled;
}
},
disable: function(el) {
console.log(el);
var el = this._dom(el);
if (el) {
console.log("disabling", el);
el.disabled = true;//!enabled;
}
},
show: function(el, method) {
this._visibility(this._dom(el), true, method);
},
hide: function(el) {
this._visibility(this._dom(el), false);
},
html: function(el, html) {
el = this._dom(el);
if (el) {
el.innerHTML = html;
}
},
value: function(el) {
el = this._dom(el);
if (el) {
return el.value;
}
return;
},
addClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.add(clazz);
}
},
removeClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.remove(clazz);
}
},
toggleClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.toggle(clazz);
}
},
debounce: function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait || 100);
if (callNow) func.apply(context, args);
};
},
post: function(url, body, callback) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
typeof callback === "function" && callback(xhttp.status, xhttp.response ? JSON.parse(xhttp.response) : null);
}
};
xhttp.open("POST", url, true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhttp.send(JSON.stringify(body));
}
};
}
window.reset = {
getParameter: function(parameterName) {
if (!location.search || !location.search.length) {
return null
}
var result = null,
tmp = [];
var items = location.search.substr(1).split("&");
for (var index = 0; index < items.length; index++) {
tmp = items[index].split("=");
if (tmp[0] === parameterName) {
result = decodeURIComponent(tmp[1]);
}
}
return result;
},
reset: function(user, opts) {
jh.post('/api/auth/resetPassword', user, function(status, data) {
if (status > 199 && status < 300) {
var user = data;
if (typeof opts.onSuccess == "function") {
opts.onSuccess(user);
}
} else {
if (typeof opts.onError == "function") {
var err = data;
if (err) {
if (!(err instanceof Array)) {
err = [err];
}
var errs = [];
var i = null;
for (i = 0; i < err.length; i++) {
errs.push(err[i] || { code: 'UnexpectedError' });
}
opts.onError(errs);
}
}
}
});
},
form: function(opts) {
if (!opts) {
opts = {};
}
var
that = this,
formId = opts.formId || "resetForm",
usernameId = opts.usernameId || "resetUsername",
passwordId = opts.passwordId || "resetPassword",
resetErrorId = opts.resetErrorId || "resetErrorId",
loginButtonId = opts.resetButtonId || "resetButton",
activityIndicatorId = opts.activityIndicatorId || "authActivityIndicator",
onSubmitHandler = typeof opts.onSubmitHandler == "function" ? opts.onSubmitHandler : function() {},
onSuccessHandler = typeof opts.onSuccessHandler == "function" ? opts.onSuccessHandler : function() {
window.location= '/';
},
onErrorHandler = typeof opts.onErrorHandler == "function" ? opts.onErrorHandler : function(errs) {
if (!errs || !errs.length) {
return;
}
var
e = null,
i = null,
el = null,
field = null,
errEl = null;
for (i = 0; i < errs.length; i++) {
e = errs[i];
if (e.field) {
if (e.field == "username") {
field = usernameId;
} else if (e.field == "password") {
field = passwordId;
}
}
if (field) {
el = jh.dom(field);
jh.addClass(el, "error");
errEl = jh.dom(field + 'Error');
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
} else {
errEl = jh.dom(resetErrorId);
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
}
}
},
disable = function() {
jh.disable(loginButtonId);
jh.disable(usernameId);
jh.disable(passwordId);
jh.show(activityIndicatorId);
},
enable = function() {
jh.enable(loginButtonId);
jh.enable(usernameId);
jh.enable(passwordId);
jh.hide(activityIndicatorId);
},
clearErrors = typeof opts.clearErrors == "function" ? opts.clearErrors : function() {
clearError(usernameId + "Error");
clearError(passwordId + "Error");
clearError(resetErrorId);
},
clearError = typeof opts.clearError == "function" ? opts.clearError : function (id) {
var el = jh.dom(id);
el.innerHTML = "";
jh.hide(el);
},
form = jh.dom(formId),
username = jh.dom(usernameId),
password = jh.dom(passwordId),
translate = typeof opts.translate === "function" ? opts.translate : function(key) {
if (window.__labels) {
return window.__labels[key] || key;
}
return key;
};
form.onsubmit = function() {
var
user = {};
user.username = username.value;
user.password = password.value;
user.token = that.getParameter("t");
disable();
clearErrors();
onSubmitHandler(user);
var errors = [];
if (!user.username) {
errors.push({
code: 'UsernameRequired',
label: translate('UsernameRequired'),
field: "username"
});
}
if (!user.password) {
errors.push({
code: 'PasswordRequired',
label: translate('PasswordRequired'),
field: "password"
});
}
if (errors.length) {
onErrorHandler(errors);
enable();
return false;
}
//clear errors
that.reset(user, {
onSuccess: function(user) {
onSuccessHandler(user);
},
onError: function(errors) {
var
errs = [];
for (var i = 0; i < errors.length; i++) {
err = errors[i] || {};
var label = translate(err.code || 'UnexpectedError');
errs.push({
field: err.field,
label: label,
code: err.code
});
}
onErrorHandler(errs);
enable();
}
});
return false;
};
}
};
window.signup = {
signup: function(user, opts) {
jh.post('/api/auth/signup', user, function(status, data) {
if (status > 199 && status < 300) {
var user = data;
if (typeof opts.onSuccess == "function") {
opts.onSuccess(user);
}
} else {
if (typeof opts.onError == "function") {
var err = data;
if (err) {
if (!(err instanceof Array)) {
err = [err];
}
var errs = [];
var i = null;
for (i = 0; i < err.length; i++) {
errs.push(err[i] || { code: 'UnexpectedError' });
}
opts.onError(errs);
}
}
}
});
},
form: function(opts) {
if (!opts) {
opts = {};
}
var
that = this,
formId = opts.formId || "signupForm",
usernameId = opts.usernameId || "signupUsername",
passwordId = opts.passwordId || "signupPassword",
signupErrorId = opts.signupErrorId || "signupErrorId",
loginButtonId = opts.signupButtonId || "signupButton",
activityIndicatorId = opts.activityIndicatorId || "authActivityIndicator",
onSubmitHandler = typeof opts.onSubmitHandler == "function" ? opts.onSubmitHandler : function() {},
onSuccessHandler = typeof opts.onSuccessHandler == "function" ? opts.onSuccessHandler : function() {
window.location= '/';
},
onErrorHandler = typeof opts.onErrorHandler == "function" ? opts.onErrorHandler : function(errs) {
if (!errs || !errs.length) {
return;
}
var
e = null,
i = null,
el = null,
field = null,
errEl = null;
for (i = 0; i < errs.length; i++) {
e = errs[i];
if (e.field) {
if (e.field == "username") {
field = usernameId;
} else if (e.field == "password") {
field = passwordId;
}
}
if (field) {
el = jh.dom(field);
jh.addClass(el, "error");
errEl = jh.dom(field + 'Error');
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
} else {
errEl = jh.dom(signupErrorId);
errEl.innerHTML = e.label || e.error;
jh.show(errEl);
}
}
},
disable = function() {
jh.disable(loginButtonId);
jh.disable(usernameId);
jh.disable(passwordId);
jh.show(activityIndicatorId);
},
enable = function() {
jh.enable(loginButtonId);
jh.enable(usernameId);
jh.enable(passwordId);
jh.hide(activityIndicatorId);
},
clearErrors = typeof opts.clearErrors == "function" ? opts.clearErrors : function() {
clearError(usernameId + "Error");
clearError(passwordId + "Error");
clearError(signupErrorId);
},
clearError = typeof opts.clearError == "function" ? opts.clearError : function (id) {
var el = jh.dom(id);
el.innerHTML = "";
jh.hide(el);
},
form = jh.dom(formId),
username = jh.dom(usernameId),
password = jh.dom(passwordId),
translate = typeof opts.translate === "function" ? opts.translate : function(key) {
if (window.__labels) {
return window.__labels[key] || key;
}
return key;
};
form.onsubmit = function() {
var
user = {};
user.username = username.value;
user.password = password.value;
disable();
clearErrors();
onSubmitHandler(user);
var errors = [];
if (!user.username) {
errors.push({
code: 'UsernameRequired',
label: translate('UsernameRequired'),
field: "username"
});
}
if (!user.password) {
errors.push({
code: 'PasswordRequired',
label: translate('PasswordRequired'),
field: "password"
});
}
if (errors.length) {
onErrorHandler(errors);
enable();
return false;
}
//clear errors
that.signup(user, {
onSuccess: function(user) {
onSuccessHandler(user);
enable();
},
onError: function(errors) {
var
errs = [];
for (var i = 0; i < errors.length; i++) {
err = errors[i] || {};
var label = translate(err.code || 'UnexpectedError');
errs.push({
field: err.field,
label: label,
code: err.code
});
}
onErrorHandler(errs);
enable();
}
});
return false;
};
}
};
//class list
if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
//inject jh plugin
if (!window.jh) {
window.jh = {
dom: function(id) {
return document.getElementById(id) || {};
},
_visibility: function(el, visible, method) {
if (el && el.style) {
if (visible) {
el.style.display = method || 'block';
} else {
el.style.display = 'none';
}
}
},
_dom: function(el) {
return typeof el === "string" ? this.dom(el) : el;
},
enable: function(el) {
var el = this._dom(el);
if (el) {
el.disabled = false;//!enabled;
}
},
disable: function(el) {
console.log(el);
var el = this._dom(el);
if (el) {
console.log("disabling", el);
el.disabled = true;//!enabled;
}
},
show: function(el, method) {
this._visibility(this._dom(el), true, method);
},
hide: function(el) {
this._visibility(this._dom(el), false);
},
html: function(el, html) {
el = this._dom(el);
if (el) {
el.innerHTML = html;
}
},
value: function(el) {
el = this._dom(el);
if (el) {
return el.value;
}
return;
},
addClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.add(clazz);
}
},
removeClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.remove(clazz);
}
},
toggleClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.toggle(clazz);
}
},
debounce: function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait || 100);
if (callNow) func.apply(context, args);
};
},
post: function(url, body, callback) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
typeof callback === "function" && callback(xhttp.status, xhttp.response ? JSON.parse(xhttp.response) : null);
}
};
xhttp.open("POST", url, true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhttp.send(JSON.stringify(body));
}
};
}
#PUBLIC page
public.title=Inodio
public.menu.item1=Home
public.menu.item2=Features
public.menu.item3=About
public.menu.item4=Signup
public.menu.login=Login
public.jumbotron.text=Smart online bookkeeping service for freelancers and small businesses
public.cta=Create my free account
public.section1.title=Your enterprise, anywhere, anytime
public.section1.text=Inodio is an online bookkeeping service that allows its users to:
public.section1.features=<li>Issue and distribute invoices</li>\
<li> Keep track of earnings and spending </li>\
<li> Simple Tax and VAT Management </ li>\
<li> Organize orders and project costs </ li> \
<li> Manage customer information </ li> \
<li> Get an overview of your business status through reports </ li>\
<li> 24-hour access </ li>\
<li> ... and much more </ li>
public.section2.title=Created for freelancers and small businesses
public.section2.text=Being small entrepreneurs ourselves, we know very well how difficult business management can be, especially with limited resources. That's why we created Inodio - to help us, our friends and colleagues, to focus on what is really important - to deliver top-level services to our customers.
public.section3.title=Beta version
public.section3.text=We constantly improve our solution to make it as useful and as easy to work with as possible. We will appreciate your feedback
public.signupSection.title=Start using Inodio for free
public.signupSection.text=Join a diverse community of businessmen and entrepreneurs and start using Inodio in just a few minutes
public.signupSection.placeholder.email=E-Mail
public.signupSection.placeholder.password=Password
public.signupSection.button=Sign up
public.signupSection.terms=* By clicking “Sign up” button, you agree to our <a href="./terms.html" target="_terms">terms of service</a>.
public.invoice.title=Invoice {0}
public.invoice.pdf=Download PDF
public.invoice.print=Print
#PUBLIC page
public.title=Inodio
public.menu.item1=Domů
public.menu.item2=Vlastnosti
public.menu.item3=O Projektu
public.menu.item4=Registrace
public.menu.login=Přihlášení
public.jumbotron.text=Chytrý nástroj pro online správu živností a malých společností
public.cta=Založit účet zdarma
public.section1.title=Vaše podnikání, kdykoliv a kdekoliv
public.section1.text=Inodio je online účetní platforma, umožňující svým uživatelům:
public.section1.features=<li>Vystavovat a rozesílat <b>faktury</b></li>\
<li>Sledovat své <b>příjmy a výdaje</b></li>\
<li>Jednoduchou správu <b>daňových sazeb</b> a <b>DPH</b></li>\
<li>Organizovat zakázky a náklady do <b>projektů</b></li>\
<li>Spravovat informace o svých <b>zákaznících</b></li>\
<li>Mít <b>přehled</b> o stavu své firmy prostřednictvím <b>reportů</b></li>\
<li>Přístup <b>24 hodin denně</b></li>\
<li>... a mnoho dalšího</li>
public.section2.title=Stvořeno pro živnostníky a malé firmy
public.section2.text=Jako drobní podnikatelé a živnostníci sami moc dobře víme, jak náročná může správa podnikání být, obzvláště s omezenými zdroji. Proto jsme stvořili Inodio tak, aby nám, našim přátelům a kolegům každý den pomáhalo soustředit se na to opravdu důležité - na poskytování špičkových služeb svým zákazníkům.
public.section3.title=Testovací verze
public.section3.text=Naše řešení neustále vylepšujeme, aby bylo co <b>nejužitečnější</b> a práce s ním co <b>nejjednodušší</b> a <b>nejzábavnější</b>.<br/>Budeme rádi za Vaši zpětnou vazbu
public.signupSection.title=Začněte používat Inodio zdarma
public.signupSection.text=Připojte se k různorodé komunitě živnostníků a podnikatelů a začněte používat Inodio během několika málo minut
public.signupSection.placeholder.email=E-Mail
public.signupSection.placeholder.password=Heslo
public.signupSection.button=Založit účet
public.signupSection.terms=* Založením a používáním účtu souhlasíte s <a href="./terms.html" target="_terms">podmínkami služby</a>.
public.invoice.title=Faktura {0}
public.invoice.pdf=Stáhnout PDF
public.invoice.print=Vytisknout
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?57173866');
src: url('../font/fontello.eot?57173866#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?57173866') format('woff2'),
url('../font/fontello.woff?57173866') format('woff'),
url('../font/fontello.ttf?57173866') format('truetype'),
url('../font/fontello.svg?57173866#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?57173866#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-uniF101:before { content: '\f101'; } /* '' */
.icon-uniF106:before { content: '\f106'; } /* '' */
.icon-uniF107:before { content: '\f107'; } /* '' */
.icon-uniF10A:before { content: '\f10a'; } /* '' */
.icon-uniF10B:before { content: '\f10b'; } /* '' */
.icon-uniF10E:before { content: '\f10e'; } /* '' */
.icon-uniF112:before { content: '\f112'; } /* '' */
.icon-uniF113:before { content: '\f113'; } /* '' */
.icon-uniF115:before { content: '\f115'; } /* '' */
.icon-uniF116:before { content: '\f116'; } /* '' */
.icon-uniF118:before { content: '\f118'; } /* '' */
.icon-uniF11B:before { content: '\f11b'; } /* '' */
.icon-uniF11C:before { content: '\f11c'; } /* '' */
.icon-uniF11D:before { content: '\f11d'; } /* '' */
.icon-uniF11E:before { content: '\f11e'; } /* '' */
.icon-uniF11F:before { content: '\f11f'; } /* '' */
.icon-uniF123:before { content: '\f123'; } /* '' */
.icon-uniF124:before { content: '\f124'; } /* '' */
.icon-uniF128:before { content: '\f128'; } /* '' */
.icon-uniF129:before { content: '\f129'; } /* '' */
.icon-uniF12A:before { content: '\f12a'; } /* '' */
.icon-uniF130:before { content: '\f130'; } /* '' */
\ No newline at end of file
//class list
if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
//inject jh plugin
if (!window.jh) {
window.jh = {
dom: function(id) {
return document.getElementById(id) || {};
},
_visibility: function(el, visible, method) {
if (el && el.style) {
if (visible) {
el.style.display = method || 'block';
} else {
el.style.display = 'none';
}
}
},
_dom: function(el) {
return typeof el === "string" ? this.dom(el) : el;
},
enable: function(el) {
var el = this._dom(el);
if (el) {
el.disabled = false;//!enabled;
}
},
disable: function(el) {
var el = this._dom(el);
if (el) {
el.disabled = true;//!enabled;
}
},
show: function(el, method) {
this._visibility(this._dom(el), true, method);
},
hide: function(el) {
this._visibility(this._dom(el), false);
},
html: function(el, html) {
el = this._dom(el);
if (el) {
el.innerHTML = html;
}
},
value: function(el) {
el = this._dom(el);
if (el) {
return el.value;
}
return;
},
addClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.add(clazz);
}
},
removeClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.remove(clazz);
}
},
toggleClass: function(el, clazz) {
el = this._dom(el);
if (el && el.classList) {
el.classList.toggle(clazz);
}
},
debounce: function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait || 100);
if (callNow) func.apply(context, args);
};
},
post: function(url, body, callback) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4) {
typeof callback === "function" && callback(xhttp.status, xhttp.response ? JSON.parse(xhttp.response) : null);
}
};
xhttp.open("POST", url, true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhttp.send(JSON.stringify(body));
}
};
}
package com.jh.radegast;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.jh.common.i18n.ClasspathI18nSource;
import com.jh.common.i18n.I18nSource;
import com.jh.common.web.ReactApplicationContext;
/**
* The Class WebConfig.
*/
@Configuration
public class WebConfig extends ReactApplicationContext {
// /**
// * User info modifier.
// *
// * @return the client content modifier
// */
// @Bean
// public ClientContentModifier userInfoModifier() {
// return new UserInfoModifier();
// }
//
// /**
// * Unit info resolver.
// *
// * @return the inject unit argument resolver
// */
// @Bean
// public InjectUnitArgumentResolver unitInfoResolver() {
// return new InjectUnitArgumentResolver();
// }
//
// /**
// * @param argumentResolvers
// * @see com.jh.common.web.ReactApplicationContext#addArgumentResolvers(java.util.List)
// */
// @Override
// public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
// super.addArgumentResolvers(argumentResolvers);
// argumentResolvers.add(unitInfoResolver());
// }
/**
* @return
* @see com.jh.common.web.ReactApplicationContext#publicI18nSource()
*/
@Bean
@Override
public I18nSource publicI18nSource() {
return new ClasspathI18nSource("public/messages");
}
}
......@@ -11,7 +11,7 @@ logging.level.org.hibernate.SQL=ERROR
# server port config
server.port=7070
server.port=7071
# datasource
spring.datasource.jdbcUrl=jdbc:postgresql://postgresdb:5432/radegast
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment