Author: jmorliaguet
Date: Wed Jun  7 19:52:46 2006
New Revision: 3347

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
   
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/quiz/cpsskins_quiz.pt
   
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/browser.py
   
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/cpsskins_treeview.pt

Log:

- DRY: the storage id in a local storage (cookie-based) is the id of the model.



Modified: cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    
(original)
+++ cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    Wed Jun 
 7 19:52:46 2006
@@ -1740,8 +1740,7 @@
   new CPSSkins.StorageAdapter(), {
 
   setup: function() {
-    this.id = this.model.def.storage.id;
-    this.cookie_name = 'cpsskins_local_storage_' + this.id;
+    this.cookie_name = 'cpsskins_local_storage_' + this.model.hash();
   },
 
   requestData: function() {

Modified: 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/quiz/cpsskins_quiz.pt
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/quiz/cpsskins_quiz.pt
     (original)
+++ 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/quiz/cpsskins_quiz.pt
     Wed Jun  7 19:52:46 2006
@@ -187,7 +187,6 @@
       "content": "No answer yet."
      },
      "storage": {
-       "id": "1",
        "type": "local"
        }
      }

Modified: 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/browser.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/browser.py
       (original)
+++ 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/browser.py
       Wed Jun  7 19:52:46 2006
@@ -56,7 +56,7 @@
 
     # TODO: moves this to an API
     def _getLocalStorageData(self, id):
-        value = self.request.cookies.get('cpsskins_local_storage_%s' % id)
+        value = self.request.cookies.get('cpsskins_local_storage_%s' % 
'tree-state')
         if value is not None:
             return json.read(unquote(value))
         return None

Modified: 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/cpsskins_treeview.pt
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/cpsskins_treeview.pt
     (original)
+++ 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/tests/functional/treeview/cpsskins_treeview.pt
     Wed Jun  7 19:52:46 2006
@@ -97,7 +97,6 @@
        "state": {}
      },
      "storage": {
-       "id": 1,
        "type": "local"
     }}
     </ins>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to