logger.log(logger.EXTREME, "Inserting link");
String text = browser.selectedText();
if (text.trim().equalsIgnoreCase(""))
return;
NoteQuickLinkDialog dialog = new NoteQuickLinkDialog(logger, conn, text);
if (dialog.getResults().size() == 0) {
QMessageBox.critical(null, tr("No Matches Found") ,tr("No matching notes found."));
return;
}
if (dialog.getResults().size() > 1) {
dialog.exec();
if (!dialog.okPressed) {
logger.log(logger.EXTREME, "Insert link canceled");
return;
}
}
User user = Global.getUserInformation();
String dUrl = new String("evernote:///view/") + new String(user.getId() + "/" +user.getShardId() +"/"
+dialog.getSelectedNote()+"/"+dialog.getSelectedNote() +"/ " +"style=\"color:#69aa35\"");
String url = "<a title=\"" +dUrl
+"\" href=" +dUrl
+" >"+text +"</a>";
String script = "document.execCommand('insertHtml', false, '"+url+"');";