Changeset 1669
- Timestamp:
- 12/12/07 17:47:26
- Files:
-
- trunk/deployment/webadmin/webapp/resources/default/default/default.css (modified) (1 diff)
- trunk/deployment/webadmin/webapp/resources/default/default/default.xsl (modified) (1 diff)
- trunk/deployment/webadmin/webapp/resources/resources/bedework.js (modified) (1 diff)
- trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js (modified) (2 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webadmin/webapp/resources/default/default/default.css
r1663 r1669 309 309 background-color: #ff3; 310 310 } 311 #bwSubmittedEventCommentBlock { 312 font-size: 0.9em; 313 padding: 1em; 314 border: 1px solid #ccc; 315 background-color: #ffe; 316 color: black; 317 } 318 #bwSubmittedEventCommentBlock h4 { 319 display: inline; 320 font-size: 1.1em; 321 } 322 #bwSubmittedEventCommentBlock table { 323 margin: 1em 0 0 0; 324 } 325 #bwSubmittedEventCommentBlock td { 326 padding-left: 2em; 327 } 328 #bwSubmittedEventCommentBlock a.toggle { 329 padding-left: 1em; 330 font-size: 0.9em; 331 } 311 332 #commonListTable { 312 333 margin-bottom: 2em; trunk/deployment/webadmin/webapp/resources/default/default/default.xsl
r1665 r1669 940 940 941 941 <h2>Event Information</h2> 942 943 <!-- if a submitted event has comments, display them --> 944 <xsl:if test="normalize-space(form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value) != ''"> 945 <script type="text/javascript"> 946 bwSubmitComment = new bwSubmitComment('<xsl:value-of select="form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value"/>','bwSubmittedEventComment'); 947 </script> 948 949 <div id="bwSubmittedEventCommentBlock"> 950 <h4>Comments from Submitter</h4> 951 <a href="javascript:toggleVisibility('bwSubmittedEventComment');" class="toggle">show/hide</a> 952 <a href="javascript:bwSubmitComment.launch();" class="toggle">pop-up</a> 953 <div id="bwSubmittedEventComment"> 954 </div> 955 </div> 956 <script type="text/javascript"> 957 bwSubmitComment.display(); 958 </script> 959 </xsl:if> 942 960 943 961 <xsl:variable name="modEventAction" select="form/@action"/> trunk/deployment/webadmin/webapp/resources/resources/bedework.js
r1548 r1669 6 6 identity = document.getElementById(id); 7 7 identity.className=newClass; 8 } 9 function toggleVisibility(id) { 10 if (document.getElementById(id).className == 'invisible') { 11 changeClass(id,'visible'); 12 } else { 13 changeClass(id,'invisible'); 14 } 8 15 } 9 16 // show hide items using a checkbox trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js
r1560 r1669 72 72 } 73 73 74 this.format = function() {74 this.format = function() { 75 75 var res = this.date + "\t" + this.time + "\t"; 76 76 … … 233 233 234 234 return res; 235 } 236 } 237 // ======================================================================== 238 // Submitted event comments 239 // ======================================================================== 240 241 /* An comment accompanying a submitted event 242 /* comment: the x-property string X-BEDEWORK-SUBMIT-COMMENT, tab delimited 243 * id: id of the div to be written to for display 244 */ 245 function bwSubmitComment(comment,displayId) { 246 var commentVals = comment.split('\t'); 247 this.locationAddress = commentVals[0]; 248 this.locationSubaddress = commentVals[1]; 249 this.locationUrl = commentVals[2]; 250 this.contactName = commentVals[3]; 251 this.contactPhone = commentVals[4]; 252 this.contactUrl = commentVals[5]; 253 this.contactEmail = commentVals[6]; 254 this.category = commentVals[7]; 255 this.notes = commentVals[8]; 256 257 this.render = function() { 258 var output = ""; 259 output += '<table>'; 260 output += '<tr><th colspan="2">Suggested Location:</th><th colspan="2">Suggested Contact:</th></tr>'; 261 output += '<tr><td>Address:</td><td>' + this.locationAddress + '</td><td>Name:</td><td>' + this.contactName + '</td></tr>'; 262 output += '<tr><td>Subaddress:</td><td>' + this.locationSubddress + '</td><td>Phone:</td><td>' + this.contactPhone + '</td></tr>'; 263 output += '<tr><td>URL:</td><td>' + this.locationUrl + '</td><td>URL:</td><td>' + this.contactUrl + '</td></tr>'; 264 output += '<tr><td colspan="2"></td><td>Email:</td><td>' + this.contactEmail + '</td></tr>'; 265 output += '<tr><th colspan="4">Notes:</th></tr>'; 266 output += '<tr><td colspan="4">' + this.notes + '</td></tr>'; 267 output += '</table>'; 268 269 return output; 270 } 271 272 this.display = function() { 273 var showComment = document.getElementById(displayId); 274 showComment.innerHTML = this.render(); 275 } 276 277 // launch comment in a pop-up window 278 this.launch = function() { 279 var commentWindow = window.open("", "commentWindow", "width=800,height=400,scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=no,toolbar=no"); 280 commentWindow.document.open(); 281 commentWindow.document.writeln("<html><head><title>Submitted Event Comments</title>"); 282 commentWindow.document.writeln('<style type="text/css">body{background-color: #ffe; color: black; padding: 1em; font-size: 0.9em; font-family: Arial,sans-serif;}th{text-align: left;}td{padding-left: 2em;}</style></head>'); 283 commentWindow.document.writeln("<body><h2>Comments from Submitter</h2>"); 284 commentWindow.document.writeln(this.render()); 285 commentWindow.document.writeln("</body></html>"); 286 commentWindow.document.close(); 235 287 } 236 288 } trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js
r1667 r1669 262 262 function setComment(formObj) { 263 263 // set the submission comments (location, contact, and category suggestions) 264 // in xml format for easier post processing. 265 // add and remove values as the application grows. 266 267 var comment = "<location>"; 268 if (formObj["commentLocationAddress"].value != "") { 269 comment += "<address>" + formObj["commentLocationAddress"].value + "</address>"; 270 } 271 if (formObj["commentLocationSubaddress"].value != "") { 272 comment += "<subaddress>" + formObj["commentLocationSubaddress"].value + "</subaddress>"; 273 } 274 if (formObj["commentLocationURL"].value != "") { 275 comment += "<url>" + formObj["commentLocationURL"].value + "</url>"; 276 } 277 comment += "</location>"; 278 comment += "<contact>"; 279 if (formObj["commentContactName"].value != "") { 280 comment += "<name>" + formObj["commentContactName"].value + "</name>"; 281 } 282 if (formObj["commentContactPhone"].value != "") { 283 comment += "<phone>" + formObj["commentContactPhone"].value + "</phone>"; 284 } 285 if (formObj["commentContactURL"].value != "") { 286 comment += "<url>" + formObj["commentContactURL"].value + "</url>"; 287 } 288 if (formObj["commentContactEmail"].value != "") { 289 comment += "<email>" + formObj["commentContactEmail"].value + "</email>"; 290 } 291 comment += "</contact>"; 292 if (formObj["commentCategories"].value != "") { 293 comment += "<category>" + formObj["commentCategories"].value + "</category>"; 294 } 264 // in a parsable format that can be filtered on output. 265 266 var comment = ""; 267 comment += formObj["commentLocationAddress"].value + "\t"; 268 comment += formObj["commentLocationSubaddress"].value + "\t"; 269 comment += formObj["commentLocationURL"].value + "\t"; 270 comment += formObj["commentContactName"].value + "\t"; 271 comment += formObj["commentContactPhone"].value + "\t"; 272 comment += formObj["commentContactURL"].value + "\t"; 273 comment += formObj["commentContactEmail"].value + "\t"; 274 comment += formObj["commentCategories"].value; 295 275 296 276 formObj["xbwsubmitcomment"].value = comment;
