dante-editor 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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +45 -24
  4. data/ROADMAP.md +12 -0
  5. data/TODO.md +1 -17
  6. data/app/assets/javascripts/dante/editor.js.coffee +149 -45
  7. data/app/assets/javascripts/dante/menu.js.coffee +13 -2
  8. data/app/assets/javascripts/dante/tooltip.js.coffee +87 -32
  9. data/app/assets/stylesheets/dante.css.scss +1 -2
  10. data/app/assets/stylesheets/dante/_debug.scss +2 -2
  11. data/app/assets/stylesheets/dante/_graf.scss +141 -68
  12. data/app/assets/stylesheets/dante/_icons.scss +22 -23
  13. data/app/assets/stylesheets/dante/_menu.scss +112 -110
  14. data/app/assets/stylesheets/dante/_needsorder.scss +7 -1
  15. data/app/assets/stylesheets/dante/_post.scss +7 -9
  16. data/app/assets/stylesheets/dante/_scaffold.scss +16 -21
  17. data/app/assets/stylesheets/dante/_tooltip.scss +103 -104
  18. data/app/assets/stylesheets/dante/_utilities.scss +2 -3
  19. data/app/assets/stylesheets/{old → temp}/fonts.css.scss +0 -26
  20. data/app/assets/stylesheets/temp/medium.css +12404 -0
  21. data/app/assets/stylesheets/temp/review.scss +21 -0
  22. data/app/assets/stylesheets/temp/structure.haml +22 -0
  23. data/lib/dante-editor/version.rb +1 -1
  24. data/source/assets/images/dante-logo.png +0 -0
  25. data/source/assets/stylesheets/_scaffold.scss +12 -0
  26. data/source/assets/stylesheets/_tooltips.scss +216 -0
  27. data/source/assets/stylesheets/all.css.scss +51 -26
  28. data/source/embeds.html.erb +13 -15
  29. data/source/index.html.erb +7 -24
  30. data/source/layouts/layout.erb +7 -3
  31. data/source/partials/_content.erb +6 -3
  32. data/source/partials/_example_1.erb +15 -0
  33. data/source/partials/_example_2.erb +1 -2
  34. data/source/partials/_example_3.erb +1 -14
  35. data/source/partials/_readme.markdown +13 -67
  36. data/source/partials/test/_example_1.erb +22 -1
  37. metadata +10 -6
  38. data/app/assets/stylesheets/old/base.css.scss +0 -57
  39. data/app/assets/stylesheets/old/editor.css.scss +0 -662
  40. data/source/readme.html.erb +0 -28
@@ -12,27 +12,26 @@
12
12
  }
13
13
  }
14
14
 
15
- .icon {
16
- &-h2:before { content: "H1"; }
17
- &-h3:before { content: "H2"; }
18
- &-h4:before { content: "H3"; }
19
- &-p:before { content: "P"; }
20
- &-code:before { content: ""; }
21
- &-insertorderedlist:before { content: ""; }
22
- &-insertunorderedlist:before { content: ""; }
23
- &-inserthorizontalrule:before { content: ""; }
24
- &-indent:before { content: ""; }
25
- &-outdent:before { content: ""; }
26
- &-bold:before { content: ""; }
27
- &-italic:before { content: ""; }
28
- &-underline:before { content: ""; }
29
- &-createlink:before { content: ""; }
30
- &-blockquote:before { content: ""; }
31
- }
32
- .icon {
33
- &-h2:before,
34
- &-h3:before,
35
- &-h4:before {
36
- font-weight: bold;
37
- }
15
+
16
+ .icon-h2:before { content: "H1"; }
17
+ .icon-h3:before { content: "H2"; }
18
+ .icon-h4:before { content: "H3"; }
19
+ .icon-p:before { content: "P"; }
20
+ .icon-code:before { content: ""; }
21
+ .icon-insertorderedlist:before { content: ""; }
22
+ .icon-insertunorderedlist:before { content: ""; }
23
+ .icon-inserthorizontalrule:before { content: ""; }
24
+ .icon-indent:before { content: ""; }
25
+ .icon-outdent:before { content: ""; }
26
+ .icon-bold:before { content: ""; }
27
+ .icon-italic:before { content: ""; }
28
+ .icon-underline:before { content: ""; }
29
+ .icon-createlink:before { content: ""; }
30
+ .icon-blockquote:before { content: ""; }
31
+
32
+
33
+ .icon-h2:before,
34
+ .icon-h3:before,
35
+ .icon-h4:before {
36
+ font-weight: bold;
38
37
  }
@@ -1,43 +1,23 @@
1
1
  .dante-menu {
2
2
 
3
3
  // MENU
4
- & {
5
- position: absolute;
6
- visibility: hidden;
7
- z-index: 1000;
8
- -webkit-transition: none;
9
- transition: none;
10
- display: none;
11
- top: 0;
12
- left: 0;
13
- display:block;
14
- white-space: nowrap;
4
+ position: absolute;
5
+ visibility: hidden;
6
+ z-index: 1000;
7
+ -webkit-transition: none;
8
+ transition: none;
9
+ display: none;
10
+ top: 0;
11
+ left: 0;
12
+ display:block;
13
+ white-space: nowrap;
15
14
 
16
- height: $menu-height;
17
- background: $menu-background;
18
- border: $menu-border;
19
- border-radius: $menu-border-radius;
20
- box-shadow: $menu-shadow;
21
- }
22
- &--active {
23
- display: inline-block;
24
- visibility: visible;
25
- -webkit-animation: pop-upwards 180ms forwards linear;
26
- animation: pop-upwards 180ms forwards linear;
27
- }
15
+ height: $menu-height;
16
+ background: $menu-background;
17
+ border: $menu-border;
18
+ border-radius: $menu-border-radius;
19
+ box-shadow: $menu-shadow;
28
20
 
29
- &--linkmode {
30
- .dante-menu-buttons {
31
- visibility: hidden;
32
- }
33
- .dante-menu-linkinput {
34
- display: block;
35
- }
36
- .dante-menu-input {
37
- -webkit-animation: pop-upwards 180ms forwards linear;
38
- animation: pop-upwards 180ms forwards linear;
39
- }
40
- }
41
21
 
42
22
  // CARET
43
23
  &:after,
@@ -60,90 +40,112 @@
60
40
  bottom: -($menu-caret-size*2);
61
41
  }
62
42
 
63
- // BUTONS
64
- &-buttons {
65
- list-style: none;
66
- margin: 0;
67
- padding: 0;
68
- line-height: 0;
43
+ }
44
+
45
+ .dante-menu--active {
46
+ display: inline-block;
47
+ visibility: visible;
48
+ -webkit-animation: pop-upwards 180ms forwards linear;
49
+ animation: pop-upwards 180ms forwards linear;
50
+ }
51
+
52
+ .dante-menu--linkmode {
53
+ .dante-menu-buttons {
54
+ visibility: hidden;
55
+ }
56
+ .dante-menu-linkinput {
57
+ display: block;
69
58
  }
70
- &-button {
71
- & {
72
- min-width: 20px;
73
- display: inline-block;
74
- padding: 0 10px;
75
- overflow: hidden;
76
- text-align: center;
77
- color: $menu-color;
78
- cursor: pointer;
79
- font-size: 16px;
80
- line-height: $menu-height - 2;
81
- -webkit-user-select: none;
82
- -moz-user-select: none;
83
- -ms-user-select: none;
84
- user-select: none;
85
- }
86
- &:hover{
87
- // nada
88
- }
89
- &.active{
90
- color: $menu-color-active;
91
- }
59
+ .dante-menu-input {
60
+ -webkit-animation: pop-upwards 180ms forwards linear;
61
+ animation: pop-upwards 180ms forwards linear;
62
+ }
63
+ }
92
64
 
93
- &:first-of-type{
94
- border-top-left-radius: $menu-border-radius;
95
- border-bottom-left-radius: $menu-border-radius;
96
- padding-left: 18px;
97
- }
98
- &:last-of-type{
99
- border-top-right-radius: $menu-border-radius;
100
- border-bottom-right-radius: $menu-border-radius;
101
- padding-right: 18px;
102
- }
65
+ // BUTONS
66
+ .dante-menu-buttons {
67
+ list-style: none;
68
+ margin: 0;
69
+ padding: 0;
70
+ line-height: 0;
71
+ }
72
+ .dante-menu-button {
73
+ & {
74
+ min-width: 20px;
75
+ display: inline-block;
76
+ padding: 0 10px;
77
+ overflow: hidden;
78
+ text-align: center;
79
+ color: $menu-color;
80
+ cursor: pointer;
81
+ font-size: 16px;
82
+ line-height: $menu-height - 2;
83
+ -webkit-user-select: none;
84
+ -moz-user-select: none;
85
+ -ms-user-select: none;
86
+ user-select: none;
87
+ }
88
+ &:hover{
89
+ // nada
90
+ }
91
+ &.active{
92
+ color: $menu-color-active;
103
93
  }
104
94
 
105
- // LINK
106
- &-linkinput {
107
- & {
108
- display: none;
109
- position: absolute;
110
- top: 0;
111
- left: 0;
112
- right: 0;
113
- bottom: 0;
114
- }
115
- .dante-menu-button {
116
- position: absolute;
117
- top: 0;
118
- right: 0;
119
- }
95
+ &:first-child {
96
+ border-top-left-radius: $menu-border-radius;
97
+ border-bottom-left-radius: $menu-border-radius;
98
+ padding-left: 18px;
99
+ }
100
+ &:last-child {
101
+ border-top-right-radius: $menu-border-radius;
102
+ border-bottom-right-radius: $menu-border-radius;
103
+ padding-right: 18px;
120
104
  }
105
+ }
121
106
 
122
- &-input {
123
- //height: $menu-height - 2;
124
- //line-height: 20px;
107
+ // LINK
108
+ .dante-menu-linkinput {
109
+ & {
110
+ display: none;
125
111
  position: absolute;
126
112
  top: 0;
127
113
  left: 0;
128
- background: rgba(0,0,0,0);
129
- width: 100%;
130
- padding: 13px 40px 13px 10px;
131
- color: $menu-color;
132
- border: none;
133
- outline: none;
134
- font-size: 16px;
135
- box-sizing: border-box;
136
- border-radius: $menu-border-radius;
137
- appearance: none;
138
- text-align: left;
139
- font-family: $font-family-serif;
140
- letter-spacing: 0.01rem;
141
- font-weight: 400;
142
- font-style: normal;
143
- text-rendering: optimizeLegibility;
144
- -webkit-font-smoothing: antialiased;
145
- -moz-osx-font-smoothing: grayscale;
146
- -moz-font-feature-settings: "liga" on;
114
+ right: 0;
115
+ bottom: 0;
147
116
  }
117
+ .dante-menu-button {
118
+ position: absolute;
119
+ top: 0;
120
+ right: 0;
121
+ }
122
+ }
148
123
 
124
+ .dante-menu-input {
125
+ //height: $menu-height - 2;
126
+ //line-height: 20px;
127
+ position: absolute;
128
+ top: 0;
129
+ left: 0;
130
+ background: rgba(0,0,0,0);
131
+ width: 100%;
132
+ padding: 13px 40px 13px 10px;
133
+ color: $menu-color;
134
+ border: none;
135
+ outline: none;
136
+ font-size: 16px;
137
+ box-sizing: border-box;
138
+ border-radius: $menu-border-radius;
139
+ appearance: none;
140
+ text-align: left;
141
+ font-family: $font-family-serif;
142
+ letter-spacing: 0.01rem;
143
+ font-weight: 400;
144
+ font-style: normal;
145
+ text-rendering: optimizeLegibility;
146
+ -webkit-font-smoothing: antialiased;
147
+ -moz-osx-font-smoothing: grayscale;
148
+ -moz-font-feature-settings: "liga" on;
149
149
  }
150
+
151
+
@@ -6,11 +6,17 @@
6
6
 
7
7
  .markup--anchor {
8
8
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.6) 50%);
9
- background-position: 0 24px;
9
+ //background-position: 0 24px;
10
+ background-position: 0 19px;
10
11
  background-repeat: repeat-x;
11
12
  background-size: 2px 2px;
12
13
  text-decoration: none;
13
14
  color: rgba(0, 0, 0, 1);
15
+ //border-bottom: 1px solid rgba(0,0,0,.4);
16
+ }
17
+
18
+ h4 .markup--anchor {
19
+ background-position: 0 34px;
14
20
  }
15
21
 
16
22
 
@@ -5,11 +5,9 @@
5
5
  font-style: normal;
6
6
  //font-size: 22px;
7
7
  font-size: 19px;
8
- line-height: 1.4;
9
- }
10
-
11
- .notesSource {
12
- position: relative;
8
+ //line-height: 1.4;
9
+ letter-spacing: 0.01rem;
10
+ line-height: 1.69;
13
11
  }
14
12
 
15
13
  .postField {
@@ -18,11 +16,11 @@
18
16
  word-break: break-word;
19
17
  word-wrap: break-word;
20
18
  }
19
+ }
21
20
 
22
- &--body {
23
- @include clearfix;
24
- margin-bottom: 30px;
25
- }
21
+ .postField--body {
22
+ @include clearfix;
23
+ margin-bottom: 30px;
26
24
  }
27
25
 
28
26
  .section-content {
@@ -1,24 +1,19 @@
1
- // Set box-sizing globally to handle padding and border widths
2
- *,
3
- *:before,
4
- *:after {
5
- box-sizing: border-box;
6
- }
1
+ .notesSource {
7
2
 
8
- html,
9
- body {
10
- font-size: 100%;
11
- height: 100%; // Must be 100% for off canvas to work
12
- }
3
+ & {
4
+ padding: 0;
5
+ margin: 0;
6
+ position: relative;
7
+ color: rgba(0,0,0,0.8);
8
+ text-rendering: optimizeLegibility;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ }
12
+
13
+ *,
14
+ *:before,
15
+ *:after {
16
+ box-sizing: border-box;
17
+ }
13
18
 
14
- // Default body styles
15
- body {
16
- padding: 0;
17
- margin: 0;
18
- position: relative;
19
- font-family: $font-family-sans;
20
- color: rgba(0,0,0,0.8);
21
- text-rendering: optimizeLegibility;
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
19
  }
@@ -1,126 +1,125 @@
1
1
  .inlineTooltip {
2
2
 
3
3
  // BASE
4
- & {
5
- position: absolute;
6
- z-index: 900;
7
- overflow: hidden;
8
- display: none;
9
- width: 33px;
10
- height: 33px;
11
- -webkit-transition: opacity 100ms, width 0 linear 250ms;
12
- transition: opacity 100ms, width 0 linear 250ms;
13
- padding: 0;
14
- }
4
+ position: absolute;
5
+ z-index: 900;
6
+ overflow: hidden;
7
+ display: none;
8
+ width: 33px;
9
+ height: 33px;
10
+ -webkit-transition: opacity 100ms, width 0 linear 250ms;
11
+ transition: opacity 100ms, width 0 linear 250ms;
12
+ padding: 0;
13
+
15
14
  &.is-active {
16
15
  display: block;
17
16
  width: 220px;
18
17
  -webkit-transition-delay: 0;
19
18
  transition-delay: 0;
20
19
  }
20
+ }
21
21
 
22
- // MENU
23
- &-menu {
24
- & {
25
- display: inline-block;
26
- padding-left: 22px;
27
- }
28
- button {
29
- margin-right: 9px;
30
- }
22
+ // MENU
23
+ .inlineTooltip-menu {
24
+ & {
25
+ display: inline-block;
26
+ padding-left: 22px;
31
27
  }
28
+ button {
29
+ margin-right: 9px;
30
+ }
31
+ }
32
32
 
33
- // BUTTON
34
- &-button {
33
+ // BUTTON
34
+ .inlineTooltip-button {
35
35
 
36
- // BASE
36
+ // BASE
37
+ & {
38
+ display: inline-block;
39
+ position: relative;
40
+ outline: 0;
41
+ padding: 0;
42
+ vertical-align: bottom;
43
+ box-sizing: border-box;
44
+ border-radius: 999em;
45
+ cursor: pointer;
46
+ font-size: 14px;
47
+ text-decoration: none;
48
+ font-family: $font-family-sans;
49
+ letter-spacing: -0.02em;
50
+ font-weight: 400;
51
+ font-style: normal;
52
+ white-space: nowrap;
53
+ text-rendering: auto;
54
+ text-align: center;
55
+ text-rendering: optimizeLegibility;
56
+ -webkit-font-smoothing: antialiased;
57
+ -moz-osx-font-smoothing: grayscale;
58
+ -moz-font-feature-settings: "liga" on;
59
+ width: $tooltip-size;
60
+ height: $tooltip-size;
61
+ line-height: $tooltip-size - 2;
62
+ -webkit-transition: 100ms border-color, 100ms color;
63
+ transition: 100ms border-color, 100ms color;
64
+ background: rgba(0,0,0,0);
65
+ border: 1px solid rgba(0,0,0,0.15);
66
+ color: rgba(0,0,0,0.44);
67
+ }
68
+
69
+ &:hover {
70
+ border-color: rgba(0,0,0,0.9);
71
+ color: rgba(0,0,0,0.9);
72
+ }
73
+
74
+ // SCALE
75
+ &.scale {
37
76
  & {
38
- display: inline-block;
39
- position: relative;
40
- outline: 0;
41
- padding: 0;
42
- vertical-align: bottom;
43
- box-sizing: border-box;
44
- border-radius: 999em;
45
- cursor: pointer;
46
- font-size: 14px;
47
- text-decoration: none;
48
- font-family: $font-family-sans;
49
- letter-spacing: -0.02em;
50
- font-weight: 400;
51
- font-style: normal;
52
- white-space: nowrap;
53
- text-rendering: auto;
54
- text-align: center;
55
- text-rendering: optimizeLegibility;
56
- -webkit-font-smoothing: antialiased;
57
- -moz-osx-font-smoothing: grayscale;
58
- -moz-font-feature-settings: "liga" on;
59
- width: $tooltip-size;
60
- height: $tooltip-size;
61
- line-height: $tooltip-size - 2;
62
- -webkit-transition: 100ms border-color, 100ms color;
63
- transition: 100ms border-color, 100ms color;
64
- background: rgba(0,0,0,0);
65
- border: 1px solid rgba(0,0,0,0.15);
66
- color: rgba(0,0,0,0.44);
77
+ -webkit-transform: scale(0);
78
+ -ms-transform: scale(0);
79
+ transform: scale(0);
80
+ -webkit-transition-property: -webkit-transform;
81
+ transition-property: transform;
82
+ -webkit-transition-duration: 100ms;
83
+ transition-duration: 100ms;
67
84
  }
68
-
69
- &:hover {
70
- border-color: rgba(0,0,0,0.9);
71
- color: rgba(0,0,0,0.9);
85
+ .is-scaled & {
86
+ -webkit-transform: scale(1);
87
+ -ms-transform: scale(1);
88
+ transform: scale(1);
89
+ -webkit-transition-duration: 200ms;
90
+ transition-duration: 200ms;
72
91
  }
73
-
74
- // SCALE
75
- &.scale {
76
- & {
77
- -webkit-transform: scale(0);
78
- -ms-transform: scale(0);
79
- transform: scale(0);
80
- -webkit-transition-property: -webkit-transform;
81
- transition-property: transform;
82
- -webkit-transition-duration: 100ms;
83
- transition-duration: 100ms;
84
- }
85
- .is-scaled & {
86
- -webkit-transform: scale(1);
87
- -ms-transform: scale(1);
88
- transform: scale(1);
89
- -webkit-transition-duration: 200ms;
90
- transition-duration: 200ms;
91
- }
92
- &:nth-child(2) {
93
- -webkit-transition-delay: 30ms;
94
- transition-delay: 30ms;
95
- }
96
- &:nth-child(3) {
97
- -webkit-transition-delay: 60ms;
98
- transition-delay: 60ms;
99
- }
100
- &:nth-child(4) {
101
- -webkit-transition-delay: 90ms;
102
- transition-delay: 90ms;
103
- }
92
+ &:nth-child(2) {
93
+ -webkit-transition-delay: 30ms;
94
+ transition-delay: 30ms;
104
95
  }
105
-
106
- // CONTROL
107
- &.control {
108
- & {
109
- -webkit-transition: -webkit-transform 100ms;
110
- transition: transform 100ms;
111
- -webkit-transform: rotate(0);
112
- -ms-transform: rotate(0);
113
- transform: rotate(0);
114
- }
115
- .is-active & {
116
- -webkit-transition: -webkit-transform 250ms;
117
- transition: transform 250ms;
118
- -webkit-transform: rotate(45deg);
119
- -ms-transform: rotate(45deg);
120
- transform: rotate(45deg);
121
- }
96
+ &:nth-child(3) {
97
+ -webkit-transition-delay: 60ms;
98
+ transition-delay: 60ms;
122
99
  }
100
+ &:nth-child(4) {
101
+ -webkit-transition-delay: 90ms;
102
+ transition-delay: 90ms;
103
+ }
104
+ }
123
105
 
106
+ // CONTROL
107
+ &.control {
108
+ & {
109
+ -webkit-transition: -webkit-transform 100ms;
110
+ transition: transform 100ms;
111
+ -webkit-transform: rotate(0);
112
+ -ms-transform: rotate(0);
113
+ transform: rotate(0);
114
+ }
115
+ .is-active & {
116
+ -webkit-transition: -webkit-transform 250ms;
117
+ transition: transform 250ms;
118
+ -webkit-transform: rotate(45deg);
119
+ -ms-transform: rotate(45deg);
120
+ transform: rotate(45deg);
121
+ }
124
122
  }
125
123
 
126
124
  }
125
+