2012-03-16 Sergio Martin <sergio.martin@artica.es>

* 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
This commit is contained in:
zarzuelo 2012-03-16 09:23:09 +00:00
parent 4867fb3743
commit c54d341691
5 changed files with 34 additions and 7 deletions

View File

@ -1,3 +1,12 @@
2012-03-16 Sergio Martin <sergio.martin@artica.es>
* 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 <slerena@artica.es>
* images/console/background: Replaced old imagemaps

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

View File

@ -436,16 +436,25 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = '
ob_start();
html_print_select ($fields, $name . '_select', $selected,"" . $script,
$nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style);
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 '<div id="'.$name.'_default" style="width:100%">';
html_print_select ($fields, $name . '_select', $selected,"" . $script,
$nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style);
echo ' <a href="javascript:">'.html_print_image('images/pencil.png',true,array('class' => $name . '_toggler', 'alt' => __('Manual'), 'title' => __('Manual'))).'</a>';
echo '</div>';
echo '<div id="'.$name.'_manual" style="width:100%">';
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 ' <a href="javascript:">'.html_print_image('images/default_list.png',true,array('class' => $name . '_toggler', 'alt' => __('List'), 'title' => __('List'))).'</a>';
echo '</div>';
echo "
<script type='text/javascript'>
period_select_events('$name');
$(document).ready (function () {
period_select_events('$name');
});
</script>
";

View File

@ -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;