Entries Tagged 'JavaScript/CSS' ↓

ThunderBird and OPML

I have been looking at Thunderbird plugins today and I am not feeling excited. Unlike Firefox, Thunderbird does not have a lot of plugins. The ones which are there, did not seem good enough. I was particularly looking like an RSS aggregator. Now ThunderBird does a nice job of managing RSS subscriptions and showing the stories. What I wanted, was to import an OPML file from my current RSS Aggregator and let ThunderBird manage the feeds. This way I can eliminate one running application and save on some resources.

I tried Forumzilla, but it did not work. I couldn’t figure out how to get it to work. It did not even import my OPML file.

I read about newsblog.jar on Dougal Campbell’s blog. Many people wrote about it, including Wayne Graham and Gumuz.
Dougal has basically added some functions to a JavaScript file in the newsblog.jar file that provide OPML import / export. I thought of giving it a try.

So I replaced the file in my chrome folder, and launched Thunderbird. Sure enough, there were “Import OPML” and “Export OPML” buttons on Subscription Management. So I tried to import the OPML I had. Didn’t work! I then exported my current subscription to see how that OPML looked like. I changed my OPML file to have the same structure as the exported one, but that too did not succeed. I tried a lot of combination but all failed.

After a few restarts, I thought of figuring out this myself. So opened up the jar file (it’s actually a zip file) and checked up subscription.js. It seemed normal! Then I thought about looking at any messages that may be coming up in the process. Opened up the JavaScript Console from Tools, and saw a few messages that said something similar to “body[0] is undefined”. I cleared up the JavaScript console and thought of trying this again to see what really goes on.

I also made sure that the outline tag comes on a new line after the body tag.

Went to import, and chose the file. And it worked!

Now, don’t ask me why did it work! I don’t know myself! I think it was just testing my patience!

Here are a few things that I learnt on the way:

  • Forumzilla needs a folder to store the feed in. The default settings won’t work. But if you create a folder within “News & Blogs” and assign that, it will be able to download the feed properly.
  • Thunderbird too has JavaScript Console, and it can be great to debug things.
  • If you are facing problems with OPML import, export your feeds and compare the resulting XML with your OPML. This may give you a good insight.
  • Try and work with a single feed first. If you can import that successfully, go with the rest.
  • Sometimes your luck plays stronger!

At the end of it, I am a happy man!

 

AJAXing ASP.NET

Learn how to build AJAX (Asynchronous JavaScript And XML) applications in ASP.NET environment. Make your applications more interactive and realtime!

Here’s the MSDN article.

 

Get Cooking with Photoshop and CSS

Are you a CSS guru… but a layout and graphics newbie? Or are you a whiz at making great Websites using tables, but feel lost with this whole CSS thing? Perhaps you’re a little bit of both… This article will take you from a blank Photoshop canvas to a CSS-based Web page.

Get Cooking with Photoshop and CSS - 3 Low-fat Recipes:
http://www.sitepoint.com/article/get-cooking-photoshop-css

 

Browser resize, iFrames, toggling the sidebar and JS debugging

A project that I am working on, teaches me some cool Javascript techniques every now and then. We needed to show a navigation area and the main content area. The obvious answer was to use frames. We also had to have something that can control both these frames. I decided on using iFrames since they would be flexible and serve the purpose of the project well.

There are two cool things that I want to write about today.

  1. Toggling the display of iFrames - turn on the navigation frame or turn it off
  2. Automatically resizing the frames when the browser size changes - user resizes, maximize window etc

The code will follow, but the major issues came up because of the differences between Firefox and IE. The window.onresize event fires when the window gets resized, and when you resize the iframe on that, you get another resize event. So this gets in a loop and can lead to a crash. Firefox emits the onresize event only once. The IE specific window.onresizeend event is sent only once - when the window is first opened - I did not get it even after resizing the window after the initial display.

The toggle seemed simple - make the visibility property of the iFrame style to either ‘visible’ or ‘hidden’ and I would have the toggle in place. That works, but only in Firefox! And then, what’s the use of hiding the navigation bar if your main frame does not expand to utilize the space created! So you need to resize the frames too!

Continue reading →