[Try and propagate ajax=1 flags through the web pages, fairly hacky and not very general
Neil Mitchell**20110112104341] {
hunk ./src/Hoogle/Type/TagStr.hs 123
- -- FIXME: this is overly specific!
- g (TagLink "" x) = g (TagLink url x)
- where str = showTagText x
- url = if "http:" `isPrefixOf` str then str else "?hoogle=" ++% str
- g (TagLink url x) = "" ++ showTagHTML x ++ ""
+ g (TagLink url x) = "" ++ showTagHTML x ++ ""
hunk ./src/Web/All.hs 13
--- would like to use datadir, but not sure how
+-- FIXME: Should use datadir, but not sure how
+-- FIXME: Only server will preserve extra flags
hunk ./src/Web/All.hs 16
- res <- response "datadir/resources" q
+ res <- response "datadir/resources" [] q
hunk ./src/Web/Page.hs 2
-module Web.Page(header, footer, welcome) where
+module Web.Page(searchLink, header, footer, welcome) where
hunk ./src/Web/Page.hs 8
+searchLink :: Args -> String -> URL
+searchLink extra x = "?" ++ concat [a ++ "=" ++% b ++ "&" | (a,b) <- extra, a /= "hoogle"] ++ "hoogle=" ++% x
+
+
hunk ./src/Web/Page.hs 56
-welcome =
+welcome extra =
hunk ./src/Web/Page.hs 82
- search x = "" ++& x ++ "
"
+ search x = "" ++& x ++ "
"
hunk ./src/Web/Response.hs 22
-response :: FilePath -> CmdLine -> IO (Response String)
-response resources q = do
+response :: FilePath -> Args -> CmdLine -> IO (Response String)
+response resources extra q = do
hunk ./src/Web/Response.hs 31
- return $ runQuery ajax dbs q
+ return $ runQuery extra ajax dbs q
hunk ./src/Web/Response.hs 63
-runQuery :: Bool -> Database -> CmdLine -> [String]
-runQuery ajax dbs Search{queryParsed = Left err} =
+runQuery :: Args -> Bool -> Database -> CmdLine -> [String]
+runQuery extra ajax dbs Search{queryParsed = Left err} =
hunk ./src/Web/Response.hs 80
-runQuery ajax dbs q | isBlankQuery $ fromRight $ queryParsed q = welcome
+runQuery extra ajax dbs q | isBlankQuery $ fromRight $ queryParsed q = welcome extra
hunk ./src/Web/Response.hs 83
-runQuery ajax dbs cq@Search{queryParsed = Right q} =
+runQuery extra ajax dbs cq@Search{queryParsed = Right q, queryText = qt} =
hunk ./src/Web/Response.hs 87
- ["
" ++ showTagHTML (transform qurl sug) ++ "
" | Just sug <- [querySuggestions dbs q]] ++ + ["" ++ showTag extra sug ++ "
" | Just sug <- [querySuggestions dbs q]] ++ hunk ./src/Web/Response.hs 101 - res = [renderRes i (i /= 0 && i == start2 && prefix) x | (i,(_,x)) <- zip [0..] src] + res = [renderRes extra i (i /= 0 && i == start2 && prefix) x | (i,(_,x)) <- zip [0..] src] hunk ./src/Web/Response.hs 106 - ["