Sha256: 2ea822452fa8165650318f2188fe16120a6030ae00dc2b39dd516844aaff0347

Contents?: true

Size: 1.26 KB

Versions: 32

Compression:

Stored size: 1.26 KB

Contents

function getAllUrlParams(url) {
      var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
      var obj = {};
      if (queryString) {
        queryString = queryString.split('#')[0];
        var arr = queryString.split('&');

        for (var i=0; i<arr.length; i++) {
          var a = arr[i].split('=');
          var paramNum = undefined;
          var paramName = a[0].replace(/\[\d*\]/, function(v) {
            paramNum = v.slice(1,-1);
            return '';
          });

          var paramValue = typeof(a[1])==='undefined' ? true : a[1];
          paramName = paramName.toLowerCase();
          paramValue = paramValue.toLowerCase();
          if (obj[paramName]) {
            if (typeof obj[paramName] === 'string') {
              obj[paramName] = [obj[paramName]];
            }
            if (typeof paramNum === 'undefined') {
              obj[paramName].push(paramValue);
            }
            else {
              obj[paramName][paramNum] = paramValue;
            }
          }
          else {
            obj[paramName] = paramValue;
          }
        }
      }
      return obj;
    }

var searchQuery = getAllUrlParams().s;

$('#searchIframe').attr('src', "https://search.linaro.org/search/?fields.label=Linaro&q=" + searchQuery);

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
jumbo-jekyll-theme-1.4.2.20 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.19 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.18 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.17 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.16 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.15 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.14 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.13 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.12 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.11 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.9 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.8 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.7 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.6 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.5 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.4 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.3 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.2 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.1 assets/js/app/search-page.js
jumbo-jekyll-theme-1.4.2.0 assets/js/app/search-page.js