produce href with hid in search part
184742
function(id, location) {
		var search = "?"+ (location.search || "") + "&hid=" + id;
		return (location.pathname || '/') 
			+ search
			+ (location.hash ? ("#" + location.hash) : "");
	}
1093978
function parentHref(href, noTrailingSlash) {
  href = str(href).replace(/\/\/+/g, '/');
  var pmatch = href.match(/(.*\/)[^/]+(\/$|$)/);
  return pmatch && (noTrailingSlash ? (pmatch[1].slice(0,-1) || '/') : pmatch[1]);
}
652743
def fixup_internal_links(config, soups):
  
  # Pages can come from different dirs; they can go to different dirs.
  # Thus, there's some relative-path-computing here.
  reverse_directory = {}
  for d, s in config['sources'].items():
    reverse_directory[s] = d
  for name, soup in soups.items():
    old_src_dir = os.path.dirname(config['sources'][name])
    for tag in soup.find_all(True):
      if not 'href' in tag.attrs:
        continue
      old_rel_path = tag['href'].split('#')[0]
      old_dst = os.path.normpath(os.path.join(old_src_dir, old_rel_path))
      if not old_dst in reverse_directory:
        continue
      new_dst = reverse_directory[old_dst] + '.html'
      new_rel_path = rel_href(name, new_dst)
      # string replace instead of assign to not loose anchor in foo.html#anchor
      tag['href'] = tag['href'].replace(old_rel_path, new_rel_path, 1)
573351
function searchFocus() {
  			if (dropDown.style.display !== "none") {
  				return;
  			}

  			dropDown.style.display = "block";
  			addEvent(document$$1, "click", hideHandler);
  			addEvent(document$$1, "keydown", hideHandler);

  			// Hide on Escape keydown or outside-container click
  			function hideHandler(e) {
  				var inContainer = moduleFilter.contains(e.target);

  				if (e.keyCode === 27 || !inContainer) {
  					if (e.keyCode === 27 && inContainer) {
  						moduleSearch.focus();
  					}
  					dropDown.style.display = "none";
  					removeEvent(document$$1, "click", hideHandler);
  					removeEvent(document$$1, "keydown", hideHandler);
  					moduleSearch.value = "";
  					searchInput();
  				}
  			}
  		}
582650
def __output_see(self, see):
        

        if see.startswith('<a href'):
            # HTML link -- <a href="...">...</a>
            return self.__html_to_rst(see)
        elif '"' in see:
            # Plain text
            return see
        else:
            # Type reference (default)
            return ':java:ref:`%s`' % (see.replace('#', '.').replace(' ', ''),)
195086
function( popup, modify_a_href )
        {
            var textbox = document.createElement('input');
            textbox.placeholder = 'www.example.com';
            if( modify_a_href )
                textbox.value = modify_a_href.href;
            textbox.style.width = '20em';
            textbox.style.maxWidth = parseInt(node_container.offsetWidth *2/3) + 'px';
            textbox.autofocus = true;
            if( modify_a_href )
                addEvent( textbox, 'input', function( e )
                {
                    var url = textbox.value.trim();
                    if( url )
                        modify_a_href.href = url;
                });
            addEvent( textbox, 'keypress', function( e )
            {
                var key = e.which || e.keyCode;
                if( key != 13 )
                    return;
                var url = textbox.value.trim();
                if( modify_a_href )
                    ;
                else if( url )
                {
                    var url_scheme = url;
                    if( ! /^[a-z0-9]+:\/\//.test(url) )
                        url_scheme = "http://" + url;
                    if( commands.getSelectedHTML() )
                        commands.insertLink( url_scheme );
                    else
                    {
                        // Encode html entities - http://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities
                        var htmlencode = function( text ) {
                            return text.replace(/[&<>"]/g, function(tag)
                            {
                                var charsToReplace = { '&':'&amp;', '<':'&lt;', '>':'&gt;', '"':'&quot;' };
                                return charsToReplace[tag] || tag;
                            });
                        }
                        commands.insertHTML( '<a href="' + htmlencode(url_scheme) + '">' + htmlencode(url) + '</a>' );
                    }
                }
                commands.closePopup().collapseSelection();
                node_contenteditable.focus();
            });
            popup.appendChild( textbox );
            // set focus
            window.setTimeout( function()
            {
                textbox.focus();
                add_class_focus();
            }, 1 );
        }
1278192
function makeUrl(s) {
  var search = window.location.search;

  // Remove previous grep query parameter if present
  if (search) {
    search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
  }

  return (
    window.location.pathname +
    (search ? search + '&' : '?') +
    'grep=' +
    encodeURIComponent(escapeRe(s))
  );
}
106474
public void setHref (String href) 
    {
        if (_forceProtocol) {
            // This will correct URLs that don't have http:// as well
            // as provide protection against JS injection
            if ( ! href.matches("^\\s*\\w+://.*")) {
                href = "http://" + href;
            }
        } else {
            // Always do some sort of JS protection
            if (href.trim().toLowerCase().startsWith("javascript:")) {
                // He's been a naughty boy
                href = "#";
            }
        }

        DOM.setElementProperty(getElement(), "href", href);
    }
318065
function getHighlightingProxy(item, match, document) {
  if (typeof Proxy === 'undefined') {
    return item;
  }
  return new Proxy({}, {
    get: function(rcvr, name) {
      var value = item[name];
      if (name !== 'name') {
        return value;
      }

      var startMatch = value.indexOf(match);
      if (startMatch === -1) {
        return value;
      }

      var before = value.substr(0, startMatch);
      var after = value.substr(startMatch + match.length);
      var parent = document.createElement('span');
      parent.appendChild(document.createTextNode(before));
      var highlight = document.createElement('span');
      highlight.classList.add('gcli-menu-typed');
      highlight.appendChild(document.createTextNode(match));
      highlight.dir = bidiUtils.getTextDirection(match);
      parent.appendChild(highlight);
      parent.appendChild(document.createTextNode(after));
      return parent;
    }
  });
}
276027
def url_unsplit (parts):
    """"""
    if parts[2] == default_ports.get(parts[0]):
        return "%s://%s%s" % (parts[0], parts[1], parts[3])
    return "%s://%s:%d%s" % parts
453226
function(_url,_href){
            if (!_url) return;
            var _info = location.parse(_url);
            this._$dispatchEvent('onbeforechange',_info);
            var _umi = this.__doRewriteUMI(
                _info.path,_href||_info.href
            );
            return this.__groups[this.__pbseed]._$hasUMI(_umi);
        }
484866
function cleanUrl(url) {
    "use strict";
    if (url.toLowerCase().indexOf('http') !== 0) {
        return url;
    }
    var a = document.createElement('a');
    a.href = url;
    return a.href;
}
112962
function QueryString(search) {
        "use strict";
    
        if (search.substr(0, 1) === '?') {
            search = search.substr(1);
        }
    
        search = search.split('&')
    
        if (search == "") return {};
    
        for (var i = 0; i < search.length; ++i) {
    
            var param = search[i].split('=', 2);
            if (param.length != 2) {
                continue;
            }
    
            this[param[0]] = decodeURIComponent(param[1].replace(/\+/g, " "));
    
        }
    
    }
715623
def safe_url(url):
    """"""
    parsed = urlparse(url)
    if parsed.password is not None:
        pwd = ':%s@' % parsed.password
        url = url.replace(pwd, ':*****@')
    return url
898160
function(needle, haystack) {
		var m = false;

		for (var i in haystack) {
			if (i === '*') m = '*';
			else if (urlglob(i, needle)) return i;
		}

		return m;
	}
1098016
def search_results_last_url(html, xpath, label):
    
    for container in html.findall(xpath):
        if container.text_content().strip() == label:
            return container.find('.//a').get('href')
1131156
function renderSearchResults(items){
    var html = '';

    // Loop through items, building up an HTML string
    for(var i = 0; i < items.length; i += 1){
      var f = items[i];
      html += [
        '<a class="item" data-value="', f.fullPath, '.html">',
          '<span class="score">', ~~f.score, '</span>',
          '<span class="filename">', highlightString(f.fileName, f.highlight.fileName), '</span>',
          '<span class="fullpath">', highlightString(f.fullPath, f.highlight.fullPath), '</span>',
        '</a>'
      ].join('');
    }

    // Dump all the html into the results list
    document.getElementById('searchresults').innerHTML = html;

    // Select the first item
    selectIndex(0);
  }