diff --git a/ui/index.html b/ui/index.html index 403b1d61..8d5270bf 100755 --- a/ui/index.html +++ b/ui/index.html @@ -129,6 +129,7 @@ $(function(){ ignoreElements: '.noScroll, '+ '.image .inline-image-info, '+ '.overlay-info, '+ + '.overlay, '+ '', }) diff --git a/ui/layout.css b/ui/layout.css index d7a46f2d..4a0a625e 100644 --- a/ui/layout.css +++ b/ui/layout.css @@ -877,14 +877,37 @@ body { .viewer.overlay .overlay-block { display: block; } +.overlay-block .content, .overlay-block .background { - position: absolute: - top: 0px; + /* XXX for some magical reason position and top are overwritten + with 'static' and 'auto' values respectively */ + + position: absolute !important; + top: 0px !important; left: 0px; height: 100%; width: 100%; - opacity: 0.7; cursor: auto; + opacity: 0.9; +} +.overlay-block .content, +.overlay-block .content table { + background: transparent; +} +.overlay-block .background { + opacity: 0.7; +} +.overlay-block .dialog { + display: inline-block; + min-height: 50px; + min-width: 300px; + color: white; + border: solid silver 1px; + border-radius: 3px; + background: gray; + padding: 20px; + vertical-align: center; + box-shadow: 0px 5px 50px 0px black; } /************************************************************ Help ***/ /* XXX make this more generic, and not just for the keyboard... */ diff --git a/ui/layout.less b/ui/layout.less index 5cfa0c6b..e77e25a0 100755 --- a/ui/layout.less +++ b/ui/layout.less @@ -872,17 +872,44 @@ body { .viewer.overlay .overlay-block { display: block; } -.overlay-block .content { -} +.overlay-block .content, .overlay-block .background { - position: absolute: - top: 0px; + /* XXX for some magical reason position and top are overwritten + with 'static' and 'auto' values respectively */ + position: absolute !important; + top: 0px !important; left: 0px; height: 100%; width: 100%; - opacity: 0.7; - cursor: auto; + + opacity: 0.9; +} +.overlay-block .content, +.overlay-block .content table { + background: transparent; +} +.overlay-block .background { + opacity: 0.7; +} + + +.overlay-block .dialog { + display: inline-block; + + min-height: 50px; + min-width: 300px; + + color: white; + border: solid silver 1px; + border-radius: 3px; + background: gray; + + padding: 20px; + + vertical-align: center; + + box-shadow: 0px 5px 50px 0px black; } diff --git a/ui/ui.js b/ui/ui.js index ed7820a9..3277bb72 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -315,6 +315,68 @@ function showContextIndicator(cls, text){ } +function getOverlay(root){ + root = $(root) + var overlay = root.find('.overlay-block') + if(overlay.length == 0){ + return $('
'+ + '
'+ + '
'+ + '
').appendTo(root) + } + return overlay +} + + +function showInOverlay(root, data){ + root = $(root) + + var overlay = getOverlay(root) + + + if(data != null){ + var container = $('
'+ + '
'+ + '
') + var dialog = container.find('.dialog') + + //overlay.find('.background') + // .click(function(){ hideOverlay(root) }) + + dialog + .append(data) + .click(function(){ event.stopPropagation() }) + overlay.find('.content') + .click(function(){ hideOverlay(root) }) + .append(container) + } + + root.addClass('overlay') + + return overlay +} + + +function hideOverlay(root){ + root.removeClass('overlay') + root.find('.overlay-block').remove() +} + + +function alert(){ + // XXX use CSS!!! + return showInOverlay($('.viewer'), $('') + .text(Array.apply(null, arguments).join(' '))) +} + +/* +function prompt(){ +} + +function confirm(){ +} +*/ + /*********************************************************************/ // vim:set ts=4 sw=4 nowrap :