Changeset 1857

Show
Ignore:
Timestamp:
04/23/08 17:19:27
Author:
johnsa
Message:

web clients: more xprop support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r1852 r1857  
    246246            } 
    247247            function initXProperties() { 
    248               <xsl:for-each select="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: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>'); 
    250250              </xsl:for-each> 
    251251            } 
     
    10611061        <a href="javascript:bwSubmitComment.launch();" class="toggle">pop-up</a> 
    10621062        <div id="bwSubmittedEventComment"> 
     1063          <xsl:if test="/bedework/page = 'modEvent'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
    10631064        </div> 
    10641065      </div> 
     
    12811282              <xsl:choose> 
    12821283                <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');"/> 
    12841285                </xsl:when> 
    12851286                <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');"/> 
    12871288                </xsl:otherwise> 
    12881289              </xsl:choose> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkXProperties.js

    r1852 r1857  
    4646var bwXParamEmail = "X-BEDEWORK-PARAM-EMAIL"; 
    4747 
     48 
    4849// ======================================================================== 
    4950// x-property functions 
     
    6970        if (this.params[i][1] != "") { 
    7071          curXparams += ";" + this.params[i][0]; 
    71           // if parameter values contain ";" or ":" they must be quoted 
    72           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) { 
    7374            curXparams += "=\"" + this.params[i][1] + "\""; 
    7475          } else { 
     
    104105      } 
    105106    } 
     107 
    106108    // add or update the xproperty: 
    107109    var xprop = new BwXProperty(name, params, value); 
    108     if (isUnique && this.contains(name)) { 
     110    if (isUnique) { 
    109111      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      } 
    111117    } else { 
    112118      xproperties.push(xprop); 
    113119    } 
    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; 
    124120  } 
    125121 
     
    131127      } 
    132128    } 
    133     return null
     129    return -1
    134130  } 
     131 
    135132 
    136133  this.generate = function(formObj) { 
  • trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

    r1852 r1857  
    178178      } 
    179179      function initXProperties() { 
    180         <xsl:for-each select="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: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>'); 
    182182        </xsl:for-each> 
    183183      } 
     
    14931493  </xsl:template> 
    14941494 
     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='"&apos;"'/> 
     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 
    14951526  <!-- 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 --> 
    14971528  <xsl:template name="replace"> 
    14981529    <xsl:param name="string" select="''"/> 
     
    15141545    </xsl:choose> 
    15151546  </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> 
    15281547</xsl:stylesheet> 
  • trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkXProperties.js

    r1852 r1857  
    7070        if (this.params[i][1] != "") { 
    7171          curXparams += ";" + this.params[i][0]; 
    72           // if parameter values contain ";" or ":" they must be quoted 
    73           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) { 
    7474            curXparams += "=\"" + this.params[i][1] + "\""; 
    7575          } else { 
     
    105105      } 
    106106    } 
     107 
    107108    // add or update the xproperty: 
    108109    var xprop = new BwXProperty(name, params, value); 
    109     if (isUnique && this.contains(name)) { 
     110    if (isUnique) { 
    110111      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      } 
    112117    } else { 
    113118      xproperties.push(xprop); 
    114119    } 
    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; 
    125120  } 
    126121 
     
    132127      } 
    133128    } 
    134     return null
     129    return -1
    135130  } 
     131 
    136132 
    137133  this.generate = function(formObj) { 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1853 r1857  
    405405        } 
    406406        function initXProperties() { 
    407           <xsl:for-each select="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: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>'); 
    409409          </xsl:for-each> 
    410410        } 
     
    79647964--></xsl:template> 
    79657965 
    7966   <!-- search and replace template taken from 
    7967        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  
    79887966  <!--==== FOOTER ====--> 
    79897967  <xsl:template name="footer"> 
     
    80127990    </table> 
    80137991  </xsl:template> 
     7992 
     7993  <!--==== Utility Templates ====--> 
     7994 
     7995  <xsl:template name="escapeApos"> 
     7996    <xsl:param name="str"/> 
     7997    <xsl:variable name="apos" select='"&apos;"'/> 
     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> 
    80148033</xsl:stylesheet> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkXProperties.js

    r1852 r1857  
    4646var bwXParamEmail = "X-BEDEWORK-PARAM-EMAIL"; 
    4747 
     48 
    4849// ======================================================================== 
    4950// x-property functions 
     
    6970        if (this.params[i][1] != "") { 
    7071          curXparams += ";" + this.params[i][0]; 
    71           // if parameter values contain ";" or ":" they must be quoted 
    72           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) { 
    7374            curXparams += "=\"" + this.params[i][1] + "\""; 
    7475          } else { 
     
    104105      } 
    105106    } 
     107 
    106108    // add or update the xproperty: 
    107109    var xprop = new BwXProperty(name, params, value); 
    108     if (isUnique && this.contains(name)) { 
     110    if (isUnique) { 
    109111      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      } 
    111117    } else { 
    112118      xproperties.push(xprop); 
    113119    } 
    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; 
    124120  } 
    125121 
     
    131127      } 
    132128    } 
    133     return null
     129    return -1
    134130  } 
     131 
    135132 
    136133  this.generate = function(formObj) {