simplec 0.1.1 → 0.1.2

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +308 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/simplec_manifest.js +2 -0
  6. data/app/assets/fonts/simplec/summernote.eot +0 -0
  7. data/app/assets/fonts/simplec/summernote.ttf +0 -0
  8. data/app/assets/fonts/simplec/summernote.woff +0 -0
  9. data/app/assets/javascripts/simplec/application.js +13 -0
  10. data/app/assets/javascripts/simplec/summernote-config.js +82 -0
  11. data/app/assets/javascripts/simplec/summernote.js +7046 -0
  12. data/app/assets/stylesheets/simplec/application.css +15 -0
  13. data/app/assets/stylesheets/simplec/summernote.scss +691 -0
  14. data/app/constraints/simplec/subdomains.rb +23 -0
  15. data/app/controllers/simplec/application_controller.rb +9 -0
  16. data/app/controllers/simplec/pages_controller.rb +19 -0
  17. data/app/helpers/simplec/application_helper.rb +4 -0
  18. data/app/jobs/simplec/application_job.rb +4 -0
  19. data/app/mailers/simplec/application_mailer.rb +6 -0
  20. data/app/models/simplec/application_record.rb +5 -0
  21. data/app/models/simplec/embedded_image.rb +15 -0
  22. data/app/models/simplec/page.rb +203 -0
  23. data/app/models/simplec/subdomain.rb +30 -0
  24. data/app/views/simplec/fields/_editor.html.erb +5 -0
  25. data/app/views/simplec/fields/_file.html.erb +16 -0
  26. data/app/views/simplec/fields/_image.html.erb +16 -0
  27. data/app/views/simplec/fields/_string.html.erb +4 -0
  28. data/app/views/simplec/fields/_text.html.erb +4 -0
  29. data/app/views/simplec/pages/show.html.erb +2 -0
  30. data/config/routes.rb +8 -0
  31. data/db/migrate/20170809204353_create_simplec_pages.rb +30 -0
  32. data/db/migrate/20170809204511_create_simplec_subdomains.rb +12 -0
  33. data/db/migrate/20170809210304_create_simplec_embedded_images.rb +15 -0
  34. data/lib/simplec/action_controller/extensions.rb +56 -0
  35. data/lib/simplec/action_view/helper.rb +118 -0
  36. data/lib/simplec/embedded_image_actions.rb +37 -0
  37. data/lib/simplec/engine.rb +18 -0
  38. data/lib/simplec/version.rb +3 -0
  39. data/lib/simplec.rb +5 -0
  40. data/lib/tasks/simplec_tasks.rake +4 -0
  41. metadata +41 -2
@@ -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 any plugin's vendor/assets/stylesheets directory 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 other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,691 @@
1
+ /**
2
+ * Super simple wysiwyg editor v0.8.2
3
+ * http://summernote.org/
4
+ *
5
+ * summernote.js
6
+ * Copyright 2013-2016 Alan Hong. and other contributors
7
+ * summernote may be freely distributed under the MIT license./
8
+ *
9
+ * Date: 2016-08-07T05:11Z
10
+ *
11
+ * MODIFIED: Unminified, renamed with .scss, and VIM substitution:
12
+ * :%s/url("font\//asset-url("simplec\//gc
13
+ *
14
+ */
15
+
16
+ @font-face {
17
+ font-family: "summernote";
18
+ font-style: normal;
19
+ font-weight: normal;
20
+ src: asset-url("simplec/summernote.eot?ad8d7e2d177d2473aecd9b35d16211fb");
21
+ src: asset-url("simplec/summernote.eot?#iefix") format("embedded-opentype"), asset-url("simplec/summernote.woff?ad8d7e2d177d2473aecd9b35d16211fb") format("woff"), asset-url("simplec/summernote.ttf?ad8d7e2d177d2473aecd9b35d16211fb") format("truetype")
22
+ }
23
+
24
+ [class^="note-icon-"]:before,
25
+ [class*=" note-icon-"]:before {
26
+ display: inline-block;
27
+ font: normal normal normal 14px summernote;
28
+ font-size: inherit;
29
+ -webkit-font-smoothing: antialiased;
30
+ text-decoration: inherit;
31
+ text-rendering: auto;
32
+ text-transform: none;
33
+ vertical-align: middle;
34
+ speak: none;
35
+ -moz-osx-font-smoothing: grayscale
36
+ }
37
+
38
+ .note-icon-align-center:before {
39
+ content: "\f101"
40
+ }
41
+
42
+ .note-icon-align-indent:before {
43
+ content: "\f102"
44
+ }
45
+
46
+ .note-icon-align-justify:before {
47
+ content: "\f103"
48
+ }
49
+
50
+ .note-icon-align-left:before {
51
+ content: "\f104"
52
+ }
53
+
54
+ .note-icon-align-outdent:before {
55
+ content: "\f105"
56
+ }
57
+
58
+ .note-icon-align-right:before {
59
+ content: "\f106"
60
+ }
61
+
62
+ .note-icon-align:before {
63
+ content: "\f107"
64
+ }
65
+
66
+ .note-icon-arrows-alt:before {
67
+ content: "\f108"
68
+ }
69
+
70
+ .note-icon-bold:before {
71
+ content: "\f109"
72
+ }
73
+
74
+ .note-icon-caret:before {
75
+ content: "\f10a"
76
+ }
77
+
78
+ .note-icon-chain-broken:before {
79
+ content: "\f10b"
80
+ }
81
+
82
+ .note-icon-circle:before {
83
+ content: "\f10c"
84
+ }
85
+
86
+ .note-icon-close:before {
87
+ content: "\f10d"
88
+ }
89
+
90
+ .note-icon-code:before {
91
+ content: "\f10e"
92
+ }
93
+
94
+ .note-icon-eraser:before {
95
+ content: "\f10f"
96
+ }
97
+
98
+ .note-icon-font:before {
99
+ content: "\f110"
100
+ }
101
+
102
+ .note-icon-frame:before {
103
+ content: "\f111"
104
+ }
105
+
106
+ .note-icon-italic:before {
107
+ content: "\f112"
108
+ }
109
+
110
+ .note-icon-link:before {
111
+ content: "\f113"
112
+ }
113
+
114
+ .note-icon-magic:before {
115
+ content: "\f114"
116
+ }
117
+
118
+ .note-icon-menu-check:before {
119
+ content: "\f115"
120
+ }
121
+
122
+ .note-icon-minus:before {
123
+ content: "\f116"
124
+ }
125
+
126
+ .note-icon-orderedlist:before {
127
+ content: "\f117"
128
+ }
129
+
130
+ .note-icon-pencil:before {
131
+ content: "\f118"
132
+ }
133
+
134
+ .note-icon-picture:before {
135
+ content: "\f119"
136
+ }
137
+
138
+ .note-icon-question:before {
139
+ content: "\f11a"
140
+ }
141
+
142
+ .note-icon-redo:before {
143
+ content: "\f11b"
144
+ }
145
+
146
+ .note-icon-special-character:before {
147
+ content: "\f11c"
148
+ }
149
+
150
+ .note-icon-square:before {
151
+ content: "\f11d"
152
+ }
153
+
154
+ .note-icon-strikethrough:before {
155
+ content: "\f11e"
156
+ }
157
+
158
+ .note-icon-subscript:before {
159
+ content: "\f11f"
160
+ }
161
+
162
+ .note-icon-summernote:before {
163
+ content: "\f120"
164
+ }
165
+
166
+ .note-icon-superscript:before {
167
+ content: "\f121"
168
+ }
169
+
170
+ .note-icon-table:before {
171
+ content: "\f122"
172
+ }
173
+
174
+ .note-icon-text-height:before {
175
+ content: "\f123"
176
+ }
177
+
178
+ .note-icon-trash:before {
179
+ content: "\f124"
180
+ }
181
+
182
+ .note-icon-underline:before {
183
+ content: "\f125"
184
+ }
185
+
186
+ .note-icon-undo:before {
187
+ content: "\f126"
188
+ }
189
+
190
+ .note-icon-unorderedlist:before {
191
+ content: "\f127"
192
+ }
193
+
194
+ .note-icon-video:before {
195
+ content: "\f128"
196
+ }
197
+
198
+ .note-editor {
199
+ position: relative
200
+ }
201
+
202
+ .note-editor .note-dropzone {
203
+ position: absolute;
204
+ z-index: 100;
205
+ display: none;
206
+ color: #87cefa;
207
+ background-color: white;
208
+ opacity: .95
209
+ }
210
+
211
+ .note-editor .note-dropzone .note-dropzone-message {
212
+ display: table-cell;
213
+ font-size: 28px;
214
+ font-weight: bold;
215
+ text-align: center;
216
+ vertical-align: middle
217
+ }
218
+
219
+ .note-editor .note-dropzone.hover {
220
+ color: #098ddf
221
+ }
222
+
223
+ .note-editor.dragover .note-dropzone {
224
+ display: table
225
+ }
226
+
227
+ .note-editor .note-editing-area {
228
+ position: relative
229
+ }
230
+
231
+ .note-editor .note-editing-area .note-editable {
232
+ outline: 0
233
+ }
234
+
235
+ .note-editor .note-editing-area .note-editable sup {
236
+ vertical-align: super
237
+ }
238
+
239
+ .note-editor .note-editing-area .note-editable sub {
240
+ vertical-align: sub
241
+ }
242
+
243
+ .note-editor.note-frame {
244
+ border: 1px solid #a9a9a9
245
+ }
246
+
247
+ .note-editor.note-frame.codeview .note-editing-area .note-editable {
248
+ display: none
249
+ }
250
+
251
+ .note-editor.note-frame.codeview .note-editing-area .note-codable {
252
+ display: block
253
+ }
254
+
255
+ .note-editor.note-frame .note-editing-area {
256
+ overflow: hidden
257
+ }
258
+
259
+ .note-editor.note-frame .note-editing-area .note-editable {
260
+ padding: 10px;
261
+ overflow: auto;
262
+ color: #000;
263
+ background-color: #fff
264
+ }
265
+
266
+ .note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"] {
267
+ background-color: #e5e5e5
268
+ }
269
+
270
+ .note-editor.note-frame .note-editing-area .note-codable {
271
+ display: none;
272
+ width: 100%;
273
+ padding: 10px;
274
+ margin-bottom: 0;
275
+ font-family: Menlo, Monaco, monospace, sans-serif;
276
+ font-size: 14px;
277
+ color: #ccc;
278
+ background-color: #222;
279
+ border: 0;
280
+ -webkit-border-radius: 0;
281
+ -moz-border-radius: 0;
282
+ border-radius: 0;
283
+ box-shadow: none;
284
+ -webkit-box-sizing: border-box;
285
+ -moz-box-sizing: border-box;
286
+ -ms-box-sizing: border-box;
287
+ box-sizing: border-box;
288
+ resize: none
289
+ }
290
+
291
+ .note-editor.note-frame.fullscreen {
292
+ position: fixed;
293
+ top: 0;
294
+ left: 0;
295
+ z-index: 1050;
296
+ width: 100%!important
297
+ }
298
+
299
+ .note-editor.note-frame.fullscreen .note-editable {
300
+ background-color: white
301
+ }
302
+
303
+ .note-editor.note-frame.fullscreen .note-resizebar {
304
+ display: none
305
+ }
306
+
307
+ .note-editor.note-frame .note-statusbar {
308
+ background-color: #f5f5f5;
309
+ border-bottom-right-radius: 4px;
310
+ border-bottom-left-radius: 4px
311
+ }
312
+
313
+ .note-editor.note-frame .note-statusbar .note-resizebar {
314
+ width: 100%;
315
+ height: 8px;
316
+ padding-top: 1px;
317
+ cursor: ns-resize
318
+ }
319
+
320
+ .note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar {
321
+ width: 20px;
322
+ margin: 1px auto;
323
+ border-top: 1px solid #a9a9a9
324
+ }
325
+
326
+ .note-editor.note-frame .note-placeholder {
327
+ padding: 10px
328
+ }
329
+
330
+ .note-popover.popover {
331
+ max-width: none
332
+ }
333
+
334
+ .note-popover.popover .popover-content a {
335
+ display: inline-block;
336
+ max-width: 200px;
337
+ overflow: hidden;
338
+ text-overflow: ellipsis;
339
+ white-space: nowrap;
340
+ vertical-align: middle
341
+ }
342
+
343
+ .note-popover.popover .arrow {
344
+ left: 20px!important
345
+ }
346
+
347
+ .note-popover .popover-content,
348
+ .panel-heading.note-toolbar {
349
+ padding: 0 0 5px 5px;
350
+ margin: 0
351
+ }
352
+
353
+ .note-popover .popover-content>.btn-group,
354
+ .panel-heading.note-toolbar>.btn-group {
355
+ margin-top: 5px;
356
+ margin-right: 5px;
357
+ margin-left: 0
358
+ }
359
+
360
+ .note-popover .popover-content .btn-group .note-table,
361
+ .panel-heading.note-toolbar .btn-group .note-table {
362
+ min-width: 0;
363
+ padding: 5px
364
+ }
365
+
366
+ .note-popover .popover-content .btn-group .note-table .note-dimension-picker,
367
+ .panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker {
368
+ font-size: 18px
369
+ }
370
+
371
+ .note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,
372
+ .panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher {
373
+ position: absolute!important;
374
+ z-index: 3;
375
+ width: 10em;
376
+ height: 10em;
377
+ cursor: pointer
378
+ }
379
+
380
+ .note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,
381
+ .panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted {
382
+ position: relative!important;
383
+ z-index: 1;
384
+ width: 5em;
385
+ height: 5em;
386
+ background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat
387
+ }
388
+
389
+ .note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,
390
+ .panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted {
391
+ position: absolute!important;
392
+ z-index: 2;
393
+ width: 1em;
394
+ height: 1em;
395
+ background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat
396
+ }
397
+
398
+ .note-popover .popover-content .note-style h1,
399
+ .panel-heading.note-toolbar .note-style h1,
400
+ .note-popover .popover-content .note-style h2,
401
+ .panel-heading.note-toolbar .note-style h2,
402
+ .note-popover .popover-content .note-style h3,
403
+ .panel-heading.note-toolbar .note-style h3,
404
+ .note-popover .popover-content .note-style h4,
405
+ .panel-heading.note-toolbar .note-style h4,
406
+ .note-popover .popover-content .note-style h5,
407
+ .panel-heading.note-toolbar .note-style h5,
408
+ .note-popover .popover-content .note-style h6,
409
+ .panel-heading.note-toolbar .note-style h6,
410
+ .note-popover .popover-content .note-style blockquote,
411
+ .panel-heading.note-toolbar .note-style blockquote {
412
+ margin: 0
413
+ }
414
+
415
+ .note-popover .popover-content .note-color .dropdown-toggle,
416
+ .panel-heading.note-toolbar .note-color .dropdown-toggle {
417
+ width: 20px;
418
+ padding-left: 5px
419
+ }
420
+
421
+ .note-popover .popover-content .note-color .dropdown-menu,
422
+ .panel-heading.note-toolbar .note-color .dropdown-menu {
423
+ min-width: 340px
424
+ }
425
+
426
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group,
427
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group {
428
+ margin: 0
429
+ }
430
+
431
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group:first-child,
432
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group:first-child {
433
+ margin: 0 5px
434
+ }
435
+
436
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title,
437
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title {
438
+ margin: 2px 7px;
439
+ font-size: 12px;
440
+ text-align: center;
441
+ border-bottom: 1px solid #eee
442
+ }
443
+
444
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset,
445
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset {
446
+ width: 100%;
447
+ padding: 0 3px;
448
+ margin: 3px;
449
+ font-size: 11px;
450
+ cursor: pointer;
451
+ -webkit-border-radius: 5px;
452
+ -moz-border-radius: 5px;
453
+ border-radius: 5px
454
+ }
455
+
456
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-row,
457
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-row {
458
+ height: 20px
459
+ }
460
+
461
+ .note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset:hover,
462
+ .panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover {
463
+ background: #eee
464
+ }
465
+
466
+ .note-popover .popover-content .note-para .dropdown-menu,
467
+ .panel-heading.note-toolbar .note-para .dropdown-menu {
468
+ min-width: 216px;
469
+ padding: 5px
470
+ }
471
+
472
+ .note-popover .popover-content .note-para .dropdown-menu>div:first-child,
473
+ .panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child {
474
+ margin-right: 5px
475
+ }
476
+
477
+ .note-popover .popover-content .dropdown-menu,
478
+ .panel-heading.note-toolbar .dropdown-menu {
479
+ min-width: 90px
480
+ }
481
+
482
+ .note-popover .popover-content .dropdown-menu.right,
483
+ .panel-heading.note-toolbar .dropdown-menu.right {
484
+ right: 0;
485
+ left: auto
486
+ }
487
+
488
+ .note-popover .popover-content .dropdown-menu.right::before,
489
+ .panel-heading.note-toolbar .dropdown-menu.right::before {
490
+ right: 9px;
491
+ left: auto!important
492
+ }
493
+
494
+ .note-popover .popover-content .dropdown-menu.right::after,
495
+ .panel-heading.note-toolbar .dropdown-menu.right::after {
496
+ right: 10px;
497
+ left: auto!important
498
+ }
499
+
500
+ .note-popover .popover-content .dropdown-menu.note-check li a i,
501
+ .panel-heading.note-toolbar .dropdown-menu.note-check li a i {
502
+ color: deepskyblue;
503
+ visibility: hidden
504
+ }
505
+
506
+ .note-popover .popover-content .dropdown-menu.note-check li a.checked i,
507
+ .panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i {
508
+ visibility: visible
509
+ }
510
+
511
+ .note-popover .popover-content .note-fontsize-10,
512
+ .panel-heading.note-toolbar .note-fontsize-10 {
513
+ font-size: 10px
514
+ }
515
+
516
+ .note-popover .popover-content .note-color-palette,
517
+ .panel-heading.note-toolbar .note-color-palette {
518
+ line-height: 1
519
+ }
520
+
521
+ .note-popover .popover-content .note-color-palette div .note-color-btn,
522
+ .panel-heading.note-toolbar .note-color-palette div .note-color-btn {
523
+ width: 20px;
524
+ height: 20px;
525
+ padding: 0;
526
+ margin: 0;
527
+ border: 1px solid #fff
528
+ }
529
+
530
+ .note-popover .popover-content .note-color-palette div .note-color-btn:hover,
531
+ .panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover {
532
+ border: 1px solid #000
533
+ }
534
+
535
+ .note-dialog>div {
536
+ display: none
537
+ }
538
+
539
+ .note-dialog .form-group {
540
+ margin-right: 0;
541
+ margin-left: 0
542
+ }
543
+
544
+ .note-dialog .note-modal-form {
545
+ margin: 0
546
+ }
547
+
548
+ .note-dialog .note-image-dialog .note-dropzone {
549
+ min-height: 100px;
550
+ margin-bottom: 10px;
551
+ font-size: 30px;
552
+ line-height: 4;
553
+ color: lightgray;
554
+ text-align: center;
555
+ border: 4px dashed lightgray
556
+ }
557
+
558
+ @-moz-document url-prefix() {
559
+ .note-image-input {
560
+ height: auto
561
+ }
562
+ }
563
+
564
+ .note-placeholder {
565
+ position: absolute;
566
+ display: none;
567
+ color: gray
568
+ }
569
+
570
+ .note-handle .note-control-selection {
571
+ position: absolute;
572
+ display: none;
573
+ border: 1px solid black
574
+ }
575
+
576
+ .note-handle .note-control-selection>div {
577
+ position: absolute
578
+ }
579
+
580
+ .note-handle .note-control-selection .note-control-selection-bg {
581
+ width: 100%;
582
+ height: 100%;
583
+ background-color: black;
584
+ -webkit-opacity: .3;
585
+ -khtml-opacity: .3;
586
+ -moz-opacity: .3;
587
+ opacity: .3;
588
+ -ms-filter: alpha(opacity=30);
589
+ filter: alpha(opacity=30)
590
+ }
591
+
592
+ .note-handle .note-control-selection .note-control-handle {
593
+ width: 7px;
594
+ height: 7px;
595
+ border: 1px solid black
596
+ }
597
+
598
+ .note-handle .note-control-selection .note-control-holder {
599
+ width: 7px;
600
+ height: 7px;
601
+ border: 1px solid black
602
+ }
603
+
604
+ .note-handle .note-control-selection .note-control-sizing {
605
+ width: 7px;
606
+ height: 7px;
607
+ background-color: white;
608
+ border: 1px solid black
609
+ }
610
+
611
+ .note-handle .note-control-selection .note-control-nw {
612
+ top: -5px;
613
+ left: -5px;
614
+ border-right: 0;
615
+ border-bottom: 0
616
+ }
617
+
618
+ .note-handle .note-control-selection .note-control-ne {
619
+ top: -5px;
620
+ right: -5px;
621
+ border-bottom: 0;
622
+ border-left: none
623
+ }
624
+
625
+ .note-handle .note-control-selection .note-control-sw {
626
+ bottom: -5px;
627
+ left: -5px;
628
+ border-top: 0;
629
+ border-right: 0
630
+ }
631
+
632
+ .note-handle .note-control-selection .note-control-se {
633
+ right: -5px;
634
+ bottom: -5px;
635
+ cursor: se-resize
636
+ }
637
+
638
+ .note-handle .note-control-selection .note-control-se.note-control-holder {
639
+ cursor: default;
640
+ border-top: 0;
641
+ border-left: none
642
+ }
643
+
644
+ .note-handle .note-control-selection .note-control-selection-info {
645
+ right: 0;
646
+ bottom: 0;
647
+ padding: 5px;
648
+ margin: 5px;
649
+ font-size: 12px;
650
+ color: white;
651
+ background-color: black;
652
+ -webkit-border-radius: 5px;
653
+ -moz-border-radius: 5px;
654
+ border-radius: 5px;
655
+ -webkit-opacity: .7;
656
+ -khtml-opacity: .7;
657
+ -moz-opacity: .7;
658
+ opacity: .7;
659
+ -ms-filter: alpha(opacity=70);
660
+ filter: alpha(opacity=70)
661
+ }
662
+
663
+ .note-hint-popover {
664
+ min-width: 100px;
665
+ padding: 2px
666
+ }
667
+
668
+ .note-hint-popover .popover-content {
669
+ max-height: 150px;
670
+ padding: 3px;
671
+ overflow: auto
672
+ }
673
+
674
+ .note-hint-popover .popover-content .note-hint-group .note-hint-item {
675
+ display: block!important;
676
+ padding: 3px
677
+ }
678
+
679
+ .note-hint-popover .popover-content .note-hint-group .note-hint-item.active,
680
+ .note-hint-popover .popover-content .note-hint-group .note-hint-item:hover {
681
+ display: block;
682
+ clear: both;
683
+ font-weight: 400;
684
+ line-height: 1.4;
685
+ color: white;
686
+ text-decoration: none;
687
+ white-space: nowrap;
688
+ cursor: pointer;
689
+ background-color: #428bca;
690
+ outline: 0
691
+ }
@@ -0,0 +1,23 @@
1
+ module Simplec
2
+ class Subdomains
3
+ def self.matches?(request)
4
+ present = request.subdomain.present?
5
+ not_admin = request.subdomain != 'admin'
6
+ subdomain = Simplec::Subdomain.find_by(name: request.subdomain)
7
+
8
+ match = present && not_admin && subdomain
9
+
10
+ if match
11
+ Thread.current[:simplec_subdomain] = subdomain
12
+ else
13
+ Rails.logger.info <<-LOG unless match
14
+ Simplec Subdomain '#{request.subdomain}' was not found.
15
+ ActionDispatch::Request#original_url: #{request.original_url}
16
+ 'admin' subdomain bypass: #{!not_admin}
17
+ LOG
18
+ end
19
+
20
+ match
21
+ end
22
+ end
23
+ end