Revert "remove estimated ram use stuff as it is no longer possible"
This reverts commit 2e675a338b
.
This commit is contained in:
parent
f4bbacb3f4
commit
0adc2d96d6
|
@ -48,6 +48,7 @@ function updateMonitorDimensions(element) {
|
|||
form.elements['newMonitor[Height]'].value = dimensions[1];
|
||||
}
|
||||
}
|
||||
update_estimated_ram_use();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -139,6 +140,9 @@ function initPage() {
|
|||
form.submit();
|
||||
};
|
||||
});
|
||||
document.querySelectorAll('input[name="newMonitor[ImageBufferCount]"],input[name="newMonitor[Width]"],input[name="newMonitor[Height]"]').forEach(function(el) {
|
||||
el.oninput = window['update_estimated_ram_use'].bind(el);
|
||||
});
|
||||
|
||||
document.querySelectorAll('select[name="newMonitor[Function]"]').forEach(function(el) {
|
||||
el.onchange = function() {
|
||||
|
@ -306,6 +310,15 @@ function random_WebColour() {
|
|||
);
|
||||
}
|
||||
|
||||
function update_estimated_ram_use() {
|
||||
var buffer_count = document.querySelectorAll('input[name="newMonitor[ImageBufferCount]"]')[0].value;
|
||||
var width = document.querySelectorAll('input[name="newMonitor[Width]"]')[0].value;
|
||||
var height = document.querySelectorAll('input[name="newMonitor[Height]"]')[0].value;
|
||||
var colours = document.querySelectorAll('select[name="newMonitor[Colours]"]')[0].value;
|
||||
|
||||
document.getElementById('estimated_ram_use').innerHTML = human_filesize(buffer_count * width * height * colours, 0);
|
||||
}
|
||||
|
||||
function updateLatitudeAndLongitude(latitude, longitude) {
|
||||
var form = document.getElementById('contentForm');
|
||||
form.elements['newMonitor[Latitude]'].value = latitude;
|
||||
|
|
Loading…
Reference in New Issue