Skip to content

Commit

Permalink
Merge pull request #20 from isghe/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
isghe authored Mar 23, 2024
2 parents 510812a + e9f8146 commit 5b3c048
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
37 changes: 17 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,25 @@ let gController = null;
alert('assertion failed'); // eslint-disable-line no-alert
}
},
keys: theObject => {
const ret = [];
for (const aProperty in theObject) {
if (theObject.hasOwnProperty(aProperty)) { // eslint-disable-line no-prototype-builtins
ret.push(aProperty);
}
}

return ret;
keys(theObject) {
return Object.keys(theObject);
},
createElement(theTag, theProperties, theClassList) {
const ret = document.createElement(theTag);
const returnValue = document.createElement(theTag);
if ((typeof undefined !== typeof theProperties) && (theProperties !== null)) {
this.keys(theProperties).forEach(theProperty => {
ret[theProperty] = theProperties[theProperty];
returnValue[theProperty] = theProperties[theProperty];
});
}

if ((typeof undefined !== typeof theClassList) && (theClassList !== null)) {
theClassList.forEach(theClass => {
ret.classList.add(theClass);
returnValue.classList.add(theClass);
});
}

return ret;
}
return returnValue;
},
};

self.buttonDisable = function (theButton) {
Expand All @@ -49,7 +42,7 @@ let gController = null;
};

self.model = {
enabled: true
enabled: true,
};

self.show = function () {
Expand All @@ -60,12 +53,16 @@ let gController = null;
aDOMLink.append(aDOMHref);
const aAddress = '1ig1p1awfjS5bQxy2s33AD8sVspy4YFMD';
const aDOMBitcoin = self.util.createElement('div', {textContent: aAddress}, ['bitcoin']);
const aDOMQR = self.util.createElement('img', {src: aAddress + '.png', alt: aAddress, width: '200', height: '200'});
const aDOMQR = self.util.createElement('img', {
src: aAddress + '.png', alt: aAddress, width: '200', height: '200',
});
[aDOMLink, aDOMQR, aDOMBitcoin].forEach(theDOM => {
aDOMFooter.append(theDOM);
});

const aDOMInputSatoshiEuro = self.util.createElement('input', {type: 'text', value: '', maxlength: 30, size: 30}, ['input_text']);
const aDOMInputSatoshiEuro = self.util.createElement('input', {
type: 'text', value: '', maxlength: 30, size: 30,
}, ['input_text']);

const aDOMWrapResult = self.util.createElement('div', null, ['wrap-result']);
const aDOMLabelResult = self.util.createElement('span', {textContent: 'Result:'});
Expand All @@ -81,17 +78,17 @@ let gController = null;
if (self.model.enabled === true) {
self.model.enabled = false;
self.buttonDisable(aDOMButtonConvert);
aDOMValueResult.textContent = 100000000 / aDOMInputSatoshiEuro.value;
aDOMValueResult.textContent = 100_000_000 / aDOMInputSatoshiEuro.value;
setTimeout(() => {
self.buttonEnable(aDOMButtonConvert);
self.model.enabled = true;
}, 1000);
}
}
},
}, ['ig_button', 'normal']);

[
aDOMInputSatoshiEuro, aDOMButtonConvert, aDOMWrapResult, aDOMFooter
aDOMInputSatoshiEuro, aDOMButtonConvert, aDOMWrapResult, aDOMFooter,
].forEach(theDOM => {
aDOMContainer.append(theDOM);
});
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"test": "xo"
},
"devDependencies": {
"xo": "^0.32.1"
"xo": "^0.58.0"
},
"xo": {
"esnext": true,
"space": false,
"rules": {},
"rules": {
"unicorn/no-array-for-each": 0,
"unicorn/prefer-module": 0,
"unicorn/no-this-assignment": 0
},
"semicolon": true,
"envs": [
"browser",
Expand Down
1 change: 1 addition & 0 deletions pm2-serve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pm2 serve . 8081 --name satoshieuro-eurobitcoin_converter-8081

0 comments on commit 5b3c048

Please sign in to comment.