angular_rails_seo 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/angular-rails-seo.js.erb +29 -22
- data/lib/angular_rails_seo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7ca23716b64c57e7ce96f35708c872b7339939
|
4
|
+
data.tar.gz: b25f4743146969869d577cd74bb0b750652ffcf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 932f6142831f5802faeed75084baeefee5afcec7aa74ef7dd8207aaeab728fa808c5d93928b745bc51493af091b31fc07c27d791747030eac7c86e3cff66335c
|
7
|
+
data.tar.gz: 230d055a069204986a835fbc4806fa0aff49b201a64d6d39f237f5e4676274249f30a65083cb3f2d81dc66a4a159b2212dc659860ac0e7642fa1efe4aa8e3a0d
|
@@ -27,45 +27,52 @@ angular.module('angular-rails-seo', [])
|
|
27
27
|
return paths;
|
28
28
|
};
|
29
29
|
|
30
|
-
// Finds the matching SEO entry for the
|
31
|
-
// none is found
|
30
|
+
// Finds the matching SEO entry for the current path, or returns the default if none is found
|
32
31
|
$seo.match = function(path) {
|
33
|
-
var
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
var path = $location.path();
|
33
|
+
var pathKeys = Object.keys(paths);
|
34
|
+
var key, i;
|
35
|
+
|
36
|
+
if (path == null) {
|
37
|
+
return $seo.getDefaults();
|
38
|
+
}
|
39
|
+
|
40
|
+
for (var i = 0; i < pathKeys.length; i++) {
|
41
|
+
key = pathKeys[i];
|
42
|
+
|
43
|
+
if (paths[key].regex.test(path)) {
|
44
|
+
return paths[key];
|
41
45
|
}
|
42
|
-
return $seo.getDefault();
|
43
46
|
}
|
47
|
+
|
48
|
+
return $seo.getDefault();
|
44
49
|
};
|
45
50
|
|
46
|
-
//
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
data = $seo.match(path);
|
51
|
+
// If we found a matching path entry apply it, otherwise use the default
|
52
|
+
$seo.refresh = function() {
|
53
|
+
var data = $seo.match();
|
54
|
+
|
51
55
|
if (data != null) {
|
52
56
|
$seo.applyData(data);
|
53
57
|
} else {
|
54
58
|
$seo.applyData($seo.getDefault());
|
55
59
|
}
|
56
|
-
}
|
60
|
+
}
|
57
61
|
|
58
62
|
// Assigns the routes as defined in seo.json
|
59
63
|
$seo.setRoutes = function(data) {
|
60
|
-
var key, _i, _len, _ref;
|
61
64
|
paths = data;
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
|
66
|
+
var key;
|
67
|
+
var pathKeys = Object.keys(paths);
|
68
|
+
|
69
|
+
for (var i = 0; i < pathKeys.length; i++) {
|
70
|
+
key = pathKeys[i];
|
65
71
|
paths[key].regex = new RegExp(paths[key].regex);
|
66
72
|
}
|
73
|
+
|
67
74
|
$rootScope.$on('$locationChangeStart', function(e, next, current) {
|
68
|
-
$seo.
|
75
|
+
$seo.refresh();
|
69
76
|
});
|
70
77
|
};
|
71
78
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular_rails_seo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Ellis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|