1 // Initializes the resize dialog
2 function webdeveloper_initializeResize()
4 var resizeViewport
= webdeveloper_getBooleanPreference("webdeveloper.resize.viewport", true);
6 document
.getElementById("webdeveloper-resize-viewport").checked
= resizeViewport
;
8 // If resizing the viewport
11 document
.getElementById("webdeveloper-resize-width").value
= window
.arguments
[2];
12 document
.getElementById("webdeveloper-resize-height").value
= window
.arguments
[3];
16 document
.getElementById("webdeveloper-resize-width").value
= window
.arguments
[0];
17 document
.getElementById("webdeveloper-resize-height").value
= window
.arguments
[1];
21 // Resizes the parent window to the given width and height
22 function webdeveloper_resizeParentWindow()
24 var height
= document
.getElementById("webdeveloper-resize-height").value
.trim();
25 var width
= document
.getElementById("webdeveloper-resize-width").value
.trim();
27 // If the width and height are valid
28 if(width
&& height
&& (width
== "*" || (parseInt(width
) == width
&& width
> 0)) && (height
== "*" || (parseInt(height
) == height
&& height
> 0)))
30 var contentWindow
= window
.opener
.content
;
31 var windowX
= window
.opener
.screenX
;
32 var windowY
= window
.opener
.screenY
;
34 // If resizing the view port
35 if(document
.getElementById("webdeveloper-resize-viewport").checked
)
37 webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.resize.viewport", true);
39 // If the width is not a wildcard
42 contentWindow
.innerWidth
= width
;
45 // If the height is not a wildcard
48 contentWindow
.innerHeight
= height
;
53 // If the resize viewport preference is set
54 if(webdeveloper_isPreferenceSet("webdeveloper.resize.viewport"))
56 webdeveloper_deletePreference("webdeveloper.resize.viewport");
59 // If the width is a wildcard
62 width
= contentWindow
.outerWidth
;
65 // If the height is a wildcard
68 height
= contentWindow
.outerHeight
;
71 window
.opener
.resizeTo(width
, height
);
74 window
.opener
.screenX
= windowX
;
75 window
.opener
.screenY
= windowY
;