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.

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



23rd
Sep 11

Making money from WordPress


If you’ve come to this post thinking I’m sharing some amazing strategies on making money from WordPress, you’ll probably be disappointed.

WordPress, and a result themes and plugins produced for it, are licensed under the GPL. What this means is that although you can product commercials versions, people are free to use and copy your results. Additionally, WordPress doesn’t integrate well with, for example, commercial plugins as there is no place for them on their site and, hence, no automatic updates.

Paid support is another option for plugin and theme authors but even they don’t seem to very popular, with one company who provides such support recently shutting down.

I’ve had a few requests to make changes to or write new plugins, but they usually don’t pan out particularly well – with so many plugins already available there’s usually a reason why one doesn’t exist ;)

I get money from the advertising on this site but that barely covers the spiralling hosting costs. There are also various promotional methods further, but these are more to do with having a website rather than WordPress in particular.

So, getting rich is probably best left to the entrepreneur and those coming up with “the next big thing”.  But that’s fine with me – WordPress is GPL for a reason and it’s all about sharing. If I was in it for the money I’d have done something else instead!

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



12th
Sep 11

Artiss Content Reveal 2 released


Artiss Content Reveal (formally Simple Content Reveal) has had a major revamp to version 2.

Apart from being extensively re-coded with various administration improvements (there’s an editor button for it, extra meta data in the Plugins menu, etc), there’s a lot of big improvements…

  1. Cookies now store the state of each hidden/revealed section for each user – so if you collapse a section when you return to the page later it will still be like that! In addition, there are lots of options to override the default cookie settings.
  2. Force all Content Reveal sections on the screen to do a single thing via the URL – e.g. make all content reveal in preparation for printing
  3. The title which you click on to hide/show sections can be separated from the actual content, allowing you to place these elsewhere
  4. Separate text can be specified for the title, allowing different things to appear depending on the state of the content

And much, much more!

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