dante-editor 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/dante/popover.js.coffee +5 -3
- data/app/assets/javascripts/dante/tooltip.js.coffee +14 -2
- data/app/assets/stylesheets/dante/_tooltip.scss +9 -7
- data/app/assets/stylesheets/dante/_variables.scss +1 -3
- data/bower.json +1 -1
- data/dist/css/dante-editor.css +30 -5
- data/dist/js/dante-editor.js +19 -8
- data/lib/dante-editor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cfab9a7cc9692beab99dac0d5a60bae095b0317
|
4
|
+
data.tar.gz: 5665200f9948f8ef09ac040e941862240271ac95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c100555c921c8f70f318e8f1f8b4fcf5af68c7192f595a04f9d4b7ca8c77d44c42eb76957b4e1d842776e1582e3c8e979392a1e59e8f21258a8694aaf7d267
|
7
|
+
data.tar.gz: 17511f2883bb0b03a6614119ca4d1bd63f5e82f3f456cebe19f2d78d99c25af0da8f2d3218aecad31648f07672d86be14aa1ff5876743f492ba8706e2276bfc4
|
@@ -26,13 +26,14 @@ class Dante.Editor.PopOver extends Dante.View
|
|
26
26
|
#display & copy original link
|
27
27
|
positionAt: (ev)->
|
28
28
|
target = $(ev.currentTarget)
|
29
|
+
wrapperOffset = target.closest('article.postArticle').offset()
|
29
30
|
target_positions = @resolveTargetPosition(target)
|
30
31
|
target_offset = target.offset()
|
31
32
|
target_width = target.outerWidth()
|
32
33
|
target_height = target.outerHeight()
|
33
34
|
popover_width = @findElement().outerWidth()
|
34
35
|
top_value = target_positions.top + target_height
|
35
|
-
left_value = target_offset.left + (target_width/2) - (popover_width/2)
|
36
|
+
left_value = target_offset.left + (target_width/2) - (popover_width/2) - wrapperOffset.left
|
36
37
|
|
37
38
|
@findElement()
|
38
39
|
.css("top", top_value)
|
@@ -147,13 +148,14 @@ class Dante.Editor.PopOverTypeAhead extends Dante.Editor.PopOver
|
|
147
148
|
#display & copy original link
|
148
149
|
positionAt: (target)->
|
149
150
|
target = $(target)
|
151
|
+
wrapperOffset = target.closest('article.postArticle').offset()
|
150
152
|
target_positions = @resolveTargetPosition(target)
|
151
153
|
target_offset = target.offset()
|
152
154
|
target_width = target.outerWidth()
|
153
155
|
target_height = target.outerHeight()
|
154
156
|
popover_width = @findElement().outerWidth()
|
155
157
|
top_value = target_positions.top + target_height
|
156
|
-
left_value = target_offset.left + (target_width/2) - (popover_width/2)
|
158
|
+
left_value = target_offset.left + (target_width/2) - (popover_width/2) - wrapperOffset.left
|
157
159
|
|
158
160
|
@findElement()
|
159
161
|
.css("top", top_value)
|
@@ -394,7 +396,7 @@ class Dante.Editor.ImageTooltip extends Dante.Editor.PopOver
|
|
394
396
|
popover_width = @findElement().outerWidth()
|
395
397
|
|
396
398
|
# hacky hack
|
397
|
-
pad_top = if @findSelectedImage().hasClass("graf--layoutOutsetLeft") then
|
399
|
+
pad_top = if @findSelectedImage().hasClass("graf--layoutOutsetLeft") then 72 else 74
|
398
400
|
|
399
401
|
top_value = target_position.top - pad_top # target_positions.top + target_height
|
400
402
|
left_value = target_offset.left + (target_width/2) - (popover_width/2)
|
@@ -34,8 +34,20 @@ class Dante.Editor.Tooltip extends Dante.View
|
|
34
34
|
|
35
35
|
|
36
36
|
render: ()=>
|
37
|
-
$(@el)
|
38
|
-
|
37
|
+
tooltip = $(@el)
|
38
|
+
tooltip.html(@template())
|
39
|
+
tooltip.addClass("is-active")
|
40
|
+
|
41
|
+
# Set menu size
|
42
|
+
tooltip_menu = tooltip.find(".inlineTooltip-menu")
|
43
|
+
tooltip_buttons = tooltip_menu.find(".inlineTooltip-button")
|
44
|
+
tooltip_button_width = $(tooltip_buttons[0]).css("width")
|
45
|
+
tooltip_button_spacing = $(tooltip_buttons[0]).css("margin-right")
|
46
|
+
tooltip_button_size = parseInt(tooltip_button_width.replace(/px/,"")) + parseInt(tooltip_button_spacing.replace(/px/,""))
|
47
|
+
tooltip_menu_size = tooltip_button_size * tooltip_buttons.length
|
48
|
+
|
49
|
+
# Add 1px on expanded tooltip to avoid colapsed buttons in FF
|
50
|
+
tooltip_menu.css("width", "#{tooltip_menu_size + 1}px")
|
39
51
|
@
|
40
52
|
|
41
53
|
toggleOptions: ()=>
|
@@ -20,17 +20,14 @@
|
|
20
20
|
&.is-scaled {
|
21
21
|
-webkit-transition-delay: 0;
|
22
22
|
transition-delay: 0;
|
23
|
+
width: auto;
|
23
24
|
}
|
24
25
|
}
|
25
26
|
|
26
27
|
// MENU
|
27
28
|
.inlineTooltip-menu {
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
button {
|
32
|
-
margin-right: $tooltip-button-spacing;
|
33
|
-
}
|
29
|
+
display: inline-block;
|
30
|
+
margin-left: $tooltip-size + $tooltip-menu-spacing;
|
34
31
|
}
|
35
32
|
|
36
33
|
// BUTTON
|
@@ -39,7 +36,7 @@
|
|
39
36
|
// BASE
|
40
37
|
& {
|
41
38
|
float: left;
|
42
|
-
margin-right: $tooltip-
|
39
|
+
margin-right: $tooltip-button-spacing;
|
43
40
|
display: inline-block;
|
44
41
|
position: relative;
|
45
42
|
outline: 0;
|
@@ -105,6 +102,11 @@
|
|
105
102
|
|
106
103
|
// CONTROL
|
107
104
|
&.control {
|
105
|
+
& {
|
106
|
+
display: block;
|
107
|
+
position: absolute;
|
108
|
+
margin-right: $tooltip-menu-spacing;
|
109
|
+
}
|
108
110
|
& {
|
109
111
|
-webkit-transition: -webkit-#{$tooltip-forward-transition}, $tooltip-default-transition;
|
110
112
|
transition: $tooltip-forward-transition, $tooltip-default-transition;
|
@@ -80,15 +80,13 @@ $tooltip-border-radius: 999em;
|
|
80
80
|
$tooltip-button-spacing: 9px;
|
81
81
|
$tooltip-menu-spacing: 22px;
|
82
82
|
|
83
|
-
$tooltip-items:
|
83
|
+
$tooltip-items: 10; // Fix this and remove it
|
84
84
|
$tooltip-item-delay: 30;
|
85
85
|
$tooltip-size: 32px;
|
86
86
|
$tooltip-line-height: $tooltip-size;
|
87
87
|
|
88
88
|
$tooltip-caret-size: 12px;
|
89
89
|
|
90
|
-
// Add 1px on expanded tooltip to avoid colapsed buttons in FF
|
91
|
-
$tooltip-size-expanded: 1 + ($tooltip-size + $tooltip-menu-spacing) + (($tooltip-size + $tooltip-button-spacing) * $tooltip-items);
|
92
90
|
$tooltip-default-transition: 100ms border-color, 100ms color;
|
93
91
|
$tooltip-forward-transition: transform 100ms;
|
94
92
|
$tooltip-backward-transition: transform 250ms;
|
data/bower.json
CHANGED
data/dist/css/dante-editor.css
CHANGED
@@ -435,16 +435,16 @@
|
|
435
435
|
pointer-events: auto; }
|
436
436
|
.inlineTooltip.is-scaled {
|
437
437
|
-webkit-transition-delay: 0;
|
438
|
-
transition-delay: 0;
|
438
|
+
transition-delay: 0;
|
439
|
+
width: auto; }
|
439
440
|
|
440
441
|
.inlineTooltip-menu {
|
441
|
-
|
442
|
-
|
443
|
-
margin-right: 9px; }
|
442
|
+
display: inline-block;
|
443
|
+
margin-left: 54px; }
|
444
444
|
|
445
445
|
.inlineTooltip-button {
|
446
446
|
float: left;
|
447
|
-
margin-right:
|
447
|
+
margin-right: 9px;
|
448
448
|
display: inline-block;
|
449
449
|
position: relative;
|
450
450
|
outline: 0;
|
@@ -490,6 +490,27 @@
|
|
490
490
|
transform: scale(1);
|
491
491
|
-webkit-transition: -webkit-transform 250ms, 100ms border-color, 100ms color;
|
492
492
|
transition: transform 250ms, 100ms border-color, 100ms color; }
|
493
|
+
.inlineTooltip-button.scale:nth-child(11) {
|
494
|
+
-webkit-transition-delay: 300ms;
|
495
|
+
transition-delay: 300ms; }
|
496
|
+
.inlineTooltip-button.scale:nth-child(10) {
|
497
|
+
-webkit-transition-delay: 270ms;
|
498
|
+
transition-delay: 270ms; }
|
499
|
+
.inlineTooltip-button.scale:nth-child(9) {
|
500
|
+
-webkit-transition-delay: 240ms;
|
501
|
+
transition-delay: 240ms; }
|
502
|
+
.inlineTooltip-button.scale:nth-child(8) {
|
503
|
+
-webkit-transition-delay: 210ms;
|
504
|
+
transition-delay: 210ms; }
|
505
|
+
.inlineTooltip-button.scale:nth-child(7) {
|
506
|
+
-webkit-transition-delay: 180ms;
|
507
|
+
transition-delay: 180ms; }
|
508
|
+
.inlineTooltip-button.scale:nth-child(6) {
|
509
|
+
-webkit-transition-delay: 150ms;
|
510
|
+
transition-delay: 150ms; }
|
511
|
+
.inlineTooltip-button.scale:nth-child(5) {
|
512
|
+
-webkit-transition-delay: 120ms;
|
513
|
+
transition-delay: 120ms; }
|
493
514
|
.inlineTooltip-button.scale:nth-child(4) {
|
494
515
|
-webkit-transition-delay: 90ms;
|
495
516
|
transition-delay: 90ms; }
|
@@ -499,6 +520,10 @@
|
|
499
520
|
.inlineTooltip-button.scale:nth-child(2) {
|
500
521
|
-webkit-transition-delay: 30ms;
|
501
522
|
transition-delay: 30ms; }
|
523
|
+
.inlineTooltip-button.control {
|
524
|
+
display: block;
|
525
|
+
position: absolute;
|
526
|
+
margin-right: 22px; }
|
502
527
|
.inlineTooltip-button.control {
|
503
528
|
-webkit-transition: -webkit-transform 100ms, 100ms border-color, 100ms color;
|
504
529
|
transition: transform 100ms, 100ms border-color, 100ms color;
|
data/dist/js/dante-editor.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
defaults: {
|
9
9
|
image_placeholder: '../images/dante/media-loading-placeholder.png'
|
10
10
|
},
|
11
|
-
version: "0.1.
|
11
|
+
version: "0.1.5"
|
12
12
|
};
|
13
13
|
|
14
14
|
}).call(this);
|
@@ -2992,8 +2992,17 @@
|
|
2992
2992
|
};
|
2993
2993
|
|
2994
2994
|
Tooltip.prototype.render = function() {
|
2995
|
-
|
2996
|
-
$(this.el)
|
2995
|
+
var tooltip, tooltip_button_size, tooltip_button_spacing, tooltip_button_width, tooltip_buttons, tooltip_menu, tooltip_menu_size;
|
2996
|
+
tooltip = $(this.el);
|
2997
|
+
tooltip.html(this.template());
|
2998
|
+
tooltip.addClass("is-active");
|
2999
|
+
tooltip_menu = tooltip.find(".inlineTooltip-menu");
|
3000
|
+
tooltip_buttons = tooltip_menu.find(".inlineTooltip-button");
|
3001
|
+
tooltip_button_width = $(tooltip_buttons[0]).css("width");
|
3002
|
+
tooltip_button_spacing = $(tooltip_buttons[0]).css("margin-right");
|
3003
|
+
tooltip_button_size = parseInt(tooltip_button_width.replace(/px/, "")) + parseInt(tooltip_button_spacing.replace(/px/, ""));
|
3004
|
+
tooltip_menu_size = tooltip_button_size * tooltip_buttons.length;
|
3005
|
+
tooltip_menu.css("width", "" + (tooltip_menu_size + 1) + "px");
|
2997
3006
|
return this;
|
2998
3007
|
};
|
2999
3008
|
|
@@ -3093,15 +3102,16 @@
|
|
3093
3102
|
};
|
3094
3103
|
|
3095
3104
|
PopOver.prototype.positionAt = function(ev) {
|
3096
|
-
var left_value, popover_width, target, target_height, target_offset, target_positions, target_width, top_value;
|
3105
|
+
var left_value, popover_width, target, target_height, target_offset, target_positions, target_width, top_value, wrapperOffset;
|
3097
3106
|
target = $(ev.currentTarget);
|
3107
|
+
wrapperOffset = target.closest('article.postArticle').offset();
|
3098
3108
|
target_positions = this.resolveTargetPosition(target);
|
3099
3109
|
target_offset = target.offset();
|
3100
3110
|
target_width = target.outerWidth();
|
3101
3111
|
target_height = target.outerHeight();
|
3102
3112
|
popover_width = this.findElement().outerWidth();
|
3103
3113
|
top_value = target_positions.top + target_height;
|
3104
|
-
left_value = target_offset.left + (target_width / 2) - (popover_width / 2);
|
3114
|
+
left_value = target_offset.left + (target_width / 2) - (popover_width / 2) - wrapperOffset.left;
|
3105
3115
|
this.findElement().css("top", top_value).css("left", left_value).show();
|
3106
3116
|
return this.handleDirection(target);
|
3107
3117
|
};
|
@@ -3213,15 +3223,16 @@
|
|
3213
3223
|
};
|
3214
3224
|
|
3215
3225
|
PopOverTypeAhead.prototype.positionAt = function(target) {
|
3216
|
-
var left_value, popover_width, target_height, target_offset, target_positions, target_width, top_value;
|
3226
|
+
var left_value, popover_width, target_height, target_offset, target_positions, target_width, top_value, wrapperOffset;
|
3217
3227
|
target = $(target);
|
3228
|
+
wrapperOffset = target.closest('article.postArticle').offset();
|
3218
3229
|
target_positions = this.resolveTargetPosition(target);
|
3219
3230
|
target_offset = target.offset();
|
3220
3231
|
target_width = target.outerWidth();
|
3221
3232
|
target_height = target.outerHeight();
|
3222
3233
|
popover_width = this.findElement().outerWidth();
|
3223
3234
|
top_value = target_positions.top + target_height;
|
3224
|
-
left_value = target_offset.left + (target_width / 2) - (popover_width / 2);
|
3235
|
+
left_value = target_offset.left + (target_width / 2) - (popover_width / 2) - wrapperOffset.left;
|
3225
3236
|
this.findElement().css("top", top_value).css("left", left_value).show();
|
3226
3237
|
return this.handleDirection(target);
|
3227
3238
|
};
|
@@ -3452,7 +3463,7 @@
|
|
3452
3463
|
target_width = target.outerWidth();
|
3453
3464
|
target_height = target.outerHeight();
|
3454
3465
|
popover_width = this.findElement().outerWidth();
|
3455
|
-
pad_top = this.findSelectedImage().hasClass("graf--layoutOutsetLeft") ?
|
3466
|
+
pad_top = this.findSelectedImage().hasClass("graf--layoutOutsetLeft") ? 72 : 74;
|
3456
3467
|
top_value = target_position.top - pad_top;
|
3457
3468
|
left_value = target_offset.left + (target_width / 2) - (popover_width / 2);
|
3458
3469
|
this.findElement().css("top", top_value).css("left", left_value).show().addClass("is-active");
|
data/lib/dante-editor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dante-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Michelson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-06-
|
12
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: dante-editor yet another Medium editor clone.
|
15
15
|
email:
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.5.2
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: dante-editor yet another Medium editor clone.
|