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

[REBOL] Re: rebol browser???

From: izkata:aol at: 28-Mar-2002 12:51

Now that I've tried at it, is this a good start? REBOL [] prin "^(page)" [if not connected? [alert "Not connected to the Internet!" quit]] flash "Loading..." if not exists? %Browserfiles/ [make-dir %Browserfiles/] either exists? %BrowserFiles/Mem.txt [ do %BrowserFiles/Mem.txt ][ Homepage: Favepage: favcolor: black ] updatemem: [write %BrowserFiles/Mem.txt rejoin [{REBOL [] Homepage: } Homepage { Favepage: } Favepage { favcolor: } favcolor] do %Browser.r ] browsepage: func [dapage [url! file!]][ A: read dapage write %page.txt {REBOL [] page: layout [ across backcolor favcolor } replace/all A "<P>" {return } replace/all A "<BR>" {return } replace/all A "&nbsp;" { } tags: make block! 100 text: make string! 8000 html-code: [ copy tag ["<title>" thru "</title>"] (append tags tag) | copy tag ["<" thru ">"] (append tags tag) | copy txt to "<" (append text rejoin ["text {" txt "} "]) ] parse A [to "<" some html-code] text: replace/all text "return" "} return text {" write/append %Page.txt rejoin [text {]}] ] webaddres: Homepage browsepage webaddres typic: does [ do %page.txt panels/pane: page size: size-text panels ] main: layout [ across backcolor favcolor button 100x100 "Make this page your Homepage." [Homepage: webaddres do updatemem] button 100x100 "Make this page your Favorite page." [Favepage: webaddres do updatemem] button 100x100 "Change Color." [favcolor: request-color do updatemem] button 100x100 "Goto homepage." [browsepage homepage typic show panels] button 100x100 "Goto favorite page." [browsepage favepage typic show panels] button 100x100 "Quit." [quit] return button 640x25 "New Web Address." [if error? try [ browsepage to-url request-text/title "Web Address:" typic show panels ][ browsepage ]] return panels: box 640x350 favcolor s1: slider 16x350 [ panels/para/scroll/y: s1/data - 1 * (negate size/y) - size/y + 2 show panels ] return s2: slider 640x16 [ panels/para/scroll/x: s2/data - 1 * (negate size/x) - size/x + 2 show panels ] ] typic request main Well? Is it a good start? Daniel S.