goog.editor.Link
Classgoog.editor.Link(anchor, isNew)
Wrap an editable link.
anchor
{HTMLAnchorElement
}
isNew
{boolean
}
.createNewLink(anchor, url, opt_target, opt_extraAnchors)
Initialize a new link.
anchor
{HTMLAnchorElement
}
url
{string
}
opt_target
{string
=}
opt_extraAnchors
{Array
.<HTMLAnchorElement
>=}
goog.editor.Link
}
.finishLinkCreation(field)
After link creation, finish creating the link depending on the type of link being created.
field
{goog.editor.Field
}
.getAnchor()
HTMLAnchorElement
}
.getCurrentText()
string
}
.getExtraAnchors()
Array
.<HTMLAnchorElement
>}
.initializeUrl(url)
Set the url without affecting the isNew() status of the link.
url
{string
}
.isLikelyEmailAddress(str)
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
str
{string
}
boolean
}
.isLikelyUrl(str)
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
str
{string
}
boolean
}
.isMailto(url)
Determines whether or not a url is an email link.
url
{string
}
boolean
}
.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(newText, newUrl)
Change the link.
newText
{string
}
newUrl
{string
}