From 3b633261c66c5e5c5e5c7a83b99b841a28ec3847 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 16 Mar 2012 09:23:09 +0000 Subject: [PATCH] 2012-03-16 Sergio Martin * include/functions_html.php include/javascript/pandora.js images/pencil.png images/default_list.png: Improved the usability of the periods advanced control toggling between manual and default mode git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5784 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 +++++++ pandora_console/images/default_list.png | Bin 0 -> 451 bytes pandora_console/images/pencil.png | Bin 0 -> 474 bytes pandora_console/include/functions_html.php | 23 ++++++++++++------ pandora_console/include/javascript/pandora.js | 9 +++++++ 5 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 pandora_console/images/default_list.png create mode 100644 pandora_console/images/pencil.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 18b7740062..931a4f0131 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2012-03-16 Sergio Martin + + * include/functions_html.php + include/javascript/pandora.js + images/pencil.png + images/default_list.png: Improved the usability + of the periods advanced control toggling between + manual and default mode + 2012-03-15 Sancho Lerena * images/console/background: Replaced old imagemaps diff --git a/pandora_console/images/default_list.png b/pandora_console/images/default_list.png new file mode 100644 index 0000000000000000000000000000000000000000..3a953aed17a906cc75c042e4b7e620bf743926a0 GIT binary patch literal 451 zcmV;!0X+VRP)`k_IFLke!8>n`H4+I?>ITH taU6Hk%d9CFWAiixFnRUp*|%Q-1^{uQhX!HZ@EQOB002ovPDHLkV1gVoz|sH! literal 0 HcmV?d00001 diff --git a/pandora_console/images/pencil.png b/pandora_console/images/pencil.png new file mode 100644 index 0000000000000000000000000000000000000000..d5ba3d5962359f1d6e4c7965e89850570307fe0e GIT binary patch literal 474 zcmV<00VV#4P)RCwBy(#=Z(K^O+`$FQyiC3%oK zWOa$6@}mDhhloB7-Re|ARQC|1AW$jjuq6bB5Z;3bx=2b%Mui{grMgHUMQfs^;@8?V zyJTS6G7ap)%`si2O~Czmj&i09A<0Y66>`{b))W1-3P{8e zYgvHnmSAu|3-6T|+@?)Odk|2_;u$r-zX2(FWnK|!Tg72WfgQ_+j=mBQo2Zb-Ns3cI z_MNU4;0kLnzZaD7pSw_xKWL!>4kGYPb+{(rQU)8ji-uSnO7Z4f z(-Fgz>bqfSW-J9HjweaSupW4H14$Z?%hCT5n6Oj=DOPAqCraJ3KvAGyE;3^&;N-p? zr=BM$OL;(JfFsnyjHMD{d'; + html_print_select ($fields, $name . '_select', $selected,"" . $script, + $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); + echo ' '.html_print_image('images/pencil.png',true,array('class' => $name . '_toggler', 'alt' => __('Manual'), 'title' => __('Manual'))).''; + echo ''; + + echo '
'; + html_print_input_text ($name . '_text', $selected, '', $size); + html_print_input_hidden ($name, $selected); + html_print_select ($units, $name . '_units', 1, "" . $script, + $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); + echo ' '.html_print_image('images/default_list.png',true,array('class' => $name . '_toggler', 'alt' => __('List'), 'title' => __('List'))).''; + echo '
'; echo " "; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 04d65a9c8a..1c4b168721 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -610,12 +610,21 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) { * @param name string with the name of the select for time */ function period_select_events(name) { + // Manual mode is hidden by default + $('#'+name+'_manual').hide(); + // If the text input is empty, we put on it 5 minutes by default if($('#text-'+name+'_text').val() == '') { $('#text-'+name+'_text').val(300); $('#'+name+'_select option:eq(1)').attr('selected', true); } + $('.'+name+'_toggler').click(function() { + $('#'+name+'_default').toggle(); + $('#'+name+'_manual').toggle(); + $('#text-'+name+'_text').focus(); + }); + function adjustTextUnits() { var restPrev; var unitsSelected = false;