From 72a0003c5ad241b2aad04597ea05ae68504f577e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 13 Jun 2013 02:02:24 +0400 Subject: [PATCH] several more bugs fixed and some tweaking... Signed-off-by: Alex A. Naanou --- ui/keybindings.js | 1 + ui/modes.js | 17 ++++++++++++++--- ui/ui.js | 6 +++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ui/keybindings.js b/ui/keybindings.js index 7968f946..1cf8492d 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -73,6 +73,7 @@ var KEYBOARD_CONFIG = { // '.viewer.overlay .overlay-block.dialog': { title: 'Dialog', + ignore: '*', Enter: doc('Accept dialog', function(){ diff --git a/ui/modes.js b/ui/modes.js index 0c886b1d..c3cfcf58 100755 --- a/ui/modes.js +++ b/ui/modes.js @@ -181,11 +181,21 @@ var toggleSlideShowMode = createCSSClassToggler( // interval from user... //var interval = prompt('Slideshow interval (sec):', SLIDESHOW_INTERVAL/1000) - prompt('Slideshow interval (sec):', SLIDESHOW_INTERVAL/1000) - .done(function(interval){ - interval = parseFloat(interval) + formDialog($('.viewer'), 'Slideshow', { + 'Interval:': (SLIDESHOW_INTERVAL/1000) + 'sec', + 'Looping:': SLIDESHOW_LOOP ? true : false, + 'Reverse direction:': SLIDESHOW_DIRECTION == 'prev' ? true : false + }, 'Start') + .done(function(data){ + var interval = parseFloat(data['Interval:']) + var looping = data['Looping:'] + var reverse = data['Reverse direction:'] SLIDESHOW_INTERVAL = isNaN(interval) ? 3000 : interval*1000 + SLIDESHOW_LOOP = looping + SLIDESHOW_DIRECTION = reverse == true ? 'prev' : 'next' + + console.log('>>>', data) showStatus('Slideshow: starting', SLIDESHOW_LOOP ? 'looped...' : 'unlooped...') @@ -220,6 +230,7 @@ var toggleSlideShowMode = createCSSClassToggler( } else { window._slideshow_timer != null && clearInterval(_slideshow_timer) showStatus('Slideshow: stopped...') + hideOverlay($('.viewer')) } }) diff --git a/ui/ui.js b/ui/ui.js index 7953e2fc..c48425db 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -383,7 +383,7 @@ var FIELD_TYPES = { type: 'text', text: null, default: '', - html: '
'+ + html: '
'+ ''+ ''+ '
', @@ -401,7 +401,7 @@ var FIELD_TYPES = { type: 'bool', text: null, default: false, - html: '
'+ + html: '
'+ ''+ ''+ '
', @@ -528,7 +528,7 @@ function formDialog(root, message, config, btn, cls){ }) setTimeout(function(){ - form.find('.field').first() + form.find('.field input').first() .focus() .select() }, 100)