+ mh2 doorblocks -- just checked in

why the lucky stiff why at hobix.com
Wed May 17 18:09:41 EDT 2006


I'm going to just explain MouseHole trunk features as they roll in.  
I'll probably dig a bit deeper into some of these with screenshots on 
RedHanded, but I just want to keep some notes.

== Doorblocks: Small apps for the doorway
MouseHole 1 listed all of your scripts on the doorway and you could turn 
them on and off, configure them from there.  This has moved to the Apps 
page in MouseHole 2.

In MouseHole 2, the doorway functions as more of a desktop for your 
apps.  So, for example, if you have an app that's a wiki.  If you use 
this personal wiki much, it might be handy to have an empty box on your 
doorway for entering new wiki pages.  Or you may want to have the recent 
changes there.  Or the markup from some important page in the wiki.

Following this example, here's a doorblock for showing Recent Changes to 
Tepee.  This code gets added to tepee.rb (right under the Camping.goes 
line.)  This is unstable code, so it all may change:

  module Tepee::MouseHole
    class RecentChanges
        def get
            pages = Tepee::Models::Page.find(:all, :include => :versions,
                  :order => 'tepee_page_versions.updated_at DESC', 
:limit => 10)     
            div { ul { pages.each { |page| li page.title } } }
        end
    end
  end

Classes contained in the App::MouseHole module are your "doorblocks."  
They function as normal Camping-style controller classes (they receive 
@env, @cookies, @input, etc.)  The content generated by the controller 
is shown on the doorway.

_why


More information about the Mousehole-scripters mailing list