KAYAK2U

November 24, 2008

CSS Holy Grail Utility

It's the layout, man.  After seeing, a couple days ago, how Internet Explorer 7 behaved with the site layout (the left column was somewhere out in space, man), I had to make the rounds, read the comments, rejigger lines of code here, there, and the other place, and finally drag my little Three Column CSS Parameter Generator utility out of rehearsal into Show Time.  Which I've done, beyond all necessity.  (And NOW with more parameters.)

There's no need to click the link above unless you're interested in CSS-driven three column layouts, and the history of such things as they've played out over several years, from BlueRobot, to Glish, to Position is Everything, to A List Apart, and beyond.  Layouts here (pre-kayak2u included) have followed the evolution of the technology as highlighted at those links, with the present layout an incarnation of A List Apart's wrapper-free Holy Grail.

BUT!  Though the HTML and CSS that go into the Holy Grail Three Column layout are uncluttered and simple (why I like 'em), the calculating of the values of the margins and paddings that go into the style sheet is tedious, never mind the inserting of those values into the proper place in the CSS file.  If you decide to change the width or padding of one column even by one pixel, everything has to be recalculated and the style sheet repopulated with the new figures.  More than a couple iterations of that can get real boring.

Therefore, I created a utility to do most of the grunt work for me, generating the CSS with the values I give it.  Written in PHP, it's at the first link above.  It can be run as is, or at the bottom of the page is a link to a .zip of the PHP source, meaning you can download it and play with it at your leisure.

Yes, it's hard wired to the "wrapper-free" version of the layout, but can be modified rather simply for other versions.  I like the "wrapper-free" version because it works without hacks in IE7 (Oops, or so I thought.  Now fixed, it looks from here.)  Yes, it still may not work in all browsers or select versions of different browsers, but that's the way it goes.  When I can see it broken, I'll try to fix it.

Thank you.  Yer Welcome.

MikeSoja - November 24, 2008 -- 10:33 pm    Filed in: Programming  

November 23, 2008

Hack notes

Sweet Cheeks unpacked her new super computer yesterday afternoon, and it was late evening before she reeled off to the sofa, leaving me my first keypressing whack at seeing what Vistafication is all about.  First thing up was Internet Exploder (in which I can’t find a version number) and wouldn’t you know, my lovely three column site layouts were breaking all over the place.  I got most of it fixed last night, but am now hacking this blog CSS into shape up through a couple of neglected revisions.  Please stand by… 

MikeSoja - November 23, 2008 -- 11:12 am    Filed in: Programming  

January 28, 2008

FCK Me and The State of the Blog

For "The State of the Blog" I’ve finally installed a real "About" page.  It’s of little more import than the faddle that was up heretofore, but there it is.

As for the FCK Me, well… 

FCK are the initials of one Frederico Caldeira Knabben, and he’s written the FCKeditor, an "online text editor", which I’m now using to edit the blog.

I ditched the built in WordPress editor almost out of the box, and was going back and forth with my old reliable UltraEdit, but that was rapidly getting old, too, the way I work.  So I cast around for something that would allow itself to be injected into a web page, and there FCKeditor was.  I was almost prepared to install the thing outright, when I stumbled upon Dean Lee who had already taken the trouble and made a WordPress plug-in out of the deal.

I had a little trouble at first because the FCKeditor liked the Opera browser only under certain unidentifiable circumstances, but it took me just a short half day to figure out that when the blurb said FCKeditor was compatible with Opera v. 9.5 and up, it wasn’t a typo.  I downloaded the Beta version of Opera and wallah!  I’m on the cutting edge.

It was easy customizing the editor menu bar, and with a little effort I was able to fix the link dialogue focus problem that annoyed me.  It turns out that someone else flagged it and it sits in the FCKeditor todo trac list as #1671.  If anyone is interested I modified line #58 of "fck_link.html" to read:

<input id="txtUrl" tabindex="1" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />

and added: 

<script type="text/javascript">
document.getElementById("txtUrl").focus();
</script>

at the end of the same file, just before the <html>.  It’s not perfect but it saves me a reach for the mouse and a click every time I add a link to a post, and that’s good enough for now.

FCKeditor takes a little getting used to, and has its quirks, but it’s a heck of a lot better than anything else I’ve tried.

Carry on.
 

MikeSoja - January 28, 2008 -- 09:58 pm    Filed in: Programming  

December 30, 2007

Well, that was fun…

Ten days ago I downloaded my first copy of WordPress’s suite of blogging-software files, and threw them out onto the server. Immediately I began tweaking them in little ways. It always annoys me when I look at someone else’s code and find typos in the comments, or one line of code that’s indented differently than the rest, or output code that mixes up tabs and spaces or neglects newlines in some places. And so it was with the WordPress code, and where ever I went in it I took to trying to neaten it up.

And then last night comes the alert of an “urgent security release”, involving changes in more than a dozen files. When I looked into how to go about upgrading, it turned out not to be as straightforward as, say, installing the latest release of Opera. In fact, upgrading WordPress borders on the annoyingly tedious. The first thing is, they don’t offer a .zip file of the few files that have changed, but want you to download the entire suite. They do have a nice list of the files that have changed, and even highlights of the particular changed lines, but the average person is just supposed to unzip the whole package and send it wholesale out to the server. Except that the average person is supposed to delete all the files on the server, first. Except for the files that the average person is not supposed to delete.

And then there were those few files that I’d diddled, and probably couldn’t even find right away again.

But the WordPress pages kept referring to a piece of Software called Subversion, and I slowly gathered that it was the tool to do the job of comparing files, and merging, or facilitating the merging of the files with the smallest of differences in them. So, I went to the Subversion web site and started poking around, and, after writing my server provider, found out that installing Subversion on the server would likely get me into trouble, as in: Verboten. Then I noticed a link to something called Tortoise SVN, a Windows Subversion Client. I downloaded the thing, and installed it on my laptop, but had the sneaking suspicion I would also still need the regular Subversion (cuz Tortoise is just the client, right?) and possibly an Apache server, too, for the laptop, to make the whole thing run out there on Internet.

After playing around with Tortoise SVN for a couple hours, it turned out to be just the thing, and I didn’t need the regular Subversion or any server software.

And here’s how ya do it (so I can read my own post the next time I need to do a big merge). Most of the following has now been set up on my machines, but for those who are just starting out here’s what you do after TortoiseSVN is installed and the computer rebooted. TortoiseSVN is utilized exclusively via Windows Explorer, so pop the Explorer open (I have it running all the time, anyway). My local setup is that I keep and work on an exact mirror image of my web site on my hard drive, so basically, that’s going to become the working folder that I will eventually merge all WordPress changes into.

Create a new folder that is going to become your Repository. Right click on that folder and in the TortoiseSVN sub menu choose “Create repository here…”. “Native filesystem (FSFS)” is good. Click “OK”. In a different, empty folder create three sub folders called “trunk”, “branches”, and “tags”. Right click on the parent folder (now containing the three you just created) and in the TortoiseSVN sub menu select “Import”. Browse to the Repository folder and select it. Let it work, and click “OK”. Then right click on the folder that holds your blog files and again go to the TortoiseSVN sub menu and select Import. Fill in the path to the Repository *trunk* folder and let ‘er rip. After it’s done, click “OK”. You now have your blog files in the Repository trunk. In order to start tracking changes as you edit the files you need the Check them Out of the Repository into a new working folder. Either rename the old blog directory and create an empty one with the original name, or delete everything in the original one. When that’s done, right click on the folder where you want your working files and select “SVN Checkout…”. Fill in, as usual, the path to the Repository *trunk*, and let fly. Click “OK”. Now you have a working folder of all your blogging files, which should be the same as your original folder, with a few (possibly hidden) special .svn folders in them. Edit the .php files as you normally would. At any time you can “Commit” them back to the Repository, at which time you’ll be given a chance to review the differences between files, with appropriate options for action.

Now, when WordPress floats a new version, download the .zip file, open it up, and drag or extract the files on top of the files in your working subdirectory (don’t mess that up!) TortoiseSVN should immediately find all the files with differences in them and give you a chance to review and massage before committing the changes to the Repository and setting your working directory in updated order. After everything is satisfactory, you can upload as you please to the server.

Carry on, eh?

MikeSoja - December 30, 2007 -- 09:52 pm    Filed in: Programming  

December 29, 2007

Remember to comment that code…

I remember looking at the html of a friend’s webpage and joking about a comment he’d left there hidden amongst the tags. He joked back something about when I read a web page, boy, I really read a web page.

Well, now, apparently Google is doing its own code sniffing, and some of the things people have found in the comments are truly hilarious.

MikeSoja - December 29, 2007 -- 11:47 pm    Filed in: Programming  
  1. Pages:
  2. 1
  3. 2
As Happy As A Clam

Kayak2U.com

msoja RSS 2.0

Other's Pages









Search

Archive

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  


  • Books4Sale



    Soja's GoodReads Books4Sale Cheap

  • Category Cloud


  • Tag Cloud