[Cosmo-dev] Re: [commits-cosmo] (travis) [2837] Fixes for IE6 and safari.

Travis Vachon travis at osafoundation.org
Thu Nov 9 15:50:00 PST 2006


Slippery enter button led to incomplete commit message, sorry about  
that.

The rest should read:

- UserList works with XML directly instead of Dojo parsed XML, since  
parsing wasn't working well in IE. Also, there's no real reason to  
parse except to make variable access look better.
- LoginDialog is skinnable again, and will be able to use global css.
- ModifyUserDialog can disable cancel button.
- Minor css tweaks (ie, collapse -> hidden)

On Nov 9, 2006, at 2:28 PM, svncheckin at osafoundation.org wrote:

> Revision
> 2837
> Author
> travis
> Date
> 2006-11-09 14:28:37 -0800 (Thu, 09 Nov 2006)
> Log Message
>
> Fixes for IE6 and safari.
>
> - Button won't set invalid ("nullpx")
> Modified Paths
>
> cosmo/trunk/src/webapp/js/cosmo/ui/widget/Button.js
> cosmo/trunk/src/webapp/js/cosmo/ui/widget/CosmoUserList.js
> cosmo/trunk/src/webapp/js/cosmo/ui/widget/LoginDialog.js
> cosmo/trunk/src/webapp/js/cosmo/ui/widget/ModifyUserDialog.js
> Diff
>
> Modified: cosmo/trunk/src/webapp/js/cosmo/ui/widget/Button.js (2836  
> => 2837)
>
> --- cosmo/trunk/src/webapp/js/cosmo/ui/widget/Button.js	2006-11-09  
> 21:08:33 UTC (rev 2836)
> +++ cosmo/trunk/src/webapp/js/cosmo/ui/widget/Button.js	2006-11-09  
> 22:28:37 UTC (rev 2837)
> @@ -72,7 +72,11 @@
>
>      setWidth: function(width){
>          this.width = width;
> -        this.tableContainer.style.width = width + "px";
> +		if (width){
> +        	this.tableContainer.style.width = width + "px";
> +        } else {
> +        	this.tableContainer.style.width = null;
> +        }
>      },
>
>      setEnabled: function(enabled){
> Modified: cosmo/trunk/src/webapp/js/cosmo/ui/widget/ 
> CosmoUserList.js (2836 => 2837)
>
> --- cosmo/trunk/src/webapp/js/cosmo/ui/widget/CosmoUserList.js	 
> 2006-11-09 21:08:33 UTC (rev 2836)
> +++ cosmo/trunk/src/webapp/js/cosmo/ui/widget/CosmoUserList.js	 
> 2006-11-09 22:28:37 UTC (rev 2837)
> @@ -272,83 +272,73 @@
>  				
>  		},
>  		
> -		updateUserListCallback:function(cmpResponse){
> +		updateUserListCallback:function(cmpXml){
>
>  			this.updateControlsView();
>
>  			var jsonObject = [];
>
> -			var users = cmpResponse.user
> +			var users = cmpXml.getElementsByTagName("user")
>
>  			for (i = 0; i < users.length; i++){
> -	
> +
>  				var user = users[i];
>  				
>  				var row = {};
>
> -				var firstname = user.firstname[0].value
> -
> -				var lastname = user.lastname[0].value
> -				var username = user.username[0].value
> -				var email = user.email[0].value
> -				var dateCreated = user.created[0].value
> -				var dateModified = user.modified[0].value
> -				var administrator = (user.administrator != undefined)
> -
> +				var firstname = user.getElementsByTagName("firstName") 
> [0].firstChild.nodeValue
> +				var lastname = user.getElementsByTagName("lastName") 
> [0].firstChild.nodeValue
> +				var username = user.getElementsByTagName("username") 
> [0].firstChild.nodeValue
> +				var email = user.getElementsByTagName("email") 
> [0].firstChild.nodeValue
> +				var dateCreated = user.getElementsByTagName("created") 
> [0].firstChild.nodeValue
> +				var dateModified = user.getElementsByTagName("modified") 
> [0].firstChild.nodeValue
> +				var administrator = (user.getElementsByTagName 
> ("administrator").length > 0)
> +				
>  				row.email = email;
>  				row.name = firstname + " " + lastname;
>  				row.username = username;	
> +				
>
>  				row.created = dojo.date.fromRfc3339(dateCreated);
> -				/*row.created = (dateCreated.getMonth() + 1).toString() + "-" +
> -								dateCreated.getDate().toString() + "-" +
> -								dateCreated.getFullYear().toString();
> -				*/
>
>  				row.modified = dojo.date.fromRfc3339(dateModified);
> -				/*row.modified = (dateModified.getMonth() + 1).toString() + "-" +
> -								dateModified.getDate().toString() + "-" +
> -								dateModified.getFullYear().toString();
> -				*/
> -
> +				
>  				if (administrator) {
>  					row.admin = "Yes";
>  				} else {
>  					row.admin = "No";
>  				}
> -				row.toString = function(){return this.username}
> -
> +				
>  				jsonObject.push(row);
>  			}
>
> -			var pagingLinks = cmpResponse.link;
> -
> +			var pagingLinks = cmpXml.getElementsByTagName("link");
> +			
>  			this.cmpFirstLink = null;
>  			this.cmpPreviousLink = null;
>  			this.cmpNextLink = null;
>  			this.cmpLastLink = null;
>  	
>  			for (i=0; i< pagingLinks.length; i++){
> -
> -				var link = pagingLinks[i].link;
> -
> -				switch(link.rel){
> +	
> +				link = pagingLinks[i]
> +				
> +				switch(link.getAttribute("rel")){
>  					case 'first':
> -						this.cmpFirstLink = link.href;
> +						this.cmpFirstLink = link.getAttribute("href");
>  						break;
>  					case 'previous':
> -						this.cmpPreviousLink = link.href;
> +						this.cmpPreviousLink = link.getAttribute("href");
>  						break;
>  					case 'next':
> -						this.cmpNextLink = link.href;
> +						this.cmpNextLink = link.getAttribute("href");
>  						break;
>  					case 'last':
> -						this.cmpLastLink = link.href;
> +						this.cmpLastLink = link.getAttribute("href");
>  						break;
>  				}
> -
>  			}
> -	
> +			
>  			var multiPage = (this.cmpPreviousLink || this.cmpNextLink)
>  	
>  			document.getElementById("firstPageLink").style.visibility =
> @@ -376,7 +366,7 @@
>  			var self = this;
>
>  			
> -			this.cmpProxy.getUsers({
> +			this.cmpProxy.getUsersXML({
>  				load: function(type, data, evt){self.updateUserListCallback 
> (data)},
>  			 	error: function(type, error){alert("update " + error.message)}
>  				 },
> Modified: cosmo/trunk/src/webapp/js/cosmo/ui/widget/LoginDialog.js  
> (2836 => 2837)
>
> --- cosmo/trunk/src/webapp/js/cosmo/ui/widget/LoginDialog.js	 
> 2006-11-09 21:08:33 UTC (rev 2836)
> +++ cosmo/trunk/src/webapp/js/cosmo/ui/widget/LoginDialog.js	 
> 2006-11-09 22:28:37 UTC (rev 2837)
> @@ -137,10 +137,6 @@
>
>  	    setStyle : function(){
>  	    	var stylesheetName = dojo.string.capitalize(this.widgetId);
> -
> -    	   	this.templateCssPath =
> -    	   		dojo.uri.dojoUri("../../cosmo/ui/widget/templates/ 
> LoginDialog/" + stylesheetName + ".css");
> -
>  	    }
>  	
>  		
> Modified: cosmo/trunk/src/webapp/js/cosmo/ui/widget/ 
> ModifyUserDialog.js (2836 => 2837)
>
> --- cosmo/trunk/src/webapp/js/cosmo/ui/widget/ModifyUserDialog.js	 
> 2006-11-09 21:08:33 UTC (rev 2836)
> +++ cosmo/trunk/src/webapp/js/cosmo/ui/widget/ModifyUserDialog.js	 
> 2006-11-09 22:28:37 UTC (rev 2837)
> @@ -84,7 +84,8 @@
>  			
>  			for (i = 0; i < inputs.length; i++){
>  				this.enabledInputs[inputs[i]] = false;
> -				this[inputs[i] + "Input"].style.visibility = 'collapse';
> +
> +				this[inputs[i] + "Input"].style.visibility = 'hidden';
>  			}
>  		},
>  		
> @@ -105,7 +106,7 @@
>  				if (this.role == cosmo.ROLE_ADMINISTRATOR) {
>  					dojo.event.connect(this.submitButton, "handleOnClick", this,  
> "createUser");	
>  				} else if (this.role == cosmo.ROLE_ANONYMOUS){
> -					dojo.event.connect(submitWidget, "handleOnClick", this,  
> "signupUser");	
> +					dojo.event.connect(this.submitButton, "handleOnClick", this,  
> "signupUser");	
>  				}
>  			} else {
>  				if (this.role == cosmo.ROLE_ADMINISTRATOR) {
> @@ -115,20 +116,19 @@
>  				}
>  			}
>
> -			if (!this.disableCancel) {
> +			if (this.disableCancel) {
> +				dojo.dom.removeNode(this.cancelButton);
> +			} else {
>  				var button = dojo.widget.createWidget("cosmo:Button",
>  						{text:this.cancelButtonText,
>  						 small:true});
>  				
> -	
>  				dojo.dom.prependChild(button.domNode,  
> this.cancelButton.parentNode);
>  				dojo.dom.removeNode(this.cancelButton);
>
>  				this.cancelButton = button;
>  				
>  				dojo.event.connect(this.cancelButton, "handleOnClick", this,  
> "cancelAction");
> -	
> -
>  			}
>  		
>  		},
>
> _______________________________________________
> Commits-Cosmo mailing list
> Commits-Cosmo at osafoundation.org
> http://lists.osafoundation.org/cgi-bin/mailman/listinfo/commits-cosmo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/cosmo-dev/attachments/20061109/3c446c2d/attachment.html


More information about the cosmo-dev mailing list