Posts

Showing posts from November, 2017

FAQ it.

Image
Added a new FAQ module. This literally steals the content from the FFG main site. Here's the code: As long as the FAQ section of the X-Wing support page stays the same, this should work to return the very latest version of the FAQ.

A quick facelift

Image
I've made a point so far of making sure you know I don't do design. That said, I was no longer happy with the "that'll do" appearance, so I played around with some new ideas. In the end, I got bored, and decided to just rip off the look of Facebook in general. Emulating a couple of calculated style sheets has taken use from this: ...to this: Is that better? Maybe? I think so. Not really my niche. It'll do ;) Also, I limited the event feed to a preset number. It loads rather a lot faster now.

That syncing feeling.

Image
Before proceeding, it seems prudent to load the component modules asynchronously. Modules are rendered as partial views within the main wrapper. Up to now, the actions to populate them have been been called prior to the page load event. In other words, all content is complied before the page is rendered. To the user, that looks like a fully populated page that loads after a lengthy period of inactivity. Resolving this is usually trivial; build the page with content placeholders, and sprinkle a little AJAX on the load event. The result of this will be a static page with progressive data loaded asynchronously.  The Meta-wing module worked fine. Page loads immediately with a "Loading Meta-Wing" notice, which is promptly replaced with the Top Pilot and Top Archetype modules. The Events module, however, threw an immediate spanner. Schoolboy Error: Any calls to the Facebook API require an access token. This is fine when we're populating on page build - The Action is tagged...

Facebook API is good... but weird.

Image
Note: This post is offered retrospectively. The work noted here was completed a week ago, so some actions may have been forgotten. I wanted to include a calendar for tournaments on Command Deck. At the moment, there's no data storage on the page; it's all polled live. This means I have to rely on an external source of data for tournament scheduling. As there's no events page or anything for the application, I'll have to borrow the feed from other event lists. The first problem, of course, is where do I poll for data? Facebook group events are the obvious route, but which group? As the Facebook application isn't requesting any specific permissions beyond a user token, It'll have to be a public group. I'm already a member of " X-Wing UK Events " and can see there's about 1000 members, and a reasonable supply of events listed. As this whole exercise is more about coding practice than usability, it seems like a good candidate. So, Facebook,...

With apologies to Meta Wing

Image
Note: This post is offered retrospectively. The work noted here was completed a week ago, so some actions may have been forgotten. Sorry, Meta-Wing ! I liked your content so much that I started out by pulling it directly! Over at Meta-Wing, we see that simply adding .json to the end of the address gives us the raw data they've compiled for us: This is handy, because not only does it give us all the pilot details we wanted to borrow, but it also gives us the URL to their picture for it. For a few days, I was simply stealing this data and thus their bandwidth. I was only testing. Sorry. For what it's worth, it was only me loading it at the time! Here's how I'm doing the data parse now: 1. Grab the complete JSON from http://meta-wing.com/pilots.json and parse it. Discard everything that doesn't have a "position" value of 1. 2. Load the local JSON for the Pilot (using the Id attribute). This gives us a complete data object fo...