Changeset 1857
- Timestamp:
- 04/23/08 17:19:27
- Files:
-
- trunk/deployment/webadmin/webapp/resources/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/webadmin/webapp/resources/resources/bedeworkXProperties.js (modified) (4 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkXProperties.js (modified) (3 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkXProperties.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webadmin/webapp/resources/default/default/default.xsl
r1852 r1857 246 246 } 247 247 function initXProperties() { 248 <xsl:for-each select=" form/xproperties/node()">249 bwX props.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']</xsl:for-each>],"<xsl:value-of select="values/text"/>");248 <xsl:for-each select="/bedework/formElements/form/xproperties/node()"> 249 bwXProps.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>],'<xsl:call-template name="escapeApos"><xsl:with-param name="str"><xsl:value-of select="values/text"/></xsl:with-param></xsl:call-template>'); 250 250 </xsl:for-each> 251 251 } … … 1061 1061 <a href="javascript:bwSubmitComment.launch();" class="toggle">pop-up</a> 1062 1062 <div id="bwSubmittedEventComment"> 1063 <xsl:if test="/bedework/page = 'modEvent'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 1063 1064 </div> 1064 1065 </div> … … 1281 1282 <xsl:choose> 1282 1283 <xsl:when test="form/end/type='E'"> 1283 <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>1284 <input type="radio" name="eventEndType" id="bwEndDateTimeButton" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/> 1284 1285 </xsl:when> 1285 1286 <xsl:otherwise> 1286 <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>1287 <input type="radio" name="eventEndType" id="bwEndDateTimeButton" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/> 1287 1288 </xsl:otherwise> 1288 1289 </xsl:choose> trunk/deployment/webadmin/webapp/resources/resources/bedeworkXProperties.js
r1852 r1857 46 46 var bwXParamEmail = "X-BEDEWORK-PARAM-EMAIL"; 47 47 48 48 49 // ======================================================================== 49 50 // x-property functions … … 69 70 if (this.params[i][1] != "") { 70 71 curXparams += ";" + this.params[i][0]; 71 // if parameter values contain ";" or ":" they must be quoted72 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 ) {72 // if parameter values contain ";" or ":" or "," they must be quoted 73 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 || this.params[i][1].indexOf(",") != -1) { 73 74 curXparams += "=\"" + this.params[i][1] + "\""; 74 75 } else { … … 104 105 } 105 106 } 107 106 108 // add or update the xproperty: 107 109 var xprop = new BwXProperty(name, params, value); 108 if (isUnique && this.contains(name)) {110 if (isUnique) { 109 111 index = this.getIndex(name); 110 xproperties.splice(index,1,xprop); 112 if (index < 0) { 113 xproperties.push(xprop); 114 } else { 115 xproperties.splice(index,1,xprop); 116 } 111 117 } else { 112 118 xproperties.push(xprop); 113 119 } 114 }115 116 this.contains = function(name) {117 for (var i = 0; i < xproperties.length; i++) {118 var curXprop = xproperties[i];119 if (curXprop.name == name) {120 return true;121 }122 }123 return false;124 120 } 125 121 … … 131 127 } 132 128 } 133 return null;129 return -1; 134 130 } 131 135 132 136 133 this.generate = function(formObj) { trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl
r1852 r1857 178 178 } 179 179 function initXProperties() { 180 <xsl:for-each select=" form/xproperties/node()">181 bwX props.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']</xsl:for-each>],"<xsl:value-of select="values/text"/>");180 <xsl:for-each select="/bedework/formElements/form/xproperties/node()"> 181 bwXProps.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>],'<xsl:call-template name="escapeApos"><xsl:with-param name="str"><xsl:value-of select="values/text"/></xsl:with-param></xsl:call-template>'); 182 182 </xsl:for-each> 183 183 } … … 1493 1493 </xsl:template> 1494 1494 1495 <!--==== FOOTER ====--> 1496 <xsl:template name="footer"> 1497 <div id="footer"> 1498 Demonstration calendar; place footer information here. 1499 </div> 1500 <div id="subfoot"> 1501 <a href="http://www.bedework.org/">Bedework Website</a> | 1502 <a href="?noxslt=yes">show XML</a> | 1503 <a href="?refreshXslt=yes">refresh XSLT</a> 1504 </div> 1505 </xsl:template> 1506 1507 <!--==== Utility Templates ====--> 1508 1509 <xsl:template name="escapeApos"> 1510 <xsl:param name="str"/> 1511 <xsl:variable name="apos" select='"'"'/> 1512 <xsl:choose> 1513 <xsl:when test="contains($str, $apos)"> 1514 <xsl:value-of select="substring-before($str, $apos)" /> 1515 <xsl:text>\'</xsl:text> 1516 <xsl:call-template name="escapeApos"> 1517 <xsl:with-param name="str" select="substring-after($str, $apos)" /> 1518 </xsl:call-template> 1519 </xsl:when> 1520 <xsl:otherwise> 1521 <xsl:value-of select="$str" /> 1522 </xsl:otherwise> 1523 </xsl:choose> 1524 </xsl:template> 1525 1495 1526 <!-- search and replace template taken from 1496 http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->1527 http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> 1497 1528 <xsl:template name="replace"> 1498 1529 <xsl:param name="string" select="''"/> … … 1514 1545 </xsl:choose> 1515 1546 </xsl:template> 1516 1517 <!--==== FOOTER ====-->1518 <xsl:template name="footer">1519 <div id="footer">1520 Demonstration calendar; place footer information here.1521 </div>1522 <div id="subfoot">1523 <a href="http://www.bedework.org/">Bedework Website</a> |1524 <a href="?noxslt=yes">show XML</a> |1525 <a href="?refreshXslt=yes">refresh XSLT</a>1526 </div>1527 </xsl:template>1528 1547 </xsl:stylesheet> trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkXProperties.js
r1852 r1857 70 70 if (this.params[i][1] != "") { 71 71 curXparams += ";" + this.params[i][0]; 72 // if parameter values contain ";" or ":" they must be quoted73 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 ) {72 // if parameter values contain ";" or ":" or "," they must be quoted 73 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 || this.params[i][1].indexOf(",") != -1) { 74 74 curXparams += "=\"" + this.params[i][1] + "\""; 75 75 } else { … … 105 105 } 106 106 } 107 107 108 // add or update the xproperty: 108 109 var xprop = new BwXProperty(name, params, value); 109 if (isUnique && this.contains(name)) {110 if (isUnique) { 110 111 index = this.getIndex(name); 111 xproperties.splice(index,1,xprop); 112 if (index < 0) { 113 xproperties.push(xprop); 114 } else { 115 xproperties.splice(index,1,xprop); 116 } 112 117 } else { 113 118 xproperties.push(xprop); 114 119 } 115 }116 117 this.contains = function(name) {118 for (var i = 0; i < xproperties.length; i++) {119 var curXprop = xproperties[i];120 if (curXprop.name == name) {121 return true;122 }123 }124 return false;125 120 } 126 121 … … 132 127 } 133 128 } 134 return null;129 return -1; 135 130 } 131 136 132 137 133 this.generate = function(formObj) { trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl
r1853 r1857 405 405 } 406 406 function initXProperties() { 407 <xsl:for-each select=" form/xproperties/node()">408 bwX props.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']</xsl:for-each>],"<xsl:value-of select="values/text"/>");407 <xsl:for-each select="/bedework/formElements/form/xproperties/node()"> 408 bwXProps.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>],'<xsl:call-template name="escapeApos"><xsl:with-param name="str"><xsl:value-of select="values/text"/></xsl:with-param></xsl:call-template>'); 409 409 </xsl:for-each> 410 410 } … … 7964 7964 --></xsl:template> 7965 7965 7966 <!-- search and replace template taken from7967 http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->7968 <xsl:template name="replace">7969 <xsl:param name="string" select="''"/>7970 <xsl:param name="pattern" select="''"/>7971 <xsl:param name="replacement" select="''"/>7972 <xsl:choose>7973 <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">7974 <xsl:value-of select="substring-before($string, $pattern)"/>7975 <xsl:copy-of select="$replacement"/>7976 <xsl:call-template name="replace">7977 <xsl:with-param name="string" select="substring-after($string, $pattern)"/>7978 <xsl:with-param name="pattern" select="$pattern"/>7979 <xsl:with-param name="replacement" select="$replacement"/>7980 </xsl:call-template>7981 </xsl:when>7982 <xsl:otherwise>7983 <xsl:value-of select="$string"/>7984 </xsl:otherwise>7985 </xsl:choose>7986 </xsl:template>7987 7988 7966 <!--==== FOOTER ====--> 7989 7967 <xsl:template name="footer"> … … 8012 7990 </table> 8013 7991 </xsl:template> 7992 7993 <!--==== Utility Templates ====--> 7994 7995 <xsl:template name="escapeApos"> 7996 <xsl:param name="str"/> 7997 <xsl:variable name="apos" select='"'"'/> 7998 <xsl:choose> 7999 <xsl:when test="contains($str, $apos)"> 8000 <xsl:value-of select="substring-before($str, $apos)" /> 8001 <xsl:text>\'</xsl:text> 8002 <xsl:call-template name="escapeApos"> 8003 <xsl:with-param name="str" select="substring-after($str, $apos)" /> 8004 </xsl:call-template> 8005 </xsl:when> 8006 <xsl:otherwise> 8007 <xsl:value-of select="$str" /> 8008 </xsl:otherwise> 8009 </xsl:choose> 8010 </xsl:template> 8011 8012 <!-- search and replace template taken from 8013 http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> 8014 <xsl:template name="replace"> 8015 <xsl:param name="string" select="''"/> 8016 <xsl:param name="pattern" select="''"/> 8017 <xsl:param name="replacement" select="''"/> 8018 <xsl:choose> 8019 <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> 8020 <xsl:value-of select="substring-before($string, $pattern)"/> 8021 <xsl:copy-of select="$replacement"/> 8022 <xsl:call-template name="replace"> 8023 <xsl:with-param name="string" select="substring-after($string, $pattern)"/> 8024 <xsl:with-param name="pattern" select="$pattern"/> 8025 <xsl:with-param name="replacement" select="$replacement"/> 8026 </xsl:call-template> 8027 </xsl:when> 8028 <xsl:otherwise> 8029 <xsl:value-of select="$string"/> 8030 </xsl:otherwise> 8031 </xsl:choose> 8032 </xsl:template> 8014 8033 </xsl:stylesheet> trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkXProperties.js
r1852 r1857 46 46 var bwXParamEmail = "X-BEDEWORK-PARAM-EMAIL"; 47 47 48 48 49 // ======================================================================== 49 50 // x-property functions … … 69 70 if (this.params[i][1] != "") { 70 71 curXparams += ";" + this.params[i][0]; 71 // if parameter values contain ";" or ":" they must be quoted72 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 ) {72 // if parameter values contain ";" or ":" or "," they must be quoted 73 if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 || this.params[i][1].indexOf(",") != -1) { 73 74 curXparams += "=\"" + this.params[i][1] + "\""; 74 75 } else { … … 104 105 } 105 106 } 107 106 108 // add or update the xproperty: 107 109 var xprop = new BwXProperty(name, params, value); 108 if (isUnique && this.contains(name)) {110 if (isUnique) { 109 111 index = this.getIndex(name); 110 xproperties.splice(index,1,xprop); 112 if (index < 0) { 113 xproperties.push(xprop); 114 } else { 115 xproperties.splice(index,1,xprop); 116 } 111 117 } else { 112 118 xproperties.push(xprop); 113 119 } 114 }115 116 this.contains = function(name) {117 for (var i = 0; i < xproperties.length; i++) {118 var curXprop = xproperties[i];119 if (curXprop.name == name) {120 return true;121 }122 }123 return false;124 120 } 125 121 … … 131 127 } 132 128 } 133 return null;129 return -1; 134 130 } 131 135 132 136 133 this.generate = function(formObj) {
