rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
SearchTree.treeBoxObject.selection.selectEventsSuppressed = true; SearchTree.onselect = null; SearchTree.removeEventListener( "select", unifinderOnSelect, true ); | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
|
if( gCalendarEventTreeClicked === false ) | if( EventSelectionArray.length > 1 ) | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } | } else if( EventSelectionArray.length == 1 ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
} else if( EventSelectionArray.length == 1 ) | if( RowToScrollTo != "null" ) | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
|
gCalendarEventTreeClicked = false; | setTimeout( "resetSelection()", 1 ); | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
for ( j = 0; j < EventBoxes.length; j++ ) | for ( var j = 0; j < EventBoxes.length; j++ ) | onSelectionChanged : function( EventSelectionArray ) { if( EventSelectionArray.length > 0 ) { //if there are selected events. //for some reason, this function causes the tree to go into a select / unselect loop //putting it in a settimeout fixes this. setTimeout( "gCalendarWindow.monthView.clearSelectedDate();", 1 ); gCalendarWindow.monthView.clearSelectedBoxes(); var i = 0; for( i = 0; i < EventSelectionArray.length; i++ ) { var EventBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+EventSelectionArray[i].id ); for ( j = 0; j < EventBoxes.length; j++ ) { EventBoxes[j].setAttribute( "eventselected", "true" ); } } } else { //select the proper day gCalendarWindow.monthView.hiliteSelectedDate(); } } |
var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); | EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); | onSelectionChanged : function( EventSelectionArray ) { if( EventSelectionArray.length > 0 ) { setTimeout( "gCalendarWindow.multiweekView.clearSelectedDate();", 1 ); var i = 0; for( i = 0; i < EventSelectionArray.length; i++ ) { if( EventSelectionArray[i].due ) { var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); } else { var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); } for ( j = 0; j < EventBoxes.length; j++ ) { EventBoxes[j].setAttribute( "eventselected", "true" ); } } } else { //select the proper day gCalendarWindow.multiweekView.hiliteSelectedDate(); } } |
var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); | EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); | onSelectionChanged : function( EventSelectionArray ) { if( EventSelectionArray.length > 0 ) { setTimeout( "gCalendarWindow.multiweekView.clearSelectedDate();", 1 ); var i = 0; for( i = 0; i < EventSelectionArray.length; i++ ) { if( EventSelectionArray[i].due ) { var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); } else { var EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); } for ( j = 0; j < EventBoxes.length; j++ ) { EventBoxes[j].setAttribute( "eventselected", "true" ); } } } else { //select the proper day gCalendarWindow.multiweekView.hiliteSelectedDate(); } } |
SearchTree.treeBoxObject.selection.select( -1 ); | SearchTree.treeBoxObject.selection.clearSelection( ); | onSelectionChanged : function( EventSelectionArray ) { if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); SearchTree.treeBoxObject.selection.select( -1 ); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.select( RowToScrollTo ); } } } gCalendarEventTreeClicked = false; SearchTree.focus(); } |
SearchTree.treeBoxObject.selection.select( RowToScrollTo ); | SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); | onSelectionChanged : function( EventSelectionArray ) { if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); SearchTree.treeBoxObject.selection.select( -1 ); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.select( RowToScrollTo ); } } } gCalendarEventTreeClicked = false; SearchTree.focus(); } |
SearchTree.focus(); | onSelectionChanged : function( EventSelectionArray ) { if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); SearchTree.treeBoxObject.selection.select( -1 ); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.select( RowToScrollTo ); } } } gCalendarEventTreeClicked = false; SearchTree.focus(); } |
|
if( EventSelectionArray[i].due ) | if("due" in EventSelectionArray[i] && EventSelectionArray[i].due ) | onSelectionChanged : function( EventSelectionArray ) { if( EventSelectionArray.length > 0 ) { setTimeout( "gCalendarWindow.multiweekView.clearSelectedDate();", 1 ); var i = 0; for( i = 0; i < EventSelectionArray.length; i++ ) { var EventBoxes; if( EventSelectionArray[i].due ) { EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); } else { EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); } for ( j = 0; j < EventBoxes.length; j++ ) { EventBoxes[j].setAttribute( "eventselected", "true" ); } } } else { //select the proper day gCalendarWindow.multiweekView.hiliteSelectedDate(); } } |
for ( j = 0; j < EventBoxes.length; j++ ) | for (var j = 0; j < EventBoxes.length; j++ ) | onSelectionChanged : function( EventSelectionArray ) { if( EventSelectionArray.length > 0 ) { setTimeout( "gCalendarWindow.multiweekView.clearSelectedDate();", 1 ); var i = 0; for( i = 0; i < EventSelectionArray.length; i++ ) { var EventBoxes; if( EventSelectionArray[i].due ) { EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-todo-box-"+EventSelectionArray[i].id ); } else { EventBoxes = document.getElementsByAttribute( "name", "multiweek-view-event-box-"+EventSelectionArray[i].id ); } for ( j = 0; j < EventBoxes.length; j++ ) { EventBoxes[j].setAttribute( "eventselected", "true" ); } } } else { //select the proper day gCalendarWindow.multiweekView.hiliteSelectedDate(); } } |
viewMenu.setAttribute('disabled', true); | function onShowAttachmentContextMenu(){ // if no attachments are selected, disable the Open and Save... var attachmentList = document.getElementById('attachmentList'); var selectedAttachments = attachmentList.selectedItems; var openMenu = document.getElementById('context-openAttachment'); var saveMenu = document.getElementById('context-saveAttachment'); var detachMenu = document.getElementById('context-detachAttachment'); var deleteMenu = document.getElementById('context-deleteAttachment'); var detachAllMenu = document.getElementById('context-detachAllAttachments'); var deleteAllMenu = document.getElementById('context-deleteAllAttachments'); var canDetach = CanDetachAttachments(); var canOpen = false; for (var i = 0; i < selectedAttachments.length && !canOpen; i++) canOpen = selectedAttachments[i].attachment.contentType != 'text/x-moz-deleted'; if (canOpen && selectedAttachments.length == 1) { openMenu.removeAttribute('disabled'); } else { openMenu.setAttribute('disabled', true); } if (canOpen) { saveMenu.removeAttribute('disabled'); } else { saveMenu.setAttribute('disabled', true); } if (canDetach && canOpen) { detachMenu.removeAttribute('disabled'); deleteMenu.removeAttribute('disabled'); } else { detachMenu.setAttribute('disabled', 'true'); deleteMenu.setAttribute('disabled', 'true'); } if (canDetach) { detachAllMenu.removeAttribute('disabled'); deleteAllMenu.removeAttribute('disabled'); } else { detachAllMenu.setAttribute('disabled', 'true'); deleteAllMenu.setAttribute('disabled', 'true'); }} |
|
var detailsDeck = document.getElementById("detailsDeck"); detailsDeck.selectedIndex = 1; | onShowMoreDetails: function() { var detailsDeck = document.getElementById("detailsDeck"); detailsDeck.selectedIndex = 1; var updateTypeElement = document.getElementById("updateType"); var moreInfoURL = document.getElementById("moreInfoURL"); var moreInfoContent = document.getElementById("moreInfoContent"); if (updateTypeElement.getAttribute("severity") == "major") { moreInfoURL.hidden = true; moreInfoContent.hidden = false; document.getElementById("updateName").hidden = true; document.getElementById("updateNameSep").hidden = true; document.getElementById("upgradeEvangelism").hidden = true; document.getElementById("upgradeEvangelismSep").hidden = true; // clear the "never" pref for this version. this is to handle the // scenario where the user clicked "never" for a major update // and then at a later point, did "Check for Updates..." // and then hit "Later". If we don't clear the "never" pref // "Later" will never happen. var neverPrefName = PREF_UPDATE_NEVER_BRANCH + gUpdates.update.version; gPref.setBoolPref(neverPrefName, false); } else { moreInfoURL.hidden = false; moreInfoContent.hidden = true; } }, |
|
var detailsDeck = document.getElementById("detailsDeck"); detailsDeck.selectedIndex = 1; | onShowMoreDetails: function() { var detailsDeck = document.getElementById("detailsDeck"); detailsDeck.selectedIndex = 1; var updateTypeElement = document.getElementById("updateType"); var moreInfoURL = document.getElementById("moreInfoURL"); var moreInfoContent = document.getElementById("moreInfoContent"); if (updateTypeElement.getAttribute("severity") == "major") { moreInfoURL.hidden = true; moreInfoContent.hidden = false; document.getElementById("updateName").hidden = true; document.getElementById("updateNameSep").hidden = true; document.getElementById("upgradeEvangelism").hidden = true; document.getElementById("upgradeEvangelismSep").hidden = true; // clear the "never" pref for this version. this is to handle the // scenario where the user clicked "never" for a major update // and then at a later point, did "Check for Updates..." // and then hit "Later". If we don't clear the "never" pref // "Later" will never happen. var neverPrefName = PREF_UPDATE_NEVER_BRANCH + gUpdates.update.version; gPref.setBoolPref(neverPrefName, false); } else { moreInfoURL.hidden = false; moreInfoContent.hidden = true; } }, |
|
const isupports_uri = "component: | const isupports_uri = "@mozilla.org/rdf/xul-sort-service;1"; | function onSortCol(sortColName){ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "component://netscape/rdf/xul-sort-service"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute('resource'); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "usercol-op": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-voice": document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-nick": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } return false;} |
const isupports_uri = "@mozilla.org/xul/xul-sort-service;1"; | const isupports_uri = (Components.classes["@mozilla.org/xul/xul-sort-service;1"]) ? "@mozilla.org/xul/xul-sort-service;1" : "@mozilla.org/rdf/xul-sort-service;1"; | function onSortCol(sortColName){ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "@mozilla.org/xul/xul-sort-service;1"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute('resource'); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "usercol-op": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-voice": document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-nick": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } return false;} |
var sortResource = node.getAttribute('resource'); | function onSortCol(sortColName){ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "@mozilla.org/xul/xul-sort-service;1"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute('resource'); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "usercol-op": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-voice": document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-nick": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } return false;} |
|
var currentDirection = node.getAttribute('sortDirection'); | var currentDirection = node.getAttribute("sortDirection"); | function onSortCol(sortColName){ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "@mozilla.org/xul/xul-sort-service;1"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute('resource'); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "usercol-op": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-voice": document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-nick": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } return false;} |
const isupports_uri = "component: | const isupports_uri = "@mozilla.org/rdf/xul-sort-service;1"; | function onSortCol(sortColName){ /* sort the <tree> widget on the column name |sortColName|. This code * was basically ripped off some mozilla code that I can't recall at the * moment. */ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "component://netscape/rdf/xul-sort-service"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute("rdf:resource"); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "componentcol-progid": document.getElementById("componentcol-clsid") .setAttribute("sortDirection", "natural"); break; case "componentcol-clsid": document.getElementById("componentcol-progid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iname": document.getElementById("interfacecol-iid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iid": document.getElementById("interfacecol-iname") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } } |
case "componentcol-progid": | case "componentcol-contractid": | function onSortCol(sortColName){ /* sort the <tree> widget on the column name |sortColName|. This code * was basically ripped off some mozilla code that I can't recall at the * moment. */ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "component://netscape/rdf/xul-sort-service"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute("rdf:resource"); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "componentcol-progid": document.getElementById("componentcol-clsid") .setAttribute("sortDirection", "natural"); break; case "componentcol-clsid": document.getElementById("componentcol-progid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iname": document.getElementById("interfacecol-iid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iid": document.getElementById("interfacecol-iname") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } } |
document.getElementById("componentcol-progid") | document.getElementById("componentcol-contractid") | function onSortCol(sortColName){ /* sort the <tree> widget on the column name |sortColName|. This code * was basically ripped off some mozilla code that I can't recall at the * moment. */ const nsIXULSortService = Components.interfaces.nsIXULSortService; const isupports_uri = "component://netscape/rdf/xul-sort-service"; var node = document.getElementById(sortColName); // determine column resource to sort on var sortResource = node.getAttribute("rdf:resource"); if (!node) return false; var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "componentcol-progid": document.getElementById("componentcol-clsid") .setAttribute("sortDirection", "natural"); break; case "componentcol-clsid": document.getElementById("componentcol-progid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iname": document.getElementById("interfacecol-iid") .setAttribute("sortDirection", "natural"); break; case "interfacecol-iid": document.getElementById("interfacecol-iname") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute('sortDirection'); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.Sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.Sort()"); } } |
xulSortService.sort(node, sortResource, sortDirection); | if ("sort" in xulSortService) xulSortService.sort(node, sortResource, sortDirection); else xulSortService.Sort(node, sortResource, sortDirection); | function onSortCol(sortColName){ const nsIXULSortService = Components.interfaces.nsIXULSortService; /* XXX remove the rdf version once 0.8 is a distant memory * 2/22/2001 */ const isupports_uri = (Components.classes["@mozilla.org/xul/xul-sort-service;1"]) ? "@mozilla.org/xul/xul-sort-service;1" : "@mozilla.org/rdf/xul-sort-service;1"; var node = document.getElementById(sortColName); if (!node) return false; // determine column resource to sort on var sortResource = node.getAttribute("resource"); var sortDirection = "ascending"; //node.setAttribute("sortActive", "true"); switch (sortColName) { case "usercol-op": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-voice": document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-nick") .setAttribute("sortDirection", "natural"); break; case "usercol-nick": document.getElementById("usercol-voice") .setAttribute("sortDirection", "natural"); document.getElementById("usercol-op") .setAttribute("sortDirection", "natural"); break; } var currentDirection = node.getAttribute("sortDirection"); if (currentDirection == "ascending") sortDirection = "descending"; else if (currentDirection == "descending") sortDirection = "natural"; else sortDirection = "ascending"; node.setAttribute ("sortDirection", sortDirection); var xulSortService = Components.classes[isupports_uri].getService(nsIXULSortService); if (!xulSortService) return false; try { xulSortService.sort(node, sortResource, sortDirection); } catch(ex) { //dd("Exception calling xulSortService.sort()"); } return false;} |
var startButton = document.getElementById("ok"); var profileTree = document.getElementById("profiles"); if( startButton.getAttribute("disabled") == "true" || profileTree.selectedItems.length != 1 ) return false; | var profileTree = document.getElementById("profiles"); | function onStart(){ var startButton = document.getElementById("ok"); var profileTree = document.getElementById("profiles"); if( startButton.getAttribute("disabled") == "true" || profileTree.selectedItems.length != 1 ) return false; var selected = profileTree.selectedItems[0]; var profilename = selected.getAttribute("profile_name"); if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var lString = bundle.GetStringFromName("migratebeforestart"); lString = lString.replace(/\s*<html:br\/>/g,"\n"); lString = lString.replace(/%brandShortName%/gi, brandBundle.GetStringFromName("brandShortName")); var title = bundle.GetStringFromName("migratetitle"); if (commonDialogService.Confirm(window, title, lString)) profile.migrateProfile( profilename, true ); else return false; } // start in online or offline mode var offlineState = document.getElementById("offlineState"); var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); ioService.offline = offlineState.checked; try { dump("start with profile: " + profilename + "\n"); profile.startApprunner(profilename); ExitApp(); } catch (ex) { //var stringA = bundle.GetStringFromName(failProfileStartA); //var stringB = bundle.GetStringFromName(failProfileStartB); //alert(stringA + " " + profilename + " " + stringB); }} |
dump("start with profile: " + profilename + "\n"); | function onStart(){ var startButton = document.getElementById("ok"); var profileTree = document.getElementById("profiles"); if( startButton.getAttribute("disabled") == "true" || profileTree.selectedItems.length != 1 ) return false; var selected = profileTree.selectedItems[0]; var profilename = selected.getAttribute("profile_name"); if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var lString = bundle.GetStringFromName("migratebeforestart"); lString = lString.replace(/\s*<html:br\/>/g,"\n"); lString = lString.replace(/%brandShortName%/gi, brandBundle.GetStringFromName("brandShortName")); var title = bundle.GetStringFromName("migratetitle"); if (commonDialogService.Confirm(window, title, lString)) profile.migrateProfile( profilename, true ); else return false; } // start in online or offline mode var offlineState = document.getElementById("offlineState"); var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); ioService.offline = offlineState.checked; try { dump("start with profile: " + profilename + "\n"); profile.startApprunner(profilename); ExitApp(); } catch (ex) { //var stringA = bundle.GetStringFromName(failProfileStartA); //var stringB = bundle.GetStringFromName(failProfileStartB); //alert(stringA + " " + profilename + " " + stringB); }} |
|
return true; | function onStart(){ var startButton = document.getElementById("ok"); var profileTree = document.getElementById("profiles"); if( startButton.getAttribute("disabled") == "true" || profileTree.selectedItems.length != 1 ) return false; var selected = profileTree.selectedItems[0]; var profilename = selected.getAttribute("profile_name"); if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var lString = bundle.GetStringFromName("migratebeforestart"); lString = lString.replace(/\s*<html:br\/>/g,"\n"); lString = lString.replace(/%brandShortName%/gi, brandBundle.GetStringFromName("brandShortName")); var title = bundle.GetStringFromName("migratetitle"); if (commonDialogService.Confirm(window, title, lString)) profile.migrateProfile( profilename, true ); else return false; } // start in online or offline mode var offlineState = document.getElementById("offlineState"); var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); ioService.offline = offlineState.checked; try { dump("start with profile: " + profilename + "\n"); profile.startApprunner(profilename); ExitApp(); } catch (ex) { //var stringA = bundle.GetStringFromName(failProfileStartA); //var stringB = bundle.GetStringFromName(failProfileStartB); //alert(stringA + " " + profilename + " " + stringB); }} |
|
if (commonDialogService.Confirm(window, title, lString)) | if (promptService.Confirm(window, title, lString)) | function onStart(){ var profileTree = document.getElementById("profiles"); var selected = profileTree.selectedItems[0]; var profilename = selected.getAttribute("profile_name"); if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var lString = gProfileManagerBundle.getString("migratebeforestart"); lString = lString.replace(/\s*<html:br\/>/g,"\n"); lString = lString.replace(/%brandShortName%/gi, gBrandBundle.getString("brandShortName")); var title = gProfileManagerBundle.getString("migratetitle"); if (commonDialogService.Confirm(window, title, lString)) profile.migrateProfile( profilename, true ); else return false; } // start in online or offline mode var offlineState = document.getElementById("offlineState"); var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); ioService.offline = offlineState.checked; try { profile.startApprunner(profilename); ExitApp(); } catch (ex) { //var stringA = gProfileManagerBundle.getString(failProfileStartA); //var stringB = gProfileManagerBundle.getString(failProfileStartB); //alert(stringA + " " + profilename + " " + stringB); } return true;} |
for each (obs in this.compCalendar.mObservers) obs.onStartBatch(); | this.notifyObservers("onStartBatch"); | onStartBatch: function() { for each (obs in this.compCalendar.mObservers) obs.onStartBatch(); }, |
onStartBatch: function () { }, | onStartBatch: function() { this.mInBatch = true; }, | onStartBatch: function () { }, |
mSaveHdr = null; | onStartHeaders: function() { // clear out any pending collected address timers... if (gCollectAddressTimer) { gCollectAddress = ""; clearTimeout(gCollectAddressTimer); gCollectAddressTimer = null; } // every time we start to redisplay a message, check the view all headers pref.... var showAllHeadersPref = pref.getIntPref("mail.show_headers"); if (showAllHeadersPref == 2) { gViewAllHeaders = true; } else { if (gViewAllHeaders) // if we currently are in view all header mode, rebuild our header view so we remove most of the header data { hideHeaderView(gExpandedHeaderView); gExpandedHeaderView = {}; initializeHeaderViewTables(); } gViewAllHeaders = false; } ClearCurrentHeaders(); gBuiltExpandedView = false; gBuiltCollapsedView = false; gBuildAttachmentsForCurrentMsg = false; gBuildAttachmentPopupForCurrentMsg = true; ClearAttachmentList(); ClearEditMessageButton(); SetUpRemoteContentBar(null); for (index in gMessageListeners) gMessageListeners[index].onStartHeaders(); }, |
|
var channel; try { channel = aRequest.QueryInterface(nsIChannel); } catch(e) { }; if (channel) { var location = channel.URI.spec; | if (aRequest instanceof nsIChannel) { var location = aRequest.URI.spec; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { // This (thanks to the filter) is a network start or the first // stray request (the first request outside of the document load), // initialize the throbber and his friends. // Call start document load listeners (only if this is a network load) if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK && aRequest && aWebProgress.DOMWindow == content) this.startDocumentLoad(aRequest); // Show the progress meter this.statusPanel.hidden = false; // Turn the throbber on. this.throbberElement.setAttribute("busy", "true"); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (aRequest) { if (aWebProgress.DOMWindow == content) this.endDocumentLoad(aRequest, aStatus); } } // This (thanks to the filter) is a network stop or the last // request stop outside of loading the document, stop throbbers // and progress bars and such if (aRequest) { var msg = ""; // Get the channel if the request is a channel var channel; try { channel = aRequest.QueryInterface(nsIChannel); } catch(e) { }; if (channel) { var location = channel.URI.spec; if (location != "about:blank") { const kErrorBindingAborted = 0x804B0002; const kErrorNetTimeout = 0x804B000E; switch (aStatus) { case kErrorBindingAborted: msg = gNavigatorBundle.getString("nv_stopped"); break; case kErrorNetTimeout: msg = gNavigatorBundle.getString("nv_timeout"); break; } } } // If msg is false then we did not have an error (channel may have // been null, in the case of a stray image load). if (!msg) { msg = gNavigatorBundle.getString("nv_done"); } this.status = ""; this.setDefaultStatus(msg); // Disable menu entries for images, enable otherwise if (content.document && this.mimeTypeIsTextBased(content.document.contentType)) this.isImage.removeAttribute('disabled'); else this.isImage.setAttribute('disabled', 'true'); } // Turn the progress meter and throbber off. this.statusPanel.hidden = true; this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } }, |
dump("*** aURL = " + aURL + "\n"); | onStateChange: function (aURL, aState, aValue) { const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog; var element = document.getElementById(aURL); dump("*** aURL = " + aURL + "\n"); if (!element) return; switch (aState) { case nsIXPIProgressDialog.DOWNLOAD_START: element.setAttribute("state", "waiting"); element.setAttribute("progress", "0"); break; case nsIXPIProgressDialog.DOWNLOAD_DONE: element.setAttribute("progress", "100"); break; case nsIXPIProgressDialog.INSTALL_START: element.setAttribute("state", "installing"); break; case nsIXPIProgressDialog.INSTALL_DONE: element.setAttribute("state", "done"); var msg; if (aValue != 0) { var xpinstallStrings = document.getElementById("xpinstallStrings"); try { msg = xpinstallStrings.getString("error" + aValue); } catch (e) { msg = xpinstallStrings.getFormattedString("unknown.error", [aValue]); } element.setAttribute("error", msg); } // Remove the dummy, since we installed successfully var type = gWindowState == "extensions" ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; gExtensionManager.removeDownload(aURL, type); break; case nsIXPIProgressDialog.DIALOG_CLOSE: break; } }, |
|
dump("*** state change = " + aURL + ", state = " + aState + ", value = " + aValue + "\n"); | onStateChange: function (aURL, aState, aValue) { const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog; var element = document.getElementById(aURL); dump("*** aURL = " + aURL + "\n"); if (!element) return; switch (aState) { case nsIXPIProgressDialog.DOWNLOAD_START: element.setAttribute("state", "waiting"); element.setAttribute("progress", "0"); break; case nsIXPIProgressDialog.DOWNLOAD_DONE: element.setAttribute("progress", "100"); break; case nsIXPIProgressDialog.INSTALL_START: element.setAttribute("state", "installing"); break; case nsIXPIProgressDialog.INSTALL_DONE: element.setAttribute("state", "done"); var msg; if (aValue != 0) { var xpinstallStrings = document.getElementById("xpinstallStrings"); try { msg = xpinstallStrings.getString("error" + aValue); } catch (e) { msg = xpinstallStrings.getFormattedString("unknown.error", [aValue]); } element.setAttribute("error", msg); } // Remove the dummy, since we installed successfully var type = gWindowState == "extensions" ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME; gExtensionManager.removeDownload(aURL, type); break; case nsIXPIProgressDialog.DIALOG_CLOSE: break; } }, |
|
var aDownloadID = aDownload.target.persistentDescriptor; | var aDownloadID = aDownload.target.path; | onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus, aDownload) { if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { var aDownloadID = aDownload.target.persistentDescriptor; var download = this.doc.getElementById(aDownloadID); if (download) download.setAttribute("status", ""); } }, |
var refBrowser=null; var tabItem=null; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (aStateFlags & nsIWebProgressListener.STATE_START) { this.stopreloadButton.className = "stop-button"; this.stopreloadButton.onClick = "BrowserStop()"; return; } if (aStateFlags & nsIWebProgressListener.STATE_STOP) { /* To be fixed. We dont want to directly access sytle from here */ document.styleSheets[1].cssRules[0].style.backgroundPosition="1000px 100%"; this.stopreloadButton.className = "reload-button"; this.stopreloadButton.onClick = "BrowserReload()"; return; } return; } if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { if (aStateFlags & nsIWebProgressListener.STATE_START) { return; } if (aStateFlags & nsIWebProgressListener.STATE_STOP) { return; } return; } }, |
|
if (getBrowser().mTabbedMode) { for (var i = 0; i < getBrowser().mPanelContainer.childNodes.length; i++) { if(getBrowser().getBrowserAtIndex(i).contentDocument==aWebProgress.DOMWindow.document) { refBrowser=getBrowser().getBrowserAtIndex(i); tabItem=getBrowser().mTabContainer.childNodes[i]; } } } const rsschromemask = "rssblank"; if(aRequest.name.indexOf(rsschromemask)>-1) { rssfetch(tabItem,refBrowser.contentDocument,refBrowser.contentDocument.body); } | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (aStateFlags & nsIWebProgressListener.STATE_START) { this.stopreloadButton.className = "stop-button"; this.stopreloadButton.onClick = "BrowserStop()"; return; } if (aStateFlags & nsIWebProgressListener.STATE_STOP) { /* To be fixed. We dont want to directly access sytle from here */ document.styleSheets[1].cssRules[0].style.backgroundPosition="1000px 100%"; this.stopreloadButton.className = "reload-button"; this.stopreloadButton.onClick = "BrowserReload()"; return; } return; } if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { if (aStateFlags & nsIWebProgressListener.STATE_START) { return; } if (aStateFlags & nsIWebProgressListener.STATE_STOP) { return; } return; } }, |
|
gReplicationBundle.getString("cancelDownloadButtonAccessKey"); | gReplicationBundle.getString("cancelDownloadButton.accesskey"); | onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) { if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_START) { // start the spinning gProgressMeter.setAttribute("mode", "undetermined"); gProgressText.value = gReplicationBundle.getString(aStatus ? "replicationStarted" : "changesStarted"); gDownloadInProgress = true; document.getElementById("download").label = gReplicationBundle.getString("cancelDownloadButton"); document.getElementById("download").accessKey = gReplicationBundle.getString("cancelDownloadButtonAccessKey"); } if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { EndDownload(aStatus); } }, |
var domWindow; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.isImage.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == this.getFrom(domWindow, "top")) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); try { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.isImage.setAttribute('disabled', 'true'); } catch (e) {} } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
|
domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) | if (aRequest && aWebProgress.DOMWindow == content) | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.isImage.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == this.getFrom(domWindow, "top")) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); try { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.isImage.setAttribute('disabled', 'true'); } catch (e) {} } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
domWindow = aWebProgress.DOMWindow; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.isImage.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == this.getFrom(domWindow, "top")) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); try { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.isImage.setAttribute('disabled', 'true'); } catch (e) {} } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
|
if (domWindow == this.getFrom(domWindow, "top")) | if (aWebProgress.DOMWindow == content) | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.isImage.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == this.getFrom(domWindow, "top")) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); try { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.isImage.setAttribute('disabled', 'true'); } catch (e) {} } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
const kErrorBindingAborted = 2152398850; const kErrorNetTimeout = 2152398862; | const kErrorBindingAborted = 0x804B0002; const kErrorNetTimeout = 0x804B000E; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; if (aStateFlags & nsIWebProgressListener.STATE_START) { // This (thanks to the filter) is a network start or the first // stray request (the first request outside of the document load), // initialize the throbber and his friends. // Call start document load listeners (only if this is a network load) if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK && aRequest && aWebProgress.DOMWindow == content) this.startDocumentLoad(aRequest); if (this.throbberElement) { // Turn the throbber on. this.throbberElement.setAttribute("busy", "true"); } // Turn the status meter on. this.statusMeter.value = 0; // be sure to clear the progress bar if (gProgressCollapseTimer) { window.clearTimeout(gProgressCollapseTimer); gProgressCollapseTimer = null; } else this.statusMeter.parentNode.collapsed = false; // XXX: This needs to be based on window activity... this.stopCommand.removeAttribute("disabled"); } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (aRequest) { if (aWebProgress.DOMWindow == content) this.endDocumentLoad(aRequest, aStatus); } } // This (thanks to the filter) is a network stop or the last // request stop outside of loading the document, stop throbbers // and progress bars and such if (aRequest) { var msg = ""; // Get the channel if the request is a channel var channel; try { channel = aRequest.QueryInterface(nsIChannel); } catch(e) { }; if (channel) { var location = channel.URI.spec; if (location != "about:blank") { const kErrorBindingAborted = 2152398850; const kErrorNetTimeout = 2152398862; switch (aStatus) { case kErrorBindingAborted: msg = gNavigatorBundle.getString("nv_stopped"); break; case kErrorNetTimeout: msg = gNavigatorBundle.getString("nv_timeout"); break; } } } // If msg is false then we did not have an error (channel may have // been null, in the case of a stray image load). if (!msg) { msg = gNavigatorBundle.getString("nv_done"); } this.status = ""; this.setDefaultStatus(msg); } // Turn the progress meter and throbber off. gProgressCollapseTimer = window.setTimeout("gProgressMeterPanel.collapsed = true; gProgressCollapseTimer = null;", 100); if (this.throbberElement) this.throbberElement.removeAttribute("busy"); this.stopCommand.setAttribute("disabled", "true"); } }, |
EnableBusyCursor(false); | onStateChange : function(channel, state) { if(!throbberElement) throbberElement = document.getElementById("navigator-throbber"); if(!statusMeter) statusMeter = document.getElementById("statusbar-icon"); if(!stopButton) stopButton = document.getElementById("stop-button"); if(!stopMenu) stopMenu = document.getElementById("menuitem-stop"); if (state & Components.interfaces.nsIWebProgressListener.flag_start) { if(state & Components.interfaces.nsIWebProgressListener.flag_is_network) { // Remember when loading commenced. startTime = (new Date()).getTime(); // Turn progress meter on. statusMeter.setAttribute("mode","undetermined"); throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", false); stopMenu.setAttribute("disabled", false); // Initialize the progress stuff... statusMeter.setAttribute("mode","undetermined"); useRealProgressFlag = false; totalRequests = 0; finishedRequests = 0; } if (state & Components.interfaces.nsIWebProgressListener.flag_is_request) { totalRequests += 1; } } else if (state & Components.interfaces.nsIWebProgressListener.flag_stop) { if (state & Components.interfaces.nsIWebProgressListener.flag_is_request) { finishedRequests += 1; if (!useRealProgressFlag) { this.onProgress(null, finishedRequests, totalRequests); } } if(state & Components.interfaces.nsIWebProgressListener.flag_is_network) { // Record page loading time. var elapsed = ( (new Date()).getTime() - startTime ) / 1000; var msg = bundle.GetStringFromName("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); defaultStatus = msg; UpdateStatusField(); //window.XULBrowserWindow.setDefaultStatus(msg); //this.setDefaultStatus(msg); this.setOverLink(msg); // Turn progress meter off. statusMeter.setAttribute("mode","normal"); statusMeter.value = 0; // be sure to clear the progress bar statusMeter.progresstext = ""; throbberElement.setAttribute("busy", false); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", true); stopMenu.setAttribute("disabled", true); } } else if (state & Components.interfaces.nsIWebProgressListener.flag_transferring) { if (state & Components.interfaces.nsIWebProgressListener.flag_is_document) { var ctype=channel.contentType; if (ctype != "text/html") { useRealProgressFlag = true; } statusMeter.setAttribute("mode", "normal"); } if (state & Components.interfaces.nsIWebProgressListener.flag_is_request) { if (!useRealProgressFlag) { this.onProgress(null, finishedRequests, totalRequests); } } } }, |
|
setFormToolbar(); | onStateChange : function(channel, state) { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; if (!throbberElement) throbberElement = document.getElementById("navigator-throbber"); if (!statusMeter) statusMeter = document.getElementById("statusbar-icon"); if (!stopButton) stopButton = document.getElementById("stop-button"); if (!stopMenu) stopMenu = document.getElementById("menuitem-stop"); if (!stopContext) stopContext = document.getElementById("context-stop"); if (state & nsIWebProgressListener.STATE_START) { if (state & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); // Turn progress meter on. statusMeter.setAttribute("mode","undetermined"); throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", false); stopMenu.setAttribute("disabled", false); stopContext.setAttribute("disabled", false); // Initialize the progress stuff... statusMeter.setAttribute("mode","undetermined"); this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (state & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (state & nsIWebProgressListener.STATE_STOP) { if (state & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgress(null, this.finishedRequests, this.totalRequests); } if (state & nsIWebProgressListener.STATE_IS_NETWORK) { var location = channel.URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.setDefaultStatus(msg); // Turn progress meter off. statusMeter.setAttribute("mode","normal"); statusMeter.value = 0; // be sure to clear the progress bar statusMeter.progresstext = ""; throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", true); stopMenu.setAttribute("disabled", true); stopContext.setAttribute("disabled", true); // Set buttons in form menu setFormToolbar(); } } else if (state & nsIWebProgressListener.STATE_TRANSFERRING) { if (state & nsIWebProgressListener.STATE_IS_DOCUMENT) { var ctype=channel.contentType; if (ctype != "text/html") this.useRealProgressFlag = true; statusMeter.setAttribute("mode", "normal"); } if (state & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgress(null, this.finishedRequests, this.totalRequests); } } }, |
|
dump("*** state change = " + aAddon.xpiURL + ", state = " + aState + ", value = " + aValue + "\n"); | onStateChange: function (aAddon, aState, aValue) { const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog; var element = this.getElementForAddon(aAddon); if (!element) return; switch (aState) { case nsIXPIProgressDialog.DOWNLOAD_START: element.setAttribute("state", "waiting"); var extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installWaiting")); element.setAttribute("progress", "0"); break; case nsIXPIProgressDialog.DOWNLOAD_DONE: element.setAttribute("progress", "100"); break; case nsIXPIProgressDialog.INSTALL_START: element.setAttribute("state", "installing"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installInstalling")); break; case nsIXPIProgressDialog.INSTALL_DONE: dump("*** state change = " + aAddon.xpiURL + ", state = " + aState + ", value = " + aValue + "\n"); element.setAttribute("state", "done"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installSuccess")); var msg; if (aValue != 0 && aValue != 999) { var xpinstallStrings = document.getElementById("xpinstallStrings"); try { msg = xpinstallStrings.getString("error" + aValue); } catch (e) { msg = xpinstallStrings.getFormattedString("unknown.error", [aValue]); } var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var extensionStrings = sbs.createBundle("chrome://mozapps/locale/extensions/extensions.properties"); var title = extensionStrings.GetStringFromName("errorInstallTitle"); var brandStrings = sbs.createBundle("chrome://branding/locale/brand.properties"); var brandShortName = brandStrings.GetStringFromName("brandShortName"); var params = [brandShortName, aAddon.xpiURL, msg]; var message = extensionStrings.formatStringFromName("errorInstallMsg", params, params.length); var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); ps.alert(window, title, message); element.setAttribute("status", msg); } break; case nsIXPIProgressDialog.DIALOG_CLOSE: break; } }, |
|
extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installSuccess")); var msg; | onStateChange: function (aAddon, aState, aValue) { const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog; var element = this.getElementForAddon(aAddon); if (!element) return; switch (aState) { case nsIXPIProgressDialog.DOWNLOAD_START: element.setAttribute("state", "waiting"); var extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installWaiting")); element.setAttribute("progress", "0"); break; case nsIXPIProgressDialog.DOWNLOAD_DONE: element.setAttribute("progress", "100"); break; case nsIXPIProgressDialog.INSTALL_START: element.setAttribute("state", "installing"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installInstalling")); break; case nsIXPIProgressDialog.INSTALL_DONE: dump("*** state change = " + aAddon.xpiURL + ", state = " + aState + ", value = " + aValue + "\n"); element.setAttribute("state", "done"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installSuccess")); var msg; if (aValue != 0 && aValue != 999) { var xpinstallStrings = document.getElementById("xpinstallStrings"); try { msg = xpinstallStrings.getString("error" + aValue); } catch (e) { msg = xpinstallStrings.getFormattedString("unknown.error", [aValue]); } var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var extensionStrings = sbs.createBundle("chrome://mozapps/locale/extensions/extensions.properties"); var title = extensionStrings.GetStringFromName("errorInstallTitle"); var brandStrings = sbs.createBundle("chrome://branding/locale/brand.properties"); var brandShortName = brandStrings.GetStringFromName("brandShortName"); var params = [brandShortName, aAddon.xpiURL, msg]; var message = extensionStrings.formatStringFromName("errorInstallMsg", params, params.length); var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); ps.alert(window, title, message); element.setAttribute("status", msg); } break; case nsIXPIProgressDialog.DIALOG_CLOSE: break; } }, |
|
msg = xpinstallStrings.getString("error" + aValue); | var msg = xpinstallStrings.getString("error" + aValue); | onStateChange: function (aAddon, aState, aValue) { const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog; var element = this.getElementForAddon(aAddon); if (!element) return; switch (aState) { case nsIXPIProgressDialog.DOWNLOAD_START: element.setAttribute("state", "waiting"); var extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installWaiting")); element.setAttribute("progress", "0"); break; case nsIXPIProgressDialog.DOWNLOAD_DONE: element.setAttribute("progress", "100"); break; case nsIXPIProgressDialog.INSTALL_START: element.setAttribute("state", "installing"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installInstalling")); break; case nsIXPIProgressDialog.INSTALL_DONE: dump("*** state change = " + aAddon.xpiURL + ", state = " + aState + ", value = " + aValue + "\n"); element.setAttribute("state", "done"); extensionsStrings = document.getElementById("extensionsStrings"); element.setAttribute("description", extensionsStrings.getString("installSuccess")); var msg; if (aValue != 0 && aValue != 999) { var xpinstallStrings = document.getElementById("xpinstallStrings"); try { msg = xpinstallStrings.getString("error" + aValue); } catch (e) { msg = xpinstallStrings.getFormattedString("unknown.error", [aValue]); } var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var extensionStrings = sbs.createBundle("chrome://mozapps/locale/extensions/extensions.properties"); var title = extensionStrings.GetStringFromName("errorInstallTitle"); var brandStrings = sbs.createBundle("chrome://branding/locale/brand.properties"); var brandShortName = brandStrings.GetStringFromName("brandShortName"); var params = [brandShortName, aAddon.xpiURL, msg]; var message = extensionStrings.formatStringFromName("errorInstallMsg", params, params.length); var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); ps.alert(window, title, message); element.setAttribute("status", msg); } break; case nsIXPIProgressDialog.DIALOG_CLOSE: break; } }, |
throbberElement.setAttribute("busy", false); | throbberElement.removeAttribute("busy"); | onStateChange : function(channel, state) { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; if (!throbberElement) throbberElement = document.getElementById("navigator-throbber"); if (!statusMeter) statusMeter = document.getElementById("statusbar-icon"); if (!stopButton) stopButton = document.getElementById("stop-button"); if (!stopMenu) stopMenu = document.getElementById("menuitem-stop"); if (!stopContext) stopContext = document.getElementById("context-stop"); if (state & nsIWebProgressListener.STATE_START) { if (state & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); // Turn progress meter on. statusMeter.setAttribute("mode","undetermined"); throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", false); stopMenu.setAttribute("disabled", false); stopContext.setAttribute("disabled", false); // Initialize the progress stuff... statusMeter.setAttribute("mode","undetermined"); this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (state & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } EnableBusyCursor(throbberElement.getAttribute("busy") == "true"); } else if (state & nsIWebProgressListener.STATE_STOP) { if (state & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgress(null, this.finishedRequests, this.totalRequests); } if (state & nsIWebProgressListener.STATE_IS_NETWORK) { var location = channel.URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = bundle.GetStringFromName("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.setDefaultStatus(msg); // Turn progress meter off. statusMeter.setAttribute("mode","normal"); statusMeter.value = 0; // be sure to clear the progress bar statusMeter.progresstext = ""; throbberElement.setAttribute("busy", false); // XXX: These need to be based on window activity... stopButton.setAttribute("disabled", true); stopMenu.setAttribute("disabled", true); stopContext.setAttribute("disabled", true); EnableBusyCursor(false); } } else if (state & nsIWebProgressListener.STATE_TRANSFERRING) { if (state & nsIWebProgressListener.STATE_IS_DOCUMENT) { var ctype=channel.contentType; if (ctype != "text/html") this.useRealProgressFlag = true; statusMeter.setAttribute("mode", "normal"); } if (state & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgress(null, this.finishedRequests, this.totalRequests); } } }, |
setTimeout("processEndOfDownload()", 300); | processEndOfDownload(); | onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) { if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { // we are done downloading... completed = true; // Indicate completion in status area. var msg = getString( "completeMsg" ); msg = replaceInsert( msg, 1, formatSeconds( elapsed/1000 ) ); dialog.status.setAttribute("value", msg); // Put progress meter at 100%. dialog.progress.setAttribute( "value", 100 ); dialog.progress.setAttribute( "mode", "normal" ); var percentMsg = getString( "percentMsg" ); percentMsg = replaceInsert( percentMsg, 1, 100 ); dialog.progressText.setAttribute("label", percentMsg); const nsIWebBrowserPersist = Components.interfaces.nsIWebBrowserPersist; if (helperAppLoader || webBrowserPersist && webBrowserPersist.currentState == nsIWebBrowserPersist.PERSIST_STATE_FINISHED) setTimeout("processEndOfDownload()", 300); } }, |
gProgressCollapseTimer = window.setTimeout("gProgressMeterPanel.collapsed = true; gProgressCollapseTimer = null;", 100); | gProgressCollapseTimer = window.setTimeout( function() { gProgressMeterPanel.collapsed = true; gProgressCollapseTimer = null; }, 100); | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; if (aStateFlags & nsIWebProgressListener.STATE_START) { // This (thanks to the filter) is a network start or the first // stray request (the first request outside of the document load), // initialize the throbber and his friends. // Call start document load listeners (only if this is a network load) if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK && aRequest && aWebProgress.DOMWindow == content) this.startDocumentLoad(aRequest); if (this.throbberElement) { // Turn the throbber on. this.throbberElement.setAttribute("busy", "true"); } // Turn the status meter on. this.statusMeter.value = 0; // be sure to clear the progress bar if (gProgressCollapseTimer) { window.clearTimeout(gProgressCollapseTimer); gProgressCollapseTimer = null; } else this.statusMeter.parentNode.collapsed = false; // XXX: This needs to be based on window activity... this.stopCommand.removeAttribute("disabled"); } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (aRequest) { if (aWebProgress.DOMWindow == content) this.endDocumentLoad(aRequest, aStatus); } } // This (thanks to the filter) is a network stop or the last // request stop outside of loading the document, stop throbbers // and progress bars and such if (aRequest) { var msg = ""; // Get the channel if the request is a channel var channel; try { channel = aRequest.QueryInterface(nsIChannel); } catch(e) { }; if (channel) { var location = channel.URI.spec; if (location != "about:blank") { const kErrorBindingAborted = 0x804B0002; const kErrorNetTimeout = 0x804B000E; switch (aStatus) { case kErrorBindingAborted: msg = gNavigatorBundle.getString("nv_stopped"); break; case kErrorNetTimeout: msg = gNavigatorBundle.getString("nv_timeout"); break; } } } // If msg is false then we did not have an error (channel may have // been null, in the case of a stray image load). if (!msg) { msg = gNavigatorBundle.getString("nv_done"); } this.status = ""; this.setDefaultStatus(msg); } // Turn the progress meter and throbber off. gProgressCollapseTimer = window.setTimeout("gProgressMeterPanel.collapsed = true; gProgressCollapseTimer = null;", 100); if (this.throbberElement) this.throbberElement.removeAttribute("busy"); this.stopCommand.setAttribute("disabled", "true"); } }, |
var ctype; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.translateMenu.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == domWindow.top) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.translateMenu.setAttribute('disabled', 'true'); } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
|
this.translateMenu.removeAttribute('disabled'); | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.translateMenu.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == domWindow.top) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.translateMenu.setAttribute('disabled', 'true'); } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
|
ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\ this.translateMenu.setAttribute('disabled', 'true'); | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.translateMenu.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == domWindow.top) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.translateMenu.setAttribute('disabled', 'true'); } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
|
ctype = aRequest.QueryInterface(nsIChannel).contentType; | var ctype = aRequest.QueryInterface(nsIChannel).contentType; | onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; var domWindow; var ctype; if (aStateFlags & nsIWebProgressListener.STATE_START) { if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // Remember when loading commenced. this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn the throbber on. this.throbberElement.setAttribute("busy", true); // XXX: These need to be based on window activity... this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); this.translateMenu.removeAttribute('disabled'); // Initialize the progress stuff... this.useRealProgressFlag = false; this.totalRequests = 0; this.finishedRequests = 0; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.totalRequests += 1; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { this.finishedRequests += 1; if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; if (aRequest) { if (domWindow == domWindow.top) this.endDocumentLoad(aRequest, aStatus); var location = aRequest.QueryInterface(nsIChannel).URI.spec; var msg = ""; if (location != "about:blank") { // Record page loading time. var elapsed = ((new Date()).getTime() - this.startTime) / 1000; msg = gNavigatorBundle.getString("nv_done"); msg = msg.replace(/%elapsed%/, elapsed); } this.status = ""; this.setDefaultStatus(msg); ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype.match(/^image\//)) this.translateMenu.setAttribute('disabled', 'true'); } // Turn the progress meter and throbber off. this.statusMeter.value = 0; // be sure to clear the progress bar this.throbberElement.removeAttribute("busy"); // XXX: These need to be based on window activity... // XXXjag: <command id="cmd_stop"/> ? this.stopButton.disabled = true; this.stopMenu.setAttribute('disabled', 'true'); this.stopContext.setAttribute('disabled', 'true'); } } else if (aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) { if (aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) { ctype = aRequest.QueryInterface(nsIChannel).contentType; if (ctype != "text/html") this.useRealProgressFlag = true; } if (aStateFlags & nsIWebProgressListener.STATE_IS_REQUEST) { if (!this.useRealProgressFlag) this.onProgressChange(null, null, 0, 0, this.finishedRequests, this.totalRequests); } } }, |
this.overLink = msg; if (!this.statusTimeoutInEffect) { this.statusTimeoutInEffect = true; setTimeout(updateOverLink, 400); } | if (!this.statusTimeoutInEffect) { this.statusTimeoutInEffect = true; this.status = msg; this.updateStatusField(); setTimeout(updateStatus, 400); } | onStatus : function(request, status, msg) { this.overLink = msg; if (!this.statusTimeoutInEffect) { this.statusTimeoutInEffect = true; setTimeout(updateOverLink, 400); } } |
statusMeter.setAttribute("mode","normal"); | statusMeter.setAttribute("mode","normal"); statusMeter.value = 0; statusMeter.progresstext = ""; | onStatusChange : function(channel, status) { if(!throbberElement) throbberElement = document.getElementById("Throbber"); if(!statusMeter) statusMeter = document.getElementById("statusbar-icon"); if(!stopButton) stopButton = document.getElementById("stop-button"); if(!stopMenu) stopMenu = document.getElementById("menuitem-stop"); if(status & Components.interfaces.nsIWebProgress.flag_net_start) { // Remember when loading commenced. startTime = (new Date()).getTime(); // Turn progress meter on. statusMeter.setAttribute("mode","undetermined"); throbberElement.setAttribute("busy", true); } else if(status & Components.interfaces.nsIWebProgress.flag_net_stop) { // Record page loading time. var elapsed = ( (new Date()).getTime() - startTime ) / 1000; var msg = bundle.GetStringFromName("nv_done") + " (" + elapsed + " secs)"; dump( msg + "\n" ); defaultStatus = msg; UpdateStatusField(); window.XULBrowserWindow.setDefaultStatus(msg); // Turn progress meter off. statusMeter.setAttribute("mode","normal"); throbberElement.setAttribute("busy", false); } else if(status & Components.interfaces.nsIWebProgress.flag_net_dns) { alert("XXX: Not yet Implemented (navigator.js dns network step."); } else if(status & Components.interfaces.nsIWebProgress.flag_net_connecting) { alert("XXX: Not yet Implemented (navigator.js connecting network step."); } else if(status & Components.interfaces.nsIWebProgress.flag_net_transferring) { alert("XXX: Not yet Implemented (navigator.js transferring network step."); } else if(status & Components.interfaces.nsIWebProgress.flag_net_redirecting) { alert("XXX: Not yet Implemented (navigator.js redirecting network step."); } else if(status & Components.interfaces.nsIWebProgress.flag_net_negotiating) { alert("XXX: Not yet Implemented (navigator.js negotiating network step."); } if(status & Components.interfaces.nsIWebProgress.flag_win_start) { stopButton.setAttribute("disabled", false); stopMenu.setAttribute("disabled", false); } else if(status & Components.interfaces.nsIWebProgress.flag_win_stop) { stopButton.setAttribute("disabled", true); stopMenu.setAttribute("disabled", true); } }, |
gStatusBar.setAttribute("mode","normal"); | gStatusFeedback.ShowProgress(100); gStatusFeedback.ShowStatusString(Bundle.GetStringFromName("doneString")); gStatusBar.setAttribute("mode","normal"); | OnStopPopulating: function() { // only re-root the tree, if it is null. // otherwise, we are in here because we are populating // a part of the tree var refValue = gSubscribeTree.getAttribute('ref'); //dump("ref = " + refValue + refValue.length + "\n"); if (refValue == "null") { dump("root subscribe tree at: "+ gServerURI +"\n"); gSubscribeTree.setAttribute('ref',gServerURI); } // Turn progress meter off. gStatusBar.setAttribute("mode","normal"); } |
this.contentType = getMIMEInfoForExtension(ext).MIMEType; | var mimeInfo = getMIMEInfoForExtension(ext); if (mimeInfo) this.contentType = mimeInfo.MIMEType; | onStopRequest: function (aRequest, aContext, aStatus) { try { if (aStatus == 0) { // NS_BINDING_SUCCEEDED, so there's something there var linkChecker = aRequest.QueryInterface(Components.interfaces.nsIURIChecker); var channel = linkChecker.baseRequest.QueryInterface(Components.interfaces.nsIChannel); this.contentType = channel.contentType; try { var httpChannel = channel.QueryInterface(Components.interfaces.nsIHttpChannel); this.mContentDisposition = httpChannel.getResponseHeader("content-disposition"); } catch (e) { } } else { var bundle = getStringBundle(); var errorTitle = bundle.GetStringFromName("saveLinkErrorTitle"); var errorMsg = bundle.GetStringFromName("saveLinkErrorMsg"); const promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); promptService.alert(this.mData.window, errorTitle, errorMsg); return; } } catch (e) { if (this.mData.document) { this.contentType = this.mData.document.contentType; } else { try { var url = this.uri.QueryInterface(Components.interfaces.nsIURL); var ext = url.fileExtension; if (ext) { this.contentType = getMIMEInfoForExtension(ext).MIMEType; } } catch (e) { // Not much we can do here. Give up. } } } this.mCallback(this, this.mData); }, |
gUpdates.wiz.canAdvance = true; | onStopRequest: function(request, context, status) { request.QueryInterface(nsIIncrementalDownload); LOG("UI:DownloadingPage", "onStopRequest: " + request.URI.spec + ", status = " + status); this._downloadThrobber.removeAttribute("state"); var u = gUpdates.update; const NS_BINDING_ABORTED = 0x804b0002; switch (status) { case Components.results.NS_ERROR_UNEXPECTED: if (u.selectedPatch.state == STATE_DOWNLOAD_FAILED && u.isCompleteUpdate) { // Verification error of complete patch, informational text is held in // the update object. gUpdates.wiz.currentPage = document.getElementById("errors"); } else { // Verification failed for a partial patch, complete patch is now // downloading so return early and do NOT remove the download listener! // Reset the progress meter to "undertermined" mode so that we don't // show old progress for the new download of the "complete" patch. this._downloadProgress.mode = "undetermined"; this._pauseButton.disabled = true; var verificationFailed = document.getElementById("verificationFailed"); verificationFailed.hidden = false; this._statusFormatter = null; return; } break; case NS_BINDING_ABORTED: LOG("UI:DownloadingPage", "onStopRequest: Pausing Download"); // Return early, do not remove UI listener since the user may resume // downloading again. return; case Components.results.NS_OK: LOG("UI:DownloadingPage", "onStopRequest: Patch Verification Succeeded"); gUpdates.wiz.advance(); break; default: LOG("UI:DownloadingPage", "onStopRequest: Transfer failed"); // Some kind of transfer error, die. gUpdates.wiz.currentPage = document.getElementById("errors"); break; } var updates = Components.classes["@mozilla.org/updates/update-service;1"]. getService(Components.interfaces.nsIApplicationUpdateService); updates.removeDownloadListener(this); }, |
|
this._fault = createInstance(XMLRPCFAULT_PROGID, | this._fault = createInstance(XMLRPCFAULT_CONTRACTID, | onStopRequest: function(channel, ctxt, status, errorMsg) { debug('Stop Request'); if (!this._inProgress) return; // No longer interested. this._inProgress = false; this._parser = null; if (status) { debug('Non-zero status: (' + status.toString(16) + ') ' + errorMsg); this._status = status; this._errorMsg = errorMsg; try { ctxt.listener.onError(this, ctxt.context, status, errorMsg); } catch (ex) {} return; } // All done. debug('Parse finished'); if (this._foundFault) { try { this._fault = createInstance(XMLRPCFAULT_PROGID, 'nsIXmlRpcFault'); this._fault.init(this._result.getValue('faultCode').data, this._result.getValue('faultString').data); this._result = null; } catch(e) { this._fault = null; this._result = null; throw Components.Exception('Could not parse response'); try { ctxt.listener.onError(this, ctxt.context, Components.results.NS_ERROR_FAIL, 'Server returned invalid Fault'); } catch(ex) {} } debug('Fault: ' + this._fault); try { ctxt.listener.onFault(this, ctxt.context, this._fault); } catch(ex) {} } else { debug('Result: ' + this._result); try { ctxt.listener.onResult(this, ctxt.context, this._result); } catch (ex) {} } }, |
ctxt.mObserver.onError(null, | ctxt.mObserver.onError(channel.requestSucceeded, | onStopRequest: function(request, ctxt, status, errorMsg) { ctxt = ctxt.wrappedJSObject; var channel; try { channel = request.QueryInterface(Components.interfaces.nsIHttpChannel); dump(channel.requestSucceeded+"\n"); } catch(e) { } if (channel && !channel.requestSucceeded) { ctxt.mObserver.onError(null, "Publishing the calendar file failed\n" + "Status code: "+channel.responseStatus+": "+channel.responseStatusText+"\n"); } else if (!channel && !Components.isSuccessCode(request.status)) { ctxt.mObserver.onError(null, "Publishing the calendar file failed\n" + "Status code: "+request.status.toString(16)+"\n"); } ctxt.locked = false; ctxt.processQueue(); }, |
ctxt.mObserver.onError(null, | ctxt.mObserver.onError(request.status, | onStopRequest: function(request, ctxt, status, errorMsg) { ctxt = ctxt.wrappedJSObject; var channel; try { channel = request.QueryInterface(Components.interfaces.nsIHttpChannel); dump(channel.requestSucceeded+"\n"); } catch(e) { } if (channel && !channel.requestSucceeded) { ctxt.mObserver.onError(null, "Publishing the calendar file failed\n" + "Status code: "+channel.responseStatus+": "+channel.responseStatusText+"\n"); } else if (!channel && !Components.isSuccessCode(request.status)) { ctxt.mObserver.onError(null, "Publishing the calendar file failed\n" + "Status code: "+request.status.toString(16)+"\n"); } ctxt.locked = false; ctxt.processQueue(); }, |
linkChecker.status = status; | onStopRequest: function(request, ctxt, status) { var linkChecker = request.QueryInterface(Components.interfaces.nsIURIChecker); if (linkChecker) { ++gNumLinksCalledBack; if (gStartedAllChecks && gNumLinksCalledBack >= gNumLinksToCheck) { clearTimeout(gLinkCheckTimerID); nsLinkCheckTimeOut(); } } } |
|
return true; | onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); //check to make sure its actually a calendar file, if not return. if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); return false; } //if we have only one event, open the event dialog. var BeginEventText = "BEGIN:VEVENT"; var firstMatchLocation = result.indexOf( BeginEventText ); if( firstMatchLocation == -1 ) { alert( "There are no events in this file. Here's what I got from\n"+Channel.URI.spec+"\nResult: "+result ); return false; } else { onResponse( result ); } } |
|
case "VTODOnot": | case "VTODO": | onStreamComplete: function(loader, ctxt, status, resultLength, result) { // XXX ?? Is this ok? this.mItems = new Array(); var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); // ics files are always utf8 unicodeConverter.charset = "UTF-8"; var str = unicodeConverter.convertFromByteArray(result, result.length); // Wrap parsing in a try block. Will ignore errors. That's a good thing // for non-existing or empty files, but not good for invalid files. // We should not accidently overwrite third party files. // XXX Fix that // XXX try disabled for debugging all the other possible problems. // that's more important then file at the moment. //try { var calComp = this.mICSService.parseICS(str); // Get unknown properties var prop = calComp.getFirstProperty("ANY"); while (prop) { if (!this.calendarPromotedProps[prop.propertyName]) { this.unmappedProperties.push(prop); dump(prop.propertyName+"\n"); } prop = calComp.getNextProperty("ANY"); } var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; this.addItem(event, null); break; case "VTODOnot": // XXX Last time i tried, vtodo didn't work. Sadly no time to // debug now. var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; this.addItem(todo, null); break; default: this.unmappedComponents.push(subComp); dump(subComp.componentType+"\n"); } subComp = calComp.getNextSubcomponent("ANY"); } //} catch(e) { dump(e+"\n");} this.addObserver(this.mObserver, calICalendar.ITEM_FILTER_TYPE_ALL); this.observeOnLoad(); }, |
alert("Getting the calendar file failed.\nStatus code: "+ch.responseStatus+": "+ch.responseStatusText); | promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('httpError',[ch.responseStatus, ch.responseStatusText],2)); | onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); var retval = false; if( typeof( result ) != "string" ) //for 1.7 compatibility result = String.fromCharCode.apply(this, result); var ch; try { ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel); } catch(e) { } if (ch && !ch.requestSucceeded) { alert("Getting the calendar file failed.\nStatus code: "+ch.responseStatus+": "+ch.responseStatusText); } else if (!Components.isSuccessCode(loader.request.status)) { // XXX this should be made human-readable. alert("Getting the calendar file failed.\nStatus code: 0x"+loader.request.status.toString(16)); } //check to make sure its actually a calendar file, if not return. else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); } else { onResponse( result ); retval = true; } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } |
alert("Getting the calendar file failed.\nStatus code: 0x"+loader.request.status.toString(16)); | promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('otherError',[cloader.request.status.toString(16)],1)); | onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); var retval = false; if( typeof( result ) != "string" ) //for 1.7 compatibility result = String.fromCharCode.apply(this, result); var ch; try { ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel); } catch(e) { } if (ch && !ch.requestSucceeded) { alert("Getting the calendar file failed.\nStatus code: "+ch.responseStatus+": "+ch.responseStatusText); } else if (!Components.isSuccessCode(loader.request.status)) { // XXX this should be made human-readable. alert("Getting the calendar file failed.\nStatus code: 0x"+loader.request.status.toString(16)); } //check to make sure its actually a calendar file, if not return. else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); } else { onResponse( result ); retval = true; } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } |
alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); | promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('contentError',[Channel.URI.spec, result],2)); | onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); var retval = false; if( typeof( result ) != "string" ) //for 1.7 compatibility result = String.fromCharCode.apply(this, result); var ch; try { ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel); } catch(e) { } if (ch && !ch.requestSucceeded) { alert("Getting the calendar file failed.\nStatus code: "+ch.responseStatus+": "+ch.responseStatusText); } else if (!Components.isSuccessCode(loader.request.status)) { // XXX this should be made human-readable. alert("Getting the calendar file failed.\nStatus code: 0x"+loader.request.status.toString(16)); } //check to make sure its actually a calendar file, if not return. else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); } else { onResponse( result ); retval = true; } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } |
var sliceStringArray = new Array(); for (var start = 0, end; start < (end = Math.min(result.length, start + 32768)); start = end) { var slice = result.slice(start, end); var sliceString = String.fromCharCode.apply(null, slice); sliceStringArray[sliceStringArray.length] = sliceString; } result = sliceStringArray.join(""); | try { var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); unicodeConverter.charset = "UTF-8"; var result = unicodeConverter.convertFromByteArray( result, result.length ); } catch(e) { var sliceStringArray = new Array(); for (var start = 0, end; start < (end = Math.min(result.length, start + 32768)); start = end) { var slice = result.slice(start, end); var sliceString = String.fromCharCode.apply(null, slice); sliceStringArray[sliceStringArray.length] = sliceString; } result = sliceStringArray.join(""); } | onStreamComplete: function(loader, ctxt, status, resultLength, result) { // revert from "wait" cursor set by getRemoteCalendarText (below) window.setCursor( "auto" ); var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties"); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var retval = false; if( typeof( result ) != "string" ) { //for 1.7 compatibility // Result is an array of integer unicode values. // Convert to string by applying String.fromCharCode static function. // Function.apply can take array of length < expt(2, 16), // so convert slices half that length to strings, then join strings. var sliceStringArray = new Array(); for (var start = 0, end; start < (end = Math.min(result.length, start + 32768)); start = end) { var slice = result.slice(start, end); var sliceString = String.fromCharCode.apply(null, slice); sliceStringArray[sliceStringArray.length] = sliceString; } result = sliceStringArray.join(""); } var ch; try { ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel); } catch(e) { } if (ch && !ch.requestSucceeded) { promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('httpError',[ch.responseStatus, ch.responseStatusText],2)); } else if (ch && !Components.isSuccessCode(loader.request.status)) { // XXX this should be made human-readable. promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('otherError',[loader.request.status.toString(16)],1)); } //check to make sure its actually a calendar file, if not return. else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'), calendarStringBundle.formatStringFromName('contentError',[Channel.URI.spec, result],2)); } else { onResponse( result ); retval = true; } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } |
result = String.fromCharCode.apply(this, result); | onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); var retval = false; //check to make sure its actually a calendar file, if not return. if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); } else { //if we have only one event, open the event dialog. var firstMatchLocation = result.indexOf( "BEGIN:VEVENT" ); if( firstMatchLocation == -1 ) { alert( "There are no events in this file. Here's what I got from\n"+Channel.URI.spec+"\nResult: "+result ); } else { onResponse( result ); retval = true; } } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } |
|
if (elem.className === "PopupLink") delayHidePopup(); | while (elem) { if (elem.className === "PopupLink") delayHidePopup(); elem = elem.parentNode; } | function onTableMouseOut(event){ if (!fg_curPopup) return; event = event || window.event; var elem = event.target || event.srcElement; if (elem.className === "PopupLink") delayHidePopup();} |
cell = cell.parentNode.cells[cell.cellIndex+1]; | do cell = cell.nextSibling; while (cell && (!cell.tagName || cell.tagName !== "TD")); if (!cell) return; | function onTableMouseOver(event){ event = event || window.event; var elem = event.target || event.srcElement; if (elem.className === "PopupLink") { /* jump to the next cell */ var cell = elem.parentNode; cell = cell.parentNode.cells[cell.cellIndex+1]; /* find first DIV child */ var div = cell.firstChild; while (div && (typeof div.tagName == "undefined" || div.tagName != "DIV")) div = div.nextSibling; if (div) showPopup(div); }} |
h.enabled = !h.enabled; | h.enabled = client.debugMode = !h.enabled; | function onToggleTraceHook(){ var h = client.eventPump.getHook ("event-tracer"); h.enabled = !h.enabled; document.getElementById("menu-dmessages").setAttribute ("checked", h.enabled); } |
dd ("** Unknown element '" + menuId + "' passed to onToggleVisibility. **"); | dd ("** Unknown element ``" + menuId + "'' passed to onToggleVisibility. **"); | function onToggleVisibility(thing){ var menu = document.getElementById("menu-view-" + thing); var ids = new Array(); switch (thing) { case "toolbar": ids = ["views-tbar"]; break; case "info": ids = ["user-list-box", "main-splitter"]; break; case "status": ids = ["status-bar-tbar"]; break; default: dd ("** Unknown element '" + menuId + "' passed to onToggleVisibility. **"); return; } var newState; var elem = document.getElementById(ids[0]); var d = elem.getAttribute("collapsed"); if (d == "true") { newState = "false"; menu.setAttribute ("checked", "true"); client.uiState[thing] = true; } else { newState = "true"; menu.setAttribute ("checked", "false"); client.uiState[thing] = false; } for (var i in ids) { elem = document.getElementById(ids[i]); elem.setAttribute ("collapsed", newState); } updateTitle();} |
ids = ["user-list-box", "main-splitter"]; | ids = ["main-splitter", "user-list-box"]; break; case "header": ids = ["header-bar-tbox"]; | function onToggleVisibility(thing){ var menu = document.getElementById("menu-view-" + thing); var ids = new Array(); switch (thing) { case "tabstrip": ids = ["view-tabs"]; break; case "info": ids = ["user-list-box", "main-splitter"]; break; case "status": ids = ["status-bar-tbar"]; break; default: dd ("** Unknown element ``" + menuId + "'' passed to onToggleVisibility. **"); return; } var newState; var elem = document.getElementById(ids[0]); var d = elem.getAttribute("collapsed"); if (d == "true") { newState = "false"; menu.setAttribute ("checked", "true"); client.uiState[thing] = true; } else { newState = "true"; menu.setAttribute ("checked", "false"); client.uiState[thing] = false; } for (var i in ids) { elem = document.getElementById(ids[i]); elem.setAttribute ("collapsed", newState); } updateTitle(); focusInput();} |
ids = ["status-bar-tbar"]; | ids = ["status-bar"]; | function onToggleVisibility(thing){ var menu = document.getElementById("menu-view-" + thing); var ids = new Array(); switch (thing) { case "tabstrip": ids = ["view-tabs"]; break; case "info": ids = ["user-list-box", "main-splitter"]; break; case "status": ids = ["status-bar-tbar"]; break; default: dd ("** Unknown element ``" + menuId + "'' passed to onToggleVisibility. **"); return; } var newState; var elem = document.getElementById(ids[0]); var d = elem.getAttribute("collapsed"); if (d == "true") { newState = "false"; menu.setAttribute ("checked", "true"); client.uiState[thing] = true; } else { newState = "true"; menu.setAttribute ("checked", "false"); client.uiState[thing] = false; } for (var i in ids) { elem = document.getElementById(ids[i]); elem.setAttribute ("collapsed", newState); } updateTitle(); focusInput();} |
OnUnassert : function(src,prop,target) { debug("panel_observer: onUnassert"); if (prop == RDF.GetResource(NC + "inbatch")) { sidebarOpenDefaultPanel(100, 0); } }, | OnUnassert : function(src,prop,target) { if (prop == RDF.GetResource(NC + "inbatch")) { sidebar_open_default_panel(100, 0); } }, | OnUnassert : function(src,prop,target) { debug("panel_observer: onUnassert"); // Wait for unassert that marks the end of the customize changes. // See customize.js for where this is unasserted. if (prop == RDF.GetResource(NC + "inbatch")) { sidebarOpenDefaultPanel(100, 0); } }, |
data.observer = null; | if ( data ) { var op = data; data = null; | function onUnload() { // Unhook observer. data.observer = null; // See if we completed normally (i.e., are closing ourself). if ( !completed ) { // Terminate transfer. data.Stop(); }} |
if ( !completed ) { data.Stop(); | op.observer = null; if ( started && !completed ) { try { op.Stop(); } catch ( exception ) { if ( !dialog.error ) { onError( exception ); } } op = null; } | function onUnload() { // Unhook observer. data.observer = null; // See if we completed normally (i.e., are closing ourself). if ( !completed ) { // Terminate transfer. data.Stop(); }} |
client.quit ("ChatZilla! [" + navigator.userAgent + "]"); | client.quit ("ChatZilla 0.8 [" + navigator.userAgent + "]"); | function onUnload(){ if (client.SAVE_SETTINGS) writeIRCPrefs(); client.quit ("ChatZilla! [" + navigator.userAgent + "]"); } |
data.Stop(); | if ( !completed ) { data.Stop(); } | function onUnload() { // Unhook observer. data.observer = null; // Terminate transfer. data.Stop();} |
writeIRCPrefs(); | writePrefs(); destroyPrefs(); | function onUnload(){ if (client.SAVE_SETTINGS) writeIRCPrefs();} |
if (gAddressBookSession) { gAddressBookSession.removeAddressBookListener(addressBookListener); } | try { var dataSource = top.rdf.GetDataSource("rdf:addressdirectory"); dataSource.RemoveObserver (addressBookObserver); } catch (ex) { dump(ex + "\n"); dump("Error removing from RDF datasource\n"); } | function OnUnloadAddressBook(){ if (gAddressBookSession) { gAddressBookSession.removeAddressBookListener(addressBookListener); }} |
return true; | function onUnloadJSConsole(){ // keep a global ref. to it instead??? try { var cs_class = Components.classes['@mozilla.org/consoleservice;1']; var cs_iface = Components.interfaces.nsIConsoleService; var cs_isupports = cs_class.getService(); var cs = cs_isupports.QueryInterface(cs_iface); } catch(exn) { // Couldn't get the console service for some reason... // pretend it never happened. return; } cs.unregisterListener(consoleListener); return true;} |
|
var cs_class = Components.classes['consoleservice']; | var cs_class = Components.classes['mozilla.consoleservice.1']; | function onUnloadJSConsole(){ // keep a global ref. to it instead??? try { var cs_class = Components.classes['consoleservice']; var cs_iface = Components.interfaces.nsIConsoleService; var cs_isupports = cs_class.getService(); var cs = cs_isupports.QueryInterface(cs_iface); } catch(exn) { // Couldn't get the console service for some reason... // pretend it never happened. return; } cs.unregisterListener(consoleListener);} |
RemoveToolBarPrefListener(); | function OnUnloadMessageWindow(){ // FIX ME - later we will be able to use onunload from the overlay OnUnloadMsgHeaderPane(); OnMailWindowUnload();} |
|
msgWindow.closeWindow(); | function OnUnloadMessageWindow(){ messenger.SetWindow(null, null);} |
|
pref.removeObserver("mail.pane_config.dynamic", MailPaneConfigObserver); | pref.removeObserver("mail.pane_config.dynamic", MailPrefObserver); pref.removeObserver("mail.showFolderPaneColumns", MailPrefObserver); | function OnUnloadMessenger(){ accountManager.removeIncomingServerListener(gThreePaneIncomingServerListener); pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal); pref.removeObserver("mail.pane_config.dynamic", MailPaneConfigObserver); // FIX ME - later we will be able to use onload from the overlay OnUnloadMsgHeaderPane(); OnMailWindowUnload();} |
accountManager.removeIncomingServerListener(gThreePaneIncomingServerListener); | function OnUnloadMessenger(){ OnMailWindowUnload();} |
|
RemoveToolBarPrefListener(); | function OnUnloadMessenger(){ accountManager.removeIncomingServerListener(gThreePaneIncomingServerListener); // FIX ME - later we will be able to use onload from the overlay OnUnloadMsgHeaderPane(); OnMailWindowUnload();} |
|
#ifdef MOZ_PHOENIX | function onUnloadViewSource(){#ifdef MOZ_PHOENIX gFindBar.uninitFindBar();#endif} |
|
#endif | function onUnloadViewSource(){#ifdef MOZ_PHOENIX gFindBar.uninitFindBar();#endif} |
|
getExtensionString("closeButtonLabel"), getExtensionString("closeButtonAccesskey"), false, "addons-no-updates"); | null, null, true, "addons-no-updates"); | onUpdateEnded: function() { if (!document) return; document.getElementById("progressBox").hidden = true; var viewGroup = document.getElementById("viewGroup"); viewGroup.hidden = false; gExtensionsView.removeAttribute("update-operation"); gExtensionsViewController.onCommandUpdate(); updateGlobalCommands(); if (this._updateFound) showView("updates"); else { var addonsMsg = document.getElementById("addonsMsg"); addonsMsg.showMessage("chrome://mozapps/skin/extensions/question.png", getExtensionString("noUpdatesMsg"), getExtensionString("closeButtonLabel"), getExtensionString("closeButtonAccesskey"), false, "addons-no-updates"); } }, |
gBrowser.showMessage(gBrowser.selectedBrowser, "chrome: message, popupButtonText, null, null, "blockedPopupOptions", "top", true, popupButtonAccesskey); | var notificationBox = gBrowser.getNotificationBox(); var notification = notificationBox.getNotificationWithValue("popup-blocked"); if (notification) { notification.label = message; } else { var buttons = [{ label: popupButtonText, accessKey: popupButtonAccesskey, popup: "blockedPopupOptions", callback: null }]; const priority = notificationBox.PRIORITY_WARNING_MEDIUM; notificationBox.appendNotification(message, "popup-blocked", "chrome: priority, buttons); } | onUpdatePageReport: function () { if (!this._reportButton) this._reportButton = document.getElementById("page-report-button"); if (gBrowser.selectedBrowser.pageReport) { this._reportButton.setAttribute("blocked", "true"); if (!gPrefService) gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (gPrefService.getBoolPref("privacy.popups.showBrowserMessage")) { var bundle_browser = document.getElementById("bundle_browser"); var brandBundle = document.getElementById("bundle_brand"); var brandShortName = brandBundle.getString("brandShortName"); var message; var popupCount = gBrowser.selectedBrowser.pageReport.length;#ifdef XP_WIN var popupButtonText = bundle_browser.getString("popupWarningButton"); var popupButtonAccesskey = bundle_browser.getString("popupWarningButton.accesskey");#else var popupButtonText = bundle_browser.getString("popupWarningButtonUnix"); var popupButtonAccesskey = bundle_browser.getString("popupWarningButtonUnix.accesskey");#endif if (popupCount > 1) message = bundle_browser.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]); else message = bundle_browser.getFormattedString("popupWarning", [brandShortName]); gBrowser.showMessage(gBrowser.selectedBrowser, "chrome://browser/skin/Info.png", message, popupButtonText, null, null, "blockedPopupOptions", "top", true, popupButtonAccesskey); } } else this._reportButton.removeAttribute("blocked"); }, |
message, popupButtonText, null, null, "blockedPopupOptions", "top", true); | message, popupButtonText, popupButtonAccesskey, null, null, "blockedPopupOptions", "top", true); | onUpdatePageReport: function () { if (!this._reportButton) this._reportButton = document.getElementById("page-report-button"); if (gBrowser.selectedBrowser.pageReport) { this._reportButton.setAttribute("blocked", "true"); if (gPrefService && gPrefService.getBoolPref("privacy.popups.showBrowserMessage")) { var bundle_browser = document.getElementById("bundle_browser"); var brandBundle = document.getElementById("bundle_brand"); var brandShortName = brandBundle.getString("brandShortName"); var message; var popupCount = gBrowser.selectedBrowser.pageReport.length;#ifdef XP_WIN var popupButtonText = bundle_browser.getString("popupWarningButton");#else var popupButtonText = bundle_browser.getString("popupWarningButtonUnix");#endif if (popupCount > 1) message = bundle_browser.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]); else message = bundle_browser.getFormattedString("popupWarning", [brandShortName]); gBrowser.showMessage(gBrowser.selectedBrowser, "chrome://browser/skin/Info.png", message, popupButtonText, null, null, "blockedPopupOptions", "top", true); } } else this._reportButton.removeAttribute("blocked"); }, |
gLastComputedMean = 0; | gLastComputedMean = -1; | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { document.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { document.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); document.title = title; }} |
var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; | dl = gActiveDownloads[i]; if (dl.percentComplete < 100 && dl.size > 0) { mean += dl.amountTransferred; base += dl.size; } | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { document.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { document.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); document.title = title; }} |
mean = Math.round(mean / numActiveDownloads); if (mean == 0 && gLastComputedMean > 0) { document.title = document.documentElement.getAttribute("statictitle"); return; | if (base == 0) { mean = 100; } else { mean = Math.floor((mean / base) * 100); | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { document.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { document.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); document.title = title; }} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.