From b969407a507b0cdaa54433bf2eb221f9203f0b44 Mon Sep 17 00:00:00 2001 From: VodkaBears Date: Sat, 2 May 2015 01:12:40 +0300 Subject: [PATCH] Make refactoring of jquery-loader.js --- Gruntfile.js | 4 ++-- libs/jquery-loader.js | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 247aab4b..759cf5a9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,7 +42,7 @@ module.exports = function(grunt) { src: 'src/**/*.js' }, test: { - src: 'test/**/*.js' + src: ['test/**/*.js', 'libs/jquery-loader.js'] }, options: { jshintrc: '.jshintrc' @@ -57,7 +57,7 @@ module.exports = function(grunt) { src: 'src/**/*.js' }, test: { - src: 'test/**/*.js' + src: ['test/**/*.js', 'libs/jquery-loader.js'] } }, diff --git a/libs/jquery-loader.js b/libs/jquery-loader.js index d99fa7b6..c9b3748f 100644 --- a/libs/jquery-loader.js +++ b/libs/jquery-loader.js @@ -1,6 +1,12 @@ -(function () { - // Get any jquery=___ param from the query string. - var jqversion = location.search.match(/[?&]jquery=(.*?)(?=&|$)/); +!(function() { - document.write(""); + // Get any lib=___ param from the query string. + var library = location.search.match(/[?&]lib=(.*?)(?=&|$)/); + + /* jshint -W060 */ + if (library) { + document.write(''); + } else { + document.write(''); + } }());