wshanks / Zutilo

Zotero plugin providing some additional editing features
Other
1.51k stars 72 forks source link

Feature request: more BBT shortcuts #224

Open DanteSung opened 2 years ago

DanteSung commented 2 years ago

Thanks for all your brilliant work.

I extensively use BBT to manage bib files and recently found Zutilo quite useful with Quick Copy alt 1&2.

I created the issue Keyboard shortcuts for BBT - https://github.com/retorquere/zotero-better-bibtex/issues/2123#issuecomment-1104875526 and the author @retorquere has exposed the function already.

Zutilo can call Zotero.BetterBibTeX.Text.sentenceCase(title, htmlSupport) to sentence-case a string.

Will the following code snippet do the job?

keys.categories.BBTSentenceCase = 'bbt'
    keys.shortcuts.BBTSentenceCase = function(win) {
        win.Zotero.BetterBibTeX.ready.then(function() {
            win.Zotero.BetterBibTeX.Text.sentenceCase(title, true)})
    }
qqobb commented 2 years ago

We can use Zotero.BetterBibTeX.ZoteroPane.sentenceCase(); for a new Zutilo shortcut. You can already use this function if you open "Tools" -> "Developer" -> "Run JavaScript" and paste in and run this line of code.

BTW, note that you can use the "Apps/Menu" key or Shift+F10 as an alternative to right-clicking items. When the item's context menu is being shown, you should be able to open the BBT submenu if you press "B" on your keyboard. You can then select a BBT function with the arrow keys and press "Enter".

qqobb commented 2 years ago

Let's also add a shortcut for BBT's "Change BibTeX key...", which should address an issue raised in https://github.com/retorquere/zotero-better-bibtex/issues/2117. We can use Zotero.BetterBibTeX.KeyManager.set(); for the shortcut.

DanteSung commented 2 years ago

We can use Zotero.BetterBibTeX.ZoteroPane.sentenceCase(); for a new Zutilo shortcut. You can already use this function if you open "Tools" -> "Developer" -> "Run JavaScript" and paste in and run this line of code.

BTW, note that you can use the "Apps/Menu" key or Shift+F10 as an alternative to right-clicking items. When the item's context menu is being shown, you should be able to open the BBT submenu if you press "B" on your keyboard. You can then select a BBT function with the arrow keys and press "Enter".

Calling Zotero.BetterBibTeX.ZoteroPane.sentenceCase(); in the code running pane does work.

image

But as you can see I'm using MAC OS which, to my knowledge, doesn't have an Apps/Menu Equivalent on the keyboard, so I guess the second suggestion won't work.

It seems my request can merge with the dark mode cite key request.

Anything I can do so far?

Thank you!

daeh commented 2 years ago

Just wanted to add enthusiastic support for @qqobb's suggestion. It would be fantastic to have a shortcut for "Change BibTeX key...".