homesteading_assets 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +34 -0
  3. data/app/assets/javascripts/homesteading_assets/read.js +2 -0
  4. data/app/assets/javascripts/homesteading_assets/write.js +57 -0
  5. data/app/assets/stylesheets/homesteading_assets/alerts.css.scss +107 -0
  6. data/app/assets/stylesheets/homesteading_assets/application.css +15 -0
  7. data/app/assets/stylesheets/homesteading_assets/application.css.scss +7 -0
  8. data/app/assets/stylesheets/homesteading_assets/base.css.scss +9 -0
  9. data/app/assets/stylesheets/homesteading_assets/nav.css.scss +13 -0
  10. data/app/assets/stylesheets/homesteading_assets/note.css.scss +34 -0
  11. data/app/assets/stylesheets/homesteading_assets/pagination.css.scss +55 -0
  12. data/app/assets/stylesheets/homesteading_assets/read-write.css.scss +269 -0
  13. data/app/assets/stylesheets/homesteading_assets/read.css.scss +43 -0
  14. data/app/assets/stylesheets/homesteading_assets/settings.css.scss +13 -0
  15. data/app/controllers/homesteading_assets/application_controller.rb +4 -0
  16. data/app/helpers/homesteading_assets/application_helper.rb +4 -0
  17. data/app/views/layouts/homesteading_assets/application.html.erb +14 -0
  18. data/config/routes.rb +2 -0
  19. data/lib/homesteading_assets/engine.rb +5 -0
  20. data/lib/homesteading_assets/version.rb +3 -0
  21. data/lib/homesteading_assets.rb +4 -0
  22. data/lib/tasks/homesteading_assets_tasks.rake +0 -0
  23. data/test/dummy/README.rdoc +28 -0
  24. data/test/dummy/Rakefile +6 -0
  25. data/test/dummy/app/assets/javascripts/application.js +13 -0
  26. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  27. data/test/dummy/app/controllers/application_controller.rb +5 -0
  28. data/test/dummy/app/helpers/application_helper.rb +2 -0
  29. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/test/dummy/bin/bundle +3 -0
  31. data/test/dummy/bin/rails +4 -0
  32. data/test/dummy/bin/rake +4 -0
  33. data/test/dummy/config/application.rb +23 -0
  34. data/test/dummy/config/boot.rb +5 -0
  35. data/test/dummy/config/database.yml +25 -0
  36. data/test/dummy/config/environment.rb +5 -0
  37. data/test/dummy/config/environments/development.rb +37 -0
  38. data/test/dummy/config/environments/production.rb +78 -0
  39. data/test/dummy/config/environments/test.rb +39 -0
  40. data/test/dummy/config/initializers/assets.rb +8 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  43. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  44. data/test/dummy/config/initializers/inflections.rb +16 -0
  45. data/test/dummy/config/initializers/mime_types.rb +4 -0
  46. data/test/dummy/config/initializers/session_store.rb +3 -0
  47. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  48. data/test/dummy/config/locales/en.yml +23 -0
  49. data/test/dummy/config/routes.rb +4 -0
  50. data/test/dummy/config/secrets.yml +22 -0
  51. data/test/dummy/config.ru +4 -0
  52. data/test/dummy/public/404.html +67 -0
  53. data/test/dummy/public/422.html +67 -0
  54. data/test/dummy/public/500.html +66 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/homesteading_assets_test.rb +7 -0
  57. data/test/integration/navigation_test.rb +10 -0
  58. data/test/test_helper.rb +15 -0
  59. metadata +169 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 08874dc6f2acab803ee9eed856013e40f6379f7a
4
+ data.tar.gz: 39f92604574223e477621c185f7bdb9ab0ac0150
5
+ SHA512:
6
+ metadata.gz: ae853a16ee17b625e9543b4bee1974a846948df21595001579c31df928941f562ae865cd622b86962f74f2d6cd76ae953353532e301b6a5929dc2e87d88e3ad2
7
+ data.tar.gz: e884aba933b331c7f55ab530b9ee15ecae144832eb80c6025af29bdbf16e1c1511766c5374aa9b1dcfa8d90cef01872fcb205657bd188820ce266ba0542e70eb
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'HomesteadingAssets'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
@@ -0,0 +1,57 @@
1
+ //= require modernizr
2
+ //= require jquery
3
+ //= require jquery_ujs
4
+ //= require jquery.simplyCountable
5
+
6
+ // for p-location geo fields
7
+ // TODO: extract into plugin and out of global namespace
8
+ function getLocation() {
9
+ if (Modernizr.geolocation) {
10
+ navigator.geolocation.getCurrentPosition(populateGeoFields);
11
+ }
12
+ }
13
+
14
+ // TODO: extract into plugin and out of global namespace
15
+ function populateGeoFields(position) {
16
+ var latitude = position.coords.latitude;
17
+ var longitude = position.coords.longitude;
18
+ var altitude = position.coords.altitude;
19
+
20
+ $("#notes.new #note_location_latitude" ).val(latitude);
21
+ $("#notes.new #note_location_longitude").val(longitude);
22
+ $("#notes.new #note_location_altitude" ).val(altitude);
23
+ }
24
+
25
+
26
+ // for dt-published datetime field
27
+ // TODO: extract into plugin and out of global namespace
28
+ function ISODateString(d){
29
+ function pad(n) { return n < 10 ? '0' + n : n }
30
+ return d.getUTCFullYear()+'-'
31
+ + pad(d.getUTCMonth()+1)+'-'
32
+ + pad(d.getUTCDate())+'T'
33
+ + pad(d.getUTCHours())+':'
34
+ + pad(d.getUTCMinutes())+':'
35
+ + pad(d.getUTCSeconds())+'-07:00'
36
+ }
37
+
38
+
39
+ $(function() {
40
+ // for notes
41
+ $('#note_content').simplyCountable({
42
+ counter: '#content-count',
43
+ countDirection: 'up',
44
+ maxCount: 120,
45
+ safeClass: 'under',
46
+ overClass: 'over',
47
+ thousandSeparator: ','
48
+ });
49
+
50
+ // prints something like 2009-09-28T19:03:12Z
51
+ $("#notes.new .dt-published").val(ISODateString(new Date()))
52
+
53
+ // ask user to access their location
54
+ // populate lat/lon/alt fields
55
+ // TODO: extract into plugin and out of global namespace
56
+ getLocation();
57
+ });
@@ -0,0 +1,107 @@
1
+ /* Borrowed and modifed from Bootstrap v3.0.0
2
+ * Their Apache license applies to the contents of this file:
3
+ * alerts.css.scss
4
+ * https://github.com/homesteading/homesteading-note/blob/master/app/assets/stylesheets/alerts.css.scss
5
+ */
6
+
7
+ /*!
8
+ * Bootstrap v3.0.0
9
+ *
10
+ * Copyright 2013 Twitter, Inc
11
+ * Licensed under the Apache License v2.0
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Designed and built with all the love in the world by @mdo and @fat.
15
+ */
16
+
17
+
18
+ .alert {
19
+ padding: 15px;
20
+ margin-bottom: 20px;
21
+ border: 1px solid transparent;
22
+ }
23
+
24
+ .alert h4 {
25
+ margin-top: 0;
26
+ color: inherit;
27
+ }
28
+
29
+ .alert .alert-link {
30
+ font-weight: bold;
31
+ }
32
+
33
+ .alert > p,
34
+ .alert > ul {
35
+ margin-bottom: 0;
36
+ }
37
+
38
+ .alert > p + p {
39
+ margin-top: 5px;
40
+ }
41
+
42
+ .alert-dismissable {
43
+ padding-right: 35px;
44
+ }
45
+
46
+ .alert-dismissable .close {
47
+ position: relative;
48
+ top: -2px;
49
+ right: -21px;
50
+ color: inherit;
51
+ }
52
+
53
+ .alert-success {
54
+ color: #468847;
55
+ background-color: #dff0d8;
56
+ border-color: #d6e9c6;
57
+ }
58
+
59
+ .alert-success hr {
60
+ border-top-color: #c9e2b3;
61
+ }
62
+
63
+ .alert-success .alert-link {
64
+ color: #356635;
65
+ }
66
+
67
+ .alert-info {
68
+ color: #3a87ad;
69
+ background-color: #d9edf7;
70
+ border-color: #bce8f1;
71
+ }
72
+
73
+ .alert-info hr {
74
+ border-top-color: #a6e1ec;
75
+ }
76
+
77
+ .alert-info .alert-link {
78
+ color: #2d6987;
79
+ }
80
+
81
+ .alert-warning {
82
+ color: #c09853;
83
+ background-color: #fcf8e3;
84
+ border-color: #fbeed5;
85
+ }
86
+
87
+ .alert-warning hr {
88
+ border-top-color: #f8e5be;
89
+ }
90
+
91
+ .alert-warning .alert-link {
92
+ color: #a47e3c;
93
+ }
94
+
95
+ .alert-danger {
96
+ color: #b94a48;
97
+ background-color: #f2dede;
98
+ border-color: #eed3d7;
99
+ }
100
+
101
+ .alert-danger hr {
102
+ border-top-color: #e6c1c7;
103
+ }
104
+
105
+ .alert-danger .alert-link {
106
+ color: #953b39;
107
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,7 @@
1
+ //= require base
2
+ //= require nav
3
+ //= require read-write
4
+ //= require read
5
+ //= require settings
6
+ //= require alerts
7
+ //= require pagination
@@ -0,0 +1,9 @@
1
+ a {
2
+ color: #333;
3
+ }
4
+
5
+ .small-word {
6
+ font-weight: normal;
7
+ font-style: italic;
8
+ font-family: georgia, times, serif;
9
+ }
@@ -0,0 +1,13 @@
1
+ nav[role="navigation"] {
2
+ width: 80%;
3
+ margin: 2em auto;
4
+ border-bottom: 1px solid #eee;
5
+ padding-bottom: .5em;
6
+
7
+ ul { width: 50%; display: inline; margin: 0; padding: 0; }
8
+ ul.admin { float: right; text-align: right; }
9
+ li { display: inline; margin-right: .25em; }
10
+
11
+ a { text-decoration: none; }
12
+ a:hover { border-bottom: 1px solid black; }
13
+ }
@@ -0,0 +1,34 @@
1
+ .h-entry {
2
+ .post-meta {
3
+ font-size: 16px;
4
+ line-height: 1.25em;
5
+ margin: 1em 0 0 0;
6
+ opacity: .5;
7
+ color: #999;
8
+
9
+ .syndication {
10
+ font-weight: normal;
11
+ display: inline;
12
+
13
+ p,
14
+ ul,
15
+ li {
16
+ display: inline;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ li {
22
+ margin-left: .25em;
23
+ }
24
+ }
25
+ }
26
+ }
27
+
28
+ /* "tablet" */
29
+ @media (min-width: 768px) {
30
+ .h-entry footer .syndication {
31
+ display: block;
32
+ margin: 0;
33
+ }
34
+ }
@@ -0,0 +1,55 @@
1
+ /* pagination... */
2
+ .pagination {
3
+ font-size: 12px;
4
+ text-align: center;
5
+ padding: 3em 0;
6
+ }
7
+
8
+ .pagination span,
9
+ .pagination em,
10
+ .pagination a {
11
+ padding: .25em;
12
+ border: 0;
13
+ }
14
+
15
+ .pagination .disabled {
16
+ color: #999;
17
+ }
18
+
19
+ .pagination .current {
20
+ color: white;
21
+ font-weight: bold;
22
+ background: #666;
23
+ font-style: normal;
24
+ display: inline-block;
25
+ text-align: center;
26
+ }
27
+
28
+ .pagination .gap {
29
+ color: #666;
30
+ }
31
+
32
+ .pagination a {
33
+ color: #666;
34
+ background: white;
35
+ text-decoration: none;
36
+ display: inline-block;
37
+ }
38
+
39
+ .pagination a.prev_page,
40
+ .pagination a.next_page {
41
+ font-weight: bold;
42
+ }
43
+
44
+ .pagination a:hover {
45
+ color: white;
46
+ background: #333;
47
+ }
48
+
49
+ /* "tablet" */
50
+ @media (min-width: 768px) {
51
+ .pagination {
52
+ font-size: 16px;
53
+ }
54
+ }
55
+ /* ...pagination */
@@ -0,0 +1,269 @@
1
+ body {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+
6
+ body,
7
+ fieldset,
8
+ input[type=text],
9
+ input[type=url],
10
+ input[type=email],
11
+ input[type=number],
12
+ input[type=datetime],
13
+ textarea,
14
+ button {
15
+ font-family: "helvetica neue", helvetica, arial, sans-serif;
16
+ }
17
+
18
+ body,
19
+ fieldset,
20
+ input[type=text],
21
+ input[type=url],
22
+ input[type=email],
23
+ input[type=number],
24
+ input[type=datetime],
25
+ textarea {
26
+ width: 100%;
27
+ }
28
+
29
+ form h4 a {
30
+ font-weight: normal;
31
+ }
32
+
33
+ .screen-reader-only {
34
+ display: none !important;
35
+ }
36
+
37
+ :focus {
38
+ outline: none;
39
+ }
40
+
41
+ textarea {
42
+ display: block;
43
+ }
44
+
45
+ input {
46
+ display: inline-block;
47
+ }
48
+
49
+ input,
50
+ textarea,
51
+ fieldset {
52
+ border: none;
53
+ padding: 0;
54
+ }
55
+
56
+ .pagination,
57
+ .h-entry {
58
+ margin: 3em auto 5em auto;
59
+ width: 80%;
60
+ padding: 0;
61
+ }
62
+
63
+ .content-container {
64
+ position: relative;
65
+ }
66
+
67
+ .content-container + fieldset {
68
+ clear: both;
69
+ margin-top: 1em;
70
+ }
71
+
72
+ .content-container .e-content {
73
+ height: 10em;
74
+ margin-top: .5em;
75
+ }
76
+
77
+ .e-content {
78
+ font-family: georgia, times, serif;
79
+ font-size: 1em;
80
+
81
+ h1, h2, h3, h4, h5, h6 {
82
+ font-family: "helvetica neue", helvetica, arial, sans-serif;
83
+ }
84
+ }
85
+
86
+
87
+ .p-hs-content-count {
88
+ background: white;
89
+ background: rgba(255, 255, 255, .9);
90
+ font-weight: normal;
91
+ color: #a9a9a9;
92
+ display: block;
93
+ height: 1em;
94
+ margin-top: -2em;
95
+ padding: .5em;
96
+ position: absolute;
97
+ right: 0;
98
+ text-align: right;
99
+ font-size: .8em;
100
+ }
101
+
102
+ .p-hs-content-count.over {
103
+ font-weight: bold;
104
+ color: #666;
105
+ }
106
+
107
+ .actions {
108
+ margin: 2em 0 3em 0;
109
+ padding-bottom: 3em;
110
+ border-bottom: 1px solid #eee;
111
+ }
112
+
113
+ .action {
114
+ color: #333;
115
+ text-transform: uppercase;
116
+ float: left;
117
+ text-decoration: none;
118
+ border-bottom: 1px solid #333;
119
+ }
120
+
121
+ .action-delete {
122
+ color: red;
123
+ text-transform: uppercase;
124
+ float: left;
125
+ text-decoration: none;
126
+ border-bottom: 1px solid red;
127
+ margin-right: 1em;
128
+ }
129
+
130
+ .action-save {
131
+ background: green;
132
+ text-transform: uppercase;
133
+ font-size: 1em;
134
+ font-weight: bold;
135
+ border: none;
136
+ color: white;
137
+ text-align: right;
138
+ float: right;
139
+ }
140
+
141
+ .action { padding: .4em 0; }
142
+ .action-delete { padding: .4em 0; }
143
+ .action-save { padding: .4em .66em; }
144
+
145
+ .actions .dt-updated {
146
+ color: #ccc;
147
+ display: block;
148
+ text-align: right;
149
+ clear: both;
150
+ font-size: .8em;
151
+ }
152
+
153
+ .p-location input,
154
+ .meta input {
155
+ display: block;
156
+ margin: 0;
157
+ padding: .5em 0;
158
+ font-size: .8em;
159
+ width: 100%;
160
+ }
161
+
162
+ .meta .tags,
163
+ .meta .u-in-reply-to {
164
+ border: none;
165
+ }
166
+
167
+ .meta select,
168
+ .meta #published-date,
169
+ .meta input[type=datetime] {
170
+ display: block;
171
+ width: 100%;
172
+ }
173
+
174
+ .p-location {
175
+ margin: 2em 0 0 0;
176
+ }
177
+
178
+ .syndication {
179
+ margin-bottom: 2em;
180
+ }
181
+
182
+ .syndication legend {
183
+ color: #a9a9a9;
184
+ font-weight: bold;
185
+ margin-bottom: .25em;
186
+ }
187
+
188
+ .syndication ul,
189
+ .syndication li {
190
+ margin: 0;
191
+ padding: 0;
192
+ margin-top: .25em;
193
+ }
194
+
195
+ .syndication li {
196
+ width: 48%;
197
+ display: inline-block;
198
+ }
199
+
200
+ .actions label {
201
+ float: right;
202
+ margin-right: .5em;
203
+ }
204
+
205
+ .actions label,
206
+ .syndication label {
207
+ color: #a9a9a9;
208
+ padding: .5em;
209
+ display: block;
210
+ border: 1px solid #eee;
211
+ -webkit-touch-callout: none;
212
+ -webkit-user-select: none;
213
+ -khtml-user-select: none;
214
+ -moz-user-select: none;
215
+ -ms-user-select: none;
216
+ user-select: none;
217
+ }
218
+
219
+ .actions label::selection,
220
+ .syndication label::selection { background: transparent; }
221
+ .actions label::-moz-selection,
222
+ .syndication label::-moz-selection { background: transparent; }
223
+
224
+ .actions input[type=checkbox],
225
+ .syndication input[type=checkbox] {
226
+ display: none;
227
+ }
228
+
229
+ .actions input:checked + label,
230
+ .syndication input:checked + label {
231
+ color: black;
232
+ border: 1px solid black;
233
+ }
234
+
235
+ aside .meta {
236
+ margin: 1em 0;
237
+ }
238
+
239
+ footer[role="contentinfo"] {
240
+ text-align: center;
241
+ color: #999;
242
+ }
243
+
244
+ @media (min-width: 768pt) {
245
+ .e-content { font-size: 1.25em; }
246
+ .p-hs-content-count,
247
+ .p-location input,
248
+ .meta input { font-size: 1em; }
249
+
250
+ .syndication ul,
251
+ .syndication li {
252
+ display: inline-block;
253
+ width: auto;
254
+ }
255
+
256
+ .meta input[type=datetime],
257
+ aside .meta input {
258
+ width: 50%;
259
+ display: inline;
260
+ float: left;
261
+ }
262
+
263
+ .p-location .p-name { width: 100%; }
264
+
265
+ .p-location input {
266
+ width: 33%;
267
+ display: inline-block;
268
+ }
269
+ }
@@ -0,0 +1,43 @@
1
+ .h-feed {
2
+ margin: 0;
3
+ padding: 0;
4
+ list-style-type: none;
5
+ }
6
+
7
+ .h-entry {
8
+ .p-name .p-hs-title,
9
+ .p-name .p-hs-subtitle {
10
+ display: block;
11
+ }
12
+
13
+ header .post-meta {
14
+ margin-bottom: 1em;
15
+ }
16
+
17
+ .p-name {
18
+ a {
19
+ text-decoration: none;
20
+ }
21
+
22
+ a:hover {
23
+ text-decoration: underline;
24
+ }
25
+
26
+ .edit {
27
+ font-weight: normal;
28
+ color: green;
29
+ }
30
+ }
31
+
32
+ p { margin-bottom: 1em; }
33
+
34
+ footer {
35
+ margin: 2em 0 0 0;
36
+ opacity: .75;
37
+ color: #999;
38
+
39
+ a { color: #999; }
40
+
41
+ p { margin: 0; }
42
+ }
43
+ }
@@ -0,0 +1,13 @@
1
+ #settings {
2
+ label,
3
+ input {
4
+ text-align: left;
5
+ font-size: 1em;
6
+ }
7
+
8
+ form { margin-bottom: 5em; }
9
+ dt { font-weight: bold; }
10
+ dt label { font-weight: normal; }
11
+ dd { margin: 0 0 1em 0; }
12
+ input { border-bottom: 1px dotted #999; }
13
+ }
@@ -0,0 +1,4 @@
1
+ module HomesteadingAssets
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HomesteadingAssets
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>HomesteadingAssets</title>
5
+ <%= stylesheet_link_tag "homesteading_assets/application", media: "all" %>
6
+ <%= javascript_include_tag "homesteading_assets/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ HomesteadingAssets::Engine.routes.draw do
2
+ end