webpg.gmail

Adds WebPG functionality to gmail

Summary
webpg.gmailAdds WebPG functionality to gmail
Functions
setupSets up the required observers and creates instances to reusable objects
getCanvasFrameRetrieves the gmail UI message editor iframe
getCanvasFrameRetrieves the gmail UI message editor document
refreshTextRefresh the button text and style to reflect the present state
overrideSaveModifies the behavior of the gmail Save button to perform certains tasks when saved
overrideSendModifies the behavior of the gmail SEND button to perform certain tasks prior to sending the email
checkRecipientsChecks the keyring for the required keys when performing GnuPG methods that require them
displayStatusLineAdds a status message line to the gmail UI to display information
removeStatusLineRemoves the status message line from the gmail UI
handleFailureDetermines the details of a GnuPG operation failure and adds status message to the UI
emulateMouseClickCreates an synthetic mouseclick event for activating the standard gmail UI buttons
getRecipientsRetrieves the recipients in the TO, CC and BCC fields
addSendOptionBtnCreates the WebPG actions menu and adds it to the gmail UI
getContentsRetrieves the contents of the gmail UI message editor
setContentsSets the contents of the gmail UI message editor
cleanStrips out or replaces extra HTML markup added by the editor
gmailChangesCalled when the DOM changes.

Functions

setup

setup: function(navDiv)

Sets up the required observers and creates instances to reusable objects

Parameters

navDiv<obj> The navigation div from the gmail interface we will be working with

getCanvasFrame

getCanvasFrame: function()

Retrieves the gmail UI message editor iframe

getCanvasFrame

getCanvasFrameDocument: function()

Retrieves the gmail UI message editor document

refreshText

refreshText: function(e)

Refresh the button text and style to reflect the present state

Parameters

e<event> The HTML Event dispatched

overrideSave

overrideSave: function()

Modifies the behavior of the gmail Save button to perform certains tasks when saved

overrideSend

overrideSend: function()

Modifies the behavior of the gmail SEND button to perform certain tasks prior to sending the email

checkRecipients

checkRecipients: function(callback)

Checks the keyring for the required keys when performing GnuPG methods that require them

Parameters

callback<func> The function to execute when completed

displayStatusLine

displayStatusLine: function(message)

Adds a status message line to the gmail UI to display information

Parameters

message<str> The message to display

removeStatusLine

removeStatusLine: function()

Removes the status message line from the gmail UI

handleFailure

handleFailure: function(result,
recipKeys)

Determines the details of a GnuPG operation failure and adds status message to the UI

Parameters

result<obj> The result of the GnuPG operation that failed
recipKeys<obj> The recipient keys found (if any)

emulateMouseClick

emulateMouseClick: function(button)

Creates an synthetic mouseclick event for activating the standard gmail UI buttons

Parameters

button<obj> The target button to click

getRecipients

getRecipients: function()

Retrieves the recipients in the TO, CC and BCC fields

addSendOptionBtn

addSendOptionBtn: function(navDiv)

Creates the WebPG actions menu and adds it to the gmail UI

Parameters

navDiv<obj> The navigation div from the gmail interface we will be working with

getContents

getContents: function(editor)

Retrieves the contents of the gmail UI message editor

Parameters

editor<editor> The editor instance to use as the context

setContents

setContents: function(editor,
message)

Sets the contents of the gmail UI message editor

Parameters

editor<obj> The editor instance to use as the context
message<str/html> The content to place in the gmail UI message editor

clean

clean: function(text)

Strips out or replaces extra HTML markup added by the editor

Parameters

text<str> The string to parse

gmailChanges

function gmailChanges(e)

Called when the DOM changes.  Watches for our queue in DOM modifications to add the webpg related controls

Parameters

e<event> The HTML Event dispatched
setup: function(navDiv)
Sets up the required observers and creates instances to reusable objects
getCanvasFrame: function()
Retrieves the gmail UI message editor iframe
refreshText: function(e)
Refresh the button text and style to reflect the present state
overrideSave: function()
Modifies the behavior of the gmail Save button to perform certains tasks when saved
overrideSend: function()
Modifies the behavior of the gmail SEND button to perform certain tasks prior to sending the email
checkRecipients: function(callback)
Checks the keyring for the required keys when performing GnuPG methods that require them
displayStatusLine: function(message)
Adds a status message line to the gmail UI to display information
removeStatusLine: function()
Removes the status message line from the gmail UI
handleFailure: function(result,
recipKeys)
Determines the details of a GnuPG operation failure and adds status message to the UI
emulateMouseClick: function(button)
Creates an synthetic mouseclick event for activating the standard gmail UI buttons
getRecipients: function()
Retrieves the recipients in the TO, CC and BCC fields
addSendOptionBtn: function(navDiv)
Creates the WebPG actions menu and adds it to the gmail UI
getContents: function(editor)
Retrieves the contents of the gmail UI message editor
setContents: function(editor,
message)
Sets the contents of the gmail UI message editor
clean: function(text)
Strips out or replaces extra HTML markup added by the editor
function gmailChanges(e)
Called when the DOM changes.
Close