Move ajax_autoselect into functions.lib.php
This commit is contained in:
parent
7743f88e98
commit
8a32ae6935
@ -358,24 +358,6 @@ function ajax_dialog($title,$message,$w=350,$h=150)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make content of an input box selected when we click into input field.
|
||||
*
|
||||
* @param string $htmlname Id of html object
|
||||
* @param string $addlink Add a 'link to' after
|
||||
*/
|
||||
function ajax_autoselect($htmlname, $addlink='')
|
||||
{
|
||||
global $langs;
|
||||
$out = '<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("#'.$htmlname.'").click(function() { jQuery(this).select(); } );
|
||||
});
|
||||
</script>';
|
||||
if ($addlink) $out.=' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a html select field into an ajax combobox.
|
||||
* Use ajax_combobox() only for small combo list! If not, use instead ajax_autocompleter().
|
||||
|
||||
@ -6861,6 +6861,25 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param=''
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make content of an input box selected when we click into input field.
|
||||
*
|
||||
* @param string $htmlname Id of html object
|
||||
* @param string $addlink Add a 'link to' after
|
||||
*/
|
||||
function ajax_autoselect($htmlname, $addlink='')
|
||||
{
|
||||
global $langs;
|
||||
$out = '<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("#'.$htmlname.'").click(function() { jQuery(this).select(); } );
|
||||
});
|
||||
</script>';
|
||||
if ($addlink) $out.=' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return mime type of a file
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user