| Behaviour Javascript framework Contrib
This contrib packages the third-party Behaviour Javascript event library, available from http://bennolan.com/behaviour/. |
|
< < | Behaviour is suited to create javascript based interaction that degrades well when javascript is not available.
Javascript file: behaviour.js (8.1K). The compressed javascript file (2.9K) has been processed by ShrinkSafe. |
> > | Behaviour uses CSS selectors to subscribe to javascript event handlers. This allows to create clean code, separated from HTML (and well suited to create javascript based interaction that degrades nicely when javascript is not available). |
| |
|
|
|
< < | |
> > | |
|
|
| |
|
< < | Example |
> > |
Example |
| If we have a 'normal' link to TWiki Web hometopic: TWiki Web Home, we can use javascript to make it open a popup window. When javascript is not available the link behaviour defaults to opening the page in the current window.
|
|
< < | TWiki Web Home |
> > |
MOUSE OVER ME
|
|
|
|
< < | The class name link%TWIKIWEB%%HOMETOPIC% will get expanded to linkTWikiWebHome
|
| Creates: |
|
< < | TWiki Web Home |
> > |
MOUSE OVER ME
|
|
|
|
> > |
Leaking danger
Behaviour code leaks memory on Windows Explorer prior to version 7. To prevent leaking, set the element variable to null :
var myrules = {
'table.test td' : function(element) {
element.onmouseover = function() {
this.style.backgroundColor = highlightColor;
return false;
}
element = null; // by setting this IE will not leak
}
};
Behaviour.register(myrules);
|
| Development |
|
< < | |
> > | |
|
License
Behaviour is freely distributable under the terms of an BSD license. |
|
< < | For details, see the Behaviour website. |
> > | For details see the Behaviour website. |
|
Links
|
|
< < | Contrib Info |
> > | Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
Like many other TWiki extensions, this module is shipped with a fully
automatic installer script written using the BuildContrib.
- If you have TWiki 4.2 or later, you can install from the
configure interface (Go to Plugins->Find More Extensions)
- If you have any problems, then you can still install manually from the command-line:
- Download one of the
.zip or .tgz archives
- Unpack the archive in the root directory of your TWiki installation.
- Run the installer script (
perl <module>_installer )
- Run
configure and enable the module, if it is a plugin.
- Repeat for any missing dependencies.
- If you are still having problems, then instead of running the installer script:
- Make sure that the file permissions allow the webserver user to access all files.
- Check in any installed files that have existing
,v files in your existing install (take care not to lock the files when you check in)
- Manually edit LocalSite.cfg to set any configuration variables.
|
| |
|
> > | Contrib Settings
- Set SHORTDESCRIPTION =
Behaviour Javascript event library to create javascript based interactions that degrade well when javascript is not available
You can also set the global TWiki variable BEHAVIOURCONTRIB_DEBUG to 1 to make the contrib use uncompressed javascript sources, in the event of problems.
Contrib Info |
|
|
|
< < |
Copyright: |
version 1.1 - Copyright (c) Ben Nolan and Simon Willison |
|
> > |
Copyright: |
Code: behaviour.js version 1.1 - Copyright (c) Ben Nolan and Simon Willison. TWiki distribution and updates/additions: TWiki:Main.ArthurClemens. |
|
|
|
|
> > |
Version: |
15675 (22 Jan 2008) |
|
|
|
|
< < |
4 June 2006 |
1.000 First Version. Included Behaviour version: 1.1 |
|
> > |
|
|
Related Topics: TWikiPreferences |
|
< < |
META FILEATTACHMENT |
attr="" autoattached="1" comment="" date="1162075796" name="behaviour.compressed.js" path="behaviour.compressed.js" size="2902" user="UnknownUser" version="" |
META FILEATTACHMENT |
attr="" autoattached="1" comment="" date="1161199153" name="behaviour.js" path="behaviour.js" size="8149" user="UnknownUser" version="" |
|
> > |
META FILEATTACHMENT |
attr="" autoattached="1" comment="" date="1162075796" name="behaviour.js" path="behaviour.compressed.js" size="2902" user="UnknownUser" version="" |
|