Change '...' to horizontal ellipsis character
This commit is contained in:
parent
da76e6b9b8
commit
b2606cda0e
|
@ -641,7 +641,7 @@ class Adminer {
|
|||
$history[$_GET["db"]] = array();
|
||||
}
|
||||
if (strlen($query) > 1e6) {
|
||||
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
|
||||
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n…"; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
|
||||
}
|
||||
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
|
||||
$sql_id = "sql-" . count($history[$_GET["db"]]);
|
||||
|
|
|
@ -815,7 +815,7 @@ function shorten_utf8($string, $length = 80, $suffix = "") {
|
|||
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
|
||||
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
|
||||
}
|
||||
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
|
||||
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>…</i>");
|
||||
}
|
||||
|
||||
/** Format decimal number
|
||||
|
@ -1476,7 +1476,7 @@ function edit_form($TABLE, $fields, $row, $update) {
|
|||
? lang('Save and continue edit')
|
||||
: lang('Save and insert next')
|
||||
) . "' title='Ctrl+Shift+Enter'>\n";
|
||||
echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "...', this); };") : "");
|
||||
echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "…', this); };") : "");
|
||||
}
|
||||
}
|
||||
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'>" . confirm() . "\n"
|
||||
|
|
|
@ -440,7 +440,7 @@ if (!$columns && support("table")) {
|
|||
$h_value = h($value !== null ? $value : $row[$key]);
|
||||
echo "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
|
||||
} else {
|
||||
$long = strpos($val, "<i>...</i>");
|
||||
$long = strpos($val, "<i>…</i>");
|
||||
echo "<td id='$id' data-text='" . ($long ? 2 : ($text ? 1 : 0)) . "'"
|
||||
. ($editable ? "" : " data-warning='" . h(lang('Use edit link to modify this value.')) . "'")
|
||||
. ">$val</td>"
|
||||
|
@ -484,7 +484,7 @@ if (!$columns && support("table")) {
|
|||
if ($pagination) {
|
||||
echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit
|
||||
? '<p><a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
|
||||
. script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "")
|
||||
. script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "…');", "")
|
||||
: ''
|
||||
);
|
||||
echo "\n";
|
||||
|
@ -503,12 +503,12 @@ if (!$columns && support("table")) {
|
|||
if ($jush != "simpledb") {
|
||||
echo "<legend><a href='" . h(remove_from_uri("page")) . "'>" . lang('Page') . "</a></legend>";
|
||||
echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };");
|
||||
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
|
||||
echo pagination(0, $page) . ($page > 5 ? " …" : "");
|
||||
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
|
||||
echo pagination($i, $page);
|
||||
}
|
||||
if ($max_page > 0) {
|
||||
echo ($page + 5 < $max_page ? " ..." : "");
|
||||
echo ($page + 5 < $max_page ? " …" : "");
|
||||
echo ($exact_count && $found_rows !== false
|
||||
? pagination($max_page, $page)
|
||||
: " <a href='" . h(remove_from_uri("page") . "&page=last") . "' title='~$max_page'>" . lang('last') . "</a>"
|
||||
|
@ -516,9 +516,9 @@ if (!$columns && support("table")) {
|
|||
}
|
||||
} else {
|
||||
echo "<legend>" . lang('Page') . "</legend>";
|
||||
echo pagination(0, $page) . ($page > 1 ? " ..." : "");
|
||||
echo pagination(0, $page) . ($page > 1 ? " …" : "");
|
||||
echo ($page ? pagination($page, $page) : "");
|
||||
echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " ..." : "") : "");
|
||||
echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " …" : "") : "");
|
||||
}
|
||||
echo "</fieldset>\n";
|
||||
}
|
||||
|
|
|
@ -40,14 +40,16 @@ tinyMCE.init({
|
|||
|
||||
function selectVal(&$val, $link, $field, $original) {
|
||||
if (preg_match("~_html~", $field["field"]) && $val != '') {
|
||||
$shortened = (substr($val, -10) == "<i>...</i>");
|
||||
$ellipsis = "<i>…</i>";
|
||||
$length = strlen($ellipsis);
|
||||
$shortened = (substr($val, -$length) == $ellipsis);
|
||||
if ($shortened) {
|
||||
$val = substr($val, 0, -10);
|
||||
$val = substr($val, 0, -$length);
|
||||
}
|
||||
//! shorten with regard to HTML tags - http://php.vrana.cz/zkraceni-textu-s-xhtml-znackami.php
|
||||
$val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); // remove ending incomplete tag (text can be shortened)
|
||||
if ($shortened) {
|
||||
$val .= "<i>...</i>";
|
||||
$val .= $ellipsis;
|
||||
}
|
||||
if (class_exists('DOMDocument')) { // close all opened tags
|
||||
$dom = new DOMDocument;
|
||||
|
|
|
@ -29,14 +29,16 @@ class AdminerWymeditor {
|
|||
function selectVal(&$val, $link, $field, $original) {
|
||||
// copied from tinymce.php
|
||||
if (preg_match("~_html~", $field["field"]) && $val != '') {
|
||||
$shortened = (substr($val, -10) == "<i>...</i>");
|
||||
$ellipsis = "<i>…</i>";
|
||||
$length = strlen($ellipsis);
|
||||
$shortened = (substr($val, -$length) == $ellipsis);
|
||||
if ($shortened) {
|
||||
$val = substr($val, 0, -10);
|
||||
$val = substr($val, 0, -$length);
|
||||
}
|
||||
//! shorten with regard to HTML tags - http://php.vrana.cz/zkraceni-textu-s-xhtml-znackami.php
|
||||
$val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); // remove ending incomplete tag (text can be shortened)
|
||||
if ($shortened) {
|
||||
$val .= "<i>...</i>";
|
||||
$val .= $ellipsis;
|
||||
}
|
||||
if (class_exists('DOMDocument')) { // close all opened tags
|
||||
$dom = new DOMDocument;
|
||||
|
|
Loading…
Reference in a new issue