vn-access v4 #1
Binary file not shown.
After Width: | Height: | Size: 936 B |
36
src/main.js
36
src/main.js
|
@ -4,7 +4,7 @@ var Conf = {
|
||||||
,dsName: 'verdnatura'
|
,dsName: 'verdnatura'
|
||||||
,dsPath: 'HKCU\\Software\\ODBC\\ODBC.INI\\verdnatura'
|
,dsPath: 'HKCU\\Software\\ODBC\\ODBC.INI\\verdnatura'
|
||||||
,regPath: 'HKCU\\Software\\Verdnatura\\vn-access'
|
,regPath: 'HKCU\\Software\\Verdnatura\\vn-access'
|
||||||
,remoteUrl: 'https://verdnatura.es/vn-access'
|
,remoteUrl: 'https://cdn.verdnatura.es/vn-access'
|
||||||
,dbHost: 'db.verdnatura.es'
|
,dbHost: 'db.verdnatura.es'
|
||||||
,defaultModule: 'tpv'
|
,defaultModule: 'tpv'
|
||||||
,defaultLocale: 'es'
|
,defaultLocale: 'es'
|
||||||
|
@ -49,7 +49,7 @@ var App = {
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
var width = 420;
|
var width = 420;
|
||||||
var height = 500;
|
var height = 525;
|
||||||
|
|
||||||
window.resizeTo(width, height);
|
window.resizeTo(width, height);
|
||||||
window.moveTo((screen.width - width) / 2, (screen.height - height) / 2);
|
window.moveTo((screen.width - width) / 2, (screen.height - height) / 2);
|
||||||
|
@ -143,16 +143,16 @@ var App = {
|
||||||
if (!branch) branch = defaultBranch;
|
if (!branch) branch = defaultBranch;
|
||||||
this.$('branchDiv').value = branch;
|
this.$('branchDiv').value = branch;
|
||||||
if (this.$("branch").value == "master") {
|
if (this.$("branch").value == "master") {
|
||||||
this.$("branch").style.backgroundColor = "#a52727";
|
this.$("branch").style.backgroundColor = "#c20000";
|
||||||
this.$("branchState").style.backgroundColor = "#a52727";
|
this.$("optionsLogo").style.backgroundColor = "#c20000";
|
||||||
}
|
}
|
||||||
if (this.$("branch").value == "test") {
|
if (this.$("branch").value == "test") {
|
||||||
this.$("branch").style.backgroundColor = "#31a527";
|
this.$("branch").style.backgroundColor = "#31a527";
|
||||||
this.$("branchState").style.backgroundColor = "#31a527";
|
this.$("optionsLogo").style.backgroundColor = "#31a527";
|
||||||
}
|
}
|
||||||
if (this.$("branch").value == "dev") {
|
if (this.$("branch").value == "dev") {
|
||||||
this.$("branch").style.backgroundColor = "#a59827";
|
this.$("branch").style.backgroundColor = "#a59827";
|
||||||
this.$("branchState").style.backgroundColor = "#a59827";
|
this.$("optionsLogo").style.backgroundColor = "#a59827";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -194,24 +194,28 @@ var App = {
|
||||||
|
|
||||||
onShowOptionsClick: function() {
|
onShowOptionsClick: function() {
|
||||||
if (this.$("branchDiv").style.visibility == "hidden") {
|
if (this.$("branchDiv").style.visibility == "hidden") {
|
||||||
this.$("branchDiv").style.visibility = "visible";}
|
this.$("branchDiv").style.visibility = "visible";
|
||||||
else {
|
this.$("optionsLogo").style.borderRadius = "25px 0px 0px 25px";
|
||||||
|
this.$("optionsLogo").style.paddingRight = ".45em";
|
||||||
|
} else {
|
||||||
this.$("branchDiv").style.visibility = "hidden";
|
this.$("branchDiv").style.visibility = "hidden";
|
||||||
|
this.$("optionsLogo").style.borderRadius = "100%";
|
||||||
|
this.$("optionsLogo").style.paddingRight = ".2em";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeBranchClick: function() {
|
onChangeBranchClick: function() {
|
||||||
if (this.$("branch").value == "master") {
|
if (this.$("branch").value == "master") {
|
||||||
this.$("branch").style.backgroundColor = "#a52727";
|
this.$("branch").style.backgroundColor = "#c20000";
|
||||||
this.$("branchState").style.backgroundColor = "#a52727";
|
this.$("optionsLogo").style.backgroundColor = "#c20000";
|
||||||
}
|
}
|
||||||
if (this.$("branch").value == "test") {
|
if (this.$("branch").value == "test") {
|
||||||
this.$("branch").style.backgroundColor = "#31a527";
|
this.$("branch").style.backgroundColor = "#31a527";
|
||||||
this.$("branchState").style.backgroundColor = "#31a527";
|
this.$("optionsLogo").style.backgroundColor = "#31a527";
|
||||||
}
|
}
|
||||||
if (this.$("branch").value == "dev") {
|
if (this.$("branch").value == "dev") {
|
||||||
this.$("branch").style.backgroundColor = "#a59827";
|
this.$("branch").style.backgroundColor = "#a59827";
|
||||||
this.$("branchState").style.backgroundColor = "#a59827";
|
this.$("optionsLogo").style.backgroundColor = "#a59827";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -276,15 +280,13 @@ var App = {
|
||||||
this.regWrite(Conf.dsPath, 'PWD', password);
|
this.regWrite(Conf.dsPath, 'PWD', password);
|
||||||
|
|
||||||
var version = this.fetchVersion();
|
var version = this.fetchVersion();
|
||||||
|
|
||||||
if (version !== null) {
|
if (version !== null) {
|
||||||
this.disableUi(true, _('Updating'));
|
this.disableUi(true, _('Updating'));
|
||||||
var remoteFile = version
|
var remoteFile = version
|
||||||
? '.archive/'+ this.module +'/'+ branch +'/'+ version +'.7z'
|
? '.archive/'+ this.module +'/'+ version +'.7z'
|
||||||
: this.module +'.7z?'+ new Date().getTime();
|
: this.module +'.7z?'+ new Date().getTime();
|
||||||
remoteFile = Conf.remoteUrl +'/'+ remoteFile;
|
remoteFile = Conf.remoteUrl +'/'+ remoteFile;
|
||||||
|
var request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
var request = new ActiveXObject('MSXML2.XMLHTTP');
|
|
||||||
request.open('GET', remoteFile, true);
|
request.open('GET', remoteFile, true);
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
App.onRequestReady(request);
|
App.onRequestReady(request);
|
||||||
|
@ -299,7 +301,7 @@ var App = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets information about the version to download.
|
* Gets information about the version to download.
|
||||||
*
|
* cmdle
|
||||||
* @return {Number|Boolean} Version number, %false if cannot
|
* @return {Number|Boolean} Version number, %false if cannot
|
||||||
* fetch or %null if local is up-to-date
|
* fetch or %null if local is up-to-date
|
||||||
*/
|
*/
|
||||||
|
|
BIN
src/options.png
BIN
src/options.png
Binary file not shown.
|
@ -17,7 +17,6 @@ a {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 2.5em;
|
margin-bottom: 2.5em;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
-webkit-user-drag: none;
|
|
||||||
}
|
}
|
||||||
button,
|
button,
|
||||||
input,
|
input,
|
||||||
|
@ -25,9 +24,12 @@ select {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
background-color: #000000;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
option::selection {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
#fields {
|
#fields {
|
||||||
max-width: 11em;
|
max-width: 11em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
@ -61,7 +63,7 @@ input[type='password'] {
|
||||||
}
|
}
|
||||||
input[type='text']:focus,
|
input[type='text']:focus,
|
||||||
input[type='password']:focus {
|
input[type='password']:focus {
|
||||||
border-bottom: 1px solid #000000;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
input[type='text']::selection,
|
input[type='text']::selection,
|
||||||
input[type='password']::selection {
|
input[type='password']::selection {
|
||||||
|
@ -92,7 +94,7 @@ input[type='password']::selection {
|
||||||
text-decoration-color: #44f;
|
text-decoration-color: #44f;
|
||||||
}
|
}
|
||||||
button {
|
button {
|
||||||
color: white;
|
color: #FFF;
|
||||||
background-color: #f7931e;
|
background-color: #f7931e;
|
||||||
padding: .7em;
|
padding: .7em;
|
||||||
padding-right: 2.5em;
|
padding-right: 2.5em;
|
||||||
|
@ -103,48 +105,33 @@ button {
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: #db821b;
|
background-color: #db821b;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 1s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Options */
|
/* Branch */
|
||||||
|
|
||||||
#options {
|
#branchOptions {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: .8em;
|
margin-top: 1.55em;
|
||||||
}
|
}
|
||||||
#optionsLogo {
|
#optionsLogo {
|
||||||
filter: alpha(opacity=30);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
padding: .2em;
|
||||||
#optionsLogo:hover {
|
|
||||||
filter: alpha(opacity=45);
|
|
||||||
}
|
|
||||||
#optionsLogo:active {
|
|
||||||
scale: 1em;
|
|
||||||
}
|
}
|
||||||
#branchDiv {
|
#branchDiv {
|
||||||
text-align: center;
|
|
||||||
margin-top: -2em;
|
margin-top: -2em;
|
||||||
margin-left: .05em;
|
margin-left: 2em;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#branch {
|
#branch {
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
padding-top: .25em;
|
padding-top: .465em;
|
||||||
padding-bottom: .2em;
|
padding-bottom: .46em;
|
||||||
padding-right: .2em;
|
padding-right: .46em;
|
||||||
border-radius: 10px 5px 5px 10px;
|
border-radius: 0px 5px 5px 0px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
cursor: pointer;
|
||||||
|
margin-top: -.435em;
|
||||||
#branchState {
|
margin-left: .4em;
|
||||||
background-color: #000000;
|
|
||||||
margin-top: -1.625em;
|
|
||||||
margin-left: 93%;
|
|
||||||
border-radius: 100%;
|
|
||||||
width: 1.5em;
|
|
||||||
height: 1.5em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Message */
|
/* Message */
|
||||||
|
@ -153,7 +140,7 @@ button:hover {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2em;
|
top: 2em;
|
||||||
left: 50%;
|
left: 49.2%;
|
||||||
width: 16em;
|
width: 16em;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
margin-left: -8.25em;
|
margin-left: -8.25em;
|
||||||
|
@ -167,14 +154,15 @@ button:hover {
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
}
|
}
|
||||||
#message.error {
|
#message.error {
|
||||||
border-color: #000000;
|
border-color: black;
|
||||||
background-color: #a52727;
|
background-color: #a52727;
|
||||||
color: #ffffff;
|
color: white;
|
||||||
}
|
}
|
||||||
#message.notice {
|
#message.notice {
|
||||||
border-color: rgb(0, 0, 0);
|
border-color: black;
|
||||||
background-color: #2773a5;
|
background-color: #2773a5;
|
||||||
color: #ffffff;
|
color: white;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Spinner */
|
/* Spinner */
|
||||||
|
|
|
@ -64,14 +64,14 @@
|
||||||
Limpiar caché
|
Limpiar caché
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="options">
|
<div id="branchOptions">
|
||||||
<img
|
<img
|
||||||
id="optionsLogo"
|
id="optionsLogo"
|
||||||
src="options.png"
|
src="branch.png"
|
||||||
onclick="App.onShowOptionsClick()"
|
onclick="App.onShowOptionsClick()"
|
||||||
|
style="border-radius: 100%; padding-right: .2em;"
|
||||||
alt="Options"/>
|
alt="Options"/>
|
||||||
<div id="branchDiv" style="visibility: hidden;">
|
<div id="branchDiv" style="visibility: hidden;">
|
||||||
<label for="branch">Branch:</label>
|
|
||||||
<select id="branch" onclick="App.onChangeBranchClick()">
|
<select id="branch" onclick="App.onChangeBranchClick()">
|
||||||
<option>master</option>
|
<option>master</option>
|
||||||
<option>test</option>
|
<option>test</option>
|
||||||
|
@ -79,9 +79,6 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="branchState">
|
|
||||||
<br/>
|
|
||||||
</div>
|
|
||||||
<div id="background">
|
<div id="background">
|
||||||
</div>
|
</div>
|
||||||
<div id="spinner">
|
<div id="spinner">
|
||||||
|
|
Loading…
Reference in New Issue