Roller Add Bookmark Bookmarklet

posted 10:01PM Mar 15, 2005 with tags by Lars Trieloff

As you can see, my blogroll is quite extensive, but it could be much larger, if it would be easier to add new bookmarks. Using this modification to my Roller installation, namely bookmarks/BookmarkForm.jsp, adding a bookmark is as easy as clicking on a button.
    (<a href="javascript:
    void(baseurl='<%= RollerRequest.getRollerRequest(request).getRequestURL().re
placeAll("bookmarks.do","") %>bookmarkEdit.do?folderid=<%= RollerRequest.getRoll
erRequest(request).getFolder().getId() %>');
    void(d=document);
    void(rss='');
    void(title=document.title);
    void(url=window.location.href);
    void(el=d.getElementsByTagName('link')); 
    for(i=0;i<el.length;i++) { 
      if (el[i].getAttribute('rel')) { 
        if( el[i].getAttribute('rel').indexOf('alternate')!=-1 && el[i].getAttri
bute('type') && (el[i].getAttribute('type').indexOf('application/rss+xml')!=-1 |
| el[i].getAttribute('type').indexOf('text/xml')!=-1)) {
          void(rss=el[i].getAttribute('href'));
          if (rss.search(/^http(s?):\/\//)==-1) {
            rss = url.substring(0,url.lastIndexOf('/')+1) + rss;
          }
        }
      }
    }
    void(window.location.href=baseurl+'&name='+escape(title)+'&url='+escape(url)
+'&feedUrl='+escape(rss));">Bookmarklet</a>)
This code adds a bookmarklet to the bookmark folder view that allows you to add bookmarks to your Roller weblog. It even contains an RSS-autodiscovery script, which original version can be found at Laughing Meme.

The ugliest thing I've seen this week

posted 07:46PM Mar 15, 2005 with tags by Lars Trieloff

The Acrobat Reader for Linux was alway one of the ugliest and misplaced applications on my desktop. Version 7 makes no difference.

Acrobat 7 toolbar

They are using GTK instead of Motif, but cripple the application with custom, inaccessible widgets. No wonder there are more than enough PDF readers for Linux. Luis Villa has a more in-depth-review.

Ajax Weblog

posted 07:45PM Mar 15, 2005 with tags by Lars Trieloff

Scott Delap links to the new Ajaxian Blog, which covers latest developments at the Ajax front.
Ajaxian.com isn't about exotic new web technologies. It's about exploring how some of our old friends (XHTML, CSS, JavaScript) can be used to do very interesting things that for the past few years we've been telling our employers can't be done in a conventional browser.

The latest post is about Using Maven to modularize JavaScript development. This weblog will be added to my blogroll.

Library directories for Maven

posted 01:34PM Mar 15, 2005 with tags by Lars Trieloff

Apache Maven supports the use of lib-directories, where you can put library jars that cannot be redistributed on a public or private repository.

Nick Lothian describes how to use a lib directory with Maven.

Cool XSLT misuse

posted 11:21AM Mar 15, 2005 with tags by Lars Trieloff

Sean Whalen implemented the popular minesweeper game in XSLT. The implementation uses JavaScript to create an initial XML document (the minefield), but the rest is pure XSLT.

So, how do you do this in XQuery :-)