new TopNav(window, document)
Manage top (navigation) bar
Parameters:
| Name | Type | Description |
|---|---|---|
window |
object | |
document |
object |
- Source:
Members
(private, static) templateEmailBody
Template Email body.
- Source:
(private, static) triggerEmailSend
Trigger Email send.
- Source:
Methods
(private, static) bindEmailEvents()
bind the event listeners of the e-mail button and its confirmation
dialog
- Source:
(private, static) bindEvents()
bind all navigation event listeners
- Source:
(private, static) changeBurnAfterReading()
when "burn after reading" is checked, disable discussion
- Source:
(private, static) changeOpenDiscussion()
when discussion is checked, disable "burn after reading"
- Source:
(static) clearAttachmentInput()
Clear the attachment input in the top navigation.
- Source:
(static) clearPasswordInput()
Clear the password input in the top navigation
- Source:
(private, static) clickNewPaste()
hides all messages and creates a new document
- Source:
(private, static) clickRetryButton(event)
retrys some callback registered before
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(static) collapseBar()
collapses the navigation bar, only if expanded
- Source:
(private, static) confirmEmailTimezone(event)
Send the Email of the confirmation dialog, with the expiration in
the chosen timezone.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(private, static) displayQrCode()
Shows the QR code of the current document (URL).
- Source:
(private, static) downloadText()
download text
- Source:
(private, static) formatEmailExpiration(expirationDate, isUtc) → {string}
formats the expiration date for the e-mail body
The date gets rounded down by at least 30 seconds, to make up for
the delay of the request. We don't use Date.prototype.toUTCString(),
because we would like to avoid GMT.
Parameters:
| Name | Type | Description |
|---|---|---|
expirationDate |
number | timestamp in milliseconds |
isUtc |
bool | use UTC instead of the current timezone |
- Source:
Returns:
- Type
- string
(static) getBurnAfterReading() → {bool}
returns the state of the burn after reading checkbox
- Source:
Returns:
- Type
- bool
(static) getCustomAttachment() → {HTMLElement}
returns the element where custom attachments can be placed
Used by AttachmentViewer when an attachment is cloned here.
- Source:
Returns:
- Type
- HTMLElement
(static) getExpiration() → {int}
returns the currently set expiration time
- Source:
Returns:
- Type
- int
(static) getFileList() → {FileList|null}
returns the currently selected file(s)
- Source:
Returns:
- Type
- FileList | null
(static) getOpenDiscussion() → {bool}
returns the state of the discussion checkbox
- Source:
Returns:
- Type
- bool
(static) getPassword() → {string}
returns the entered password
- Source:
Returns:
- Type
- string
(static) hideAllButtons()
Hides all elements belonging to existing documents
- Source:
(static) hideBurnAfterReadingButtons()
hide irrelevant buttons when viewing burn after reading document
- Source:
(static) hideCloneButton()
only hides the clone button
- Source:
(static) hideCreateButtons()
shows all elements needed when creating a new document
- Source:
(static) hideCustomAttachment()
hides the custom attachment
- Source:
(static) hideEmailButton()
hide the "email" button
- Source:
(static) hideFileSelector()
hides the file selector in attachment
- Source:
(static) hideQrCodeButton()
only hides the qr code button
- Source:
(static) hideRawButton()
only hides the raw text button
- Source:
(static) hideRawButton()
only hides the download text button
- Source:
(static) hideRetryButton()
hides the "retry" button
- Source:
(static) hideViewButtons()
Hides all navigation elements for viewing an existing document
- Source:
(static) highlightFileupload()
Highlight file upload
- Source:
(static) init()
init navigation manager
preloads DOM elements
- Source:
(static) isAttachmentReadonly() → {bool}
returns if attachment dropdown is readonly, not editable
- Source:
Returns:
- Type
- bool
(private, static) rawText()
return raw text
- Source:
(private, static) removeAttachment(event)
removes the existing attachment
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(static) resetInput()
Reset the top navigation back to it's default values.
- Source:
(private, static) sendEmail()
Send Email with current document (URL), asking to confirm the
timezone of its expiration first, if it has one.
- Source:
(private, static) sendOnShortcut(event)
sends the document on [Ctrl]+[S] or, on macOS, [Cmd]+[S]
Only acts while the send button is shown, so the browser's own
"save page" still works when viewing an existing document.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
KeyboardEvent |
- Source:
(static) setFormat()
set the format on bootstrap templates in dropdown programmatically
- Source:
(private, static) setLanguage(event)
saves the language in a cookie and reloads the page
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(static) setRetryCallback(callback)
Set a function to call when the retry button is clicked.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
(private, static) setTemplate(event)
save the template in a cookie and reloads the page
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(static) showCreateButtons()
shows all elements needed when creating a new document
- Source:
(static) showCustomAttachment()
shows the custom attachment
- Source:
(static) showEmailbutton(optionalRemainingTimeInSeconds, optionalBurnAfterReading)
show the "email" button
Parameters:
| Name | Type | Description |
|---|---|---|
optionalRemainingTimeInSeconds |
number | undefined | |
optionalBurnAfterReading |
bool | undefined |
- Source:
(static) showNewPasteButton()
only shows the "new document" button
- Source:
(static) showRetryButton()
only shows the "retry" button
- Source:
(static) showViewButtons()
Shows all navigation elements for viewing an existing document
- Source:
(private, static) updateExpiration(event)
set the expiration on bootstrap templates in dropdown
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source:
(private, static) updateFormat(event)
set the format on bootstrap templates in dropdown from user interaction
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event |
- Source: