Permalink
Browse files

updating the docs event examples

  • Loading branch information...
1 parent e4b0704 commit c6df81c8ad85eda86d384bd2e1ea5631485041fc @jonrohan jonrohan committed Dec 28, 2012
Showing with 55 additions and 4 deletions.
  1. +1 −0 README.md
  2. +54 −4 docs/instructions.md
View
@@ -25,6 +25,7 @@ clip.on( 'load', function(client) {
} );
clip.on( 'complete', function(client, args) {
+ this.style.display = 'none'; // "this" is the element that was clicked
alert("Copied text to clipboard: " + args.text );
} );
View
@@ -143,6 +143,8 @@ clip.on( 'load', function ( client, args ) {
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
</dl>
@@ -160,6 +162,8 @@ clip.on( 'mouseover', function ( client, args ) {
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
<dt>altKey</dt>
@@ -178,12 +182,14 @@ The `mouseout` event is fired when the user's mouse pointer leaves the Flash mov
```
clip.on( 'mouseout', function ( client, args ) {
alert( "mouse has left movie" );
-} );
+} );
```
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
<dt>altKey</dt>
@@ -201,12 +207,14 @@ The `mousedown` event is fired when the user clicks on the Flash movie. Please
```
clip.on( 'mousedown', function ( client, args ) {
alert( "mouse button is down" );
-} );
+} );
```
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
<dt>altKey</dt>
@@ -224,12 +232,14 @@ The `mouseup` event is fired when the user releases the mouse button (having fir
```
clip.on( 'mouseup', function ( client, args ) {
alert( "mouse button is up" );
-} );
+} );
```
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
<dt>altKey</dt>
@@ -247,12 +257,14 @@ The `complete` event is fired when the text is successfully copied to the clipbo
```
clip.on( 'complete', function ( client, args ) {
alert("Copied text to clipboard: " + args.text );
-} );
+} );
```
The handler is passed these options to the `args`
<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
<dt>flashVersion</dt>
<dd>This property contains the users' flash version</dd>
<dt>altKey</dt>
@@ -265,6 +277,44 @@ The handler is passed these options to the `args`
<dd>The copied text.</dd>
</dl>
+#### noflash
+
+The `noflash` event is fired when the user doesn't have flash installed on their system
+
+```
+clip.on( 'noflash', function ( client, args ) {
+ alert("You don't support flash");
+} );
+```
+
+The handler is passed these options to the `args`
+
+<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
+<dt>flashVersion</dt>
+<dd>This property contains the users' flash version</dd>
+</dl>
+
+#### wrongflash
+
+The `wrongflash` event is fired when the user has the wrong version of flash. ZeroClipboard supports version 10 and up.
+
+```
+clip.on( 'wrongflash', function ( client, args ) {
+ alert("Your flash is too old " + args.flashVersion);
+} );
+```
+
+The handler is passed these options to the `args`
+
+<dl>
+<dt>this</dt>
+<dd>The current element that is being provoked. if null this will be the window</dd>
+<dt>flashVersion</dt>
+<dd>This property contains the users' flash version</dd>
+</dl>
+
## Examples
The following are complete, working examples of using the clipboard client library in HTML pages.

0 comments on commit c6df81c

Please sign in to comment.