mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
removing more dump()s.
This commit is contained in:
parent
2da7b60a9b
commit
aa82385a70
@ -33,9 +33,7 @@ function editType()
|
||||
if (gTree.selectedItems && gTree.selectedItems[0]) {
|
||||
var uri = gTree.selectedItems[0].id;
|
||||
var handlerOverride = new HandlerOverride(uri);
|
||||
dump("*** foopy\n");
|
||||
window.openDialog("chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", handlerOverride);
|
||||
dump("*** foopy\n");
|
||||
selectApplication();
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,6 @@ function saveFontPrefs()
|
||||
pref.SetIntPref( "browser.display.use_document_fonts", documentFonts );
|
||||
if( currDefault != defaultFont )
|
||||
{
|
||||
dump("*** defaultFont = " + defaultFont + "\n");
|
||||
pref.SetUnicharPref( "font.default", defaultFont );
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,6 @@ function prefClearUrlbarHistory()
|
||||
if ( urlBarHist )
|
||||
{
|
||||
urlBarHist.clearHistory();
|
||||
dump("Now history should be empty. \n");
|
||||
button.setAttribute("disabled","true");
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
function TriStateColumnSort(column_name)
|
||||
{
|
||||
debug("TriStateColumnSort("+column_name+")");
|
||||
var current_column = find_sort_column();
|
||||
var current_direction = find_sort_direction(current_column);
|
||||
var column = document.getElementById(column_name);
|
||||
@ -46,9 +45,51 @@ function TriStateColumnSort(column_name)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Note: doSort() does NOT support natural order sorting, unless naturalOrderResource is valid,
|
||||
// in which case we sort ascending on naturalOrderResource
|
||||
|
||||
function doSort(sortColName, naturalOrderResource)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!sortResource)
|
||||
return false;
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true") {
|
||||
sortDirection = "ascending";
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending") {
|
||||
if (sortResource != naturalOrderResource)
|
||||
sortDirection = "descending";
|
||||
}
|
||||
else if (currentDirection == "descending") {
|
||||
if (naturalOrderResource)
|
||||
sortResource = naturalOrderResource;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var isupports = Components.classes["@mozilla.org/rdf/xul-sort-service;1"].getService();
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
}
|
||||
catch(ex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
xulSortService.Sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function SetSortDirection(direction)
|
||||
{
|
||||
debug("SetSortDirection("+direction+")");
|
||||
var current_column = find_sort_column();
|
||||
var current_direction = find_sort_direction(current_column);
|
||||
if (current_direction != direction) {
|
||||
@ -58,7 +99,6 @@ function SetSortDirection(direction)
|
||||
|
||||
function SetSortColumn(column_name)
|
||||
{
|
||||
debug("SetSortColumn("+column_name+")");
|
||||
var current_column = find_sort_column();
|
||||
var current_direction = find_sort_direction(current_column);
|
||||
var column = document.getElementById(column_name);
|
||||
@ -80,9 +120,7 @@ function sort_column(column, direction)
|
||||
var sort_resource = column.getAttribute('resource');
|
||||
xulSortService.Sort(column, sort_resource, direction);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
debug("Exception calling xulSortService.Sort()");
|
||||
catch(ex) {
|
||||
}
|
||||
update_sort_menuitems(column, direction);
|
||||
return false;
|
||||
@ -143,7 +181,6 @@ function update_sort_menuitems(column, direction)
|
||||
menuitem = menuitem.nextSibling
|
||||
while (1) {
|
||||
var name = menuitem.getAttribute('column_id');
|
||||
debug("update: "+name)
|
||||
if (!name) break;
|
||||
if (column_name == name) {
|
||||
menuitem.setAttribute('checked', 'true');
|
||||
@ -192,20 +229,21 @@ function fillViewMenu(popup)
|
||||
var head = document.getElementById('headRow');
|
||||
var skip_column = document.getElementById('popupCell');
|
||||
|
||||
if (fill_after.nextSibling == fill_before) {
|
||||
var name_template = get_localized_string("SortMenuItem");
|
||||
var tree_column = head.firstChild;
|
||||
var column_node = columns.firstChild;
|
||||
while (tree_column) {
|
||||
if (skip_column != tree_column) {
|
||||
var name_template = get_localized_string("SortMenuItem");
|
||||
var tree_column = head.firstChild;
|
||||
var column_node = columns.firstChild;
|
||||
var popupChild = popup.firstChild.nextSibling.nextSibling;
|
||||
var firstTime = (fill_after.nextSibling == fill_before);
|
||||
while (tree_column) {
|
||||
if (firstTime) {
|
||||
if (skip_column != tree_column && tree_column.getAttribute("collapsed") != "true") {
|
||||
// Construct an entry for each cell in the row.
|
||||
var column_name = tree_column.getAttribute("value");
|
||||
var item = document.createElement("menuitem");
|
||||
item.setAttribute("type", "radio");
|
||||
item.setAttribute("name", "sort_column");
|
||||
if (column_name == "") {
|
||||
column_name = tree_column.getAttribute("display");
|
||||
}
|
||||
if (column_name == "")
|
||||
column_name = tree_column.getAttribute("display");
|
||||
var name = name_template.replace(/%NAME%/g, column_name);
|
||||
var id = column_node.id;
|
||||
item.setAttribute("value", name);
|
||||
@ -214,12 +252,18 @@ function fillViewMenu(popup)
|
||||
|
||||
popup.insertBefore(item, fill_before);
|
||||
}
|
||||
tree_column = tree_column.nextSibling;
|
||||
column_node = column_node.nextSibling;
|
||||
|
||||
if (column_node && column_node.tagName == "splitter")
|
||||
column_node = column_node.nextSibling;
|
||||
}
|
||||
else {
|
||||
if (column_node.getAttribute("collapsed") == "true")
|
||||
popupChild.setAttribute("hidden", "true");
|
||||
else
|
||||
popupChild.removeAttribute("hidden");
|
||||
popupChild = popupChild.nextSibling;
|
||||
}
|
||||
tree_column = tree_column.nextSibling;
|
||||
column_node = column_node.nextSibling;
|
||||
if (column_node && column_node.tagName == "splitter")
|
||||
column_node = column_node.nextSibling;
|
||||
}
|
||||
var sort_column = find_sort_column();
|
||||
var sort_direction = find_sort_direction(sort_column);
|
||||
@ -261,7 +305,6 @@ function fillContextMenu(name)
|
||||
}
|
||||
|
||||
var select_list = treeNode.selectedItems;
|
||||
debug("# of Nodes selected: " + treeNode.selectedItems.length + "\n");
|
||||
|
||||
var separatorResource =
|
||||
rdf.GetResource(NC_NS + "BookmarkSeparator");
|
||||
@ -376,9 +419,6 @@ function fillContextMenu(name)
|
||||
cmdName = cmdNameLiteral.Value;
|
||||
if (!cmdName) break;
|
||||
|
||||
debug("Command #" + cmdIndex + ": id='" + cmdResource.Value +
|
||||
"' name='" + cmdName + "'");
|
||||
|
||||
var newMenuItem = document.createElement("menuitem");
|
||||
newMenuItem.setAttribute("value", cmdName);
|
||||
popupNode.appendChild(newMenuItem);
|
||||
@ -440,5 +480,4 @@ function get_localized_string(name) {
|
||||
var uri = "chrome://communicator/locale/bookmarks/bookmark.properties";
|
||||
var bundle = srGetStrBundle(uri);
|
||||
return bundle.GetStringFromName(name);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user