Sha256: 9c082f040fde111f83643feea69266794c40cd1afe4af42600aee5db2546f38c

Contents?: true

Size: 457 Bytes

Versions: 9

Compression:

Stored size: 457 Bytes

Contents

(function(object) {
  'use strict';

  object.url = {
    segment: function(collection) {
      var url = new URL(window.location.href),
          path = url.pathname.replace(/^\/|\/$/g, '').split('/'),
          segment = null;

      for (var p = 0; p < path.length; p++) {
        if (path[p] === collection) {
          segment = path[p + 1];

          break;
        }
      }

      return segment;
    }
  };

  return object;

}(Archangel || {}));

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
archangel-0.4.0 app/assets/javascripts/archangel/object/url.js
archangel-0.3.0 app/assets/javascripts/archangel/object/url.js
archangel-0.0.8 app/assets/javascripts/archangel/object/url.js
archangel-0.0.7 app/assets/javascripts/archangel/object/url.js
archangel-0.0.6 app/assets/javascripts/archangel/object/url.js
archangel-0.0.5 app/assets/javascripts/archangel/object/url.js
archangel-0.0.4 app/assets/javascripts/archangel/object/url.js
archangel-0.0.3 app/assets/javascripts/archangel/object/url.js
archangel-0.0.2 app/assets/javascripts/archangel/object/url.js