[Show the search string when searching Neil Mitchell**20080804232855] { hunk ./src/Web/Action.hs 7 +import Hoogle.Item.All +import Hoogle.Search.All hunk ./src/Web/Action.hs 13 +import Data.TagStr hunk ./src/Web/Action.hs 19 - let res = unlines $ header (queryText q) ++ runQuery dbs q ++ footer + let res = unlines $ header (escapeHTML $ queryText q) ++ runQuery dbs q ++ footer hunk ./src/Web/Action.hs 48 - ," Query: " ++ pre ++ "" ++ post2 ++ "
" + ," Query: " +? pre ++ "" +? post2 ++ "
" hunk ./src/Web/Action.hs 50 - ," Error: " ++ drop 1 (dropWhile (/= ':') $ show err) ++ "
" + ," Error: " +? drop 1 (dropWhile (/= ':') $ show err) ++ "
" hunk ./src/Web/Action.hs 68 -runQuery dbs q = ["Search here"] +runQuery dbs CmdQuery{query = Right q} = + ["

Searched for " ++ qstr ++ "

" + ,"

todo

" + ] + where + qstr = unwords $ names q ++ + ["::" | names q /= [] && isJust (typeSig q)] ++ + [showTagHTML (renderEntryText view $ renderTypeSig t) | Just t <- [typeSig q]] + view = [ArgPosNum i i | i <- [0..10]] + + + + + +a +? b = a ++ escapeHTML b + + +escapeHTML = concatMap f + where + f '\"' = """ + f '<' = "<" + f '>' = ">" + f x = [x] + + +showTagHTML (Str x) = escapeHTML x +showTagHTML (Tags xs) = concatMap showTagHTML xs +showTagHTML (TagBold x) = "" ++ showTagHTML x ++ "" +showTagHTML (TagUnderline x) = "" ++ showTagHTML x ++ "" +showTagHTML (TagHyperlink url x) = "" ++ showTagHTML x ++ "" +showTagHTML (TagColor i x) = "" ++ showTagHTML x ++ "" hunk ./src/Web/Page.hs 34 - ," " + ," " hunk ./src/res/hoogle.css 71 - background-color: #def; hunk ./src/res/hoogle.css 72 - border-top: 1px solid #36c; + /* nicer colors, but do not work for type search coloring */ + background-color: #f4f4f4; + border-top: 1px solid #bbb; /* #36c; */ hunk ./src/res/hoogle.css 141 -.c1{background-color: #fcc;} -.c2{background-color: #cfc;} -.c3{background-color: #ccf;} -.c4{background-color: #ffc;} -.c5{background-color: #fcf;} -.c6{background-color: #cff;} +.c0{background-color: #fcc;} +.c1{background-color: #cfc;} +.c2{background-color: #ccf;} +.c3{background-color: #ffc;} +.c4{background-color: #fcf;} +.c5{background-color: #cff;} }