RedGate.SSC.Windows.Web.Assets/dist/combined.js
/**
 * @ngdoc provider
 * @name $locationProvider
 * @description
 * Use the `$locationProvider` to configure how the application deep linking paths are stored.
 */
@ngdoc provider
@name $locationProvider
@description
Use the `$locationProvider` to configure how the application deep linking paths are stored.
@ngdoc provider @name $locationProvider @description Use the ` $locationProvider ` to configure how the application deep linking paths are stored .
function $LocationProvider(){
  var hashPrefix = '',
      html5Mode = false;
  this.hashPrefix = function(prefix) {
    if (isDefined(prefix)) {
      hashPrefix = prefix;
      return this;
    } else {
      return hashPrefix;
    }
  };
  this.html5Mode = function(mode) {
    if (isDefined(mode)) {
      html5Mode = mode;
      return this;
    } else {
      return html5Mode;
    }
  };
  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement',
      function( $rootScope,   $browser,   $sniffer,   $rootElement) {
    var $location,
        LocationMode,
        baseHref = $browser.baseHref(), 
        initialUrl = $browser.url(),
        appBase;
    if (html5Mode) {
      appBase = serverBase(initialUrl) + (baseHref || '/');
      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
    } else {
      appBase = stripHash(initialUrl);
      LocationMode = LocationHashbangUrl;
    }
    $location = new LocationMode(appBase, '#' + hashPrefix);
    $location.$$parse($location.$$rewrite(initialUrl));
    $rootElement.on('click', function(event) {
      if (event.ctrlKey || event.metaKey || event.which == 2) return;
      var elm = jqLite(event.target);
      while (lowercase(elm[0].nodeName) !== 'a') {
        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
      }
      var absHref = elm.prop('href');
      if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {
        absHref = urlResolve(absHref.animVal).href;
      }
      if (LocationMode === LocationHashbangInHtml5Url) {
        var href = elm.attr('href') || elm.attr('xlink:href');
        if (href.indexOf('://') < 0) {         
          var prefix = '#' + hashPrefix;
          if (href[0] == '/') {
            absHref = appBase + prefix + href;
          } else if (href[0] == '#') {
            absHref = appBase + prefix + ($location.path() || '/') + href;
          } else {
            var stack = $location.path().split("/"),
              parts = href.split("/");
            for (var i=0; i<parts.length; i++) {
              if (parts[i] == ".")
                continue;
              else if (parts[i] == "..")
                stack.pop();
              else if (parts[i].length)
                stack.push(parts[i]);
            }
            absHref = appBase + prefix + stack.join('/');
          }
        }
      }
      var rewrittenUrl = $location.$$rewrite(absHref);
      if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
        event.preventDefault();
        if (rewrittenUrl != $browser.url()) {
          $location.$$parse(rewrittenUrl);
          $rootScope.$apply();
          window.angular['ff-684208-preventDefault'] = true;
        }
      }
    });
    if ($location.absUrl() != initialUrl) {
      $browser.url($location.absUrl(), true);
    }
    $browser.onUrlChange(function(newUrl) {
      if ($location.absUrl() != newUrl) {
        $rootScope.$evalAsync(function() {
          var oldUrl = $location.absUrl();
          $location.$$parse(newUrl);
          if ($rootScope.$broadcast('$locationChangeStart', newUrl,
                                    oldUrl).defaultPrevented) {
            $location.$$parse(oldUrl);
            $browser.url(oldUrl);
          } else {
            afterLocationChange(oldUrl);
          }
        });
        if (!$rootScope.$$phase) $rootScope.$digest();
      }
    });
    var changeCounter = 0;
    $rootScope.$watch(function $locationWatch() {
      var oldUrl = $browser.url();
      var currentReplace = $location.$$replace;
      if (!changeCounter || oldUrl != $location.absUrl()) {
        changeCounter++;
        $rootScope.$evalAsync(function() {
          if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl).
              defaultPrevented) {
            $location.$$parse(oldUrl);
          } else {
            $browser.url($location.absUrl(), currentReplace);
            afterLocationChange(oldUrl);
          }
        });
      }
      $location.$$replace = false;
      return changeCounter;
    });
    return $location;
    function afterLocationChange(oldUrl) {
      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl);
    }
}];
}
function $LocationProvider ( ) { var hashPrefix = '' , html5Mode = false ; this . hashPrefix = function ( prefix ) { if ( isDefined ( prefix ) ) { hashPrefix = prefix ; return this ; } else { return hashPrefix ; } } ; this . html5Mode = function ( mode ) { if ( isDefined ( mode ) ) { html5Mode = mode ; return this ; } else { return html5Mode ; } } ; this . $get = [ '$rootScope' , '$browser' , '$sniffer' , '$rootElement' , function ( $rootScope , $browser , $sniffer , $rootElement ) { var $location , LocationMode , baseHref = $browser . baseHref ( ) , initialUrl = $browser . url ( ) , appBase ; if ( html5Mode ) { appBase = serverBase ( initialUrl ) + ( baseHref || '/' ) ; LocationMode = $sniffer . history ? LocationHtml5Url : LocationHashbangInHtml5Url ; } else { appBase = stripHash ( initialUrl ) ; LocationMode = LocationHashbangUrl ; } $location = new LocationMode ( appBase , '#' + hashPrefix ) ; $location . $$parse ( $location . $$rewrite ( initialUrl ) ) ; $rootElement . on ( 'click' , function ( event ) { if ( event . ctrlKey || event . metaKey || event . which == 2 ) return ; var elm = jqLite ( event . target ) ; while ( lowercase ( elm [ 0 ] . nodeName ) !== 'a' ) { if ( elm [ 0 ] === $rootElement [ 0 ] || ! ( elm = elm . parent ( ) ) [ 0 ] ) return ; } var absHref = elm . prop ( 'href' ) ; if ( isObject ( absHref ) && absHref . toString ( ) === '[object SVGAnimatedString]' ) { absHref = urlResolve ( absHref . animVal ) . href ; } if ( LocationMode === LocationHashbangInHtml5Url ) { var href = elm . attr ( 'href' ) || elm . attr ( 'xlink:href' ) ; if ( href . indexOf ( '://' ) < 0 ) { var prefix = '#' + hashPrefix ; if ( href [ 0 ] == '/' ) { absHref = appBase + prefix + href ; } else if ( href [ 0 ] == '#' ) { absHref = appBase + prefix + ( $location . path ( ) || '/' ) + href ; } else { var stack = $location . path ( ) . split ( "/" ) , parts = href . split ( "/" ) ; for ( var i = 0 ; i < parts . length ; i ++ ) { if ( parts [ i ] == "." ) continue ; else if ( parts [ i ] == ".." ) stack . pop ( ) ; else if ( parts [ i ] . length ) stack . push ( parts [ i ] ) ; } absHref = appBase + prefix + stack . join ( '/' ) ; } } } var rewrittenUrl = $location . $$rewrite ( absHref ) ; if ( absHref && ! elm . attr ( 'target' ) && rewrittenUrl && ! event . isDefaultPrevented ( ) ) { event . preventDefault ( ) ; if ( rewrittenUrl != $browser . url ( ) ) { $location . $$parse ( rewrittenUrl ) ; $rootScope . $apply ( ) ; window . angular [ 'ff-684208-preventDefault' ] = true ; } } } ) ; if ( $location . absUrl ( ) != initialUrl ) { $browser . url ( $location . absUrl ( ) , true ) ; } $browser . onUrlChange ( function ( newUrl ) { if ( $location . absUrl ( ) != newUrl ) { $rootScope . $evalAsync ( function ( ) { var oldUrl = $location . absUrl ( ) ; $location . $$parse ( newUrl ) ; if ( $rootScope . $broadcast ( '$locationChangeStart' , newUrl , oldUrl ) . defaultPrevented ) { $location . $$parse ( oldUrl ) ; $browser . url ( oldUrl ) ; } else { afterLocationChange ( oldUrl ) ; } } ) ; if ( ! $rootScope . $$phase ) $rootScope . $digest ( ) ; } } ) ; var changeCounter = 0 ; $rootScope . $watch ( function $locationWatch ( ) { var oldUrl = $browser . url ( ) ; var currentReplace = $location . $$replace ; if ( ! changeCounter || oldUrl != $location . absUrl ( ) ) { changeCounter ++ ; $rootScope . $evalAsync ( function ( ) { if ( $rootScope . $broadcast ( '$locationChangeStart' , $location . absUrl ( ) , oldUrl ) . defaultPrevented ) { $location . $$parse ( oldUrl ) ; } else { $browser . url ( $location . absUrl ( ) , currentReplace ) ; afterLocationChange ( oldUrl ) ; } } ) ; } $location . $$replace = false ; return changeCounter ; } ) ; return $location ; function afterLocationChange ( oldUrl ) { $rootScope . $broadcast ( '$locationChangeSuccess' , $location . absUrl ( ) , oldUrl ) ; } } ] ; }
@ngdoc provider
 @name $locationProvider
 @description
 Use the `$locationProvider` to configure how the application deep linking paths are stored.
@ngdoc provider @name $locationProvider @description Use the ` $locationProvider ` to configure how the application deep linking paths are stored .
/**
   * @ngdoc method
   * @name $locationProvider#hashPrefix
   * @description
   * @param {string=} prefix Prefix for hash part (containing path and search)
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */ /**
   * @ngdoc method
   * @name $locationProvider#html5Mode
   * @description
   * @param {boolean=} mode Use HTML5 strategy if available.
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */ /**
   * @ngdoc event
   * @name $location#$locationChangeStart
   * @eventType broadcast on root scope
   * @description
   * Broadcasted before a URL will change. This change can be prevented by calling
   * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
   * details about event object. Upon successful change
   * {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired.
   *
   * @param {Object} angularEvent Synthetic event object.
   * @param {string} newUrl New URL
   * @param {string=} oldUrl URL that was before it was changed.
   */ /**
   * @ngdoc event
   * @name $location#$locationChangeSuccess
   * @eventType broadcast on root scope
   * @description
   * Broadcasted after a URL was changed.
   *
   * @param {Object} angularEvent Synthetic event object.
   * @param {string} newUrl New URL
   * @param {string=} oldUrl URL that was before it was changed.
   */ // if base[href] is undefined, it defaults to '' // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) // currently we open nice url link and redirect then // traverse the DOM up to find first A tag // ignore rewriting if no A tag (reached root element, or no parent - removed from document) // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during // an animation. // Make relative links work in HTML5 mode for legacy browsers (or at least IE8 & 9) // The href should be a regular url e.g. /link/somewhere or link/somewhere or ../somewhere or // somewhere#anchor or http://example.com/somewhere // get the actual href attribute - see // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx // Ignore absolute URLs // absolute path - replace old path // local anchor // relative path - join with current path // update location manually // hack to work around FF6 bug 684208 when scenario runner clicks on links // rewrite hashbang url <> html5 url // update $location when $browser url changes // update browser