Enhancement Suggestion :- move embedded style settings to single file tfstimesheet.css

Jun 12, 2009 at 12:38 AM
Edited Jun 12, 2009 at 12:40 AM

Hi Luke

I've added this...

// register css
            HtmlHead head = (HtmlHead)Page.Header;
            HtmlLink link = new HtmlLink();
            link.Attributes.Add("href", Page.ResolveClientUrl("/Resources/styles/tfstimesheet.css"));
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("rel", "stylesheet");
            head.Controls.Add(link); head = null; link = null;

 to explorer.aspx.cs "OnPreRender". Since I need this once only, I haven't wrapped this as a function call or utility method.

I added the stylesheet to TSWA as per the path above, currently it contains only:-

DIV#datagridContainer INPUT.edited
{
	background-color: #dbacac;
}

you might prefer the css file to live in the tfstimesheet sub-site?

This is coupled to a slight change to the js in AddChangeToQueue() - various spots where single css properties are updated individually - more powerful to bundle these into a single css selector.

//textBox.style.backgroundColor = "#dbacac";
                textBox.className += ' edited';
similarly, this className can be removed with :-
textBox.className = textBox.className.replace('edited','');
this would allow a nicely packaged template approach to skinning the tfstimesheet app'

Thanks!

Andy