On Mon, Jan 5, 2009 at 11:00 AM, Braydon Fuller <[email protected]> wrote:

>  Christian Sonne wrote:
>
>
> (...)
>
> Before anyone else spends time on it, I'll just check off the ones I've
> done so far
>
>>
>>> - history
>>> - back / forward / home / refresh / page-down / page-up
>>
>>    back, forward, home, refresh
>
> Cool. I was just messing around with this and ended up with:
>
> CmdUtils.CreateCommand({
>   name: "back",
>   icon: "gtk-go-back",
>   description: "Browser's Back Function",
>   takes: {"input": noun_arb_text},
>   preview: function( pblock, input ) {
>     var template = "Hello ${name}";
>     pblock.innerHTML = CmdUtils.renderTemplate(template, {"name": "World!"
> });
>   },
>   execute: function(input) {
>     CmdUtils.getWindowInsecure().history.go(-1)
>   }
> });
>
> Ditto for forward.
> Obviously lots of problems,;icon, and preview.
> I was thinking the preview could be a thumbnail of the window, and it could
> accept nouns that are of the type of titles of pages in the history, as well
> as integers.
>
> What did you get so far?
>
>     Braydon
>

I have not yet troubled myself with icons and the likes (I think a lot of
the current icons have been produced by the same guy, but I can't remember
who :-S) but here is my current implementations:
CmdUtils.CreateCommand({
  name: "fullscreen",
  description: "Toggles fullscreen mode",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.fullScreen = win.fullScreen ? false : true;
  }
});

CmdUtils.CreateCommand({
  name: "back",
  description: "Go one step back in history",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.history.go(-1);
  }
});

CmdUtils.CreateCommand({
  name: "forward",
  description: "Go one step forward in history",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.history.go(1);
  }
});

CmdUtils.CreateCommand({
  name: "home",
  description: "Go to home page",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.home();
  }
});

CmdUtils.CreateCommand({
  name: "close",
  description: "Close firefox",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.close();
  }
});

CmdUtils.CreateCommand({
  name: "refresh",
  description: "Refresh current document",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.location.reload( true );
  }
});

CmdUtils.CreateCommand({
  name: "bookmark",
  description: "Add current document to bookmarks",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindowInsecure();
    var doc = CmdUtils.getDocument();
    try {
      if(!win.sidebar.addPanel(doc.title, win.location.href,""))
throw("Internal error");
    } catch ( e ) { displayMessage("Page could not be bookmarked!" + ((e)?"
- "+e:"")); }
  }
});

CmdUtils.CreateCommand({
  name: "print",
  description: "Print current page",
  preview: function( pblock ) {pblock.innerHTML=this.description},
  execute: function() {
    var win = CmdUtils.getWindow();
    win.print();
  }
});

-- cers / Christian Sonne


>
>
>
>
>>> - bookmark / print
>>
>>    bookmark, print
>
>
>>> - preferences
>>> - delete-cache
>>> - turn on / off plugins and themes
>>> - fullscreen
>>
>>    fullscreen
>
>>
>>> - downloads
>>> - url (goto)
>>> - quit
>>
>>    I've done close, which closes the current window - but not yet quit
>
>>
>>>
>>> Thus replacing the need for a menubar at all. Also just the ctrl key
>>> could be the hotkey so that ctrl b (back), ctrl f (forward), u (up), d
>>> (down)
>>> would work.
>>>
>>>
>>>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to