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
@@ -0,0 +1,21 @@
1
+ .pen-input{position:absolute;
2
+ width:100%;left:0;
3
+ top:0;height:36px;
4
+ line-height:20px;
5
+ background:#333;
6
+ color:#fff;
7
+ border:none;
8
+ text-align:center;
9
+ display:none;
10
+ font-family:arial, sans-serif;
11
+ }
12
+ .pen-input:focus{
13
+ outline:none;
14
+ }
15
+
16
+ html = "<input class='dante-menu-input' placeholder='http://'>"
17
+ html += "<ul class='dante-menu-buttons'>"
18
+ _.each @config.buttons, (item)->
19
+ html += "<li class='dante-menu-button'><i class=\"dante-icon icon-#{item}\" data-action=\"#{item}\"></i></li>"
20
+ html += "</ul>"
21
+ html
@@ -0,0 +1,22 @@
1
+ %article.postArticle
2
+
3
+ .notesPositionContainer
4
+
5
+ %section.postWrapper
6
+ .postWrapper-inner
7
+
8
+ .postContent
9
+ .postContent-inner
10
+
11
+ .notesSource
12
+ .postField
13
+
14
+ %section
15
+ .section-divider
16
+ .section-content
17
+
18
+ .inlineTooltip2
19
+
20
+ %footer
21
+
22
+ .highlightMenu
@@ -1,5 +1,5 @@
1
1
  require "dante-editor/version"
2
2
 
3
3
  module DanteEditor
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
@@ -0,0 +1,12 @@
1
+ // Set box-sizing globally to handle padding and border widths
2
+ *,
3
+ *:before,
4
+ *:after {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ html,
9
+ body {
10
+ font-size: 100%;
11
+ height: 100%; // Must be 100% for off canvas to work
12
+ }
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Tooltips!
3
+ */
4
+
5
+ $tooltip-arrow-size: 6px;
6
+ $tooltip-arrow-height: $tooltip-arrow-size * 2;
7
+
8
+ /* Base styles for the element that has a tooltip */
9
+ [data-tooltip],
10
+ .tooltip {
11
+ position: relative;
12
+ cursor: pointer;
13
+ }
14
+
15
+ /* Base styles for the entire tooltip */
16
+ [data-tooltip]:before,
17
+ [data-tooltip]:after,
18
+ .tooltip:before,
19
+ .tooltip:after {
20
+ position: absolute;
21
+ visibility: hidden;
22
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
23
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
24
+ opacity: 0;
25
+ -webkit-transition:
26
+ opacity 0.2s ease-in-out,
27
+ visibility 0.2s ease-in-out,
28
+ -webkit-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
29
+ -moz-transition:
30
+ opacity 0.2s ease-in-out,
31
+ visibility 0.2s ease-in-out,
32
+ -moz-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
33
+ transition:
34
+ opacity 0.2s ease-in-out,
35
+ visibility 0.2s ease-in-out,
36
+ transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
37
+ -webkit-transform: translate3d(0, 0, 0);
38
+ -moz-transform: translate3d(0, 0, 0);
39
+ transform: translate3d(0, 0, 0);
40
+ pointer-events: none;
41
+ }
42
+
43
+ /* Show the entire tooltip on hover and focus */
44
+ [data-tooltip]:hover:before,
45
+ [data-tooltip]:hover:after,
46
+ [data-tooltip]:focus:before,
47
+ [data-tooltip]:focus:after,
48
+ .tooltip:hover:before,
49
+ .tooltip:hover:after,
50
+ .tooltip:focus:before,
51
+ .tooltip:focus:after {
52
+ visibility: visible;
53
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
54
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
55
+ opacity: 1;
56
+ }
57
+
58
+ /* Base styles for the tooltip's directional arrow */
59
+ .tooltip:before,
60
+ [data-tooltip]:before {
61
+ z-index: 1001;
62
+ border: $tooltip-arrow-size solid transparent;
63
+ background: transparent;
64
+ content: "";
65
+ }
66
+
67
+ /* Base styles for the tooltip's content area */
68
+ .tooltip:after,
69
+ [data-tooltip]:after {
70
+ white-space: nowrap;
71
+ z-index: 1000;
72
+ padding: 8px;
73
+ background-color: #000;
74
+ background-color: hsla(0, 0%, 20%, 0.9);
75
+ color: #fff;
76
+ content: attr(data-tooltip);
77
+ font-size: 14px;
78
+ line-height: 1.2;
79
+ border-radius: 3px;
80
+ }
81
+
82
+ /* Directions */
83
+
84
+ /* Top (default) */
85
+ [data-tooltip]:before,
86
+ [data-tooltip]:after,
87
+ .tooltip:before,
88
+ .tooltip:after,
89
+ .tooltip-top:before,
90
+ .tooltip-top:after {
91
+ bottom: 100%;
92
+ left: 50%;
93
+ }
94
+
95
+ [data-tooltip]:before,
96
+ .tooltip:before,
97
+ .tooltip-top:before {
98
+ margin-left: -$tooltip-arrow-size;
99
+ margin-bottom: -$tooltip-arrow-height;
100
+ border-top-color: #000;
101
+ border-top-color: hsla(0, 0%, 20%, 0.9);
102
+ }
103
+
104
+ /* Horizontally align top/bottom tooltips */
105
+ [data-tooltip]:after,
106
+ .tooltip:after,
107
+ .tooltip-top:after {
108
+ margin-left: -80px;
109
+ }
110
+
111
+ [data-tooltip]:hover:before,
112
+ [data-tooltip]:hover:after,
113
+ [data-tooltip]:focus:before,
114
+ [data-tooltip]:focus:after,
115
+ .tooltip:hover:before,
116
+ .tooltip:hover:after,
117
+ .tooltip:focus:before,
118
+ .tooltip:focus:after,
119
+ .tooltip-top:hover:before,
120
+ .tooltip-top:hover:after,
121
+ .tooltip-top:focus:before,
122
+ .tooltip-top:focus:after {
123
+ -webkit-transform: translateY(-$tooltip-arrow-height);
124
+ -moz-transform: translateY(-$tooltip-arrow-height);
125
+ transform: translateY(-$tooltip-arrow-height);
126
+ }
127
+
128
+ /* Left */
129
+ .tooltip-left:before,
130
+ .tooltip-left:after {
131
+ right: 100%;
132
+ bottom: 50%;
133
+ left: auto;
134
+ }
135
+
136
+ .tooltip-left:before {
137
+ margin-left: 0;
138
+ margin-right: -$tooltip-arrow-height;
139
+ margin-bottom: 0;
140
+ border-top-color: transparent;
141
+ border-left-color: #000;
142
+ border-left-color: hsla(0, 0%, 20%, 0.9);
143
+ }
144
+
145
+ .tooltip-left:hover:before,
146
+ .tooltip-left:hover:after,
147
+ .tooltip-left:focus:before,
148
+ .tooltip-left:focus:after {
149
+ -webkit-transform: translateX(-$tooltip-arrow-height);
150
+ -moz-transform: translateX(-$tooltip-arrow-height);
151
+ transform: translateX(-$tooltip-arrow-height);
152
+ }
153
+
154
+ /* Bottom */
155
+ .tooltip-bottom:before,
156
+ .tooltip-bottom:after {
157
+ top: 100%;
158
+ bottom: auto;
159
+ left: 50%;
160
+ }
161
+
162
+ .tooltip-bottom:before {
163
+ margin-top: -12px;
164
+ margin-bottom: 0;
165
+ border-top-color: transparent;
166
+ border-bottom-color: #000;
167
+ border-bottom-color: hsla(0, 0%, 20%, 0.9);
168
+ }
169
+
170
+ .tooltip-bottom:hover:before,
171
+ .tooltip-bottom:hover:after,
172
+ .tooltip-bottom:focus:before,
173
+ .tooltip-bottom:focus:after {
174
+ -webkit-transform: translateY($tooltip-arrow-height);
175
+ -moz-transform: translateY($tooltip-arrow-height);
176
+ transform: translateY($tooltip-arrow-height);
177
+ }
178
+
179
+ /* Right */
180
+ .tooltip-right:before,
181
+ .tooltip-right:after {
182
+ bottom: 50%;
183
+ left: 100%;
184
+ }
185
+
186
+ .tooltip-right:before {
187
+ margin-bottom: 0;
188
+ margin-left: -$tooltip-arrow-height;
189
+ border-top-color: transparent;
190
+ border-right-color: #000;
191
+ border-right-color: hsla(0, 0%, 20%, 0.9);
192
+ }
193
+
194
+ .tooltip-right:hover:before,
195
+ .tooltip-right:hover:after,
196
+ .tooltip-right:focus:before,
197
+ .tooltip-right:focus:after {
198
+ -webkit-transform: translateX($tooltip-arrow-height);
199
+ -moz-transform: translateX($tooltip-arrow-height);
200
+ transform: translateX($tooltip-arrow-height);
201
+ }
202
+
203
+ /* Move directional arrows down a bit for left/right tooltips */
204
+ .tooltip-left:before,
205
+ .tooltip-right:before {
206
+ top: 50%;
207
+ margin-top: -$tooltip-arrow-size;
208
+ bottom: auto;
209
+ }
210
+
211
+ /* Vertically center tooltip content for left/right tooltips */
212
+ .tooltip-left:after,
213
+ .tooltip-right:after {
214
+ margin-left: 0;
215
+ margin-bottom: -16px;
216
+ }
@@ -1,34 +1,59 @@
1
1
  @charset "utf-8";
2
2
 
3
- header{
4
- width: 100%;
5
- border-top: 3px solid #1abf89;
6
- margin-bottom: 40px;
3
+ @import "scaffold";
4
+ @import "tooltips";
7
5
 
8
- img{
9
- display: block;
10
- float: left;
11
- margin: -34px 7px 11px 25px;
12
- position: absolute;
13
- left: 0;
14
- top: 28px;
15
- }
16
- h1 {
17
- font-size: 30px;
18
- font-style: normal;
19
- font-weight: 300;
20
- letter-spacing: -0.04em;
21
- line-height: 1;
22
- margin-bottom: 8px;
23
- margin-right: 91px;
24
- margin-top: 25px;
25
- padding-top: 0;
26
- text-align: right;
27
- }
28
- }
6
+ $color-brand: #1abf89;
7
+ $gutter: 30px;
29
8
 
9
+ body:after {
10
+ content: "";
11
+ position: fixed;
12
+ width: 100%;
13
+ height: 3px;
14
+ top: 0;
15
+ right: 0;
16
+ left: 0;
17
+ background-color: $color-brand;
18
+ }
19
+ article {
20
+ margin-top: 70px;
21
+ padding: $gutter;
22
+ }
30
23
  #editor{
31
24
  margin: 0 auto;
32
25
  //width: 70%;
33
- width: 700px;
26
+ max-width: 700px;
27
+ }
28
+
29
+ .logo {
30
+ display: block;
31
+ float: left;
32
+ margin: -34px 7px 11px 25px;
33
+ position: absolute;
34
+ left: 0;
35
+ top: 28px;
36
+ }
37
+
38
+ .top-left,
39
+ .top-right {
40
+ position: fixed;
41
+ top: $gutter;
42
+ }
43
+
44
+ .top-left {
45
+ left: $gutter;
46
+ }
47
+ .top-right {
48
+ right: $gutter;
49
+ }
50
+
51
+ .github {
52
+ font-size: 40px;
53
+ color: $color-brand;
54
+ line-height: 0;
55
+ i {
56
+ position: relative;
57
+ top: -2px;
58
+ }
34
59
  }
@@ -1,29 +1,27 @@
1
1
  ---
2
- title: Dante Editor example
2
+ title: Dante Editor EMBEDS example
3
3
  ---
4
4
 
5
- <div class="welcome">
6
- <header>
7
- <img src="images/icon-logo.png" alt="dante logo" width="90" >
8
- <h1 class="main-title">Dante Wysiwyg</h1>
9
- </header>
5
+ <article>
6
+ <div class="postContent">
7
+ <div class="notesSource">
10
8
 
9
+ <div id="editor" class="postField postField--body editable smart-media-plugin">
10
+ <%= partial "partials/content" %>
11
+ <%= partial "partials/example_1" %>
12
+ <%= partial "partials/example_2" %>
13
+ </div>
11
14
 
12
- <div id="editor" class="postField postField--body editable smart-media-plugin">
13
- <%= partial "partials/example_1" %>
14
- <%= partial "partials/example_2" %>
15
+ </div>
15
16
  </div>
16
-
17
- </div>
18
-
17
+ </article>
19
18
 
20
19
  <script type="text/javascript">
21
20
  editor = new Dante.Editor(
22
21
  {
23
22
  el: "#editor",
24
- upload_url: "/images.json",
23
+ upload_url: "/uploads/new.json",
25
24
  debug: true
26
25
  }
27
- );
28
- editor.start()
26
+ ).start()
29
27
  </script>
@@ -2,35 +2,18 @@
2
2
  title: Dante Editor example
3
3
  ---
4
4
 
5
- <div class="welcome">
6
- <header>
7
- <img src="assets/images/icon-logo.png" alt="dante logo" width="90" >
8
- <h1 class="main-title">Dante Wysiwyg</h1>
9
- </header>
10
-
11
- <article>
12
- <div class="postContent">
13
- <div class="notesSource">
14
-
15
- <div id="editor" class="postField postField--body editable smart-media-plugin">
16
- <% partial "partials/content" %>
17
- <% partial "partials/example_1" %>
18
- <% partial "partials/example_2" %>
19
- </div>
20
-
21
- </div>
22
- </div>
23
- </article>
24
-
25
- </div>
26
5
 
6
+ <article>
7
+ <div id="editor">
8
+ <%= partial "partials/readme" %>
9
+ </div>
10
+ </article>
27
11
 
28
12
  <script type="text/javascript">
29
13
  editor = new Dante.Editor(
30
14
  {
31
15
  el: "#editor",
32
- upload_url: "/uploads/new.json",
33
- debug: true
16
+ upload_url: "/uploads/new.json"
34
17
  }
35
18
  ).start()
36
- </script>
19
+ </script>