Returns +'active'+ if the given external page is in the current url path or +nil+.
353983
def external_page_css_class(page)
      return nil if !page.redirects_to_external?
      request.path.split('/').delete_if(&:blank?).first == page.urlname.gsub(/^\//, '') ? 'active' : nil
    end
621218
def visit_link?(link, from_page = nil)
      !@pages.has_page?(link) &&
      !skip_link?(link) &&
      !skip_query_string?(link) &&
      allowed(link) &&
      !too_deep?(from_page)
    end
1341773
function checkUrl() {
					if (new UriParameters(window.location.href).get("sap-ui-xx-asyncRouting") === "true") {
						Log.warning("Activation of async view loading in routing via url parameter is only temporarily supported and may be removed soon", "MobileTarget");
						return true;
					}
					return false;
				}
678594
def find
      path = clean_content_pathname.join(page_id.tr("\\", "/")).cleanpath.to_s
      if !path.start_with?("#{clean_content_pathname}/")
        raise InvalidPageIdError.new "Invalid page id: #{page_id}"
      end
      path
    rescue ArgumentError
      raise InvalidPageIdError.new "Invalid page id: #{page_id}"
    end
879397
def webView(in_web, shouldStartLoadWithRequest:in_request, navigationType:in_type)
      if %w(http https).include?(in_request.URL.scheme)
        if self.external_links == true && in_type == UIWebViewNavigationTypeLinkClicked
          if defined?(OpenInChromeController)
            open_in_chrome in_request
          else
            open_in_safari in_request
          end
          return false # don't allow the web view to load the link.
        end
      end

      load_request_enable = true #return true on default for local file loading.
      load_request_enable = !!on_request(in_request, in_type) if self.respond_to?(:on_request)
      load_request_enable
    end
130305
function pathIsActive(pathname, currentPathname) {
  // Normalize leading slash for consistency. Leading slash on pathname has
  // already been normalized in isActive. See caveat there.
  if (currentPathname.charAt(0) !== '/') {
    currentPathname = '/' + currentPathname;
  }

  // Normalize the end of both path names too. Maybe `/foo/` shouldn't show
  // `/foo` as active, but in this case, we would already have failed the
  // match.
  if (pathname.charAt(pathname.length - 1) !== '/') {
    pathname += '/';
  }
  if (currentPathname.charAt(currentPathname.length - 1) !== '/') {
    currentPathname += '/';
  }

  return currentPathname === pathname;
}
1364050
function isActive(_ref, indexOnly, currentLocation, routes, params) {
  var pathname = _ref.pathname;
  var query = _ref.query;

  if (currentLocation == null) return false;

  // TODO: This is a bit ugly. It keeps around support for treating pathnames
  // without preceding slashes as absolute paths, but possibly also works
  // around the same quirks with basenames as in matchRoutes.
  if (pathname.charAt(0) !== '/') {
    pathname = '/' + pathname;
  }

  if (!pathIsActive(pathname, currentLocation.pathname)) {
    // The path check is necessary and sufficient for indexOnly, but otherwise
    // we still need to check the routes.
    if (indexOnly || !routeIsActive(pathname, routes, params)) {
      return false;
    }
  }

  return queryIsActive(query, currentLocation.query);
}
1183539
function () {

      // helper method to assert if a given url is local
      function isLocal(url) {
        var loc = document.location,
            reg = new RegExp("^\\.|^\/(?!\/)|^[\\w]((?!://).)*$|" + loc.protocol + "//" + loc.host);
        return url.match(reg);
      }

      // gather all resources
      var scripts = document.getElementsByTagName("script"),
          links = document.getElementsByTagName("link"),
          uris = [];

      // track local js urls
      for (var i = 0; i < scripts.length; i++) {
        var script = scripts[i], src = script.getAttribute("src");
        if (src && isLocal(src))
          uris.push(src);
        if (src && src.match(/\blive.js#/)) {
          for (var type in active)
            active[type] = src.match("[#,|]" + type) != null
          if (src.match("notify")) 
            alert("Live.js is loaded.");
        }
      }
      if (!active.js) uris = [];
      if (active.html) uris.push(document.location.href);

      // track local css urls
      for (var i = 0; i < links.length && active.css; i++) {
        var link = links[i], rel = link.getAttribute("rel"), href = link.getAttribute("href", 2);
        if (href && rel && rel.match(new RegExp("stylesheet", "i")) && isLocal(href)) {
          uris.push(href);
          currentLinkElements[href] = link;
        }
      }

      // initialize the resources info
      for (var i = 0; i < uris.length; i++) {
        var url = uris[i];
        Live.getHead(url, function (url, info) {
          resources[url] = info;
        });
      }

      // add rule for morphing between old and new css files
      var head = document.getElementsByTagName("head")[0],
          style = document.createElement("style"),
          rule = "transition: all .3s ease-out;"
      css = [".livejs-loading * { ", rule, " -webkit-", rule, "-moz-", rule, "-o-", rule, "}"].join('');
      style.setAttribute("type", "text/css");
      head.appendChild(style);
      style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css));

      // yep
      loaded = true;
    }
27813
def active(self, include=None):
        
        return self._get(self._build_url(self.endpoint.active(include=include)))
1082370
def add_indirect_path(node, path, params)
      parts = url_parts(path)

      parts.each_with_index do |part, index|
        if has_binding?(part)
          # Strip off {{ and }}
          section_matcher, multipart = binding_extract(part)

          if multipart
            # Match anything for the rest of the url (multiple sections)

            # check that the splat is at the end of the url
            if index != (parts.size-1)
              raise "The splat (*) operator can only be used at the end of a url"
            end

            part = '**'
            index = (index..-1)
          else
            # Match anything in a single section, set the part to be '*'
            part = '*'
          end

          params[section_matcher] = index
        end

        node = (node[part] ||= {})
      end

      node[nil] = params
    end
497609
def legacy_page_redirect_url
      page = last_legacy_url.page
      return unless page

      alchemy.show_page_path(
        locale: prefix_locale? ? page.language_code : nil,
        urlname: page.urlname
      )
    end
868201
def method_missing(m, *args, &block)
      if m.to_s.end_with?("_url") || m.to_s.end_with?("_path")
        "/"
      else
        super
      end
    end
1310825
def return_current_uri_page_only(self):
        
        uri = post_slash("%s%s" % (post_slash(self.current_dir()),
                         self.slots['page']))
        return uri
776421
def path(self, which=None):
        
        if which == 'refresh':
            return '{0}/{1}'.format(
                super(ExternalUserGroup, self).path(which='self'),
                which
            )
        return super(ExternalUserGroup, self).path(which)
350399
public function findActivePageByUri($currentUri)
    {
        $foundPages = [];
        $siteUrl = url()->current();

        $pages = $this->getPages();

        foreach ($pages as $page) {
            $url = $page->getUrl();
            $len = strpos($url, $siteUrl);
            if ($len !== false) {
                $len += strlen($siteUrl);
            }

            $url = substr($url, $len);

            $len = strpos($currentUri, $siteUrl);
            if ($len !== false) {
                $len += strlen($siteUrl);
            }

            if (! empty($url)) {
                $uri = substr($currentUri, $len);
                $pos = strpos($uri, $url);

                if ($pos !== false) {
                    $foundPages[strlen(substr($uri, strlen($url)))] = $page;
                    $page->setStatus(true);
                }
            }
        }

        if (count($foundPages) > 0) {
            ksort($foundPages);
            $page = array_shift($foundPages);
            $this->navigation->setCurrentPage($page);
        }

        foreach ($this->getSections() as $section) {
            $section->findActivePageByUri($currentUri);
        }
    }
733345
def build_url_query(current_path, datum = nil)
      unless datum.nil?
        current_path += '?'
        current_path += URI.encode_www_form datum
      end
      current_path
    end
508518
function findImportedPath(url, prev, includedFilesMap, includedPaths) {
  let candidateFromPaths;

  if(prev !== 'stdin') {
    const prevPath = path.posix.dirname(prev);
    candidateFromPaths = [prevPath, ...includedPaths];
  } else {
    candidateFromPaths = [...includedPaths];
  }

  for(let i = 0; i < candidateFromPaths.length; i++) {
    let candidatePath;
    let candidateFromPath = normalizePath(makeAbsolute(candidateFromPaths[i]));
    if (path.isAbsolute(url)) {
      candidatePath = normalizePath(url);
    } else {
      // Get normalize absolute candidate from path
      candidatePath = path.posix.join(candidateFromPath, url);
    }

    if(includedFilesMap[candidatePath]) {
      return candidatePath;
    } else {
      let urlBasename = path.posix.basename(url);
      let indexOfBasename = url.lastIndexOf(urlBasename);
      let partialUrl = `${url.substring(0, indexOfBasename)}_${urlBasename}`;

      if (path.isAbsolute(partialUrl)) {
        candidatePath = normalizePath(partialUrl);
      } else {
        candidatePath = path.posix.join(candidateFromPath, partialUrl);
      }

      if(includedFilesMap[candidatePath]) {
        return candidatePath;
      }
    }
  }

  return null;
}