Sha256: 40af741e646a6322b85b42e1a7d699e0f0400e3ea5ff3f103cd310319a767aac

Contents?: true

Size: 1.26 KB

Versions: 80

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

80 entries across 80 versions & 1 rubygems

Version Path
jumbo-jekyll-theme-1.4.3.27 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.26 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.25 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.24 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.23 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.22 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.21 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.20 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.19 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.18 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.17 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.16 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.15 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.14 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.13 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.12 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.11 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.10 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.9 assets/js/app/search.js
jumbo-jekyll-theme-1.4.3.8 assets/js/app/search.js