Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
*/ |