goog.editor.Link
Provided By |
---|
Wrap an editable link.
new Link( anchor, isNew )
Parameters |
|
---|
Instance Methods
this.finishLinkCreation( field ) → void
void
After link creation, finish creating the link depending on the type of link being created.
Parameters |
|
---|
this.getAnchor() → (HTMLAnchorElement|null)
(HTMLAnchorElement|null)
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getCurrentText() → string
string
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getExtraAnchors() → Array<(HTMLAnchorElement|null)>
Array<(HTMLAnchorElement|null)>
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getValidLinkFromText() → (string|null)
(string|null)
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.initializeUrl( url ) → void
void
this.isNew() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.placeCursorRightOf() → void
void
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.
this.removeLink() → void
void
Removes the link, leaving its contents in the document. Note that this object will no longer be usable/useful after this call.
this.setTextAndUrl( newText, newUrl ) → void
void
Static Functions
Link.createNewLink( anchor, url, opt_target, opt_extraAnchors ) → goog.editor.Link
goog.editor.Link
Initialize a new link.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Link.createNewLinkFromText( anchor, opt_target ) → goog.editor.Link
goog.editor.Link
Initialize a new link using text in anchor, or empty string if there is no likely url in the anchor.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Link.isLikelyEmailAddress( str ) → boolean
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
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
Link.isLikelyUrl( str ) → boolean
boolean
Link.isMailto( url ) → boolean
boolean