summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2014-08-02 20:36:48 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2014-08-02 20:36:48 +0100
commit915d3291ab57d59e41877c98dba97d6388c56a35 (patch)
tree3b808e771f68cb557cb179faa3a15b2ee1dd39f6
parent6a6377123716b5a41222fbca29ba7515a8ab3976 (diff)
parentca937cdba8246eb21357e4147a568709c62a5463 (diff)
downloadNim-915d3291ab57d59e41877c98dba97d6388c56a35.tar.gz
Merge branch 'gradha-pr_updates_babel_js' into devel
-rw-r--r--doc/lib.txt6
-rw-r--r--web/babelpkglist.nim11
2 files changed, 8 insertions, 9 deletions
diff --git a/doc/lib.txt b/doc/lib.txt
index 2da753007..5bacfcc4f 100644
--- a/doc/lib.txt
+++ b/doc/lib.txt
@@ -594,7 +594,8 @@ compiler.
 
 .. raw:: html
 
-  <div id="officialPkgList"></div>
+  <div id="officialPkgList"><b>If you are reading this you are missing
+  babelpkglist.js or have javascript disabled in your browser.</b></div>
 
 Unofficial packages
 -------------------
@@ -605,7 +606,8 @@ Nimrod programming language.
 
 .. raw:: html
 
-  <div id="unofficialPkgList"></div>
+  <div id="unofficialPkgList"><b>If you are reading this you are missing
+  babelpkglist.js or have javascript disabled in your browser.</b></div>
 
   <script type="text/javascript" src="babelpkglist.js"></script>
   <script type="text/javascript" src="http://build.nimrod-lang.org/packages?callback=gotPackageList"></script>
diff --git a/web/babelpkglist.nim b/web/babelpkglist.nim
index 8745c9f99..5da7d60a9 100644
--- a/web/babelpkglist.nim
+++ b/web/babelpkglist.nim
@@ -21,7 +21,7 @@ proc processContent(content: string) =
   var jsonArr = jsonDoc.elems
 
   jsonArr.sort do (x, y: PJsonNode) -> int:
-    system.cmp(x["name"].str, y["name"].str)
+    strutils.cmpIgnoreCase(x["name"].str, y["name"].str)
 
   var
     officialList = ""
@@ -38,8 +38,7 @@ proc processContent(content: string) =
       else: pkg["url"].str
     let
       desc = pkg["description"].str
-      # Review array index access when #1291 is solved.
-      dot = if desc.high > 0 and desc[<desc.high] in endings: "" else: "."
+      dot = if desc.high > 0 and desc[desc.high] in endings: "" else: "."
       listItem = li(a(href=pkgWeb, pkg["name"].str), " ", desc & dot)
     if pkg["url"].str.startsWith("git://github.com/nimrod-code") or
        "official" in pkg["tags"].elems:
@@ -51,19 +50,17 @@ proc processContent(content: string) =
 
   var officialPkgListDiv = document.getElementById("officialPkgList")
 
-  officialPkgListDiv.innerHTML.add(
+  officialPkgListDiv.innerHTML =
     p("There are currently " & $officialCount &
       " official packages in the Babel package repository.") &
     ul(officialList)
-  )
 
   var unofficialPkgListDiv = document.getElementById("unofficialPkgList")
 
-  unofficialPkgListDiv.innerHTML.add(
+  unofficialPkgListDiv.innerHTML =
     p("There are currently " & $unofficialCount &
       " unofficial packages in the Babel package repository.") &
     ul(unofficialList)
-  )
 
 proc gotPackageList(apiReply: TData) {.exportc.} =
   let decoded = decodeContent($apiReply.content)