typographical 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ // Colors
2
+ $default-shade: #222;
3
+ $default-color: #222;
4
+ $default-tint: #aaa;
5
+ $grey-1: #979797;
6
+ $grey-2: #e5e5e5;
7
+ $grey-3: #f9f9f9;
8
+ $white: #fff;
9
+ $blue: #4a9ae1;
10
+ $shadow-color: rgba(0, 0, 0, .2);
11
+ $code-color: #bf616a;
12
+ $accent-color: #ffd900;
13
+ $base-font-size: 1.3rem;
14
+
15
+ // Fonts
16
+ $serif-primary: Alegreya, 'Times New Roman', Times, serif;
17
+ $serif-secondary: Alegreya, Palatino, 'Palatino LT STD', 'Palatino Linotype', 'Book Antiqua', 'Georgia', serif;
18
+ $sans-serif: 'Alegreya Sans', Helvetica, Arial, sans-serif;
19
+ $monospaced: 'Fira Mono', Menlo, Consolas, monospace;
20
+ $sc-font: 'Alegreya SC';
21
+
22
+ @mixin box-sizing($type: border-box) {
23
+ -webkit-box-sizing: $type;
24
+ -moz-box-sizing: $type;
25
+ box-sizing: $type;
26
+ }
27
+
28
+ @mixin transition($args...) {
29
+ -webkit-transition: $args;
30
+ -moz-transition: $args;
31
+ transition: $args;
32
+ }
Binary file
@@ -0,0 +1,164 @@
1
+ /**
2
+ *
3
+ * Default filter to prepend and append Text.
4
+ *
5
+ */
6
+ (function( window ) {
7
+
8
+ // create filter for prefix and postfix
9
+ window.filter_prefix_postfix = function( selection ) {
10
+
11
+ // load filter configuration
12
+ var copyenrich = window.copyenrich || {};
13
+ var clipboard_prefix = copyenrich.filter_prefix || '';
14
+ var clipboard_postfix = copyenrich.filter_postfix || '';
15
+
16
+ return clipboard_prefix + selection + clipboard_postfix;
17
+ };
18
+
19
+ })( window );
20
+
21
+ /**
22
+ *
23
+ * Minimal length required to perform text enrichment.
24
+ * If the minimum length is not reached, function will return FALSE
25
+ * which results in cancelation of all changes made and return the
26
+ * originally selected text.
27
+ *
28
+ */
29
+ (function( window ) {
30
+
31
+ window.filter_minlength = function( selection ) {
32
+
33
+ // load filter configuration
34
+ var copyenrich = window.copyenrich || {};
35
+ var minlength = copyenrich.filter_minlength || 20;
36
+
37
+ if ( selection.length < minlength ) {
38
+ // Boolean FALSE means that no changes will be done at all.
39
+ return false;
40
+ };
41
+
42
+ return selection;
43
+ };
44
+
45
+ })( window );
46
+
47
+ /**
48
+ *
49
+ * User defined filters. They can be loaded from external file.
50
+ *
51
+ */
52
+ (function( window ) {
53
+
54
+ window.filter_source_url = function( selection ) {
55
+
56
+ // load filter configuration
57
+ var copyenrich = window.copyenrich || {};
58
+ var postfix = copyenrich.filter_source_url || '';
59
+
60
+ return selection + postfix + location.href;
61
+ };
62
+
63
+ })( window );
64
+
65
+ /**
66
+ *
67
+ * Tracks the copied text with Google Analytics.
68
+ *
69
+ */
70
+ (function( window ) {
71
+
72
+ window._gaq = window._gaq || [];
73
+ window.filter_analytics = function( selection ) {
74
+ // load filter configuration
75
+ var copyenrich = window.copyenrich || {};
76
+ var track_name = copyenrich.filter_analytics_name;
77
+ var track_value = copyenrich.filter_analytics_value;
78
+
79
+ window._gaq.push(['_trackEvent', track_name, track_value, selection]);
80
+ // return selection without modification
81
+ return selection;
82
+ };
83
+
84
+ })( window );
85
+
86
+ /**
87
+ *
88
+ * Inserts an Ad to the selection if certain words have been selected.
89
+ * Context based Ad insetion.
90
+ *
91
+ */
92
+ (function( window ) {
93
+
94
+ window.filter_wordmatch_ad = function( selection ) {
95
+
96
+ // load filter configuration
97
+ var copyenrich = window.copyenrich || {};
98
+ // if these words are inside the selection, AdText will be inserted
99
+ var signal_words = copyenrich.filter_wordmatch_ad_signal_words || [ ];
100
+ var ad_text = copyenrich.filter_wordmatch_ad || '';
101
+
102
+ // try to match words inside selected text
103
+ var word = '';
104
+ var word_match = false;
105
+
106
+ var split = selection.split( ' ' );
107
+ for( var w = 0; w < split.length; w++ ) {
108
+ word = split[w].trim( ).replace( /[\.,\-;:\n\r]+/gi, '' );
109
+
110
+ for( var sw = 0; sw < signal_words.length; sw++ ) {
111
+ if ( signal_words[sw] == word ) {
112
+ word_match = true;
113
+ }
114
+ }
115
+
116
+ if ( word_match === true ) {
117
+ return selection + ad_text;
118
+ }
119
+ }
120
+
121
+ return selection;
122
+ };
123
+
124
+ })( window );
125
+
126
+ /**
127
+ *
128
+ * Enables script if at least one keyword is inside the selected text.
129
+ *
130
+ */
131
+ (function( window ) {
132
+
133
+ window.filter_wordmatch_enabled = function( selection ) {
134
+
135
+ // load filter configuration
136
+ var copyenrich = window.copyenrich || {};
137
+ // if these words are inside the selection, script will be enabled
138
+ var signal_words = copyenrich.filter_wordmatch_enabled_signal_words || [ ];
139
+
140
+ // try to match words inside selected text
141
+ var word = '';
142
+ var word_match = false;
143
+
144
+ var split = selection.split( ' ' );
145
+ for( var w = 0; w < split.length; w++ ) {
146
+ word = split[w].trim( ).replace( /[\.,\-;:\n\r]+/gi, '' );
147
+
148
+ for( var sw = 0; sw < signal_words.length; sw++ ) {
149
+ if ( signal_words[sw] == word ) {
150
+ word_match = true;
151
+ }
152
+ }
153
+ }
154
+
155
+ // if signal words not found, disable all changes made by the script
156
+ if ( word_match !== true ) {
157
+ // Boolean FALSE means that no changes will be done at all.
158
+ return false;
159
+ }
160
+
161
+ return selection;
162
+ };
163
+
164
+ })( window );
@@ -0,0 +1,127 @@
1
+ /**
2
+ // Copyright (c) 2014 AKM3 GmbH
3
+ // http://www.akm3.com
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ // of this software and associated documentation files (the "Software"), to deal
7
+ // in the Software without restriction, including without limitation the rights
8
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ // copies of the Software, and to permit persons to whom the Software is
10
+ // furnished to do so, subject to the following conditions:
11
+ //
12
+ // The above copyright notice and this permission notice shall be included in
13
+ // all copies or substantial portions of the Software.
14
+ //
15
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ // THE SOFTWARE.
22
+ */
23
+ (function( d, w ) {
24
+
25
+ // Version
26
+ w.version = '1.4';
27
+
28
+ // preparing filter array where filter calbacks are stored
29
+ w.copyenrichFilters = w.copyenrichFilters || [];
30
+
31
+ // register "copy" event
32
+ if ( w.addEventListener ) {
33
+ d.body.addEventListener( "copy", intercept_clipboard, true );
34
+ }
35
+
36
+ /**
37
+ * Creates helper element, copies selected and modified text inthere
38
+ * and creates new selection with the new text.
39
+ */
40
+ function intercept_clipboard( ) {
41
+
42
+ var clipboard_text = get_selection( );
43
+ var modified_clipboard_text = clipboard_text;
44
+
45
+ // Running filters on selection. Here all changes of the selected text are done.
46
+ // To stop filtering and restore original selection, any filter
47
+ // may return (boolean) FALSE.
48
+
49
+ if ( w.copyenrichFilters.length > 0 ) {
50
+ // running filters
51
+ for( var f = 0; f < w.copyenrichFilters.length; f++ ) {
52
+ try {
53
+ modified_clipboard_text = w.copyenrichFilters[f][0]( modified_clipboard_text );
54
+ console.log( 'Copyenrich executing filter: ' + f );
55
+ // breaking condition: returning (bool) FALSE means that no changes should be done at all
56
+ if ( modified_clipboard_text === false ) {
57
+ // Remove helper element
58
+ w.setTimeout( hide_clipboard_interceptor, 200 );
59
+ console.log( 'Copyenrich: filter triggered reset. No changes done.' );
60
+ // terminate here, undo all changes. filter told us to do so.
61
+ return;
62
+ }
63
+
64
+ } catch ( err ) {
65
+ console.log( '! Copyenrich filter caused an error. Current filter was: ' + w.copyenrichFilters[f][0] );
66
+ }
67
+ }
68
+ }
69
+
70
+ // Creates helper element outside the view
71
+ var top = ( w.pageYOffset || d.scrollTop );
72
+ var div = d.createElement( 'span' );
73
+ div.id = 'clipboard_interceptor';
74
+ div.style.position = 'absolute';
75
+ div.style.top = ( typeof top == 'undefined' ? 0 : top ) + 'px';
76
+ div.style.left = '-300px';
77
+ div.style.overflow = 'hidden';
78
+ div.style.width = '100px';
79
+ div.style.height = '100px';
80
+ d.body.appendChild( div );
81
+
82
+ // Modifies clipboard text and preselects it to be copied
83
+ if ( navigator.userAgent.indexOf( 'Firefox' ) > 0 ) {
84
+ div.innerHTML = modified_clipboard_text.replace( /\n/g, '<br>' );
85
+ } else {
86
+ // Creates textarea to store clipboard text
87
+ var textarea = d.createElement( 'textarea' );
88
+ div.appendChild( textarea );
89
+
90
+ textarea.innerHTML = modified_clipboard_text;
91
+ }
92
+
93
+ // Selects modified hidden text to be copied instead of original selection
94
+ if ( navigator.userAgent.indexOf( 'Firefox' ) > 0 ) {
95
+ var sel = w.getSelection( );
96
+ if( sel.rangeCount > 0 ) sel.removeAllRanges( );
97
+ var range = d.createRange( );
98
+ range.selectNode( div );
99
+ sel.addRange( range );
100
+ } else {
101
+ textarea.select( );
102
+ }
103
+ console.log( 'Copyenrich: done.' );
104
+ // Remove helper element
105
+ w.setTimeout( hide_clipboard_interceptor, 200 );
106
+ }
107
+
108
+ /**
109
+ * Gets selected Text
110
+ */
111
+ function get_selection( ) {
112
+
113
+ var sel = w.getSelection( );
114
+ var selected_text = sel.toString( );
115
+
116
+ return selected_text;
117
+ }
118
+
119
+ /**
120
+ * Removes helper element
121
+ */
122
+ function hide_clipboard_interceptor() {
123
+ var c = d.getElementById( 'clipboard_interceptor' );
124
+ c && c.parentNode.removeChild( c );
125
+ }
126
+
127
+ })( document, window );
Binary file
Binary file
data/assets/main.scss ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ # Only the main Sass file needs front matter (the dashes are enough)
3
+ ---
4
+
5
+ @import 'typographical';
metadata ADDED
@@ -0,0 +1,184 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: typographical
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ram Iyer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jekyll-paginate
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jekyll-feed
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.10.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.10.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: jekyll-seo-tag
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.5'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.5.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.5'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.5.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: jekyll-sitemap
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.2'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 1.2.0
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '1.2'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 1.2.0
95
+ - !ruby/object:Gem::Dependency
96
+ name: bundler
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.16'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '1.16'
109
+ - !ruby/object:Gem::Dependency
110
+ name: rake
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '12.0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '12.0'
123
+ description:
124
+ email:
125
+ - ramakrishnan.rkology@gmail.com
126
+ executables: []
127
+ extensions: []
128
+ extra_rdoc_files: []
129
+ files:
130
+ - LICENSE.txt
131
+ - README.md
132
+ - _includes/analytics.html
133
+ - _includes/copyenrich-hook.html
134
+ - _includes/footer.html
135
+ - _includes/head.html
136
+ - _includes/navigation.html
137
+ - _includes/related.html
138
+ - _includes/share.html
139
+ - _layouts/default.html
140
+ - _layouts/home.html
141
+ - _layouts/page.html
142
+ - _layouts/post.html
143
+ - _sass/typographical.scss
144
+ - _sass/typographical/_base.scss
145
+ - _sass/typographical/_catalogue.scss
146
+ - _sass/typographical/_code.scss
147
+ - _sass/typographical/_layout.scss
148
+ - _sass/typographical/_multipage.scss
149
+ - _sass/typographical/_pagination.scss
150
+ - _sass/typographical/_post.scss
151
+ - _sass/typographical/_syntax.scss
152
+ - _sass/typographical/_tweaks.scss
153
+ - _sass/typographical/_variables.scss
154
+ - assets/apple-touch-icon.png
155
+ - assets/copyenrich/copyenrich-filter.js
156
+ - assets/copyenrich/copyenrich.js
157
+ - assets/favicon-16x16.png
158
+ - assets/favicon-32x32.png
159
+ - assets/main.scss
160
+ homepage: https://iam.ramiyer.me
161
+ licenses:
162
+ - MIT
163
+ metadata: {}
164
+ post_install_message:
165
+ rdoc_options: []
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ requirements: []
179
+ rubyforge_project:
180
+ rubygems_version: 2.7.6
181
+ signing_key:
182
+ specification_version: 4
183
+ summary: A typography-focused theme based on Tale by Chester How.
184
+ test_files: []