jekyll-theme-primer 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.md +1 -1
  3. data/README.md +39 -13
  4. data/_includes/head-custom-google-analytics.html +10 -0
  5. data/_includes/head-custom.html +9 -0
  6. data/_layouts/default.html +7 -5
  7. data/_layouts/home.html +4 -0
  8. data/_layouts/page.html +4 -0
  9. data/_layouts/post.html +4 -0
  10. data/_sass/primer-base/lib/base.scss +17 -0
  11. data/_sass/primer-base/lib/normalize.scss +2 -4
  12. data/_sass/primer-layout/lib/grid-offset.scss +12 -23
  13. data/_sass/primer-markdown/lib/code.scss +3 -16
  14. data/_sass/primer-markdown/lib/lists.scss +5 -1
  15. data/_sass/primer-markdown/lib/markdown-body.scss +1 -1
  16. data/_sass/primer-support/lib/mixins/buttons.scss +13 -9
  17. data/_sass/primer-support/lib/mixins/layout.scss +18 -12
  18. data/_sass/primer-support/lib/variables/layout.scss +15 -1
  19. data/_sass/primer-support/lib/variables/misc.scss +1 -1
  20. data/_sass/primer-utilities/index.scss +1 -0
  21. data/_sass/primer-utilities/lib/animations.scss +33 -2
  22. data/_sass/primer-utilities/lib/borders.scss +75 -38
  23. data/_sass/primer-utilities/lib/details.scss +18 -0
  24. data/_sass/primer-utilities/lib/flexbox.scss +45 -73
  25. data/_sass/primer-utilities/lib/layout.scss +16 -27
  26. data/_sass/primer-utilities/lib/margin.scss +42 -75
  27. data/_sass/primer-utilities/lib/padding.scss +26 -56
  28. data/_sass/primer-utilities/lib/typography.scss +22 -23
  29. data/_sass/primer-utilities/lib/visibility-display.scss +21 -45
  30. data/_sass/primer.scss +4 -0
  31. metadata +71 -72
  32. data/_sass/primer-base/LICENSE +0 -21
  33. data/_sass/primer-base/README.md +0 -48
  34. data/_sass/primer-base/build/build.css +0 -1
  35. data/_sass/primer-base/build/index.js +0 -1
  36. data/_sass/primer-base/package.json +0 -68
  37. data/_sass/primer-layout/LICENSE +0 -21
  38. data/_sass/primer-layout/README.md +0 -137
  39. data/_sass/primer-layout/build/build.css +0 -1
  40. data/_sass/primer-layout/build/index.js +0 -1
  41. data/_sass/primer-layout/package.json +0 -65
  42. data/_sass/primer-markdown/LICENSE +0 -21
  43. data/_sass/primer-markdown/README.md +0 -218
  44. data/_sass/primer-markdown/build/build.css +0 -1
  45. data/_sass/primer-markdown/build/index.js +0 -1
  46. data/_sass/primer-markdown/package.json +0 -69
  47. data/_sass/primer-support/LICENSE +0 -21
  48. data/_sass/primer-support/README.md +0 -42
  49. data/_sass/primer-support/package.json +0 -66
  50. data/_sass/primer-utilities/LICENSE +0 -21
  51. data/_sass/primer-utilities/README.md +0 -48
  52. data/_sass/primer-utilities/build/build.css +0 -1
  53. data/_sass/primer-utilities/build/index.js +0 -1
  54. data/_sass/primer-utilities/package.json +0 -65
  55. data/assets/javascript/anchor-js/.eslintrc +0 -77
  56. data/assets/javascript/anchor-js/.gitattributes +0 -2
  57. data/assets/javascript/anchor-js/.npmignore +0 -4
  58. data/assets/javascript/anchor-js/.travis.yml +0 -6
  59. data/assets/javascript/anchor-js/anchor.js +0 -334
  60. data/assets/javascript/anchor-js/anchor.min.js +0 -6
  61. data/assets/javascript/anchor-js/banner.js +0 -17
  62. data/assets/javascript/anchor-js/docs/anchor.js +0 -334
  63. data/assets/javascript/anchor-js/docs/favicon.ico +0 -0
  64. data/assets/javascript/anchor-js/docs/fonts/anchorjs-extras.eot +0 -0
  65. data/assets/javascript/anchor-js/docs/fonts/anchorjs-extras.svg +0 -11
  66. data/assets/javascript/anchor-js/docs/fonts/anchorjs-extras.ttf +0 -0
  67. data/assets/javascript/anchor-js/docs/fonts/anchorjs-extras.woff +0 -0
  68. data/assets/javascript/anchor-js/docs/fonts/fonts.css +0 -24
  69. data/assets/javascript/anchor-js/docs/grunticon/grunticon.loader.js +0 -3
  70. data/assets/javascript/anchor-js/docs/grunticon/icons.data.png.css +0 -5
  71. data/assets/javascript/anchor-js/docs/grunticon/icons.data.svg.css +0 -5
  72. data/assets/javascript/anchor-js/docs/grunticon/icons.fallback.css +0 -5
  73. data/assets/javascript/anchor-js/docs/grunticon/png/grunticon-link.png +0 -0
  74. data/assets/javascript/anchor-js/docs/grunticon/preview.html +0 -33
  75. data/assets/javascript/anchor-js/docs/img/anchoring-links.png +0 -0
  76. data/assets/javascript/anchor-js/docs/img/anchorjs_logo.png +0 -0
  77. data/assets/javascript/anchor-js/docs/img/anchorlinks2.png +0 -0
  78. data/assets/javascript/anchor-js/docs/img/gh-link.svg +0 -9
  79. data/assets/javascript/anchor-js/docs/img/gh_link.svg +0 -9
  80. data/assets/javascript/anchor-js/docs/img/hyperlink.svg +0 -9
  81. data/assets/javascript/anchor-js/docs/img/link.svg +0 -6
  82. data/assets/javascript/anchor-js/docs/img/mini-logo.png +0 -0
  83. data/assets/javascript/anchor-js/docs/img/primer-md.png +0 -0
  84. data/assets/javascript/anchor-js/docs/index.html +0 -807
  85. data/assets/javascript/anchor-js/docs/scripts.js +0 -12
  86. data/assets/javascript/anchor-js/docs/styles.css +0 -493
@@ -1,6 +0,0 @@
1
- /**
2
- * AnchorJS - v4.0.0 - 2017-06-02
3
- * https://github.com/bryanbraun/anchorjs
4
- * Copyright (c) 2017 Bryan Braun; Licensed MIT
5
- */
6
- !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";function A(A){function e(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.class=A.hasOwnProperty("class")?A.class:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64}function t(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}function n(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}this.options=A||{},this.elements=[],e(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var i,o,s,c,r,a,h,l,u,d,f,g,p=[];if(e(this.options),"touch"===(g=this.options.visible)&&(g=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(i=t(A)).length)return this;for(n(),o=document.querySelectorAll("[id]"),s=[].map.call(o,function(A){return A.id}),r=0;r<i.length;r++)if(this.hasAnchorJSLink(i[r]))p.push(r);else{if(i[r].hasAttribute("id"))c=i[r].getAttribute("id");else if(i[r].hasAttribute("data-anchor-id"))c=i[r].getAttribute("data-anchor-id");else{u=l=this.urlify(i[r].textContent),h=0;do{void 0!==a&&(u=l+"-"+h),a=s.indexOf(u),h+=1}while(-1!==a);a=void 0,s.push(u),i[r].setAttribute("id",u),c=u}d=c.replace(/-/g," "),(f=document.createElement("a")).className="anchorjs-link "+this.options.class,f.href="#"+c,f.setAttribute("aria-label","Anchor link for: "+d),f.setAttribute("data-anchorjs-icon",this.options.icon),"always"===g&&(f.style.opacity="1"),""===this.options.icon&&(f.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(f.style.lineHeight="inherit")),"left"===this.options.placement?(f.style.position="absolute",f.style.marginLeft="-1em",f.style.paddingRight="0.5em",i[r].insertBefore(f,i[r].firstChild)):(f.style.paddingLeft="0.375em",i[r].appendChild(f))}for(r=0;r<p.length;r++)i.splice(p[r]-r,1);return this.elements=this.elements.concat(i),this},this.remove=function(A){for(var e,n,i=t(A),o=0;o<i.length;o++)(n=i[o].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[o]))&&this.elements.splice(e,1),i[o].removeChild(n));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){var t=/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g;return this.options.truncate||e(this.options),A.trim().replace(/\'/gi,"").replace(t,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&(" "+A.firstChild.className+" ").indexOf(" anchorjs-link ")>-1,t=A.lastChild&&(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ")>-1;return e||t||!1}}return A});
@@ -1,17 +0,0 @@
1
- const fs = require('fs');
2
- const pkg = require('./package.json');
3
- const filename = 'anchor.min.js';
4
- const script = fs.readFileSync(filename);
5
- const padStart = str => ('0' + str).slice(-2)
6
- const dateObj = new Date;
7
- const date = `${dateObj.getFullYear()}-${padStart(dateObj.getMonth() + 1)}-${padStart(dateObj.getDate())}`;
8
- const banner = `/**
9
- * AnchorJS - v${pkg.version} - ${date}
10
- * ${pkg.homepage}
11
- * Copyright (c) ${dateObj.getFullYear()} Bryan Braun; Licensed ${pkg.license}
12
- */
13
- `;
14
-
15
- if (script.slice(0, 3) != '/**') {
16
- fs.writeFileSync(filename, banner + script);
17
- }
@@ -1,334 +0,0 @@
1
- /* eslint-env amd, node */
2
-
3
- // https://github.com/umdjs/umd/blob/master/templates/returnExports.js
4
- (function (root, factory) {
5
- 'use strict';
6
-
7
- if (typeof define === 'function' && define.amd) {
8
- // AMD. Register as an anonymous module.
9
- define([], factory);
10
- } else if (typeof module === 'object' && module.exports) {
11
- // Node. Does not work with strict CommonJS, but
12
- // only CommonJS-like environments that support module.exports,
13
- // like Node.
14
- module.exports = factory();
15
- } else {
16
- // Browser globals (root is window)
17
- root.AnchorJS = factory();
18
- root.anchors = new root.AnchorJS();
19
- }
20
- }(this, function () {
21
- 'use strict';
22
-
23
- function AnchorJS(options) {
24
- this.options = options || {};
25
- this.elements = [];
26
-
27
- /**
28
- * Assigns options to the internal options object, and provides defaults.
29
- * @param {Object} opts - Options object
30
- */
31
- function _applyRemainingDefaultOptions(opts) {
32
- opts.icon = opts.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'.
33
- opts.visible = opts.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' & 'touch'
34
- opts.placement = opts.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left'
35
- opts.class = opts.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name.
36
- // Using Math.floor here will ensure the value is Number-cast and an integer.
37
- opts.truncate = opts.hasOwnProperty('truncate') ? Math.floor(opts.truncate) : 64; // Accepts any value that can be typecast to a number.
38
- }
39
-
40
- _applyRemainingDefaultOptions(this.options);
41
-
42
- /**
43
- * Checks to see if this device supports touch. Uses criteria pulled from Modernizr:
44
- * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40
45
- * @return {Boolean} - true if the current device supports touch.
46
- */
47
- this.isTouchDevice = function() {
48
- return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
49
- };
50
-
51
- /**
52
- * Add anchor links to page elements.
53
- * @param {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links
54
- * to. Also accepts an array or nodeList containing the relavant elements.
55
- * @return {this} - The AnchorJS object
56
- */
57
- this.add = function(selector) {
58
- var elements,
59
- elsWithIds,
60
- idList,
61
- elementID,
62
- i,
63
- index,
64
- count,
65
- tidyText,
66
- newTidyText,
67
- readableID,
68
- anchor,
69
- visibleOptionToUse,
70
- indexesToDrop = [];
71
-
72
- // We reapply options here because somebody may have overwritten the default options object when setting options.
73
- // For example, this overwrites all options but visible:
74
- //
75
- // anchors.options = { visible: 'always'; }
76
- _applyRemainingDefaultOptions(this.options);
77
-
78
- visibleOptionToUse = this.options.visible;
79
- if (visibleOptionToUse === 'touch') {
80
- visibleOptionToUse = this.isTouchDevice() ? 'always' : 'hover';
81
- }
82
-
83
- // Provide a sensible default selector, if none is given.
84
- if (!selector) {
85
- selector = 'h2, h3, h4, h5, h6';
86
- }
87
-
88
- elements = _getElements(selector);
89
-
90
- if (elements.length === 0) {
91
- return this;
92
- }
93
-
94
- _addBaselineStyles();
95
-
96
- // We produce a list of existing IDs so we don't generate a duplicate.
97
- elsWithIds = document.querySelectorAll('[id]');
98
- idList = [].map.call(elsWithIds, function assign(el) {
99
- return el.id;
100
- });
101
-
102
- for (i = 0; i < elements.length; i++) {
103
- if (this.hasAnchorJSLink(elements[i])) {
104
- indexesToDrop.push(i);
105
- continue;
106
- }
107
-
108
- if (elements[i].hasAttribute('id')) {
109
- elementID = elements[i].getAttribute('id');
110
- } else if (elements[i].hasAttribute('data-anchor-id')) {
111
- elementID = elements[i].getAttribute('data-anchor-id');
112
- } else {
113
- tidyText = this.urlify(elements[i].textContent);
114
-
115
- // Compare our generated ID to existing IDs (and increment it if needed)
116
- // before we add it to the page.
117
- newTidyText = tidyText;
118
- count = 0;
119
- do {
120
- if (index !== undefined) {
121
- newTidyText = tidyText + '-' + count;
122
- }
123
-
124
- index = idList.indexOf(newTidyText);
125
- count += 1;
126
- } while (index !== -1);
127
- index = undefined;
128
- idList.push(newTidyText);
129
-
130
- elements[i].setAttribute('id', newTidyText);
131
- elementID = newTidyText;
132
- }
133
-
134
- readableID = elementID.replace(/-/g, ' ');
135
-
136
- // The following code builds the following DOM structure in a more effiecient (albeit opaque) way.
137
- // '<a class="anchorjs-link ' + this.options.class + '" href="#' + elementID + '" aria-label="Anchor link for: ' + readableID + '" data-anchorjs-icon="' + this.options.icon + '"></a>';
138
- anchor = document.createElement('a');
139
- anchor.className = 'anchorjs-link ' + this.options.class;
140
- anchor.href = '#' + elementID;
141
- anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID);
142
- anchor.setAttribute('data-anchorjs-icon', this.options.icon);
143
-
144
- if (visibleOptionToUse === 'always') {
145
- anchor.style.opacity = '1';
146
- }
147
-
148
- if (this.options.icon === '\ue9cb') {
149
- anchor.style.font = '1em/1 anchorjs-icons';
150
-
151
- // We set lineHeight = 1 here because the `anchorjs-icons` font family could otherwise affect the
152
- // height of the heading. This isn't the case for icons with `placement: left`, so we restore
153
- // line-height: inherit in that case, ensuring they remain positioned correctly. For more info,
154
- // see https://github.com/bryanbraun/anchorjs/issues/39.
155
- if (this.options.placement === 'left') {
156
- anchor.style.lineHeight = 'inherit';
157
- }
158
- }
159
-
160
- if (this.options.placement === 'left') {
161
- anchor.style.position = 'absolute';
162
- anchor.style.marginLeft = '-1em';
163
- anchor.style.paddingRight = '0.5em';
164
- elements[i].insertBefore(anchor, elements[i].firstChild);
165
- } else { // if the option provided is `right` (or anything else).
166
- anchor.style.paddingLeft = '0.375em';
167
- elements[i].appendChild(anchor);
168
- }
169
- }
170
-
171
- for (i = 0; i < indexesToDrop.length; i++) {
172
- elements.splice(indexesToDrop[i] - i, 1);
173
- }
174
- this.elements = this.elements.concat(elements);
175
-
176
- return this;
177
- };
178
-
179
- /**
180
- * Removes all anchorjs-links from elements targed by the selector.
181
- * @param {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links,
182
- * OR a nodeList / array containing the DOM elements.
183
- * @return {this} - The AnchorJS object
184
- */
185
- this.remove = function(selector) {
186
- var index,
187
- domAnchor,
188
- elements = _getElements(selector);
189
-
190
- for (var i = 0; i < elements.length; i++) {
191
- domAnchor = elements[i].querySelector('.anchorjs-link');
192
- if (domAnchor) {
193
- // Drop the element from our main list, if it's in there.
194
- index = this.elements.indexOf(elements[i]);
195
- if (index !== -1) {
196
- this.elements.splice(index, 1);
197
- }
198
- // Remove the anchor from the DOM.
199
- elements[i].removeChild(domAnchor);
200
- }
201
- }
202
- return this;
203
- };
204
-
205
- /**
206
- * Removes all anchorjs links. Mostly used for tests.
207
- */
208
- this.removeAll = function() {
209
- this.remove(this.elements);
210
- };
211
-
212
- /**
213
- * Urlify - Refine text so it makes a good ID.
214
- *
215
- * To do this, we remove apostrophes, replace nonsafe characters with hyphens,
216
- * remove extra hyphens, truncate, trim hyphens, and make lowercase.
217
- *
218
- * @param {String} text - Any text. Usually pulled from the webpage element we are linking to.
219
- * @return {String} - hyphen-delimited text for use in IDs and URLs.
220
- */
221
- this.urlify = function(text) {
222
- // Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\
223
- var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g,
224
- urlText;
225
-
226
- // The reason we include this _applyRemainingDefaultOptions is so urlify can be called independently,
227
- // even after setting options. This can be useful for tests or other applications.
228
- if (!this.options.truncate) {
229
- _applyRemainingDefaultOptions(this.options);
230
- }
231
-
232
- // Note: we trim hyphens after truncating because truncating can cause dangling hyphens.
233
- // Example string: // " ⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
234
- urlText = text.trim() // "⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
235
- .replace(/\'/gi, '') // "⚡⚡ Dont forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
236
- .replace(nonsafeChars, '-') // "⚡⚡-Dont-forget--URL-fragments-should-be-i18n-friendly--hyphenated--short--and-clean-"
237
- .replace(/-{2,}/g, '-') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-short-and-clean-"
238
- .substring(0, this.options.truncate) // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-"
239
- .replace(/^-+|-+$/gm, '') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated"
240
- .toLowerCase(); // "⚡⚡-dont-forget-url-fragments-should-be-i18n-friendly-hyphenated"
241
-
242
- return urlText;
243
- };
244
-
245
- /**
246
- * Determines if this element already has an AnchorJS link on it.
247
- * Uses this technique: http://stackoverflow.com/a/5898748/1154642
248
- * @param {HTMLElemnt} el - a DOM node
249
- * @return {Boolean} true/false
250
- */
251
- this.hasAnchorJSLink = function(el) {
252
- var hasLeftAnchor = el.firstChild && ((' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1),
253
- hasRightAnchor = el.lastChild && ((' ' + el.lastChild.className + ' ').indexOf(' anchorjs-link ') > -1);
254
-
255
- return hasLeftAnchor || hasRightAnchor || false;
256
- };
257
-
258
- /**
259
- * Turns a selector, nodeList, or array of elements into an array of elements (so we can use array methods).
260
- * It also throws errors on any other inputs. Used to handle inputs to .add and .remove.
261
- * @param {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links,
262
- * OR a nodeList / array containing the DOM elements.
263
- * @return {Array} - An array containing the elements we want.
264
- */
265
- function _getElements(input) {
266
- var elements;
267
- if (typeof input === 'string' || input instanceof String) {
268
- // See https://davidwalsh.name/nodelist-array for the technique transforming nodeList -> Array.
269
- elements = [].slice.call(document.querySelectorAll(input));
270
- // I checked the 'input instanceof NodeList' test in IE9 and modern browsers and it worked for me.
271
- } else if (Array.isArray(input) || input instanceof NodeList) {
272
- elements = [].slice.call(input);
273
- } else {
274
- throw new Error('The selector provided to AnchorJS was invalid.');
275
- }
276
- return elements;
277
- }
278
-
279
- /**
280
- * _addBaselineStyles
281
- * Adds baseline styles to the page, used by all AnchorJS links irregardless of configuration.
282
- */
283
- function _addBaselineStyles() {
284
- // We don't want to add global baseline styles if they've been added before.
285
- if (document.head.querySelector('style.anchorjs') !== null) {
286
- return;
287
- }
288
-
289
- var style = document.createElement('style'),
290
- linkRule =
291
- ' .anchorjs-link {' +
292
- ' opacity: 0;' +
293
- ' text-decoration: none;' +
294
- ' -webkit-font-smoothing: antialiased;' +
295
- ' -moz-osx-font-smoothing: grayscale;' +
296
- ' }',
297
- hoverRule =
298
- ' *:hover > .anchorjs-link,' +
299
- ' .anchorjs-link:focus {' +
300
- ' opacity: 1;' +
301
- ' }',
302
- anchorjsLinkFontFace =
303
- ' @font-face {' +
304
- ' font-family: "anchorjs-icons";' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
305
- ' src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype");' +
306
- ' }',
307
- pseudoElContent =
308
- ' [data-anchorjs-icon]::after {' +
309
- ' content: attr(data-anchorjs-icon);' +
310
- ' }',
311
- firstStyleEl;
312
-
313
- style.className = 'anchorjs';
314
- style.appendChild(document.createTextNode('')); // Necessary for Webkit.
315
-
316
- // We place it in the head with the other style tags, if possible, so as to
317
- // not look out of place. We insert before the others so these styles can be
318
- // overridden if necessary.
319
- firstStyleEl = document.head.querySelector('[rel="stylesheet"], style');
320
- if (firstStyleEl === undefined) {
321
- document.head.appendChild(style);
322
- } else {
323
- document.head.insertBefore(style, firstStyleEl);
324
- }
325
-
326
- style.sheet.insertRule(linkRule, style.sheet.cssRules.length);
327
- style.sheet.insertRule(hoverRule, style.sheet.cssRules.length);
328
- style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length);
329
- style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length);
330
- }
331
- }
332
-
333
- return AnchorJS;
334
- }));
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="anchorjs-extras" horiz-adv-x="1024">
7
- <font-face units-per-em="1024" ascent="960" descent="-64" />
8
- <missing-glyph horiz-adv-x="1024" />
9
- <glyph unicode="&#x20;" d="" horiz-adv-x="512" />
10
- <glyph unicode="&#xf0c1;" d="M832 182.858q0 22.857-16 38.857l-118.857 118.857q-16 16-38.857 16-24 0-41.143-18.286 1.714-1.714 10.857-10.571t12.286-12.286 8.571-10.857 7.429-14.571 2-15.714q0-22.857-16-38.857t-38.857-16q-8.571 0-15.714 2t-14.571 7.429-10.857 8.571-12.286 12.286-10.571 10.857q-18.857-17.714-18.857-41.714 0-22.857 16-38.857l117.714-118.286q15.429-15.429 38.857-15.429 22.857 0 38.857 14.857l84 83.429q16 16 16 38.286zM430.286 585.715q0 22.857-16 38.857l-117.714 118.286q-16 16-38.857 16-22.286 0-38.857-15.429l-84-83.429q-16-16-16-38.286 0-22.857 16-38.857l118.857-118.857q15.429-15.429 38.857-15.429 24 0 41.143 17.714-1.714 1.714-10.857 10.571t-12.286 12.286-8.571 10.857-7.429 14.571-2 15.714q0 22.857 16 38.857t38.857 16q8.571 0 15.714-2t14.571-7.429 10.857-8.571 12.286-12.286 10.571-10.857q18.857 17.714 18.857 41.714zM941.714 182.858q0-68.571-48.571-116l-84-83.429q-47.429-47.429-116-47.429-69.143 0-116.571 48.571l-117.714 118.286q-47.429 47.429-47.429 116 0 70.286 50.286 119.429l-50.286 50.286q-49.143-50.286-118.857-50.286-68.571 0-116.571 48l-118.857 118.857q-48 48-48 116.571t48.571 116l84 83.429q47.429 47.429 116 47.429 69.143 0 116.571-48.571l117.714-118.286q47.429-47.429 47.429-116 0-70.286-50.286-119.429l50.286-50.286q49.143 50.286 118.857 50.286 68.571 0 116.571-48l118.857-118.857q48-48 48-116.571z" horiz-adv-x="951" />
11
- </font></defs></svg>
@@ -1,24 +0,0 @@
1
- @font-face {
2
- font-family: 'anchorjs-extras';
3
- src:url('anchorjs-extras.eot?-qcq09q');
4
- src:url('anchorjs-extras.eot?#iefix-qcq09q') format('embedded-opentype'),
5
- url('anchorjs-extras.woff?-qcq09q') format('woff'),
6
- url('anchorjs-extras.ttf?-qcq09q') format('truetype'),
7
- url('anchorjs-extras.svg?-qcq09q#anchorjs-extras') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
-
12
- [class^="ajs-"], [class*=" ajs-"] {
13
- font-family: 'anchorjs-extras';
14
- speak: none;
15
- font-style: normal;
16
- font-weight: normal;
17
- font-variant: normal;
18
- text-transform: none;
19
- line-height: 1;
20
-
21
- /* Better Font Rendering =========== */
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
- }
@@ -1,3 +0,0 @@
1
- /*! grunt-grunticon Stylesheet Loader - v2.1.2 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */
2
-
3
- (function(e){function t(t,n,r,o){"use strict";function a(){for(var e,n=0;u.length>n;n++)u[n].href&&u[n].href.indexOf(t)>-1&&(e=!0);e?i.media=r||"all":setTimeout(a)}var i=e.document.createElement("link"),l=n||e.document.getElementsByTagName("script")[0],u=e.document.styleSheets;return i.rel="stylesheet",i.href=t,i.media="only x",i.onload=o||null,l.parentNode.insertBefore(i,l),a(),i}var n=function(r,o){"use strict";if(r&&3===r.length){var a=e.navigator,i=e.Image,l=!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||e.opera&&-1===a.userAgent.indexOf("Chrome")||-1!==a.userAgent.indexOf("Series40")),u=new i;u.onerror=function(){n.method="png",n.href=r[2],t(r[2])},u.onload=function(){var e=1===u.width&&1===u.height,a=r[e&&l?0:e?1:2];n.method=e&&l?"svg":e?"datapng":"png",n.href=a,t(a,null,null,o)},u.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",document.documentElement.className+=" grunticon"}};n.loadCSS=t,e.grunticon=n})(this);(function(e,t){"use strict";var n=t.document,r="grunticon:",o=function(e){if(n.attachEvent?"complete"===n.readyState:"loading"!==n.readyState)e();else{var t=!1;n.addEventListener("readystatechange",function(){t||(t=!0,e())},!1)}},a=function(e){return t.document.querySelector('link[href$="'+e+'"]')},c=function(e){var t,n,o,a,c,i,u={};if(t=e.sheet,!t)return u;n=t.cssRules?t.cssRules:t.rules;for(var l=0;n.length>l;l++)o=n[l].cssText,a=r+n[l].selectorText,c=o.split(");")[0].match(/US\-ASCII\,([^"']+)/),c&&c[1]&&(i=decodeURIComponent(c[1]),u[a]=i);return u},i=function(e){var t,o,a;o="data-grunticon-embed";for(var c in e)if(a=c.slice(r.length),t=n.querySelectorAll(a+"["+o+"]"),t.length)for(var i=0;t.length>i;i++)t[i].innerHTML=e[c],t[i].style.backgroundImage="none",t[i].removeAttribute(o);return t},u=function(t){"svg"===e.method&&o(function(){i(c(a(e.href))),"function"==typeof t&&t()})};e.embedIcons=i,e.getCSS=a,e.getIcons=c,e.ready=o,e.svgLoadedCallback=u,e.embedSVG=u})(grunticon,this);
@@ -1,5 +0,0 @@
1
-
2
- .icon-grunticon-link {
3
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABuklEQVQ4T52U4VnCMBiE71hAnECcgLCBblBYAJxANgAmEDfABWg3kA2IE6ATWBbo+XwplLaWguZnm765fncX4h9LkesC6DHxvv45/8JT5CIQLyB74TspBbFChgUTn9qjq4EauhXIMYA9pBWIFKId0IfkITwa9CpgARM+ID0c1QSRIzcHOIP0ythPLwLbYMdxaTjwgO4Y+9uLwKAicjaztKysPPtCZab7VqAi9wBSkPZNjp4UuiXIZ2RqVqiRm0KYgbR45Csf/FMdHCJE7EDuud72fiksufkFaIkMnyBM6QSSDm6G/B1g7yAdMg2Z+KQCbHUzcg4dbiwy5mYFJr0x9pNKDptgGrolgHFZ1S9lJVgBDA3oMEYtZzqpEogEQgLCQZiEttRgJ+Bo8Amgi0zWz1ChwguDktaMfunxHtCca29/UFkMs+jw+5j0c90Oau1Q62viN+f2GdCGvQW04NrPmzYebpcuE29/0rqCyxoNUkg7xn5Q333OzbMKA9DctKTnc1mU5mehzXPWYEATNFcY0s5NcRWZozav3M3utbBqDvMKzUMjgJvD6V/INLUGXJrd8X3j5XDpdmmD/wAyTxBSftthKwAAAABJRU5ErkJggg==');
4
- background-repeat: no-repeat;
5
- }
@@ -1,5 +0,0 @@
1
-
2
- .icon-grunticon-link {
3
- background-image: url('data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3C%21--%20Generated%20by%20IcoMoon.io%20--%3E%0A%3C%21DOCTYPE%20svg%20PUBLIC%20%22-//W3C//DTD%20SVG%201.1//EN%22%20%22http%3A//www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd%22%3E%0A%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%20768%20768%22%3E%0A%20%20%3Cg%20fill%3D%22%23FF5231%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M544%2032q37.75%200%2072.875%2014.25t62.875%2042%2042%2062.875%2014.25%2072.875q0%2037.5-14.375%2072.875t-41.875%2062.875l-96%2096q-2.75%202.75-8.25%207.75-26.75%2023.75-59.75%2036.125t-67.75%2012.375q-43.75%200-82.75-18.75-29.25-13.75-53-37.5t-37.5-53q18.75-18.75%2045.25-18.75%209.25%200%2018.75%202.75%2016.25%2026.25%2042.5%2042.5%2030.75%2018.75%2066.75%2018.75%2025%200%2048.5-9.5t42-28l96-96q18.5-18.5%2028-42t9.5-48.5-9.5-48.5-28-42-42-28-48.5-9.5-48.5%209.5-42%2028l-67.25%2067.25q-32-8.75-66.25-8.75-5.5%200-15.5%200.5%205-5.5%207.75-8.25l96-96q27.5-27.5%2062.875-41.875t72.875-14.375zM320%20256q43.75%200%2082.75%2018.75%2029.25%2013.75%2053%2037.5t37.5%2053q-18.75%2018.75-45.25%2018.75-9.25%200-18.75-2.75-16.25-26.25-42.5-42.5-30.75-18.75-66.75-18.75-25%200-48.5%209.5t-42%2028l-96%2096q-18.5%2018.5-28%2042t-9.5%2048.5%209.5%2048.5%2028%2042%2042%2028%2048.5%209.5%2048.5-9.5%2042-28l67.25-67.25q32%208.75%2066.25%208.75%205.5%200%2015.5-0.5-5%205.5-7.75%208.25l-96%2096q-27.75%2027.75-62.875%2042t-72.875%2014.25q-37.5%200-72.875-14.375t-62.875-41.875q-27.75-27.75-42-62.875t-14.25-72.875%2014.25-72.875%2042-62.875l96-96q2.75-2.75%208.25-7.75%2026.75-23.75%2059.75-36.125t67.75-12.375z%22%3E%3C/path%3E%0A%20%20%3C/g%3E%0A%3C/svg%3E%0A');
4
- background-repeat: no-repeat;
5
- }
@@ -1,5 +0,0 @@
1
-
2
- .icon-grunticon-link {
3
- background-image: url('png/grunticon-link.png');
4
- background-repeat: no-repeat;
5
- }
@@ -1,33 +0,0 @@
1
- <!doctype HTML>
2
- <html>
3
- <head>
4
- <title>Icons Preview!</title>
5
- <meta charset="utf-8">
6
- <style>
7
- body {
8
- background-image: linear-gradient(#eee 25%, transparent 25%, transparent), linear-gradient(#eee 25%, transparent 25%, transparent), linear-gradient(transparent 75%, #eee 75%), linear-gradient(transparent 75%, #eee 75%);
9
- width: auto;
10
- background-size: 10px 10px;
11
- }
12
- </style>
13
- <script>
14
-
15
- /*! grunt-grunticon Stylesheet Loader - v2.1.2 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */
16
-
17
- (function(e){function t(t,n,r,o){"use strict";function a(){for(var e,n=0;u.length>n;n++)u[n].href&&u[n].href.indexOf(t)>-1&&(e=!0);e?i.media=r||"all":setTimeout(a)}var i=e.document.createElement("link"),l=n||e.document.getElementsByTagName("script")[0],u=e.document.styleSheets;return i.rel="stylesheet",i.href=t,i.media="only x",i.onload=o||null,l.parentNode.insertBefore(i,l),a(),i}var n=function(r,o){"use strict";if(r&&3===r.length){var a=e.navigator,i=e.Image,l=!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||e.opera&&-1===a.userAgent.indexOf("Chrome")||-1!==a.userAgent.indexOf("Series40")),u=new i;u.onerror=function(){n.method="png",n.href=r[2],t(r[2])},u.onload=function(){var e=1===u.width&&1===u.height,a=r[e&&l?0:e?1:2];n.method=e&&l?"svg":e?"datapng":"png",n.href=a,t(a,null,null,o)},u.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",document.documentElement.className+=" grunticon"}};n.loadCSS=t,e.grunticon=n})(this);(function(e,t){"use strict";var n=t.document,r="grunticon:",o=function(e){if(n.attachEvent?"complete"===n.readyState:"loading"!==n.readyState)e();else{var t=!1;n.addEventListener("readystatechange",function(){t||(t=!0,e())},!1)}},a=function(e){return t.document.querySelector('link[href$="'+e+'"]')},c=function(e){var t,n,o,a,c,i,u={};if(t=e.sheet,!t)return u;n=t.cssRules?t.cssRules:t.rules;for(var l=0;n.length>l;l++)o=n[l].cssText,a=r+n[l].selectorText,c=o.split(");")[0].match(/US\-ASCII\,([^"']+)/),c&&c[1]&&(i=decodeURIComponent(c[1]),u[a]=i);return u},i=function(e){var t,o,a;o="data-grunticon-embed";for(var c in e)if(a=c.slice(r.length),t=n.querySelectorAll(a+"["+o+"]"),t.length)for(var i=0;t.length>i;i++)t[i].innerHTML=e[c],t[i].style.backgroundImage="none",t[i].removeAttribute(o);return t},u=function(t){"svg"===e.method&&o(function(){i(c(a(e.href))),"function"==typeof t&&t()})};e.embedIcons=i,e.getCSS=a,e.getIcons=c,e.ready=o,e.svgLoadedCallback=u,e.embedSVG=u})(grunticon,this);
18
-
19
- grunticon(["icons.data.svg.css", "icons.data.png.css", "icons.fallback.css"]);
20
- </script>
21
- <noscript><link href="icons.fallback.css" rel="stylesheet"></noscript>
22
-
23
- </head>
24
- <body>
25
-
26
- <h1>PREVIEW - you can change this in the previewTemplate option</h1>
27
-
28
-
29
- <pre><code>.icon-grunticon-link:</code></pre><div class="icon-grunticon-link" style="width: 20px; height: 20px;" ></div><hr/>
30
-
31
-
32
- </body>
33
- </html>