From b23dcfb456da7d954243a9836ec30abf700178a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 9 Jun 2016 14:33:48 +0200 Subject: [PATCH] Remove no longer used bigints javascript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- js/big_ints.js | 67 ------------------------------------------------- tbl_change.php | 1 - tbl_replace.php | 1 - 3 files changed, 69 deletions(-) delete mode 100644 js/big_ints.js diff --git a/js/big_ints.js b/js/big_ints.js deleted file mode 100644 index f50cefb388..0000000000 --- a/js/big_ints.js +++ /dev/null @@ -1,67 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * phpMyAdmin's BigInts library - */ - -/** - * @var BigInts object to handle big integers (in string) - * as JS can handle upto 53 bits of precision only. - */ -var BigInts = { - - /** - * Compares two integer strings - * - * @param int1 the string representation of 1st integer - * @param int2 the string representation of 2nd integer - * - * @return int 0 if equal, < 0 if int1 < int2, else > 0 - */ - compare: function(int1, int2) { - // trim integers - int1 = int1.trim(); - int2 = int2.trim(); - // length of integer strings - var len1 = int1.length; - var len2 = int2.length; - // integer is -ve or not - var isNeg1 = (int1[0] === '-'); - var isNeg2 = (int2[0] === '-'); - // Sign of int1 != int2 then no actual comparison - // is needed we can return result directly - if (isNeg1 !== isNeg2) { - return (isNeg1 === true ? -1 : 1); - } - // replace - sign with 0 - int1[0] = isNeg1 ? '0' : int1[0]; - int2[0] = isNeg2 ? '0' : int2[0]; - // pad integers with 0 to make them - // equal length - int1 = BigInts.lpad(int1, len2); - int2 = BigInts.lpad(int2, len1); - // Now they are good to compare as strings - if (int1 !== int2) { - return (int1 < int2 ? -1 : 1); - } - return 0; - }, - - /** - * Adds leading zeros to a integer given a total length - * - * @param int the string representation of the integer - * @param total the total length required - * - * @return int the integer of length given with added leading - * zeros if necessary - */ - lpad: function(int, total){ - var len = int.length; - var pad = ''; - while(len < total) { - pad += '0'; - len++; - } - return (pad + int); - } -}; diff --git a/tbl_change.php b/tbl_change.php index 157b88b124..9d0caefbf7 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -80,7 +80,6 @@ $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('sql.js'); $scripts->addFile('tbl_change.js'); -$scripts->addFile('big_ints.js'); $scripts->addFile('jquery/jquery-ui-timepicker-addon.js'); $scripts->addFile('jquery/jquery.validate.js'); $scripts->addFile('jquery/additional-methods.js'); diff --git a/tbl_replace.php b/tbl_replace.php index 841978b325..b6ee7ab169 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -455,7 +455,6 @@ if (! empty($return_to_sql_query)) { } $scripts->addFile('tbl_change.js'); -$scripts->addFile('big_ints.js'); $active_page = $goto_include;