AI
Animation
CGI
Compression
Console
Database
Debug
Dialects
Dialogs
Editor
Email
Encryption
Extension
External Library
File
File Handling
Files
Financial
FTP
Game
Games
Graphics
GUI
HTML
HTTP
Internet
LDC
Markup
Math
Module
Network
Networking
None
Other - Net
Parse
Patch
Printing
Protocol
Rebol
Scheme
Scientific
SDK
Security
Shell
Sound
SQL
TCP
Testing
Text
Text Processing
UI
User Interface
Util
Utility
VID
Visualization
Web
Win API
X-File
XML
REBOL [
    Title: "Embedded Search"
    Date: 20-Aug-2006
    Name: 'embedded-search
    File: %embedded-search.r
    Version: 1.0.0
    Author: "rwvd.zee"
    Purpose: "The script enables a document search  from within a browser."
    Note: {
        - "call [firefox found.html]" might be changed to "browse %found.html"      
        - requires REBOL browser plugin    
        - script refers to Firefox, but other browsers might be named
    }
  Library: [
     level: 'beginner
     platform: 'all
     type: [reference tool]
     domain: [files html]
     tested-under: none
     support: none
     license: none
     see-also: %document-search.r
   ]
]



                               ;the document search script that will be embedded

script-directory: what-dir 
if not exists? %embedded-script.r [
    write %embedded-script.r {
    REBOL [Title: "Plugin Ready" Version: 1.2.0]
    vers: 1.2.46
    view layout [
    size 600x595
    backdrop 187.219.220
    origin 5
    image logo.gif
    space 0
    indent 9 h3 130 "Document Search"
    space 10
    indent 20 directory: h3 450 
    space 3
    indent 30
    searchField: field 208 tan tan font-size 15 bold center 
    across
    indent 60
    btn "Open A Directory To Search"  [
        search-directory: request-dir/offset 350x170 
        if  (search-directory <> none) [
            change-dir search-directory
            directory/text: join "Searching " search-directory
            show directory
        ]
    ]
                                 ;a web page to display the search results

    btn "Search" [
       manualFiles: read %.
       finds: rejoin [
           {
            
            
Search Results For "} searchField/text {"
 
} ] foreach fileIn manualFiles [ if find read fileIn searchField/text [ parse read fileIn [thru copy theTitle to ] append finds rejoin ["" theTitle "
" ] ] ] append finds "
" write %found.html finds call [firefox found.html] ] ] } ] ;and the html page that contains the script page-path: join script-directory %embedded-script.r if not exists? %webPage.html [ write %webPage.html rejoin [ { Document Search } ] ] if (not exists? %logo.gif) [save/png %logo.png logo.gif] browse %webpage.html
Copyright © 2018 Rebol Software Foundation