No edit for read-only text
This also removes annoying edit button that appears under the menu bar in Google Docs viewer.
Fix up the test case a little
Add Kazuya to the list of contributors
Use window-system to detect when we're on OS X

(featurep 'aquamacs) was false for me on the experimental Emacs Mac
port, causing edit-server to fail since make-frame-on-display seems to
only work when you're under X11.  I presume--but have not tested--that
it would also fail for the official Emacs NS port.

This new test on window-system should cover Aquamacs (tested), Emacs
NS port (untested), and the Emacs Mac port (tested).
Use jquery() magic to better determine if things are visible or hidden
offscreen. This fixes the random floating edit button on the GitHub
comments page ;-)
More usage of jQuery to indentify textareas instead of using the hokey inbuilt JavaScript DOM traversing code.
Add textareas.css and a specific CSS ID for the edit buttons.

Reported as issue 41 the site:

http://www.thegatesnotes.com/Personal/Steve-Jobs

Has CSS which overode the size of all the image elements in a given
div box. As a result the button was stretched to fill the <div> area.
By specifying a specific CSS ID the size vould be forced back again.

I assume it's possible the CSS ID might clash with another sites but
hopefully that will be fairly rare.
Merge pull request #39 from dsedivec/master

Make new frame under OS X Emacsen other than Aquamacs
testareas.js: scan for contenteditable (but don't do anything yet)
ta_test: add some editable divs for testing

* also clean-up the HTML
* un-uglify
textareas.js: Handle "contenteditable" div blocks

This add support for modern editable DIVs which are much beloved of
modern HTML5 systems like G+. This required a little re-jigging of the
textAreaTracker which now provides set/getContent functions to
abstract away the differences (thinking ahead?).

I've also taken the opportunity to re-format the whole thing with a
more sensible tab-stop and no tabs. I don't know what I was thinking.
Sorry.
Really make the indentation consistent across all the JavaScript

I'm not sure what I was smoking when I agreed to using tabs instead of
spaces like I usually do. Anyway I've M-x indent-region'ed all the
code so it should be consistent now.

I've dropped the vim instructions only because I couldn't find the
exact equivalent instructions for vim (admittedly I didn't look very
hard). Patches are welcome to add vim mode-line support back to the code.
textareas.js: Optimise the scanning for text areas.

Instead of scanning the whole document we keep an array of touched
elements and use the jQuery .find() method to search the subtree. I've
also added a timeout step to delay the processing for up to 2 seconds
if a lot of stuff is being added.
edit-server.el: rebind C-x C-s to edit-server-save

Following a suggested patch from tarsius on github I've changed the
behaviour of C-x C-s to save the current buffer into the kill-ring.
This stops the C-x C-s operation from potentially loosing data in the
client has disappeared on it.
Merge pull request #33 from purcell/master

Allow users to customize the default major mode, and to specify URL pattern -> major mode mappings
NEWS: update with changes to date.
Add some more code contributors.
edit-server.el: persist the buffer-local variables beyond mode changes

As discussed in https://github.com/stsquad/emacs_chrome/issues/37 a
change in major mode after setting up can loose critical information.
The normal major mode selection tries to mitigate against this by
making sure those mode changes happen early on.

If you change major-mode you'll still need to re-enable the
edit-server-edit-mode to re-enable the key map that allows you to save
your progress.

Written-by: frobtech
follow the header conventions, mostly

(tweaked original commit so Riccardo isn't stuck with maintainer emails)
fix style issues

* comments begin with at least two semicolons
  unless they are on the same line as code
* major section titles use three semicolons
* doc-strings do not end with whitespace
* don't quote nil and empty list