Feature Request: Toggle "Flat View" for Collections
A direct Toggle Button for a "Flat View" of (sub-)Collections would be great if it was integrated directly in Zotero.
I learned it is possible in about:config via the setting of extensions.zotero.recursiveCollections, and after some trial & error I found out it is possible with a "custom Buttons"-Script in firefox. So it would be great if it was integrated in zotero directly as a Button on the surface.
------
For the meanwhile: a solution only for the zotero firefox addon:
- download the "custom buttons" firefox addon
- create a custom button (I put it next to my zotero button)
- in the section /*CODE*/, copy this:
this.toggleZoteroFlatView();
- in the sction /*Initialization code*/, copy this:
var pref = "extensions.zotero.recursiveCollections";
this.type = "checkbox";
this.SetZoteroFlatView = function() {
if (custombuttons.getPrefs(pref) == false) {
this.tooltipText = "FlatView is Off";
this.checked = false;
} else {
custombuttons.setPrefs(pref, true);
this.tooltipText = "FlatView is On";
this.checked = true;
}
}
this.toggleZoteroFlatView = function() {
if (custombuttons.getPrefs(pref) == true) {
custombuttons.setPrefs(pref, false);
this.tooltipText = "FlatView is Off";
this.checked = false;
} else {
custombuttons.setPrefs(pref, true);
this.tooltipText = "FlatView is On";
this.checked = true;
}
}
this.SetZoteroFlatView();
- finished - errhm - at least, worked for me. I'm no C programmer, don't know if this code is really clean. Last thing to do: After toggling, refresh the zotero view for the changes to take place.
I learned it is possible in about:config via the setting of extensions.zotero.recursiveCollections, and after some trial & error I found out it is possible with a "custom Buttons"-Script in firefox. So it would be great if it was integrated in zotero directly as a Button on the surface.
------
For the meanwhile: a solution only for the zotero firefox addon:
- download the "custom buttons" firefox addon
- create a custom button (I put it next to my zotero button)
- in the section /*CODE*/, copy this:
this.toggleZoteroFlatView();
- in the sction /*Initialization code*/, copy this:
var pref = "extensions.zotero.recursiveCollections";
this.type = "checkbox";
this.SetZoteroFlatView = function() {
if (custombuttons.getPrefs(pref) == false) {
this.tooltipText = "FlatView is Off";
this.checked = false;
} else {
custombuttons.setPrefs(pref, true);
this.tooltipText = "FlatView is On";
this.checked = true;
}
}
this.toggleZoteroFlatView = function() {
if (custombuttons.getPrefs(pref) == true) {
custombuttons.setPrefs(pref, false);
this.tooltipText = "FlatView is Off";
this.checked = false;
} else {
custombuttons.setPrefs(pref, true);
this.tooltipText = "FlatView is On";
this.checked = true;
}
}
this.SetZoteroFlatView();
- finished - errhm - at least, worked for me. I'm no C programmer, don't know if this code is really clean. Last thing to do: After toggling, refresh the zotero view for the changes to take place.