Fix JavaScript warnings in strict mode. r=pchen
git-svn-id: svn://10.0.0.236/trunk@78424 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
28c6a497f2
commit
707e9c93fa
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
var pref = null;
|
||||
var gURLBar = null;
|
||||
var bundle = srGetStrBundle("chrome://navigator/locale/navigator.properties");
|
||||
var brandBundle = srGetStrBundle("chrome://global/locale/brand.properties");
|
||||
|
||||
@ -218,6 +219,7 @@ nsXULBrowserWindow.prototype =
|
||||
if(iid.equals(Components.interfaces.nsIXULBrowserWindow))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
return null; // quiet warnings
|
||||
},
|
||||
setJSStatus : function(status)
|
||||
{
|
||||
@ -592,6 +594,8 @@ function gotoHistoryIndex( aEvent )
|
||||
else if (id == "menuitem-forward")
|
||||
BrowserForward();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function BrowserBack()
|
||||
@ -647,6 +651,8 @@ function BrowserHome()
|
||||
|
||||
function OpenBookmarkURL(node, datasources)
|
||||
{
|
||||
// what is the meaning of the return value from this function?
|
||||
|
||||
if (node.getAttribute('container') == "true") {
|
||||
return false;
|
||||
}
|
||||
@ -678,17 +684,26 @@ function OpenBookmarkURL(node, datasources)
|
||||
// Check if we have a browser window
|
||||
if ( window._content == null )
|
||||
{
|
||||
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
|
||||
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//window._content.location.href = url;
|
||||
if (appCore)
|
||||
{
|
||||
appCore.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
dump("BrowserAppCore is not initialised\n");
|
||||
RefreshUrlbar();
|
||||
return false;
|
||||
}
|
||||
RefreshUrlbar();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function OpenSearch(tabName, forceDialogFlag, searchStr)
|
||||
@ -1147,8 +1162,8 @@ function BrowserChangeTextSize(newSize)
|
||||
if (aOffset > 0)
|
||||
{
|
||||
var cmd = text.substr(0, aOffset);
|
||||
var text = text.substr(aOffset+1);
|
||||
var shortcutURL = bmks.FindShortcut(cmd);
|
||||
text = text.substr(aOffset+1);
|
||||
shortcutURL = bmks.FindShortcut(cmd);
|
||||
if ((shortcutURL) && (shortcutURL != "") && (text != ""))
|
||||
{
|
||||
aOffset = shortcutURL.indexOf("%s");
|
||||
@ -1192,7 +1207,7 @@ function BrowserChangeTextSize(newSize)
|
||||
.classes["component://netscape/widget/transferable"]
|
||||
.createInstance( Components.interfaces.nsITransferable );
|
||||
if ( !clipboard || !trans )
|
||||
return;
|
||||
return null;
|
||||
|
||||
trans.addDataFlavor( "text/unicode" );
|
||||
clipboard.getData(trans, clipboard.kSelectionClipboard);
|
||||
@ -1424,8 +1439,8 @@ function TileWindow()
|
||||
var yOffset = screen.availRight;
|
||||
do
|
||||
{
|
||||
var currentWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );
|
||||
if ( currentWindow.screenX == screenX && currentWindow.screenY == screenY )
|
||||
var thisWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );
|
||||
if ( (thisWindow.screenX == screenX) && (thisWindow.screenY == screenY) )
|
||||
{
|
||||
alreadyThere = true;
|
||||
break;
|
||||
@ -1437,13 +1452,15 @@ function TileWindow()
|
||||
enumerator = windowManagerInterface.getEnumerator( null );
|
||||
do
|
||||
{
|
||||
var currentWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );
|
||||
if ( currentWindow.screenX == screenX+xOffset*xShift+yOffset*xShift && currentWindow.screenY == screenY+yShift*xOffset && window != currentWindow )
|
||||
var thatWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );
|
||||
if ( (thatWindow.screenX == screenX+xOffset*xShift+yOffset*xShift) &&
|
||||
(thatWindow.screenY == screenY+yShift*xOffset) &&
|
||||
(window != thatWindow) )
|
||||
{
|
||||
xOffset++;
|
||||
if ( (screenY+outerHeight < screen.availHeight) && (screenY+outerHeight+yShift*xOffset > screen.availHeight ) )
|
||||
{
|
||||
dump(" increment yOffset");
|
||||
// dump(" increment yOffset");
|
||||
yOffset++;
|
||||
xOffset = 0;
|
||||
}
|
||||
@ -1454,11 +1471,12 @@ function TileWindow()
|
||||
|
||||
if ( xOffset > 0 || yOffset >0 )
|
||||
{
|
||||
dump( "offsets:"+xOffset+" "+yOffset+"\n");
|
||||
dump("Move by ("+ xOffset*xShift + yOffset*xShift +","+ yShift*xOffset +")\n");
|
||||
// dump( "offsets:"+xOffset+" "+yOffset+"\n");
|
||||
// dump("Move by ("+ xOffset*xShift + yOffset*xShift +","+ yShift*xOffset +")\n");
|
||||
moveBy( xOffset*xShift + yOffset*xShift, yShift*xOffset );
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure that a window fits fully on the screen. Will move to preserve size, and then shrink to fit
|
||||
function FitToScreen()
|
||||
{
|
||||
@ -1584,7 +1602,7 @@ var consoleListener = {
|
||||
},
|
||||
|
||||
// whether or not an error alert is being displayed
|
||||
isShowingError: false,
|
||||
isShowingError: false
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ var RDFUtils = {
|
||||
{
|
||||
aResource = aResource.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
return aResource ? target.Value : null;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
function isBookmark(aURI)
|
||||
@ -89,7 +89,7 @@ var personalToolbarObserver = {
|
||||
|
||||
var personalToolbar = document.getElementById("PersonalToolbar");
|
||||
if (aEvent.target == personalToolbar)
|
||||
return;
|
||||
return null;
|
||||
|
||||
var childWithDatabase = document.getElementById("innermostBox");
|
||||
var uri = aEvent.target.id;
|
||||
@ -163,7 +163,8 @@ var personalToolbarObserver = {
|
||||
default:
|
||||
rdfContainer.InsertElementAt(elementRes, dropIndex+1, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
mCurrentDragOverButton: null,
|
||||
@ -220,6 +221,8 @@ var personalToolbarObserver = {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
getSupportedFlavours: function ()
|
||||
@ -257,8 +260,10 @@ var personalToolbarObserver = {
|
||||
if (aEvent.clientY > overButtonBoxObject.y &&
|
||||
aEvent.clientY < overButtonBoxObject.y + overButtonBoxObject.height)
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
var contentAreaDNDObserver = {
|
||||
@ -364,8 +369,8 @@ var contentAreaDNDObserver = {
|
||||
|
||||
onDrop: function (aEvent, aData, aDragSession)
|
||||
{
|
||||
var aData = aData.length ? aData[0] : aData;
|
||||
var url = retrieveURLFromData(aData);
|
||||
var data = aData.length ? aData[0] : aData;
|
||||
var url = retrieveURLFromData(data);
|
||||
if (url.length == 0)
|
||||
return;
|
||||
// valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out
|
||||
@ -402,7 +407,7 @@ var contentAreaDNDObserver = {
|
||||
aNode = aNode.parentNode;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
@ -431,8 +436,8 @@ var proxyIconDNDObserver = {
|
||||
var homeButtonObserver = {
|
||||
onDrop: function (aEvent, aData, aDragSession)
|
||||
{
|
||||
var aData = aData.length ? aData[0] : aData;
|
||||
var url = retrieveURLFromData(aData);
|
||||
var data = aData.length ? aData[0] : aData;
|
||||
var url = retrieveURLFromData(data);
|
||||
var showDialog = nsPreferences.getBoolPref("browser.homepage.enable_home_button_drop", false);
|
||||
var setHomepage;
|
||||
if (showDialog)
|
||||
@ -501,7 +506,7 @@ var homeButtonObserver = {
|
||||
flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" };
|
||||
flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" };
|
||||
return flavourList;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
function retrieveURLFromData (aData)
|
||||
|
||||
@ -317,7 +317,7 @@ nsContextMenu.prototype = {
|
||||
}
|
||||
|
||||
// Bubble out, looking for link.
|
||||
var elem = this.target;
|
||||
elem = this.target;
|
||||
while ( elem && !this.onLink ) {
|
||||
// Test for element types of interest.
|
||||
if ( elem.nodeType == 1 &&
|
||||
@ -697,7 +697,7 @@ nsContextMenu.prototype = {
|
||||
var data = this.createInstance( "component://netscape/supports-wstring",
|
||||
"nsISupportsWString" );
|
||||
if ( data ) {
|
||||
data.data = text ;
|
||||
data.data = text;
|
||||
transferable.setTransferData( "text/unicode", data, text.length * 2 );
|
||||
// Put on clipboard.
|
||||
clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard );
|
||||
@ -712,11 +712,11 @@ nsContextMenu.prototype = {
|
||||
if ( clipboard && transferableForSelection ) {
|
||||
transferableForSelection.addDataFlavor( "text/unicode" );
|
||||
// Create wrapper for text.
|
||||
var data = this.createInstance( "component://netscape/supports-wstring",
|
||||
var selectionData = this.createInstance( "component://netscape/supports-wstring",
|
||||
"nsISupportsWString" );
|
||||
if ( data ) {
|
||||
data.data = text ;
|
||||
transferableForSelection.setTransferData( "text/unicode", data, text.length * 2 );
|
||||
if ( selectionData ) {
|
||||
selectionData.data = text;
|
||||
transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 );
|
||||
// Put on clipboard.
|
||||
clipboard.setData( transferableForSelection, null,
|
||||
Components.interfaces.nsIClipboard.kSelectionClipboard );
|
||||
|
||||
@ -47,31 +47,35 @@ function FillHistoryMenu( aParent, aMenu )
|
||||
deleteHistoryItems( aParent );
|
||||
var count = shistory.count;
|
||||
var index = shistory.index;
|
||||
var end;
|
||||
var j;
|
||||
var entry;
|
||||
|
||||
switch (aMenu)
|
||||
{
|
||||
case "back":
|
||||
var end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0;
|
||||
for ( var j = index - 1; j >= end; j--)
|
||||
end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0;
|
||||
for ( j = index - 1; j >= end; j--)
|
||||
{
|
||||
var entry = shistory.getEntryAtIndex(j, false);
|
||||
entry = shistory.getEntryAtIndex(j, false);
|
||||
if (entry)
|
||||
createMenuItem( aParent, j, entry.title );
|
||||
}
|
||||
break;
|
||||
case "forward":
|
||||
var end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count;
|
||||
for ( var j = index + 1; j < end; j++)
|
||||
end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count;
|
||||
for ( j = index + 1; j < end; j++)
|
||||
{
|
||||
var entry = shistory.getEntryAtIndex(j, false);
|
||||
entry = shistory.getEntryAtIndex(j, false);
|
||||
if (entry)
|
||||
createMenuItem( aParent, j, entry.title );
|
||||
}
|
||||
break;
|
||||
case "go":
|
||||
var end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0;
|
||||
for( var j = count - 1; j >= end; j-- )
|
||||
end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0;
|
||||
for( j = count - 1; j >= end; j-- )
|
||||
{
|
||||
var entry = shistory.getEntryAtIndex(j, false);
|
||||
entry = shistory.getEntryAtIndex(j, false);
|
||||
if (entry)
|
||||
createCheckboxMenuItem( aParent, j, entry.title, j==index );
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ function xlateURL(key)
|
||||
//dump("\n>> xlateURL(" + key + "): ds=" + ds + ", loaded=" + loaded);
|
||||
if (!ds || !loaded) {
|
||||
dump("\n xlateURL(): data source is not loaded! Try again later! \n");
|
||||
return;
|
||||
return "";
|
||||
}
|
||||
// get data
|
||||
var srcNode = RDF.GetResource(key);
|
||||
@ -108,6 +108,8 @@ function xlateURL(key)
|
||||
else {
|
||||
dump("\n content target=" + contentTarget + "\n");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function loadXURL(key)
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<property name="autoCompleteSession">
|
||||
<![CDATA[
|
||||
if (this.getAttribute('searchSessionType') != "") {
|
||||
searchSession = unescape('component:%2F%2Fnetscape%2FautocompleteSession%26type=');
|
||||
var searchSession = unescape('component:%2F%2Fnetscape%2FautocompleteSession%26type=');
|
||||
searchSession = searchSession + this.getAttribute('searchSessionType');
|
||||
try {
|
||||
Components.classes[searchSession].getService(Components.interfaces.nsIAutoCompleteSession);
|
||||
@ -184,7 +184,7 @@
|
||||
{
|
||||
me.ignoreInputEvent = true;
|
||||
inputElement.value = menuitem.getAttribute("value");
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
inputElement.setSelectionRange(inputElement.value.length, inputElement.value.length);
|
||||
needToAutocomplete = false;
|
||||
me.privatefunc.selectedItemIndex = i;
|
||||
@ -199,7 +199,7 @@
|
||||
case 'startLookup':
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
if (!me.lastResults || inputElement.value != me.lastResults.searchString)
|
||||
me.autoCompleteSession.onStartLookup(inputElement.value, me.lastResults, me.autoCompleteListener);
|
||||
break;
|
||||
|
||||
@ -766,6 +766,7 @@ function TriStateColumnSort(column_name)
|
||||
}
|
||||
}
|
||||
sort_column(column, direction);
|
||||
return true;
|
||||
}
|
||||
|
||||
function sort_column(column, direction)
|
||||
@ -948,26 +949,26 @@ function fillContextMenu(name)
|
||||
*/
|
||||
|
||||
var lastWasSep = false;
|
||||
for (var cmdIndex = 0; cmdIndex < cmdArray.length; cmdIndex++)
|
||||
for (var commandIndex = 0; commandIndex < cmdArray.length; commandIndex++)
|
||||
{
|
||||
var cmd = cmdArray[cmdIndex];
|
||||
var cmd = cmdArray[commandIndex];
|
||||
if (!cmd) continue;
|
||||
var cmdResource = cmd.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (!cmdResource) break;
|
||||
|
||||
// handle separators
|
||||
if (cmdResource == separatorResource)
|
||||
{
|
||||
if (lastWasSep != true)
|
||||
// handle separators
|
||||
if (cmdResource == separatorResource)
|
||||
{
|
||||
lastWasSep = true;
|
||||
var menuItem = document.createElement("menuseparator");
|
||||
popupNode.appendChild(menuItem);
|
||||
if (lastWasSep != true)
|
||||
{
|
||||
lastWasSep = true;
|
||||
var menuItem = document.createElement("menuseparator");
|
||||
popupNode.appendChild(menuItem);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
lastWasSep = false;
|
||||
|
||||
lastWasSep = false;
|
||||
|
||||
var cmdNameNode = compositeDB.GetTarget(cmdResource, rdfNameResource,
|
||||
true);
|
||||
@ -980,12 +981,12 @@ function fillContextMenu(name)
|
||||
debug("Command #" + cmdIndex + ": id='" + cmdResource.Value +
|
||||
"' name='" + cmdName + "'");
|
||||
|
||||
var menuItem = document.createElement("menuitem");
|
||||
menuItem.setAttribute("value", cmdName);
|
||||
popupNode.appendChild(menuItem);
|
||||
var newMenuItem = document.createElement("menuitem");
|
||||
newMenuItem.setAttribute("value", cmdName);
|
||||
popupNode.appendChild(newMenuItem);
|
||||
// Work around bug #26402 by setting "oncommand" attribute
|
||||
// AFTER appending menuitem
|
||||
menuItem.setAttribute("oncommand",
|
||||
newMenuItem.setAttribute("oncommand",
|
||||
"return doContextCmd('"+cmdResource.Value+"');");
|
||||
}
|
||||
|
||||
@ -1024,12 +1025,12 @@ function fillContextMenu(name)
|
||||
|
||||
// And then add a "Properties" menu items
|
||||
var propMenuName = get_localized_string("BookmarkProperties");
|
||||
var menuItem = document.createElement("menuitem");
|
||||
menuItem.setAttribute("value", propMenuName);
|
||||
popupNode.appendChild(menuItem);
|
||||
var aMenuItem = document.createElement("menuitem");
|
||||
aMenuItem.setAttribute("value", propMenuName);
|
||||
popupNode.appendChild(aMenuItem);
|
||||
// Work around bug # 26402 by setting "oncommand" attribute
|
||||
// AFTER appending menuitem
|
||||
menuItem.setAttribute("oncommand", "return BookmarkProperties();");
|
||||
aMenuItem.setAttribute("oncommand", "return BookmarkProperties();");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1049,12 +1050,16 @@ function doContextCmd(cmdName)
|
||||
|
||||
var nameVal = "";
|
||||
var urlVal = "";
|
||||
|
||||
var promptStr;
|
||||
|
||||
var picker_uri;
|
||||
var filePicker;
|
||||
|
||||
if (cmdName == NC_NS + "command?cmd=newbookmark")
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var promptStr = get_localized_string("NewBookmarkURLPrompt");
|
||||
promptStr = get_localized_string("NewBookmarkURLPrompt");
|
||||
urlVal = prompt(promptStr, "");
|
||||
if (!urlVal || urlVal=="") return false;
|
||||
|
||||
@ -1070,7 +1075,7 @@ function doContextCmd(cmdName)
|
||||
}
|
||||
else if (cmdName == NC_NS + "command?cmd=newfolder")
|
||||
{
|
||||
var promptStr = get_localized_string("NewFolderNamePrompt");
|
||||
promptStr = get_localized_string("NewFolderNamePrompt");
|
||||
nameVal = prompt(promptStr, "");
|
||||
if (!nameVal || nameVal=="") return false;
|
||||
}
|
||||
@ -1086,11 +1091,11 @@ function doContextCmd(cmdName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var picker_uri = "component://mozilla/filepicker";
|
||||
var filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker);
|
||||
picker_uri = "component://mozilla/filepicker";
|
||||
filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker);
|
||||
if (!filePicker) return false;
|
||||
|
||||
var promptStr = get_localized_string("SelectImport");
|
||||
promptStr = get_localized_string("SelectImport");
|
||||
filePicker.init(window, promptStr, nsIFilePicker.modeOpen);
|
||||
filePicker.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterAll);
|
||||
if (filePicker.show() != nsIFilePicker.returnCancel)
|
||||
@ -1109,11 +1114,11 @@ function doContextCmd(cmdName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var picker_uri = "component://mozilla/filepicker";
|
||||
var filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker);
|
||||
picker_uri = "component://mozilla/filepicker";
|
||||
filePicker = Components.classes[picker_uri].createInstance(nsIFilePicker);
|
||||
if (!filePicker) return false;
|
||||
|
||||
var promptStr = get_localized_string("EnterExport");
|
||||
promptStr = get_localized_string("EnterExport");
|
||||
filePicker.init(window, promptStr, nsIFilePicker.modeSave);
|
||||
filePicker.defaultString = "bookmarks.html";
|
||||
filePicker.appendFilters(nsIFilePicker.filterHTML | nsIFilePicker.filterAll);
|
||||
@ -1173,13 +1178,16 @@ function doContextCmd(cmdName)
|
||||
var select_list = treeNode.selectedItems;
|
||||
debug("# of Nodes selected: " + select_list.length);
|
||||
|
||||
var uri;
|
||||
var rdfNode;
|
||||
|
||||
if (select_list.length < 1)
|
||||
{
|
||||
// if nothing is selected, default to using the "ref"
|
||||
// on the root of the tree
|
||||
var uri = treeNode.getAttribute("ref");
|
||||
uri = treeNode.getAttribute("ref");
|
||||
if (!uri || uri=="") return false;
|
||||
var rdfNode = rdf.GetResource(uri);
|
||||
rdfNode = rdf.GetResource(uri);
|
||||
// add node into selection array
|
||||
if (rdfNode)
|
||||
{
|
||||
@ -1206,14 +1214,14 @@ function doContextCmd(cmdName)
|
||||
{
|
||||
var node = select_list[nodeIndex];
|
||||
if (!node) break;
|
||||
var uri = node.getAttribute("ref");
|
||||
uri = node.getAttribute("ref");
|
||||
if ((uri) || (uri == ""))
|
||||
{
|
||||
uri = node.getAttribute("id");
|
||||
}
|
||||
if (!uri) return false;
|
||||
|
||||
var rdfNode = rdf.GetResource(uri);
|
||||
rdfNode = rdf.GetResource(uri);
|
||||
if (!rdfNode) break;
|
||||
|
||||
// add node into selection array
|
||||
@ -1238,17 +1246,17 @@ function doContextCmd(cmdName)
|
||||
|
||||
if ((nameVal) && (nameVal != ""))
|
||||
{
|
||||
var nameLiteral = rdf.GetLiteral(nameVal);
|
||||
if (!nameLiteral) return false;
|
||||
var nameLiteral2 = rdf.GetLiteral(nameVal);
|
||||
if (!nameLiteral2) return false;
|
||||
argumentsArray.AppendElement(nameArc);
|
||||
argumentsArray.AppendElement(nameLiteral);
|
||||
argumentsArray.AppendElement(nameLiteral2);
|
||||
}
|
||||
if ((urlVal) && (urlVal != ""))
|
||||
{
|
||||
var urlLiteral = rdf.GetLiteral(urlVal);
|
||||
if (!urlLiteral) return false;
|
||||
var urlLiteral2 = rdf.GetLiteral(urlVal);
|
||||
if (!urlLiteral2) return false;
|
||||
argumentsArray.AppendElement(urlArc);
|
||||
argumentsArray.AppendElement(urlLiteral);
|
||||
argumentsArray.AppendElement(urlLiteral2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -247,6 +247,8 @@ function (force_reload)
|
||||
|
||||
// Pick sandboxed, or unsandboxed iframe
|
||||
var iframe = panel.get_iframe();
|
||||
var load_state;
|
||||
|
||||
if (selected_id == id) {
|
||||
is_after_selected = 1
|
||||
debug("item("+ii+") selected");
|
||||
@ -261,7 +263,7 @@ function (force_reload)
|
||||
iframe.setAttribute('src', src);
|
||||
}
|
||||
|
||||
var load_state = content.getAttribute('loadstate');
|
||||
load_state = content.getAttribute('loadstate');
|
||||
if (load_state == 'never loaded') {
|
||||
iframe.removeAttribute('hidden');
|
||||
iframe.setAttribute('loadstate', 'loading');
|
||||
@ -272,7 +274,7 @@ function (force_reload)
|
||||
header.removeAttribute('selected');
|
||||
content.setAttribute('collapsed','true');
|
||||
|
||||
var load_state = content.getAttribute('loadstate');
|
||||
load_state = content.getAttribute('loadstate');
|
||||
if (load_state == 'loading') {
|
||||
iframe.removeEventListener("load", panel_loader, true);
|
||||
content.setAttribute('hidden','true');
|
||||
@ -568,6 +570,7 @@ function sidebar_get_panels_file() {
|
||||
debug("Error: Unable to grab panels file.\n");
|
||||
throw(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function sidebar_revert_to_default_panels() {
|
||||
@ -579,15 +582,15 @@ function sidebar_revert_to_default_panels() {
|
||||
|
||||
// Since we just removed the panels file,
|
||||
// this should copy the defaults over.
|
||||
var sidebar_file = sidebar_get_panels_file();
|
||||
sidebar_file = sidebar_get_panels_file();
|
||||
|
||||
debug("sidebar defaults reloaded");
|
||||
var datasource = RDF.GetDataSource(sidebarObj.datasource_uri);
|
||||
datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Refresh(true);
|
||||
} catch (ex) {
|
||||
debug("Error: Unable to reload panel defaults file.\n");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function get_sidebar_datasource_uri() {
|
||||
@ -599,8 +602,8 @@ function get_sidebar_datasource_uri() {
|
||||
} catch (ex) {
|
||||
// This should not happen
|
||||
debug("Error: Unable to load panels file.\n");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the template for the available panels url from preferences.
|
||||
@ -904,7 +907,7 @@ if (!SB_DEBUG) {
|
||||
debug = function (s) {};
|
||||
dump_attributes = function (node, depth) {};
|
||||
dump_tree = function (node) {};
|
||||
_dump_tree_recur = function (node, depth, index) {};
|
||||
var _dump_tree_recur = function (node, depth, index) {};
|
||||
} else {
|
||||
debug = function (s) { dump("-*- sbOverlay: " + s + "\n"); };
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@ function mailCharsetLoadListener (event)
|
||||
var wintype = document.firstChild.getAttribute('windowtype');
|
||||
if (window && (wintype == "navigator:browser"))
|
||||
{
|
||||
contentArea = window.document.getElementById("appcontent");
|
||||
var contentArea = window.document.getElementById("appcontent");
|
||||
if (contentArea)
|
||||
contentArea.addEventListener("load", charsetLoadListener, true);
|
||||
}
|
||||
@ -229,8 +229,8 @@ else
|
||||
var arrayOfStrings = wintype.split(":");
|
||||
if (window && arrayOfStrings[0] == "mail")
|
||||
{
|
||||
contentArea = window.document.getElementById("messagepane");
|
||||
if (contentArea)
|
||||
contentArea.addEventListener("load", mailCharsetLoadListener, true);
|
||||
var messageContent = window.document.getElementById("messagepane");
|
||||
if (messageContent)
|
||||
messageContent.addEventListener("load", mailCharsetLoadListener, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,9 +83,9 @@ var nsTransferable = {
|
||||
get: function (aFlavourList, aRetrievalFunc, aAnyFlag)
|
||||
{
|
||||
var firstFlavour = null;
|
||||
for (var flavour in aFlavourList)
|
||||
for (var flav in aFlavourList)
|
||||
{
|
||||
firstFlavour = flavour;
|
||||
firstFlavour = flav;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -128,17 +128,19 @@ var nsTransferable = {
|
||||
else
|
||||
{
|
||||
trans.getTransferData(firstFlavour, data, length);
|
||||
var currData = data ? this.wrapData(data.value, length.value, aFlavourList[firstFlavour].width) : null;
|
||||
var curData = data ? this.wrapData(data.value, length.value, aFlavourList[firstFlavour].width) : null;
|
||||
if (supportsArray.Count() == 1)
|
||||
return currData;
|
||||
return curData;
|
||||
else
|
||||
dataArray[i] = currData;
|
||||
dataArray[i] = curData;
|
||||
}
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
else
|
||||
throw "No data retrieval handler provided!";
|
||||
|
||||
return null; // quiet warnings
|
||||
},
|
||||
|
||||
/**
|
||||
@ -188,5 +190,7 @@ var nsTransferable = {
|
||||
var data = aDataObject.QueryInterface(IID);
|
||||
if (data)
|
||||
return data.data.substring(0, aLength / aWidth);
|
||||
},
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@ -92,6 +92,6 @@ var nsPreferences = {
|
||||
return aDefVal != undefined ? aDefVal : null;
|
||||
}
|
||||
return null; // quiet warnings
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -218,6 +218,7 @@ Contributor(s):
|
||||
return subnodes.length ? subnodes[0] : null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
@ -248,10 +249,11 @@ Contributor(s):
|
||||
return subnodes.length ? subnodes[0] : null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
</bindings>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user