diff --git a/mozilla/cmd/dialup/as_html/connect2.js b/mozilla/cmd/dialup/as_html/connect2.js index a9350ce873b..fd360c55ada 100644 --- a/mozilla/cmd/dialup/as_html/connect2.js +++ b/mozilla/cmd/dialup/as_html/connect2.js @@ -332,12 +332,10 @@ function configureDialer() var thePlatform = parent.parent.globals.getPlatform(); var configFile=""; - if (thePlatform == "Macintosh") { // Macintosh support + if ( thePlatform == "Macintosh" ) // Macintosh support configFile = profileDir + "Configuration"; - } - else { // Windows support + else // Windows support configFile = profileDir + "CONFIG.INI"; - } parent.parent.globals.document.setupPlugin.SetNameValuePair(configFile,"Account", "Account", newProfileName); // parent.parent.globals.document.vars.providername.value); parent.parent.globals.document.setupPlugin.SetNameValuePair(configFile,"Modem", "Modem", parent.parent.globals.document.vars.modem.value); @@ -345,23 +343,20 @@ function configureDialer() // write out default Bookmark file (if one doesn't exist yet) - var currentBookmarkFilename=""; - if (thePlatform == "Macintosh") { // Macintosh support + if ( thePlatform == "Macintosh" ) // Macintosh support currentBookmarkFilename = profileDir + "Bookmarks.html"; - } - else { // Windows support + else // Windows support currentBookmarkFilename = profileDir + "BOOKMARK.HTM"; - } - var bookmarkData = parent.parent.globals.document.setupPlugin.GetNameValuePair(currentBookmarkFilename,null,null); - if ((bookmarkData == null) || (bookmarkData == "") || (bookmarkData.indexOf("HREF")<0)) { - var defaultBookmarkFilename = parent.parent.globals.getConfigFolder(self) + "bookmark.htm"; - bookmarkData = parent.parent.globals.document.setupPlugin.GetNameValuePair(defaultBookmarkFilename,null,null); - if (bookmarkData != null && bookmarkData != "") { - parent.parent.globals.document.setupPlugin.SaveTextToFile(currentBookmarkFilename,bookmarkData,false); - } - } + var bookmarkData = parent.parent.globals.document.setupPlugin.GetFileContents( currentBookmarkFilename ); + if ( ( bookmarkData == null ) || ( bookmarkData == "" ) || ( bookmarkData.indexOf( "HREF" ) < 0 ) ) + { + var defaultBookmarkFilename = parent.parent.globals.getConfigFolder( self ) + "bookmark.htm"; + bookmarkData = parent.parent.globals.document.setupPlugin.GetFileContents( defaultBookmarkFilename ); + if ( bookmarkData != null && bookmarkData != "" ) + parent.parent.globals.document.setupPlugin.SaveTextToFile( currentBookmarkFilename, bookmarkData, false ); + } // copy profile lock file (if one is specified in selected .NCI file) diff --git a/mozilla/cmd/dialup/as_html/globals.htm b/mozilla/cmd/dialup/as_html/globals.htm index 363dae5fe4e..3039bf4ac4e 100644 --- a/mozilla/cmd/dialup/as_html/globals.htm +++ b/mozilla/cmd/dialup/as_html/globals.htm @@ -18,9 +18,11 @@
- - + diff --git a/mozilla/cmd/dialup/as_html/globals1.js b/mozilla/cmd/dialup/as_html/globals1.js index 08fe7dcc415..8b8eba1714b 100644 --- a/mozilla/cmd/dialup/as_html/globals1.js +++ b/mozilla/cmd/dialup/as_html/globals1.js @@ -28,157 +28,6 @@ parent.ondblclick = cancelEvent; var oneStepSemaphore = false; var selectedISP = null; -function cancelEvent( e ) -{ - var retVal = false; - - if ( ( e.which < 2 ) && ( e.type != "dragdrop" ) && ( e.type != "dblclick" ) ) - retVal = routeEvent( e ); - - return retVal; -} - -function debug( theString ) -{ - java.lang.System.out.println( theString ); -} - -function GetNameValuePair( file, section, variable ) -{ - netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); - - var value = parent.globals.document.setupPlugin.GetNameValuePair( file, section, variable ); - if ( value == null ) - value = ""; - return value; -} - -function SetNameValuePair( file, section, variable, data ) -{ - netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); - - parent.globals.document.setupPlugin.SetNameValuePair( file, section, variable, data ); - //debug( "\tSetNameValuePair: [" + section + "] " + variable + "=" + data ); -} - - -// * returns a string representing the path to the folder named "Config" inside the folder "Data" that -// is installed in the Communicator's home directory -function getConfigFolder( object ) -{ - var pathName; - pathName = getFolder( object ) + "Config" + "\\"; - - //debug( "getConfigFolder: " + pathName ); - - return pathName; -} - -// * returns a string representing the path to the file "ACCTSET.INI" inside the folder -// returned from getConfigFolder -function getAcctSetupFilename( object ) -{ - var file; - file = getConfigFolder( object ) + "ACCTSET.INI"; - - //debug( "getAcctSetupFilename: " + file ); - return file; -} - -function getPlatform() -{ - var platform = new String( navigator.userAgent ); - var x = platform.indexOf( "(" ) + 1; - var y = platform.indexOf( ";", x + 1 ); - platform = platform.substring( x, y ); - return platform; -} - -function getBrowserVersionNumber() -{ - var theAgent = navigator.userAgent; - var x = theAgent.indexOf( "/" ); - var theVersion = "unknown"; - if ( x >= 0 ) - var theVersion = theAgent.substring( x + 1, theAgent.length ); - return theVersion; -} - -function getBrowserMajorVersionNumber() -{ - var version = getBrowserVersionNumber(); - if ( version != "unknown" ) - { - var x = theVersion.indexOf( "." ); - if ( x > 0 ) - version = version.substring( 0, x ); - } - return version; -} - -// * returns a canoncial path to the folder containing the document representing the current contents of "window" -function getFolder( window ) -{ - platform = getPlatform(); - - if ( platform == "Macintosh" ) - { // Macintosh support - var path = unescape( window.location.pathname ); - if ( ( x = path.lastIndexOf( "/" ) ) > 0 ) - path = path.substring( 0, x + 1 ); - - //var fileArray = path.split( "/" ); - //var newpath = fileArray.join( ":" ) + ":"; - - //if ( newpath.charAt( 0 ) == ':' ) - // newpath = newpath.substring( 1, newpath.length ); - - newpath = path; - } - else - { // Windows support - - // note: JavaScript returns path with '/' instead of '\' - var path = unescape( window.location.pathname ); - - var drive = "|"; - - // gets the drive letter and directory path - if ( ( x = path.lastIndexOf( "|" ) ) > 0 ) - { - drive = path.substring( path.indexOf( '/' ) + 1, path.indexOf( '|' ) ); - path = path.substring( path.indexOf( '|' ) + 1, path.lastIndexOf( '/' ) + 1 ); - } - - var pathArray = path.split( "/" ); - path = pathArray.join( "\\" ); - - //debug( "drive: " + drive + " path: " + path ); - - // construct newpath - newpath = drive + ":" + path + "\\"; - debug( "path: " + newpath ); - } - return newpath; -} - -function setFocus( theObject ) -{ - theObject.focus(); - theObject.select(); -} - -function message( txt ) -{ - window.status = txt; - setTimeout( "remove_message()", 10000 ); -} - -function remove_message() -{ - window.status = ""; -} - function getSelectedISPName() { netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); @@ -188,46 +37,6 @@ function getSelectedISPName() return ispDisplayName; } -function checkPluginExists( name, generateOutputFlag ) -{ - /* - var myPlugin = navigator.plugins["name"]; - if (myPlugin) { - // do something here - } - else { - document.writeln("\n" ); - document.writeln( "Please install the plugin, then run 'Account Setup' again.
\n" ); - document.writeln( "Choose Options | Network Preferences and enable Java, then try again.