I just looked at the blog in IE, and it looks like my <pre> elements mess everything up. They have the CSS set as scroll: auto, but IE doesn't care. Honestly, at this point, I don't care either. This blog is for me to document my thoughts on creating the Young Israel website and anyone is welcome to listen in, but you're far better off in Firefox or Safari anyway.

The Using Javascript page in the Codex says to include common javascript files in your header.php file, but that means re-writing it whenever you change themes. I created a simple plugin that includes jQuery and ui.jquery on each page; it's

<?php
/*
Plugin Name: jQuery
Plugin URI: http://bililite.nfshost.com/blog/
Description: Includes the jQuery javascript framework (and the ui.jquery plugins) in your page, with some styling for <pre> elements
Author: Daniel Wachsstock
Version: 1.0
Author URI: http://bililite.nfshost.com/blog/
*/ 

function jQuery(){
echo '
   <script type="text/javascript" src="http://www.google.com/jsapi?key=apikey"></script>
   <script type="text/javascript">google.load("jquery","1");</script>
   <script type="text/javascript" src="http://ui.jquery.com/js/ui.js" ></script>
   <style>
      pre {
        background: #F4F4F4;
        border: 1px solid #B2B2B2;
        overflow: scroll;
      }
    </style>';
}

add_action('wp_head', 'jQuery');

?>

Replace apikey with your own Google API key.

I was trying to figure out how to organize the shiurim in a way that allowed for "AND" filters; something like author=shulman&tag=audio&tanach. Regular expressions won't work; but PHP allows you to use [] after a name and it automatically creates an array, so author=shulman&tag[]=audio&tag[]=tanach works (tag=audio&tag=tanach just overwrites the first tag).
The archive filter is now basically:
function shiurquery($get){
  $ret = '1';
  foreach($get as $query=>$item) $ret .= shiurquerystring($item, $query." REGEXP");
  return $ret;
}

function shiurquerystring ($item, $query){
  if (is_array($item))
    return join (' AND ', array_map ('shiurquerystring', $item, array_fill(0, count($item), $query)));
  return "$query\"$item\"";
}
Where shiurquerystring uses array_map to recursively analyze each element of the array. It's a bit obscure but works, and tighter than a for-each loop.
So shiurquerystring("shulman", "author REGEXP",) returns 'author REGEXP "shulman"' and
shiurquerystring(array("Tanach", "Audio"), "tag REGEXP")
returns 'tag REGEXP "Tanach" AND tag REGEXP "Audio"',
just as we wanted,
and shuirquery(parse_str("author=shulman&tag[]=Audio&tag[]=Tanach") returns
'1 AND author REGEXP "shulman" AND tag REGEXP "Audio" AND tag REGEXP "Tanach'.
Perfect!
The "1 AND" at the beginning makes the coding easier. The actual code is a bit more involved, to prevent cross-site scripting and to limit the filters to specific items.
I just got a Windows Mobile smartphone to replace my Palm TX (screen digitizer died). It's an ugly, kludgy and slow operating system (even after upgrading to WM 6). There's nothing as elegant as Luach that integrates Jewish calendar data in the datebook. There's a Jewish Calendar that's nice, but I ended up writing my own program that generates a CSV file with Hebrew dates etc. It allows you to import candlelighting times, calendar info, and even all the Young Israel events into Outlook. It's at http://youngisrael-stl.org/articles/exportCalendarFull.php Next up for that program: Cardinals, Rams and Blues schedules!

It’s finally live: the redesigned Young Israel site. So far, the feedback has been all positive, and I figured I’d have more free time once it was done. But nooooooo: I’m going to have to reorganize the shiur archives; with Rabbi Shulman adding 2+ a week, it’s going to add up fast. I like the idea of organizing with tags, but right now the search is with regular expressions. Expressing ‘or’ is easy: tanach|kohelet. But is there a way to do ‘and’ with RE’s? Something like tanach&audio ? I don’t think so. So it’s back to the drawing board.

’nuff said.

http://irregularwebcomic.net/1736.html

My brother sent me a "salary survey" with one question, "Are you happy with your current salary," where the "No" button ran away from the mouse. I thought it might be useful for gag sites, so I created a jquery plugin that mimics that effect, at http://bililite.nfshost.com/blog/blogfiles/keepaway.html. It's easy enough to use, just $(selector).keepaway(options) ,with options of
  • jump: the distance to jump away from the mouse, in pixels; default 500
  • speed: the speed to move (passed intact to the animate plugin); default 'fast'
  • home: time to return to the starting position if nothing happens, in ms; default 1000
Have fun!

Please note: the CSS parser is complete and documented in this post
I had an idea to write a CSS parser to allow custom jQuery attributes, since a lot of the jQuery I use is more presentation than behavior, and the redesign of the YI website allows for switching stylesheets, which may require different plugins to be applied. My idea would be to allow something like:

div {
-jquery-round: 5;
-jquery-gradient: {from: '#008800', to: '#000088'}
}

But I never did anything about until Andy Kent developed JSS which does something similar for CSS selectors that a browser can’t handle but that jQuery can. His code also includes a cache for selectors that implements partial selector caching (thus div span img would also search the cache for div and div span as well). I emailed him back and forth a few times, and made some suggestions; my best css parser and selector cache are available here (look at the code and use Firebug to look at the console). I still haven’t got the custom jQuery stuff together yet, but the pieces may be useful right now.
Please note: the CSS parser is complete and documented in this post

As I mentioned before, I don't have access to a modern version of Safari and when I pass an Apple store, I try to play with it and the site. Something always pops up to bite me. This time it was an improved version of my Hebrew keyboard, that I made into a popup, absolutely-positioned <div> instead of a separate page, using sprites for the keyboard button rollovers. Nice and elegant, but it means loading the <style> element with all those a:hover {background: 0 -150px}'s via Ajax as well. Just putting a <style> element in the loaded <div> worked fine in IE and Firefox, but today Safari wouldn't show any styles. Turns out Safari is technically right; <style>'s go in the <head>, not the middle of the <body>. That's a rule that doesn't make any sense, any more than requiring <script> elements to be limited to the <head> would. But such are the rules. I looked up a few ways to include a <style> element, but realized there's an easier way; I split the style into its own stylesheet and added a line to Javascript: $('head').append('<link type="text/css" href="/css/kb.css" rel="stylesheet" >'); before the $('<div id="keyboard-holder">').insertAfter('#q').load('/inc/keyboard.html'); // load via Ajax and now the style loads dynamically and easily. Luckily, jQuery handles identifying and executing <script> elements in Ajax'ed code, so I don't have to pull that out.
Just completed a long meeting about the website, which will be undergoing a major redesign, hopefully before the yomim tovim. The Lubchansky's think we should roll it out all at once, completed, rather than redesign and then recompose, to maximize the impact. So the site will stay as it is. Watch this space for more info!