From 1bd4720304021f7e98e7ffb230be151c1527771d Mon Sep 17 00:00:00 2001 From: Saivann Date: Fri, 10 Jul 2015 13:55:28 -0400 Subject: [PATCH] Enable use of "use strict" and fix two global variable declarations --- js/base.js | 2 ++ js/devsearch.js | 2 ++ js/events.js | 3 +++ js/ie.js | 4 +++- js/main.js | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/js/base.js b/js/base.js index 7b34f4bc..f437e27d 100644 --- a/js/base.js +++ b/js/base.js @@ -4,6 +4,8 @@ // This file should be used only for javascript code // necessary for all pages to work properly. +"use strict" + function addEvent(a, b, c) { // Attach event to a DOM node. // Ex. addEvent(node,'click',function); diff --git a/js/devsearch.js b/js/devsearch.js index befed212..56462eb5 100644 --- a/js/devsearch.js +++ b/js/devsearch.js @@ -19,6 +19,8 @@ Nested loops below: {% endcomment %} +"use strict" + var search_data = [ {% for list in site.devsearches %}{% for item in list %} {% if forloop.first %}{% capture category_name %}{{item}}{% endcapture %} diff --git a/js/events.js b/js/events.js index 9ddf9908..0d446cd1 100644 --- a/js/events.js +++ b/js/events.js @@ -1,6 +1,9 @@ --- layout: null --- + +"use strict" + var zoom=2; var minzoom=1; if(isMobile())var zoom=minzoom=0; diff --git a/js/ie.js b/js/ie.js index fff9f03e..deb13a57 100644 --- a/js/ie.js +++ b/js/ie.js @@ -1,6 +1,8 @@ // This file is licensed under the MIT License (MIT) available on // http://opensource.org/licenses/MIT. +"use strict" + function pngfix(){ //Allows IE6 to render transparent png var arVersion = navigator.appVersion.split("MSIE") @@ -38,7 +40,7 @@ if ((version >= 5.5) && (document.body.filters)) } //Let other scripts know browser is IE6-7 -legacyIE=true; +var legacyIE=true; //Render all transparent pngs window.onload=pngfix; diff --git a/js/main.js b/js/main.js index b05fdf31..dd791a28 100644 --- a/js/main.js +++ b/js/main.js @@ -4,6 +4,8 @@ // This file is used for javascript code // necessary for some pages to work properly. +"use strict" + function getWidth(a) { // Return the integer value of the computed width of a DOM node. // Ex. getWidth(node); @@ -189,6 +191,7 @@ function updateToc() { var pageoffset; var windowy; var toc; +var fallback; var first; var last; var closer;