mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Fix openLocation dialog
This commit is contained in:
parent
3c09a31379
commit
90840b6f9d
@ -332,7 +332,12 @@
|
||||
}
|
||||
}
|
||||
if ( core ) {
|
||||
core.ShowWindowWithArgs( "resource:/res/samples/openLocation.xul", window, appCoreName );
|
||||
//core.ShowWindowWithArgs( "resource:/res/samples/openLocation.xul", window, appCoreName );
|
||||
var name = appCoreName.replace( /\./, /\_/ );
|
||||
// Note: Use width/height one less than actual so resizing occurs.
|
||||
// This bypasses bug whereby dialog contents don't appear
|
||||
// till the dialog is resized.
|
||||
window.openDialog( "resource:/res/samples/openLocation.xul", name+"_openLocation", "chrome,width=419,height=189", appCoreName );
|
||||
} else {
|
||||
dump("Error; can't create toolkitCore\n");
|
||||
}
|
||||
|
@ -23,16 +23,12 @@ var browser;
|
||||
var dialog;
|
||||
|
||||
function onLoad() {
|
||||
}
|
||||
|
||||
function onLoadWithArgs() {
|
||||
dialog = new Object;
|
||||
dialog.input = document.getElementById( "dialog.input" );
|
||||
dialog.ok = document.getElementById( "dialog.ok" );
|
||||
dialog.cancel = document.getElementById( "dialog.cancel" );
|
||||
dialog.help = document.getElementById( "dialog.help" );
|
||||
dialog.ok = document.getElementById( "dialog.ok" );
|
||||
dialog.cancel = document.getElementById( "dialog.cancel" );
|
||||
dialog.help = document.getElementById( "dialog.help" );
|
||||
dialog.newWindow = document.getElementById( "dialog.newWindow" );
|
||||
dialog.args = document.getElementById( "args" );
|
||||
|
||||
toolkit = XPAppCoresManager.Find( "toolkitCore" );
|
||||
if ( !toolkit ) {
|
||||
@ -40,10 +36,10 @@ function onLoadWithArgs() {
|
||||
toolkit.Init( "toolkitCore" );
|
||||
}
|
||||
|
||||
browser = XPAppCoresManager.Find( dialog.args.getAttribute( "value" ) );
|
||||
browser = XPAppCoresManager.Find( window.arguments[0] );
|
||||
if ( !browser ) {
|
||||
dump( "unable to get browser app core\n" );
|
||||
//toolkit.CloseWindow( window );
|
||||
toolkit.CloseWindow( window );
|
||||
}
|
||||
|
||||
/* Give input field the focus. */
|
||||
@ -89,25 +85,22 @@ function open() {
|
||||
}
|
||||
|
||||
/* Close dialog. */
|
||||
//toolkit.CloseWindow( window );
|
||||
toolkit.CloseWindow( window );
|
||||
}
|
||||
|
||||
function choose() {
|
||||
/* Use existing browser "open" logic. */
|
||||
browser.openWindow();
|
||||
//toolkit.CloseWindow( window );
|
||||
toolkit.CloseWindow( window );
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
if ( dialog.cancel.disabled ) {
|
||||
return;
|
||||
}
|
||||
//toolkit.CloseWindow( window );
|
||||
toolkit.CloseWindow( window );
|
||||
}
|
||||
|
||||
function help() {
|
||||
if ( dialog.help.disabled ) {
|
||||
return;
|
||||
}
|
||||
dump( "openLocation::help() not implemented\n" );
|
||||
if ( dialog.help.disabled ) {
|
||||
return;
|
||||
}
|
||||
dump( "openLocation::help() not implemented\n" );
|
||||
}
|
||||
|
@ -13,12 +13,6 @@
|
||||
<html:script language="javascript" src="openLocation.js">
|
||||
</html:script>
|
||||
|
||||
<broadcaster id="args" value=""/>
|
||||
|
||||
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
|
||||
<broadcaster id="dialog.start" ready="false"/>
|
||||
<observes element="dialog.start" attribute="ready" onchange="onLoadWithArgs()"/>
|
||||
|
||||
<!--
|
||||
<box align="vertical">
|
||||
<box align="horizontal">
|
||||
@ -83,7 +77,7 @@
|
||||
<html:button id="dialog.ok" onclick="open()" disabled="">Open</html:button>
|
||||
</html:td>
|
||||
<html:td width="70">
|
||||
<html:button id="dialog.cancel" onclick="cancel()" disabled="">Cancel</html:button>
|
||||
<html:button id="dialog.cancel" onclick="cancel()">Cancel</html:button>
|
||||
</html:td>
|
||||
<html:td width="70">
|
||||
<html:button id="dialog.help" onclick="help()" disabled="">Help</html:button>
|
||||
|
Loading…
Reference in New Issue
Block a user