From d282856370ca7f590c232407209c3aa991854427 Mon Sep 17 00:00:00 2001 From: Umaroth Date: Fri, 5 May 2017 19:12:19 -0400 Subject: [PATCH 1/5] Added JSON Ajax feed type, random feed order and general code improvements General code improvements: -Removed implicit variable declarations -Uniformed preceding spaces into tabs -Removed unnecessary semicolons -Changed all comparisons to strict -Removed following empty space -Fixed broken comparison --- includes/jquery.ticker.js | 228 +++++++++++++++++++++----------------- 1 file changed, 127 insertions(+), 101 deletions(-) diff --git a/includes/jquery.ticker.js b/includes/jquery.ticker.js index 96799e8..60adb71 100755 --- a/includes/jquery.ticker.js +++ b/includes/jquery.ticker.js @@ -11,15 +11,15 @@ You should have received a copy of the GNU General Public License along with jQuery News Ticker. If not, see . */ -(function($){ - $.fn.ticker = function(options) { +(function($){ + $.fn.ticker = function(options) { // Extend our default options with those provided. // Note that the first arg to extend is an empty object - // this is to keep from overriding our "defaults" object. var opts = $.extend({}, $.fn.ticker.defaults, options); // check that the passed element is actually in the DOM - if ($(this).length == 0) { + if ($(this).length === 0) { if (window.console && window.console.log) { window.console.log('Element does not exist in DOM!'); } @@ -42,6 +42,7 @@ /* Internal vars */ var settings = { position: 0, + prevPosition: 0, time: 0, distance: 0, newsArr: {}, @@ -64,24 +65,25 @@ }; // if we are not using a UL, display an error message and stop any further execution - if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { + if (tagType !== 'UL' && tagType !== 'OL' && opts.htmlFeed === true) { debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type