Support » Plugin: Google Calendar Widget » Loading wheel doesn't disappear

  • jobzesage


    Hi there, I LOVE your plugin 🙂 finally a good looking way to display my Google calendar, good job !

    A question though, when I use it as a widget, it works perfectly. But then I tried to use it on the frontpage of my website with the PHP code, and it works, but even after the events are displayed, the loading wheel keeps turning.

    Can it be a javascript conflict with the theme ?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Poco


    Can you provide a link?

    Did you check the errors on your page when this happens? If you can’t provide a link, then the errors would be helpful.

    Thread Starter jobzesage


    I had it in maintenance mode, but I’ll leave it open until we figure it out :

    I’m actually not sure what you mean by checking the errors. With Firebug for instance ? I’m not so familiar with javascript sadly…

    Thanks for your help !

    Thread Starter jobzesage


    You’ll find the calendar in the lower left corner of the page. This is with the PHP code. In the menu “Bli med”, you’ll find the same calendar but inserted with the help of a widget.

    Thread Starter jobzesage


    Plugin Author Poco



    It seems that the code is not working correctly, but there are no errors that I can see. It could have something to do with having multiple calendars on the same page, but it shouldn’t be a problem since they are both named differently.

    The code that should have removed the loading gif is below “eventDiv.removeChild”. For some reason it isn’t doing the right thing. I suspect that I can change that to do it differently (better?) that might help.

    Still looking at it.

    function processFinalFeed(feedRoot) {
    	// var entries = feedRoot.feed.getEntries();
    	var entries = feedRoot;
    	var eventDiv = document.getElementById(outputId);
    	if (eventDiv.childNodes.length > 0) {
    Plugin Author Poco


    Ah, I see the problem now – should have waited to reply.

    The problem is the newlines in the source around the “widget-ko_calendar–1-widget_events” tag. The code I posted above is designed to remove the first, and only, child of that tag, but there are 3 children. The newline right after the <div> tag and the newline after the next <div> tag. So the first child is the newline, not the “loading icon”.

    <div class="ko-calendar-widget-events" id="widget-ko_calendar--1-widget_events">
    <div class="ko-calendar-widget-loading"><img class="ko-calendar-widget-image" src="" alt="Loading..."/></div>

    I suspect that replacing the code above with the code below will fix the problem. How are you generating that code? I guess I never noticed this because it is all generated by the plugin – but you say that you are doing it manually, so that might be the difference.

    <div class="ko-calendar-widget-events" id="widget-ko_calendar--1-widget_events"><div class="ko-calendar-widget-loading"><img class="ko-calendar-widget-image" src="" alt="Loading..."/></div></div>

    As for a proper solution, I should fix that script so that it can handle white space around the <div> tags. Can you try the fix above and let me know if it works, I will hopefully get around to fixing the script up as well.

    Plugin Author Poco


    Alright, I have a proper fix for the plugin that works with your current page.

    Just change the “if” to a “while” in ko-calendar.js. I will submit this change to the trunk soon and it will eventually become a new version.

    The code below is the same as the first code I posted above but the if is now a while.

    function processFinalFeed(feedRoot) {
    	// var entries = feedRoot.feed.getEntries();
    	var entries = feedRoot;
    	var eventDiv = document.getElementById(outputId);
    	while (eventDiv.childNodes.length > 0) {

    Thread Starter jobzesage


    Wow, that was a quick and efficient response !

    You last fix worked at once, for your record, I generate the code using the piece of PHP from your FAQ :

            'title' => 'Kalender',
            'url' => '',
        array('before_widget' => '<div class="calendarwidget">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>'

    Thanks for such a good work !



    I’m dealing with the same issue with the Google Calendar Widget. it’s working on Safari but not on Firefox. here is a screenshot showing the problem:

    Plugin Author Poco


    I don’t have a Mac to test your page and it works with the Windows version of Firefox.

    Can you provide the output from Web Console? It is accessible through the “Web Developer” menu in the Windows version of Firefox – I don’t know how you access it on a Mac.

    Open the Web Console, Clear it, and refresh the page.

    This is what I get with Firefox 4 in Windows.

    [09:43:54.974] GET [HTTP/1.1 304 Not Modified 123ms]
    [09:43:52.510] GET [HTTP/1.1 200 OK 885ms]
    [09:43:53.285] GET [HTTP/1.1 304 Not Modified 249ms]
    [09:43:53.301] GET [HTTP/1.1 304 Not Modified 199ms]
    [09:43:53.312] GET [HTTP/1.1 304 Not Modified 42ms]
    [09:43:53.322] GET [HTTP/1.1 304 Not Modified 520ms]
    [09:43:53.332] GET [HTTP/1.1 304 Not Modified 519ms]
    [09:43:53.343] GET [HTTP/1.1 200 OK 50ms]
    [09:43:53.354] GET [HTTP/1.1 304 Not Modified 587ms]
    [09:43:53.367] GET [HTTP/1.1 304 Not Modified 373ms]
    [09:43:53.381] GET [HTTP/1.1 304 Not Modified 300ms]
    [09:43:53.394] GET [HTTP/1.1 304 Not Modified 439ms]
    [09:43:53.408] GET [HTTP/1.1 304 Not Modified 538ms]
    [09:43:53.421] GET [HTTP/1.1 304 Not Modified 612ms]
    [09:43:53.467] GET [HTTP/1.1 304 Not Modified 941ms]
    [09:43:53.481] GET [HTTP/1.1 304 Not Modified 455ms]
    [09:43:53.892] GET [HTTP/1.1 200 OK 57ms]
    [09:43:53.950] GET,batch,mediarss,geo,opensearch,atom,threading,app,gdata,gbase,finance,blogger,contacts,analytics,acl,maps,calendar,sidewiki,default.I.js [HTTP/1.1 200 OK 685ms]
    [09:43:54.935] GET [HTTP/1.1 304 Not Modified 124ms]
    [09:43:54.955] GET [HTTP/1.1 304 Not Modified 130ms]
    [09:43:55.002] GET [HTTP/1.1 304 Not Modified 128ms]
    [09:43:55.021] GET [HTTP/1.1 304 Not Modified 132ms]
    [09:43:55.040] GET [HTTP/1.1 304 Not Modified 121ms]
    [09:43:55.061] GET [HTTP/1.1 304 Not Modified 230ms]
    [09:43:55.142] GET [HTTP/1.1 304 Not Modified 114ms]
    [09:43:55.161] GET [HTTP/1.1 304 Not Modified 55ms]
    [09:43:55.180] GET [HTTP/1.1 200 OK 86ms]
    [09:43:55.281] GET [HTTP/1.1 200 OK 55ms]
    [09:43:55.404] GET [HTTP/1.1 200 OK 309ms]
    [09:43:55.477] GET [HTTP/1.1 304 Not Modified 128ms]
    [09:43:55.760] GET [HTTP/1.1 200 OK 347ms]
    Plugin Author Poco



    I suspect there is a conflict of some kind with another plugin that is including the Google Maps API, but not the rest of the Google API.

    <script type='text/javascript' src=''></script>
    <script type='text/javascript' src=''></script>
    <script type='text/javascript' src=''></script>
    <script type='text/javascript' src=''></script>
    <script type='text/javascript' src=''></script>

    The calendar plugin requires the full Google API included, like the following…

    <script type='text/javascript' src=''></script>

    It is added in the php like this…

    wp_enqueue_script('google', '', false, NULL);

    My guess is that the other widget has a similar wp_enqueue_script call that registers “” as “google” instead of something like “googlemaps”.

    Not sure of the right fix – it depends on your other plugins, but you might want to check for wp_enqueue_script calls.

    Well, you seem to have it. I disabled the Simple Real Estate Pack
    Package of real estate tools and widgets designed specifically for real estate industry blogs and sites. Includes mortgage and home affordability calculators, closing cost estimator, lilve mortgage rates, Trulia statistical graphs, local schools and other features.

    When this plugin is disabled, the Calendar plugin works fine. The real question now is who’s plugin is improperly coded and how to best fix it to be compliant with WP development standards… beyond my skill level.

    Plugin Author Poco


    I took a quick look through the SRP and found the offending line in srp-functions.php.

    $googlepath = "";
        wp_enqueue_script( 'google', $googlepath, FALSE, false, false );

    You can try replacing the string ‘google’ with ‘googlemaps’ or something unique so that there is no conflict and both plugins will include both files. I’m not sure if they are both needed, but give it a try.

    You might want to contact the author of that plugin and see if he has a better option. I don’t know if there is a naming convention for google APIs with wordpress plugins.


Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Loading wheel doesn't disappear’ is closed to new replies.