Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: pair-edit style - desktop url argument

From: carl:cybercraft at: 21-Jun-2002 15:40

Hi Anton! (: On 21-Jun-02, Anton wrote:
> Yeah, I thought this too. 'desktop should be like 'browse. > We could probably patch desktop to do this, I reckon. > Looking in ctx-viewtop: > desktop ; first go to desktop and then exit to console > print mold first ctx-viewtop > I see some interesting looking words: > load-index > goto-url > find-site > goto-view > > but it turns out that the function we want is > show-folder, which takes a url argument eg. > ctx-viewtop/show-folder site/index.r > Now we just need to patch desktop so it takes an > optional argument. Here's the original desktop: > desktop: func [][ > if block? ctx-viewtop [ctx-viewtop: context ctx-viewtop] > ctx-viewtop/init-desktop > do-events > ] > The patched version: > desktop: func [url [url! file! any-type!]][ > if block? ctx-viewtop [ctx-viewtop: context ctx-viewtop] > ctx-viewtop/init-desktop > if value? 'url [ctx-viewtop/show-folder :url] > do-events > ] > Now you can go directly to my site first (: > desktop http://www.lexicon.net/anton/rebol/gui/index.r > From there, it's one click to demo-pair-edit.r :) > Seems to work pretty well, though I thought I noticed it not working > once in a new rebol. Anyone else notice this, please report it.
It won't work if you're in local mode and the site's not in your local directory. (Of course:) But the Desktop handles it gracefully and just shows what we normally get at startup.
> Anton.
That's real cool Anton! Except instead of calling the function 'desktop I've called it 'Antop. (; And added it to my user.r. It also handles leaving off the index.r too, though the trailing slash is required. ie... antop http://www.lexicon.net/anton/rebol/gui/ Now, how do we get everyone to start using Antop and to paste their rebsite URLs using the above format? ...
>>>> Desktop/REBOL.com/Sites/Anton/gui/demo-pair-edit.r >> I've been wondering about a better way to go to pages on the >> Desktop, as often people supply two methods like Anton has above, >> but the Desktop "URL" isn't usable. It should be as easy as doing >> an URL from the console. Perhaps something like this... >> desktop %public/sites/someones-rebsite/ >> to load the desktop and go directly to "someones-rebsite"? Others >> can no doubt think of a better format, but this is just to start a >> discussion. Or does IOS already have some method for doing this >> that will be in future versions of View?
-- Carl Read