mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
Bug 226955: Conversion from <window class="dialog"> to <dialog>.
r=neil, sr=alecf, a=chofmann
This commit is contained in:
parent
cca3ebfb5e
commit
7f4eae8402
@ -22,6 +22,7 @@
|
|||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Gervase Markham <gerv@gerv.net>
|
* Gervase Markham <gerv@gerv.net>
|
||||||
* Tuukka Tolvanen <tt@lament.cjb.net>
|
* Tuukka Tolvanen <tt@lament.cjb.net>
|
||||||
|
* Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||||
@ -569,7 +570,7 @@ function changeScreenResolution()
|
|||||||
if (screenResolution.value == "other")
|
if (screenResolution.value == "other")
|
||||||
{
|
{
|
||||||
// If the user selects "Other..." we bring up the calibrate screen dialog
|
// If the user selects "Other..." we bring up the calibrate screen dialog
|
||||||
var rv = { newdpi : 0 };
|
var rv = { newdpi : -1 };
|
||||||
var calscreen = window.openDialog("chrome://communicator/content/pref/pref-calibrate-screen.xul",
|
var calscreen = window.openDialog("chrome://communicator/content/pref/pref-calibrate-screen.xul",
|
||||||
"_blank",
|
"_blank",
|
||||||
"modal,chrome,centerscreen,resizable=no,titlebar",
|
"modal,chrome,centerscreen,resizable=no,titlebar",
|
||||||
@ -627,32 +628,19 @@ function setResolution( resolution )
|
|||||||
|
|
||||||
// "Calibrate screen" dialog code
|
// "Calibrate screen" dialog code
|
||||||
|
|
||||||
function Init()
|
|
||||||
{
|
|
||||||
sizeToContent();
|
|
||||||
doSetOKCancel(onOK, onCancel);
|
|
||||||
document.getElementById("horizSize").focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onOK()
|
function onOK()
|
||||||
{
|
{
|
||||||
// Get value from the dialog to work out dpi
|
// Get value from the dialog to work out dpi
|
||||||
var horizSize = parseFloat(document.getElementById("horizSize").value);
|
var horizSize = parseFloat(document.getElementById("horizSize").value);
|
||||||
var units = document.getElementById("units").value;
|
|
||||||
|
|
||||||
if (!horizSize || horizSize < 0)
|
|
||||||
{
|
|
||||||
// We can't calculate anything without a proper value
|
// We can't calculate anything without a proper value
|
||||||
window.arguments[0].newdpi = -1;
|
if (!horizSize || horizSize < 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
// Convert centimetres to inches.
|
// Convert centimetres to inches.
|
||||||
// The magic number is allowed because it's a fundamental constant :-)
|
// The magic number is allowed because it's a fundamental constant :-)
|
||||||
if (units === "centimetres")
|
if (document.getElementById("units").value === "centimetres")
|
||||||
{
|
|
||||||
horizSize /= 2.54;
|
horizSize /= 2.54;
|
||||||
}
|
|
||||||
|
|
||||||
// These shouldn't change, but you can't be too careful.
|
// These shouldn't change, but you can't be too careful.
|
||||||
var horizBarLengthPx = document.getElementById("horizRuler").boxObject.width;
|
var horizBarLengthPx = document.getElementById("horizRuler").boxObject.width;
|
||||||
@ -665,13 +653,6 @@ function onOK()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCancel()
|
|
||||||
{
|
|
||||||
// We return -1 to show that no value has been given.
|
|
||||||
window.arguments[0].newdpi = -1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// disable font items, but not the browserUseDocumentFonts checkbox nor the resolution
|
// disable font items, but not the browserUseDocumentFonts checkbox nor the resolution
|
||||||
// menulist
|
// menulist
|
||||||
function disableAllFontElements()
|
function disableAllFontElements()
|
||||||
|
Loading…
Reference in New Issue
Block a user