mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
show agent and module name tip
This commit is contained in:
parent
b9c78bbfb1
commit
2b6a9f0277
@ -88,6 +88,23 @@ function js_html_entity_decode(str) {
|
|||||||
return str2;
|
return str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function truncate_string(str, str_length, separator) {
|
||||||
|
if (str.length <= str_length) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
separator = separator || "...";
|
||||||
|
|
||||||
|
var separator_length = separator.length,
|
||||||
|
chars_to_show = str_length - separator_length,
|
||||||
|
front_chars = Math.ceil(chars_to_show / 2),
|
||||||
|
tail_chars = Math.floor(chars_to_show / 2);
|
||||||
|
|
||||||
|
return (
|
||||||
|
str.substr(0, front_chars) + separator + str.substr(str.length - tail_chars)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to search an element in an array.
|
* Function to search an element in an array.
|
||||||
*
|
*
|
||||||
@ -620,7 +637,7 @@ function module_changed_by_multiple_modules(event, id_module, selected) {
|
|||||||
s = js_html_entity_decode(val);
|
s = js_html_entity_decode(val);
|
||||||
$("#agents").append(
|
$("#agents").append(
|
||||||
$("<option></option>")
|
$("<option></option>")
|
||||||
.html(s)
|
.html(truncate_string(s, 30, "..."))
|
||||||
.attr({ value: i, title: s })
|
.attr({ value: i, title: s })
|
||||||
);
|
);
|
||||||
$("#agents").fadeIn("normal");
|
$("#agents").fadeIn("normal");
|
||||||
|
@ -365,15 +365,6 @@ if (is_ajax()) {
|
|||||||
'AW'
|
'AW'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($truncate_agent_names === true) {
|
|
||||||
$names = array_map(
|
|
||||||
function ($name) {
|
|
||||||
return ui_print_truncate_text($name, 30);
|
|
||||||
},
|
|
||||||
$names
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo json_encode($names);
|
echo json_encode($names);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user