Clean up whitespace/returns/braces, plus Ben's update to GetFields.

This commit is contained in:
brendan%mozilla.org 1999-11-28 06:37:13 +00:00
Родитель f2a5a70e3a
Коммит 869d5f55c0
5 изменённых файлов: 392 добавлений и 413 удалений

Просмотреть файл

@ -1,4 +1,5 @@
/*
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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
@ -151,8 +152,7 @@ function onBack()
function displayPage(content)
{
if (content != "")
{
if (content != "") {
var contentFrame = document.getElementById("content");
if (contentFrame)
contentFrame.setAttribute("src", content);
@ -226,13 +226,9 @@ function onFinish(opener)
ExitApp();
}
}
else {
return;
}
}
catch (ex) {
alert("Failed to create a profile.");
return;
}
}
@ -261,13 +257,12 @@ function processCreateProfileData()
}
profile.createNewProfile(profName, profDir);
profile.startApprunner(profName);
return true;
}
catch (ex) {
alert("Failed to create a profile.");
return false;
}
return false;
return true;
}
function ExitApp()

Просмотреть файл

@ -1,4 +1,5 @@
/*
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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

Просмотреть файл

@ -1,4 +1,5 @@
/*
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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
@ -56,15 +57,7 @@ function GetFields()
{
var profName = document.getElementById("ProfileName").value;
var profDir = document.getElementById("ProfileDir");
var profDirContent;
for(var i = 0; i < profDir.attributes.length; i++)
{
// this is just an awful, bad, terrible hack. I shouldn't have to do this
// to get the value. but all other ways return "undefined".
if(profDir.attributes[i].nodeName == "value")
profDirContent = profDir.attributes[i].nodeValue;
}
var profDirContent = profDir.getAttribute("value");
return [["ProfileName",profName],["ProfileDir",profDirContent]];
}
@ -89,18 +82,16 @@ function chooseFolder(string)
if (fileSpec) {
fileSpec = fileSpec.QueryInterface(Components.interfaces.nsIFileSpecWithUI);
return fileSpec.chooseDirectory(string);
} else
return false;
} catch(e) {
return false;
}
} catch(e) {
}
return false;
}
function removeChildren(which)
{
if (which.hasChildNodes()) {
for(var i = 0; i < which.childNodes.length; i++)
{
for (var i = 0; i < which.childNodes.length; i++) {
which.removeChild(which.lastChild);
}
}

Просмотреть файл

@ -1,4 +1,5 @@
/*
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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
@ -42,8 +43,7 @@ function RenameProfile(w)
if (renameButton.getAttribute("disabled") == "true") {
return;
}
if (!selected)
{
if (!selected) {
alert("Select a profile to rename.");
return;
}
@ -52,8 +52,7 @@ function RenameProfile(w)
var oldName = selected.getAttribute("rowName");
var migrate = selected.getAttribute("rowMigrate");
if (migrate == "true")
{
if (migrate == "true") {
alert("Migrate this profile before renaming it.");
return;
}
@ -75,8 +74,7 @@ function DeleteProfile(deleteFiles)
if (deleteButton.getAttribute("disabled") == "true") {
return;
}
if (!selected)
{
if (!selected) {
alert("Select a profile to delete.");
return;
}
@ -103,8 +101,7 @@ function onStart()
if (startButton.getAttribute("disabled") == "true") {
return;
}
if (!selected)
{
if (!selected) {
alert("Select a profile to start.");
return;
}
@ -112,8 +109,7 @@ function onStart()
var migrate = selected.getAttribute("rowMigrate");
var name = selected.getAttribute("rowName");
if (migrate == "true")
{
if (migrate == "true") {
// pass true for show progress as modal window
profile.migrateProfile(name, true);
}
@ -231,8 +227,7 @@ function loadElements()
}
}
for (var i=0; i < profileList.length; i++)
{
for (var i=0; i < profileList.length; i++) {
var pvals = profileList[i].split(" - ");
addTreeItem(i, pvals[0], (pvals[1] == "migrate"));
}
@ -247,14 +242,13 @@ function openRename()
if (!selected) {
alert("Select a profile to rename.");
}
else
{
else {
var migrate = selected.getAttribute("rowMigrate");
if (migrate == "true") {
alert("Migrate the profile before renaming it.");
}
else
var win = window.openDialog('chrome://profile/content/renameProfile.xul', 'Renamer', 'chrome');
window.openDialog('chrome://profile/content/renameProfile.xul', 'Renamer', 'chrome');
}
}
@ -265,8 +259,7 @@ function ConfirmDelete()
if (deleteButton.getAttribute("disabled") == "true") {
return;
}
if (!selected)
{
if (!selected) {
alert("Select a profile to delete.");
return;
}
@ -274,8 +267,7 @@ function ConfirmDelete()
var migrate = selected.getAttribute("rowMigrate");
var name = selected.getAttribute("rowName");
if (migrate == "true")
{
if (migrate == "true") {
alert("Migrate this profile before deleting it.");
return;
}

Просмотреть файл

@ -1,4 +1,5 @@
/*
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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
@ -74,8 +75,7 @@ function loadElements()
currProfile = profileList;
}
for (var i = 0; i < profileList.length; i++)
{
for (var i = 0; i < profileList.length; i++) {
var pvals = profileList[i].split(" - ");
// only add profiles that have been migrated
if (pvals[1] != "migrate") {