hoogle 4.2.37 → 4.2.38
raw patch · 7 files changed
+64/−20 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +3/−0
- datadir/resources/hoogle.css +8/−9
- datadir/resources/hoogle.js +42/−2
- hoogle.cabal +2/−2
- src/Recipe/Cabal.hs +4/−4
- src/Recipe/Command.hs +1/−1
- src/Web/Response.hs +4/−2
CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for Hoogle +4.2.38+ #96, allow certicate verification failures+ #95, allow a higher version of Cabal on older GHCs 4.2.37 #94, GHC 7.10 support 4.2.36
datadir/resources/hoogle.css view
@@ -168,6 +168,8 @@ h1 { padding: 5px; margin-top: 0px;+ margin-bottom: 0px;+ padding-bottom: 0px; font-weight: normal; padding-left: 170px; font-size: 16px;@@ -211,11 +213,16 @@ * RESULTS */ -.ans, .doc, .from {+.result { margin-left: 170px; margin-right: 20px;+ margin-top: 1.5em; } +.result.active {+ background-color: #f7f5c0;+}+ .from, .doc { margin-top: 0.4em; }@@ -236,14 +243,6 @@ border-top: 1px solid #CCCCCC; font-size: 16px; padding: 0.2em 0.5em;-}--.from + .ans {- margin-top: 1.5em;-}--.doc + .ans {- margin-top: 1.5em; } .ans .a {
datadir/resources/hoogle.js view
@@ -1,4 +1,3 @@- var embed = false; // are we running as an embedded search box var instant = false; // should we search on key presses var query = parseQuery(); // what is the current query string@@ -353,7 +352,7 @@ { contents["#" + key] = val; },- + ask: function(key) { return contents["#" + key];@@ -386,3 +385,44 @@ xdr.open("get", args.url + url); xdr.send(); }++function on_arrow_press(ev) {+ var offset = 0;+ if (ev.keyCode == Key.Up) {+ offset = -1;+ } else if (ev.keyCode == Key.Down) {+ offset = +1;+ } else if (ev.keyCode != Key.Return) {+ return;+ }++ // Figure out where we are+ var results = $("div#body .result");+ var activeResults = $("div#body .result.active");+ var activeRow = -1;+ if (activeResults.length == 1) {+ activeRow = results.index(activeResults[0]);+ }++ if (ev.keyCode == Key.Return) {+ if (activeRow >= 0)+ document.location.href = $("a", activeResults).attr("href");+ } else {+ var newRow = activeRow + offset;+ var $activeRow = $(results[activeRow]);+ if (newRow < 0) {+ $activeRow.removeClass("active");+ $hoogle.focus();+ } else if (newRow < results.length) {+ var $newRow = $(results[newRow]);+ if (activeRow >= 0)+ $activeRow.removeClass("active");+ $newRow.addClass("active");+ $hoogle.blur();+ }+ }+}++$(document).ready(function() {+ $(document).keyup(on_arrow_press);+});
hoogle.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 build-type: Simple name: hoogle-version: 4.2.37+version: 4.2.38 license: BSD3 license-file: docs/LICENSE category: Development@@ -15,7 +15,7 @@ or by approximate type signature. homepage: http://www.haskell.org/hoogle/ bug-reports: https://github.com/ndmitchell/hoogle/issues-tested-with: GHC==7.10.1, GHC==7.8.3, GHC==7.6.3, GHC==7.4.2+tested-with: GHC==7.10.1, GHC==7.8.3, GHC==7.6.3 extra-source-files: README.md CHANGES.txt
src/Recipe/Cabal.hs view
@@ -13,7 +13,7 @@ import Distribution.Verbosity import Distribution.Version import Recipe.Haddock-#if __GLASGOW_HASKELL__ >= 710+#if MIN_VERSION_Cabal(1,22,0) import Language.Haskell.Extension (Language(..)) #endif @@ -33,9 +33,7 @@ pkg <- readPackageDescription silent file let plat = Platform I386 Linux compid = CompilerId GHC (Version ghcVersion [])-#if __GLASGOW_HASKELL__ < 710- comp = compid-#else+#if MIN_VERSION_Cabal(1,22,0) comp = CompilerInfo { compilerInfoId = compid , compilerInfoAbiTag = NoAbiTag@@ -46,6 +44,8 @@ -- 'Distribution.Simple.GHC.Internal'. , compilerInfoExtensions = Nothing }+#else+ comp = compid #endif pkg <- return $ case finalizePackageDescription [] (const True) plat comp [] pkg of Left _ -> flattenPackageDescription pkg
src/Recipe/Command.hs view
@@ -40,7 +40,7 @@ type Downloader = FilePath -> URL -> String wget2 :: Downloader-wget2 fp url = "wget -nv " ++ url ++ " --output-document=" ++ fp+wget2 fp url = "wget -nv --no-check-certificate " ++ url ++ " --output-document=" ++ fp curl :: Downloader curl fp url = "curl -sSL " ++ url ++ " --output " ++ fp
src/Web/Response.hs view
@@ -137,7 +137,7 @@ ["<p>No results found</p>"] else concat (pre ++ now)- else+ else concat now) ++ ["<p><a href=\"" ++& urlMore ++ "\" class='more'>Show more results</a></p>" | not $ null post] where@@ -172,10 +172,12 @@ renderRes :: Int -> Bool -> Result -> [String] renderRes i more Result{..} = ["<a name='more'></a>" | more] +++ ["<div class='result'>"] ++ ["<div class='ans'>" ++ href selfUrl (showTagHTMLWith url self) ++ "</div>"] ++ ["<div class='from'>" ++ intercalate ", " [unwords $ zipWith (f u) [1..] ps | (u,ps) <- locations] ++ "</div>" | not $ null locations] ++ ["<div class='doc " ++ (if '\n' `elem` s then " newline" else "") ++ "'><span>" ++ showTag docs ++ "</span></div>"- | let s = showTagText docs, s /= ""]+ | let s = showTagText docs, s /= ""] +++ ["</div>"] where selfUrl = head $ map fst locations ++ [""] f u cls (url,text) = "<a class='p" ++ show cls ++ "' href='" ++ url2 ++ "'>" ++ text ++ "</a>"