Sha256: 7bc4de9ad9794550b60c90e9096f6457de39857023872f2269dccdc34c8ca60b

Contents?: true

Size: 1.3 KB

Versions: 17

Compression:

Stored size: 1.3 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().q;


$('#searchIframe').attr('src', "https://search.linaro.org/search/?fields.label="{{site.data.company.search-label}}"&q=" + searchQuery);

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
linaro-jekyll-theme-0.6.6 assets/js/app/search.js
linaro-jekyll-theme-0.6.5 assets/js/app/search.js
linaro-jekyll-theme-0.5.5 assets/js/app/search.js
linaro-jekyll-theme-0.5.4 assets/js/app/search.js
linaro-jekyll-theme-0.5.3 assets/js/app/search.js
linaro-jekyll-theme-0.5.2 assets/js/app/search.js
linaro-jekyll-theme-0.5.1 assets/js/app/search.js
linaro-jekyll-theme-0.5.0 assets/js/app/search.js
linaro-jekyll-theme-0.4.9 assets/js/app/search.js
linaro-jekyll-theme-0.4.8 assets/js/app/search.js
linaro-jekyll-theme-0.4.7 assets/js/app/search.js
linaro-jekyll-theme-0.4.6 assets/js/app/search.js
linaro-jekyll-theme-0.4.5 assets/js/app/search.js
linaro-jekyll-theme-0.4.4 assets/js/app/search.js
linaro-jekyll-theme-0.4.3 assets/js/app/search.js
linaro-jekyll-theme-0.4.2 assets/js/app/search.js
linaro-jekyll-theme-0.4.1 assets/js/app/search.js