Changeset 73 for trunk/src/ajax
- Timestamp:
- 06/28/09 16:35:36 (16 years ago)
- Location:
- trunk/src/ajax
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/ajax/css/frame.css ¶
r71 r73 12 12 ul.fragmentFrame { 13 13 list-style-type: none; 14 } 15 16 caption { 14 padding-left: 0px; 15 } 16 17 ul.fragmentFrame table > caption { 17 18 font-size: 1.5em; 18 19 font-weight: bold; … … 21 22 td.controlColumn { 22 23 background-color: #eaeaee; 24 width: 13px; 23 25 } 24 26 … … 32 34 } 33 35 36 li.instanceOfFrame > div { 37 margin-left: 10px; 38 } 39 40 li.instanceOfFrame > div > input[type="button"]{ 41 margin-left: 24px; 42 } 43 34 44 input[value="generate fragment"] { 35 45 margin-top: 10px; … … 37 47 } 38 48 49 input[value="validate fragment"] { 50 float: right; 51 } 52 39 53 input[value="commit fragment"] { 54 margin-left: 5px; 40 55 float: right; 41 56 } 57 58 59 /* === remove/add buttons in any kind of rows =============================== */ 60 div.textrowWithoutRemoveButton span{ 61 display: inline-block; 62 width: 20px; 63 margin-left: 2px; 64 margin-right: 2px; 65 text-align: center; 66 } 67 68 div.textrowWithRemoveButton span{ 69 display: inline-block; 70 width: 20px; 71 margin-left: 2px; 72 margin-right: 2px; 73 text-align: center; 74 } 75 76 div.selectrowWithoutRemoveButton span{ 77 display: inline-block; 78 width: 20px; 79 margin-left: 2px; 80 margin-right: 2px; 81 text-align: center; 82 } 83 84 div.selectrowWithRemoveButton span{ 85 display: inline-block; 86 width: 20px; 87 margin-left: 2px; 88 margin-right: 2px; 89 text-align: center; 90 } 91 92 input[type="text"] { 93 background-color: #white; 94 border: 1px solid darkgray; 95 margin-bottom: 1px; 96 margin-top: 1px; 97 } 98 99 input[type="text"][readonly="readonly"] { 100 background-color: #eaeaee; 101 border: 1px solid darkgray; 102 margin-bottom: 1px; 103 margin-top: 1px; 104 } 105 106 107 div.textrowWithRemoveButton > input[type="text"]{ 108 margin-left: 0px; 109 font-weight: normal; 110 } 111 112 div.textrowWithoutRemoveButton > input[type="text"]{ 113 margin-left: 24px; 114 font-weight: normal; 115 } 116 117 div.selectrowWithRemoveButton > select { 118 margin-left: 0px; 119 font-weight: normal; 120 } 121 122 div.selectrowWithoutRemoveButton > select { 123 margin-left: 24px; 124 font-weight: normal; 125 } 126 127 textarea { 128 margin-left: 24px; 129 background-color: white; 130 border: 1px solid darkgray; 131 margin-bottom: 1px; 132 margin-top: 1px; 133 } 134 135 textarea[readonly="readonly"] { 136 margin-left: 24px; 137 background-color: #eaeaee; 138 border: 1px solid darkgray; 139 margin-bottom: 1px; 140 margin-top: 1px; 141 } 142 143 144 /* === topic frame ========================================================== */ 145 table.topicFrame { 146 width: 1022px; 147 border-collapse: collapse; 148 border: 1px solid #d1d1d3; 149 } 150 151 table.topicFrame > tr > td.description { 152 width: 163px; 153 } 154 155 table.topicFrame > tr > td.content { 156 width: 854px; 157 } 158 159 table.topicFrame > tr.topicIdFrame { 160 background-color: #f6f7f9; 161 } 162 163 table.topicFrame > tr.subjectLocatorFrame { 164 background-color: #f6f7f9; 165 } 166 167 table.topicFrame > tr.nameContainer { 168 background-color: #f6f7f9; 169 } 170 171 table.topicFrame:hover { 172 border: 1px solid #ff7f00; 173 } 174 175 176 /* === name frame =========================================================== */ 177 table.topicFrame table.nameFrame { 178 width: 851px; 179 margin-top: 2px; 180 margin-bottom: 2px; 181 margin-left: 1px; 182 border-collapse: collapse; 183 border: 1px solid #d1d1d3; 184 } 185 186 table.topicFrame table.nameFrame td.description { 187 width: 142px; 188 } 189 190 table.topicFrame table.nameFrame td.content { 191 width: 689px; 192 } 193 194 table.topicFrame table.nameFrame > tr.typeFrame { 195 background-color: white; 196 } 197 198 table.topicFrame table.nameFrame > tr.valueFrame { 199 background-color: white; 200 } 201 202 table.topicFrame table.nameFrame:hover { 203 border: 1px solid #ff7f00; 204 } 205 206 207 /* === variant frame ======================================================== */ 208 table.nameFrame div.variantFrame { 209 margin-left: 24px; 210 } 211 212 table.nameFrame table.variantFrame { 213 width: 667px; 214 margin-top: 2px; 215 margin-bottom: 2px; 216 border-collapse: collapse; 217 border: 1px solid #d1d1d3; 218 } 219 220 table.nameFrame table.variantFrame > tr > td.description { 221 width: 142px; 222 } 223 224 table.nameFrame table.variantFrame > tr > td.content { 225 width: 505px; 226 } 227 228 table.nameFrame table.variantFrame tr.scopeContainer { 229 background-color: white; 230 } 231 232 table.nameFrame table.variantFrame tr.datatypeFrame { 233 background-color: white; 234 } 235 236 table.nameFrame table.variantFrame:hover { 237 border: 1px solid #ff7f00; 238 } 239 240 241 /* === occurrence frame ===================================================== */ 242 table.topicFrame table.occurrenceFrame { 243 width: 851px; 244 margin-top: 2px; 245 margin-bottom: 2px; 246 margin-left: 1px; 247 border-collapse: collapse; 248 border: 1px solid #d1d1d3; 249 } 250 251 table.topicFrame table.occurrenceFrame td.description { 252 width: 142px; 253 } 254 255 table.topicFrame table.occurrenceFrame td.content { 256 width: 689px; 257 } 258 259 table.topicFrame table.occurrenceFrame > tr.typeFrame { 260 background-color: #f6f7f9; 261 } 262 263 table.topicFrame table.occurrenceFrame > tr.valueFrame { 264 background-color: #f6f7f9; 265 } 266 267 table.topicFrame table.occurrenceFrame:hover { 268 border: 1px solid #ff7f00; 269 } 270 271 272 /* === association container / association frame ============================ */ 273 div.associationContainer { 274 margin-top: 30px; 275 } 276 277 table.associationContainer { 278 border-collapse: collapse; 279 width: 1022px; 280 border: 1px solid #d1d1d3; 281 } 282 283 table.associationContainer:hover { 284 border: 1px solid #ff7f00; 285 } 286 287 table.associationFrame { 288 border-collapse: collapse; 289 margin-left: 1px; 290 margin-top: 1px; 291 margin-bottom: 1px; 292 border: 1px solid #d1d1d3; 293 width: 1018px; 294 } 295 296 table.associationFrame:hover { 297 border: 1px solid #ff7f00; 298 } 299 300 table.associationFrame > tr > td.description { 301 width: 142px; 302 } 303 304 table.associationFrame > tr > td.content { 305 width: 853px; 306 } 307 308 table.associationFrame > tr.itemIdentityFrame { 309 background-color: #f6f7f9; 310 } 311 312 table.associationFrame > tr.scopeContainer { 313 background-color: #f6f7f9; 314 } 315 316 317 318 319 /* === associationrole frame ================================================ */ 320 table.associationFrame table.roleFrame { 321 width: 853px; 322 margin-left: 1px; 323 margin-top: 2px; 324 margin-bottom: 2px; 325 border-collapse: collapse; 326 border: 1px solid #d1d1d3; 327 } 328 329 table.associationFrame table.roleFrame:hover { 330 border: 1px solid #ff7f00; 331 } 332 333 table.associationFrame table.roleFrame > tr > td.description { 334 width: 142px; 335 } 336 337 table.associationFrame table.roleFrame > tr > td.content { 338 width: 692px; 339 } 340 341 table.roleFrame > tr.typeFrame { 342 background-color: #f6f7f9; 343 } 344 345 346 347 /* === tmId frame ========================================================== */ 348 div.tmIdFrame { 349 margin-top: 30px; 350 } 351 352 table.tmIdFrame { 353 width: 1023px; 354 border-collapse: collapse; 355 border: 1px solid #d1d1d3; 356 background-color: #f6f7f9; 357 } 358 359 table.tmIdFrame:hover { 360 border: 1px solid #ff7f00; 361 } 362 363 li.tmIdFrame { 364 margin-bottom: 10px; 365 } 366 367 table.tmIdFrame input[type="text"] { 368 margin-left: 12px; 369 } -
TabularUnified trunk/src/ajax/css/main.css ¶
r71 r73 28 28 29 29 h1 { 30 clear: left; 30 31 margin-left: 10px; 31 32 padding-top: 20px; … … 62 63 img.ajaxLoader { 63 64 display: none; 64 margin-left: 412px; /* the image has a width of 100px */65 margin-left: 412px; /* the image has a width of 100px --> 1024/2 - 100 = 412*/ 65 66 } -
TabularUnified trunk/src/ajax/javascripts/constants.js ¶
r70 r73 13 13 // --- Some constants fot the http connections via the XMLHttpRequest-Object 14 14 var TIMEOUT = 10000; // const TIMEOUT = 10000 --> "const" doesn't work under IE 15 var HOST_PREF = "http://1 43.93.190.237:8000/"; //"http://localhost:8000/"; // of the form "http://(.+)/"15 var HOST_PREF = "http://192.168.178.29:8000/"; //"http://localhost:8000/"; // of the form "http://(.+)/" 16 16 var GET_PREFIX = HOST_PREF + "json/get/"; 17 17 var GET_STUB_PREFIX = HOST_PREF + "json/topicstubs/"; … … 38 38 var MMAX_INT = "*"; 39 39 40 41 // --- some css-styles 42 var DISABLED_BACKGROUND_COLOR = {"backgroundColor" : "#eaeaee"}; 43 44 40 45 // --- Contains most css classes used in this project 41 46 // --- There should be called only the function to be sure to don't override 42 47 // --- the original values. 43 var CLASSES = {"__divPage__" : "page", 44 "__divSubPage__" : "subPage", 45 "__divContent__" : "content", 46 "__divTextrowWithRemoveButton__" : "textrowWithRemoveButton", 47 "__divTextrowWithoutRemoveButton__" : "textrowWithoutRemoveButton", 48 "__divSelectrowWithRemoveButton__" : "selectrowWithRemoveButton", 49 "__divSelectrowWithoutRemoveButton__" : "selectrowWithoutRemoveButton", 50 "__spanClickable__" : "clickable", 51 "__notVisible__" : "notvisible", 52 "__divError__" : "errorMessage", 53 "__ulFragmentFrame__" : "fragmentFrame", 54 "__tableTopicFrame__" : "topicFrame", 55 "__trTopicIdFrame__" : "topicIdFrame", 56 "__tdContent__" : "content", 57 "__tdDescription__" : "description", 58 "__divInstanceOfFrame__" : "instanceOfFrame", 59 "__divItemIdentityFrame__" : "itemIdentityFrame", 60 "__divSubjectLocatorFrame__" : "subjectLocatorFrame", 61 "__divSubjectIdentifierFrame__" : "subjectIdentifierFrame", 62 "__divNameContainer__" : "nameContainer", 63 "__divNameFrame__" : "nameFrame", 64 "__trControlColumn__" : "controlColumn", 65 "__trShowHiddenRows__" : "showHiddenRows", 66 "__trTypeFrame__" : "typeFrame", 67 "__divScopeFrame__" : "scopeFrame", 68 "__divScopeContainer__" : "scopeContainer", 69 "__divValueFrame__" : "valueFrame", 70 "__divVariantFrame__" : "variantFrame", 71 "__divVariantContainer__" : "variantContainer", 72 "__divDatatypeFrame__" : "datatypeFrame", 73 "__divOccurrenceContainer__" : "occurrenceContainer", 74 "__divOccurrenceFrame__" : "occurrenceFrame", 75 "__divAssociationContainer__" : "associationContainer", 76 "__divAssociationFrame__" : "associationFrame", 77 "__divRoleContainer__" : "roleContainer", 78 "__divRoleFrame__" : "roleFrame", 79 "__divPlayerFrame__" : "playerFrame", 80 "__spanDeselect__" : "deselect", 81 "__divFog__" : "fog", 82 "__inputCommitButton__" : "commitButton", 83 "__divTmIdFrame__" : "tmIdFrame", 84 "__divLoad__" : "loadFrame", 85 "__imgAjaxLoader__" : "ajaxLoader", 86 "__divEditFrame__" : "editFrame", 87 88 "page" : function(){ return this.__divPage__; }, 89 "subPage" : function(){ return this.__divSubPage__; }, 90 "content" : function(){ return this.__divContent__; }, 91 "textrowWithRemoveButton" : function(){ return this.__divTextrowWithRemoveButton__; }, 92 "textrowWithoutRemoveButton" : function(){ return this.__divTextrowWithoutRemoveButton__; }, 93 "selectrowWithRemoveButton" : function(){ return this.__divSelectrowWithRemoveButton__; }, 94 "selectrowWithoutRemoveButton" : function(){ return this.__divSelectrowWithoutRemoveButton__; }, 95 "clickable" : function(){ return this.__spanClickable__; }, 96 "notVisible" : function(){ return this.__notVisible__; }, 97 "error" : function(){ return this.__divError__; }, "fragmentFrame" : function(){ return this.__ulFragmentFrame__; }, 98 "topicFrame" : function(){ return this.__tableTopicFrame__; }, 99 "topicIdFrame" : function(){ return this.__trTopicIdFrame__; }, 100 "content" : function(){ return this.__tdContent__; }, 101 "description" : function(){ return this.__tdDescription__; }, 102 "instanceOfFrame" : function(){ return this.__divInstanceOfFrame__; }, 103 "itemIdentityFrame" : function(){ return this.__divItemIdentityFrame__; }, 104 "subjectLocatorFrame" : function(){ return this.__divSubjectLocatorFrame__; }, 105 "subjectIdentifierFrame" : function(){ return this.__divSubjectIdentifierFrame__; }, 106 "nameContainer" : function(){ return this.__divNameContainer__; }, 107 "nameFrame" : function(){ return this.__divNameFrame__; }, 108 "controlColumn" : function(){ return this.__trControlColumn__; }, 109 "showHiddenRows" : function(){ return this.__trShowHiddenRows__; }, 110 "typeFrame" : function(){ return this.__trTypeFrame__; }, 111 "scopeFrame" : function(){ return this.__divScopeFrame__; }, 112 "scopeContainer" : function(){ return this.__divScopeContainer__; }, 113 "valueFrame" : function(){ return this.__divValueFrame__; }, 114 "variantFrame" : function(){ return this.__divVariantFrame__; }, 115 "variantContainer" : function(){ return this.__divVariantContainer__; }, 116 "datatypeFrame" : function(){ return this.__divDatatypeFrame__; }, 117 "occurrenceContainer" : function(){ return this.__divOccurrenceContainer__; }, 118 "occurrenceFrame" : function(){ return this.__divOccurrenceFrame__; }, 119 "associationContainer" : function(){ return this.__divAssociationContainer__; }, 120 "associationFrame" : function(){ return this.__divAssociationFrame__; }, 121 "roleContainer" : function(){ return this.__divRoleContainer__; }, 122 "roleFrame" : function(){ return this.__divRoleFrame__; }, 123 "playerFrame" : function(){ return this.__divPlayerFrame__; }, 124 "deselect" : function(){ return this.__spanDeselect__; }, 125 "fog" : function(){ return this.__divFog__; }, 126 "commitButton" : function(){ return this.__inputCommitButton__; }, 127 "tmIdFrame" : function(){ return this.__divTmIdFrame__; }, 128 "load" : function(){ return this.__divLoad__; }, 129 "ajaxLoader" : function(){ return this.__imgAjaxLoader__; }, 130 "editFrame" : function(){ return this.__divEditFrame__; } 48 var CLASSES = {"page" : function(){ return "page"; }, 49 "subPage" : function(){ return "subPage"; }, 50 "content" : function(){ return "content"; }, 51 "textrowWithRemoveButton" : function(){ return "textrowWithRemoveButton"; }, 52 "textrowWithoutRemoveButton" : function(){ return "textrowWithoutRemoveButton"; }, 53 "selectrowWithRemoveButton" : function(){ return "selectrowWithRemoveButton"; }, 54 "selectrowWithoutRemoveButton" : function(){ return "selectrowWithoutRemoveButton"; }, 55 "clickable" : function(){ return "clickable"; }, 56 "error" : function(){ return "errorMessage" }, 57 "fragmentFrame" : function(){ return "fragmentFrame"; }, 58 "topicFrame" : function(){ return "topicFrame"; }, 59 "topicIdFrame" : function(){ return "topicIdFrame"; }, 60 "content" : function(){ return "content"; }, 61 "description" : function(){ return "description"; }, 62 "instanceOfFrame" : function(){ return "instanceOfFrame"; }, 63 "itemIdentityFrame" : function(){ return "itemIdentityFrame"; }, 64 "subjectLocatorFrame" : function(){ return "subjectLocatorFrame"; }, 65 "subjectIdentifierFrame" : function(){ return "subjectIdentifierFrame"; }, 66 "nameContainer" : function(){ return "nameContainer"; }, 67 "nameFrame" : function(){ return "nameFrame"; }, 68 "controlColumn" : function(){ return "controlColumn"; }, 69 "showHiddenRows" : function(){ return "showHiddenRows"; }, 70 "typeFrame" : function(){ return "typeFrame"; }, 71 "scopeFrame" : function(){ return "scopeFrame"; }, 72 "scopeContainer" : function(){ return "scopeContainer"; }, 73 "valueFrame" : function(){ return "valueFrame"; }, 74 "variantFrame" : function(){ return "variantFrame"; }, 75 "variantContainer" : function(){ return "variantContainer"; }, 76 "datatypeFrame" : function(){ return "datatypeFrame"; }, 77 "occurrenceContainer" : function(){ return "occurrenceContainer"; }, 78 "occurrenceFrame" : function(){ return "occurrenceFrame"; }, 79 "associationContainer" : function(){ return "associationContainer"; }, 80 "associationFrame" : function(){ return "associationFrame"; }, 81 "roleContainer" : function(){ return "roleContainer"; }, 82 "roleFrame" : function(){ return "roleFrame"; }, 83 "playerFrame" : function(){ return "playerFrame"; }, 84 "commitButton" : function(){ return "commitButton"; }, 85 "tmIdFrame" : function(){ return "tmIdFrame"; }, 86 "load" : function(){ return "loadFrame"; }, 87 "ajaxLoader" : function(){ return "ajaxLoader"; }, 88 "editFrame" : function(){ return "editFrame"; } 131 89 }; -
TabularUnified trunk/src/ajax/javascripts/create.js ¶
r71 r73 102 102 } 103 103 104 var validateButton = new Element("input", {"type" : "button", "value" : "validate fragment"}); 105 validateButton.observe("click", function(event){ 106 var ret = true; 107 if(topic.isValid() === false) ret = false; 108 if(associations && associations.isValid() === false) ret = false; 109 if(tmId.isValid() === false) ret = false; 110 111 if(ret === true) alert("Fragment is valid!"); 112 else alert("Fragment is not valid!"); 113 }); 114 104 115 var commitButton = new Element("input", {"type" : "button", "value" : "commit fragment"}) 105 116 commitButton.observe("click", function(event){ … … 147 158 148 159 var liCB = new Element("li", {"class" : CLASSES.commitButton()}); 149 liCB.update(commitButton); 160 liCB.insert({"top" : validateButton}); 161 liCB.insert({"top" : commitButton}); 150 162 liTm.insert({"after" : liCB}); 151 163 } -
TabularUnified trunk/src/ajax/javascripts/datamodel.js ¶
r72 r73 96 96 this.__frame__.writeAttribute({"class" : CLASSES.textrowWithRemoveButton()}); 97 97 this.__content__.remove(); 98 this.__content__ = new Element("input", {"type" : "text", "value" : content });98 this.__content__ = new Element("input", {"type" : "text", "value" : content, "size" : 40}); 99 99 this.__dblClickHandler__ = dblClickHandler; 100 100 if(cssTitle && cssTitle.length){ … … 1157 1157 1158 1158 // --- resource value and datatype 1159 makeResource(this, contents, null, null, null );1159 makeResource(this, contents, null, null, null, {"rows" : 3, "cols" : 40}); 1160 1160 1161 1161 this.getFrame().observe("dblclick", function(event){ … … 1226 1226 "disable" : function(){ 1227 1227 this.hideError(); 1228 this.__itemIdentity__.disable();1228 disableItemIdentity(this); 1229 1229 // TODO: scope 1230 this.__value__.writeAttribute({"readonly" : "readonly"}); 1231 this.__datatype__.__frames__[0].disable(); 1230 this.__table__.select("tr." + CLASSES.scopeContainer())[0].setStyle(DISABLED_BACKGROUND_COLOR); 1231 disableValue(this); 1232 disableDatatype(this); 1232 1233 this.hideRemoveButton(); 1233 1234 this.hideAddButton(); 1234 this.getFrame().setStyle({"backgroundColor" : "#edeceb"}); 1235 this.getFrame().setStyle({"border" : "1px solid darkgrey"}); 1235 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR); 1236 1236 this.__disabled__ = true; 1237 1237 }, 1238 1238 "enable" : function(){ 1239 this.__itemIdentity__.enable();1239 enableItemIdentity(this); 1240 1240 // TODO: scope 1241 this.__value__.removeAttribute("readonly"); 1242 this.__datatype__.__frames__[0].enable(); 1241 this.__table__.select("tr." + CLASSES.scopeContainer())[0].removeAttribute("style"); 1242 enableValue(this); 1243 enableDatatype(this); 1243 1244 if(this.__owner__.__frames__.length > 1) this.showRemoveButton(); 1244 1245 this.showAddButton(); 1245 this.getFrame().setStyle({"backgroundColor" : "inherit"}); 1246 this.getFrame().setStyle({"border" : "none"}); 1246 this.getFrame().removeAttribute("style"); 1247 1247 this.__disabled__ = false; 1248 1248 }, … … 1393 1393 function addSecondShowHandler(myself){ 1394 1394 myself.__table__.select("tr")[0].observe("click", function(event){ 1395 try{ 1396 for(var i = 0; i != myself.__variants__.__container__.__frames__.length; ++i){ 1397 myself.__variants__.__container__.__frames__[i].minimize(); 1398 } 1399 }catch(tmp){ alert(tmp);} 1395 for(var i = 0; i != myself.__variants__.__container__.__frames__.length; ++i){ 1396 myself.__variants__.__container__.__frames__[i].minimize(); 1397 } 1400 1398 }); 1401 1399 } … … 1451 1449 "disable" : function(){ 1452 1450 this.hideError(); 1453 this.__itemIdentity__.disable(); 1454 this.__type__.__frames__[0].disable(); 1455 this.__scope__.disable(); 1456 this.__value__.__frames__[0].disable(); 1457 this.__variants__.disable(); 1458 this.getFrame().setStyle({"backgroundColor" : "#edeceb"}); 1459 this.getFrame().setStyle({"border" : "1px solid darkgrey"}); 1451 disableItemIdentity(this); 1452 disableType(this); 1453 disableScope(this); 1454 disableValue(this); 1455 disableVariants(this); 1456 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR); 1460 1457 this.getFrame().writeAttribute({"title" : this.__cssTitle__}); 1461 1458 this.hideAddButton(); … … 1463 1460 }, 1464 1461 "enable" : function(){ 1465 this.__itemIdentity__.enable(); 1466 this.__type__.__frames__[0].enable(); 1467 this.__scope__.enable(); 1468 this.__value__.__frames__[0].enable(); 1469 this.__variants__.enable(); 1470 this.getFrame().setStyle({"backgroundColor" : "inherit"}); 1471 this.getFrame().setStyle({"border" : "none"}); 1462 enableItemIdentity(this); 1463 enableType(this); 1464 enableScope(this); 1465 enableValue(this); 1466 enableVariants(this); 1467 this.getFrame().removeAttribute("style"); 1472 1468 this.getFrame().removeAttribute("title"); 1473 1469 checkRemoveAddButtons(this.__owner__, 1, this.__max__, this); … … 1756 1752 if(noConstraint === false) cssTitle = "min: " + _min + " max: " + _max + " regular expression: " + constraint.regexp; 1757 1753 this.__cssTitle__ = cssTitle; 1758 makeResource(this, contents, constraint, (occurrenceTypes ? occurrenceTypes[0].datatypeConstraint : null), cssTitle );1754 makeResource(this, contents, constraint, (occurrenceTypes ? occurrenceTypes[0].datatypeConstraint : null), cssTitle, {"rows" : 5, "cols" : 60}); 1759 1755 1760 1756 this.getFrame().observe("dblclick", function(event){ … … 1828 1824 } 1829 1825 }, 1830 "disable" : function(){ 1826 "disable" : function(){try{ 1831 1827 this.hideError(); 1832 this.__itemIdentity__.disable(); 1833 this.__type__.__frames__[0].disable(); 1834 this.__scope__.disable(); 1835 this.__value__.writeAttribute({"readonly" : "readonly"}); 1836 this.__datatype__.__frames__[0].disable(); 1837 this.getFrame().setStyle({"backgroundColor" : "#edeceb"}); 1838 this.getFrame().setStyle({"border" : "1px solid darkgrey"}); 1828 disableItemIdentity(this); 1829 disableType(this);; 1830 disableScope(this); 1831 disableValue(this); 1832 disableDatatype(this); 1833 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR); 1839 1834 this.getFrame().writeAttribute({"title" : this.__cssTitle__}); 1840 1835 this.hideAddButton(); 1841 this.__disabled__ = true; 1836 this.__disabled__ = true;}catch(err){ alert("err: " + err); } 1842 1837 }, 1843 1838 "enable" : function(){ 1844 this.__itemIdentity__.enable(); 1845 this.__type__.__frames__[0].enable(); 1846 this.__scope__.enable(); 1847 this.__value__.removeAttribute("readonly"); 1848 this.__datatype__.__frames__[0].enable(); 1849 this.getFrame().setStyle({"backgroundColor" : "inherit"}); 1850 this.getFrame().setStyle({"border" : "none"}); 1839 enableItemIdentity(this); 1840 enableType(this);; 1841 enableScope(this); 1842 enableValue(this); 1843 enableDatatype(this); 1844 this.getFrame().removeAttribute("style"); 1851 1845 this.getFrame().removeAttribute("title"); 1852 1846 checkRemoveAddButtons(this.__owner__, 1, this.__max__, this); … … 2480 2474 "disable" : function(){ 2481 2475 this.hideError(); 2482 this.__itemIdentity__.disable(); 2483 this.__type__.__frames__[0].disable(); 2484 this.__player__.__frames__[0].disable(); 2485 this.getFrame().setStyle({"backgroundColor" : "#edeceb"}); 2486 this.getFrame().setStyle({"border" : "1px solid darkgrey"}); 2476 disableItemIdentity(this); 2477 disableType(this); 2478 disablePlayer(this); 2479 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR); 2487 2480 this.__disabled__ = true; 2488 2481 }, 2489 2482 "enable" : function(){ 2490 this.__itemIdentity__.enable(); 2491 this.__type__.__frames__[0].enable(); 2492 this.__player__.__frames__[0].enable(); 2493 this.getFrame().setStyle({"backgroundColor" : "inherit"}); 2494 this.getFrame().setStyle({"border" : "none"}); 2483 enableItemIdentity(this); 2484 enableType(this); 2485 enablePlayer(this); 2486 this.getFrame().removeAttribute("style"); 2495 2487 this.__disabled__ = false; 2496 2488 }}); … … 3570 3562 "disable" : function(){ 3571 3563 this.hideError(); 3572 this.__itemIdentity__.disable();3573 this.__roles__.disable();3574 this.__type__.__frames__[0].disable();3575 this.__scope__.disable();3564 disableItemIdentity(this); 3565 disableRole(this); 3566 disableType(this); 3567 disableScope(this); 3576 3568 this.hideRemoveButton(); 3577 3569 this.hideAddButton(); 3578 this.getFrame().setStyle({"backgroundColor" : "#edeceb"}); 3579 this.getFrame().setStyle({"border" : "1px solid darkgrey"}); 3570 this.getFrame().setStyle(DISABLED_BACKGROUND_COLOR); 3580 3571 this.__disabled__ = true; 3581 3572 }, 3582 3573 "enable" : function(){ 3583 this.__itemIdentity__.enable();3584 this.__roles__.enable();3585 this.__type__.__frames__[0].enable();3586 this.__scope__.enable();3574 enableItemIdentity(this); 3575 enableRole(this); 3576 enableType(this); 3577 enableScope(this); 3587 3578 if(this.__owner__.__frames__.length > 1 || !this.__constraints__ || this.__constraints__.length !== 0) this.showRemoveButton(); 3588 3579 if(this.__constraints__ && this.__constraints__.length !== 0) this.showAddButton(); 3589 this.getFrame().setStyle({"backgroundColor" : "inherit"}); 3590 this.getFrame().setStyle({"border" : "none"}); 3580 this.getFrame().removeAttribute("style"); 3591 3581 this.__disabled__ = false; 3592 3582 }}); … … 3713 3703 this.__table__.update(this.__caption__); 3714 3704 var value = contents && contents.length !== 0 ? decodeURI(contents[0]) : ""; 3715 this.__contentrow__ = new Element("input", {"type" : "text", "value" : value });3705 this.__contentrow__ = new Element("input", {"type" : "text", "value" : value, "size" : 40}); 3716 3706 this.__tr__ = new Element("tr", {"class" : CLASSES.tmIdFrame()}); 3717 3707 var td =new Element("td", {"class" : CLASSES.content()}); … … 3969 3959 3970 3960 // --- sets the resource value and datatype of names and occurrences 3971 function makeResource(myself, content, constraints, datatypeConstraint, cssTitle )3961 function makeResource(myself, content, constraints, datatypeConstraint, cssTitle, size) 3972 3962 { 3963 if(!size) size = {"rows" : 3, "cols" : 40}; 3973 3964 var value = ""; 3974 3965 var datatype = ""; … … 3990 3981 this.__datatype__ = new Object(); 3991 3982 }catch(err){} 3992 myself.__value__ = new Element("textarea", {"rows" : 3}).setValue(value);3983 myself.__value__ = new Element("textarea", size).setValue(value); 3993 3984 myself.__table__.insert({"bottom" : newRow(CLASSES.valueFrame(), "Resource Value", myself.__value__)}); 3994 3985 if(cssTitle && cssTitle.length !== 0) myself.__value__.writeAttribute({"title" : cssTitle}); … … 3996 3987 // --- datatype 3997 3988 myself.__datatype__ = new Object(); 3998 if( datatypeConstraint && datatypeConstraint.length !== 0){3989 if((datatypeConstraint && datatypeConstraint.length !== 0) || datatype === ANY_URI){ 3999 3990 new TextrowC(datatypeConstraint, datatypeConstraint, myself.__datatype__, 1, 1, null); 4000 3991 myself.__datatype__.__frames__[0].getFrame().select("input")[0].writeAttribute({"readonly" : "readonly"}); 3992 myself.__datatypeIsSet__ = true; 4001 3993 } 4002 3994 else { 4003 3995 new TextrowC(datatype, ".*", myself.__datatype__, 1, 1, null); 3996 myself.__datatypeIsSet__ = false; 4004 3997 } 4005 3998 myself.__table__.insert({"bottom" : newRow(CLASSES.datatypeFrame(), "Datatype", myself.__datatype__.__frames__[0].getFrame())}); … … 4155 4148 return types; 4156 4149 } 4150 4151 // --- some helper to enable/disable some table rows 4152 4153 function disableItemIdentity(myself) 4154 { 4155 myself.__itemIdentity__.disable(); 4156 myself.__table__.select("tr." + CLASSES.itemIdentityFrame())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4157 } 4158 function enableItemIdentity(myself) 4159 { 4160 myself.__itemIdentity__.enable(); 4161 myself.__table__.select("tr." + CLASSES.itemIdentityFrame())[0].removeAttribute("style"); 4162 } 4163 function disableType(myself) 4164 { 4165 myself.__type__.__frames__[0].disable(); 4166 myself.__table__.select("tr." + CLASSES.typeFrame())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4167 } 4168 function enableType(myself) 4169 { 4170 myself.__type__.__frames__[0].enable(); 4171 myself.__table__.select("tr." + CLASSES.typeFrame())[0].removeAttribute("style"); 4172 } 4173 function disableScope(myself){ 4174 myself.__scope__.disable(); 4175 myself.__table__.select("tr." + CLASSES.scopeContainer())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4176 } 4177 function enableScope(myself) 4178 { 4179 myself.__scope__.enable(); 4180 myself.__table__.select("tr." + CLASSES.scopeContainer())[0].removeAttribute("style"); 4181 } 4182 function disableValue(myself) 4183 { 4184 try{ myself.__value__.__frames__[0].disable(); } catch(err){} 4185 try{ myself.__value__.writeAttribute({"readonly" : "readonly"}); } catch(err){} 4186 myself.__table__.select("tr." + CLASSES.valueFrame())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4187 } 4188 function enableValue(myself) 4189 { 4190 try{ myself.__value__.__frames__[0].enable(); } catch(err){} 4191 try{ myself.__value__.removeAttribute("readonly"); } catch(err){} 4192 myself.__table__.select("tr." + CLASSES.valueFrame())[0].removeAttribute("style"); 4193 } 4194 function disableDatatype(myself) 4195 { 4196 myself.__datatype__.__frames__[0].disable(); 4197 myself.__table__.select("tr." + CLASSES.datatypeFrame())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4198 } 4199 function enableDatatype(myself) 4200 { 4201 if(myself.__datatypeIsSet__ === false) myself.__datatype__.__frames__[0].enable(); 4202 myself.__table__.select("tr." + CLASSES.datatypeFrame())[0].removeAttribute("style"); 4203 } 4204 function disableVariants(myself) 4205 { 4206 myself.__variants__.disable(); 4207 myself.__table__.select("tr." + CLASSES.variantContainer())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4208 } 4209 function enableVariants(myself) 4210 { 4211 myself.__variants__.enable(); 4212 myself.__table__.select("tr." + CLASSES.variantContainer())[0].removeAttribute("style"); 4213 } 4214 function disableRole(myself) 4215 { 4216 myself.__roles__.disable(); 4217 myself.__table__.select("tr." + CLASSES.roleContainer())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4218 } 4219 function enableRole(myself) 4220 { 4221 myself.__roles__.enable(); 4222 myself.__table__.select("tr." + CLASSES.roleContainer())[0].removeAttribute("style"); 4223 } 4224 function disablePlayer(myself) 4225 { 4226 myself.__player__.__frames__[0].disable(); 4227 myself.__table__.select("tr." + CLASSES.playerFrame())[0].setStyle(DISABLED_BACKGROUND_COLOR); 4228 } 4229 function enablePlayer(myself) 4230 { 4231 myself.__player__.__frames__[0].enable(); 4232 myself.__table__.select("tr." + CLASSES.playerFrame())[0].removeAttribute("style"); 4233 } -
TabularUnified trunk/src/ajax/javascripts/requests.js ¶
r70 r73 17 17 return setTimeout(function(){ 18 18 alert("The AJAX request for \"" + url + "\" timed out. Please check your network connection!"); 19 hideLoad(); 19 20 }, time); 20 21 }
Note: See TracChangeset
for help on using the changeset viewer.