monospace, jakolinkki
This commit is contained in:
58
index.html
58
index.html
@@ -23,12 +23,15 @@
|
|||||||
min-width: 69%;
|
min-width: 69%;
|
||||||
max-width: 100%; }
|
max-width: 100%; }
|
||||||
LABEL {
|
LABEL {
|
||||||
width: 10ex;
|
width: 25ex;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.error {
|
.error {
|
||||||
color: salmon;
|
color: salmon;
|
||||||
}
|
}
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
#barcode {
|
#barcode {
|
||||||
margin-top: 0em;
|
margin-top: 0em;
|
||||||
margin-bottom: 0em;
|
margin-bottom: 0em;
|
||||||
@@ -88,14 +91,22 @@
|
|||||||
.print_help {
|
.print_help {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.arvo {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
.kayttaja {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
.kayttaja_pdf {
|
.kayttaja_pdf {
|
||||||
display: none;
|
display: none;
|
||||||
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
.print_help_pdf {
|
.print_help_pdf {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
.no-print, .no-print * {
|
.no-print, .no-print * {
|
||||||
@@ -114,6 +125,7 @@
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -129,7 +141,8 @@ let state = {
|
|||||||
'iban': null,
|
'iban': null,
|
||||||
'paiva': null,
|
'paiva': null,
|
||||||
'summa': null,
|
'summa': null,
|
||||||
'viite': null
|
'viite': null,
|
||||||
|
'jaettu': null
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear_barcode() {
|
function clear_barcode() {
|
||||||
@@ -187,8 +200,12 @@ function modify_request(iban,summa,viite,paiva) {
|
|||||||
let saaja_s = encodeURIComponent(document.getElementById('saaja').value);
|
let saaja_s = encodeURIComponent(document.getElementById('saaja').value);
|
||||||
let maksaja_s = encodeURIComponent(document.getElementById('maksaja').value);
|
let maksaja_s = encodeURIComponent(document.getElementById('maksaja').value);
|
||||||
let lasku_s = encodeURIComponent(document.getElementById('laskun_tiedot').value);
|
let lasku_s = encodeURIComponent(document.getElementById('laskun_tiedot').value);
|
||||||
const nextURL = `${URL}?FI${state['iban']},${state['summa']},${state['viite']},${state['paiva']},${saaja_s},${maksaja_s},${lasku_s}`;
|
let jaettu = state['jaettu'] === true ? "1" : ""
|
||||||
|
const nextURL = `${URL}?FI${state['iban']},${state['summa']},${state['viite']},${state['paiva']},${saaja_s},${maksaja_s},${lasku_s},${jaettu}`;
|
||||||
window.history.replaceState({}, document.title, nextURL);
|
window.history.replaceState({}, document.title, nextURL);
|
||||||
|
|
||||||
|
const shareURL = `${URL}?FI${state['iban']},${state['summa']},${state['viite']},${state['paiva']},${saaja_s},${maksaja_s},${lasku_s},1`;
|
||||||
|
document.getElementById('lasku_linkki').href = shareURL;
|
||||||
}
|
}
|
||||||
function calculate_viite_tarkiste(ilman_tarkiste) {
|
function calculate_viite_tarkiste(ilman_tarkiste) {
|
||||||
let kertoimet = Array(7, 3, 1);
|
let kertoimet = Array(7, 3, 1);
|
||||||
@@ -350,16 +367,35 @@ function lasku_pdf() {
|
|||||||
jsPDF: { unit: 'mm', format: 'A4', orientation: 'portrait' }
|
jsPDF: { unit: 'mm', format: 'A4', orientation: 'portrait' }
|
||||||
};
|
};
|
||||||
html2pdf().set(opt).from(element).save().then(function(results){
|
html2pdf().set(opt).from(element).save().then(function(results){
|
||||||
|
if (! state['jaettu']) {
|
||||||
for (let i = 0; i < editables.length; i++) {
|
for (let i = 0; i < editables.length; i++) {
|
||||||
editables[i].classList.remove("kayttaja_pdf");
|
editables[i].classList.remove("kayttaja_pdf");
|
||||||
}
|
}
|
||||||
for (let i = 0; i < printables.length; i++) {
|
for (let i = 0; i < printables.length; i++) {
|
||||||
printables[i].classList.remove("print_help_pdf");
|
printables[i].classList.remove("print_help_pdf");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_shared() {
|
||||||
|
const editables = document.getElementsByClassName("kayttaja");
|
||||||
|
const printables = document.getElementsByClassName("print_help");
|
||||||
|
const non_printables = document.getElementsByClassName("no-print");
|
||||||
|
for (let i = 0; i < editables.length; i++) {
|
||||||
|
editables[i].classList.add("kayttaja_pdf");
|
||||||
|
}
|
||||||
|
for (let i = 0; i < printables.length; i++) {
|
||||||
|
printables[i].classList.add("print_help_pdf");
|
||||||
|
}
|
||||||
|
for (let i = 0; i < non_printables.length; i++) {
|
||||||
|
non_printables[i].classList.add("hidden");
|
||||||
|
}
|
||||||
|
document.getElementById('jaettu_lasku_nappi').classList.remove('hidden');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
document.getElementById('paiva').value = date.toISOString().substring(0,10);
|
document.getElementById('paiva').value = date.toISOString().substring(0,10);
|
||||||
@@ -375,8 +411,12 @@ function init() {
|
|||||||
if (i==4) document.getElementById('saaja').value = decodeURIComponent(vars[i]);
|
if (i==4) document.getElementById('saaja').value = decodeURIComponent(vars[i]);
|
||||||
if (i==5) document.getElementById('maksaja').value = decodeURIComponent(vars[i]);
|
if (i==5) document.getElementById('maksaja').value = decodeURIComponent(vars[i]);
|
||||||
if (i==6) document.getElementById('laskun_tiedot').value = decodeURIComponent(vars[i]);
|
if (i==6) document.getElementById('laskun_tiedot').value = decodeURIComponent(vars[i]);
|
||||||
|
if (i==7) {
|
||||||
|
if (vars[i] == "1") { state['jaettu'] = true; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
flash_generate();
|
flash_generate();
|
||||||
|
if (state['jaettu']) show_shared();
|
||||||
}
|
}
|
||||||
|
|
||||||
function reversed(str) {
|
function reversed(str) {
|
||||||
@@ -402,10 +442,11 @@ function reversed(str) {
|
|||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
<div id="barcodes">
|
<div id="barcodes">
|
||||||
|
<input id=jaettu_lasku_nappi class=hidden type="submit" onclick="lasku_pdf()" value="Tallenna lasku PDF"/>
|
||||||
<table id="lasku">
|
<table id="lasku">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class=col1>Saajan tilinumero</td><td class=col2 id="lasku_iban">[tilinro]</td><td colspan=3 rowspan=2><textarea class=kayttaja rows=10 id=laskun_tiedot placeholder="Laskun tiedot" onblur="print_help()" onkeyup="print_help()"></textarea><div class="print_help" id="print_laskun_tiedot"></div></td>
|
<td class=col1>Saajan tilinumero</td><td class="col2, arvo" id="lasku_iban">[tilinro]</td><td colspan=3 rowspan=2><textarea class=kayttaja rows=10 id=laskun_tiedot placeholder="Laskun tiedot" onblur="print_help()" onkeyup="print_help()"></textarea><div class="print_help" id="print_laskun_tiedot"></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -414,11 +455,11 @@ function reversed(str) {
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class=col1 rowspan=2>Maksaja</td><td class=col2 rowspan=2><textarea id=maksaja class=kayttaja rows=3 placeholder="Maksajan tiedot" onblur="print_help()" onkeyup="print_help()"></textarea><div class="print_help" id="print_maksaja"></div></td>
|
<td class=col1 rowspan=2>Maksaja</td><td class=col2 rowspan=2><textarea id=maksaja class=kayttaja rows=3 placeholder="Maksajan tiedot" onblur="print_help()" onkeyup="print_help()"></textarea><div class="print_help" id="print_maksaja"></div></td>
|
||||||
<td class=col3>Viite</td><td colspan=2 id="lasku_viite">[viite]</td>
|
<td class=col3>Viite</td><td colspan=2 id="lasku_viite" class="arvo">[viite]</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class=col3>Eräpäivä</td><td class=col4 id="lasku_paiva">[paiva]</td><td class=col5 id="lasku_summa">[summa]</td>
|
<td class=col3>Eräpäivä</td><td class="col4, arvo" id="lasku_paiva">[paiva]</td><td class="col5, arvo" id="lasku_summa">[summa]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=5 id=lasku_barcode><svg id="barcode"></svg></td>
|
<td colspan=5 id=lasku_barcode><svg id="barcode"></svg></td>
|
||||||
@@ -430,8 +471,9 @@ function reversed(str) {
|
|||||||
<br>
|
<br>
|
||||||
<div class="no-print">
|
<div class="no-print">
|
||||||
|
|
||||||
<input type="submit" onclick="lasku_pdf()" value="Tallenna lasku PDF"/>
|
<input type="submit" onclick="lasku_pdf()" value="Tallenna lasku PDF"/><br><br>
|
||||||
<br><br>
|
<label>Jaettava <a id="lasku_linkki" href="#"/>linkki</a></label><br>
|
||||||
|
<br>
|
||||||
<label>Virtuaaliviivakoodi:</label><br>
|
<label>Virtuaaliviivakoodi:</label><br>
|
||||||
<input id="virtuaali" size=54 /><br>
|
<input id="virtuaali" size=54 /><br>
|
||||||
<label> </label><span id="virtuaali_error" class="error" ></span><br>
|
<label> </label><span id="virtuaali_error" class="error" ></span><br>
|
||||||
|
|||||||
Reference in New Issue
Block a user