/*

 ParsingGet — jQuery plugin
 Version: 0.1
 Author: M.Ulyanov (web.ulyanov@gmail.com)
 Site: http://web-ulyanov.ru
 Source && Doc: https://github.com/M-Ulyanov/ParsingGet
 Example: #

 */

(function($) {

	jQuery.fn.parsingGet = function(options) {

		// Параметры по умолчанию
		var defaults = $.extend({}, {
		
		}, options); 

		// С какими элементами будем работать
		var arrInput = [
										'input[type="text"]', 
										'input[type="color"]',
										'input[type="date"]',
										'input[type="hidden"]',
										'input[type="datetime"]',
										'input[type="datetime-local"]',
										'input[type="email"]',
										'input[type="number"]',
										'input[type="range"]',
										'input[type="search"]',
										'input[type="tel"]',
										'input[type="time"]',
										'input[type="url"]',
										'input[type="month"]',
										'input[type="week"]'
									];

		// Получение и разбор GET параметров в ассоциативный массив
		var url = window.location.href;
		var hash = url.slice(url.indexOf('?') + 1).split('&');
		var ObjParams = {};

		for(var i = 0; i < hash.length; i++) {
			var iHash = hash[i].split('=');
			var key = decodeURIComponent(iHash[0]);
			var value = decodeURIComponent(iHash[1].replace(/\+/g, ' '));

			if(key in ObjParams) { 
        if(typeof ObjParams[key] == 'string') {
        	ObjParams[key] = [ObjParams[key]];
        }
      	ObjParams[key].push(value);
      } 
      else {
        ObjParams[key] = value;
      }

		};

		// Основной цикл
		return this.each(function() {
			
			// Input
			for(var i = 0; i < arrInput.length; i++) {
				$(this).find(arrInput[i]).each( function() {
	          var name = $(this).attr('name');
	          var val  = ObjParams[name];
	          if(!!val) {
	            $(this).val(val);
	          }
	      });
			}

		});
	}

})(jQuery);




@@ -385,23 +385,16 @@
 put = %5B%0A
-%09%09%09%09%09%09%09
 %09%09%09'inpu
@@ -411,23 +411,16 @@
 xt%22%5D', %0A
-%09%09%09%09%09%09%09
 %09%09%09'inpu
@@ -433,31 +433,24 @@
 =%22color%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -458,31 +458,24 @@
 e=%22date%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -485,31 +485,24 @@
 %22hidden%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -510,39 +510,32 @@
 e=%22datetime%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Btype=%22
@@ -549,31 +549,24 @@
 e-local%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -575,31 +575,24 @@
 =%22email%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -602,31 +602,24 @@
 %22number%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -628,31 +628,24 @@
 =%22range%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -655,31 +655,24 @@
 %22search%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -679,31 +679,24 @@
 pe=%22tel%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -704,31 +704,24 @@
 e=%22time%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -728,31 +728,24 @@
 pe=%22url%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'input%5Bty
@@ -758,23 +758,16 @@
 nth%22%5D',%0A
-%09%09%09%09%09%09%09
 %09%09%09'inpu
@@ -782,23 +782,16 @@
 week%22%5D'%0A
-%09%09%09%09%09%09%09
 %09%09%5D;%0A%0A%09%09

update style code