'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('imgViewer.jquery.json'),
    banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
    // Task configuration.
    clean: {
      files: ['dist']
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/<%= pkg.name %>.js'],
        dest: 'dist/<%= pkg.name %>.js'
      },
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      },
    },
    qunit: {
		all: {
			options: {
				urls: ['1.8.0', '1.9.0', '2.0.0'].map(function(version) {
					return 'http://localhost:<%= connect.server.options.port %>/test/imgViewer.html?jquery='+version;
				})
			}
		}
    },
    jshint: {
      gruntfile: {
        options: {
          jshintrc: '.jshintrc'
        },
        src: 'Gruntfile.js'
      },
      src: {
        options: {
          jshintrc: 'src/.jshintrc'
        },
        src: ['src/**/*.js']
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/**/*.js']
      },
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
    },
	connect: {
		server: {
			options: {
				port: 8085
			}
		}
	},
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  
  // Default task.
  grunt.registerTask('default', ['connect','jshint', 'qunit', 'clean', 'concat', 'uglify']);
  grunt.registerTask('test', ['connect','jshint', 'qunit']);
  
};

@@ -1032,13 +1032,61 @@
 ls: 
-%5B'1.8
+(function() %7B%0A%09%09%09%09%09var res = %5B%5D;%0A%09%09%09%09%09%5B'2.0.1', '1.10
 .0',
@@ -1095,25 +1095,31 @@
 1.9.
-0
+1
 ', '
-2.0.0'%5D.map(
+1.8.3' %5D.forEach( 
 func
@@ -1123,16 +1123,18 @@
 unction(
+jq
 version)
@@ -1145,15 +1145,87 @@
 %09%09%09%09
-return 
+%09%5B'1.10.3', '1.9.2', '1.8.24'%5D.forEach( function(uiversion) %7B%0A%09%09%09%09%09%09%09this.push(
 'htt
@@ -1305,24 +1305,104 @@
 ry='
-+
+ + jq
 version
+ + '&jquery-ui=' + uiversion);%0A%09%09%09%09%09%09%7D, this);%0A%09%09%09%09%09%7D, res);%0A%09%09%09%09%09return res
 ;%0A%09%09%09%09%7D)
 %0A%09%09%09
@@ -1397,16 +1397,18 @@
 ;%0A%09%09%09%09%7D)
+()
 %0A%09%09%09%7D%0A%09%09

Add quint test driver to test against various versions of jQuery and jQuery-ui