MCPcopy Create free account
hub / github.com/apache/cloudstack / convertToHtml5Url

Function convertToHtml5Url

tools/ngui/static/js/lib/angular.js:5092–5104  ·  view source on GitHub ↗
(url, basePath, hashPrefix)

Source from the content-addressed store, hash-verified

5090
5091
5092function convertToHtml5Url(url, basePath, hashPrefix) {
5093 var match = matchUrl(url);
5094
5095 // already html5 url
5096 if (decodeURIComponent(match.path) != basePath || isUndefined(match.hash) ||
5097 match.hash.indexOf(hashPrefix) !== 0) {
5098 return url;
5099 // convert hashbang url -> html5 url
5100 } else {
5101 return composeProtocolHostPort(match.protocol, match.host, match.port) +
5102 pathPrefixFromBase(basePath) + match.hash.substr(hashPrefix.length);
5103 }
5104}
5105
5106
5107function convertToHashbangUrl(url, basePath, hashPrefix) {

Callers 1

$LocationProviderFunction · 0.85

Calls 4

matchUrlFunction · 0.85
isUndefinedFunction · 0.85
composeProtocolHostPortFunction · 0.85
pathPrefixFromBaseFunction · 0.85

Tested by

no test coverage detected