-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0 parents
commit 5580f04
Showing
18 changed files
with
982 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Define variables | ||
SRC_DIR := src | ||
BUILD_DIR := build | ||
VERSION:=$(shell grep em:version src/install.rdf | head -n 1 | sed -e 's/ *<em:version>//' -e 's/<\/em:version>//') | ||
ZIP_FILE_NAME := zotmeta-$(VERSION).xpi | ||
ZIP_FILE_PATH := $(BUILD_DIR)/$(ZIP_FILE_NAME) | ||
JSON_FILE := updates.json | ||
|
||
|
||
# Default target | ||
all: $(ZIP_FILE_PATH) $(JSON_FILE) | ||
|
||
# Target to zip all files in the source folder | ||
$(ZIP_FILE_PATH): | $(BUILD_DIR) | ||
(cd $(SRC_DIR) && zip -r $(abspath $@) .) | ||
|
||
# Target to generate a updates.json file | ||
$(JSON_FILE): | $(BUILD_DIR) | ||
jq ".addons[\"zotmeta@roadtodream.tech\"].updates[0].update_hash = \"sha256:`shasum -a 256 $(ZIP_FILE_PATH) | cut -d' ' -f1`\"" updates.json.tmpl | \ | ||
jq ".addons[\"zotmeta@roadtodream.tech\"].updates[0].update_link = \"https://github.com/RoadToDream/ZotMeta/releases/download/v$(VERSION)/$(ZIP_FILE_NAME)\"" > $@ | ||
|
||
# Create the build directory if it doesn't exist | ||
$(BUILD_DIR): | ||
mkdir -p $(BUILD_DIR) | ||
|
||
# Clean up generated files | ||
clean: | ||
rm -rf $(BUILD_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ZotMeta: Metadata update tool | ||
ZotMeta is a Zotero plugin to update articles metadata. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var ZotMeta; | ||
|
||
function log(msg) { | ||
Zotero.debug("ZotMeta: " + msg); | ||
} | ||
|
||
function install() { | ||
log("Installed"); | ||
} | ||
|
||
async function startup({ id, version, rootURI }) { | ||
log("Starting"); | ||
|
||
// Load chrome/content file directly via file:/// URL | ||
Services.scriptloader.loadSubScript(rootURI + 'chrome/content/utilities.js'); | ||
Services.scriptloader.loadSubScript(rootURI + 'chrome/content/threadpool.js'); | ||
Services.scriptloader.loadSubScript(rootURI + 'chrome/content/zotmeta.js'); | ||
ZotMeta.init({ id, version, rootURI }); | ||
ZotMeta.addToAllWindows(); | ||
} | ||
|
||
function onMainWindowLoad({ window }) { | ||
ZotMeta.addToWindow(window); | ||
} | ||
|
||
function onMainWindowUnload({ window }) { | ||
ZotMeta.removeFromWindow(window); | ||
} | ||
|
||
function shutdown() { | ||
log("Shutting down"); | ||
ZotMeta.removeFromAllWindows(); | ||
} | ||
|
||
function uninstall() { | ||
log("Uninstalled"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
content zotmeta chrome/content/ | ||
skin zotmeta default chrome/skin/ | ||
locale zotmeta en-US chrome/locale/en-US/ | ||
overlay chrome://zotero/content/zoteroPane.xul chrome://zotmeta/content/overlay.xul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
window.addEventListener('load', async function (event) { | ||
await Zotero.initializationPromise; | ||
ZotMeta.init(); | ||
ZotMeta.addToWindow(window); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
|
||
<overlay id="zotmeta-overlay" | ||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | ||
<script src="overlay.js"/> | ||
<script src="threadpool.js"/> | ||
<script src="utilities.js"/> | ||
<script src="zotmeta.js"/> | ||
</overlay> |
Oops, something went wrong.