]> git.joonet.de Git - adminer.git/commitdiff
Change '...' to horizontal ellipsis character
authorPeter Knut <peter@ajtak.sk>
Tue, 18 Dec 2018 13:45:37 +0000 (14:45 +0100)
committerJakub Vrána <jakub@vrana.cz>
Tue, 18 Dec 2018 13:45:37 +0000 (14:45 +0100)
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php
plugins/tinymce.php
plugins/wymeditor.php

index 992315dbf6f0135f506b4c7e1eb7415e5519f309..c10c62fc897c073382c2e3064a3e0e3b31e5afa0 100644 (file)
@@ -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"]]);
index 1cfdeaac26e40dbaa48757be484726172ba35b6d..02fa0e523487b69ed9516030e2565c6cd7212ab9 100644 (file)
@@ -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"
index a87bc85ed1348f443da59b68713c7c4ae04d29ab..403e04539a6d7cef062ca20516d92be66506b622 100644 (file)
@@ -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";
                                }
index 51f1216e5959c00d0cdae7e114e2ec1bed6e502e..44ee37f5ed2b785a4b848b5dc8dd8313c43acb7b 100644 (file)
@@ -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;
index fcf06722f162aff94ac51ec1d3ccb475bb670a02..ca452bcb098574d88010ae39b9599f2409790793 100644 (file)
@@ -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;