JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
restyle annotations
authorJason Woofenden <jason@jasonwoof.com>
Sun, 13 Mar 2016 03:37:38 +0000 (22:37 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Sun, 13 Mar 2016 03:37:38 +0000 (22:37 -0500)
editor.coffee

index 7d34100..a8b6a27 100644 (file)
@@ -231,6 +231,18 @@ outer_css = (args) ->
        ret += '@keyframes blink {'
        ret +=     'to { visibility: hidden; }'
        ret += '}'
+       ret += '.ann_box {'
+       ret +=     'z-index: 5;'
+       ret +=     'position: absolute;'
+       ret +=     'border: 1px solid rgba(0,0,0,.1);'
+       ret += '}'
+       ret += '.ann_tag {'
+       ret +=     'z-index: 10;'
+       ret +=     'position: absolute;'
+       ret +=     'font-size: 8px;'
+       ret +=     'white-space: pre;'
+       ret +=     'background: rgba(255,255,255,0.4);'
+       ret += '}'
        return ret
 
 # key codes:
@@ -791,10 +803,10 @@ class PeachHTML5Editor
                        if bounds.x is prev_bounds.x and bounds.y is prev_bounds.y and bounds.w is prev_bounds.w and bounds.h is prev_bounds.h
                                n = n.parent
                                continue
-                       matt = domify @outer_idoc, div: style: "position: absolute; left: #{bounds.x - 1 + overlay_padding}px; top: #{bounds.y - 1 + overlay_padding}px; width: #{bounds.w}px; height: #{bounds.h}px; outline: 1000px solid rgba(0,153,255,#{alpha}); border: 1px solid rgba(0,0,0,.1)"
+                       matt = domify @outer_idoc, div: class: 'ann_box', style: "left: #{bounds.x - 1 + overlay_padding}px; top: #{bounds.y - 2 + overlay_padding}px; width: #{bounds.w}px; height: #{bounds.h}px" # outline: 1000px solid rgba(0,153,255,#{alpha});
                        @overlay.appendChild matt
                        @matting.push matt
-                       ann = domify @outer_idoc, div: style: "position: absolute; left: #{bounds.x - 2 + overlay_padding}px; top: #{bounds.y - 6 + overlay_padding}px; font-size: 8px", children: [domify @outer_idoc, text: "<#{n.name}>"]
+                       ann = domify @outer_idoc, div: class: 'ann_tag', style: "left: #{bounds.x + 1 + overlay_padding}px; top: #{bounds.y - 7 + overlay_padding}px", children: [domify @outer_idoc, text: " #{n.name} "]
                        @overlay.appendChild ann
                        @matting.push ann
                        n = n.parent