Skip to content

Commit

Permalink
upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Sep 9, 2023
1 parent 18e6b63 commit 6efd62d
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 54 deletions.
2 changes: 1 addition & 1 deletion content/Preferences/autoexport.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ html:div(class='bbt-prefs-1col')
label(bbt:preference='extensions.zotero.translators.better-bibtex.autoExport') &better-bibtex_preferences_auto-export;
menulist(preference='extensions.zotero.translators.better-bibtex.autoExport')
menupopup
menuitem(value='off' label='&better-bibtex_preferences_auto-export_off.label;')
menuitem(value='immediate' label='&better-bibtex_preferences_auto-export_immediate.label;')
menuitem(value='idle' label='&better-bibtex_preferences_auto-export_idle.label;')
menuitem(value='off' label='&better-bibtex_preferences_auto-export_off.label;')
html:div
label(bbt:preference='extensions.zotero.translators.better-bibtex.autoExportDelay') &better-bibtex_preferences_auto-export_delay;
html:input(type='range' min='2' max='300' preference='extensions.zotero.translators.better-bibtex.autoExportDelay')/
Expand Down
22 changes: 13 additions & 9 deletions content/ZoteroPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,22 @@ class ZoteroPane {
else if (isLibrary) {
auto_exports = AutoExport.db.find($and({ type: 'library', id: treeRow.ref.libraryID }))
}
auto_exports = [...auto_exports].sort((a: { path: string }, b: { path: string }) => a.path.localeCompare(b.path))
log.debug('mae:', auto_exports)
}
auto_exports = [...auto_exports].sort((a: { path: string }, b: { path: string }) => a.path.localeCompare(b.path))

const menulist: XUL.Menulist = doc.getElementById('zotero-collectionmenu-bbt-autoexport') as XUL.Menulist
menulist.hidden = auto_exports.length === 0
log.debug('2578 auto-exports should be hidden:', menulist.hidden, auto_exports.length === 0)

if (auto_exports.length !== 0) {
menulist.removeAllItems()
auto_exports.forEach(ae => {
menulist.appendItem(ae.path, `${ae.$loki}`).addEventListener('command', () => AutoExport.run(ae.$loki))
})
if (!(menulist.hidden = auto_exports.length === 0)) {
const menupopup = doc.querySelector<HTMLElement>('#zotero-collectionmenu-bbt-autoexport menupopup')
while (menupopup.firstChild) menupopup.firstChild.remove()
log.debug('mae: reconstructing menu:', auto_exports.length, 'items')
for (const ae of auto_exports) {
log.debug('mae:', ae.path)
menupopup.appendChild(elements.create('menuitem', {
label: ae.path,
oncommand: () => AutoExport.run(ae.$loki),
}))
}
}
}
catch (err) {
Expand Down
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
"@retorquere/zotero-sync": "^1.0.23",
"@types/bluebird": "^3.5.38",
"@types/lokijs": "^1.5.10",
"@types/node": "^20.5.9",
"@types/node": "^20.6.0",
"@xmldom/xmldom": "^0.8.10",
"ajv-keywords": "^5.1.0",
"archiver": "^6.0.1",
"assert": "^2.0.0",
"assert": "^2.1.0",
"barcoder": "^2.0.1",
"benchmark": "^2.1.4",
"bluebird": "^3.7.2",
Expand All @@ -129,7 +129,7 @@
"dotenv": "^16.3.1",
"ejs": "^3.1.9",
"esbuild": "^0.19.2",
"eslint": "^8.48.0",
"eslint": "^8.49.0",
"estrace": "^4.2.2",
"eta": "^3.1.1",
"fast-json-patch": "^3.1.1",
Expand Down Expand Up @@ -162,7 +162,7 @@
"process": "^0.11.10",
"properties-reader": "^2.3.0",
"pug": "^3.0.2",
"putout": "^31.8.4",
"putout": "^31.8.5",
"recast": "^0.23.4",
"regenerate": "^1.4.2",
"rimraf": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions schema/BetterBibTeX JSON.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@
},
"autoExport": {
"enum": [
"off",
"immediate",
"idle"
"idle",
"off"
],
"type": "string"
},
Expand Down
2 changes: 1 addition & 1 deletion site/content/installation/preferences/automatic-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ idle. You mostly want this if your computer is performance-constrained (aka slow

Options:

* Paused
* On Change
* When Idle
* Paused


## Delay auto-export for
Expand Down
2 changes: 1 addition & 1 deletion submodules/babel

0 comments on commit 6efd62d

Please sign in to comment.