MediaWiki:Common.js: Unterschied zwischen den Versionen
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 26: | Zeile 26: | ||
'<br />' + | '<br />' + | ||
'<button type="button" onclick="scopCalculator()">Berechnen</button>' + | '<button type="button" onclick="scopCalculator()">Berechnen</button>' + | ||
'<p><a id="scop">0</a></p>'; | |||
} | |||
}); | |||
function scop55Calculator() { | |||
var copa, copb, copc, scop; | |||
const f1 = 0.0054; | |||
const f2 = 0.658; | |||
const f3 = 0.396; | |||
copa = document.getElementById('copa-7w35').value; | |||
copb = document.getElementById('copa2w35').value; | |||
copc = document.getElementById('copa7w35').value; | |||
scop = 1.00000 / ( (f1 / copa) + (f2 / copb) + (f3 / copc ) ); | |||
document.getElementById('scop').innerHTML = scop.toFixed(3); | |||
} | |||
$(function () { | |||
if ($('#scop55-wrapper').length) { | |||
document.getElementById('scop55-wrapper').innerHTML = | |||
'<p>COP-Wert A-7/W35:</p>' + | |||
'<input id="copa-7w35" type="number" style="width: 130px">' + | |||
'<p>COP-Wert A2/W35:</p>' + | |||
'<input id="copa2w35" type="number" style="width: 130px">' + | |||
'<p>COP-Wert A7/W35:</p>' + | |||
'<input id="copa7w35" type="number" style="width: 130px">' + | |||
'<br />' + | |||
'<button type="button" onclick="scop55Calculator()">Berechnen</button>' + | |||
'<p><a id="scop">0</a></p>'; | '<p><a id="scop">0</a></p>'; | ||
} | } | ||
}); | }); |
Version vom 16. April 2024, 19:00 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
function scopCalculator() {
var copa, copb, copc, scop;
const f1 = 0.0380;
const f2 = 0.5250;
const f3 = 0.3400;
copa = document.getElementById('copa-7w35').value;
copb = document.getElementById('copa2w35').value;
copc = document.getElementById('copa7w35').value;
scop = 1.00000 / ( (f1 / copa) + (f2 / copb) + (f3 / copc ) );
document.getElementById('scop').innerHTML = scop.toFixed(3);
}
$(function () {
if ($('#scop-wrapper').length) {
document.getElementById('scop-wrapper').innerHTML =
'<p>COP-Wert A-7/W35:</p>' +
'<input id="copa-7w35" type="number" style="width: 130px">' +
'<p>COP-Wert A2/W35:</p>' +
'<input id="copa2w35" type="number" style="width: 130px">' +
'<p>COP-Wert A7/W35:</p>' +
'<input id="copa7w35" type="number" style="width: 130px">' +
'<br />' +
'<button type="button" onclick="scopCalculator()">Berechnen</button>' +
'<p><a id="scop">0</a></p>';
}
});
function scop55Calculator() {
var copa, copb, copc, scop;
const f1 = 0.0054;
const f2 = 0.658;
const f3 = 0.396;
copa = document.getElementById('copa-7w35').value;
copb = document.getElementById('copa2w35').value;
copc = document.getElementById('copa7w35').value;
scop = 1.00000 / ( (f1 / copa) + (f2 / copb) + (f3 / copc ) );
document.getElementById('scop').innerHTML = scop.toFixed(3);
}
$(function () {
if ($('#scop55-wrapper').length) {
document.getElementById('scop55-wrapper').innerHTML =
'<p>COP-Wert A-7/W35:</p>' +
'<input id="copa-7w35" type="number" style="width: 130px">' +
'<p>COP-Wert A2/W35:</p>' +
'<input id="copa2w35" type="number" style="width: 130px">' +
'<p>COP-Wert A7/W35:</p>' +
'<input id="copa7w35" type="number" style="width: 130px">' +
'<br />' +
'<button type="button" onclick="scop55Calculator()">Berechnen</button>' +
'<p><a id="scop">0</a></p>';
}
});