My hobbyist coding updates and releases as the mysterious "Mr. Tines"

Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

Tuesday, 2 December 2008

Syntax highlighting

Following on from Scott Hanselman's post about the SyntaxHighlighter script, here's the secret sauce I needed to get it to work.

The separate hosting is the easy bit -- the trick was getting the code I needed to run the repainting into a window.onload, and to keep Blogger from mutilating the code by use of a CDATA section.

Et voilà!

<link href='.../SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script src='.../shCore.js' type='text/javascript'/>
<script src='.../shBrushPython.js' type='text/javascript'/>
<script src='.../shBrushRuby.js' type='text/javascript'/>
...
<script type='text/javascript'>//<![CDATA[
window.onload = function () {
    dp.SyntaxHighlighter.ClipboardSwf = ".../clipboard.swf";
    dp.SyntaxHighlighter.BloggerMode();
    dp.SyntaxHighlighter.HighlightAll("code",true,false,false,1,false);
}
//]]></script>

There is also a Scala brush for this -- but F# or Erlang will need to be hand-cranked first.

Later: hand cranking done & linked.

Saturday, 10 December 2005

Enkoder applet

“E”-ddress encoder 1.0 — a utility based on the the old Hiveware “Enkoder”, only this one is a Java app/applet. Offered into the public domain.

Friday, 5 November 2004

Strict XHTML Applets

Noting that this page was reached by the search query "Strict XHTML Applets", a brief guide to what I've done along these lines.

I started with Hixie's Embedding flash without <embed>, which nests <object /> tags, but suffers from parameter duplication, and, IIRC, unless I had things back-to-front, it also leaves empty place-holders for the "other platform" applet in some browsers. By using IE conditional comments in a sneaky fashion, one only need duplicate the opening <object> as follows (code based upon that in my N-body applet page):-

<!--[if IE]>

<object archive="nbodyzip.zip" type="application/x-java-object"
code="Nbody.class" width="250" height="150" title="&lambda; Serpentis
II system simulation" standby="standby" >
<![endif]-->

<!--[if !IE]> -->
<object archive="nbodyzip.zip" type="application/x-java-object"
classid="java:Nbody.class" title="&lambda; Serpentis II system
simulation" standby="standby" width="250" height="150" >
<!-- <![endif]-->

<!-- shared parameter tags go here if needed e.g. -->
    <param name="bgcolor" value="#000000" />

<!-- followed by fallback content such as:- -->

    <p>Alas! Either your browser is not one for which I've been able to get
    XHTML object tags to work, or perhaps it's not Java enabled!</p>

<!-- finally close the one object tag -->

</object>

Here IE wants the main-class via the code attribute code="Nbody.class"; whereas Gecko browsers (Netscape, Mozilla, Firefox) want it via the classid attribute, classid="java:Nbody.class". Both use the archive attribute to show where the bytecode is to be found.

This works for Netscape 4 and up. I believe it also works in Konqueror (KHTML), and thus also Safari - but if you know different, please say.

It would be nicer if I could find one tag that would feed Java to all these browsers…

Monday, 6 September 2004

XPP -- XML PreProcessor

XPP 1.0.1708.27390 — Use it to fold repeated units into static pages as a compile-before-upload step for XHTML web pages. See the ReadMe file in the archive for more details.

From the Windows page

Sunday, 25 July 2004

Texture

A new background texture which is done by Noise + greyscale + invert, followed by blurring and embossing, and then tweaking the brightness and contrast to taste.

Sunday, 18 July 2004

I like Metal

Rolled my own textures for the brushed metal look : light and dark brushed aluminium. The brushed metal trick is Noise + greyscale + invert + motion blur; then cut a chunk out the middle.

Sunday, 26 October 2003

CSS Validator resources

Uploaded the pre-built resource files for the VS.NET build of the CSS Validator.

Monday, 4 August 2003

Geocities site cleanup

Well, as freecrypto.org has bit the big one, nuke the last (animated) .gif — rather than .mng it.

Saturday, 21 June 2003

Validator Updates

Both the XHTML validator programs now support

  • whole folder validation, and
  • respecting file declared DOCTYPE (if it's one of the three XHTML DTDs, 1.0 Transition, 1.0 Strict or 1.1, defaulting to 1.0 Strict).

Versions are now 2.1.1263.35260 for .NET and 1.2 for Java. The Java version is noisier than the .NET version, in emitting redefinition warnings; but the W3C validator agrees with the .NET version where I have done comparisons.

Fixed bug in the Java build of the CSS2 parser that didn't handle relative file:// URLs properly, so failed on @import url() statements; this is something long ago fixed in the J# version - just forgot I needed to port it back.

Tweaked style sheets so that Konqueror 3.0 doesn't merge the print style into the screen presentation and hide the site-map links.

Saturday, 24 May 2003

Geocities site cleanup

Late spring holiday weekend, and another spring-clean. The brushed-metal look was too oppressive as it stood, so I've toned it down, and added a dash of colour. Page layout is now done with CSS on modern browsers - thanks to the CSS gurus at alistapart.com, bluerobot.com, and thenoodleincident.com for the hints, tips, worked examples and design philosophy.
FWIW all pages are now XHTML 1.1, at least until the hosting service's scripts start.

Friday, 23 May 2003

Validator Updates

More fixes to work around places where J# is not a perfect Java-alike in v2.0.1238 and supporting DLL.

Tuesday, 20 May 2003

Validator Updates

Minor updates uploaded to both validators, mainly to tidy up output formats, but also to echo the DOCTYPE actually declared in the document being checked, if it has one. Versions are now 2.0.1234.35151 for .NET and 1.1-02 for Java.

Sunday, 18 May 2003

Validator/.Net 1.2 -- CSS2 support

There's now a CSS2 validator build for the .NET validator - it uses J# to build the CSS validator, so you'll need the J# redistributables from Microsoft as well as the .NET framework. Version 1.1 is still available for those who don't want or don't have J# support.

Remember these are only helpers; for definitive checks, always go to validator.w3.org.

Saturday, 17 May 2003

JXHTML -- Validator/Java + CSS2 support

There's now a CSS2 validator build for the Java validator, and a new version 1.1 of both validators also checks for the non-SGML charactersthat often find their way onto pages from Windows applications.

Tuesday, 6 May 2003

JXHTML -- Validator/Java

Now a Java version of an offline XHTML validator that will check a document against 1.0 Transitional, 1.0 Strict and 1.1, all without needing to edit your DOCTYPE. Useful for polishing before uploading for sending to the W3C validator. Requires the Apache Xerces-J XML library (I used version 2.4.0, you will need some version 2.x, but I haven't tested other versions). If you have a copy of the Java-based CSS validator from the W3C, then it can use it to perform CSS validation after a clean XHTML validation too. Tweaked the C# version a bit - but that doesn't have the CSS validation, of course.

From the Java page.

Sunday, 4 May 2003

Validator.NET

My first .NET project release - an offline XHTML validator that will check a document against 1.0 Transitional, 1.0 Strict and 1.1, all without needing to edit your DOCTYPE. Useful for polishing before sending to the W3C validator.

From the Windows page.

Wednesday, 30 April 2003

Geocities site cleanup

Haven't been able to get browsers other than IE, Gecko (Mozilla, Galeon, and recent Netscape), and NN4.5 to work with object tags for Java applets. In particular, Konqueror resisted, and presumably that means Safari would too. So I've added some more Javascript fu to put in an applet tag as a fallback. Netscape/Gecko users will get their page first, all the rest will have to wait for the whole script loading and execution, I'm, afraid.

Monday, 28 April 2003

Geocities site cleanup

With a little bit of JavaScript tinkering, I've managed to get applets to work for NN7 and 4.5 as well as IE6. Intermediate NN versions and some earlier IE versions may work; the two families require completely different sets of attributes on an <object> tag - what works on IE drops through to the included text on NN, and what works on NN leaves an applet sized blank in the IE rendering.

I've also adjusted the other bits of script in an attempt to get closer to XHTML1.0 strict validation - but since the redirection service for pointing ravnaandtines.com at the GeoCities URL uses frames, I'm stuck with the non-compliant target=_top" attribute on links. That being the case, I'm not going to roll out the last little tweaks until I've got more content to upload - just on an as-updated basis. The Yahoo-supplied script addenda, with their preceding set of "close everything" tags will still make a page invalid according to the validator at validator.w3.org, so there's another limit to how much I can achieve.

Oh, and while I was at it, I nuked all the gifs, apart from the one animated logo on this page, in favour of pngs.

Saturday, 26 April 2003

Geocities site cleanup : Spring cleaning and mega redesign

This site went black many years ago as part of a one-day protest event (which might have been something to do with the American CDA), and stayed that way out of inertia. Now I felt it was a suitable season for a redesign, and have done one with an eye to handling small format devices (for mobile internet) for which a 150-200 pixel navigation bar at the left becomes a screen-wide thing, often rendered above the page body; in any case the real above-the-fold content is hidden offscreen to the right or below of the first screenful. To combat this all navigation is moved into a narrow band, with links top and bottom to a site map; and in the more functional browsers, the whole thing is a clickable link.

The new look is a brushed-metal version of the original Mosaic/Netscape black text on grey ground.

Putting style information into a separate CSS has had the advantage of letting old browsers like NN4.5 pick some of them up, which the in-line ones weren't being, so the site should be looking better there too.
Downside - as I'm going for XHTML 1.0 strict, I'm using <object> rather than <applet>, which currently means I've only got applets working on IE6 - but I'm working on it.

Friday, 22 November 2002

Blue Planet applet update

More tidying, with bug-fixing the XHTML and the Blue Planet applet (fixing UI problems and allowing for collisions between moons).

From the RPG page.