Skip to content

cblage/jQuery-in-place-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FORK
-----
This project is a fork of http://code.google.com/p/jquery-in-place-editor

INTRODUCTION
------------

editInPlace is a jQuery plugin that turns any element or group of elements
into an Ajax in-place editor using only one line of code. It’s written using the jQuery
library, which is freely available at http://jquery.com.


SUPPORT AND BUG REPORTS
-----------------------

Bug reports, as well as feature requests, may be submitted to https://github.com/cblage/jQuery-in-place-editor


QUICK START
-----------

Include jquery and the editin place scripts in your html page (preferably at the bottom so the page loads faster).

	<script type="text/javascript" src="path/to/js/jquery.js"></script>
	<script type="text/javascript" src="path/to/js/jquery.editinplace.js"></script>
	<script type="text/javascript">
	    $(".inplace-editor").editInPlace({
	        url: "path/to/server/script.php"
	    });
	</script>

Create a div with the class 'inplace-editor'

	<div class="inplace-editor"></div>

Create a server side handler script (php, python, etc...), this example will use php

The following parameters will be sent via a POST requeset to the server script

* update_value
* element_id
* original_html

e.g. in script.php:

	$_POST['update_value']
	$_POST['element_id']
	$_POST['original_html']

Alternatively you can set the option callback, so you can controll the whole saving process yourself (update other parts of the webpage and possibly not even save to the server at all). The editor accepts a wealth of other options to customize how it behaves. They are documented inline [in the sourcecode](lib/jquery.editInPlace.js) and are exposed as $.fn.editInPlace.defaults where you can change them globally for your app. For more examples of how to use the editor, have [a look at the demo html](demo/index.html) and [javascript](demo/js/demo.js).


DOCUMENTATION
-------------

The Editor works in two stages. After initialization it is closed, wich means that it listens to a click on the element it was bound to. When clicked it will open, which means it replaces the content of the bound field with the configured GUI (input, textarea or select), preinitialized to show the value that was shown in that DOM element before. If the user then cancels or doesn't change anything, everything is returned to what it was before. If the user makes a change and commits, that new value is either submitted to the configured URL or to the configured callback and then the editor GUI is again replaced by just the edited value and the editor again listenes to a click.

To support automated acceptance tests better the editor will set the class .editInPlace-active as soon as it opens, and will only remove it when it has finished any interaction with the server or the callback interface has told it so.

Thats it! Have fun using it!

Releases

No releases published

Packages

No packages published

Languages