Changeset 3508

Show
Ignore:
Timestamp:
03/14/12 16:20:17
Author:
johnsa
Message:

admin client: force character limit on event description, show characters remaining as user types

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/default/default/default.css

    r3507 r3508  
    489489  width: 140px; 
    490490} 
     491#remainingChars { 
     492        margin-left: 2em; 
     493} 
    491494#eventFormImage { 
    492495  margin-bottom: 0.5em; 
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/default/default/default.xsl

    r3507 r3508  
    376376            $(document).ready(function(){ 
    377377 
    378                     <xsl:if test="/bedework/formElements/recurrenceId = ''"> 
     378                  <xsl:if test="/bedework/formElements/recurrenceId = ''"> 
    379379                initRXDates(); 
    380380              </xsl:if> 
     
    386386                // trim the event description: 
    387387                $("#description").val($.trim($("#description").val())); 
     388                 
     389                // limit the event description to maxPublicDescriptionLength as configured in cal.options.xml 
     390                $("#description").keyup(function(){   
     391                  var maxDescLength = parseInt(<xsl:value-of select="/bedework/formElements/form/descLength"/>);   
     392                  var desc = $(this).val();   
     393                  var remainingChars = maxDescLength - desc.length; 
     394                  if (remainingChars &lt; 0) { 
     395                    remainingChars = 0; 
     396                  } 
     397                  $("#remainingChars").html(remainingChars + " <xsl:value-of select="$bwStr-AEEF-CharsRemaining"/>");  
     398                  if(desc.length > maxDescLength){   
     399                    var truncDesc = desc.substr(0, maxDescLength);   
     400                    $(this).val(truncDesc);  
     401                  };   
     402                });   
     403                 
    388404              </xsl:if> 
    389405                             
     
    24782494              <xsl:if test="$canEdit = 'false'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
    24792495              <span class="maxCharNotice"><xsl:value-of select="form/descLength"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AEEF-CharsMax"/></span> 
     2496              <span id="remainingChars">&#160;</span> 
    24802497            </div> 
    24812498            <xsl:if test="$canEdit = 'false'"> 
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/default/default/strings.xsl

    r3507 r3508  
    246246  <xsl:variable name="bwStr-AEEF-EnterPertientInfo">Enter a brief description of the event</xsl:variable> 
    247247  <xsl:variable name="bwStr-AEEF-CharsMax">characters max.</xsl:variable> 
     248  <xsl:variable name="bwStr-AEEF-CharsRemaining">character(s) remaining.</xsl:variable> 
    248249  <xsl:variable name="bwStr-AEEF-Cost">Cost:</xsl:variable> 
    249250  <xsl:variable name="bwStr-AEEF-OptionalPlaceToPurchaseTicks">optional: if any, and place to purchase tickets</xsl:variable> 
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/es_ES/default/default.css

    r3507 r3508  
    489489  width: 140px; 
    490490} 
     491#remainingChars { 
     492        margin-left: 2em; 
     493} 
    491494#eventFormImage { 
    492495  margin-bottom: 0.5em; 
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/es_ES/default/default.xsl

    r3507 r3508  
    386386                // trim the event description: 
    387387                $("#description").val($.trim($("#description").val())); 
     388                 
     389                // limit the event description to maxPublicDescriptionLength as configured in cal.options.xml 
     390                $("#description").keyup(function(){   
     391                  var maxDescLength = parseInt(<xsl:value-of select="/bedework/formElements/form/descLength"/>);   
     392                  var desc = $(this).val();   
     393                  var remainingChars = maxDescLength - desc.length; 
     394                  if (remainingChars &lt; 0) { 
     395                    remainingChars = 0; 
     396                  } 
     397                  $("#remainingChars").html(remainingChars + " <xsl:value-of select="$bwStr-AEEF-CharsRemaining"/>");  
     398                  if(desc.length > maxDescLength){   
     399                    var truncDesc = desc.substr(0, maxDescLength);   
     400                    $(this).val(truncDesc);  
     401                  };   
     402                });   
     403                 
    388404              </xsl:if> 
    389405 
     
    24792495              <xsl:if test="$canEdit = 'false'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
    24802496              <span class="maxCharNotice"><xsl:value-of select="form/descLength"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AEEF-CharsMax"/></span> 
     2497              <span id="remainingChars">&#160;</span> 
    24812498            </div> 
    24822499            <xsl:if test="$canEdit = 'false'"> 
  • releases/bedework-3.8/deployment/webadmin/webapp/resources/es_ES/default/strings.xsl

    r3507 r3508  
    246246  <xsl:variable name="bwStr-AEEF-EnterPertientInfo">Introduzca toda la información pertinente</xsl:variable> 
    247247  <xsl:variable name="bwStr-AEEF-CharsMax">caracteres max.)</xsl:variable> 
     248  <xsl:variable name="bwStr-AEEF-CharsRemaining">caracter(es) remanente.</xsl:variable> 
    248249  <xsl:variable name="bwStr-AEEF-Cost">Coste:</xsl:variable> 
    249250  <xsl:variable name="bwStr-AEEF-OptionalPlaceToPurchaseTicks">opcional: si lo hay, y el lugar para obtener las entradas</xsl:variable> 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.css

    r3507 r3508  
    489489  width: 140px; 
    490490} 
     491#remainingChars { 
     492        margin-left: 2em; 
     493} 
    491494#eventFormImage { 
    492495  margin-bottom: 0.5em; 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r3507 r3508  
    376376            $(document).ready(function(){ 
    377377 
    378                     <xsl:if test="/bedework/formElements/recurrenceId = ''"> 
     378                  <xsl:if test="/bedework/formElements/recurrenceId = ''"> 
    379379                initRXDates(); 
    380380              </xsl:if> 
     
    386386                // trim the event description: 
    387387                $("#description").val($.trim($("#description").val())); 
     388                 
     389                // limit the event description to maxPublicDescriptionLength as configured in cal.options.xml 
     390                $("#description").keyup(function(){   
     391                  var maxDescLength = parseInt(<xsl:value-of select="/bedework/formElements/form/descLength"/>);   
     392                  var desc = $(this).val();   
     393                  var remainingChars = maxDescLength - desc.length; 
     394                  if (remainingChars &lt; 0) { 
     395                    remainingChars = 0; 
     396                  } 
     397                  $("#remainingChars").html(remainingChars + " <xsl:value-of select="$bwStr-AEEF-CharsRemaining"/>");  
     398                  if(desc.length > maxDescLength){   
     399                    var truncDesc = desc.substr(0, maxDescLength);   
     400                    $(this).val(truncDesc);  
     401                  };   
     402                });   
     403                 
    388404              </xsl:if> 
    389405                             
     
    24782494              <xsl:if test="$canEdit = 'false'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
    24792495              <span class="maxCharNotice"><xsl:value-of select="form/descLength"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AEEF-CharsMax"/></span> 
     2496              <span id="remainingChars">&#160;</span> 
    24802497            </div> 
    24812498            <xsl:if test="$canEdit = 'false'"> 
  • trunk/deployment/webadmin/webapp/resources/default/default/strings.xsl

    r3507 r3508  
    246246  <xsl:variable name="bwStr-AEEF-EnterPertientInfo">Enter a brief description of the event</xsl:variable> 
    247247  <xsl:variable name="bwStr-AEEF-CharsMax">characters max.</xsl:variable> 
     248  <xsl:variable name="bwStr-AEEF-CharsRemaining">character(s) remaining.</xsl:variable> 
    248249  <xsl:variable name="bwStr-AEEF-Cost">Cost:</xsl:variable> 
    249250  <xsl:variable name="bwStr-AEEF-OptionalPlaceToPurchaseTicks">optional: if any, and place to purchase tickets</xsl:variable> 
  • trunk/deployment/webadmin/webapp/resources/es_ES/default/default.css

    r3507 r3508  
    489489  width: 140px; 
    490490} 
     491#remainingChars { 
     492        margin-left: 2em; 
     493} 
    491494#eventFormImage { 
    492495  margin-bottom: 0.5em; 
  • trunk/deployment/webadmin/webapp/resources/es_ES/default/default.xsl

    r3507 r3508  
    386386                // trim the event description: 
    387387                $("#description").val($.trim($("#description").val())); 
     388                 
     389                // limit the event description to maxPublicDescriptionLength as configured in cal.options.xml 
     390                $("#description").keyup(function(){   
     391                  var maxDescLength = parseInt(<xsl:value-of select="/bedework/formElements/form/descLength"/>);   
     392                  var desc = $(this).val();   
     393                  var remainingChars = maxDescLength - desc.length; 
     394                  if (remainingChars &lt; 0) { 
     395                    remainingChars = 0; 
     396                  } 
     397                  $("#remainingChars").html(remainingChars + " <xsl:value-of select="$bwStr-AEEF-CharsRemaining"/>");  
     398                  if(desc.length > maxDescLength){   
     399                    var truncDesc = desc.substr(0, maxDescLength);   
     400                    $(this).val(truncDesc);  
     401                  };   
     402                });   
     403                 
    388404              </xsl:if> 
    389405 
     
    24792495              <xsl:if test="$canEdit = 'false'"><xsl:attribute name="class">invisible</xsl:attribute></xsl:if> 
    24802496              <span class="maxCharNotice"><xsl:value-of select="form/descLength"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AEEF-CharsMax"/></span> 
     2497              <span id="remainingChars">&#160;</span> 
    24812498            </div> 
    24822499            <xsl:if test="$canEdit = 'false'"> 
  • trunk/deployment/webadmin/webapp/resources/es_ES/default/strings.xsl

    r3507 r3508  
    246246  <xsl:variable name="bwStr-AEEF-EnterPertientInfo">Introduzca toda la información pertinente</xsl:variable> 
    247247  <xsl:variable name="bwStr-AEEF-CharsMax">caracteres max.)</xsl:variable> 
     248  <xsl:variable name="bwStr-AEEF-CharsRemaining">caracter(es) remanente.</xsl:variable> 
    248249  <xsl:variable name="bwStr-AEEF-Cost">Coste:</xsl:variable> 
    249250  <xsl:variable name="bwStr-AEEF-OptionalPlaceToPurchaseTicks">opcional: si lo hay, y el lugar para obtener las entradas</xsl:variable>