guides_style_18f 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 248853b675ee3576d3db1ae85b80735a388eee24
|
4
|
+
data.tar.gz: 1b6e7b6b83a74a56319ba22da50d82df0373f0b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4616a3aad89f83b5c377ab8268a3368b70bbf7af7e3282573c9a2b19f6d6a4a0c5502d45e4b0a7905c8f66f49b59cd54416b67bfc464a265438570167a6294b9
|
7
|
+
data.tar.gz: e00c37a7450347550c6e99215dffa9b8d574cbd9dc580a5bb6cb21888713d6092b92f41b3d0dfdd14a14f5c43b6c332ca8bc9375b2cb83482f7b427a6cd1e4ff
|
data/assets/js/18f-guide.js
CHANGED
@@ -5,6 +5,7 @@ $(function() {
|
|
5
5
|
|
6
6
|
// https://github.com/18F/private-eye#usage
|
7
7
|
PrivateEye({
|
8
|
+
defaultMessage: "This link is private to 18F.",
|
8
9
|
ignoreUrls: [
|
9
10
|
'https://docs.google.com',
|
10
11
|
'https://drive.google.com',
|
@@ -15,4 +16,3 @@ $(function() {
|
|
15
16
|
]
|
16
17
|
});
|
17
18
|
});
|
18
|
-
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// https://github.com/18F/private-eye
|
2
|
+
(function() {
|
3
|
+
'use strict';
|
4
|
+
|
5
|
+
var PrivateEye = function(opts) {
|
6
|
+
var styles = document.createElement('style');
|
7
|
+
styles.innerHTML = 'a.private-link::after { content: "\\1F512"; font-size: 0.75em; vertical-align: top; }';
|
8
|
+
document.body.appendChild(styles);
|
9
|
+
|
10
|
+
var defaultMessage;
|
11
|
+
|
12
|
+
if ( opts.defaultMessage && 'string' === typeof opts.defaultMessage ) {
|
13
|
+
|
14
|
+
defaultMessage = opts.defaultMessage;
|
15
|
+
|
16
|
+
} else {
|
17
|
+
|
18
|
+
defaultMessage = "This is a link to a private site, which may or may not be accessible to you.";
|
19
|
+
}
|
20
|
+
|
21
|
+
opts.ignoreUrls.forEach(function(url) {
|
22
|
+
|
23
|
+
var hrefValue;
|
24
|
+
var titleValue;
|
25
|
+
|
26
|
+
// If the `url` is an Object, then parse the properties `message` & `url`
|
27
|
+
//
|
28
|
+
if ( url === Object( url ) ) {
|
29
|
+
|
30
|
+
titleValue = url.message;
|
31
|
+
hrefValue = url.url;
|
32
|
+
|
33
|
+
} else {
|
34
|
+
|
35
|
+
hrefValue = url;
|
36
|
+
titleValue = defaultMessage;
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
var anchors = document.querySelectorAll('a[href*="' + hrefValue + '"]');
|
41
|
+
Array.prototype.forEach.call(anchors, function(anchor) {
|
42
|
+
anchor.className += ' private-link';
|
43
|
+
|
44
|
+
// Only replace the anchor's title if it is empty
|
45
|
+
//
|
46
|
+
if ( ! anchor.title ) {
|
47
|
+
|
48
|
+
anchor.title = titleValue;
|
49
|
+
|
50
|
+
}
|
51
|
+
|
52
|
+
});
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
if (typeof module === 'object' && typeof module.exports === 'object') {
|
57
|
+
module.exports = PrivateEye;
|
58
|
+
} else {
|
59
|
+
window.PrivateEye = PrivateEye;
|
60
|
+
}
|
61
|
+
})();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<script src="{% guides_style_18f_asset_root %}/assets/js/vendor/jquery-1.11.2.min.js"></script>
|
2
2
|
<script src="{% guides_style_18f_asset_root %}/assets/js/accordion.js"></script>
|
3
|
-
<script src="{% guides_style_18f_asset_root %}/assets/js/vendor/private-eye-1.
|
3
|
+
<script src="{% guides_style_18f_asset_root %}/assets/js/vendor/private-eye-1.1.0.js"></script>
|
4
4
|
<script src="{% guides_style_18f_asset_root %}/assets/js/18f-guide.js"></script>{% for script in site.scripts %}
|
5
5
|
<script src="{{ site.baseurl }}/{{ script }}"></script>{% endfor %}{% for script in page.scripts %}
|
6
6
|
<script src="{{ site.baseurl }}/{{ script }}"></script>{% endfor %}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guides_style_18f
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -207,7 +207,7 @@ files:
|
|
207
207
|
- assets/js/respond.js
|
208
208
|
- assets/js/vendor/anchor.min.js
|
209
209
|
- assets/js/vendor/jquery-1.11.2.min.js
|
210
|
-
- assets/js/vendor/private-eye-1.
|
210
|
+
- assets/js/vendor/private-eye-1.1.0.js
|
211
211
|
- lib/guides_style_18f.rb
|
212
212
|
- lib/guides_style_18f/assets.rb
|
213
213
|
- lib/guides_style_18f/breadcrumbs.rb
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
259
|
rubyforge_project:
|
260
|
-
rubygems_version: 2.5.
|
260
|
+
rubygems_version: 2.5.1
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: 18F Guides Template style elements
|
@@ -1,24 +0,0 @@
|
|
1
|
-
// https://github.com/18F/private-eye
|
2
|
-
(function() {
|
3
|
-
'use strict';
|
4
|
-
|
5
|
-
var PrivateEye = function(opts) {
|
6
|
-
var styles = document.createElement('style');
|
7
|
-
styles.innerHTML = 'a.private-link::after { content: "\\1F512"; font-size: 0.75em; vertical-align: top; }';
|
8
|
-
document.body.appendChild(styles);
|
9
|
-
|
10
|
-
opts.ignoreUrls.forEach(function(url) {
|
11
|
-
var anchors = document.querySelectorAll('a[href*="' + url + '"]');
|
12
|
-
Array.prototype.forEach.call(anchors, function(anchor) {
|
13
|
-
anchor.className += ' private-link';
|
14
|
-
anchor.title = "This is a link to a private site, which may or may not be accessible to you.";
|
15
|
-
});
|
16
|
-
});
|
17
|
-
};
|
18
|
-
|
19
|
-
if (typeof module === 'object' && typeof module.exports === 'object') {
|
20
|
-
module.exports = PrivateEye;
|
21
|
-
} else {
|
22
|
-
window.PrivateEye = PrivateEye;
|
23
|
-
}
|
24
|
-
})();
|