rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if (addInterface.BeginImport( success, error)) {
if (addInterface.BeginImport( success, error, selLocIsHome)) {
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
importType = importTypeRadioGroup.selectedItem.getAttribute("data"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText',
importType = importTypeRadioGroup.selectedItem.getAttribute("value"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText',
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var importTypeRadioGroup = document.getElementById("importFields"); importType = importTypeRadioGroup.selectedItem.getAttribute("data"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(gImportMsgsBundle.getString('ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(gImportMsgsBundle.getFormattedString('ImportSettingsSuccess', [ name ]), null); break; } } } return true;}
progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText);
progressStatusEl.setAttribute("label", ""); progressTitleEl.setAttribute("label", meterText);
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var importTypeRadioGroup = document.getElementById("importFields"); importType = importTypeRadioGroup.selectedItem.getAttribute("data"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(gImportMsgsBundle.getString('ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(gImportMsgsBundle.getFormattedString('ImportSettingsSuccess', [ name ]), null); break; } } } return true;}
return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break;
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var importTypeRadioGroup = document.getElementById("importFields"); importType = importTypeRadioGroup.selectedItem.getAttribute("data"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(gImportMsgsBundle.getString('ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(gImportMsgsBundle.getFormattedString('ImportSettingsSuccess', [ name ]), null); break; } } } return true;}
case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value)
return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value)
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var importTypeRadioGroup = document.getElementById("importFields"); importType = importTypeRadioGroup.selectedItem.getAttribute("data"); var index = tree.selectedItems[0].getAttribute('list-index'); var module = importService.GetModule(importType, index); var name = importService.GetModuleName(importType, index); selectedModuleName = name; if (module) { var meterText = ""; switch(importType) { case "mail": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText', [ name ]); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(gImportMsgsBundle.getString('ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(gImportMsgsBundle.getFormattedString('ImportSettingsSuccess', [ name ]), null); break; } } } return true;}
var meterText = GetBundleString( 'MailProgressMeterText') + " " + name;
var meterText = GetFormattedBundleString( 'MailProgressMeterText', name);
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetBundleString( 'MailProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'AddrProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetBundleString( 'ImportSettingsSuccess') + name); } break; } } } return true;}
var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name;
var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle');
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetBundleString( 'MailProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'AddrProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetBundleString( 'ImportSettingsSuccess') + name); } break; } } } return true;}
{windowTitle: GetBundleString( 'AddrProgressTitle'),
{windowTitle: titleText,
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetBundleString( 'MailProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'AddrProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetBundleString( 'ImportSettingsSuccess') + name); } break; } } } return true;}
alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value);
alert( GetBundleString( 'ImportSettingsFailed'));
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetBundleString( 'MailProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'AddrProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetBundleString( 'ImportSettingsSuccess') + name); } break; } } } return true;}
alert( GetBundleString( 'ImportSettingsSuccess') + name);
alert( GetFormattedBundleString( 'ImportSettingsSuccess', name));
function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetBundleString( 'MailProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetBundleString( 'AddrProgressMeterText') + " " + name; // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'AddrProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsError') + name + ":\n" + error.value); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetBundleString( 'ImportSettingsSuccess') + name); } break; } } } return true;}
CIRCDCCChat.prototype.__defineGetter__(method, import_wrapper);
function importFromFrame(method){ client.__defineGetter__(method, import_wrapper); CIRCNetwork.prototype.__defineGetter__(method, import_wrapper); CIRCChannel.prototype.__defineGetter__(method, import_wrapper); CIRCUser.prototype.__defineGetter__(method, import_wrapper); function import_wrapper() { var dummy = function(){}; if (!("frame" in this)) return dummy; try { var window = getContentWindow(this.frame) if (window && "initialized" in window && window.initialized && method in window) { return window[method]; } } catch (ex) { ASSERT(0, "Caught exception calling: " + method + "\n" + ex); } return dummy; };}
if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false;
if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); }
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;}
var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } }
top.progressInfo.importSuccess = false;
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;}
if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; return true; } else return false; } else
var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; return true; } else return false; } else
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;}
filePicker.chooseDirectory( "Select mail directory");
filePicker.chooseDirectory( GetBundleString( 'ImportSelectMailDir'));
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = GetBundleString( 'ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFileSpecWithUI); if (filePicker != null) { try { filePicker.chooseDirectory( "Select mail directory"); mailInterface.SetData( "mailLocation", CreateNewFileSpec( filePicker.QueryInterface( Components.interfaces.nsIFileSpec))); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { dump( "*** WantsProgress returned false\n"); if (mailInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
if (mailInterface.BeginImport( success, error)) {
if (mailInterface.BeginImport( success, error, false)) {
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;}
return mailInterface.BeginImport( success, error) ? true : false;
return mailInterface.BeginImport( success, error, false) ? true : false;
function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = gImportMsgsBundle.getString('ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;}
var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = gImportMsgsBundle.getString('ImportSettingsBadModule'); return( false); } var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { if (location.value != null) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { var file = null; try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = CreateNewFileSpecFromPath( filePicker.file.path); else file = null; } catch(ex) { file = null; error.value = null; return( false); } if (file != null) { setIntf.SetLocation( file); } else { error.value = null; return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } }
var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = gImportMsgsBundle.getString('ImportSettingsBadModule'); return( false); }
function ImportSettings( module, newAccount, error) { var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = gImportMsgsBundle.getString('ImportSettingsBadModule'); return( false); } // determine if we can auto find the settings or if we need to ask the user var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { // In this case, we couldn't not find the settings if (location.value != null) { // Settings were not found, however, they are specified // in a file, so ask the user for the settings file. var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { var file = null; try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = CreateNewFileSpecFromPath( filePicker.file.path); else file = null; } catch(ex) { file = null; error.value = null; return( false); } if (file != null) { setIntf.SetLocation( file); } else { error.value = null; return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } // interesting, we need to return the account that new // mail should be imported into? // that's really only useful for "Upgrade" result = setIntf.Import( newAccount); if (result == false) { error.value = gImportMsgsBundle.getString('ImportSettingsFailed'); } return( result);}
result = setIntf.Import( newAccount); if (result == false) { error.value = gImportMsgsBundle.getString('ImportSettingsFailed'); } return( result);
var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { if (location.value != null) { var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { var file = null; try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = CreateNewFileSpecFromPath( filePicker.file.path); else file = null; } catch(ex) { file = null; error.value = null; return( false); } if (file != null) { setIntf.SetLocation( file); } else { error.value = null; return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } result = setIntf.Import( newAccount); if (result == false) { error.value = gImportMsgsBundle.getString('ImportSettingsFailed'); } return( result);
function ImportSettings( module, newAccount, error) { var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = gImportMsgsBundle.getString('ImportSettingsBadModule'); return( false); } // determine if we can auto find the settings or if we need to ask the user var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { // In this case, we couldn't not find the settings if (location.value != null) { // Settings were not found, however, they are specified // in a file, so ask the user for the settings file. var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { var file = null; try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = CreateNewFileSpecFromPath( filePicker.file.path); else file = null; } catch(ex) { file = null; error.value = null; return( false); } if (file != null) { setIntf.SetLocation( file); } else { error.value = null; return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } else { error.value = gImportMsgsBundle.getString('ImportSettingsNotFound'); return( false); } } // interesting, we need to return the account that new // mail should be imported into? // that's really only useful for "Upgrade" result = setIntf.Import( newAccount); if (result == false) { error.value = gImportMsgsBundle.getString('ImportSettingsFailed'); } return( result);}
filePicker.chooseInputFile( "Select settings file", filePicker.eAllFiles, null, null);
filePicker.chooseInputFile( GetBundleString( 'ImportSelectSettings'), filePicker.eAllFiles, null, null);
function ImportSettings( module, newAccount, error) { var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = GetBundleString( 'ImportSettingsBadModule'); return( false); } // determine if we can auto find the settings or if we need to ask the user var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { // In this case, we couldn't not find the settings if (location.value != null) { // Settings were not found, however, they are specified // in a file, so ask the user for the settings file. var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFileSpecWithUI); if (filePicker != null) { // filePicker.create( window.top, "Select settings file", filePicker.modeLoad); try { filePicker.chooseInputFile( "Select settings file", filePicker.eAllFiles, null, null); setIntf.SetLocation( filePicker.QueryInterface( Components.interfaces.nsIFileSpec)); } catch( ex) { error.value = null; return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } // interesting, we need to return the account that new // mail should be imported into? // that's really only useful for "Upgrade" var result = setIntf.Import( newAccount); if (result == false) { error.value = GetBundleString( 'ImportSettingsFailed'); } return( result);}
BrowserViewDownload();
BrowserViewDownload(true);
init: function (aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable) { // document.getElementById("statusbar").hidden=false; BrowserViewDownload(); document.getElementById("toolbar-download-tag").cachedCancelable=aCancelable; },
document.getElementById("download-button-stop").disabled=false;
init: function (aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable) { // document.getElementById("statusbar").hidden=false; BrowserViewDownload(); document.getElementById("toolbar-download-tag").cachedCancelable=aCancelable; },
oURL = createInstance('component:
var oURL = createInstance('component:
init: function(serverURL) { oURL = createInstance('component://netscape/network/standard-url', 'nsIURL'); oURL.spec = serverURL; // Make sure it is a complete spec // Note that we don't care what the scheme is otherwise. // Should we care? POST works only on http and https.. if (!oURL.scheme) oURL.scheme = 'http'; if (oURL.scheme != 'http') throw Components.Exceptions('Only HTTP is supported'); this._serverUrl = oURL; },
this.mPrefs = XPCU.getService("@mozilla.org/preferences;1", "nsIPref");
var prefService = XPCU.getService("@mozilla.org/preferences-service;1", "nsIPrefService"); this.mPrefs = prefService.getBranch(null);
init: function() { this.mPrefs = XPCU.getService("@mozilla.org/preferences;1", "nsIPref"); },
if (DEBUG) { this.kRasputin = rdfSvc.GetResource("ldap: this.kElvis = rdfSvc.GetResource("ldap: }
Init: function(aServer, aPort, aBindname) { // XXX - if this a "single-connection" datasource; we should figure // that out here by noticing that there is a ; after "rdf:ldap", and // that after that there is a cookie which happens to be an LDAP URL // designating the connection. for now, we just assume that this will // be a "universal" datasource. // get the RDF service // var rdfSvc = Components. classes["component://netscape/rdf/rdf-service"]. getService(Components.interfaces.nsIRDFService); // get some RDF Resources that we'll need // this.kRDF_instanceOf = rdfSvc.GetResource( RDF_NAMESPACE_URI + "instanceOf"); this.kNC_child = rdfSvc.GetResource( NC_NAMESPACE_URI + "child"); this.kNC_Folder = rdfSvc.GetResource( NC_NAMESPACE_URI + "Folder"); // XXXdmose debugging cruft // if (DEBUG) { this.kRasputin = rdfSvc.GetResource("ldap://memberdir.netscape.com:389/ou=member_directory,o=netcenter.com??sub?(sn=Rasputin)"); this.kElvis = rdfSvc.GetResource("ldap://memberdir.netscape.com:389/ou=member_directory,o=netcenter.com??sub?(sn=Elvis)"); } return; },
this.inlineSpellChecker = editor.inlineSpellChecker;
this.inlineSpellChecker = editor.getInlineSpellChecker(true);
Init : function (editor, enable) { this.editor = editor; this.inlineSpellChecker = editor.inlineSpellChecker; this.inlineSpellChecker.enableRealTimeSpell = enable; },
this.transferCount=0;
this.refTab = null; this.transferCount = 0;
init : function() { this.urlBar = document.getElementById("urlbar"); this.statusbarText = document.getElementById("statusbar-text"); this.stopreloadButton = document.getElementById("reload-stop-button"); this.statusbar = document.getElementById("statusbar"); this.transferCount=0; },
var formatter = Cc["@mozilla.org/browser/URLFormatterService;1"].
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
init: function () { const Cc = Components.classes, Ci = Components.interfaces; var providerNum = window.arguments[0].providerNum; var phishBefore = document.getElementById("phishBefore"); var prefb = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService). getBranch("browser.safebrowsing.provider."); // init before-frame and after-frame strings // note that description only wraps when the string is the element's // *content* and *not* when it's the value attribute var providerName = prefb.getComplexValue(providerNum + ".name", Ci.nsISupportsString).data var strings = document.getElementById("bundle_phish"); phishBefore.textContent = strings.getFormattedString("phishBeforeText", [providerName]); // guaranteed to be present, because only providers with privacy policies // are displayed in the prefwindow var formatter = Cc["@mozilla.org/browser/URLFormatterService;1"]. getService(Ci.nsIURLFormatter); var privacyURL = formatter.formatURLPref("browser.safebrowsing.provider." + providerNum + ".privacy.url", null); var fallbackURL = formatter.formatURLPref("browser.safebrowsing.provider." + providerNum + ".privacy.fallbackurl", null); this._progressListener._providerFallbackURL = fallbackURL; // add progress listener to enable OK, radios when page loads var frame = document.getElementById("phishPolicyFrame"); var webProgress = frame.docShell .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebProgress); webProgress.addProgressListener(this._progressListener, Ci.nsIWebProgress.NOTIFY_STATE_WINDOW); this._webProgress = webProgress; // for easy use later // start loading the privacyURL const loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; frame.webNavigation.loadURI(privacyURL, loadFlags, null, null, null); },
var privacyURL = prefb.getComplexValue(providerNum + ".privacy.url", Ci.nsISupportsString).data;
var formatter = Cc["@mozilla.org/browser/URLFormatterService;1"]. getService(Ci.nsIURLFormatter); var privacyURL = formatter.formatURLPref("browser.safebrowsing.provider." + providerNum + ".privacy.url", null); var fallbackURL = formatter.formatURLPref("browser.safebrowsing.provider." + providerNum + ".privacy.fallbackurl", null); this._progressListener._providerFallbackURL = fallbackURL;
init: function () { const Cc = Components.classes, Ci = Components.interfaces; var providerNum = window.arguments[0].providerNum; var phishBefore = document.getElementById("phishBefore"); var prefb = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService). getBranch("browser.safebrowsing.provider."); // init before-frame and after-frame strings // note that description only wraps when the string is the element's // *content* and *not* when it's the value attribute var providerName = prefb.getComplexValue(providerNum + ".name", Ci.nsISupportsString).data var strings = document.getElementById("bundle_phish"); phishBefore.textContent = strings.getFormattedString("phishBeforeText", [providerName]); // guaranteed to be present, because only providers with privacy policies // are displayed in the prefwindow var privacyURL = prefb.getComplexValue(providerNum + ".privacy.url", Ci.nsISupportsString).data; // add progress listener to enable OK, radios when page loads var frame = document.getElementById("phishPolicyFrame"); var webProgress = frame.docShell .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebProgress); webProgress.addProgressListener(this._progressListener, Ci.nsIWebProgress.NOTIFY_STATE_WINDOW); this._webProgress = webProgress; // for easy use later // start loading the privacyURL const loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; frame.webNavigation.loadURI(privacyURL, loadFlags, null, null, null); },
this.translateMenu = document.getElementById("menuitem-translate");
this.isImage = document.getElementById("isImage");
init : function() { // XXXjag is this still needed? It's currently just "" this.defaultStatus = gNavigatorBundle.getString("defaultStatus"); this.urlBar = document.getElementById("urlbar"); this.throbberElement = document.getElementById("navigator-throbber"); this.statusMeter = document.getElementById("statusbar-icon"); this.stopButton = document.getElementById("stop-button"); this.stopMenu = document.getElementById("menuitem-stop"); this.stopContext = document.getElementById("context-stop"); this.statusTextField = document.getElementById("statusbar-display"); this.translateMenu = document.getElementById("menuitem-translate"); },
init : function(aLocalFile, aIsBaseline)
init : function(aLocalFile, aIsBaseline, aIsPrinting)
init : function(aLocalFile, aIsBaseline) { this.mIsBaseline = aIsBaseline; this.mURLs = new Array(); this.readFileList(aLocalFile); this.mRegressionTester = Components.classes["@mozilla.org/layout-debug/regressiontester;1"]. createInstance(nsILayoutRegressionTester) },
this.mIsPrinting = aIsPrinting;
init : function(aLocalFile, aIsBaseline) { this.mIsBaseline = aIsBaseline; this.mURLs = new Array(); this.readFileList(aLocalFile); this.mRegressionTester = Components.classes["@mozilla.org/layout-debug/regressiontester;1"]. createInstance(nsILayoutRegressionTester) },
#ifdef XP_WIN document.getElementById('mail.checkDefaultMail').valueFromPreferences = this.onReadDefaultMailPref(); document.getElementById('mail.checkDefaultNews').valueFromPreferences = this.onReadDefaultNewsPref(); document.getElementById('mail.checkDefaultFeed').valueFromPreferences = this.onReadDefaultFeedPref(); #endif #ifdef HAVE_SHELL_SERVICE var mapiReg; try { mapiReg = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry); } catch (e) {} if (!mapiReg) document.getElementById("defaultClientBox").hidden = true; #endif
init: function () { this.mPane = document.getElementById("paneGeneral"); this.startPageCheck(); this.mailSoundCheck(); #ifdef XP_WIN document.getElementById('mail.checkDefaultMail').valueFromPreferences = this.onReadDefaultMailPref(); document.getElementById('mail.checkDefaultNews').valueFromPreferences = this.onReadDefaultNewsPref(); document.getElementById('mail.checkDefaultFeed').valueFromPreferences = this.onReadDefaultFeedPref();#endif#ifdef HAVE_SHELL_SERVICE // first check whether nsIMapiRegistry is available. if it's not, // hide the whole default mail/news app section. var mapiReg; try { mapiReg = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry); } catch (e) {} if (!mapiReg) document.getElementById("defaultClientBox").hidden = true;#endif },
this.onReadDefaultFeedPref(); #endif
init: function () { this.mPane = document.getElementById("paneGeneral"); this.mBrandBundle = document.getElementById("brandBundle"); this.mMapiBundle = document.getElementById("mapiBundle"); this.playSoundCheck(); this.onReadDefaultMailPref(); this.onReadDefaultNewsPref();#ifdef XP_MACOSX document.getElementById("defaultClientBox").hidden = true;#endif#ifdef MOZ_WIDGET_GTK2 // first check whether GNOME is available. if it's not, hide the whole // default mail/news app section. var mapiReg; try { mapiReg = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry); } catch (e) {} if (!mapiReg) document.getElementById("defaultClientBox").hidden = true;#endif },
this.kNC_recursiveChild = this.mRdfSvc.GetResource(NC_NAMESPACE_URI + "recursiveChild");
Init: function() { if (this.kInited == -1) { this.kInited = 0; // get the RDF service // this.mRdfSvc = Components. classes["@mozilla.org/rdf/rdf-service;1"]. getService(Components.interfaces.nsIRDFService); this.mLDAPDataSource = this.mRdfSvc.GetDataSource("rdf:ldap"). QueryInterface(Components.interfaces.nsIRDFObserver); // get some RDF Resources that we'll need // this.kNC_child = this.mRdfSvc.GetResource( NC_NAMESPACE_URI + "child"); } },
{
init: function () { if( window.queuedTag ) { this.onpageload( window.queuedTag ); } if( window.arguments[1] ) this.openBranch( window.arguments[1], window.arguments[2] ); },
}
init: function () { if( window.queuedTag ) { this.onpageload( window.queuedTag ); } if( window.arguments[1] ) this.openBranch( window.arguments[1], window.arguments[2] ); },
function init() { helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); helpGlossaryPanel = document.getElementById("help-glossary-panel"); helpBrowser = document.getElementById("help-content"); strBundle = document.getElementById("bundle_help"); emptySearchText = strBundle.getString("emptySearchText"); initFindBar(); var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); const width = document.documentElement.getAttribute("width"); const height = document.documentElement.getAttribute("height"); window.moveTo((screen.availWidth - width) / 2, (screen.availHeight - height) / 2); getWebNavigation().sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); gClickSelectsAll = getBoolPref("browser.urlbar.clickSelectsAll", true); setTimeout(focusSearch, 0); }
init : function() {},
function init() { // Cache panel references. helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); helpGlossaryPanel = document.getElementById("help-glossary-panel"); helpBrowser = document.getElementById("help-content"); strBundle = document.getElementById("bundle_help"); emptySearchText = strBundle.getString("emptySearchText"); initFindBar(); // Get the content pack, base URL, and help topic var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); // trailing "/" included. helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); // Move to Center of Screen const width = document.documentElement.getAttribute("width"); const height = document.documentElement.getAttribute("height"); window.moveTo((screen.availWidth - width) / 2, (screen.availHeight - height) / 2); // Initialize history. getWebNavigation().sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); gClickSelectsAll = getBoolPref("browser.urlbar.clickSelectsAll", true); setTimeout(focusSearch, 0);}
function init() { helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); helpGlossaryPanel = document.getElementById("help-glossary-panel"); helpBrowser = document.getElementById("help-content"); var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); window.XULBrowserWindow = new nsHelpStatusHandler(); const interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); const webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); showPanel('help-toc'); }
init : function() { this.throbberElement = document.getElementById("navigator-throbber"); },
function init() { //cache panel references. helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); helpGlossaryPanel = document.getElementById("help-glossary-panel"); helpBrowser = document.getElementById("help-content"); // Get the help content pack, base URL, and help topic var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); // trailing "/" included. helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); // Initalize History. var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); window.XULBrowserWindow = new nsHelpStatusHandler(); // Hook up UI through Progress Listener const interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); const webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); //Always show the Table of Contents sidebar at startup. showPanel('help-toc');}
initDebugger();
function init(){ initPrefs(); initCommands(); initDebugger(); initOutliners(); disableDebugCommands(); window._content = console._outputDocument = document.getElementById("output-iframe").contentDocument; console._outputElement = console._outputDocument.getElementById("output-tbody"); console._slInputElement = document.getElementById("input-single-line"); console._slInputElement.focus(); console._munger = new CMunger(); console._munger.enabled = true; console._munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,})/, insertLink); console._munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + console.prefs["output.wordbreak.length"] + ",})"), insertHyphenatedWord); display(MSG_HELLO, MT_HELLO); displayCommands(); startupTests();}
initDebugger();
function init(){ initPrefs(); initCommands(); initDebugger(); initOutliners(); disableDebugCommands(); window._content = console._outputDocument = document.getElementById("output-iframe").contentDocument; console._outputElement = console._outputDocument.getElementById("output-tbody"); console._slInputElement = document.getElementById("input-single-line"); console._slInputElement.focus(); console._munger = new CMunger(); console._munger.enabled = true; console._munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,})/, insertLink); console._munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + console.prefs["output.wordbreak.length"] + ",})"), insertHyphenatedWord); display(MSG_HELLO, MT_HELLO); displayCommands(); startupTests();}
pref.SetDefaultBoolPref('sidebar.open', true);
pref.SetDefaultBoolPref('sidebar.open', false);
function Init() { var pref = Components.classes['component://netscape/preferences'].getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); if (pref) { pref.SetDefaultIntPref('sidebar.width', 170); // pref.SetIntPref(pref.GetIntPref('sidebar.width')); pref.SetDefaultBoolPref('sidebar.open', true); pref.SavePrefFile(); if (pref.GetBoolPref('sidebar.open')) { toggleOpenClose(); } }}
document.documentElement.getButton("accept").focus();
function init(aEvent) { if (aEvent.target != document) return; var userAgentField = document.getElementById("userAgent"); userAgentField.value = navigator.userAgent; var button = document.documentElement.getButton("extra2"); button.setAttribute("label", document.documentElement.getAttribute("creditslabel")); gSelectedPage = 0; button.addEventListener("command", switchPage, false);}
SelectLanguage();
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch pref_string = active_languages.getAttribute("prefvalue"); LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); } SelectLanguage();}
{name: "irc.idle.net", port: 6667},
{name: "irc.mcs.net", port: 6667},
function init(obj){ obj.eventPump = new CEventPump (100); obj.networks = new Object(); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["efnet"] = new CIRCNetwork ("efnet", [ {name: "irc.idle.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; }
gSelectedPage = 0;
function init(aEvent) { if (aEvent.target != document) return; var userAgentField = document.getElementById("userAgent"); userAgentField.value = navigator.userAgent; var button = document.documentElement.getButton("extra2"); button.setAttribute("label", document.documentElement.getAttribute("creditslabel")); gSelectedPage = 0; button.addEventListener("command", switchPage, false); document.documentElement.getButton("accept").focus();}
document.documentElement.setAttribute("title", extensionsStrings.getFormattedString("aboutWindowTitle", [name]));
document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [name]);
function init(){ gExtensionID = window.arguments[0]; gExtensionDB = window.arguments[1]; var extensionsStrings = document.getElementById("extensionsStrings"); var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var extension = rdfs.GetResource(gExtensionID); // Name var nameArc = rdfs.GetResource(EM_NS("name")); var name = gExtensionDB.GetTarget(extension, nameArc, true); name = name.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Version var versionArc = rdfs.GetResource(EM_NS("version")); var version = gExtensionDB.GetTarget(extension, versionArc, true); version = version.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Description var descriptionArc = rdfs.GetResource(EM_NS("description")); var description = gExtensionDB.GetTarget(extension, descriptionArc, true); if (description) description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Home Page URL var homepageArc = rdfs.GetResource(EM_NS("homepageURL")); var homepage = gExtensionDB.GetTarget(extension, homepageArc, true); if (homepage) homepage = homepage.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Creator var creatorArc = rdfs.GetResource(EM_NS("creator")); var creator = gExtensionDB.GetTarget(extension, creatorArc, true); if (creator) creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; document.documentElement.setAttribute("title", extensionsStrings.getFormattedString("aboutWindowTitle", [name])); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [version])); var extensionDescription = document.getElementById("extensionDescription"); extensionDescription.appendChild(document.createTextNode(description)); var extensionCreator = document.getElementById("extensionCreator"); extensionCreator.setAttribute("value", creator); var extensionHomepage = document.getElementById("extensionHomepage"); if (homepage) { extensionHomepage.setAttribute("href", homepage); extensionHomepage.setAttribute("tooltiptext", homepage); } else extensionHomepage.hidden = true; var contributorsBox = document.getElementById("contributorsBox"); var contributorsArc = rdfs.GetResource(EM_NS("contributor")); var contributors = gExtensionDB.GetTargets(extension, contributorsArc, true); var count = 0; while (contributors.hasMoreElements()) { var contributor = contributors.getNext().QueryInterface(Components.interfaces.nsIRDFLiteral).Value; var label = document.createElement("label"); label.setAttribute("value", contributor); label.setAttribute("class", "contributor"); contributorsBox.appendChild(label); ++count; } if (count == 0) document.getElementById("extensionContributors").hidden = true; var acceptButton = document.documentElement.getButton("accept"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");}
helpTocPanel = document.getElementById("help-toc-tree"); helpIndexPanel = document.getElementById("help-index-tree"); helpGlossaryPanel = document.getElementById("help-glossary-tree");
helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); helpGlossaryPanel = document.getElementById("help-glossary-panel");
function init() { //cache panel references. helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-tree"); helpIndexPanel = document.getElementById("help-index-tree"); helpGlossaryPanel = document.getElementById("help-glossary-tree"); helpBrowser = document.getElementById("help-content"); var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); // trailing "/" included. helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);}
showPanel('help-toc');
function init() { //cache panel references. helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-tree"); helpIndexPanel = document.getElementById("help-index-tree"); helpGlossaryPanel = document.getElementById("help-glossary-tree"); helpBrowser = document.getElementById("help-content"); var helpTopic = defaultTopic; if ("arguments" in window && window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) { helpFileURI = window.arguments[0].GetString(0); helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1); // trailing "/" included. helpTopic = window.arguments[0].GetString(1); } loadHelpRDF(); displayTopic(helpTopic); // move to right end of screen var width = document.documentElement.getAttribute("width"); var height = document.documentElement.getAttribute("height"); window.moveTo(screen.availWidth-width, (screen.availHeight-height)/2); var sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); getWebNavigation().sessionHistory = sessionHistory; window.XULBrowserWindow = new nsHelpStatusHandler(); // hook up UI through progress listener var interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);}
client.dcc = new CIRCDCC(client);
function init(){ if (("initialized" in client) && client.initialized) return; client.initialized = false; client.networks = new Object(); client.eventPump = new CEventPump (200); if (DEBUG) { /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ client.debugHook = client.eventPump.addHook([{type: "poll", set:/^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); } initRDF(); initMessages(); initCommands(); initPrefs(); initMunger(); initNetworks(); initMenus(); initStatic(); initHandlers(); // start logging. nothing should call display() before this point. if (client.prefs["log"]) client.openLogFile(client); client.display(MSG_WELCOME, "HELLO"); setCurrentObject (client); importFromFrame("updateHeader"); importFromFrame("setHeaderState"); importFromFrame("changeCSS"); processStartupScripts(); client.commandManager.installKeys(document); createMenus(); client.initialized = true; dispatch("networks"); dispatch("commands"); processStartupURLs();}
SelectLanguage();
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); //fall-back (hard-coded for Beta2, need to move to XUL/DTD) if (!pref_string) pref_string = "en"; } //try catch(ex) { } //catch LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
if (description) description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
function init(){ gExtensionID = window.arguments[0]; gExtensionDB = window.arguments[1]; var extensionsStrings = document.getElementById("extensionsStrings"); var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var extension = rdfs.GetResource(gExtensionID); // Name var nameArc = rdfs.GetResource(EM_NS("name")); var name = gExtensionDB.GetTarget(extension, nameArc, true); name = name.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Version var versionArc = rdfs.GetResource(EM_NS("version")); var version = gExtensionDB.GetTarget(extension, versionArc, true); version = version.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Description var descriptionArc = rdfs.GetResource(EM_NS("description")); var description = gExtensionDB.GetTarget(extension, descriptionArc, true); description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Home Page URL var homepageArc = rdfs.GetResource(EM_NS("homepageURL")); var homepage = gExtensionDB.GetTarget(extension, homepageArc, true); if (homepage) homepage = homepage.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Creator var creatorArc = rdfs.GetResource(EM_NS("creator")); var creator = gExtensionDB.GetTarget(extension, creatorArc, true); creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; document.documentElement.setAttribute("title", extensionsStrings.getFormattedString("aboutWindowTitle", [name])); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [version])); var extensionDescription = document.getElementById("extensionDescription"); extensionDescription.appendChild(document.createTextNode(description)); var extensionCreator = document.getElementById("extensionCreator"); extensionCreator.setAttribute("value", creator); var extensionHomepage = document.getElementById("extensionHomepage"); if (homepage) { extensionHomepage.setAttribute("href", homepage); extensionHomepage.setAttribute("tooltiptext", homepage); } else extensionHomepage.hidden = true; var contributorsBox = document.getElementById("contributorsBox"); var contributorsArc = rdfs.GetResource(EM_NS("contributor")); var contributors = gExtensionDB.GetTargets(extension, contributorsArc, true); var count = 0; while (contributors.hasMoreElements()) { var contributor = contributors.getNext().QueryInterface(Components.interfaces.nsIRDFLiteral).Value; var label = document.createElement("label"); label.setAttribute("value", contributor); label.setAttribute("class", "contributor"); contributorsBox.appendChild(label); ++count; } if (count == 0) document.getElementById("extensionContributors").hidden = true; var acceptButton = document.documentElement.getButton("accept"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");}
creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
if (creator) creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
function init(){ gExtensionID = window.arguments[0]; gExtensionDB = window.arguments[1]; var extensionsStrings = document.getElementById("extensionsStrings"); var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var extension = rdfs.GetResource(gExtensionID); // Name var nameArc = rdfs.GetResource(EM_NS("name")); var name = gExtensionDB.GetTarget(extension, nameArc, true); name = name.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Version var versionArc = rdfs.GetResource(EM_NS("version")); var version = gExtensionDB.GetTarget(extension, versionArc, true); version = version.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Description var descriptionArc = rdfs.GetResource(EM_NS("description")); var description = gExtensionDB.GetTarget(extension, descriptionArc, true); description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Home Page URL var homepageArc = rdfs.GetResource(EM_NS("homepageURL")); var homepage = gExtensionDB.GetTarget(extension, homepageArc, true); if (homepage) homepage = homepage.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Creator var creatorArc = rdfs.GetResource(EM_NS("creator")); var creator = gExtensionDB.GetTarget(extension, creatorArc, true); creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; document.documentElement.setAttribute("title", extensionsStrings.getFormattedString("aboutWindowTitle", [name])); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [version])); var extensionDescription = document.getElementById("extensionDescription"); extensionDescription.appendChild(document.createTextNode(description)); var extensionCreator = document.getElementById("extensionCreator"); extensionCreator.setAttribute("value", creator); var extensionHomepage = document.getElementById("extensionHomepage"); if (homepage) { extensionHomepage.setAttribute("href", homepage); extensionHomepage.setAttribute("tooltiptext", homepage); } else extensionHomepage.hidden = true; var contributorsBox = document.getElementById("contributorsBox"); var contributorsArc = rdfs.GetResource(EM_NS("contributor")); var contributors = gExtensionDB.GetTargets(extension, contributorsArc, true); var count = 0; while (contributors.hasMoreElements()) { var contributor = contributors.getNext().QueryInterface(Components.interfaces.nsIRDFLiteral).Value; var label = document.createElement("label"); label.setAttribute("value", contributor); label.setAttribute("class", "contributor"); contributorsBox.appendChild(label); ++count; } if (count == 0) document.getElementById("extensionContributors").hidden = true; var acceptButton = document.documentElement.getButton("accept"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");}
tree.database.AddDataSource(HTTPIndex.DataSource);
tree.database.AddDataSource(HTTPIndex);
function Init(){ debug("directory.js: Init()\n"); var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; if (baseURI && (baseURI.indexOf("ftp://") == 0)) { // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI.substr(baseURI.length - 1) != "/") { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } } if (baseURI && (baseURI.indexOf("file://") != 0)) { // Note: DON'T add the HTTPIndex datasource into the tree // for file URLs, only do it for FTP/Gopher/etc URLs; the "rdf:files" // datasources handles file URLs tree.database.AddDataSource(HTTPIndex.DataSource); } // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService(); if (RDF) RDF = RDF.QueryInterface(nsIRDFService); if (RDF) { loadingArc = RDF.GetResource(NC_LOADING, true); var httpDS = HTTPIndex.DataSource; if (httpDS) httpDS = httpDS.QueryInterface(nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) { httpDS.encoding = window._content.defaultCharacterset; } } } // set window title var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI; } tree.database.AddObserver(RDF_observer); debug("Directory: added observer\n"); // root the tree (do this last) tree.setAttribute("ref", baseURI);}
console.ui["menu_initAtStartup"] = document.getElementById ("menu_initAtStartup");
console.ui["menu_PrettyPrint"] = document.getElementById ("menu_PrettyPrint"); console.ui["menu_InitAtStartup"] = document.getElementById ("menu_InitAtStartup");
function init(){ initPrefs(); initCommands(); initOutliners(); disableDebugCommands(); console._outputDocument = document.getElementById("output-iframe").contentDocument; console._outputElement = console._outputDocument.getElementById("output-tbody"); console._slInputElement = document.getElementById("input-single-line"); console._slInputElement.focus(); console._munger = new CMunger(); console._munger.enabled = true; console._munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,})/, insertLink); console._munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + MAX_WORD_LEN + ",})"), insertHyphenatedWord); console._lastStackDepth = -1; initDebugger(); /* debugger may need display() to init */ display(MSG_HELLO, MT_HELLO); display(getMsg(MSN_VERSION, console.version), MT_HELLO); displayCommands(); console.ui = new Object(); console.ui["menu_initAtStartup"] = document.getElementById ("menu_initAtStartup"); console.ui["menu_TModeIgnore"] = document.getElementById("menu_TModeIgnore"); console.ui["menu_TModeTrace"] = document.getElementById("menu_TModeTrace"); console.ui["menu_TModeBreak"] = document.getElementById("menu_TModeBreak"); console.ui["status-text"] = document.getElementById ("status-text"); console._statusStack = new Array(); startupTests();}
setPageAccessKeys(document.getElementById("behaviourDeck").firstChild);
function init(){ var prefWindow = parent.hPrefWindow; gData = prefWindow.wsm.dataManager .pageData["chrome://communicator/content/pref/pref-navigator.xul"] gDefaultPage = getDefaultPage(); if ("navigatorData" in gData) return; var navigatorData = {}; navigatorData.groupIsSet = getGroupIsSetMessage(); var URIs = []; try { URIs[0] = prefWindow.getPref("localizedstring", "browser.startup.homepage"); var count = prefWindow.getPref("int", "browser.startup.homepage.count"); for (var i = 1; i < count; ++i) { URIs[i] = prefWindow.getPref("localizedstring", "browser.startup.homepage."+i); } navigatorData.homePages = URIs; } catch(e) { } gData.navigatorData = navigatorData; setPageAccessKeys(document.getElementById("behaviourDeck").firstChild); prefWindow.registerOKCallbackFunc(doOnOk);}
if (baseURI && (baseURI.indexOf("ftp: (baseURI.substr(baseURI.length - 1) != "/"))
if (baseURI && (baseURI.indexOf("ftp:
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); tree.database.AddDataSource(HTTPIndex.DataSource); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = HTTPIndex.DataSource; if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) { httpDS.encoding = window._content.defaultCharacterset; } } } // set window title var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI; } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
debug("append traiing slash to FTP directory URL\n"); baseURI += "/";
if (baseURI.substr(baseURI.length - 1) != "/") { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } tree.database.AddDataSource(HTTPIndex.DataSource);
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); tree.database.AddDataSource(HTTPIndex.DataSource); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = HTTPIndex.DataSource; if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) { httpDS.encoding = window._content.defaultCharacterset; } } } // set window title var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI; } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
debug("base URL = " + baseURI + "\n"); var tree = document.getElementById('tree'); tree.database.AddDataSource(HTTPIndex.DataSource);
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); tree.database.AddDataSource(HTTPIndex.DataSource); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = HTTPIndex.DataSource; if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { httpDS.encoding = "ISO-8859-1"; // Use a default character set. if (window._content.defaultCharacterset) { httpDS.encoding = window._content.defaultCharacterset; } } } // set window title var theWindow = window._content.parentWindow; if (theWindow) { theWindow.title = baseURI; } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
extensionHomepage.setAttribute("href", homepage);
extensionHomepage.setAttribute("onclick", "loadHomepage(\"" + homepage + "\");");
function init(){ gExtensionID = window.arguments[0]; gExtensionDB = window.arguments[1]; var extensionsStrings = document.getElementById("extensionsStrings"); var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var extension = rdfs.GetResource(gExtensionID); // Name var nameArc = rdfs.GetResource(EM_NS("name")); var name = gExtensionDB.GetTarget(extension, nameArc, true); name = name.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Version var versionArc = rdfs.GetResource(EM_NS("version")); var version = gExtensionDB.GetTarget(extension, versionArc, true); version = version.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Description var descriptionArc = rdfs.GetResource(EM_NS("description")); var description = gExtensionDB.GetTarget(extension, descriptionArc, true); if (description) description = description.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // Home Page URL var homepageArc = rdfs.GetResource(EM_NS("homepageURL")); var homepage = gExtensionDB.GetTarget(extension, homepageArc, true); if (homepage) { homepage = homepage.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; // only allow http(s) homepages var scheme = ""; var uri = null; try { uri = makeURI(homepage); scheme = uri.scheme; } catch (ex) {} if (uri && (scheme == "http" || scheme == "https")) homepage = uri.spec; else homepage = null; } // Creator var creatorArc = rdfs.GetResource(EM_NS("creator")); var creator = gExtensionDB.GetTarget(extension, creatorArc, true); if (creator) creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [name]); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [version])); var extensionDescription = document.getElementById("extensionDescription"); extensionDescription.appendChild(document.createTextNode(description)); var extensionCreator = document.getElementById("extensionCreator"); extensionCreator.setAttribute("value", creator); var extensionHomepage = document.getElementById("extensionHomepage"); if (homepage) { extensionHomepage.setAttribute("href", homepage); extensionHomepage.setAttribute("tooltiptext", homepage); } else extensionHomepage.hidden = true; var sectionProps = [["developersBox", "developer", "extensionDevelopers"], ["translatorsBox", "translator", "extensionTranslators"], ["contributorsBox", "contributor", "extensionContributors"]]; for (var i = 0; i < sectionProps.length; ++i) { var node = document.getElementById(sectionProps[i][0]); var arc = rdfs.GetResource(EM_NS(sectionProps[i][1])); var targets = gExtensionDB.GetTargets(extension, arc, true); if (!(targets.hasMoreElements())) document.getElementById(sectionProps[i][2]).hidden = true; else { while (targets.hasMoreElements()) { var literalValue = targets.getNext().QueryInterface(Components.interfaces.nsIRDFLiteral).Value; var label = document.createElement("label"); label.setAttribute("value", literalValue); label.setAttribute("class", "contributor"); node.appendChild(label); } } } var acceptButton = document.documentElement.getButton("accept"); acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");}
panel_title.setAttribute('value', panel_name);
panel_title.setAttribute('label', panel_name);
function Init(){ var panel_name = window.arguments[0]; var panel_URL = window.arguments[1]; var panel_title = document.getElementById('paneltitle'); var preview_frame = document.getElementById('previewframe'); panel_title.setAttribute('value', panel_name); preview_frame.setAttribute('src', panel_URL);}
console.pluginState = new Object();
function init(){ const WW_CTRID = "@mozilla.org/embedcomp/window-watcher;1"; const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher; console.windowWatcher = Components.classes[WW_CTRID].getService(nsIWindowWatcher); initPrefs(); initCommands(); initMenus(); initOutliners(); disableDebugCommands(); console.files = new Object(); console._outputDocument = document.getElementById("output-iframe").contentDocument; console._outputElement = console._outputDocument.getElementById("output-tbody"); console._slInputElement = document.getElementById("input-single-line"); console._slInputElement.focus(); console._munger = new CMunger(); console._munger.enabled = true; console._munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,})/, insertLink); console._munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + MAX_WORD_LEN + ",})"), insertHyphenatedWord); console._lastStackDepth = -1; initDebugger(); /* debugger may need display() to init */ console.ui = new Object(); console.ui["status-text"] = document.getElementById ("status-text"); console.ui["sl-input"] = document.getElementById ("input-single-line"); console._statusStack = new Array(); dispatch("version"); var ary = console.prefs["initialScripts"].split(); for (var i = 0; i < ary.length; ++i) { var url = stringTrim(ary[i]); if (url) dispatch ("loadd", {url: ary[i]}); } console.sourceText = new HelpText(); dispatch("commands"); dispatch("help"); initHandlers();}
pref.SetDefaultBoolPref('sidebar.open', false);
pref.SetDefaultBoolPref('sidebar.open', true);
function Init() { var pref = Components.classes['component://netscape/preferences']; if (pref) { pref = pref.getService(); } if (pref) { pref = pref.QueryInterface(Components.interfaces.nsIPref); } if (pref) { pref.SetDefaultIntPref('sidebar.width', 170); // pref.SetIntPref(pref.GetIntPref('sidebar.width')); pref.SetDefaultBoolPref('sidebar.open', false); pref.SavePrefFile(); if (pref.GetBoolPref('sidebar.open')) { toggleOpenClose(); } }}
active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').value;
active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label;
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); //fall-back (hard-coded for Beta2, need to move to XUL/DTD) if (!pref_string) pref_string = "en"; } //try catch(ex) { } //catch LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').value; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
console.debuggerWindow = getBaseWindowFromWindow(window);
function init(){ var ary = navigator.userAgent.match (/;\s*([^;\s]+\s*)\).*\/(\d+)/); if (ary) { console.userAgent = "Venkman " + console.version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; } else { console.userAgent = "Venkman " + console.version + " [" + navigator.userAgent + "]"; } const WW_CTRID = "@mozilla.org/embedcomp/window-watcher;1"; const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher; console.windowWatcher = Components.classes[WW_CTRID].getService(nsIWindowWatcher); initPrefs(); initCommands(); initMenus(); initOutliners(); disableDebugCommands(); console.files = new Object(); console._outputDocument = document.getElementById("output-iframe").contentDocument; console._outputElement = console._outputDocument.getElementById("output-tbody"); console._slInputElement = document.getElementById("input-single-line"); console._slInputElement.focus(); console._munger = new CMunger(); console._munger.enabled = true; console._munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,})/, insertLink); console._munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + MAX_WORD_LEN + ",})"), insertHyphenatedWord); console._lastStackDepth = -1; initDebugger(); /* debugger may need display() to init */ console.ui = new Object(); console.ui["status-text"] = document.getElementById ("status-text"); console.ui["sl-input"] = document.getElementById ("input-single-line"); console._statusStack = new Array(); console.pluginState = new Object(); dispatch("version"); var ary = console.prefs["initialScripts"].split(); for (var i = 0; i < ary.length; ++i) { var url = stringTrim(ary[i]); if (url) dispatch ("loadd", {url: ary[i]}); } console.sourceText = new HelpText(); dispatch("commands"); dispatch("help"); initHandlers();}
debug("base URL = " + HTTPIndex.BaseURL + "\n"); tree.setAttribute('ref', HTTPIndex.BaseURL);
var baseURI = HTTPIndex.BaseURL; if (baseURI && (baseURI.indexOf("ftp: (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); tree.setAttribute("ref", baseURI);
function Init(){ debug("directory.js: Init()\n"); // Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at debug("base URL = " + HTTPIndex.BaseURL + "\n"); tree.setAttribute('ref', HTTPIndex.BaseURL);}
display (MSG_SLASH_REQUIRED, MT_ATTENTION);
display (MSG_TIP3_HELP);
function init(){ dd ("init {"); var i; const WW_CTRID = "@mozilla.org/embedcomp/window-watcher;1"; const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher; console.windowWatcher = Components.classes[WW_CTRID].getService(nsIWindowWatcher); const UC_CTRID = "@mozilla.org/intl/scriptableunicodeconverter"; const nsIUnicodeConverter = Components.interfaces.nsIScriptableUnicodeConverter; console.ucConverter = Components.classes[UC_CTRID].getService(nsIUnicodeConverter); console.baseWindow = getBaseWindowFromWindow(window); console.mainWindow = window; console.dnd = nsDragAndDrop; console.currentEvalObject = console; console.files = new Object(); console.pluginState = new Object(); console._statusStack = new Array(); console._lastStackDepth = -1; initMsgs(); initPrefs(); initCommands(); initJSDURL(); /* Some commonly used commands, cached now, for use with dispatchCommand. */ var cm = console.commandManager; console.coManagerCreated = cm.commands["hook-script-manager-created"]; console.coManagerDestroyed = cm.commands["hook-script-manager-destroyed"]; console.coInstanceCreated = cm.commands["hook-script-instance-created"]; console.coInstanceSealed = cm.commands["hook-script-instance-sealed"]; console.coInstanceDestroyed = cm.commands["hook-script-instance-destroyed"]; console.coDisplayHook = cm.commands["hook-session-display"]; console.coFindScript = cm.commands["find-script"]; console.commandManager.addHooks (console.hooks); initMenus(); console.capturedMsgs = new Array(); var ary = console.prefs["initialScripts"].split(/\s*;\s*/); for (i = 0; i < ary.length; ++i) { var url = stringTrim(ary[i]); if (url) dispatch ("loadd", { url: ary[i] }); } dispatch ("hook-venkman-started"); initViews(); initRecords(); initHandlers(); // handlers may notice windows, which need views and records createMainMenu(document); createMainToolbar(document); console.ui = { "status-text": document.getElementById ("status-text"), "profile-button": document.getElementById ("maintoolbar:profile-tb"), "stop-button": document.getElementById ("maintoolbar:stop") }; disableDebugCommands(); initDebugger(); initProfiler(); fetchLaunchCount(); console.sourceText = new HelpText(); console.pushStatus(MSG_STATUS_DEFAULT); dispatch ("restore-layout default"); var startupMsgs = console.capturedMsgs; delete console.capturedMsgs; dispatch ("version"); for (i = 0; i < startupMsgs.length; ++i) display (startupMsgs[i][0], startupMsgs[i][1]); display (getMsg(MSN_TIP1_HELP, console.prefs["sessionView.requireSlash"] ? "/" : "")); display (MSG_TIP2_HELP); if (console.prefs["sessionView.requireSlash"]) display (MSG_SLASH_REQUIRED, MT_ATTENTION); //dispatch ("commands"); //dispatch ("help"); dispatch ("pprint", { toggle: console.prefs["prettyprint"] }); if (MSG_LOCALE_VERSION != __vnk_requiredLocale) { display (getMsg(MSN_BAD_LOCALE, [__vnk_requiredLocale, MSG_LOCALE_VERSION]), MT_WARN); } console.initialized = true; dispatch ("hook-venkman-started"); dd ("}");}
importFromFrame("updateMotifSettings");
function init(){ if (("initialized" in client) && client.initialized) return; client.initialized = false; client.networks = new Object(); client.entities = new Object(); client.eventPump = new CEventPump (200); if (DEBUG) { /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ client.debugHook = client.eventPump.addHook([{type: "poll", set:/^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); } initApplicationCompatibility(); initMessages(); if (client.host == "") showErrorDlg(getMsg(MSG_ERR_UNKNOWN_HOST, getBrowserURL())); initRDF(); initCommands(); initPrefs(); initMunger(); initNetworks(); initMenus(); initStatic(); initHandlers(); // Create DCC handler. client.dcc = new CIRCDCC(client); // start logging. nothing should call display() before this point. if (client.prefs["log"]) client.openLogFile(client); client.display(MSG_WELCOME, "HELLO"); client.dispatch("set-current-view", { view: client }); importFromFrame("updateHeader"); importFromFrame("setHeaderState"); importFromFrame("changeCSS"); importFromFrame("addUsers"); importFromFrame("updateUsers"); importFromFrame("removeUsers"); processStartupScripts(); client.commandManager.installKeys(document); createMenus(); initIcons(); client.busy = false; updateProgress(); client.initialized = true; dispatch("networks"); dispatch("commands"); processStartupURLs();}
setPageAccessKeys(document.getElementById("behaviourDeck").firstChild);
function init(){ var prefWindow = parent.hPrefWindow; gData = prefWindow.wsm.dataManager .pageData["chrome://communicator/content/pref/pref-navigator.xul"] gDefaultPage = getDefaultPage(); if ("navigatorData" in gData) return; var navigatorData = {}; navigatorData.groupIsSet = getGroupIsSetMessage(); var URIs = []; try { URIs[0] = prefWindow.getPref("localizedstring", "browser.startup.homepage"); var count = prefWindow.getPref("int", "browser.startup.homepage.count"); for (var i = 1; i < count; ++i) { URIs[i] = prefWindow.getPref("localizedstring", "browser.startup.homepage."+i); } navigatorData.homePages = URIs; } catch(e) { } gData.navigatorData = navigatorData; prefWindow.registerOKCallbackFunc(doOnOk);}
if (window._content.defaultCharacterset) httpDS.encoding = window._content.defaultCharacterset;
function Init(){ debug("directory.js: Init()\n"); // Initialize the tree's base URL to whatever the HTTPIndex is rooted at var baseURI = HTTPIndex.BaseURL; // fix bug # 37102: if its a FTP directory // ensure it ends with a trailing slash if (baseURI && (baseURI.indexOf("ftp://") == 0) && (baseURI.substr(baseURI.length - 1) != "/")) { debug("append traiing slash to FTP directory URL\n"); baseURI += "/"; } debug("base URL = " + baseURI + "\n"); // Note: Add the HTTPIndex datasource into the tree var tree = document.getElementById('tree'); // Note: set encoding BEFORE setting "ref" (important!) var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (RDF) RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService); if (RDF) { var httpDS = RDF.GetDataSource("rdf:httpindex"); if (httpDS) httpDS = httpDS.QueryInterface(Components.interfaces.nsIHTTPIndex); if (httpDS) { // TO DO - The encoding should really be determined // from the current encoding as chosen by the user httpDS.encoding = "ISO-8859-1"; } } // root the tree (do this last) tree.setAttribute("ref", baseURI);}
if (("initialized" in client) && client.initialized) return;
function init(){ client.initialized = false; client.networks = new Object(); client.eventPump = new CEventPump (200); if (DEBUG) { /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ client.debugHook = client.eventPump.addHook([{type: "poll", set:/^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); } initRDF(); initMessages(); initCommands(); initPrefs(); initMunger(); initNetworks(); initMenus(); initStatic(); initHandlers(); // start logging. nothing should call display() before this point. if (client.prefs["log"]) client.openLogFile(client); client.display(MSG_WELCOME, "HELLO"); setCurrentObject (client); importFromFrame("updateHeader"); importFromFrame("setHeaderState"); importFromFrame("changeCSS"); processStartupScripts(); client.commandManager.installKeys(document); createMenus(); client.initialized = true; dispatch("networks"); dispatch("commands"); processStartupURLs();}
doSetOKCancel(onOK, onCancel);
function Init() { sizeToContent(); doSetOKCancel(onOK, onCancel); document.getElementById("horizSize").focus(); }
LoadAvailableCharSets();
if (applicationArea.indexOf("mail") != -1) { LoadAvailableCharSets("NC:EncodersRoot"); } else { LoadAvailableCharSets("NC:DecodersRoot"); }
function Init(){ var applicationArea = ""; if ("arguments" in window && window.arguments[0]) applicationArea = window.arguments[0]; prefInt = Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); if (applicationArea.indexOf("mail") != -1) { pref_string_title = "intl.charsetmenu.mailedit"; } else { //default is the browser pref_string_title = "intl.charsetmenu.browser.static"; } pref_string_content = prefInt.getLocalizedUnicharPref(pref_string_title); AddRemoveLatin1('add'); } LoadAvailableCharSets(); LoadActiveCharSets();}
active_languages_treeroot = document.getElementById('active_languages_root');
function Init(){ try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch pref_string = active_languages.getAttribute("prefvalue"); LoadActiveLanguages(); SelectLanguage(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
available_languages_treeroot = document.getElementById('available_languages_root');
function Init(){ try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch pref_string = active_languages.getAttribute("prefvalue"); LoadActiveLanguages(); SelectLanguage(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
active_languages_treeroot = window.opener.document.getElementById('active_languages_root');
function Init(){ try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch pref_string = active_languages.getAttribute("prefvalue"); LoadActiveLanguages(); SelectLanguage(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); }}
try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); } catch(ex) { }
pref_string = active_languages.getAttribute("prefvalue");
function Init(){ doSetOKCancel(AddAvailableLanguage); try { GetBundles(); } catch(ex) { } ReadAvailableLanguages(); if (!("arguments" in window)) { //no caller arguments - load base window try { active_languages = document.getElementById('active_languages'); active_languages_treeroot = document.getElementById('active_languages_root'); } //try catch(ex) { } //catch try { parent.initPanel('chrome://communicator/content/pref/pref-languages.xul'); } catch(ex) { //pref service backup } //catch try { pref_string = parent.hPrefWindow.getPref( "string", "intl.accept_languages"); } //try catch(ex) { } //catch LoadActiveLanguages(); } else { //load available languages popup try { //add language popup available_languages = document.getElementById('available_languages'); available_languages_treeroot = document.getElementById('available_languages_root'); active_languages = window.opener.document.getElementById('active_languages'); active_languages_treeroot = window.opener.document.getElementById('active_languages_root'); pref_string = window.opener.document.getElementById('intlAcceptLanguages').label; } //try catch(ex) { } //catch LoadAvailableLanguages(); } SelectLanguage();}
all_panels_datasources = all_panels_datasources.replace(/^\s+/,''); all_panels_datasources = all_panels_datasources.replace(/\s+$/,'');
function Init(){ var all_panels_datasources = window.arguments[0]; var all_panels_resource = window.arguments[1]; sidebarObj.datasource_uri = window.arguments[2]; sidebarObj.resource = window.arguments[3]; debug("Init: all panels datasources = " + all_panels_datasources); debug("Init: all panels resource = " + all_panels_resource); debug("Init: sidebarObj.datasource_uri = " + sidebarObj.datasource_uri); debug("Init: sidebarObj.resource = " + sidebarObj.resource); var all_panels = document.getElementById('other-panels'); var current_panels = document.getElementById('current-panels'); all_panels_datasources = all_panels_datasources.split(/\s+/); for (var ii = 0; ii < all_panels_datasources.length; ii++) { debug("Init: Adding "+all_panels_datasources[ii]); // This will load the datasource, if it isn't already. var datasource = RDF.GetDataSource(all_panels_datasources[ii]); all_panels.database.AddDataSource(datasource); current_panels.database.AddDataSource(datasource); } // Add the datasource for current list of panels. It selects panels out // of the other datasources. debug("Init: Adding current panels, "+sidebarObj.datasource_uri); sidebarObj.datasource = RDF.GetDataSource(sidebarObj.datasource_uri); current_panels.database.AddDataSource(sidebarObj.datasource); // Root the customize dialog at the correct place. debug("Init: reset all panels ref, "+all_panels_resource); all_panels.setAttribute('ref', all_panels_resource); debug("Init: reset current panels ref, "+sidebarObj.resource); current_panels.setAttribute('ref', sidebarObj.resource); save_initial_panels(); enable_buttons_for_current_panels();}
pref = Components.classes['component:
prefs = Components.classes['component:
function init_sidebar(name, uri, width) { sidebar_name = name; sidebar_uri = uri; sidebar_width = width; sidebar_pref = 'sidebar.' + name; // Open/close sidebar based on saved pref. // This may be replaced by another system by hyatt. pref = Components.classes['component://netscape/preferences']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { prefs.SetDefaultBoolPref(sidebar_pref + '.open', false); // The sidebar is closed by default, so open it only if the // preference is set to true. if (pref.GetBoolPref(sidebar_pref + '.open')) { toggle_open_close(); } }}
if (pref.GetBoolPref(sidebar_pref + '.open')) {
if (prefs.GetBoolPref(sidebar_pref + '.open')) {
function init_sidebar(name, uri, width) { sidebar_name = name; sidebar_uri = uri; sidebar_width = width; sidebar_pref = 'sidebar.' + name; // Open/close sidebar based on saved pref. // This may be replaced by another system by hyatt. pref = Components.classes['component://netscape/preferences']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { prefs.SetDefaultBoolPref(sidebar_pref + '.open', false); // The sidebar is closed by default, so open it only if the // preference is set to true. if (pref.GetBoolPref(sidebar_pref + '.open')) { toggle_open_close(); } }}
prefs = Components.classes['@mozilla.org/preferences;1']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); }
prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
function init_sidebar(name, uri, width) { sidebar_name = name; sidebar_uri = uri; sidebar_width = width; sidebar_pref = 'sidebar.' + name; // Open/close sidebar based on saved pref. // This may be replaced by another system by hyatt. prefs = Components.classes['@mozilla.org/preferences;1']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { // The sidebar is closed by default, so open it only if the // preference is set to true. try { if (prefs.GetBoolPref(sidebar_pref + '.open')) { toggle_open_close(); } } catch (ex) { dump("failed to get sidebar_pref\n"); } }}
if (prefs.GetBoolPref(sidebar_pref + '.open')) {
if (prefs.getBoolPref(sidebar_pref + '.open')) {
function init_sidebar(name, uri, width) { sidebar_name = name; sidebar_uri = uri; sidebar_width = width; sidebar_pref = 'sidebar.' + name; // Open/close sidebar based on saved pref. // This may be replaced by another system by hyatt. prefs = Components.classes['@mozilla.org/preferences;1']; if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { // The sidebar is closed by default, so open it only if the // preference is set to true. try { if (prefs.GetBoolPref(sidebar_pref + '.open')) { toggle_open_close(); } } catch (ex) { dump("failed to get sidebar_pref\n"); } }}
if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault) {
if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && !this.mForced) {
initAppAndSaveToDiskValues: function() { // Fill in helper app info, if there is any. this.chosenApp = this.mLauncher.MIMEInfo.preferredApplicationHandler; // Initialize "default application" field. this.initDefaultApp(); // Fill application name textbox. if (this.chosenApp && this.chosenApp.path) { this.dialogElement( "appPath" ).value = this.getPath(this.chosenApp); } var useDefault = this.dialogElement( "useSystemDefault" );; if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault) { // Open (using system default). useDefault.radioGroup.selectedItem = useDefault; } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp) { // Open with given helper app. var openUsing = this.dialogElement( "openUsing" ); openUsing.radioGroup.selectedItem = openUsing; } else { // Save to disk. var saveToDisk = this.dialogElement( "saveToDisk" ); saveToDisk.radioGroup.selectedItem = saveToDisk; } // If we don't have a "default app" then disable that choice. if ( !this.openWithDefaultOK() ) { // Disable that choice. useDefault.hidden = true; // If that's the default, then switch to "save to disk." if ( useDefault.selected ) { useDefault.radioGroup.selectedItem = this.dialogElement( "saveToDisk" ); } } // Enable/Disable choose application button and textfield this.toggleChoice(); },
} else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp) {
} else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && !this.mForced) {
initAppAndSaveToDiskValues: function() { // Fill in helper app info, if there is any. this.chosenApp = this.mLauncher.MIMEInfo.preferredApplicationHandler; // Initialize "default application" field. this.initDefaultApp(); // Fill application name textbox. if (this.chosenApp && this.chosenApp.path) { this.dialogElement( "appPath" ).value = this.getPath(this.chosenApp); } var useDefault = this.dialogElement( "useSystemDefault" );; if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault) { // Open (using system default). useDefault.radioGroup.selectedItem = useDefault; } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp) { // Open with given helper app. var openUsing = this.dialogElement( "openUsing" ); openUsing.radioGroup.selectedItem = openUsing; } else { // Save to disk. var saveToDisk = this.dialogElement( "saveToDisk" ); saveToDisk.radioGroup.selectedItem = saveToDisk; } // If we don't have a "default app" then disable that choice. if ( !this.openWithDefaultOK() ) { // Disable that choice. useDefault.hidden = true; // If that's the default, then switch to "save to disk." if ( useDefault.selected ) { useDefault.radioGroup.selectedItem = this.dialogElement( "saveToDisk" ); } } // Enable/Disable choose application button and textfield this.toggleChoice(); },
if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && !this.mForced) {
if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && this.mReason != REASON_SERVERREQUEST) {
initAppAndSaveToDiskValues: function() { // Fill in helper app info, if there is any. this.chosenApp = this.mLauncher.MIMEInfo.preferredApplicationHandler; // Initialize "default application" field. this.initDefaultApp(); // Fill application name textbox. if (this.chosenApp && this.chosenApp.path) { this.dialogElement( "appPath" ).value = this.getPath(this.chosenApp); } var useDefault = this.dialogElement( "useSystemDefault" );; if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && !this.mForced) { // Open (using system default). useDefault.radioGroup.selectedItem = useDefault; } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && !this.mForced) { // Open with given helper app. var openUsing = this.dialogElement( "openUsing" ); openUsing.radioGroup.selectedItem = openUsing; } else { // Save to disk. var saveToDisk = this.dialogElement( "saveToDisk" ); saveToDisk.radioGroup.selectedItem = saveToDisk; } // If we don't have a "default app" then disable that choice. if ( !this.openWithDefaultOK() ) { // Disable that choice. useDefault.hidden = true; // If that's the default, then switch to "save to disk." if ( useDefault.selected ) { useDefault.radioGroup.selectedItem = this.dialogElement( "saveToDisk" ); } } // Enable/Disable choose application button and textfield this.toggleChoice(); },
} else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && !this.mForced) {
} else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && this.mReason != REASON_SERVERREQUEST) {
initAppAndSaveToDiskValues: function() { // Fill in helper app info, if there is any. this.chosenApp = this.mLauncher.MIMEInfo.preferredApplicationHandler; // Initialize "default application" field. this.initDefaultApp(); // Fill application name textbox. if (this.chosenApp && this.chosenApp.path) { this.dialogElement( "appPath" ).value = this.getPath(this.chosenApp); } var useDefault = this.dialogElement( "useSystemDefault" );; if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && !this.mForced) { // Open (using system default). useDefault.radioGroup.selectedItem = useDefault; } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && !this.mForced) { // Open with given helper app. var openUsing = this.dialogElement( "openUsing" ); openUsing.radioGroup.selectedItem = openUsing; } else { // Save to disk. var saveToDisk = this.dialogElement( "saveToDisk" ); saveToDisk.radioGroup.selectedItem = saveToDisk; } // If we don't have a "default app" then disable that choice. if ( !this.openWithDefaultOK() ) { // Disable that choice. useDefault.hidden = true; // If that's the default, then switch to "save to disk." if ( useDefault.selected ) { useDefault.radioGroup.selectedItem = this.dialogElement( "saveToDisk" ); } } // Enable/Disable choose application button and textfield this.toggleChoice(); },
if ("getBrowserURL" in window)
var app = getService("@mozilla.org/xre/app-info;1", "nsIXULAppInfo"); if (app) { switch (app.ID) { case "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": client.host = "Firefox"; if (compareVersions(app.version, "1.4") <= 0) client.hostCompat.typeChromeBrowser = true; break; case "{" + __cz_guid + "}": client.host = "XULrunner"; client.hostCompat.typeChromeBrowser = true; break; case "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}": client.host = "Mozilla"; client.hostCompat.typeChromeBrowser = true; break; default: client.host = ""; } } else if ("getBrowserURL" in window)
function initApplicationCompatibility(){ // This routine does nothing more than tweak the UI based on the host // application. // Set up simple host and platform information. client.host = "Unknown"; if ("getBrowserURL" in window) { var url = getBrowserURL(); if (url == "chrome://navigator/content/navigator.xul") client.host = "Mozilla"; else if (url == "chrome://browser/content/browser.xul") client.host = "Firefox"; else client.host = ""; // We don't know this host. Show an error later. } else { client.host = "XULrunner"; } client.platform = "Unknown"; if (navigator.platform.search(/mac/i) > -1) client.platform = "Mac"; if (navigator.platform.search(/win/i) > -1) client.platform = "Windows"; if (navigator.platform.search(/linux/i) > -1) client.platform = "Linux"; if (navigator.platform.search(/os\/2/i) > -1) client.platform = "OS/2"; client.hostPlatform = client.host + client.platform; CIRCServer.prototype.OS_RPLY = navigator.oscpu + " (" + navigator.platform + ")"; // Windows likes \r\n line endings, as wussy-notepad can't cope with just // \n logs. if (client.platform == "Windows") client.lineEnd = "\r\n"; else client.lineEnd = "\n";}
} else { client.host = "XULrunner";
function initApplicationCompatibility(){ // This routine does nothing more than tweak the UI based on the host // application. // Set up simple host and platform information. client.host = "Unknown"; if ("getBrowserURL" in window) { var url = getBrowserURL(); if (url == "chrome://navigator/content/navigator.xul") client.host = "Mozilla"; else if (url == "chrome://browser/content/browser.xul") client.host = "Firefox"; else client.host = ""; // We don't know this host. Show an error later. } else { client.host = "XULrunner"; } client.platform = "Unknown"; if (navigator.platform.search(/mac/i) > -1) client.platform = "Mac"; if (navigator.platform.search(/win/i) > -1) client.platform = "Windows"; if (navigator.platform.search(/linux/i) > -1) client.platform = "Linux"; if (navigator.platform.search(/os\/2/i) > -1) client.platform = "OS/2"; client.hostPlatform = client.host + client.platform; CIRCServer.prototype.OS_RPLY = navigator.oscpu + " (" + navigator.platform + ")"; // Windows likes \r\n line endings, as wussy-notepad can't cope with just // \n logs. if (client.platform == "Windows") client.lineEnd = "\r\n"; else client.lineEnd = "\n";}
var caption = document.getElementById("BackColorCaption"); if (caption) { var captionStr; var isSelectedObj = new Object(); var tagNameObj = new Object(); var element = editorShell.GetSelectedOrParentTableElement(tagNameObj, isSelectedObj); if (tagNameObj.value == "table") captionStr = editorShell.GetString("TableBackColor"); else if (tagNameObj.value == "td") captionStr = editorShell.GetString("CellBackColor"); else captionStr = editorShell.GetString("PageBackColor"); caption.setAttribute("value",captionStr); }
SetBackColorString("BackColorCaption");
function InitBackColorPopup(){ var caption = document.getElementById("BackColorCaption"); if (caption) { var captionStr; var isSelectedObj = new Object(); var tagNameObj = new Object(); var element = editorShell.GetSelectedOrParentTableElement(tagNameObj, isSelectedObj); if (tagNameObj.value == "table") captionStr = editorShell.GetString("TableBackColor"); else if (tagNameObj.value == "td") captionStr = editorShell.GetString("CellBackColor"); else captionStr = editorShell.GetString("PageBackColor"); caption.setAttribute("value",captionStr); }}
function InitBackColorPopup()
function InitBackColorPopup(allowPageBackground)
function InitBackColorPopup(){ SetBackColorString("BackColorCaption"); }
SetBackColorString("BackColorCaption");
SetBackColorString("BackColorCaption", allowPageBackground);
function InitBackColorPopup(){ SetBackColorString("BackColorCaption"); }
var opacity = getSpecifiedStyle("-moz-opacity");
var opacity = getSpecifiedStyle("opacity");
function InitBackgroundTabPanel(){ gDialog.selectedTab = BACKGROUND_TAB; if (!gDialog.selectedObject || !gDialog.selectedObject.style) return; gDialog.opacityScrollbar.removeEventListener("DOMAttrModified", onOpacityScrollbarAttrModified, false); var opacity = getSpecifiedStyle("-moz-opacity"); if (opacity == "") opacity = 1; gDialog.opacityScrollbar.setAttribute("curpos", opacity*1000); gDialog.opacityScrollbar.addEventListener("DOMAttrModified", onOpacityScrollbarAttrModified, false); /* INIT BACKGROUND-COLOR */ backgroundColor = ConvertRGBColorIntoHEXColor(getSpecifiedStyle("background-color")); gDialog.backgroundColorInput.setAttribute("value", backgroundColor); if (backgroundColor == "") backgroundColor = "white"; setColorWell("backgroundCW", backgroundColor); AddStyleToElement(gDialog.backgroundPreview, "background-color", backgroundColor); /* INIT BACKGROUND-REPEAT */ var backgroundRepeat = getSpecifiedStyle("background-repeat"); var choice = "repeatBackgroundRepeatMenu"; if (backgroundRepeat == "no-repeat") { choice = "norepeatBackgroundRepeatMenu"; } else if (backgroundRepeat == "repeat-x") { choice = "horizontallyBackgroundRepeatMenu"; } else if (backgroundRepeat == "repeat-y") { choice = "verticallyBackgroundRepeatMenu"; } else if (backgroundRepeat == "repeat") { choice = "repeatBackgroundRepeatMenu"; } AddStyleToElement(gDialog.backgroundPreview, "background-repeat", backgroundRepeat); var choiceItem = document.getElementById(choice); gDialog.backgroundRepeatMenulist.selectedItem = choiceItem; /* INIT BACKGROUND-IMAGE */ var backgroundImage = getSpecifiedStyle("background-image"); gDialog.backgroundImageInput.setAttribute("value", backgroundImage); enableBackgroundProps( (backgroundImage != "none" && backgroundImage != "") ); AddStyleToElement(gDialog.backgroundPreview, "background-image", backgroundImage); /* INIT BACKGROUND-ATTACHMENT */ var backgroundAttachment = getSpecifiedStyle("background-attachment"); gDialog.backgroundAttachmentCheckbox.checked = ( (backgroundAttachment == "fixed") ? false : true ); AddStyleToElement(gDialog.backgroundPreview, "background-attachment", backgroundAttachment); /* INIT BACKGROUND-POSITION */ var xBackgroundPosition = getSpecifiedStyle("-x-background-x-position"); var yBackgroundPosition = getSpecifiedStyle("-x-background-y-position"); var xRadio, yRadio; if (xBackgroundPosition == "100%" || xBackgroundPosition == "right") xRadio = "rightXBackgroundPositionRadio"; else if (xBackgroundPosition == "50%" || xBackgroundPosition == "center") xRadio = "centerXBackgroundPositionRadio"; else xRadio = "leftXBackgroundPositionRadio"; if (yBackgroundPosition == "100%" || yBackgroundPosition == "bottom") yRadio = "bottomYBackgroundPositionRadio"; else if (xBackgroundPosition == "50%" || yBackgroundPosition == "center") yRadio = "centerYBackgroundPositionRadio"; else yRadio = "topYBackgroundPositionRadio"; gDialog.xBackgroundPositionRadiogroup.selectedItem = document.getElementById(xRadio); gDialog.yBackgroundPositionRadiogroup.selectedItem = document.getElementById(yRadio); AddStyleToElement(gDialog.backgroundPreview, "background-attachment", xBackgroundPosition + " " + yBackgroundPosition);}
CalDuration = new Components.Constructor("@mozilla.org/calendar/duration;1", Components.interfaces.calIDateTime);
function initBaseComponent(){ CalRecurrenceInfo = new Components.Constructor(kCalRecurrenceInfoContractID, kCalIRecurrenceInfo); CalRecurrenceRule = new Components.Constructor(kCalRecurrenceRuleContractID, kCalIRecurrenceRule); CalRecurrenceDateSet = new Components.Constructor(kCalRecurrenceDateSetContractID, kCalIRecurrenceDateSet); CalRecurrenceDate = new Components.Constructor(kCalRecurrenceDateContractID, kCalIRecurrenceDate); CalDateTime = new Components.Constructor("@mozilla.org/calendar/datetime;1", Components.interfaces.calIDateTime); CalAttendee = new Components.Constructor("@mozilla.org/calendar/attendee;1", Components.interfaces.calIAttendee);}
var name = srGetStrBundle("chrome: .GetStringFromName("homeCalendarName");
var name = calGetString("calendar", "homeCalendarName");
function initCalendarManager(){ var calMgr = getCalendarManager(); var composite = getCompositeCalendar(); if (calMgr.getCalendars({}).length == 0) { var homeCalendar = calMgr.createCalendar("storage", makeURL("moz-profile-calendar://")); calMgr.registerCalendar(homeCalendar); var name = srGetStrBundle("chrome://calendar/locale/calendar.properties") .GetStringFromName("homeCalendarName"); homeCalendar.name = name; composite.addCalendar(homeCalendar); } calMgr.addObserver(calCalendarManagerObserver); composite.addObserver(calCompositeCalendarObserver); setCalendarManagerUI(); initColors(); var calendarList = document.getElementById("list-calendars-listbox"); calendarList.addEventListener("select", onCalendarListSelect, true); // Set up a pref listener so the proper UI bits can be refreshed when prefs // are changed. var pb2 = prefService.getBranch("").QueryInterface( Components.interfaces.nsIPrefBranch2); pb2.addObserver("calendar.", calPrefObserver, false);}
previousValue= dialog.CellHeightInput.value;
previousValue= dialog.CellWidthInput.value;
function InitCellPanel(){ // Get cell attributes if (globalCellElement) { // This assumes order of items is Cell, Row, Column dialog.SelectionList.selectedIndex = SelectedCellsType-1; var previousValue = dialog.CellHeightInput.value; dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits", gPercent); dialog.CellHeightCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellHeightInput.value; previousValue= dialog.CellHeightInput.value; dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits", gPixel); dialog.CellWidthCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellWidthInput.value; previousValue = dialog.RowSpanInput.value; dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.RowSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.RowSpanInput.value; previousValue = dialog.ColSpanInput.value; dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); dialog.ColSpanCheckbox.checked = AdvancedEditUsed && previousValue != dialog.ColSpanInput.value; var previousIndex = dialog.CellVAlignList.selectedIndex; var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) dialog.CellVAlignList.selectedIndex = 0; else if (valign == bottomStr) dialog.CellVAlignList.selectedIndex = 2; else // Default = middle dialog.CellVAlignList.selectedIndex = 1; dialog.CellVAlignCheckbox.checked = AdvancedEditUsed && previousValue != dialog.CellVAlignList.selectedIndex; previousIndex = dialog.CellHAlignList.selectedIndex; previousValue = dialog.CellAlignCharInput.value; // Clear in case alignment type isn't "char" dialog.CellAlignCharInput.value = ""; var halign = globalCellElement.align.toLowerCase(); switch (halign) { case centerStr: dialog.CellHAlignList.selectedIndex = 1; break; case rightStr: dialog.CellHAlignList.selectedIndex = 2; break; case justifyStr: dialog.CellHAlignList.selectedIndex = 3; break; case charStr: dialog.CellHAlignList.selectedIndex = 4; dialog.CellAlignCharInput.value = alignChar; break; default: // left dialog.CellHAlignList.selectedIndex = 0; break; } dialog.CellHAlignCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.CellHAlignList.selectedIndex || previousValue != dialog.CellAlignCharInput.value; previousIndex = dialog.CellStyleList.selectedIndex; dialog.CellStyleList.selectedIndex = (globalCellElement.nodeName.toLowerCase() == "th") ? 1 : 0; dialog.CellStyleCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.CellStyleList.selectedIndex; previousIndex = dialog.TextWrapList.selectedIndex; dialog.TextWrapList.selectedIndex = globalCellElement.noWrap ? 1 : 0; dialog.TextWrapCheckbox.checked = AdvancedEditUsed && previousIndex != dialog.TextWrapList.selectedIndex; previousValue = CellColor; SetColor("cellBackgroundCW", globalCellElement.bgColor); dialog.CellColorCheckbox.checked = AdvancedEditUsed && CellColor != globalCellElement.bgColor; CellColor = globalCellElement.bgColor; // We want to set this true in case changes came // from Advanced Edit dialog session (must assume something changed) CellDataChanged = true; }}
dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits"); dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits");
dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits", gPercent); dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits", gPixel);
function InitCellPanel(){ // Get cell attributes if (globalCellElement) { // This assumes order of items is Cell, Row, Column dialog.SelectionList.selectedIndex = SelectedCellsType-1; dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits"); dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits"); dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) dialog.CellVAlignList.selectedIndex = 0; else if (valign == bottomStr) dialog.CellVAlignList.selectedIndex = 2; else // Default = middle dialog.CellVAlignList.selectedIndex = 1; var halign = globalCellElement.align.toLowerCase(); switch (halign) { case centerStr: dialog.CellHAlignList.selectedIndex = 1; break; case rightStr: dialog.CellHAlignList.selectedIndex = 2; break; case justifyStr: dialog.CellHAlignList.selectedIndex = 3; break; case charStr: var alignChar = globalCellElement.getAttribute(charStr); if (alignChar && alignChar.length == 1) { dialog.CellAlignCharInput.value = alignChar; dialog.CellHAlignList.selectedIndex = 4; dialog.CellAlignCharInput.removeAttribute("collapsed"); } else { // "char" align set but no alignment char value dialog.CellHAlignList.selectedIndex = 0; } break; default: // left dialog.CellHAlignList.selectedIndex = 0; break; } // Hide align char input if not that align type dialog.CellHAlignList.selectedIndex != 4 dialog.CellAlignCharInput.setAttribute("collapsed","true"); dialog.CellStyleList.selectedIndex = (globalCellElement.nodeName == "TH") ? 1 : 0; dialog.TextWrapList.selectedIndex = globalCellElement.noWrap ? 1 : 0; SetColor("cellBackgroundCW", globalCellElement.bgColor); if (globalCellElement.background) dialog.CellImageInput.value = globalCellElement.background; }}
if (globalCellElement.background) dialog.CellImageInput.value = globalCellElement.background;
function InitCellPanel(){ // Get cell attributes if (globalCellElement) { // This assumes order of items is Cell, Row, Column dialog.SelectionList.selectedIndex = SelectedCellsType-1; dialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits"); dialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits"); dialog.RowSpanInput.value = globalCellElement.getAttribute("rowspan"); dialog.ColSpanInput.value = globalCellElement.getAttribute("colspan"); var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) dialog.CellVAlignList.selectedIndex = 0; else if (valign == bottomStr) dialog.CellVAlignList.selectedIndex = 2; else // Default = middle dialog.CellVAlignList.selectedIndex = 1; var halign = globalCellElement.align.toLowerCase(); switch (halign) { case centerStr: dialog.CellHAlignList.selectedIndex = 1; break; case rightStr: dialog.CellHAlignList.selectedIndex = 2; break; case justifyStr: dialog.CellHAlignList.selectedIndex = 3; break; case charStr: var alignChar = globalCellElement.getAttribute(charStr); if (alignChar && alignChar.length == 1) { dialog.CellAlignCharInput.value = alignChar; dialog.CellHAlignList.selectedIndex = 4; dialog.CellAlignCharInput.removeAttribute("collapsed"); } else { // "char" align set but no alignment char value dialog.CellHAlignList.selectedIndex = 0; } break; default: // left dialog.CellHAlignList.selectedIndex = 0; break; } // Hide align char input if not that align type dialog.CellHAlignList.selectedIndex != 4 dialog.CellAlignCharInput.setAttribute("collapsed","true"); dialog.CellStyleList.selectedIndex = (globalCellElement.nodeName == "TH") ? 1 : 0; dialog.TextWrapList.selectedIndex = globalCellElement.noWrap ? 1 : 0; SetColor("cellBackgroundCW", globalCellElement.bgColor); if (globalCellElement.background) dialog.CellImageInput.value = globalCellElement.background; }}
var valign = globalCellElement.vAlign.toLowerCase();
var valign = GetHTMLOrCSSStyleValue(globalCellElement, "valign", "vertical-align").toLowerCase();
function InitCellPanel(){ // Get cell attributes if (globalCellElement) { // This assumes order of items is Cell, Row, Column gDialog.SelectionList.selectedIndex = SelectedCellsType-1; var previousValue = gDialog.CellHeightInput.value; gDialog.CellHeightInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "height", "CellHeightUnits", gPixel); gDialog.CellHeightCheckbox.checked = AdvancedEditUsed && previousValue != gDialog.CellHeightInput.value; previousValue= gDialog.CellWidthInput.value; gDialog.CellWidthInput.value = InitPixelOrPercentMenulist(globalCellElement, CellElement, "width", "CellWidthUnits", gPixel); gDialog.CellWidthCheckbox.checked = AdvancedEditUsed && previousValue != gDialog.CellWidthInput.value; var previousIndex = gDialog.CellVAlignList.selectedIndex; var valign = globalCellElement.vAlign.toLowerCase(); if (valign == topStr) gDialog.CellVAlignList.selectedIndex = 0; else if (valign == bottomStr) gDialog.CellVAlignList.selectedIndex = 2; else // Default = middle gDialog.CellVAlignList.selectedIndex = 1; gDialog.CellVAlignCheckbox.checked = AdvancedEditUsed && previousValue != gDialog.CellVAlignList.selectedIndex; previousIndex = gDialog.CellHAlignList.selectedIndex; alignWasChar = false; var halign = GetHTMLOrCSSStyleValue(globalCellElement, "align", "text-align").toLowerCase(); switch (halign) { case centerStr: gDialog.CellHAlignList.selectedIndex = 1; break; case rightStr: gDialog.CellHAlignList.selectedIndex = 2; break; case justifyStr: gDialog.CellHAlignList.selectedIndex = 3; break; case charStr: // We don't support UI for this because layout doesn't work: bug 2212. // Remember that's what they had so we don't change it // unless they change the alignment by using the menulist alignWasChar = true; // Fall through to use show default alignment in menu default: // Default depends on cell type (TH is "center", TD is "left") gDialog.CellHAlignList.selectedIndex = (globalCellElement.nodeName.toLowerCase() == "th") ? 1 : 0; break; } gDialog.CellHAlignCheckbox.checked = AdvancedEditUsed && previousIndex != gDialog.CellHAlignList.selectedIndex; previousIndex = gDialog.CellStyleList.selectedIndex; gDialog.CellStyleList.selectedIndex = (globalCellElement.nodeName.toLowerCase() == "th") ? 1 : 0; gDialog.CellStyleCheckbox.checked = AdvancedEditUsed && previousIndex != gDialog.CellStyleList.selectedIndex; previousIndex = gDialog.TextWrapList.selectedIndex; if (GetHTMLOrCSSStyleValue(globalCellElement, "nowrap", "white-space") == "nowrap") gDialog.TextWrapList.selectedIndex = 1; else gDialog.TextWrapList.selectedIndex = 0; gDialog.TextWrapCheckbox.checked = AdvancedEditUsed && previousIndex != gDialog.TextWrapList.selectedIndex; previousValue = CellColor; CellColor = GetHTMLOrCSSStyleValue(globalCellElement, bgcolor, cssBackgroundColorStr); CellColor = ConvertRGBColorIntoHEXColor(CellColor); SetColor("cellBackgroundCW", CellColor); gDialog.CellColorCheckbox.checked = AdvancedEditUsed && previousValue != CellColor; // We want to set this true in case changes came // from Advanced Edit dialog session (must assume something changed) CellDataChanged = true; }}
this.showItem( "context-copyemail", this.onMailtoLink );
initClipboardItems : function () { // Select All is always OK, unless in directory listing. this.showItem( "context-selectall", !this.inDirList ); // Copy depends on whether there is selected text. // Enabling this context menu item is now done through the global // command updating system // this.setItemAttr( "context-copy", "disabled", this.isNoTextSelected() ); goUpdateGlobalEditMenuItems(); // Items for text areas this.showItem( "context-cut", this.onTextInput ); this.showItem( "context-paste", this.onTextInput ); // XXX dr // ------ // nsDocumentViewer.cpp has code to determine whether we're // on a link or an image. we really ought to be using that... // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); },
this.setItemAttr( "context-copy", "disabled", this.isNoTextSelected() );
initClipboardItems : function () { // Select All is always OK. // Copy depends on whether there is selected text. this.setItemAttr( "context-copy", "disabled", this.isNoTextSelected() ); // Copy link location depends on whether we're on a link. this.showItem( "context-copylink", this.onLink ); // Copy image location depends on whether we're on an image. this.showItem( "context-copyimage", this.onImage ); },