megatron 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +43 -2
  3. data/app/assets/javascripts/megatron/form.js +36 -0
  4. data/app/assets/javascripts/megatron/index.js +93 -0
  5. data/app/assets/javascripts/megatron/link.js +58 -0
  6. data/app/assets/javascripts/megatron/utils/auto-navigate.js +24 -0
  7. data/app/assets/javascripts/megatron/utils/form-notify.js +39 -0
  8. data/app/assets/javascripts/megatron/utils/index.js +112 -0
  9. data/app/assets/javascripts/megatron/utils/messages.js +97 -0
  10. data/app/assets/javascripts/megatron/utils/time/date-to-html.js +59 -0
  11. data/app/assets/javascripts/megatron/utils/time/time-switch.js +87 -0
  12. data/app/assets/javascripts/megatron/utils/time/timeago.js +95 -0
  13. data/app/assets/javascripts/megatron/utils/toggler.js +163 -0
  14. data/app/assets/stylesheets/_example.scss +76 -0
  15. data/app/assets/stylesheets/_grid.scss +41 -0
  16. data/app/assets/stylesheets/_typography.scss +38 -0
  17. data/app/assets/stylesheets/application.scss +19 -0
  18. data/app/assets/stylesheets/megatron/error-pages.scss +164 -0
  19. data/app/assets/stylesheets/megatron/error-pages/_animations.scss +96 -0
  20. data/app/assets/stylesheets/megatron/error-pages/_csi.scss +41 -0
  21. data/app/assets/stylesheets/megatron/error-pages/_waves.scss +36 -0
  22. data/app/assets/stylesheets/megatron/megatron.scss +3 -0
  23. data/app/assets/stylesheets/megatron/modules/_crop-height.scss +5 -0
  24. data/app/assets/stylesheets/megatron/modules/_index.scss +22 -0
  25. data/app/assets/stylesheets/megatron/modules/_logo.scss +67 -0
  26. data/app/assets/stylesheets/megatron/modules/_new-tag.scss +11 -0
  27. data/app/assets/stylesheets/megatron/modules/_progress.scss +80 -0
  28. data/app/assets/stylesheets/megatron/modules/app/_animation-classes.scss +3 -0
  29. data/app/assets/stylesheets/megatron/modules/app/_animations.scss +62 -0
  30. data/app/assets/stylesheets/megatron/modules/app/_index.scss +5 -0
  31. data/app/assets/stylesheets/megatron/modules/app/_layout.scss +261 -0
  32. data/app/assets/stylesheets/megatron/modules/app/_sizes.scss +28 -0
  33. data/app/assets/stylesheets/megatron/modules/app/_typography.scss +111 -0
  34. data/app/assets/stylesheets/megatron/modules/box/_base.scss +94 -0
  35. data/app/assets/stylesheets/megatron/modules/box/_color-box.scss +33 -0
  36. data/app/assets/stylesheets/megatron/modules/box/_deployment_box.scss +37 -0
  37. data/app/assets/stylesheets/megatron/modules/box/_index.scss +4 -0
  38. data/app/assets/stylesheets/megatron/modules/box/_placeholder.scss +6 -0
  39. data/app/assets/stylesheets/megatron/modules/buttons/_animations.scss +35 -0
  40. data/app/assets/stylesheets/megatron/modules/buttons/_buttons.scss +266 -0
  41. data/app/assets/stylesheets/megatron/modules/buttons/_index.scss +4 -0
  42. data/app/assets/stylesheets/megatron/modules/buttons/_mixins.scss +108 -0
  43. data/app/assets/stylesheets/megatron/modules/buttons/_pills.scss +44 -0
  44. data/app/assets/stylesheets/megatron/modules/code/_codemirror.scss +98 -0
  45. data/app/assets/stylesheets/megatron/modules/code/_highlighted.scss +65 -0
  46. data/app/assets/stylesheets/megatron/modules/code/_index.scss +3 -0
  47. data/app/assets/stylesheets/megatron/modules/code/_syntax.scss +18 -0
  48. data/app/assets/stylesheets/megatron/modules/core/_colored-items.scss +22 -0
  49. data/app/assets/stylesheets/megatron/modules/core/_colors.scss +163 -0
  50. data/app/assets/stylesheets/megatron/modules/core/_index.scss +3 -0
  51. data/app/assets/stylesheets/megatron/modules/core/_mixins.scss +262 -0
  52. data/app/assets/stylesheets/megatron/modules/core/_vars.scss +30 -0
  53. data/app/assets/stylesheets/megatron/modules/core/_z-index.scss +3 -0
  54. data/app/assets/stylesheets/megatron/modules/dialog/_animations.scss +48 -0
  55. data/app/assets/stylesheets/megatron/modules/dialog/_dialog.scss +81 -0
  56. data/app/assets/stylesheets/megatron/modules/dialog/_index.scss +2 -0
  57. data/app/assets/stylesheets/megatron/modules/forms/_base.scss +31 -0
  58. data/app/assets/stylesheets/megatron/modules/forms/_check-radio.scss +99 -0
  59. data/app/assets/stylesheets/megatron/modules/forms/_check-switch.scss +88 -0
  60. data/app/assets/stylesheets/megatron/modules/forms/_footer.scss +13 -0
  61. data/app/assets/stylesheets/megatron/modules/forms/_index.scss +10 -0
  62. data/app/assets/stylesheets/megatron/modules/forms/_login.scss +92 -0
  63. data/app/assets/stylesheets/megatron/modules/forms/_radio-nav.scss +62 -0
  64. data/app/assets/stylesheets/megatron/modules/forms/_select.scss +37 -0
  65. data/app/assets/stylesheets/megatron/modules/forms/_stacked-form.scss +29 -0
  66. data/app/assets/stylesheets/megatron/modules/forms/_table-form.scss +53 -0
  67. data/app/assets/stylesheets/megatron/modules/forms/_text-input.scss +118 -0
  68. data/app/assets/stylesheets/megatron/modules/grids/_alignment.scss +39 -0
  69. data/app/assets/stylesheets/megatron/modules/grids/_grid.scss +144 -0
  70. data/app/assets/stylesheets/megatron/modules/grids/_index.scss +2 -0
  71. data/app/assets/stylesheets/megatron/modules/headers/_actions.scss +10 -0
  72. data/app/assets/stylesheets/megatron/modules/headers/_base.scss +67 -0
  73. data/app/assets/stylesheets/megatron/modules/headers/_index.scss +4 -0
  74. data/app/assets/stylesheets/megatron/modules/headers/_meta.scss +10 -0
  75. data/app/assets/stylesheets/megatron/modules/headers/_site-header.scss +8 -0
  76. data/app/assets/stylesheets/megatron/modules/lib/_codemirror.scss +301 -0
  77. data/app/assets/stylesheets/megatron/modules/lists/_base.scss +13 -0
  78. data/app/assets/stylesheets/megatron/modules/lists/_box-list.scss +53 -0
  79. data/app/assets/stylesheets/megatron/modules/lists/_index.scss +2 -0
  80. data/app/assets/stylesheets/megatron/modules/messages/_index.scss +3 -0
  81. data/app/assets/stylesheets/megatron/modules/messages/_notice.scss +57 -0
  82. data/app/assets/stylesheets/megatron/modules/messages/_notifications.scss +126 -0
  83. data/app/assets/stylesheets/megatron/modules/messages/_pop-message.scss +157 -0
  84. data/app/assets/stylesheets/megatron/modules/nav/_auto-navigate.scss +7 -0
  85. data/app/assets/stylesheets/megatron/modules/nav/_breadcrumbs.scss +35 -0
  86. data/app/assets/stylesheets/megatron/modules/nav/_index.scss +8 -0
  87. data/app/assets/stylesheets/megatron/modules/nav/_main-sidebar.scss +21 -0
  88. data/app/assets/stylesheets/megatron/modules/nav/_mixins.scss +53 -0
  89. data/app/assets/stylesheets/megatron/modules/nav/_nav-toggle.scss +61 -0
  90. data/app/assets/stylesheets/megatron/modules/nav/_primary-nav.scss +120 -0
  91. data/app/assets/stylesheets/megatron/modules/nav/_secondary-nav.scss +105 -0
  92. data/app/assets/stylesheets/megatron/modules/nav/_tabs.scss +87 -0
  93. data/app/assets/stylesheets/megatron/modules/roboticons/_font.scss +62 -0
  94. data/app/assets/stylesheets/megatron/modules/roboticons/_icons.scss +219 -0
  95. data/app/assets/stylesheets/megatron/modules/roboticons/_index.scss +2 -0
  96. data/app/assets/stylesheets/megatron/modules/slider/_base.scss +49 -0
  97. data/app/assets/stylesheets/megatron/modules/slider/_index.scss +4 -0
  98. data/app/assets/stylesheets/megatron/modules/slider/_slider.scss +282 -0
  99. data/app/assets/stylesheets/megatron/modules/slider/_switch.scss +75 -0
  100. data/app/assets/stylesheets/megatron/modules/slider/_themes.scss +42 -0
  101. data/app/assets/stylesheets/megatron/modules/tables/_base.scss +170 -0
  102. data/app/assets/stylesheets/megatron/modules/tables/_border-table.scss +28 -0
  103. data/app/assets/stylesheets/megatron/modules/tables/_box-table.scss +36 -0
  104. data/app/assets/stylesheets/megatron/modules/tables/_columns.scss +8 -0
  105. data/app/assets/stylesheets/megatron/modules/tables/_doc-table.scss +22 -0
  106. data/app/assets/stylesheets/megatron/modules/tables/_icon-cell.scss +9 -0
  107. data/app/assets/stylesheets/megatron/modules/tables/_index.scss +7 -0
  108. data/app/assets/stylesheets/megatron/modules/tables/_link-cell.scss +8 -0
  109. data/app/assets/stylesheets/megatron/modules/tables/_responsive-table.scss +13 -0
  110. data/app/assets/stylesheets/megatron/modules/widgets/_index.scss +1 -0
  111. data/app/assets/stylesheets/megatron/modules/widgets/_time-switch.scss +24 -0
  112. data/lib/megatron.rb +1 -1
  113. data/lib/megatron/engine.rb +5 -0
  114. data/lib/megatron/version.rb +1 -1
  115. data/lib/tasks/megatron_tasks.rake +4 -4
  116. data/public/assets/megatron/megatron-0.0.4.css +3 -0
  117. data/public/assets/megatron/{megatron-0.0.3.css.map → megatron-0.0.4.css.map} +3 -3
  118. data/public/assets/megatron/{megatron-0.0.3.js → megatron-0.0.4.js} +1 -1
  119. data/public/assets/megatron/megatron-0.0.4.map.json +1 -0
  120. metadata +115 -6
  121. data/public/assets/megatron/megatron-0.0.3.css +0 -2
  122. data/public/assets/megatron/megatron-0.0.3.map.json +0 -1
@@ -0,0 +1,75 @@
1
+
2
+ //----------------------------//
3
+ // Switch horizontal slider //
4
+ //----------------------------//
5
+
6
+ .select-switch {
7
+ $border-width: 3px;
8
+ $border-radius: 20px;
9
+
10
+ font-family: $slider-font;
11
+ font-size: 11px;
12
+ cursor: pointer;
13
+ position: relative;
14
+ display: inline-block;
15
+ margin-bottom: .5em;
16
+ line-height: 1.8em;
17
+
18
+ .slider-track {
19
+ border-radius: $border-radius;
20
+ border: 1px solid rgba(#000, .18);
21
+ background-color: $slider-switch-bg;
22
+ box-shadow: #fff 0 1px 1px;
23
+ }
24
+
25
+ .slider-label {
26
+ padding-top: 1px;
27
+ font-weight: bold;
28
+ line-height: 1.8em;
29
+ display: inline-block;
30
+ width: 37px;
31
+ text-align: center;
32
+ color: #999;
33
+ text-shadow: #fff 0 1px;
34
+ transition: color .2s ease-in-out;
35
+ }
36
+
37
+ .slider-handle {
38
+ width: 50%;
39
+ position: absolute;
40
+ top: 0px; bottom: 0px;
41
+ z-index: 1;
42
+ background-color: rgba(#000, .06);
43
+ background-image: linear-gradient(rgba(#fff, .4), rgba(#fff, 0) 80%);
44
+ transition: background-color .2s ease-in-out;
45
+ border-radius: $border-radius - 1;
46
+ box-shadow: rgba(#000, .15) 0 0 0 1px inset, rgba(#fff, .5) 0 1px inset;
47
+ }
48
+
49
+ select:focus {
50
+ ~ .slider-track {
51
+ border-color: mix($slider-glow, #fff);
52
+ box-shadow: rgba($slider-glow, .5) 0 0 1px;
53
+ }
54
+ ~ .slider-handle {
55
+ box-shadow: rgba($slider-glow, .45) 0 0 0 1px inset;
56
+ }
57
+ }
58
+
59
+
60
+ &[data-step='0']{
61
+ .step-0 { color: #666; }
62
+ }
63
+
64
+ &[data-step='1']{
65
+ .slider-handle {
66
+ background-color: rgba($slider-glow, .1);
67
+ box-shadow: rgba($slider-glow, .3) 0 0 0 1px inset;
68
+ }
69
+ .step-1 { color: darken($slider-glow, 10); }
70
+ }
71
+
72
+ .step-1:hover { color: $slider-glow; }
73
+ .step-0:hover { color: #666; }
74
+ }
75
+
@@ -0,0 +1,42 @@
1
+ /*--------------------------------\
2
+ | Slider default styles |
3
+ \--------------------------------*/
4
+
5
+ .select-slider {
6
+ &.default {
7
+ .slider-fill {
8
+ background-color: $slider-blue;
9
+ }
10
+ .slider-track:before {
11
+ background-color: $slider-track;
12
+ }
13
+ }
14
+
15
+ .slider-fill-segment {
16
+ @include slider-fill-colors($slider-blue);
17
+ }
18
+ }
19
+
20
+ .alert-slider {
21
+ max-width: 150px;
22
+ margin: 0 { left: .5em }
23
+ .slider-fill-segment-1 {
24
+ @include slider-fill-colors($slider-red);
25
+ }
26
+ .slider-fill-segment-2 {
27
+ @include slider-fill-colors($slider-orange);
28
+ }
29
+ }
30
+
31
+ .upgrade-slider {
32
+ .slider-fill .used {
33
+ @include slider-fill-colors($slider-red);
34
+ //@include slider-fill-colors(change-color($slider-blue, $hue: 210, $lightness: 50));
35
+ }
36
+ .slider-track .used {
37
+ @include slider-fill-colors(mix($slider-red, $slider-track, 25%));
38
+ }
39
+ .slider-track .paid {
40
+ @include slider-fill-colors(mix($slider-blue, $slider-track, 20%));
41
+ }
42
+ }
@@ -0,0 +1,170 @@
1
+ $bright-table-bg: $bright;
2
+
3
+ @mixin table-align($pos) {
4
+ .align-#{$pos},
5
+ &.align-#{$pos} .table-cell,
6
+ &.align-#{$pos} td,
7
+ &.align-#{$pos} th {
8
+ vertical-align: $pos;
9
+ }
10
+ }
11
+
12
+ @mixin auto-table {
13
+ display: table;
14
+ width: 100%;
15
+
16
+ .table-row {
17
+ display: table-row;
18
+ &.span-left {
19
+ &:before {
20
+ content: "";
21
+ display: table-cell;
22
+ }
23
+ }
24
+ &.span-right {
25
+ &:after {
26
+ content: "";
27
+ display: table-cell;
28
+ }
29
+ }
30
+ }
31
+
32
+ .table-cell, .table-head-cell {
33
+ display: table-cell;
34
+ }
35
+ }
36
+
37
+ .table {
38
+ width: 100%;
39
+ display: table;
40
+ @extend %table_base;
41
+ .table-body, .table-head {
42
+ display: table-row-group;
43
+ }
44
+ .table-row {
45
+ display: table-row;
46
+ }
47
+ .table-cell, .table-head-cell {
48
+ display: table-cell;
49
+ }
50
+ }
51
+
52
+ %table_base .table-heading-row td,
53
+ %table_base .table-heading-row .table-cell {
54
+ color: $light-text-color;
55
+ @include v-pad_box((3px, 5px));
56
+ text-shadow: 0 1px rgba(#fff, .8);
57
+ font-size: 12px;
58
+ background-color: $silver;
59
+ }
60
+
61
+ th {
62
+ font-weight: normal;
63
+ text-align: left;
64
+ }
65
+
66
+ th, td, .table-cell, .table-head-cell {
67
+ @include v-pad_box((8px, 10px));
68
+ @include h-pad_box;
69
+ }
70
+
71
+ .tight-table {
72
+ th, td, .table-cell, .table-head-cell {
73
+ @include v-pad_box((3px, 5px));
74
+ @include h-pad_box;
75
+ }
76
+ }
77
+
78
+ .zebra-table {
79
+ .table-row:nth-child(even) .table-cell, tr:nth-child(even) td {
80
+ background: none;
81
+ }
82
+ .table-row:nth-child(odd) .table-cell, tr:nth-child(odd) td {
83
+ background-color: rgba($white, .8);
84
+ }
85
+ }
86
+
87
+ .wide {
88
+ tr td, tr th, .table-row .table-cell {
89
+ &:last-child {
90
+ border-right: none;
91
+ }
92
+ &:first-child {
93
+ border-left: none;
94
+ }
95
+ }
96
+ }
97
+
98
+ .fixed-table {
99
+ table-layout: fixed;
100
+ }
101
+
102
+ tr.split td,
103
+ .table-row.split .table-cell {
104
+ border-top: 1px solid $page-border;
105
+ }
106
+
107
+ tr.split-thick td,
108
+ .table-row.split-thick .table-cell {
109
+ border-top: 2px solid $page-border;
110
+ }
111
+
112
+ table {
113
+ border-collapse: collapse;
114
+ margin: { top: $block-margin; bottom: $block-margin; }
115
+ }
116
+
117
+ %table_base {
118
+ width: 100%;
119
+ border-collapse: collapse;
120
+ text-decoration: none;
121
+ margin: { top: $block-margin; bottom: $block-margin; }
122
+
123
+ .table-body, .table-head {
124
+ display: table-row-group;
125
+ }
126
+
127
+ .table-row {
128
+ display: table-row;
129
+ &.link-hover-row:hover {
130
+ td, .table-cell {
131
+ background: $white;
132
+ }
133
+ }
134
+ }
135
+
136
+ a { text-decoration: none; }
137
+
138
+ td, .table-cell {
139
+ a:not([class*=btn]):hover {
140
+ text-decoration: underline;
141
+ }
142
+ }
143
+
144
+ .meta {
145
+ font-size: .8em;
146
+ color: $light-text-color;
147
+ }
148
+
149
+ @include table-align(top);
150
+ @include table-align(middle);
151
+ @include table-align(bottom);
152
+ }
153
+
154
+ .box %table_base {
155
+ margin-top: 0;
156
+
157
+ th, .table-head-cell {
158
+ border-color: $page-border;
159
+ }
160
+ &:not(:first-child) {
161
+ tr:first-child {
162
+ th, td { border-top: 0; }
163
+ }
164
+ .table-row:first-child {
165
+ .table-head-cell, .table-cell {
166
+ border-top: 0;
167
+ }
168
+ }
169
+ }
170
+ }
@@ -0,0 +1,28 @@
1
+ .border-table {
2
+ @extend %table_base;
3
+ border-bottom: $page-border 1px solid;
4
+ display: table;
5
+
6
+ th, .table-head-cell {
7
+ color: $light-text-color;
8
+ @include v-pad_box((3px, 5px));
9
+ text-shadow: 0 1px rgba(#fff, .8);
10
+ font-size: 12px;
11
+ background-color: $silver;
12
+ }
13
+
14
+ .table-row {
15
+ display: table-row;
16
+ }
17
+ .table-cell {
18
+ display: table-cell;
19
+ }
20
+
21
+ .table-cell, .table-head-cell, td, th{
22
+ border: $page-border 1px solid;
23
+ }
24
+ .table-cell, td {
25
+ background: $bright-table-bg;
26
+ }
27
+
28
+ }
@@ -0,0 +1,36 @@
1
+ .box-table {
2
+ @extend %table_base;
3
+ display: table;
4
+ border-collapse: collapse;
5
+
6
+ thead, .table-head {
7
+ color: $light-text-color;
8
+ font-size: 12px;
9
+ }
10
+
11
+ .table-row {
12
+ display: table-row;
13
+ }
14
+
15
+ .table-cell, td {
16
+ border-top: $page-border 1px solid;
17
+ border-bottom: $page-border 1px solid;
18
+ background: $bright-table-bg;
19
+ display: table-cell;
20
+
21
+ &:first-child {
22
+ border-left: $page-border 1px solid;
23
+ }
24
+ &:last-child {
25
+ border-right: $page-border 1px solid;
26
+ }
27
+ }
28
+
29
+ thead th, thead td, .table-head .table-cell {
30
+ font-weight: normal;
31
+ border-color: transparent;
32
+ background: transparent;
33
+ border-bottom: none;
34
+ }
35
+ }
36
+
@@ -0,0 +1,8 @@
1
+ .columns {
2
+ display: table;
3
+ width: 100%;
4
+ .column {
5
+ display: table-cell;
6
+ }
7
+ }
8
+
@@ -0,0 +1,22 @@
1
+ .doc-table {
2
+ @extend %table_base;
3
+ thead th, .table-head .table-cell {
4
+ font: {
5
+ weight: bold;
6
+ size: 15px;
7
+ }
8
+ border: $page-border 1px solid;
9
+ background: $bright-table-bg;
10
+ }
11
+
12
+ .table-cell, td {
13
+ font-size: 14px;
14
+ border: $page-border 1px solid;
15
+ background: $bright-table-bg;
16
+ @include h-pad_box;
17
+ }
18
+ tr:nth-child(2n+2) td,
19
+ .table-row:nth-child(2n+2) .table-cell {
20
+ background: darken($bright-table-bg, 3);
21
+ }
22
+ }
@@ -0,0 +1,9 @@
1
+ .icon-cell.icon-cell {
2
+ width: 1%;
3
+ padding-right: 4px;
4
+ border-right: none;
5
+ + .table-cell, + td {
6
+ border-left: none;
7
+ padding-left: 4px;
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ @import "base";
2
+ @import "box-table";
3
+ @import "doc-table";
4
+ @import "border-table";
5
+ @import "link-cell";
6
+ @import "icon-cell";
7
+ @import "responsive-table";
@@ -0,0 +1,8 @@
1
+ .link-cell {
2
+ position: relative;
3
+ a:after {
4
+ content: "";
5
+ position: absolute;
6
+ top: 0; left: 0; right: 0; bottom: 0;
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ .small-table {
2
+ @extend .table;
3
+ @include until($small) {
4
+ &, .table-cell, .table-row, .table-head, .table-head-cell { display: block; }
5
+ }
6
+ }
7
+ .medium-table {
8
+ @extend .table;
9
+ @include until($medium) {
10
+ &, .table-cell, .table-row, .table-head, .table-head-cell { display: block; }
11
+ }
12
+ }
13
+
@@ -0,0 +1 @@
1
+ @import "time-switch";
@@ -0,0 +1,24 @@
1
+ .time-switch {
2
+ cursor: pointer;
3
+ .utc, .local {
4
+ font-size: 14px;
5
+ [class*=_icon]{
6
+ font-size: 11px;
7
+ }
8
+ }
9
+ .timeago { font-size: 14px; }
10
+
11
+ .local { display: none; }
12
+
13
+ &.alt-zone {
14
+ .utc { display: none; }
15
+ .local { display: inline-block; }
16
+ }
17
+ .date, .time, .timeago {
18
+ white-space: nowrap;
19
+ }
20
+ }
21
+
22
+ .timeago {
23
+ white-space: nowrap;
24
+ }