Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Compatibility with Zotero v5 Standalone #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

mkdir -p build
git archive --format=zip -o build/z2csl.xpi HEAD \
rm -f build/z2csl.xpi
zip -r build/z2csl.xpi \
chrome.manifest \
install.rdf \
content/
2 changes: 1 addition & 1 deletion chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
content z2csl content/
overlay chrome://zotero/content/zoteroPane.xul chrome://z2csl/content/overlay.xul
overlay chrome://zotero/content/standalone/standalone.xul chrome://z2csl/content/overlay.xul
3 changes: 1 addition & 2 deletions content/overlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<script src="include.js"/>
<script src="z2csl.js"/>

<menupopup id="zotero-tb-actions-popup">
<menuseparator id="zotero-tb-actions-extension-separator"/>
<menupopup id="menu_ToolsPopup">
<menuitem id="z2csl-export" label="Export Z2CSL map"
oncommand="Zotero.Z2CSL.exportMappings(event);"/>
</menupopup>
Expand Down
4 changes: 2 additions & 2 deletions content/z2csl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Zotero.Z2CSL = {
}
this.cslDateMap = context.CSL_DATE_MAPPINGS;
this.cslCreatorMap = context.CSL_NAMES_MAPPINGS;
this.zoteroTypes = Zotero.ItemTypes.getTypes();
},

exportMappings: function() {
Expand All @@ -37,6 +36,7 @@ Zotero.Z2CSL = {

this.debug("Creating item type map...");

this.zoteroTypes = Zotero.ItemTypes.getTypes();
for(var i=0, n=this.zoteroTypes.length; i<n; i++) {
type = {name:'typeMap',
attributes:{
Expand Down Expand Up @@ -179,7 +179,7 @@ Zotero.Z2CSL = {
retrieveCSLVariables: function(callback) {
if(this.cslVars) callback(this.cslVars);

var url = 'http://citationstyles.org/downloads/specification.html';
var url = 'http://docs.citationstyles.org/en/1.0.1/specification.html';
var me = this;

Zotero.HTTP.processDocuments(url, function(doc) {
Expand Down
23 changes: 8 additions & 15 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,15 @@
<em:version>1.1</em:version>
<em:description>Produces Zotero to CSL type and field map</em:description>
<em:creator>Aurimas Vinckevicius</em:creator>
<em:type>2</em:type> <!-- type=extension -->

<!-- Requires Firefox or Zotero Standalone -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.6</em:minVersion>
<em:maxVersion>20.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>zotero@chnm.gmu.edu</em:id>
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>4.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>zotero@chnm.gmu.edu</em:id>
<em:minVersion>4.999</em:minVersion>
<em:maxVersion>5.*</em:maxVersion>
</Description>
</em:targetApplication>

</Description>

Expand Down