Thursday 26 July 2012

Sharing via AddThis

A long time ago I decided to add some ‘social sharing’ into the blog; the how in this instance being more important than the why. I didn’t care for the layout of Blogger’s own set of share buttons so hacked an alternative, adding in the Google +1 button when it became available. Sometime (or was it immediately?) after the launch of their new social networking platform the +1 button was extended to “recommend on search, share on Google+”. Whilst this was kind of OK - platform first, then API - it twisted the metaphor; when, I wondered, would Google+ have a function dedicated to “Share”? It happened so quietly - back in April - I hardly noticed; the share buttons on YouTube had altered, specifically Google+ no longer referenced +1. This is much better; the lack of direct sharing must have further limited people’s use of Google's offering.

My first thought was to enter the HTML jungle representing this blog - in which there has been far too much messing around - and code up a new button. My second thought, which occurred shortly after escaping said jungle, was to look for something else. Something unobtrusive and easily configurable, I settled on AddThis. Using their “Install Blogger Widget” option places some HTML-generating JavaScript in a widget. Done this way it’s easy to remove - always reassuring - and still relatively easy to customise, of which there are a plethora of options.

It's early days, but so far I've only three gripes. Visually I'm not keen on the two-column pop-up menu showing the other bookmarking and sharing options, and I don’t really want to spend time overriding the styling. Having said that my two other concerns are addressed if I hide the menu header. The first of which is if I select one of the services the header changes to “Share successful!” irrespective of whether I have shared. The other is something that happens in Chrome (but not IE or Firefox) as a result of the following piece of AddThis code:
<a id="at15sptx" href="#" onclick="return _atw.clb()" onkeydown="if(!e){var e = window.event||event;}if(e.keyCode){_ate.maf.key=e.keyCode;}else{if(e.which){_ate.maf.key=e.which;}}if(_ate.maf.key==9){ addthis_close(); _ate.maf.sib.tabIndex=9001;_ate.maf.sib.focus();}else{alert(_ate.maf.key)} _ate.maf.key=null" tabindex="9000">X</a>
Keycode alert
It took me a while to track down as I hadn’t noticed that I’d explicitly closed the menu, and then I assumed I’d left some code of my own hanging around; it is in truth the kind of thing I’d do in testing. Then I noticed this behaviour everywhere. For example, using the Chrome browser I tried this out on the official London2012 page detailing the Olympic opening ceremony: Hover over the “Share” icon, explicitly close the pop-up menu by clicking on “X”, then press a key, (almost) any key; I typed “A”. Well, it made me smile.


Post a Comment