Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript Framework Contrib | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
On this page:
Behaviour Javascript event library to create Javascript based interactions that degrade well when Javascript is not available | ||||||||
Line: 270 to 270 | ||||||||
Installation Instructions | ||||||||
Changed: | ||||||||
< < | 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.
| |||||||
> > |
| |||||||
| ||||||||
Deleted: | ||||||||
< < |
| |||||||
Changed: | ||||||||
< < | ||||||||
> > |
| |||||||
Contrib Settings | ||||||||
Line: 299 to 289 | ||||||||
Contrib Info
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
|
Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
Changed: | |||||||||
< < | Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
> > | Behaviour Javascript Framework Contrib<-- Contributions to this TWiki extension are appreciated. Please update the contrib page at http://twiki.org/cgi-bin/view/Plugins/BehaviourContrib Behaviour Javascript event library to create Javascript based interactions that degrade well when Javascript is not available | ||||||||
Changed: | |||||||||
< < | 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). | ||||||||
> > | Introduction | ||||||||
Changed: | |||||||||
< < | |||||||||
> > | This contrib packages the third-party Behaviour Javascript event library, available from http://bennolan.com/behaviour/![]() | ||||||||
Added: | |||||||||
> > | 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). | ||||||||
Deleted: | |||||||||
< < | Introduction | ||||||||
From the website:
After all the work of WASP and others to promote clean markup, valid pages and graceful degradation via css - it sucks that we're going back to tag soup days by throwing javascript tags into our html. | |||||||||
Line: 55 to 61 | |||||||||
Deleted: | |||||||||
< < | |||||||||
Usage | |||||||||
Changed: | |||||||||
< < | Include the javascript file: | ||||||||
> > | Include the Javascript file: | ||||||||
Changed: | |||||||||
< < | |||||||||
> > | |||||||||
Line: 76 to 81 | |||||||||
// code here } }, | |||||||||
Deleted: | |||||||||
< < | |||||||||
'#id' : function(element) { // element event element.onclick = function() { | |||||||||
Line: 107 to 111 | |||||||||
Deleted: | |||||||||
< < | |||||||||
Example | |||||||||
Changed: | |||||||||
< < | 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. | ||||||||
> > | 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. | ||||||||
Line: 171 to 174 | |||||||||
// ]]> | |||||||||
Added: | |||||||||
> > | |||||||||
Creates: | |||||||||
Line: 231 to 235 | |||||||||
// ]]> | |||||||||
Added: | |||||||||
> > | Leaking Danger | ||||||||
Deleted: | |||||||||
< < | Leaking danger | ||||||||
Behaviour code leaks memory on Windows Explorer prior to version 7. To prevent leaking, set the element variable to null :
| |||||||||
Line: 255 to 259 | |||||||||
| |||||||||
Deleted: | |||||||||
< < | |||||||||
License | |||||||||
Deleted: | |||||||||
< < | Behaviour is freely distributable under the terms of an BSD license. For details see the Behaviour website. | ||||||||
Added: | |||||||||
> > | Behaviour is freely distributable under the terms of an BSD license. For details see the Behaviour website. | ||||||||
Links | |||||||||
Added: | |||||||||
> > | |||||||||
Line: 288 to 291 | |||||||||
Contrib Settings | |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
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 | |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
| |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
| |||||||||
Added: | |||||||||
> > |
| ||||||||
| |||||||||
Line: 308 to 314 | |||||||||
| |||||||||
Changed: | |||||||||
< < | Related Topics: TWikiPreferences
| ||||||||
> > | Related Topics: TWikiPreferences | ||||||||
Added: | |||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
Line: 296 to 296 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
Line: 296 to 296 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
Line: 296 to 296 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
Line: 296 to 296 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | ||||||||
Line: 296 to 296 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Behaviour Javascript framework Contrib
This contrib packages the third-party | |||||||||||||
Changed: | |||||||||||||
< < | 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). | ||||||||||||
Line: 61 to 62 | |||||||||||||
Changed: | |||||||||||||
< < | |||||||||||||
> > | |||||||||||||
Line: 107 to 108 | |||||||||||||
Changed: | |||||||||||||
< < | 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.
| |||||||||||||
Changed: | |||||||||||||
< < | TWiki Web Home | ||||||||||||
> > |
MOUSE OVER ME
| ||||||||||||
Deleted: | |||||||||||||
< < | The class name link%TWIKIWEB%%HOMETOPIC% will get expanded to linkTWikiWebHome
| ||||||||||||
Creates: | |||||||||||||
Changed: | |||||||||||||
< < | TWiki Web Home | ||||||||||||
> > |
MOUSE OVER ME
| ||||||||||||
Added: | |||||||||||||
> > |
Leaking dangerBehaviour code leaks memory on Windows Explorer prior to version 7. To prevent leaking, set the element variable tonull :
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 | |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
| ||||||||||||
LicenseBehaviour is freely distributable under the terms of an BSD license. | |||||||||||||
Changed: | |||||||||||||
< < | For details, see the Behaviour website. | ||||||||||||
> > | For details see the Behaviour website. | ||||||||||||
Links | |||||||||||||
Changed: | |||||||||||||
< < | Contrib Info | ||||||||||||
> > | Installation InstructionsYou 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.
| ||||||||||||
Added: | |||||||||||||
> > | Contrib Settings
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 | ||||||||||||
| |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
| ||||||||||||
| |||||||||||||
Added: | |||||||||||||
> > |
| ||||||||||||
| |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
| ||||||||||||
Related Topics: TWikiPreferences | |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
|
Line: 1 to 1 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||
> > | Behaviour Javascript framework Contrib
This contrib packages the third-party 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
On this page:
IntroductionFrom the website:After all the work of WASP and others to promote clean markup, valid pages and graceful degradation via css - it sucks that we're going back to tag soup days by throwing javascript tags into our html.
UsageInclude the javascript file:
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/BehaviourContrib/behaviour.compressed.js"></script> In your code you create a "rules" object, with sub-objects for each html element class name or id: var myrules = { '.classname' : function(element) { // element event element.onclick = function() { // code here } }, '#id' : function(element) { // element event element.onclick = function() { // code here } } }; Apply the rules with:
Behaviour.register(myrules);
ExampleIf 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.
<span class="link%TWIKIWEB%%HOMETOPIC%">[[%TWIKIWEB%.%HOMETOPIC%][TWiki Web Home]]</span> <script type="text/javascript"> // <![CDATA[ var myrules = { '.link%TWIKIWEB%%HOMETOPIC% a' : function(el){ el.onclick = function() { // open in a popup with no other attributes than template 'viewplain' launchTheWindow(this.href,null,null,null,"viewplain"); return false; } } }; Behaviour.register(myrules); // ]]> </script> Creates:
Development
LicenseBehaviour is freely distributable under the terms of an BSD license. For details, see the Behaviour website.
Links
Contrib Info
Related Topics: TWikiPreferences
|