var transformToAssocArray; transformToAssocArray = function(prmstr) { var i, params, prmarr, tmparr; params = {}; prmarr = prmstr.split('&'); i = 0; while (i < prmarr.length) { tmparr = prmarr[i].split('='); params[tmparr[0]] = tmparr[1]; i++; } return params; }; var getSearchParameters; getSearchParameters = function() { var prmstr; prmstr = decodeURIComponent(window.location.search.substr(1)); if (prmstr != null && prmstr != '') { return transformToAssocArray(prmstr); } else { return {}; } }; $(document).ready(function() { var searchval; var searchval $('#name').change(function() { $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/main.html?search=' + $('#name').val()); $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/blogsearch.html?search=' + $('#name').val()); }); $('#name').val(getSearchParameters().search); if (getSearchParameters().search === void 0) { $('#name').val(''); } $('#name').bind('oninput', function() { $('#name').val(this); }); $('#button').click(function() { var url; url = void 0; searchval = $('#name').val(); document.location.href = '/index/main.html?search=' + searchval; }); $('#button').click(function() { var url; url = void 0; searchval = $('#name').val(); document.location.href = '/index/main.html?search=' + searchval; }); $('#name').keypress(function(e) { if (e.which === 13) { $('#button').trigger('click'); } }); $('ul.nav-tabs > li:nth-child(1) > a').attr('href', '/index/main.html?search=' + $('#name').val()); $('ul.nav-tabs > li:nth-child(2) > a').attr('href', '/index/blogsearch.html?search=' + $('#name').val()); }); function Add(){ AddValue(""); }; var myApp = angular.module('myApp', []); myApp.controller('AppController', function($scope) { $scope.steps = {}; });