• 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

    (@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

    (@jobzesage)

    I had it in maintenance mode, but I’ll leave it open until we figure it out :
    https://dev.jesuschurch.no/

    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

    (@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

    (@jobzesage)

    Plugin Author Poco

    (@poco)

    Curious…

    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) {
    		eventDiv.removeChild(eventDiv.childNodes[0]);
    	}
    Plugin Author Poco

    (@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="https://dev.jesuschurch.no/wp-content/plugins/google-calendar-widget/loading.gif" alt="Loading..."/></div>
    </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="https://dev.jesuschurch.no/wp-content/plugins/google-calendar-widget/loading.gif" 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

    (@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) {
    		eventDiv.removeChild(eventDiv.childNodes[0]);
    	}

    Thread Starter jobzesage

    (@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 :

    <?php
    the_widget("WP_Widget_KO_Calendar",
        array(
            'title' => 'Kalender',
            'url' => 'https://www.google.com/calendar/feeds/gss6c0fqkui2f987dq02ql5960%40group.calendar.google.com/public/full',
        ),
        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: https://twitpic.com/5abudr

    Plugin Author Poco

    (@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 https://shahryar.net/wp-content/plugins/google-calendar-widget/loading.gif [HTTP/1.1 304 Not Modified 123ms]
    [09:43:52.510] GET https://shahryar.net/ [HTTP/1.1 200 OK 885ms]
    [09:43:53.285] GET https://shahryar.net/wp-content/themes/shahryar/js/cufon-yui.js [HTTP/1.1 304 Not Modified 249ms]
    [09:43:53.301] GET https://shahryar.net/wp-content/themes/shahryar/js/nevis.font.js [HTTP/1.1 304 Not Modified 199ms]
    [09:43:53.312] GET https://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js [HTTP/1.1 304 Not Modified 42ms]
    [09:43:53.322] GET https://shahryar.net/wp-includes/js/l10n.js?ver=20101110 [HTTP/1.1 304 Not Modified 520ms]
    [09:43:53.332] GET https://shahryar.net/wp-content/themes/shahryar/style.css [HTTP/1.1 304 Not Modified 519ms]
    [09:43:53.343] GET https://www.google.com/jsapi?ver=1 [HTTP/1.1 200 OK 50ms]
    [09:43:53.354] GET https://shahryar.net/wp-content/plugins/google-calendar-widget/date.js?ver=alpha-1 [HTTP/1.1 304 Not Modified 587ms]
    [09:43:53.367] GET https://shahryar.net/wp-content/plugins/google-calendar-widget/wiky.js?ver=1.0 [HTTP/1.1 304 Not Modified 373ms]
    [09:43:53.381] GET https://shahryar.net/wp-content/plugins/google-calendar-widget/ko-calendar.js?ver=3.1.3 [HTTP/1.1 304 Not Modified 300ms]
    [09:43:53.394] GET https://shahryar.net/wp-includes/js/jquery/jquery.js?ver=1.4.4 [HTTP/1.1 304 Not Modified 439ms]
    [09:43:53.408] GET https://shahryar.net/wp-includes/js/hoverIntent.js?ver=3.1.3 [HTTP/1.1 304 Not Modified 538ms]
    [09:43:53.421] GET https://shahryar.net/wp-content/plugins/commentluv/js/commentluv.js?ver=3.1.3 [HTTP/1.1 304 Not Modified 612ms]
    [09:43:53.467] GET https://shahryar.net/wp-content/plugins/commentluv/style/cl_style.css [HTTP/1.1 304 Not Modified 941ms]
    [09:43:53.481] GET https://shahryar.net/wp-content/plugins/google-calendar-widget/ko-calendar.css [HTTP/1.1 304 Not Modified 455ms]
    [09:43:53.892] GET https://www.google.com/uds/?file=gdata&v=2.x [HTTP/1.1 200 OK 57ms]
    [09:43:53.950] GET https://www.google.com/uds/api/gdata/2.4/9c597f6780f49935322b8dc6d9f79364/core,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 https://shahryar.net/wp-content/themes/shahryar/images/logo.png [HTTP/1.1 304 Not Modified 124ms]
    [09:43:54.955] GET https://shahryar.net/wp-content/uploads/2010/04/Shahryars-YouTube-page-edited.jpg [HTTP/1.1 304 Not Modified 130ms]
    [09:43:55.002] GET https://shahryar.net/wp-content/themes/shahryar/images/bg.jpg [HTTP/1.1 304 Not Modified 128ms]
    [09:43:55.021] GET https://shahryar.net/wp-content/themes/shahryar/images/back.jpg [HTTP/1.1 304 Not Modified 132ms]
    [09:43:55.040] GET https://shahryar.net/wp-content/themes/shahryar/images/menu.png [HTTP/1.1 304 Not Modified 121ms]
    [09:43:55.061] GET https://shahryar.net/wp-content/themes/shahryar/images/sidetitle.png [HTTP/1.1 304 Not Modified 230ms]
    [09:43:55.142] GET https://shahryar.net/wp-content/uploads/2010/05/spinner.gif [HTTP/1.1 304 Not Modified 114ms]
    [09:43:55.161] GET https://www.google-analytics.com/ga.js [HTTP/1.1 304 Not Modified 55ms]
    [09:43:55.180] GET https://www.youtube.com/p/55E5AFE457CE9900?hl=en_US&fs=1 [HTTP/1.1 200 OK 86ms]
    [09:43:55.281] GET https://www.google-analytics.com/__utm.gif?utmwv=4.9.4&utms=8&utmn=355177008&utmhn=shahryar.net&utmcs=UTF-8&utmsr=1680x1050&utmsc=24-bit&utmul=en-gb&utmje=1&utmfl=10.0%20r45&utmdt=Shahryar.net%C2%A0%7C%C2%A0&utmhid=701145754&utmr=-&utmp=%2F&utmac=UA-20244767-1&utmcc=__utma%3D102534979.1232741021.1307982457.1307982457.1307982457.1%3B%2B__utmz%3D102534979.1307982457.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=H~ [HTTP/1.1 200 OK 55ms]
    [09:43:55.404] GET https://www.twitter.com/statuses/user_timeline/shahryar.json?callback=twitterCallback1&count=20&cb=0.8936627861207693 [HTTP/1.1 200 OK 309ms]
    [09:43:55.477] GET https://gdata.youtube.com/feeds/api/playlists/55E5AFE457CE9900?&v=2&max-results=50 [HTTP/1.1 304 Not Modified 128ms]
    [09:43:55.760] GET https://www.google.com/calendar/feeds/dajq7voop0gh5r8u2jmusptjig%40group.calendar.google.com/public/full?orderby=starttime&sortorder=ascending&futureevents=true&singleevents=true&max-results=5&alt=json-in-script&reqid=1&user-agent=google-calendar-widget%20GData-JavaScript%2F2.1%201307983435706-993&v=2.1 [HTTP/1.1 200 OK 347ms]
    Plugin Author Poco

    (@poco)

    samdobrow,

    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='https://marksblythe.com/wp-includes/js/jquery/jquery.js?ver=1.7.1'></script>
    <script type='text/javascript' src='https://maps.google.com/maps/api/js?sensor=true&ver=3.3'></script>
    <script type='text/javascript' src='https://marksblythe.com/wp-content/plugins/google-calendar-widget/date.js?ver=alpha-1'></script>
    <script type='text/javascript' src='https://marksblythe.com/wp-content/plugins/google-calendar-widget/wiky.js?ver=1.0'></script>
    <script type='text/javascript' src='https://marksblythe.com/wp-content/plugins/google-calendar-widget/ko-calendar.js?ver=3.3'></script>

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

    <script type='text/javascript' src='https://www.google.com/jsapi'></script>

    It is added in the php like this…

    wp_enqueue_script('google', 'https://www.google.com/jsapi', false, NULL);

    My guess is that the other widget has a similar wp_enqueue_script call that registers “maps.google.com” 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

    (@poco)

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

    $googlepath = "https://maps.google.com/maps/api/js?sensor=true";
        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.

    Thanks.

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