[isidorus-cvs] r64 - trunk/src/ajax/javascripts

Lukas Giessmann lgiessmann at common-lisp.net
Thu Jun 25 10:08:48 UTC 2009


Author: lgiessmann
Date: Thu Jun 25 06:08:47 2009
New Revision: 64

Log:
ajax-client: currently all roles which exist in the json fragment will be displayed in the fragment template

Modified:
   trunk/src/ajax/javascripts/datamodel.js

Modified: trunk/src/ajax/javascripts/datamodel.js
==============================================================================
--- trunk/src/ajax/javascripts/datamodel.js	(original)
+++ trunk/src/ajax/javascripts/datamodel.js	Thu Jun 25 06:08:47 2009
@@ -2724,7 +2724,27 @@
 					       "__createNewRolesFromContents__" : function(contents){
 						   if(!contents || contents.length === 0) return;
 
-						   // TODO: implement
+						   for(var i = 0; i !== contents.length; ++i){
+						       var rType = contents[i].type;
+						       if(!rType) rType = new Array("");
+						       rType = new Array(rType);
+						       var rPlayer = contents[i].topicRef;
+						       if(!rPlayer) rPlayer = new Array("");
+						       rPlayer = new Array(rPlayer);
+						       var itemIdentities = contents[i].itemIdentities;
+
+						       // itemIdentities, roleTypes, rolePlayers, owner, typeMin, parent){
+						       var role = new RoleC(itemIdentities, rType, rPlayer, this.__arContainer__, 0, this.__parentElem__);
+						       if(this.__arContainer__.__frames__ && this.__arContainer__.__frames__.length > 1){
+							   var insertPoint = this.__arContainer__.__frames__[this.__arContainer__.__frames__.length - 2];
+							   insertPoint.getFrame().insert({"after" : role.getFrame()});
+						       }
+						       else {
+							   this.__error__.insert({"before" : role.getFrame()})
+						       }
+						       role.hideAddButton();
+						       
+						   }
 					       },
 					       "__createFromContent__" : function(contents){
 						   if(!contents || contents.lenght === 0) return;




More information about the Isidorus-cvs mailing list