Friday, February 27, 2009

One dead

deadsqurl is down, and will remain so until I gather the inclination and find the time to move it to a new home.  Sorry for the broken links…

Labels: , , , ,

Wednesday, February 25, 2009

HTML: Conditional Else Comment

IE browsers support Conditional Comments, but the syntax only supports IF statements – there is no ELSE.

Stu Nicholls and the JavaScript Kit to the rescue;  the following simulates an else statement:

 <head><title>Choose a browser...</title></head>
  <p>You chose
  <![if ! IE]>
  <![endif]><!--[if IE]>

Copy to a text file, save as html and run in IE and Firefox/Chrome/Safari/Opera…

Labels: , ,

Friday, February 13, 2009

Why I use Chrome

While checking her email on my computer yesterday, my wife asked me why I use “that Google POS browser” (Chrome).  I think she was annoyed that it was unfamiliar to her, and that it’s just the latest example of me doing something geeky that gets a bit on her non-geeky nerves.  Oh well – marital bliss... 

For the record (not that she would read this…), this is why I use Chrome:

  1. It is clean.  No clutter.  This actually matters.
  2. It is fast: Below are the results of the V8 Engine Benchmark scores.  Sure the benchmark is written by Google, sure it only measures JS performance, and sure it doesn’t mean that Chrome is 20x faster than IE8.  But it is faster, just as Firefox3 is noticeably faster than IE8:

Benchmark test results from run on my laptop

V8Benchmark_IE8 V8Benchmark_Firefox3 V8Benchmark_Chrome
IE 8.0.6001 Firefox 3.0.6 Chrome 1.0.154

Now if only Chrome was as extensible as Firefox is, and if only people would start writing standards compliant html and JavaScript (people = Microsoft, really – SharePoint and OWA are the two biggies), then I would ONLY use Chrome.  As is I’m stuck with all three.  Sigh.

Labels: , , , , , , , ,

Tuesday, February 10, 2009

MOSS: The dreaded schema.xml

My colleague Tad sent me a link to Andrew Connell’s post: A Quicker Way to Create Custom SharePoint List Templates with the comment - ‘I guess “quicker” is relative.’  Tad’s right – this seems to be going too far for a simple schema.xml file.
Much of Andrew’s post is valid – there’s not much doing getting around the Content Types and the List Template (if you need them), and using the OOTB list interface plus Keutmann’s excellent SharePoint Manager tool  to build queries is a simple workaround, but I’m balking on his approach for creating the the List’s schema.  If you take Andrew’s approach, you’re gonna end up with a MINIMUM of 1600 lines of xml in your schema: my approach is far simpler; below is a fully functioning schema that’s only 30+ lines – see if you can spot the magic bullet…:
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Id="{AB426CDE-98F2-432A-B296-880C7931DEF3}"
     Title="Setting" Url="Lists/Setting" BaseType="0"
     FolderCreation="FALSE" DisableAttachments="TRUE" VersioningEnabled="FALSE"
                     <Field Type="Text" Name="Title" DisplayName="Name" Required="TRUE" />
                     <Field Type="Text" Name="Value" DisplayName="Value" Required="TRUE" />
                     <View BaseViewID="0" Type="HTML" WebPartZoneID="Main" DisplayName="All Items" DefaultView="TRUE"
                         MobileView="True" MobileDefaultView="False" SetupPath="pages\viewpage.aspx"
                         ImageUrl="/_layouts/images/issues.png" Url="AllItems.aspx">
                           <ViewStyle ID="17"/>
                           <RowLimit Paged="TRUE">100</RowLimit>
                           <Toolbar Type="Standard" />
                                  <FieldRef Name="Edit" />
                                  <FieldRef Name="Title"/>
                                  <FieldRef Name="Value"/>
                                         <FieldRef Name="Title"/>
                     <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
                     <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
                     <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
              <DefaultDescription>Settings used in the application.</DefaultDescription>
Yep, it’s the ViewStyle tag I wrote about back in 2007.  It eliminates that 90% of the schema file that Andrew suggests you ignore, leaving a fairly terse xml that can actually be digested and debugged (sort of).

Labels: , ,