[Registry-dev] svn commit r16478 - in trunk/registry/modules/webapps/src/main/webapp/admin: . ajax css js

svn at wso2.org svn at wso2.org
Fri May 2 04:12:23 PDT 2008


Author: chanaka
Date: Fri May  2 04:12:10 2008
New Revision: 16478

Log:

1 - IE issues raised by the resent validation changes in the UI are fixed.
2 - Missing validations were added for UI
3 - Text Trimmed error is fixed on user edit page

Modified:
   trunk/registry/modules/webapps/src/main/webapp/admin/advanced-search.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/ajax/user-password-edit.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/css/main.css
   trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js
   trunk/registry/modules/webapps/src/main/webapp/admin/js/validation.js
   trunk/registry/modules/webapps/src/main/webapp/admin/recent-activity.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/search.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/advanced-search.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/advanced-search.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/advanced-search.jsp	Fri May  2 04:12:10 2008
@@ -65,37 +65,18 @@
 <div class="content">
 
 <h1 class="headding-search">Advanced Search</h1>
+
 <div id="advSearchReason" class="validationError" style="display: none;"></div>
             
 <div class="box1-mid" id="userExpanded">
 <form id="advancedSearchForm" name="advancedSearch" onsubmit="return submitAdvSearchForm()" action="/wso2registry/system/search/advanced" method="get">
-<%--<table cellpadding="0" cellspacing="0" border="0" class="form-table">--%>
-<%--<tr>--%>
-<%--<td class="leftColumn">Search For</td>--%>
-<%--<td>--%>
-<%--<select name="" id="searchFor" onchange="showHideSearch();">--%>
-<%--<option value="0">Resource</option>--%>
-<%--<option value="1">Comments</option>--%>
-<%--</select>--%>
-
-<%--</td>--%>
-<%--</tr>--%>
-<%--</table>--%>
-
-
-
 <div id="resourceForm">
-
-
     <table cellpadding="0" cellspacing="0" border="0" style="width:100%" class="form-table" >
         <tr>
             <td class="leftColumn">Resource Name</td>
             <td>
                 <input type="text" name="resourcePath" value="" id="#_resourceName" style="width:100px;"/>
-
-
             </td>
-
         </tr>
         <tr>
             <td valign="top">Created</td>
@@ -167,7 +148,7 @@
         <tr>
             <td>Updated by</td>
             <td>
-                <input type="text" name="updater" value="" id="#_author"/>
+                <input type="text" name="updater" value="" id="#_updater"/>
 
 
             </td>
@@ -254,8 +235,6 @@
         <td class="leftColumn"></td>
         <td>
             <input type="button" id="#_0" value="Search" class="button" onclick="submitAdvSearchForm()" />
-
-
         </td>
     </tr>
 

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/ajax/user-password-edit.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/ajax/user-password-edit.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/ajax/user-password-edit.jsp	Fri May  2 04:12:10 2008
@@ -25,7 +25,7 @@
             </td>
         </tr>
         <tr id="passwordEdit1" style="display:none;">
-            <td style="width:140px"><h3 style="margin-bottom:0px;">Editing Password:</h3></td>
+            <td style="width:140px;*margin-left:-10px;"><h3 style="margin-bottom:0px;*margin-left:0px;">Editing Password:</h3></td>
             <td style="text-align:right;width:20px;" align="right">
                 <a onclick="saveNewPassword('<%=userDetailsAction.getUserName()%>')" title="Save Password" href="#">
                     <img border="0" align="bottom" src="/wso2registry/admin/images/save-button.gif"/>

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/css/main.css
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/css/main.css	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/css/main.css	Fri May  2 04:12:10 2008
@@ -723,6 +723,7 @@
 font-size:13px;
 *position:absolute;
 *right:400px;
+*width:150px;
 }
 #propertiesAddDiv{
 padding-left:10px;

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js	Fri May  2 04:12:10 2008
@@ -181,7 +181,7 @@
     	new Ajax.Updater('commentList', '/wso2registry/system/addComment', { method: 'post', parameters: {comment: comment, resourcePath: resourcePath} });
     	commentElement.value = '';
     	reasonDiv.style.display="none";
-    	commentElement.style.background="#ffffff;";
+    	commentElement.style.background="White";
     	showHideCommon('add-comment-div');
     }else{
     	reasonDiv.innerHTML=reason;
@@ -407,7 +407,7 @@
 }
 function cleanField(fld){
 fld.value="";
-fld.style.background="#ffffff;";
+fld.style.background="White";
 }
 function setProperty() {
     var reason="";
@@ -453,9 +453,19 @@
     new Ajax.Updater('associationDiv','/wso2registry/system/addAssociation', {method:'post',parameters:{resourcePath:resourcePath,type:type,associationPaths:associationPaths}})  ;
 }
 function renameResource(parentPath, oldResourcePath, resourceEditDivID) {
-
-    var newName = document.getElementById(resourceEditDivID).value;
-    new Ajax.Updater('entryList', '/wso2registry/system/renameResource', { method: 'post', parameters: {parentPath: parentPath, oldResourcePath: oldResourcePath, newName: newName} });
+    var reason="";
+    var reasonDiv=$('entryListReason');
+    
+    reason += validateForInput($(resourceEditDivID),"New Resource Name");
+    if(reason!=""){
+    	reasonDiv.style.display="block";
+    	reasonDiv.innerHTML=reason;
+    	return false;
+    }else{
+	var newName = document.getElementById(resourceEditDivID).value;
+	new Ajax.Updater('entryList', '/wso2registry/system/renameResource', { method: 'post', parameters: {parentPath: parentPath, oldResourcePath: oldResourcePath, newName: newName} });
+    }
+    
 }
 
 function saveFriendlyName(userName) {
@@ -503,8 +513,8 @@
         showHideCommon('passwordEdit2');
         showHideCommon('passwordEdit3');
         reasonDiv.style.display="none";
-	$('newPassword').style.background="#ffffff";
-    	$('newPasswordConfirm').style.background="#ffffff";
+	$('newPassword').style.background="White";
+    	$('newPasswordConfirm').style.background="White";
     		
         new Ajax.Updater('passwordDiv', '/wso2registry/system/saveNewPassword', { method: 'post', parameters: {userName: userName, newPassword: newPassword} });
     }
@@ -659,8 +669,8 @@
  		reason+="Please make sure Password and Confirm Password fields are matching.<br />";
  	}
  	else{
- 		$('confirmedPassword').style.background="#ffffff";
- 		$('passwordMain').style.background="#ffffff";
+ 		$('confirmedPassword').style.background="White";
+ 		$('passwordMain').style.background="White";
  	}
  	reason +=validateForInput($('friendlyName'),"Display name");
  	reasonDiv.innerHTML=reason;
@@ -711,7 +721,13 @@
  	if($('#_cfromDate').value!="") reason +=validateDate($('#_cfromDate'),"From");
  	if($('#_ctoDate').value!="") reason +=validateDate($('#_ctoDate'),"To");
  	if($('#_ufromDate').value!="") reason +=validateDate($('#_ufromDate'),"From");
- 	if($('#_utoDate').value!="") reason +=validateDate($('#_utoDate'),"From");
+ 	if($('#_utoDate').value!="") reason +=validateDate($('#_utoDate'),"To");
+ 	if($('#_resourceName').value!="") reason +=validateForInput($('#_resourceName'),"Resource Name");
+ 	if($('#_author').value!="") reason +=validateForInput($('#_author'),"Created by");
+ 	if($('#_updater').value!="") reason +=validateForInput($('#_updater'),"Updated by");
+ 	if($('#_tags').value!="") reason +=validateForInput($('#_tags'),"Tags");
+ 	if($('#_comments').value!="") reason +=validateForInput($('#_comments'),"Comments");
+ 	
  	reasonDiv.innerHTML=reason;
  	if(reason!="") {
  		reasonDiv.style.display="block";
@@ -728,6 +744,8 @@
  	
  	if($('fromDate').value!="") reason +=validateDate($('fromDate'),"From");
  	if($('toDate').value!="") reason +=validateDate($('toDate'),"To");
+ 	if($('userName').value!="") reason +=validateForInput($('userName'),"Username");
+ 	if($('path').value!="") reason +=validateForInput($('path'),"Path");
 
  	reasonDiv.innerHTML=reason;
  	if(reason!="") {
@@ -778,18 +796,18 @@
 
         fetchURLID.setAttribute('disabled','');
         resourceFile.removeAttribute('disabled');
-        fetchURLID.style.background="#ffffff";
-        urlHelpText.style.color="#cccccc";
-        fileHelpText.style.color="#000000";
+        fetchURLID.style.background="White";
+        urlHelpText.style.color="Gray";
+        fileHelpText.style.color="Black";
 
     }
     else{
 
         resourceFile.setAttribute('disabled','');
         fetchURLID.removeAttribute('disabled');
-        resourceFile.style.background="#ffffff";
-        fileHelpText.style.color="#cccccc";
-        urlHelpText.style.color="#000000";
+        resourceFile.style.background="White";
+        fileHelpText.style.color="Gray";
+        urlHelpText.style.color="Black";
     }
 }
 function expandIfNot(name)

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/js/validation.js
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/js/validation.js	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/js/validation.js	Fri May  2 04:12:10 2008
@@ -46,17 +46,20 @@
 }
 function validateIllegal(fld,fldName){
     var error = "";
+    
     var illegalChars = /([^a-zA-Z0-9_\-\x2E\&\?\\\:\,\s])/; // allow only letters and numbers - _and period
     
     if (fld.value == "") {
         fld.style.background = 'Yellow';
         error = "Please make sure you fill the "+fldName+" field.<br />";
-    } else if (illegalChars.test(fld.value)) {
+    } 
+    if (illegalChars.match(fld.value)) {
         error = "The "+fldName+" contains illegal characters.<br />";
         fld.style.background = 'Yellow';
     } else{
-        fld.style.background = '#ffffff;';
+        fld.style.background = 'White';
     }
+    
    return error;
 }
 function validateForInput(fld,fldName){
@@ -67,7 +70,7 @@
         error = "The "+fldName+" contains illegal characters.<br />";
         fld.style.background = 'Yellow';
     } else{
-        fld.style.background = '#ffffff;';
+        fld.style.background = 'White';
     }
    return error;
 }
@@ -75,7 +78,7 @@
     var error = "";
     var allowed= /(0[1-9]|1[0-2]\/[0-2][0-9]|3[0-1]\/[1-2][0-9][0-9][0-9])/;
     if (allowed.test(fld.value)) {
-        fld.style.background = '#ffffff;';
+        fld.style.background = 'White';
     }
     else {
         error = "The "+fldName+" is not a valid date. Please make sure it's in MM/DD/YYYY format.<br />";

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/recent-activity.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/recent-activity.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/recent-activity.jsp	Fri May  2 04:12:10 2008
@@ -71,11 +71,11 @@
             <table cellpadding="0" cellspacing="0" border="0" class="form-table">
                 <tr>
                     <td style="width:100px;" valign="top">Username</td>
-                    <td><input type="text" name="userName"/></td>
+                    <td><input type="text" name="userName" id="userName" /></td>
                 </tr>
                 <tr>
                     <td valign="top">Path</td>
-                    <td><input type="text" name="path"/></td>
+                    <td><input type="text" id="path" name="path"/></td>
                 </tr>
                 <tr>
                     <td valign="top">Date</td>

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp	Fri May  2 04:12:10 2008
@@ -243,7 +243,7 @@
         <td valign="top" style="width:10px;">
 
             <% if (!details.isPutAllowed()) { %>
-            <!-- span class="helpText">Sorry. You don't have Permissions to add new properties.</span -->
+            
             <%
             } else if (details.isVersionView()) {
             %>
@@ -551,7 +551,7 @@
         </table>
     </form>
 </div>
-
+<div id="entryListReason" class="validationError" style="display: none;"></div>
 <div id="entryList">
     <table cellpadding="0" cellspacing="0" border="0" style="width:100%;" class="data-table">
         <%

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/search.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/search.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/search.jsp	Fri May  2 04:12:10 2008
@@ -48,7 +48,7 @@
             	Iterator i = resourceDataList.iterator();
             	if(resourceDataList.isEmpty()){
             	%>
-	Your search did not match any resources taged with <h3 style="display:inline;margin-left:0px;"><%=request.getParameter("criteria")%></h3>. 
+	Your search did not match any resources tagged with <h3 style="display:inline;margin-left:0px;"><%=request.getParameter("criteria")%></h3>. 
 	<ul class="normalList">
 		<li>Make sure all words are spelled correctly.</li>
     		<li>Try different keywords.</li>

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/user.jsp	Fri May  2 04:12:10 2008
@@ -92,7 +92,7 @@
             </td>
         </tr>
         <tr id="passwordEdit1" style="display:none;">
-            <td style="width:140px"><h3 style="margin-bottom:0px;">Editing Password:</h3></td>
+            <td style="width:140px;*margin-left:-10px;"><h3 style="margin-bottom:0px;*margin-left:0px;">Editing Password:</h3></td>
             <td style="text-align:right;width:20px;" align="right">
                 <a onclick="saveNewPassword('<%=userDetailsAction.getDisplayUserName()%>')" title="Save Password" href="#">
                     <img border="0" align="bottom" src="/wso2registry/admin/images/save-button.gif"/>



More information about the Registry-dev mailing list