Closed Bug 991190 Opened 6 years ago Closed 6 years ago

Rename Home.panels.authHandler API to Home.panels.auth

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 31

People

(Reporter: Margaret, Assigned: Margaret)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Follow-up to bug 942281.

mfinkle made this suggestion, and I like it. The "authHandler" option property is really more than a handler, since it specifies a function, as well as UI elements. We only use the term "authHandler" in the JS code, so this should be a simple change to make.
FYI, this is built on top of the patch for bug 978991, so I'll need to land that first.

This would make the set of API options look like:

function optionsCallback() {
  return {
    title: "My Panel",
    views: [{
      type: Home.panels.View.LIST,
      dataset: DATASET_ID,
      backImageUrl: "myBackIcon.png",
      itemHandler: Home.panels.ItemHandler.BROWSER
    }],
    layout: Home.panels.Layout.FRAME,
    auth: {
      authenticate: function authenticate() {
        // do some stuff to authenticate the user
        Home.panels.setAuthenticated(PANEL_ID, true);
      }, 
      messageText: "Please log in to this panel",
      buttonText: "Log in"
    }
  }; 
}

I like how this makes all the top-level properties into short all-lowercase names.
Attachment #8400799 - Flags: review?(liuche)
Comment on attachment 8400799 [details] [diff] [review]
Rename Home.panels.authHandler API to Home.panels.auth

Review of attachment 8400799 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #8400799 - Flags: review?(liuche) → review+
https://hg.mozilla.org/integration/fx-team/rev/042d3099b1f7

FYI, I updated the wiki and MDN.
https://hg.mozilla.org/mozilla-central/rev/042d3099b1f7
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
You need to log in before you can comment on or make changes to this bug.