зеркало из https://github.com/mozilla/gecko-dev.git
Bug 387748 add a tag column in the organizer center pane, for tagged items (for christineyen+bugs@gmail.com, r=mano)
This commit is contained in:
Родитель
9d955e2999
Коммит
209de66525
|
@ -381,6 +381,9 @@
|
|||
<treecol label="&col.title.label;" id="title" flex="5" primary="true"
|
||||
persist="width hidden ordinal sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol label="&col.tags.label;" id="tags" flex="2"
|
||||
persist="width hidden ordinal sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol label="&col.url.label;" id="url" flex="5"
|
||||
persist="width hidden ordinal sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
|
|
|
@ -425,6 +425,7 @@ PlacesTreeView.prototype = {
|
|||
COLUMN_TYPE_DESCRIPTION: 6,
|
||||
COLUMN_TYPE_DATEADDED: 7,
|
||||
COLUMN_TYPE_LASTMODIFIED: 8,
|
||||
COLUMN_TYPE_TAGS: 9,
|
||||
|
||||
_getColumnType: function PTV__getColumnType(aColumn) {
|
||||
var columnType = aColumn.id || aColumn.element.getAttribute("anonid");
|
||||
|
@ -445,6 +446,8 @@ PlacesTreeView.prototype = {
|
|||
return this.COLUMN_TYPE_DATEADDED;
|
||||
case "lastModified":
|
||||
return this.COLUMN_TYPE_LASTMODIFIED;
|
||||
case "tags":
|
||||
return this.COLUMN_TYPE_TAGS;
|
||||
}
|
||||
return this.COLUMN_TYPE_UNKNOWN;
|
||||
},
|
||||
|
@ -1020,6 +1023,14 @@ PlacesTreeView.prototype = {
|
|||
if (PlacesUtils.nodeIsSeparator(node))
|
||||
return "";
|
||||
return node.title || PlacesUtils.getString("noTitle");
|
||||
case this.COLUMN_TYPE_TAGS:
|
||||
if (PlacesUtils.nodeIsURI(node)) {
|
||||
var tagsvc = PlacesUtils.tagging;
|
||||
var uri = PlacesUtils._uri(node.uri);
|
||||
var tags = tagsvc.getTagsForURI(uri, {});
|
||||
return tags.join(", ");
|
||||
}
|
||||
return "";
|
||||
case this.COLUMN_TYPE_URI:
|
||||
if (PlacesUtils.nodeIsURI(node))
|
||||
return node.uri;
|
||||
|
@ -1105,6 +1116,10 @@ PlacesTreeView.prototype = {
|
|||
if (!this._result)
|
||||
throw Cr.NS_ERROR_UNEXPECTED;
|
||||
|
||||
// Currently cannot sort by tags
|
||||
if (aColumn.id == "tags")
|
||||
return;
|
||||
|
||||
this._enumerateObservers("onCycleHeader", [aColumn]);
|
||||
|
||||
// Sometimes you want a tri-state sorting, and sometimes you don't. This
|
||||
|
|
|
@ -197,6 +197,8 @@
|
|||
|
||||
<!ENTITY col.title.label
|
||||
"Name">
|
||||
<!ENTITY col.tags.label
|
||||
"Tags">
|
||||
<!ENTITY col.url.label
|
||||
"Location">
|
||||
<!ENTITY col.lastvisit.label
|
||||
|
|
Загрузка…
Ссылка в новой задаче