Home

# Class goog.editor.Link

Wrap an editable link.

Instance Method Summary
| `finishLinkCreation(?goog.editor.Field field)` After link creation, finish creating the link depending on the type of link being created.
| `getAnchor() ⇒ ?HTMLAnchorElement`
| `getCurrentText() ⇒ string`
| `initializeUrl(string url)` Set the url without affecting the isNew() status of the link.
| `isNew() ⇒ boolean`
| `placeCursorRightOf()` Places the cursor to the right of the anchor. Note that this is different from goog.editor.range's placeCursorNextTo in that it specifically handles the placement of a cursor in browsers that trap you in links, by adding a space when necessary and placing the cursor after that space.
| `removeLink()` Removes the link, leaving its contents in the document. Note that this object will no longer be usable/useful after this call.
| `setTextAndUrl(string newText, string newUrl)` Change the link.
| `updateLinkDisplay_(?goog.editor.Field field, string url)` Updates the cursor position and link bubble for this link.

Static Method Summary
| `createNewLink(?HTMLAnchorElement anchor, string url, string= opt_target) ⇒ ?goog.editor.Link` Initialize a new link.
| `isLikelyEmailAddress(string str) ⇒ boolean` Returns true if str could be an email address, false otherwise Ex: goog.editor.Link.isLikelyEmailAddress_("some word") == false goog.editor.Link.isLikelyEmailAddress_("foo@foo.com") == true
| `isLikelyUrl(string str) ⇒ boolean` Returns true if str could be a URL, false otherwise Ex: TR_Util.isLikelyUrl_("http://www.google.com") == true TR_Util.isLikelyUrl_("www.google.com") == true
| `isMailto(string url) ⇒ boolean` Determines whether or not a url is an email link.