-
Notifications
You must be signed in to change notification settings - Fork 780
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
TinyMCE Improvements: Open links from note window with popup and auto-create links (for 4.0 branch) #450
Conversation
@@ -138,6 +138,9 @@ | |||
|
|||
case 'change': | |||
break; | |||
|
|||
case 'openlink': | |||
ZoteroPane.loadURI(event.target.href); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent and add "break;"
no idea what was going on with the indent but it's fixed. |
I'll look into passing through the modifier keys and getting this to work in separate note windows. For contextmenu, it looks like this will be easier once we upgrade to TinyMCE 4, which lets you define menu items that can then be added to the menu. In the meantime, we can just include the non-minified version from GitHub — I assume it's just this — and add a comment that says "// Added by Zotero".
I can look into it. Otherwise, this looks good. You can squash these commits together into a single one for merging. |
I replaced the |
Sorry, could you just clean up that commit message a little and remove unnecessary stuff ("Indent correctly")? You can use Also, can you add a comment to the top of linksmenu/editor_plugin.js saying that it's based on the TinyMCE contextmenu plugin (which I think is what you said)? |
Sorry, my git skills are still pretty bad. The message is fixed. There already is a comment saying * This plugin adds a left-click context menu to links in the TinyMCE editor for Zotero.
* Code adopted and modified from TinyMCE contextmenu plugin. Anything missing? |
- Send modifier keys through to loadURI() when clicking Open Link in notes - Open link in parent window from external note window - Don't show both menus on right-click Follow-up from #450
TinyMCE Improvements: Open links from note window with popup and auto-create links
Sorry, missed that. Merged into 4.0. Note that I rebased your commit again to convert spaces to tabs (which are what we use) in linksmenu/editor_plugin.js, so you'll probably need to rewind to before these changes with Thanks for working on this! |
Now available for testing in 4.0.18-beta.r5. |
Great! I will use and test it a little. |
Okay, here is an updated version for the 4.0 branch.
I have Moved the pull-request.
I tried but have problems doing this because I am unable to get the original event. Maybe you have an idea what's going on. Currently, the linksmenu plugin adds a command using
ed.addCommand('openlink'
, which callszoteroHandleEvent
with a fake event (but without .shiftKey, etc.). This 'openlink' command is called when the user clicks the button based on this linecmd : 'openlink'
in the definition of theOpen Link
button. The command is not an event though so that I don't know how to get the data. An alternative would be to replacecmd : 'openlink'
withonclick: function() {... call to zoteroHandleEvent...
but that function only gets the node as an argument not the event.linksmenu
plugin contains all the relevant code. There is, however, a second place were I used to modify tinymce code. I changed thecontextmenu
plugin to add the open button to the right click menu as well. It's a little annoying because the contextmenu plugin is minified so that my small change replaces the entire plugin. I don't think there is a workaround for that. This pull request does not include this commit for now. I can add the commit, I could create a new plugincontextmenu2
with the modification, or theopen link
button does not appear in the right-click menu but I think it's nice. What is your preference?For me, two finger click on touchpad is right click (OSX/Firefox) and I can't reproduce the problem. So it would be great if you can take a look.
I remove the Unlink button from the toolbar.
loadURI
, which might try to open the link in the separate note window.