Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Aug 19, 2016
1 parent 24765bb commit ff1c18e
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 6 deletions.
44 changes: 44 additions & 0 deletions docs/appActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,50 @@ Clears the data specified in dataDetail



### addAutofillAddress(detail, originalDetail)

Add address data

**Parameters**

**detail**: `object`, the address to add as per doc/state.md's autofillAddressDetail

**originalDetail**: `object`, the original address before editing



### removeAutofillAddress(detail)

Remove address data

**Parameters**

**detail**: `object`, the address to remove as per doc/state.md's autofillAddressDetail



### addAutofillCreditCard(detail, originalDetail)

Add credit card data

**Parameters**

**detail**: `object`, the credit card to add as per doc/state.md's autofillCreditCardDetail

**originalDetail**: `object`, the original credit card before editing



### removeAutofillCreditCard(detail)

Remove credit card data

**Parameters**

**detail**: `object`, the credit card to remove as per doc/state.md's autofillCreditCardDetail




* * *

Expand Down
38 changes: 38 additions & 0 deletions docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,27 @@ AppStore
locale: string, // en_US, en, or any other locale string
ignoredWords: Array<string>, // List of words to ignore
addedWords: Array<string> // List of words to add to the dictionary
},
autofill: {
addresses: [{
name: string,
organization: string,
streetAddress: string,
city: string,
state: string,
postalCode: string,
country: string,
phone: string,
email: string,
guid: Object.<string, <string>> // map of (partition, id) used to access the autofill entry in database
}],
creditCards: [{
name: string,
card: string,
month: string,
year: string,
guid: Object.<string, <string>> // map of (partition, id) used to access the autofill entry in database
}]
}
}
```
Expand Down Expand Up @@ -407,6 +428,23 @@ WindowStore
site: string,
score: ?
}
},
autofillAddressDetail: {
name: string,
organization: string,
streetAddress: string,
city: string,
state: string,
postalCode: string,
country: string,
phone: string,
email: string
},
autofillCreditCardDetail: {
name: string,
card: string,
month: string,
year: string
}
}
```
24 changes: 24 additions & 0 deletions docs/windowActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,30 @@ Sets the clear browsing data popup detail



### setAutofillAddressDetail(currentDetail, originalDetail)

Sets the manage autofill address popup detail

**Parameters**

**currentDetail**: `Object`, Properties of the address to change to

**originalDetail**: `Object`, Properties of the address to edit



### setAutofillCreditCardDetail(currentDetail, originalDetail)

Sets the manage autofill credit card popup detail

**Parameters**

**currentDetail**: `Object`, Properties of the credit card to change to

**originalDetail**: `Object`, Properties of the credit card to edit




* * *

Expand Down
26 changes: 26 additions & 0 deletions js/about/aboutActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,52 @@ const AboutActions = {
ipc.send(messages.LEDGER_ENABLE, enabled)
},

/**
* Open a adding address dialog
*/
addAutofillAddress: function () {
ipc.sendToHost(messages.ADD_AUTOFILL_ADDRESS)
},

/**
* Remove address
*
* @param {object} address - address to remove as per doc/state.md's autofillAddressDetail
*/
removeAutofillAddress: function (address) {
ipc.send(messages.REMOVE_AUTOFILL_ADDRESS, address)
},

/**
* Open a edit address dialog
*
* @param {object} address - address to edit as per doc/state.md's autofillAddressDetail
*/
editAutofillAddress: function (address) {
ipc.sendToHost(messages.EDIT_AUTOFILL_ADDRESS, address)
},

/**
* Open a adding credit card dialog
*/
addAutofillCreditCard: function () {
ipc.sendToHost(messages.ADD_AUTOFILL_CREDIT_CARD)
},

/**
* Remove credit card
*
* @param {object} card - credit card to remove as per doc/state.md's autofillCreditCardDetail
*/
removeAutofillCreditCard: function (card) {
ipc.send(messages.REMOVE_AUTOFILL_CREDIT_CARD, card)
},

/**
* Open a editing credit card dialog
*
* @param {object} card - credit card to edit as per doc/state.md's autofillCreditCardDetail
*/
editAutofillCreditCard: function (card) {
ipc.sendToHost(messages.EDIT_AUTOFILL_CREDIT_CARD, card)
}
Expand Down
18 changes: 18 additions & 0 deletions js/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ const appActions = {
})
},

/**
* Add address data
* @param {object} detail - the address to add as per doc/state.md's autofillAddressDetail
* @param {object} originalDetail - the original address before editing
*/
addAutofillAddress: function (detail, originalDetail) {
AppDispatcher.dispatch({
actionType: AppConstants.APP_ADD_AUTOFILL_ADDRESS,
Expand All @@ -377,13 +382,22 @@ const appActions = {
})
},

/**
* Remove address data
* @param {object} detail - the address to remove as per doc/state.md's autofillAddressDetail
*/
removeAutofillAddress: function (detail) {
AppDispatcher.dispatch({
actionType: AppConstants.APP_REMOVE_AUTOFILL_ADDRESS,
detail
})
},

/**
* Add credit card data
* @param {object} detail - the credit card to add as per doc/state.md's autofillCreditCardDetail
* @param {object} originalDetail - the original credit card before editing
*/
addAutofillCreditCard: function (detail, originalDetail) {
AppDispatcher.dispatch({
actionType: AppConstants.APP_ADD_AUTOFILL_CREDIT_CARD,
Expand All @@ -392,6 +406,10 @@ const appActions = {
})
},

/**
* Remove credit card data
* @param {object} detail - the credit card to remove as per doc/state.md's autofillCreditCardDetail
*/
removeAutofillCreditCard: function (detail) {
AppDispatcher.dispatch({
actionType: AppConstants.APP_REMOVE_AUTOFILL_CREDIT_CARD,
Expand Down
6 changes: 5 additions & 1 deletion js/actions/windowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,8 @@ const windowActions = {

/**
* Sets the manage autofill address popup detail
* @param {Object} currentDetail - Properties of the address to change to
* @param {Object} originalDetail - Properties of the address to edit
*/
setAutofillAddressDetail: function (currentDetail, originalDetail) {
dispatch({
Expand All @@ -965,7 +967,9 @@ const windowActions = {
},

/**
* Sets the manage autofill credit cards popup detail
* Sets the manage autofill credit card popup detail
* @param {Object} currentDetail - Properties of the credit card to change to
* @param {Object} originalDetail - Properties of the credit card to edit
*/
setAutofillCreditCardDetail: function (currentDetail, originalDetail) {
dispatch({
Expand Down
3 changes: 0 additions & 3 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,6 @@ class Frame extends ImmutableComponent {
this.webview.addEventListener('show-autofill-settings', (e) => {
windowActions.newFrame({ location: 'about:autofill' }, true)
})
this.webview.addEventListener('update-autofill-popup-data-list-values', (e) => {
console.log(e)
})
this.webview.addEventListener('show-autofill-popup', (e) => {
contextMenus.onShowAutofillMenu(e.suggestions, e.rect, this.frame)
})
Expand Down
1 change: 1 addition & 0 deletions js/constants/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const messages = {
CHECK_FLASH_INSTALLED: _,
ABOUT_COMPONENT_INITIALIZED: _,
CLEAR_BROWSING_DATA_NOW: _,
// Autofill
ADD_AUTOFILL_ADDRESS: _,
REMOVE_AUTOFILL_ADDRESS: _,
EDIT_AUTOFILL_ADDRESS: _,
Expand Down
4 changes: 2 additions & 2 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ const doAction = (action) => {
originalDetail: action.originalDetail
})
}
// Since the input values of addresses are bound, we need to notify the controls sync.
// Since the input values of address are bound, we need to notify the controls sync.
windowStore.emitChanges()
break
case WindowConstants.WINDOW_SET_AUTOFILL_CREDIT_CARD_DETAIL:
Expand All @@ -719,7 +719,7 @@ const doAction = (action) => {
originalDetail: action.originalDetail
})
}
// Since the input values of credit cards are bound, we need to notify the controls sync.
// Since the input values of credit card are bound, we need to notify the controls sync.
windowStore.emitChanges()
break
case WindowConstants.WINDOW_SET_DOWNLOADS_TOOLBAR_VISIBLE:
Expand Down

0 comments on commit ff1c18e

Please sign in to comment.