You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gr...@apache.org on 2007/08/14 23:42:54 UTC

svn commit: r565929 - in /myfaces: maven/trunk/master-pom/ site/trunk/src/site/xdoc/project_management/ tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/ tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfa...

Author: grantsmith
Date: Tue Aug 14 14:42:53 2007
New Revision: 565929

URL: http://svn.apache.org/viewvc?view=rev&rev=565929
Log:
patch applied for TOMAHAWK-1077

Added:
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength_ar.properties
Modified:
    myfaces/maven/trunk/master-pom/pom.xml
    myfaces/site/trunk/src/site/xdoc/project_management/contributors.xml
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength.properties
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/css/passwordStrength.css
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/passwordStrength.js

Modified: myfaces/maven/trunk/master-pom/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/maven/trunk/master-pom/pom.xml?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/maven/trunk/master-pom/pom.xml (original)
+++ myfaces/maven/trunk/master-pom/pom.xml Tue Aug 14 14:42:53 2007
@@ -494,6 +494,14 @@
               <role>Schedule</role>
            </roles>
         </contributor>
+        <contributor>
+           <name>Hazem Saleh</name>
+           <email>Hazem.saleh@gmail.com</email>           
+           <roles>
+              <role>PasswordStrength</role>
+           </roles>
+            <timezone>+2</timezone>           
+        </contributor>        
     </contributors>
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/maven/trunk/master-pom</connection>

Modified: myfaces/site/trunk/src/site/xdoc/project_management/contributors.xml
URL: http://svn.apache.org/viewvc/myfaces/site/trunk/src/site/xdoc/project_management/contributors.xml?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/site/trunk/src/site/xdoc/project_management/contributors.xml (original)
+++ myfaces/site/trunk/src/site/xdoc/project_management/contributors.xml Tue Aug 14 14:42:53 2007
@@ -195,6 +195,7 @@
             <tr><td colspan="1" rowspan="1">Jesse Wilson (NewspaperDataTable)</td></tr>
             <tr><td colspan="1" rowspan="1">Find all <a href="http://wiki.apache.org/myfaces/Acknowledgements/">Acknowlegdgements</a>
                 to our great user community on our WIKI.</td></tr>
+            <tr><td colspan="1" rowspan="1">Hazem Saleh (PasswordStrength Component)</td></tr>                
       </table>
     </section>
 
@@ -202,4 +203,4 @@
 
     
 
-</document>
\ No newline at end of file
+</document>

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRenderer.java?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRenderer.java Tue Aug 14 14:42:53 2007
@@ -144,6 +144,13 @@
 				.getDetail();
 	}
 	
+	private String getLeftCharactersString() {
+		return "'" + MessageUtils.getMessage(BUNDLE_BASE_NAME,
+				MessageUtils.getCurrentLocale(),
+				"org.apache.myfaces.custom.passwordStrength.LEFT_CHARS", null)
+				.getDetail() + "'";		
+	}
+	
 	private String getDefaultStrengthIndicatorType() {
 		return TextIndicatorType.TEXT;
 	}	
@@ -341,7 +348,7 @@
 								 indicatorMessageID, leftCharsMessageID,
 								 showMessageIndicatorString, 
 								 strengthIndicatorType, progressBarId,
-								 showDetails);
+								 showDetails, getLeftCharactersString());
 	}
 	
 	private String updateStatusValue(String textID, String preferredLength,
@@ -349,13 +356,14 @@
 									 String indicatorMessageID, String leftCharsMessageID,									 
 									 String showMessageIndicatorString, 
 									 String strengthIndicatorType, String progressBarId, 
-									 String showDetails) {
+									 String showDetails, String leftCharactersString) {
 		return "updateStatusValue(" 
 				+ textID + "," + preferredLength + ", "
 				+ prefix + ", " + textStrengthDescriptions + ", " 
 				+ indicatorMessageID + ", " + leftCharsMessageID + ", "				
 				+ strengthIndicatorType + ", " + progressBarId + ", " 				
-				+ showDetails + ");"
+				+ showDetails + ", "
+				+ leftCharactersString + ");"			
 				+ showMessageIndicatorString;
 	}
 	

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength.properties
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength.properties?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength.properties (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength.properties Tue Aug 14 14:42:53 2007
@@ -1,2 +1,3 @@
 org.apache.myfaces.custom.passwordStrength.DESC = Very Poor;Weak;Average;Strong;Excellent
 org.apache.myfaces.custom.passwordStrength.PREFIX = Strength :
+org.apache.myfaces.custom.passwordStrength.LEFT_CHARS = characters are left

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength_ar.properties
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength_ar.properties?view=auto&rev=565929
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength_ar.properties (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/PasswordStrength_ar.properties Tue Aug 14 14:42:53 2007
@@ -0,0 +1,3 @@
+org.apache.myfaces.custom.passwordStrength.DESC = \u0636\u0639\u064a\u0641\u0629 \u062c\u062f\u0627;\u0636\u0639\u064a\u0641\u0629;\u0645\u062a\u0648\u0633\u0637\u0629;\u0642\u0648\u064a\u0629;\u0642\u0648\u064a\u0629 \u062c\u062f\u0627
+org.apache.myfaces.custom.passwordStrength.PREFIX = \u0627\u0644\u062f\u0631\u062c\u0629 : 
+org.apache.myfaces.custom.passwordStrength.LEFT_CHARS = : \u0639\u062f\u062f \u0627\u0644\u062d\u0631\u0648\u0641 \u0627\u0644\u0645\u062a\u0628\u0642\u064a\u0629 

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/css/passwordStrength.css
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/css/passwordStrength.css?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/css/passwordStrength.css (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/css/passwordStrength.css Tue Aug 14 14:42:53 2007
@@ -1,2 +1,2 @@
-.indicatorMessage { color:white; background:gray; font-size: 12px; padding: 3; font-style: italic;
+.indicatorMessage { color:white; background:gray; font-size: 12px; padding: 3; 
 } 

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/passwordStrength.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/passwordStrength.js?view=diff&rev=565929&r1=565928&r2=565929
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/passwordStrength.js (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/passwordStrength/resource/passwordStrength.js Tue Aug 14 14:42:53 2007
@@ -26,7 +26,7 @@
 						   prefixText, passwordDesc, 
 						   indicatorMessageID, leftCharsMessageID, 
 						   strengthIndicatorType, progressBarId, 
-						   showDetails) {				   
+						   showDetails, leftCharactersString) {				   
     //Get the current message content ...
     var content = document.getElementById(textID).value;
     var currentStatus = prefixText;
@@ -39,6 +39,7 @@
 	    //Check the contents ...   
 	    var tokens = passwordDesc.split(";");
 	    var length = tokens.length;
+	    //Here we will calc the password strength ratio based on length + custom rule work ...
 	    //Calc the delta of char changes : diff = preferredLength / tokens;
 	    var delta = preferredLength / length;
 	    var change = delta;
@@ -74,7 +75,7 @@
     } else if(showDetails == "true" && content.length < preferredLength) {
         show(leftCharsMessageID);
 	diff = (preferredLength - content.length);
-	var charLeft = diff + " characters are left";
+	var charLeft = diff + " " + leftCharactersString;
       if(document.all) { 
              document.getElementById(leftCharsMessageID).innerText = charLeft;
       } else {