LukeWoodward / SplitsBrowser

Orienteering results analysis
GNU General Public License v2.0
13 stars 9 forks source link

D3 JS library upgrade? #54

Closed BlaikM closed 6 years ago

BlaikM commented 7 years ago

We have been using the SplitsBrowser tool to publish event results on our web site for a little over a year. Recently I installed the latest version of SplitsBrowser, but now when I attempt to access it, I get the following error message:

D3 version 3.5.17 was found. SplitsBrowser requires version 4 or later.

I've tried placing the latest D3 JS files in the SplitsBrowser folder on our site, but that doesn't get rid of the error message. Does the D3 installation have to be done by the people that host the site?

Also, I noticed that the D3 library is referred to in several HTML files in SplitsBrowser's folder:

but the named file (d3.v4.min.js) doesn't exist in the material extracted from the D3 ZIP file I downloaded from d3js.org. There's a d3.min.js though. Does it need to be renamed?

Sorry if these are noob questions, I'm pretty new at this web site installation thing. Thanks for any help you can give.

Blaik Mathews www.floridaorienteering.org

LukeWoodward commented 7 years ago

Hi Blaik,

I've had a brief look at your site and found one URL that gives the error you report. It's http://www.floridaorienteering.org/results_or/splitsbrowser.php?20170520_FAM_Results. When I look at the HTML source of this page, it includes the following line:

<script type="text/javascript" charset="utf-8" src="http://d3js.org/d3.v3.min.js"></script>

This causes your browser to fetch a copy of D3 v3 from d3js.org. To use D3 v4, d3.v3.min.js needs to be replaced with d3.v4.min.js.

This line appears to be generated by your PHP script splitsbrowser.php. I don't know what's in this script, nor who wrote it, but it seems you'll need to edit this script to change the version of D3 being used.

You don't need to 'install' D3, or even copy it to your server, as your site will use a copy of D3 served from d3js.org instead.

While you are making this change, please also upgrade the version of jQuery you use, from 2.0.3 to 3.1.1. This should be a similar change: replace 2.0.3 with 3.1.1 in the URL to jQuery in your splitsbrowser.php file.

I hope this helps you.

Yours,

Luke

BlaikM commented 7 years ago

Wow! Thank you so much for looking into this for me, and for the quick solution. This took 30 seconds to fix once I knew where to look. I had searched everything under the splitsbrowser folder itself looking for those script declarations. If I had just gone one folder farther up! Thanks for pointing me at the right file. Thanks also for the heads-up about the jQuery version. I wouldn't have known to change that without your help. I've made both changes in splitsbrowser.php (which is an Ór thing, I think), and now all our Splitsbrowser links are working again.

BTW, as a club we've been offering GPS logging to your participants now for about a year (first with RouteGadget, now with Livelox). One feature I've often wished for in SplitsBrowser is the ability to filter so that only people who have uploaded GPS tracks show in the SB display, so that I can compare my track to other tracks on the relevant legs. Is there any way for me to set that up for our members? Is this a question you've had from other sources?

Thanks, Blaik Mathews www.floridaorienteering.org

On Wed, Jun 14, 2017 at 4:30 PM, Luke Woodward notifications@github.com wrote:

Hi Blaik,

I've had a brief look at your site and found one URL that gives the error you report. It's http://www.floridaorienteering.org/ results_or/splitsbrowser.php?20170520_FAM_Results. When I look at the HTML source of this page, it includes the following line:

This causes your browser to fetch a copy of D3 v3 from d3js.org. To use D3 v4, d3.v3.min.js needs to be replaced with d3.v4.min.js.

This line appears to be generated by your PHP script splitsbrowser.php. I don't know what's in this script, nor who wrote it, but it seems you'll need to edit this script to change the version of D3 being used.

You don't need to 'install' D3, or even copy it to your server, as your site will use a copy of D3 served from d3js.org instead.

While you are making this change, please also upgrade the version of jQuery you use, from 2.0.3 to 3.1.1. This should be a similar change: replace 2.0.3 with 3.1.1 in the URL to jQuery in your splitsbrowser.php file.

I hope this helps you.

Yours,

Luke

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LukeWoodward/SplitsBrowser/issues/54#issuecomment-308549072, or mute the thread https://github.com/notifications/unsubscribe-auth/ASdWYHkkViCsslslz4NnZKAHkdnITcqBks5sEELUgaJpZM4N6DeR .

LukeWoodward commented 7 years ago

Hi Blaik,

Glad to hear you've got SplitsBrowser working again on your site. I did write an FAQ about upgrading SplitsBrowser (see https://github.com/LukeWoodward/SplitsBrowser/wiki/FAQ-for-administrators#i-run-a-copy-of-splitsbrowser-on-my-website--id-like-to-upgrade-to-the-latest-version--how-do-i-do-this) - evidently it isn't obvious enough how to find it :(.

The D3 upgrade is a must: the latest SplitsBrowser won't work at all with D3 v3 and if SplitsBrowser didn't show you that message and stop you going any further you'd just get a load of confusing JavaScript errors. The latest SplitsBrowser mostly works with jQuery 2 instead of jQuery 3 - the only problem I'm aware of there is that graphs can extend off the bottom of the browser window with jQuery 2. Maybe I should add a warning message for an out-of-date version of jQuery as well....

I have to admit I hadn't heard of Livelox before. There are some links to events that appear to be public here, so I've been able to take a brief look at it. I'm aware that RouteGadget includes a version of SplitsBrowser inside it, but it seems Livelox doesn't, or at least I couldn't find it in there.

Ultimately, if SplitsBrowser is to filter out a list of users depending on whether they have uploaded a GPS route,, it needs some way of knowing whether users have uploaded routes. There isn't presently a way to get this information into SplitsBrowser: this isn't a request I've had before from other users. I'd also need to get the information out of Livelox somehow, and I don't know how I would do that.

Yours,

Luke

LukeWoodward commented 6 years ago

Closing this issue as nothing has happened for about 9 months.