Author: jmorliaguet Date: Fri Feb 17 18:53:06 2006 New Revision: 2404 Added: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/cpsskins_behaviour_test.html (contents, props changed) cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/template.html (contents, props changed) Log:
- added functional test for behaviour (basically the same principle as in http://bennolan.com/behaviour/ with a simpler syntax for registering handlers) Added: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/cpsskins_behaviour_test.html ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/cpsskins_behaviour_test.html Fri Feb 17 18:53:06 2006 @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xml:lang="en" lang="en" + xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>CPSSkins Unit test file</title> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <script src="../../../prototype.js" type="text/javascript"></script> + <script src="../../../json.js" type="text/javascript"></script> + <script src="../../../ctal.js" type="text/javascript"></script> + <script src="../../../cpsskins.js" type="text/javascript"></script> + <link rel="stylesheet" href="../../../cpsskins.css" type="text/css" /> + + <script type="text/javascript"> + function sayHello(event) { + alert('Hello!'); + } + + CPSSkins.registerHandlers({'say-hello': sayHello}); + + </script> + +</head> +<body> + + <h1>CPSSkins behaviour</h1> + + <div id="area1"> + + <ins class="controller"> + {"id": "behaviour", + "type": "behaviour", + "rules": { + "#item1": { + "click": "say-hello" + } + }} + </ins> + + <!-- dummy model (needed for rendering the view) --> + <ins class="model"> + {"id": "dummy"} + </ins> + + <ins class="view"> + {"model": "dummy", + "widget": { + "template": "template.html" + }, + "controllers": ["behaviour"] + } + </ins> + + </div> + +</body> +</html> Added: cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/template.html ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour/template.html Fri Feb 17 18:53:06 2006 @@ -0,0 +1,5 @@ + + <ul> + <li><span id="item1">Click me</span></li> + </ul> + -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins