Needs review
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Dec 2011 at 01:00 UTC
Updated:
14 Aug 2013 at 18:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
Dave Cohen commentedIt is drupal's zebra bar. I'm sure it could be hidden via css, or javascript. It's a little hacky I admit, but I thought better to give some kind of feedback, and I didn't bother to figure out how to make a spinning wheel appear in the middle of the page.
The code is in fb.js...
As the TODO indicates, it could use some work. Would love to see patches from people who really know how to do this sort of thing.
Comment #2
jim_at_miramontes commentedThanks much. Giving the div's ID a display: none style hides it nicely.
Comment #3
blv commentedHello everyone... hope it's okay i posted a comment inside this thread instead of opening a new one. i saw this one is still active. i have a similar problem - i want to hide the progress bar, yet when i tried to put -
in fb_theme.css and in my theme's (Zen) pages.css file (not at the same time of course), it didn't do the trick, and the progress bar kept showing up. it's very strange, as it supposed to be a simple css attribute. i tried to make sure it's not a theme registry problem by enabling the "Rebuild theme registry on every page" option but the problem remains. anyone have any idea why this is happening? any idea's on other method's of removing \ hiding the progress bar?
thanks a lot!
Comment #4
Dave Cohen commentedin recent versions, fb.js does not just add a bar to the top of the screen, it attempts this effect on connect buttons and other facebook-related portions of the page.
Try a style like
(I haven't tested that, and might have the classes in the wrong order. Try it and see.)
I'm open to patches that make this easier to customize or improve the effect. I just want some feedback that the page is reloading by default, because in some cases that is slow.
Comment #5
blv commentedThanks again for your help! i admire the work you've done and the effort's you make so all of us could enjoy this module and get the best of it.
i tried getting it done with plain CSS
display:none;as you suggested, but for some reason i couldn't get the p-bar to hide itself. so, unable to hide it, i had to go an extra mile and do a little hack that ease the use of custom loading animations... i don't know how to create a patch so I'll just write what I've done -in
fb.user.module, in line 561 as part of thehook_form_alter, I've added a loading animation DIV -in
fb.js(line 233) i changed the function a bit -and last, in
fb.theme.cssi added the attribute to position the loading wheel -of course you can position it however you like, depending on your design needs.
this way, the only thing needed is to point in
fb.user.moduleto the loader's animation path and to position it through the css file. loader animations can be downloaded from here - http://ajaxload.info/it's kind of a hack, but it get's the ugly progress bar out of the way and put's a beautiful spinning wheel (or any other custom animation) instead of it ;) would appreciate your insight's... i'm not sure if adding the spinner DIV to that form in fb.user wont cause it to show anywhere else (other than the loading process). i guess it's alright as long as you wont think these changes could mess something up. hope this solution is good enough and that someone else could enjoy it, you were right saying it's good to give a feedback that the page is loading for slow connections. as i said, i don't know how to compile patches (but would be happy to get a link to a good tut though).
Comment #6
blv commentednow that i think of it, it might not be the best way to approach it... i looked at it again and if im not mistaking, it basically cancels the progress bar, and adds an animation to the fb_connected DIV.
the problem is, that DIV get's hidden the moment the progress bar is supposed to show. so in case of a slow connection, the user will see the animation as long as the so called "splash screen" appears. BUT, as soon as fb_connected disappears, he would be left with no indication of what's going on. did i understand the workflow correctly? if so, my previous solution isn't too good and I'll have to figure out something else...
Comment #7
Dave Cohen commentedTo solve that, you want fb.js to simply do
Without the rest of that if clause.
Have you tested this on all major browsers. I think you have a better way here. I will take a stab at making the default behavior more like this.
Comment #8
blv commentedThanks a lot!
did you mean like this ?
or like this?
var fbMarkup = jQuery('body').prepend('<div id="spinner" class="spinner" >');for the browsers, both of the codes work fine on all 3 major browsers.
i tested it with Chrome, Firefox and IE, the three of them show the loading animation and redirect correctly. would appreciate your answer regarding which code is a better use so i could get the workflow correctly. of course, some work has to be done on the css code in order for it to look crisp on all three of them. (for some reason, FF and IE throws in some little extra padding - but i guess that's just because the fancy positioning i used and shouldn't happen with "simple" css attributes)
glad i could throw in my 2 cents... thanks a lot again!
Comment #9
Dave Cohen commentedHere's what I'm currently testing. It's a D6 diff (because its easier for me to checkin to my D6 branch then merge changes into D7), I think it will apply to D7 as well.
The diff wouldn't include the new fb_spinner.gif so I've attached it. Save into modules/fb/images/
Comment #10
warmth commentedIt could be great to add something like Views Sext Throbber support. I'm getting #1884274: 2 Progress bar in the user login block!
Comment #11
Dave Cohen commentedI'm curious how the views throbber can be overridden by another module, but don't have time to look at the code right now. Would be great if someone can explain that. I'd like the modules/fb throbber to be customizable the same way.
Comment #12
warmth commentedAgree Dave!
Comment #13
sigveio commentedAny solution to the double progress bar issue?
Also; the fb_spinner.gif image does not appear to load. I'm using the latest stable 7.x release. When recording network activity/requests using Chrome's dev tools, the GET request for the image appears to be cancelled before it can complete. Probably by the POST to /user immediately following it. Hence it's never shown, and we end up with just the faded window during the session transition.
Comment #14
sigveio commentedThe login flow (seemingly slow session transition, lack of feedback to the user, etc) didn't quite work for my needs right now, and unfortunately I don't have time to look into fixing it / contributing improvements at this point in time either. So I ended up sticking with fboauth for what it does great (logging users in swiftly, and syncing user data), and rather experiment with having the fb-modules side-by-side for various app/canvas needs.
I did have a quick look at fixing the cancelled image get earlier though, and a quick and easy way of solving it for me was using a preload like this:
(I just threw it at the top of fb.js for a quick test/proof of concept.)
The ['/sites/all/modules/fb/images/fb_spinner.gif'] array can be set to hold multiple images, and the path should obviously not be a static one... but it might give you an idea of how you can ensure that the image is usable when needed. :)