fix for #29168
r=sspitzer a=phil allow us to switch between nativePath and URLString when using the picker in prefs/account manager git-svn-id: svn://10.0.0.236/trunk@61820 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e64ecc0632
commit
1b216fafd4
@ -71,7 +71,7 @@
|
||||
<html:input name="identity.attachSignature" id="identity.attachSignature" type="checkbox"/>
|
||||
<html:label for="identity.attachSignature">&signature.label;</html:label>
|
||||
<html:input type="text" id="identity.signature" datatype="nsIFileSpec" flex="100%" name="identity.signature"/>
|
||||
<titledbutton class="dialog push" name="browse" type="button" value="&choose.label;" onclick="prefNavSelectFile('identity.signature', 'choosefile')"/>
|
||||
<titledbutton class="dialog push" name="browse" type="button" value="&choose.label;" onclick="prefNavSelectFile('identity.signature', 'choosefile', true)"/>
|
||||
</html:div>
|
||||
|
||||
<!--
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
value="&useCurrent;" onclick="setHomePageToCurrentPage('mailnews.start_page.url');" />
|
||||
|
||||
<titledbutton class="dialog push" name="browse" type="button"
|
||||
value="&browseFile;" onclick="prefNavSelectFile('mailnews.start_page.url', 'choosehomepage')"/>
|
||||
value="&browseFile;" onclick="prefNavSelectFile('mailnews.start_page.url', 'choosehomepage', false)"/>
|
||||
</box>
|
||||
|
||||
</titledbox>
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
<box orient="horizontal">
|
||||
<spring flex="1"/>
|
||||
<titledbutton class="dialog push" name="starts" type="button" value="&useCurrent;" onclick="setHomePageToCurrentPage('browserStartupHomepage');" />
|
||||
<titledbutton class="dialog push" name="browse" type="button" value="&browseFile;" onclick="prefNavSelectFile('browserStartupHomepage', 'choosehomepage');"/>
|
||||
<titledbutton class="dialog push" name="browse" type="button" value="&browseFile;" onclick="prefNavSelectFile('browserStartupHomepage', 'choosehomepage', false);"/>
|
||||
</box>
|
||||
</box>
|
||||
</titledbox>
|
||||
|
||||
@ -1,6 +1,29 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*/
|
||||
|
||||
var bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties");
|
||||
|
||||
function getFileOrFolderURL( aTitle, aFolder )
|
||||
function getFileOrFolderSpec( aTitle, aFolder )
|
||||
{
|
||||
try {
|
||||
var fileSpecWithUI = Components.classes["component://netscape/filespecwithui"].createInstance();
|
||||
@ -24,15 +47,19 @@ function getFileOrFolderURL( aTitle, aFolder )
|
||||
dump("Error: " + e + "\n");
|
||||
return -1;
|
||||
}
|
||||
return fileSpecWithUI.URLString;
|
||||
return fileSpecWithUI;
|
||||
}
|
||||
|
||||
function prefNavSelectFile(folderFieldId, stringId)
|
||||
function prefNavSelectFile(folderFieldId, stringId, useNative)
|
||||
{
|
||||
var folderField = document.getElementById(folderFieldId);
|
||||
var url = getFileOrFolderURL( bundle.GetStringFromName(stringId), false );
|
||||
if( url != -1 )
|
||||
folderField.value = url;
|
||||
var spec = getFileOrFolderSpec( bundle.GetStringFromName(stringId), false );
|
||||
if( spec != -1 ) {
|
||||
if (useNative)
|
||||
folderField.value = spec.nativePath;
|
||||
else
|
||||
folderField.value = spec.URLString;
|
||||
}
|
||||
}
|
||||
|
||||
function setHomePageToCurrentPage(folderFieldId)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user