Home

# Class goog.ui.editor.LinkDialog

A type of goog.ui.editor.AbstractDialog for editing/creating a link.

extends goog.ui.editor.AbstractDialog

Instance Method Summary
| `buildOpenInNewWindowDiv_() ⇒ ?Element` Builds and returns the "checkbox to open the link in a new window" section of the edit link dialog.
| `buildTabEmailAddress_() ⇒ ?Element` Builds and returns the div containing the tab "Email address".
| `buildTabOnTheWeb_() ⇒ ?Element` Builds and returns the div containing the tab "On the web".
| `buildTextToDisplayDiv_() ⇒ ?Element` Builds and returns the text to display section of the edit link dialog.
| `createDialogControl() ⇒ ?goog.ui.Dialog` Creates and returns the goog.ui.Dialog control that is being wrapped by this object.
| `createOkEvent(?goog.events.Event e) ⇒ ?goog.events.Event` Creates and returns the event object to be used when dispatching the OK event to listeners based on which tab is currently selected and the contents of the input fields of that tab.
| `createOkEventFromEmailTab_(string= opt_inputId) ⇒ ?goog.ui.editor.LinkDialog.OkEvent` The function called when hitting OK with the "email address" tab current.
| `createOkEventFromUrl_(string url) ⇒ ?goog.ui.editor.LinkDialog.OkEvent` Creates an OK event from the text to display input and the specified link. If text to display input is empty, then generate the auto value for it.
| `createOkEventFromWebTab_() ⇒ ?goog.ui.editor.LinkDialog.OkEvent` The function called when hitting OK with the "On the web" tab current.
| `disableAutogenFlag_(boolean autogen)` Disables autogen so that onUrlOrEmailInputChange_ doesn't act in cases that are undesirable.
| `disposeInternal()` Disposes of the dialog. If the dialog is open, it will be hidden and AFTER_HIDE will be dispatched.
| `getTargetUrl_() ⇒ string` Returns the url that the target points to.
| `guessUrlAndSelectTab_(string text)` Select a url/tab based on the link's text. This function is simply the isNewLink_() == true case of selectAppropriateTab_().
| `hide()` Hides the dialog, causing AFTER_HIDE to fire.
| `isNewLink_() ⇒ boolean`
| `onChangeTab_(?goog.events.Event e)` Called when the currently selected tab changes.
| `onTextToDisplayEdit_()` Changes the autogenerateTextToDisplay flag so that text to display stops autogenerating.
| `onUrlOrEmailInputChange_()` Called whenever the url or email input is edited. If the text to display matches the text to display, turn on auto. Otherwise if auto is on, update the text to display based on the url.
| `onWebTestLink_()` Function to test a link from the on the web tab.
| `selectAppropriateTab_(string text, string url)` Selects the correct tab based on the URL, and fills in its inputs. For new links, it suggests a url based on the link text.
| `setAutogenFeatureEnabled(boolean enable)` Tells the dialog whether the autogeneration of text to display is to be enabled.
| `setAutogenFlagFromCurInput_()` If an email or url is being edited, set autogenerate to on if the text to display matches the url.
| `setAutogenFlag_(boolean val)` Turn on the autogenerate text to display flag, and set some sort of indicator that autogen is on.
| `setEmailWarning(string emailWarning)` Sets the warning message to show to users about including email addresses on public web pages.
| `setStopReferrerLeaks(boolean stop)` Tells the plugin whether to stop leaking the page's url via the referrer header when the "test this link" link is clicked.
| `setTextToDisplayFromAuto_()` If autogen is turned on, set the value of text to display based on the current selection or url.
| `setTextToDisplayVisible(boolean visible)` Tells the dialog whether to show the 'text to display' div. When the target element of the dialog is an image, there is no link text to modify. This function can be used for this kind of situations.
| `show()` Causes the dialog box to appear, centered on the screen. Lazily creates the dialog if needed.
| `showOpenLinkInNewWindow(boolean startChecked)` Tells the dialog to show a checkbox where the user can choose to have the link open in a new window.
| `syncOkButton_()` Called on a change to the url or email input. If either one of those tabs is active, sets the OK button to enabled/disabled accordingly.
| `toggleInvalidEmailWarning_(boolean on)` Show/hide the Invalid Email Address warning.