First run guidance for creator menu

This commit is contained in:
Simon Kornblith 2011-10-03 06:04:37 +00:00
parent 27b5505661
commit a259a6b8cd
3 changed files with 21 additions and 10 deletions

View file

@ -31,22 +31,26 @@
<binding id="guidancepanel">
<implementation>
<method name="show">
<parameter name="forEl"/>
<body>
<![CDATA[
var about = this.getAttribute("about");
var pref = "firstRunGuidanceShown."+about;
var shown = false;
var about = this.getAttribute("about"),
pref = "firstRunGuidanceShown."+about,
shown = false;
try {
shown = Zotero.Prefs.get(pref);
} catch(e) {};
if(shown) return;
var panel = document.getAnonymousNodes(this)[0],
forEl = this.getAttribute("for");
var x = this.getAttribute("x"),
y = this.getAttribute("y"),
position = this.getAttribute("position"),
panel = document.getAnonymousNodes(this)[0];
if(!forEl) forEl = document.getElementById(this.getAttribute("for"));
panel.lastChild.textContent = Zotero.getString("firstRunGuidance."+about);
panel.openPopup(document.getElementById(forEl),
"after_start", 0, 0, false, true, null);
panel.openPopup(forEl, position ? position : "after_start",
x ? parseInt(x, 10) : 0, y ? parseInt(y, 10) : 0, false, false, null);
Zotero.Prefs.set(pref, true);
]]>

View file

@ -1867,6 +1867,11 @@
if(field === 'creator') {
// Reset creator mode settings here so that flex attribute gets reset
this.switchCreatorMode(row, (otherFields.fieldMode ? 1 : 0), true);
if(Zotero.ItemTypes.getName(this.item.itemTypeID) === "bookSection") {
var creatorTypeLabels = document.getAnonymousNodes(this)[0].getElementsByClassName("creator-type-label");
document.getElementById("zotero-author-guidance").show(creatorTypeLabels[creatorTypeLabels.length-1]);
}
}
if (this._tabDirection) {
@ -2412,7 +2417,8 @@
oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'sentence')"/>
</menupopup>
</menu>
</menupopup>
</menupopup>
<zoteroguidancepanel id="zotero-author-guidance" about="authorMenu" position="after_end" x="-25"/>
</popupset>
<grid flex="1">
<columns>

View file

@ -749,4 +749,5 @@ standalone.addonInstallationFailed.body = The add-on "%S" could not be installe
connector.error.title = Zotero Connector Error
connector.standaloneOpen = Your database cannot be accessed because Zotero Standalone is currently open. Please view your items in Zotero Standalone.
firstRunGuidance.saveIcon = Zotero can recognize a reference on this page. Click this icon in the address bar to save this reference to your Zotero library.
firstRunGuidance.saveIcon = Zotero can recognize a reference on this page. Click this icon in the address bar to save this reference to your Zotero library.
firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu.