Trigger the hyperlink in the Tinymce editor

Hi, admins!

The hyperlink issue has been discussed in Note hyperlinks in Standalone.
Honestly, I pretty desire this feature. I fancy to note in my Evernote, so I need a hyperlink in the tinymce to link a certain record in my Evernote.
Tinymce does not trigger the 'dblclick' event. So I add a handler for the 'dblclick' event in the source code.

I modified the handle_event_callback in "/content/zotero/tinymce/note.html" (line: 18) to:

handle_event_callback : function (event) {
if(event.type === "dblclick"){
var targetNode = event.target;
if(targetNode.nodeName.toLowerCase() === "a"){
// open the origin link by a new created "a" element
var aEle = document.createElement('a');
aEle.href = targetNode.href;
aEle.target = '_blank'; // should open a new window
// fire a new mouse click event
var evt = document.createEvent("MouseEvents");
evt.initEvent("click",true,true);
aEle.dispatchEvent(evt);

}
}
// buble to zetero handler
zoteroHandleEvent(event);
},
After adding this code, when you double click a hyperlink in the tinymce editor, Zotero will open a new window to show the hyperlink page. And in terms of Evernote, Evernote will popup and focus the assigned record.
This might not be a good solution, but it does work! You guys might have much better ideas, and then update the coming version with this hyperlink feature.

Thanks!
Sign In or Register to comment.