[isidorus-cvs] r75 - in trunk/src: ajax/css ajax/javascripts unit_tests

Lukas Giessmann lgiessmann at common-lisp.net
Mon Jun 29 08:19:48 UTC 2009


Author: lgiessmann
Date: Mon Jun 29 04:19:47 2009
New Revision: 75

Log:
ajax-client: fixed the "disable/enable" safari-bug

Modified:
   trunk/src/ajax/css/frame.css
   trunk/src/ajax/javascripts/constants.js
   trunk/src/ajax/javascripts/datamodel.js
   trunk/src/unit_tests/poems.xtm

Modified: trunk/src/ajax/css/frame.css
==============================================================================
--- trunk/src/ajax/css/frame.css	(original)
+++ trunk/src/ajax/css/frame.css	Mon Jun 29 04:19:47 2009
@@ -8,7 +8,6 @@
 /*  You can find a detailed description in trunk/docs/LGPL-LICENSE.txt and    */
 /*  in trunk/src/ajax/javascripts/external/MIT-LICENSE.txt.                   */
 /*----------------------------------------------------------------------------*/
-
 ul.fragmentFrame {
     list-style-type: none;
     padding-left: 0px;
@@ -203,12 +202,38 @@
     border: 1px solid #ff7f00;
 }
 
+/* === disabled name frame === */
+div.disabled table.nameFrame > tr.itemIdentityFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.nameFrame > tr.typeFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.nameFrame > tr.scopeContainer {
+    background-color: #eaeaee;
+}
+
+div.disabled table.nameFrame > tr.valueFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.nameFrame > tr.variantContainer {
+    background-color: #eaeaee;
+}
+
+
 
 /* === variant frame ======================================================== */
 table.nameFrame div.variantFrame {
     margin-left: 24px;
 }
 
+table.nameFrame div.disabled {
+    margin-left: 24px;
+}
+
 table.nameFrame table.variantFrame {
     width: 667px;
     margin-top: 2px;
@@ -237,6 +262,23 @@
     border: 1px solid #ff7f00;
 }
 
+/* === disabled variant frame === */
+div.disabled table.variantFrame > tr.itemIdentityFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.variantFrame > tr.scopeContainer {
+    background-color: #eaeaee;
+}
+
+div.disabled table.variantFrame > tr.valueFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.variantFrame > tr.datatypeFrame {
+    background-color: #eaeaee;
+}
+
 
 /* === occurrence frame ===================================================== */
 table.topicFrame table.occurrenceFrame {
@@ -268,6 +310,31 @@
     border: 1px solid #ff7f00;
 }
 
+/* === disabled occurrence frame === */
+div.disabled {
+    background-color: #eaeaee;
+}
+
+div.disabled table.occurrenceFrame > tr.itemIdentityFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.occurrenceFrame > tr.typeFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.occurrenceFrame > tr.scopeContainer {
+    background-color: #eaeaee;
+}
+
+div.disabled table.occurrenceFrame > tr.valueFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.occurrenceFrame > tr.datatypeFrame {
+    background-color: #eaeaee;
+}
+
 
 /* === association container / association frame ============================ */
 div.associationContainer {
@@ -313,7 +380,22 @@
     background-color: #f6f7f9;
 }
 
+/* === disabled association frame === */
+div.disabled table.associationFrame > tr.itemIdentityFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.associationFrame > tr.typeFrame {
+    background-color: #eaeaee;
+}
 
+div.disabled table.associationFrame > tr.scopeContainer {
+    background-color: #eaeaee;
+}
+
+div.disabled table.associationFrame > tr.roleContainer {
+    background-color: #eaeaee;
+}
 
 
 /* === associationrole frame ================================================ */
@@ -342,6 +424,18 @@
     background-color: #f6f7f9;
 }
 
+/* === disabled role frame === */
+div.disabled table.roleFrame > tr.itemIdentityFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.roleFrame > tr.typeFrame {
+    background-color: #eaeaee;
+}
+
+div.disabled table.roleFrame > tr.playerFrame {
+    background-color: #eaeaee;
+}
 
 
 /* === tmId frame  ========================================================== */

Modified: trunk/src/ajax/javascripts/constants.js
==============================================================================
--- trunk/src/ajax/javascripts/constants.js	(original)
+++ trunk/src/ajax/javascripts/constants.js	Mon Jun 29 04:19:47 2009
@@ -11,8 +11,7 @@
 
 
 // --- Some constants fot the http connections via the XMLHttpRequest-Object
-var TIMEOUT = 10000; // const TIMEOUT = 10000 --> "const" doesn't work under IE
-var HOST_PREF = "http://192.168.178.29:8000/"; //"http://localhost:8000/"; // of the form "http://(.+)/"
+var HOST_PREF = "http://143.93.190.237:8000/"; //"http://localhost:8000/"; // of the form "http://(.+)/"
 var GET_PREFIX = HOST_PREF + "json/get/";
 var GET_STUB_PREFIX = HOST_PREF + "json/topicstubs/";
 var TMCL_TYPE_URL = HOST_PREF + "json/tmcl/type/";
@@ -23,6 +22,7 @@
 var INSTANCE_PSIS_URL = HOST_PREF + "json/tmcl/instances/";
 var OWN_URL = HOST_PREF + "isidorus";
 var SUMMARY_URL = HOST_PREF + "json/summary"
+var TIMEOUT = 10000; // const TIMEOUT = 10000 --> "const" doesn't work under IE
 
 
 
@@ -85,5 +85,6 @@
 	       "tmIdFrame" : function(){ return "tmIdFrame"; },
 	       "load" : function(){ return "loadFrame"; },
 	       "ajaxLoader" : function(){ return "ajaxLoader"; },
-	       "editFrame" : function(){ return "editFrame"; }
+	       "editFrame" : function(){ return "editFrame"; },
+	       "disabled" : function(){ return "disabled"; }
 	      };
\ No newline at end of file

Modified: trunk/src/ajax/javascripts/datamodel.js
==============================================================================
--- trunk/src/ajax/javascripts/datamodel.js	(original)
+++ trunk/src/ajax/javascripts/datamodel.js	Mon Jun 29 04:19:47 2009
@@ -1225,26 +1225,25 @@
 					 },
 					 "disable" : function(){
 					     this.hideError();
-					     disableItemIdentity(this);
+					     this.__itemIdentity__.disable();
 					     // TODO: scope
-					     this.__table__.select("tr." + CLASSES.scopeContainer())[0].setStyle(DISABLED_BACKGROUND_COLOR);
-					     disableValue(this);
-					     disableDatatype(this);
+					     this.__value__.writeAttribute({"readonly" : "readonly"});
+					     this.__datatype__.__frames__[0].disable();
 					     this.hideRemoveButton();
 					     this.hideAddButton();
-					     this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);
+					     this.getFrame().writeAttribute({"class" : CLASSES.disabled()});
 					     this.__disabled__ = true;
 					 },
 					 "enable" : function(){
 					     this.getFrame().select("tr." + CLASSES.showHiddenRows())[0].hide();
-					     enableItemIdentity(this);
+					     this.__itemIdentity__.enable();
 					     // TODO: scope
-					     this.__table__.select("tr." + CLASSES.scopeContainer())[0].removeAttribute("style");
-					     enableValue(this);
-					     enableDatatype(this);
+					     this.__value__.removeAttribute("readonly")
+					     this.__datatype__.__frames__[0].enable();
 					     if(this.__owner__.__frames__.length > 1) this.showRemoveButton();
 					     this.showAddButton();
 					     this.getFrame().removeAttribute("style");
+					     this.getFrame().writeAttribute({"class" : CLASSES.variantFrame()});
 					     this.__disabled__ = false;
 					 },
 					 "minimize" : function(){
@@ -1474,23 +1473,36 @@
 				      },
 				      "disable" : function(){
 					  this.hideError();
+					  this.__itemIdentity__.disable();
+					  this.__type__.__frames__[0].disable();
+					  this.__scope__.disable();
+					  this.__value__.__frames__[0].disable();
+					  this.__variants__.disable();
+/*
 					  disableItemIdentity(this);
 					  disableType(this);
 					  disableScope(this);
 					  disableValue(this);
 					  disableVariants(this);
-					  this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);
+					  this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);*/
+					  this.getFrame().writeAttribute({"class" : CLASSES.disabled()});
 					  this.getFrame().writeAttribute({"title" : this.__cssTitle__});
 					  this.hideAddButton();
 					  this.__disabled__ = true;
 				      },
 				      "enable" : function(){
+					  this.__itemIdentity__.enable();
+					  this.__type__.__frames__[0].enable();
+					  this.__scope__.enable();
+					  this.__value__.__frames__[0].enable();
+					  this.__variants__.enable();
+/*
 					  enableItemIdentity(this);
 					  enableType(this);
 					  enableScope(this);
 					  enableValue(this);
-					  enableVariants(this);
-					  this.getFrame().removeAttribute("style");
+					  enableVariants(this);*/
+					  this.getFrame().writeAttribute({"class" : CLASSES.nameFrame()});
 					  this.getFrame().removeAttribute("title");
 					  checkRemoveAddButtons(this.__owner__, 1, this.__max__, this);
 					  this.__disabled__ = false;
@@ -1863,24 +1875,25 @@
 						    this.__isMinimized__ = false;
 						}
 					    },
-					    "disable" : function(){try{
+					    "disable" : function(){
 						this.hideError();
-						disableItemIdentity(this);
-						disableType(this);;
-						disableScope(this);
-						disableValue(this);
-						disableDatatype(this);
-						this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);
+						this.__itemIdentity__.disable();
+						this.__type__.__frames__[0].disable();
+						this.__scope__.disable();
+						this.__value__.writeAttribute({"readonly" : "readonly"});
+						this.__datatype__.__frames__[0].disable();
+						this.getFrame().writeAttribute({"class" : CLASSES.disabled()});
 						this.getFrame().writeAttribute({"title" : this.__cssTitle__});
 						this.hideAddButton();
-						this.__disabled__ = true;}catch(err){ alert("err: " + err); }
+						this.__disabled__ = true;
 					    },
 					    "enable" : function(){
-						enableItemIdentity(this);
-						enableType(this);;
-						enableScope(this);
-						enableValue(this);
-						enableDatatype(this);
+						this.__itemIdentity__.enable();
+						this.__type__.__frames__[0].enable();
+						this.__scope__.enable();
+						this.__value__.removeAttribute("readonly");
+						if(this.__datatypeIsSet__ === false) this.__datatype__.__frames__[0].enable();
+						this.getFrame().writeAttribute({"class" : CLASSES.occurrenceFrame()});
 						this.getFrame().removeAttribute("style");
 						this.getFrame().removeAttribute("title");
 						checkRemoveAddButtons(this.__owner__, 1, this.__max__, this);
@@ -2514,17 +2527,17 @@
 				      },
 				      "disable" : function(){
 					  this.hideError();
-					  disableItemIdentity(this);
-					  disableType(this);
-					  disablePlayer(this);
-					  this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);
+					  this.__itemIdentity__.disable()
+					  this.__type__.__frames__[0].disable();
+					  this.__player__.__frames__[0].disable();
+					  this.getFrame().writeAttribute({"class" : CLASSES.disabled()});
 					  this.__disabled__ = true;
 				      },
 				      "enable" : function(){
-					  enableItemIdentity(this);
-					  enableType(this);
-					  enablePlayer(this);
-					  this.getFrame().removeAttribute("style");
+					  this.__itemIdentity__.enable()
+					  this.__type__.__frames__[0].enable();
+					  this.__player__.__frames__[0].enable();
+					  this.getFrame().writeAttribute({"class" : CLASSES.roleFrame()});
 					  this.__disabled__ = false;
 				      },
 				      "minimize" : function(){
@@ -3619,23 +3632,23 @@
 					     },
 					     "disable" : function(){
 						 this.hideError();
-						 disableItemIdentity(this);
-						 disableRole(this);
-						 disableType(this);
-						 disableScope(this);
+						 this.__itemIdentity__.disable();
+						 this.__roles__.disable();
+						 this.__type__.__frames__[0].disable();
+						 this.__scope__.disable();
 						 this.hideRemoveButton();
 						 this.hideAddButton();
-						 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR);
+						 this.getFrame().writeAttribute({"class" : CLASSES.disabled()});
 						 this.__disabled__ = true;
 					     },
 					     "enable" : function(){
-						 enableItemIdentity(this);
-						 enableRole(this);
-						 enableType(this);
-						 enableScope(this);
+						 this.__itemIdentity__.enable();
+						 this.__roles__.enable();
+						 this.__type__.__frames__[0].enable();
+						 this.__scope__.enable();
 						 if(this.__owner__.__frames__.length > 1 || !this.__constraints__ || this.__constraints__.length !== 0) this.showRemoveButton();
 						 if(this.__constraints__ && this.__constraints__.length !== 0) this.showAddButton();
-						 this.getFrame().removeAttribute("style");
+						 this.getFrame().writeAttribute({"class" : CLASSES.associationFrame()});
 						 this.__disabled__ = false;
 					     },
 					     "minimize" : function(){

Modified: trunk/src/unit_tests/poems.xtm
==============================================================================
--- trunk/src/unit_tests/poems.xtm	(original)
+++ trunk/src/unit_tests/poems.xtm	Mon Jun 29 04:19:47 2009
@@ -16,7 +16,6 @@
       <tm:topicRef href="#written"/>
     </tm:role>
   </tm:association>
-
   <!-- end test -->
 
 
@@ -2876,7 +2875,7 @@
 
   <tm:association>
     <tm:itemIdentity href="written-by-association-shiller-resignation"/>
-    <tm:type><tm:topicRef href="#place"/></tm:type>
+    <tm:type><tm:topicRef href="#written-by"/></tm:type>
     <tm:scope><tm:topicRef href="#de"/></tm:scope>
     <tm:role>
       <tm:itemIdentity href="writer-role-schiller"/>




More information about the Isidorus-cvs mailing list