changeset 1758:0130532006c4

make changes recommended by jslint
author Roger Haase <crosseyedpenguin@yahoo.com>
date Tue, 28 Aug 2012 14:09:09 -0700
parents 22c5d8b59163
children 3c5f7739c5a2
files MoinMoin/templates/common.js
diffstat 1 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/common.js	Tue Aug 28 14:06:56 2012 -0700
+++ b/MoinMoin/templates/common.js	Tue Aug 28 14:09:09 2012 -0700
@@ -24,18 +24,22 @@
 
 // Highlight currently selected link in side panel. Executed on page load
 function selected_link() {
-   var selected = window.location.pathname;
-
-   var list = document.getElementsByClassName('panel');
-   for (var j = 0; j < list.length; j++) {
-      nav_links = list[j].getElementsByTagName('a');
+    "use strict";
+    var selected = window.location.pathname,
+        list = document.getElementsByClassName('panel'),
+        i,
+        j,
+        nav_links,
+        link;
+    for (j = 0; j < list.length; j += 1) {
+        nav_links = list[j].getElementsByTagName('a');
 
-      for (var i = 0; i < nav_links.length; i++) {
-         var link = nav_links[i].attributes.href.value;
+        for (i = 0; i < nav_links.length; i += 1) {
+            link = nav_links[i].attributes.href.value;
 
-             if (link == selected) {
-               nav_links[i].setAttribute('class', 'current-link');
-               break;
+            if (link === selected) {
+                nav_links[i].setAttribute('class', 'current-link');
+                break;
             }
         }
     }
@@ -286,12 +290,12 @@
     function moinwiki(subitem_name, fullname) {
         // note: keep the many plusses, to avoid jinja2 templating kicking in
         // when seeing two curly opening / closing braces
-        return "{"+"{" + fullname.replace("{"+"{", "\\"+"}"+"}") + "}"+"} ";
+        return "{" + "{" + fullname.replace("{" + "{", "\\" + "}" + "}") + "}" + "} ";
     }
     function mediawiki(subitem_name, fullname) {
         // note: keep the many plusses, to avoid jinja2 templating kicking in
         // when seeing two curly opening / closing braces
-        return "{"+"{:" + fullname.replace("}"+"}", "\\"+"}"+"}") + "}"+"} ";
+        return "{" + "{:" + fullname.replace("}" + "}", "\\" + "}" + "}") + "}" + "} ";
     }
     function rst(subitem_name, fullname) {
         return "\n.. include:: " + subitem_name + "\n";