0

Flickr widget login functionality

I need help to understand flickr widget's login functionality. I could not find the code for login(where yahoo id and password are entered). I could not find the code where keyboard the attached to the widget.

I want to add a login functionality in my widget how should I go for it?

by
16 Replies
  • QUOTE (Jaya @ May 6 2009, 02:38 AM) <{POST_SNAPBACK}>
    I need help to understand flickr widget's login functionality. I could not find the code for login(where yahoo id and password are entered). I could not find the code where keyboard the attached to the widget.

    I want to add a login functionality in my widget how should I go for it?


    The way the Flickr does it is different than how you will do it. Here's an example:

    CODE
    var onLoginCompleted = function (result) {
    log("the login dialog returned username:", result.username, "and password:", result.password);
    };

    var onLoginCancelled = function () {
    log("the login dialog was cancelled");
    };

    new KONtx.dialogs.Login({
    title: "Login required",
    message: "Please enter your FooBar.com login information."
    callback: onLoginCompleted,
    cancelCallback: onLoginCancelled
    }).show();
    0
  • QUOTE (Jeremy Johnstone @ May 6 2009, 11:34 AM) <{POST_SNAPBACK}>
    The way the Flickr does it is different than how you will do it. Here's an example:

    CODE
    var onLoginCompleted = function (result) {
    log("the login dialog returned username:", result.username, "and password:", result.password);
    };

    var onLoginCancelled = function () {
    log("the login dialog was cancelled");
    };

    new KONtx.dialogs.Login({
    title: "Login required",
    message: "Please enter your FooBar.com login information."
    callback: onLoginCompleted,
    cancelCallback: onLoginCancelled
    }).show();


    I've copypasted this and run on Simulator 540 and it worked fine, while in 1080 login dialog doesn't look good (looks like half of its components think the sidebar width is much less than it is). Changing KONtx.dialogs.Login to KONtx.dialogs.YahooLogin helped, it works fine with everything else untouched. Is there any way of making Login dialog look the same as YahooLogin on Simulator 1080 or am I missing something?
    0
  • QUOTE (hriuki @ Sep 10 2009, 08:04 AM) <{POST_SNAPBACK}>
    I've copypasted this and run on Simulator 540 and it worked fine, while in 1080 login dialog doesn't look good (looks like half of its components think the sidebar width is much less than it is). Changing KONtx.dialogs.Login to KONtx.dialogs.YahooLogin helped, it works fine with everything else untouched. Is there any way of making Login dialog look the same as YahooLogin on Simulator 1080 or am I missing something?


    Which version of the WDK are you using?

    -Jeremy
    0
  • Thanks Jeremy,

    Now, how can I retrieve the user_id of the user after login.
    I used KONtx.dialogs.YahooLogin, The "result" in onLoginCompleted function is coming true, there must be some other object returned on successful login.

    please help.
    0
  • QUOTE (Jaya @ May 6 2009, 10:25 PM) <{POST_SNAPBACK}>
    Now, how can I retrieve the user_id of the user after login.
    I used KONtx.dialogs.YahooLogin, The "result" in onLoginCompleted function is coming true, there must be some other object returned on successful login.


    Are you trying to log in a Yahoo! ID? If so, can you please tell me what you are trying to accomplish?

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ May 7 2009, 09:47 AM) <{POST_SNAPBACK}>
    Are you trying to log in a Yahoo! ID? If so, can you please tell me what you are trying to accomplish?

    -Jeremy


    Hi Jeremy,

    I want to set a logo for LoginDialog,

    var logo = new KONtx.element.Image({
    src: $imgpath + 'application/application-logo.png',
    });
    var login = new KONtx.dialogs.Login({
    logo: logo, //image above
    title: "Login required",
    message: "Please enter userID and password",
    callback: onLoginCompleted,
    cancelCallback: onLoginCancelled
    });
    login.show();

    But the logo isn't showed. Please help me.
    0
  • Hi Jeremy,

    I do following your sample, but
    the functions: onLoginCompleted, onLoginCancelled don't work.

    var logo = new KONtx.element.Image({
    src: $imgpath + 'application/application-logo.png',
    });

    var onLoginCompleted = function (result) {
    dlog('onLoginCompleted', 2);
    };

    var onLoginCancelled = function () {
    dlog('onLoginCancelled', 2);
    };

    new KONtx.dialogs.Login({
    logo: logo, //image above
    title: $_("views.login.title"),
    message: $_("views.login.message"),
    callback: onLoginCompleted,
    cancelCallback: onLoginCancelled
    }).show();


    Please help to solve:
    1. Logo (not be showed).
    2. callback and cancelCallback (don't work).

    Many thanks.
    0
  • append...
    ( :)Many thanks.
    0
  • Jerry,

    1.) Pass the path to the image, not a KONtx image
    2.) I'll check and see if that's an issue of you using an older Framework (I believe so)
    3.) Coming in next WDK release

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ May 11 2009, 08:36 AM) <{POST_SNAPBACK}>
    Jerry,

    1.) Pass the path to the image, not a KONtx image
    2.) I'll check and see if that's an issue of you using an older Framework (I believe so)
    3.) Coming in next WDK release

    -Jeremy


    Hi Jeremy,

    1. I passed the path to the image, but it isn't be displayed so i pass the image like above.
    2. I set up the file ywe-wdk-0.9.5-33-i386.deb. Please help me.
    3. Hope it come soon.

    Thanks.
    Jerry ^ _ ^
    0
  • QUOTE (Jerry Dang @ May 11 2009, 06:14 PM) <{POST_SNAPBACK}>
    Hi Jeremy,


    2. I set up the file ywe-wdk-0.9.5-33-i386.deb..
    I see 2 events: onDialogDone, onDialogCancelled when i implement the Login dialog, Jeremy. Please help to show my problem, Jeremy.

    Thanks.
    Jerry ^ _ ^
    0
  • Can you try the Framework I provided with the video sample widget and let me know if this is an issue?

    Thanks!

    -Jeremy
    0
  • WOW,

    I can do it, Jeremy, in the framework i'm using (my code is not right, ).
    Thanks Jeremy.
    0
  • But i can't still change the logo, huhu. :(
    0
  • QUOTE (Jerry Dang @ May 13 2009, 02:15 AM) <{POST_SNAPBACK}>
    But i can't still change the logo, huhu. :(Did you do like I suggested and provide the path to the image and not a KONtx.element.Image reference?
    0
  • QUOTE (Jeremy Johnstone @ May 13 2009, 09:48 AM) <{POST_SNAPBACK}>
    Did you do like I suggested and provide the path to the image and not a KONtx.element.Image reference?


    Hi Jeremy,

    Before i tried to set an image object to logo, i had tried to set a path to logo, like this:

    //show RPLoginView
    this.controls.loginView = new RPLoginView({
    logo: $rp.$data.$imgpath + 'application/application-logo.png',
    title: $_("views.login.title"),
    message: $_("views.login.message"),
    callback: onLoginCompleted,
    cancelCallback: onLoginCancelled
    });

    RPLoginView is a class extends from KONtx.dialogs.Login.
    It always shows the title, not logo.
    I don't know why.

    Thanks.
    0
  • I followed up on this more internally and the issue is that logo is not supported. I have created a ticket to have the config option removed from KONtx.dialogs.Login to avoid confusion.

    -Jeremy
    0

Recent Posts

in General - Yahoo! TV Widgets