Checkpoint
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-06-06 18:19:43 +02:00
parent 2307c16748
commit 68eedecb90
13 changed files with 54 additions and 69 deletions

View File

@ -17,10 +17,6 @@ Hedera.Catalog = new Class({
} }
} }
,refreshColors() {
this.$.colors.lazyRefresh();
}
,onBasketCheck: function(isOk) { ,onBasketCheck: function(isOk) {
if (isOk) if (isOk)
this.loadUi(); this.loadUi();
@ -258,7 +254,7 @@ Hedera.Catalog = new Class({
this.onEraseClick(); this.onEraseClick();
this.$.card.row = form.row; this.$.card.row = form.row;
this.$.cardLot.value = form.$.id; this.$.cardLot.assign({item: form.$.id});
this.$.cardPopup.show(event.currentTarget); this.$.cardPopup.show(event.currentTarget);
} }
@ -296,7 +292,7 @@ Hedera.Catalog = new Class({
const params = { const params = {
warehouse: warehouse, warehouse: warehouse,
item: this.$.cardLot.value, item: this.$.cardLot.$.item,
amount: amount amount: amount
} }
sql += query.render(params); sql += query.render(params);
@ -307,7 +303,7 @@ Hedera.Catalog = new Class({
var itemName = this.$.card.get('item'); var itemName = this.$.card.get('item');
Htk.Toast.showMessage( Htk.Toast.showMessage(
sprintf(_('Added%dOf%s'), amountSum, itemName)); Vn.Value.sprintf(_('Added%dOf%s'), amountSum, itemName));
} }
this.$.cardPopup.hide(); this.$.cardPopup.hide();

View File

@ -266,7 +266,7 @@
placeholder="_Color" placeholder="_Color"
form="params" form="params"
column="color" column="color"
on-mousedown="this.refreshColors()"> on-mousedown="$.colors.lazyRefresh()">
<db-model <db-model
id="colors" id="colors"
property="model" property="model"

View File

@ -1,7 +1,5 @@
require('htk/htk'); require('htk/htk');
require('./responsive.scss');
require('./style.scss');
Hedera = module.exports = { Hedera = module.exports = {
Login : require('./login') Login : require('./login')

View File

@ -1,6 +1,5 @@
module.exports = new Class module.exports = new Class({
({
basePath: null basePath: null
,path: null ,path: null
,moduleName: null ,moduleName: null
@ -11,84 +10,74 @@ module.exports = new Class
,error: false ,error: false
,ready: false ,ready: false
,initialize: function (basePath, path) ,initialize: function(basePath, path) {
{
var absPath = basePath +'/'+ path; var absPath = basePath +'/'+ path;
var aux = path.split ('/'); var aux = path.split('/');
var moduleName = aux[aux.length - 1]; var moduleName = aux[aux.length - 1];
Vn.Locale.load (absPath, Vn.Locale.load(absPath,
this.onLocaleReady.bind (this)); this.onLocaleReady.bind(this));
Vn.includeJs (absPath +'/'+ moduleName +'.js', Vn.includeJs(absPath +'/'+ moduleName +'.js',
this.onJsReady.bind (this)); this.onJsReady.bind(this));
Vn.loadXml (absPath +'/ui.xml', Vn.loadXml(absPath +'/ui.xml',
this.onUiReady.bind (this)); this.onUiReady.bind(this));
this.basePath = basePath; this.basePath = basePath;
this.path = path; this.path = path;
this.moduleName = moduleName; this.moduleName = moduleName;
} }
,addCallback: function (callback) ,addCallback: function(callback) {
{
if (!this.ready) if (!this.ready)
this.callbacks.push (callback); this.callbacks.push(callback);
else else
callback (this); callback(this);
} }
,onLocaleReady: function (success) ,onLocaleReady: function() {
{
this.localeReady = true; this.localeReady = true;
this.onReady (); this.onReady();
} }
,onJsReady: function (success) ,onJsReady: function(success) {
{
this.jsReady = true; this.jsReady = true;
this.error = !success; this.error = !success;
this.onReady (); this.onReady();
} }
,onUiReady: function (success) ,onUiReady: function(success) {
{
this.uiReady = true; this.uiReady = true;
this.error = !success; this.error = !success;
this.onReady (); this.onReady();
} }
,onReady: function () ,onReady: function() {
{
if (!(this.localeReady && this.jsReady && this.uiReady)) if (!(this.localeReady && this.jsReady && this.uiReady))
return; return;
this.ready = true; this.ready = true;
var klassName = this.toCamelCase (this.moduleName); var klassName = this.toCamelCase(this.moduleName);
try { try {
this.klass = Hedera[klassName]; this.klass = Hedera[klassName];
} } catch (e) {
catch (e)
{
this.error = true; this.error = true;
console.error (e); console.error(e);
} }
var callbacks = this.callbacks; var callbacks = this.callbacks;
this.callbacks = null; this.callbacks = null;
for (var i = 0; i < callbacks.length; i++) for (var i = 0; i < callbacks.length; i++)
callbacks[i] (this); callbacks[i](this);
} }
,toCamelCase: function (dashedName) ,toCamelCase: function(dashedName) {
{ var camelCase = dashedName.charAt(0).toUpperCase();
var camelCase = dashedName.charAt (0).toUpperCase (); camelCase += dashedName.substr(1).replace(/\w-\w/g, function(token) {
camelCase += dashedName.substr (1).replace (/\w\-\w/g, function (token) return token.charAt(0) + token.charAt(2).toUpperCase();
{
return token.charAt (0) + token.charAt (2).toUpperCase ();
}); });
return camelCase; return camelCase;
} }

View File

@ -1,3 +1,4 @@
require('./social-bar.scss');
module.exports = new Class({ module.exports = new Class({
Extends: Vn.Component Extends: Vn.Component

13
js/hedera/social-bar.scss Normal file
View File

@ -0,0 +1,13 @@
.htk-social-bar {
text-align: center;
a {
display: inline-block;
margin: 0 .1em;
}
img {
height: 1.8em;
width: 1.8em;
}
}

View File

@ -1,3 +1,4 @@
@import "../../style/classes";
td.cell-button { td.cell-button {
max-width: 20px; max-width: 20px;

View File

@ -4,4 +4,6 @@
@import "./spacing"; @import "./spacing";
@import "./text"; @import "./text";
@import "./width"; @import "./width";
@import "./responsive";
@import "./material-symbols"; @import "./material-symbols";
@import "./style";

View File

@ -14,19 +14,19 @@
/* Desktop - FHD 1920x1080 */ /* Desktop - FHD 1920x1080 */
@media (max-resolution: 119dpi) and (min-device-width: 1900px) { @media (max-resolution: 119dpi) and (min-device-width: 1900px) {
body { font-size: 13pt; } body { font-size: 10pt; }
} }
/* Mobile - Low DPI */ /* Mobile - Low DPI */
@media @media
(min-resolution: 120dpi), (min-resolution: 120dpi),
(-webkit-min-device-pixel-ratio: 1.5) { (-webkit-min-device-pixel-ratio: 1.5) {
body { font-size: 9pt; } body { font-size: 10pt; }
} }
@media @media
(min-resolution: 144dpi), (min-resolution: 144dpi),
(-webkit-min-device-pixel-ratio: 1.5) { (-webkit-min-device-pixel-ratio: 1.5) {
body { font-size: 11pt; } body { font-size: 10pt; }
} }
/* Mobile - Normal DPI */ /* Mobile - Normal DPI */
@ -38,7 +38,7 @@
@media @media
(min-device-width: 384px) and (min-resolution: 192dpi), (min-device-width: 384px) and (min-resolution: 192dpi),
(min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) { (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) {
body { font-size: 11pt; } body { font-size: 10pt; }
} }
/* Mobile - High DPI */ /* Mobile - High DPI */
@ -50,5 +50,5 @@
@media @media
(min-device-width: 412px) and (min-resolution: 249dpi), (min-device-width: 412px) and (min-resolution: 249dpi),
(min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) { (min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) {
body { font-size: 11pt; } body { font-size: 10pt; }
} }

View File

@ -1,5 +1,5 @@
@import "../htk/style/classes"; @import "./classes";
@font-face { @font-face {
font-family: 'Poppins'; font-family: 'Poppins';
@ -313,18 +313,3 @@ img.icon {
@media screen and (min-width: 2000px) { @media screen and (min-width: 2000px) {
.masonry-box { width: 25%; } .masonry-box { width: 25%; }
} }
/* Social bar */
.htk-social-bar {
text-align: center;
a {
display: inline-block;
margin: 0 .1em;
}
img {
height: 1.8em;
width: 1.8em;
}
}