OSDN Git Service

Add popup to show URL when moving mouse over a link.
authorRandy Baumgarte <randy@fbn.cx>
Thu, 2 Sep 2010 12:41:25 +0000 (08:41 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Tue, 14 Sep 2010 10:22:03 +0000 (06:22 -0400)
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/gui/BrowserWindow.java

index 2399e93..692fb9b 100644 (file)
@@ -3991,6 +3991,15 @@ public class NeverNote extends QMainWindow{
                        enmedia.removeChild(enmedia.firstChild());   // Remove the actual encrypted text
                }
 
+               
+               // Modify link tags
+               anchors = docElem.elementsByTagName("a");
+               enCryptLen = anchors.length();
+               for (int i=0; i<anchors.length(); i++) {
+                       QDomElement element = anchors.at(i).toElement();
+                       element.setAttribute("title", element.attribute("href"));
+               }
+
                logger.log(logger.HIGH, "Leaving NeverNote.modifyTags");
                return doc;
        }
index 77542c4..e64c2c1 100644 (file)
@@ -1168,7 +1168,9 @@ public class BrowserWindow extends QWidget {
                        String selectedText = browser.selectedText();\r
                        logger.log(logger.EXTREME, "Inserting link on text "+selectedText);\r
                        logger.log(logger.EXTREME, "URL Link " +dialog.getUrl().trim());\r
-                       String url = "<a href=\"" +dialog.getUrl().trim()+"\" >"+selectedText +"</a>";\r
+                       String url = "<a href=\"" +dialog.getUrl().trim()\r
+                                       +"\" title=" +dialog.getUrl().trim() \r
+                                       +" >"+selectedText +"</a>";\r
                        String script = "document.execCommand('insertHtml', false, '"+url+"');";\r
                        browser.page().mainFrame().evaluateJavaScript(script);\r
                        return;\r