Considering how regularly new versions of Firefox now come along, that's quite some bug fix list in version 10! http://t.co/K3I2vLpW 1 week ago

25th
Oct 11

Copying to clipboard in WordPress



I was recently asked, as a commercial request, to create a WordPress plugin that would allow users to click a button and copy text the clipboard. It seemed an easy enough thing to do – 2 weeks later, though, and I’ve thrown in the towel.

Using JavaScript to capture contents is the easy bit – adding it to the clipboard is a lot more difficult. IE has a JavaScript command built in, other browsers vary. Unfortunately, other browsers (e.g. Firefox) also restrict this ability for security reasons. This is because the ability to write to the clipboard also comes with the ability to read from it as well – quite why this functionality can’t be detached and restrict just the reading I don’t know.

So, using JavaScript is problematic.

Thankfully I’m not the first to come across this problem and a third party script named ZeroClipboard is available. This uses Flash to update the clipboard, which doesn’t have the same security limitations. Of course if you’re viewing from a device that doesn’t support Flash (cough, splutter, iPad, iPhone, cough) then you’re still out of luck. None-the-less this seemed a perfect solution.

Unfortunately, my limited JavaScript skills failed me – I found the program to be over-complex for what I needed and failed to be able to get it to work.

At this point I found an alternative – ZClip uses ZeroClipboard but is controlled via JQuery (which is built into WordPress) and provide a much easier and friendly method of access.

I was now in a position where I had a working plugin. Until I used Admin Bar. That seemed to affect the positioning of the Flash overlay so you had to click slightly above the “Copy to clipboard” button to get it to work.

The customer, though, didn’t have an issue with this and I could only hope that they didn’t have anything else within their theme or plugins that could affect it in this way (I did try contacting the developer of Zclip but got no response).

What really ended it all though was the limited way of capturing text in zclip, which I hadn’t appreciated earlier on. ZClip can capture in 2 ways – from static fields (e.g. the text between a SPAN) or dynamic (e.g. from a field). The first doesn’t capture any formatting, even paragraph breaks – returning everything as one long line of text. The second did, but by capturing the HTML.

The customer wanted the customer to be able to copy to the clipboard long paragraphs of text – neither offered a neat solution to this.

Then I gave up. One day I may return to it – certainly ZeroClipboard will probably allow me to do what I need it to, but I’ll have to get my head around how to first.

Comments Add a comment

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



24th
Oct 11

Why the next iPhone shouldn’t be the iPhone 5


The recent  announcement of the iPhone 4S was met, pretty universally, by disappointment. People were expecting the iPhone 5.

However, the release of the 4s is quite consistent with Apple iPhone releases.

The initial iPhone (with a monikor) was released in June 2007 and was followed up by the 3G – simply named because it had 3G data capability – in July 2008.

In June 2009 they didn’t release a new version, but improved the 3G and released it as the 3GS.

In 2010 we get the iPhone 4 and this year the iPhone 4S.

This pattern of releasing a new phone one year and then improving it the next is a good idea – particularly when iPhone users are usually on 2 year contracts. If the year after they buy a newly released iPhone they launch another brand-new must-have version then users would probably get annoyed quite quickly. An interim improved phone is the logical conclusion.

So, we have a pattern, which means that the next big iPhone release will be next year. But what about the number?

The 3G was not the third phone. However, the iPhone 4 WAS the 4th iteration (after the original, 3G and 3GS). So that means that next year’s phone will be the iPhone 6. And for a company that works so hard on these intricate details would they really get the numbering wrong? Logically, no. But something tells me the next phone will be the iPhone 5.

Comments Add a comment

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



23rd
Oct 11

I hate to say it, but I’m disappointed with the Galaxy Nexus


Since the Galaxy S2 launched earlier this year no other phone has come near to its capabilities – and that includes, I think, the iPhone 4S. As far as I’m concerned the S2 still reigns supreme.

So, I’ve been excited by the launch of the Galaxy Nexus – the newest release from Samsung, sporting Android 4 as its main highlight.

Other than Android 4, it’s other big thing is the screen – 4.3″ inches at 720×1280. Although the screen physically is bigger the whole device is apparently on a par with the S2 as the screen is taller rather than wider and this extra width takes the place of the buttons at the bottom.

However, ignoring the OS and screen resolution for a moment, when you start comparing the rest of the phone specifications it suddenly starts to look a little more disappointing…

  • The Nexus has a Super Amoled screen. The S2 has a Super Amoled Plus screen. There is a difference, and it’s important.
  • They both sport a 1.2Ghz Dual Core processor.
  • The S2 weighs 116 g, whereas the Nexus is 135 g.
  • There is no removable storage option on the Nexus, compared to the Micro SD on the S2.
  • The Nexus lacks USB On-the-Go and Wi-Fi Direct.
  • The rear camera on the Nexus is 5MP and the front 1.3MP. On the S2 you get an 8MP rear and 2MP front camera. However, the Nexus does give you a twin LED flash rather than the single on the S2.
  • The headphone socket is on the bottom. Really? Because when I have a set of headphones plugged in and my phone in my pocket, I really want to have it upside down. No news yet as to where they’ve sited the USB socket.
  • It’s a personal preference but the Nexus has more rounded corners, looking like one of its cheaper cousins, and I don’t like it.

One thing I’m not sure about, comparison wise, are the GPUs in the 2 phones which are very different. However, forum discussions would suggest that the S2 might edge it.

One thing that I can find on the Nexus which is better than the S2 is the battery, which is 1750 mAh, compared to 1650 mAh. Extras, the Nexus has a built in barometer. Really.

So, a higher resolution screen, a bigger capacity battery and ability to know if it’s about to rain in the next few hours. But you get a poorer set of cameras, more weight and a load of features missing. Or have I missed something?

Comments Add a comment

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly