Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
John Antoni Griffiths committed Sep 21, 2010
1 parent 679081d commit 6bad83a
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions readme.txt
@@ -1,34 +1,21 @@
/*
* jquery.tamper.js
* v 1.0
* v 1.1
*
* Initial Author
* John Griffiths
*
* Description
* Simpy watches an element for changes, if any encountered flips the flag.
* If the exit button is clicked and the flag is true a dialog appears warning user will lose changes.
* Simply watches an element for changes, if any encountered flips the tamper flag to true.
* If the exit button is clicked and the tamper flag is set to true a dialog will appear warning
* the user they will lose their changes if they click OK.
*
* Params:
* watchName : element (textarea) to watch for changes
* exitName : element (button) which classes as an exit when clicked
* messageText : text to show in the alert dialog
* watchName : (required) element (textarea) to watch for changes
* exitName : (required) element (button) which classes as an exit when clicked
* messageText : (optional) text to show in the alert dialog
*
* Uses
* on input element of edit page, if user edits value, flag set and leaving via
* back [exit] link show alert message
* PLEASE NOTE: if an onclick event is present on the exit element it will clone it, remove it
* and append it so when the user click's ok it fires.
*
* Usage
* $.tamper('.backBtn', '.comment', 'Im sorry, Dave. Im afraid I cant do that.');
*
* Simpler version
* // assign message on click, if flag set to true
* $.tamperAlert('.backBtn', 'Did you really want to do that?');
*
* // set flag manually to true
* $.tamperFlag('.backBtn');
*/

/*
* iframe version located here http://gist.github.com/537728
*/

0 comments on commit 6bad83a

Please sign in to comment.