[Z3lab-checkins] r2395 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 12:04:14 2006
New Revision: 2395

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- renamed the event's 'target' as 'publisher' since in the subscriber/publisher
  pattern the 'target' can be misunderstood as being the 'subscriber'.

  (this is still what is called 'event target' in DOM events, i.e. the event's
   source)




Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
12:04:14 2006
@@ -99,7 +99,7 @@
   unsubscribe: function(eventid, event) {
 new_subscribers = $A([]);
 CPSSkins.Subscribers[eventid].each(function(e) {
-  if (!(event.subscriber == e.subscriber  event.target == e.target)) {
+  if (!(event.subscriber == e.subscriber  event.publisher == 
e.publisher)) {
 new_subscribers.push(e);
   }
 });
@@ -108,15 +108,15 @@
 
   notify: function(eventid, info) {
 var subscribers = CPSSkins.Subscribers[eventid];
-var target = info.target;
+var publisher = info.publisher;
 $A(subscribers).each(function(e) {
-  var event_target = e.target;
-  if (event_target == target || event_target == null) {
+  var event_publisher = e.publisher;
+  if (event_publisher == publisher || event_publisher == null) {
 var handler = CPSSkins.getEventHandler(eventid, e.subscriber);
 if (handler) {
-  // set the target in case no target is specified in the subscription.
+  // set the publisher in case no publisher is specified in the 
subscription.
   info.subscriber = e.subscriber;
-  info.target = target;
+  info.publisher = publisher;
   handler(info);
 }
   }
@@ -161,7 +161,7 @@
 var progress = new Object({'initialized': 0});
 var length = elements.length;
 
-CPSSkins.subscribe(initialized, {'subscriber': progress, 'target': 
null});
+CPSSkins.subscribe(initialized, {'subscriber': progress, 'publisher': 
null});
 CPSSkins.registerEventHandler(initialized, progress, function(event) {
   progress.initialized += 1;
   if (progress.initialized = length) {
@@ -175,7 +175,7 @@
 var options = {
   onComplete: function(req) {
 el.innerHTML = req.responseText;
-CPSSkins.notify('initialized', {target: el});
+CPSSkins.notify('initialized', {'publisher': el});
   }
 }
 var parts = url.split('?');
@@ -186,7 +186,7 @@
 new Ajax.Request(url, options);
   } else {
 /* the definition is written inline */
-CPSSkins.notify('initialized', {target: el});
+CPSSkins.notify('initialized', {'publisher': el});
   }
 });
   },
@@ -219,7 +219,7 @@
 var controller = factory(el, def);
 CPSSkins.Controllers[name] = controller;
 CPSSkins.notify(registered controller  + def.id,
-{target: controller});
+{'publisher': controller});
   }
   break;
 }
@@ -227,7 +227,7 @@
 case model: {
   var model = new CPSSkins.Model(el, def);
   CPSSkins.Models[name] = model;
-  CPSSkins.notify(registered model  + def.id, {target: model});
+  CPSSkins.notify(registered model  + def.id, {'publisher': model});
   break;
 }
 
@@ -259,10 +259,10 @@
 if (model_id) {
   var evt_id = registered model  + model_id;
   CPSSkins.registerEventHandler(evt_id, view, function(event) {
-var model = event.target;
+var model = event.publisher;
 view.observe(model);
   });
-  CPSSkins.subscribe(evt_id, {'subscriber': view, 'target': null});
+  CPSSkins.subscribe(evt_id, {'subscriber': view, 'publisher': 
null});
 }
 
 /* register the controllers */
@@ -270,14 +270,14 @@
 $A(controllers_id).each(function(c) {
   var evt_id = registered controller  + c;
   CPSSkins.registerEventHandler(evt_id, view, function(event) {
-var controller = event.target;
+var controller = event.publisher;
 controller.view = view;
 controller.register(view);
 // add a back-reference
 view.controller = controller;
 
   });
-  CPSSkins.subscribe(evt_id, {'subscriber': view, 'target': null});
+  CPSSkins.subscribe(evt_id, {'subscriber': view, 'publisher': 
null});
 });
 
 /* insert the widget into the DOM */
@@ -419,9 +419,9 @@
 
 var controller = this;
 
-CPSSkins.registerEventHandler(command, view, function(info) {
+ 

[Z3lab-checkins] r2396 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 12:19:59 2006
New Revision: 2396

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- harmonization: rename the event 'info' object as 'event'



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
12:19:59 2006
@@ -106,18 +106,18 @@
 CPSSkins.Subscribers[eventid] = new_subscribers;
   },
 
-  notify: function(eventid, info) {
+  notify: function(eventid, event) {
 var subscribers = CPSSkins.Subscribers[eventid];
-var publisher = info.publisher;
+var publisher = event.publisher;
 $A(subscribers).each(function(e) {
   var event_publisher = e.publisher;
   if (event_publisher == publisher || event_publisher == null) {
 var handler = CPSSkins.getEventHandler(eventid, e.subscriber);
 if (handler) {
   // set the publisher in case no publisher is specified in the 
subscription.
-  info.subscriber = e.subscriber;
-  info.publisher = publisher;
-  handler(info);
+  event.subscriber = e.subscriber;
+  event.publisher = publisher;
+  handler(event);
 }
   }
 });
@@ -419,21 +419,21 @@
 
 var controller = this;
 
-CPSSkins.registerEventHandler(command, controller, function(info) {
-  var view = info.subscriber;
-  var controller = info.publisher;
+CPSSkins.registerEventHandler(command, controller, function(event) {
+  var view = event.subscriber;
+  var controller = event.publisher;
 
   // add some contextual info
-  info.view = view;
-  info.model = view.model;
+  event.view = view;
+  event.model = view.model;
 
-  var action = info.options.action;
+  var action = event.options.action;
   // TODO: to refactor
   /* the event handler calls the controller's registered handler */
   var handler_id = controller.def.handlers[action];
   if (handler_id) {
 var handler = CPSSkins.Handlers[handler_id];
-if (handler) handler(info);
+if (handler) handler(event);
   }
 });
 
@@ -477,9 +477,9 @@
 
 var controller = this;
 
-CPSSkins.registerEventHandler(gained focus, controller, function(info) {
-  var view = info.publisher;
-  var selected = info.context;
+CPSSkins.registerEventHandler(gained focus, controller, function(event) {
+  var view = event.publisher;
+  var selected = event.context;
   if (!view.def.model) {
 var model = Canvas.getModel(selected);
 if (model) {
@@ -488,8 +488,8 @@
   }
 });
 
-CPSSkins.registerEventHandler(lost focus, controller, function(info) {
-  var view = info.publisher;
+CPSSkins.registerEventHandler(lost focus, controller, function(event) {
+  var view = event.publisher;
   view.stopObserving();
 });
 
@@ -1644,12 +1644,12 @@
   if (!window.confirm(confirm)) return;
 }
 /* notify the controller to take action */
-var info = {
+var event = {
   context: this.selected,
   publisher: this.controller,
   options: {'action': action, 'choice': choice}
 }
-CPSSkins.notify(command, info);
+CPSSkins.notify(command, event);
 this.active = false;
   },
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2401 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 17:03:26 2006
New Revision: 2401

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- no need to specify a subscriber as 'null' if there is no subscriber.



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
17:03:26 2006
@@ -161,7 +161,7 @@
 var progress = new Object({'initialized': 0});
 var length = elements.length;
 
-CPSSkins.subscribe(initialized, {'subscriber': progress, 'publisher': 
null});
+CPSSkins.subscribe(initialized, {'subscriber': progress});
 CPSSkins.registerEventHandler(initialized, progress, function(event) {
   progress.initialized += 1;
   if (progress.initialized = length) {
@@ -262,7 +262,7 @@
 var model = event.publisher;
 view.observe(model);
   });
-  CPSSkins.subscribe(evt_id, {'subscriber': view, 'publisher': 
null});
+  CPSSkins.subscribe(evt_id, {'subscriber': view});
 }
 
 /* register the controllers */
@@ -277,7 +277,7 @@
 view.controller = controller;
 
   });
-  CPSSkins.subscribe(evt_id, {'subscriber': view, 'publisher': 
null});
+  CPSSkins.subscribe(evt_id, {'subscriber': view});
 });
 
 /* insert the widget into the DOM */
@@ -1357,7 +1357,7 @@
 view.getData();
   });
 
-  CPSSkins.subscribe(evt_id, {'subscriber': view, 'publisher': null});
+  CPSSkins.subscribe(evt_id, {'subscriber': view});
 }
 
   },
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2402 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 17:19:03 2006
New Revision: 2402

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- added a distinction between render(data) and display(data)

  - render(data) triggers no event

  - display(data) triggers a diplayed event

  this is needed to attach DOM events after the widget has been rendered.



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
17:19:03 2006
@@ -865,7 +865,7 @@
 // observers subscribes to events on the model
 CPSSkins.registerEventHandler('modified', view, function(event) {
   var data = event.publisher.def.data;
-  event.subscriber.render(data);
+  event.subscriber.display(data);
 });
 CPSSkins.subscribe('modified', {'subscriber': view, 'publisher': model});
 // create a back-reference
@@ -1224,18 +1224,20 @@
 }
   },
 
-  update: function() {
-var data = this.getData();
-if (data) this.render(data);
+  display: function(data) {
+this.render(data);
+CPSSkins.notify(displayed, {'publisher': this});
   },
 
   show: function() {
 if (this.visible) return;
 
-CPSSkins.notify(gained focus, {'publisher': this, 'context': 
this.selected});
+CPSSkins.notify(gained focus, {'publisher': this,
+ 'context': this.selected});
 
-// get new data
-this.update();
+// get new data and display the view
+var data = this.getData();
+if (data) this.display(data);
 
 // prepare the view
 this.prepare();
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2404 - cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/behaviour

2006-02-17 Thread svn
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
+  titleCPSSkins 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
+
+  h1CPSSkins 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
+   lispan id=item1Click me/span/li
+ /ul
+
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2405 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 19:00:52 2006
New Revision: 2405

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- optimization (avoid calling $$() several times for the same selector)



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
19:00:52 2006
@@ -459,15 +459,17 @@
   var widget = view.widget;
 
   $H(rules).each(function(r) {
-var selector = r[0];
-$H(r[1]).each(function(s) {
-  var event_name = s[0];
-  var handler_name = s[1];
-  var handler = CPSSkins.Handlers[handler_name];
-  $$(selector).each(function(el) {
-Event.observe(widget, event_name, handler);
-  });
-})
+var selector = $$(r[0]);
+if (selector) {
+  $H(r[1]).each(function(s) {
+var event_name = s[0];
+var handler_name = s[1];
+var handler = CPSSkins.Handlers[handler_name];
+selector.each(function(el) {
+  Event.observe(widget, event_name, handler);
+});
+  })
+}
   })
 });
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2407 - cpsskins/branches/jmo-perspectives/ui/framework

2006-02-17 Thread svn
Author: jmorliaguet
Date: Fri Feb 17 23:03:23 2006
New Revision: 2407

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- not rendering the view when it is supposed to be rendered is not a good
  idea, since DOM events can get registered several time.

  optimizations are to be made instead in the communication between the storages
  and the model.



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
23:03:23 2006
@@ -1390,11 +1390,7 @@
   var node = document.createElement(div);
   node.innerHTML = this.source;
   ctal.process_ctal(node, data);
-  var old_html = this.widget.innerHTML;
-  var new_html = node.innerHTML;
-  if (new_html != old_html) {
-this.widget.innerHTML = node.innerHTML;
-  }
+  this.widget.innerHTML = node.innerHTML;
 }
   }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2408 - in cpsskins/branches/jmo-perspectives/ui/framework: . tests/unit

2006-02-17 Thread svn
Author: jmorliaguet
Date: Sat Feb 18 01:37:44 2006
New Revision: 2408

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
Log:

- bug fix: new edge case where the information from the data structure became
  unavailable from inside the loop the third time the repeat loop was run.

  we do a deepcopy of the entire data structure



Modified: cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
==
--- cpsskins/branches/jmo-perspectives/ui/framework/ctal.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/ctal.js Sat Feb 18 
01:37:44 2006
@@ -163,24 +163,17 @@
iterator variable overwrites loop variable.);
   }
 
+  // do a deep copy of the data structure traversed by the repeat loop
+  // to avoid corrupting it.
+  var saved_data = ctal.deepcopy(data);
   for (var i=0; idatas.length; i++) {
-// do a deep copy of the data structure traversed by the repeat loop
-// to avoid corrupting it.
-var saved_data = new Object();
-var current_data = data[nmx[0]];
-if (typeof current_data != undefined) {
-  saved_data = ctal.deepcopy(current_data);
-}
 data[nmx[0]] = datas[i];
 
 var newnode = tmpl.cloneNode(true);
 ctal.node_insertbefore(parent, newnode, marker);
 // recurse
 ctal.process_ctal(newnode, data);
-// restore the original data structure
-if (saved_data) {
-  data = ctal.deepcopy(saved_data);
-}
+data = ctal.deepcopy(saved_data);
   }
   parent.removeChild(tmpl);
 }

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
==
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_ctal_test.html
  Sat Feb 18 01:37:44 2006
@@ -298,6 +298,10 @@
 div id=e34p ctal:repeat=f f ctal:content=f.../p/div
 
 
+!-- the entire data structure must be accessible from inside the loop --
+div id=e35p ctal:repeat=item fspan ctal:content=a/span/p/div
+
+
 !-- Tests follow --
 script type=text/javascript
 // ![CDATA[
@@ -510,6 +514,10 @@
 
   // XXX: this one does not pass yet
   assertEqual('', htmlOf(e34));
+
+  assertEqual(
+ 'pspan1/span/ppspan1/span/ppspan1/span/p',
+ htmlOf(e35));
 }}
 
   });
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins


[Z3lab-checkins] r2409 - in cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional: . treeview

2006-02-17 Thread svn
Author: jmorliaguet
Date: Sat Feb 18 02:11:58 2006
New Revision: 2409

Added:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/__init__.py
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/browser.py
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-last.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-open.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/cpsskins_treeview.pt
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/folder.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-branch.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-last.png
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/treeview_widget.pt
   (contents, props changed)
Modified:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
Log:

- saving work:

  the model consists of:

  - tree data generated on the server
(remote storage with a @@getTreeData getter)

  - tree states (information about which nodes are open)
(local storage, the information is stored in a cookie)

  - a compound storage that combines the tree data and the
tree state.


  the view:

  - CTAL template that renders the tree

  - observes the model (see above)


  the controller:

  - behaviour on each container node (close/open)

  - 2 handlers (openContainer() and closeContainer()

  - controls the view (see above)


  TODO: 

  - the server must use the tree state information to avoid
sending information about closed nodes

  - ...




Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
==
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
   (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
   Sat Feb 18 02:11:58 2006
@@ -12,4 +12,6 @@
 
   include package=.latency /
 
+  include package=.treeview /
+
 /configure

Added: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/__init__.py
==
--- (empty file)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/__init__.py
 Sat Feb 18 02:11:58 2006
@@ -0,0 +1 @@
+#

Added: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/browser.py
==
--- (empty file)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/browser.py
  Sat Feb 18 02:11:58 2006
@@ -0,0 +1,22 @@
+
+from zope.app.publisher.browser import BrowserView
+
+from cpsskins import minjson as json
+
+data = {
+'items': [
+{'id': 1, 'title': 'item 1', 'depth': 1, 'type': 'container'},
+{'id': 2, 'title': 'item 2', 'depth': 1, 'type': 'container'},
+{'id': 3, 'title': 'item 3', 'depth': 2},
+{'id': 4, 'title': 'item 4', 'depth': 2},
+{'id': 5, 'title': 'item 5', 'depth': 2, 'position': 'last'},
+{'id': 6, 'title': 'item 6', 'depth': 1, 'type': 'container'},
+{'id': 7, 'title': 'item 7', 'depth': 1, 'type': 'container'},
+]
+}
+
+class Views(BrowserView):
+
+def getTreeData(self):
+return json.write(data)
+

Added: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
==
--- (empty file)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
  Sat Feb 18 02:11:58 2006
@@ -0,0 +1,53 @@
+configure
+xmlns:browser=http://namespaces.zope.org/browser;
+
+  browser:resource
+  name=container.png file=container.png
+  layer=cpsskins-test /
+
+  browser:resource
+  name=container-open.png file=container-open.png
+  layer=cpsskins-test /
+
+  browser:resource
+  name=node-link-branch.png file=node-link-branch.png
+  layer=cpsskins-test /
+
+  

[Z3lab-checkins] r2410 - in cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview: . images

2006-02-17 Thread svn
Author: jmorliaguet
Date: Sat Feb 18 02:17:45 2006
New Revision: 2410

Added:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/__init__.py
   (contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/container-last.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-last.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/container-open.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-open.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/container.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/folder.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/folder.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/node-link-branch.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-branch.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/node-link-last.png
  - copied unchanged from r2409, 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-last.png
Removed:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-last.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container-open.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/container.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/folder.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-branch.png
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/node-link-last.png
Modified:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/cpsskins_treeview.pt
Log:

- moved images to the image folder



Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
==
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/configure.zcml
  Sat Feb 18 02:17:45 2006
@@ -2,23 +2,23 @@
 xmlns:browser=http://namespaces.zope.org/browser;
 
   browser:resource
-  name=container.png file=container.png
+  name=container.png file=images/container.png
   layer=cpsskins-test /
 
   browser:resource
-  name=container-open.png file=container-open.png
+  name=container-open.png file=images/container-open.png
   layer=cpsskins-test /
 
   browser:resource
-  name=node-link-branch.png file=node-link-branch.png
+  name=node-link-branch.png file=images/node-link-branch.png
   layer=cpsskins-test /
 
   browser:resource
-  name=node-link-last.png file=node-link-last.png
+  name=node-link-last.png file=images/node-link-last.png
   layer=cpsskins-test /
 
   browser:resource
-  name=folder.png file=folder.png
+  name=folder.png file=images/folder.png
   layer=cpsskins-test /
 
   browser:page

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/cpsskins_treeview.pt
==
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/cpsskins_treeview.pt
(original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/cpsskins_treeview.pt
Sat Feb 18 02:17:45 2006
@@ -30,11 +30,13 @@
 function openContainer(event) {
   var target = Event.element(event);
   var nodeid = target.getAttribute(nodeid);
+  debug(nodeid);
 }
 
 function closeContainer(event) {
   var target = Event.element(event);
   var nodeid = target.getAttribute(nodeid);
+  debug(nodeid);
 }
 
 CPSSkins.registerHandlers(

Added: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/treeview/images/__init__.py
==
--- (empty file)
+++