-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
127 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "contrib/adminer-theme"] | ||
path = contrib/adminer-theme | ||
url = https://github.com/pematon/adminer-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule adminer-theme
added at
087ef8
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
/** | ||
* Show the history of the latest selected tables. Cookies based. | ||
* Set the js variable history_length to define the history length. | ||
* Works only with current browsers. | ||
* @link http://www.adminer.org/plugins/#use | ||
* @author Ale Rimoldi, http://www.ideale.ch/ | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) | ||
*/ | ||
class AdminerTablesHistory { | ||
|
||
function tablesPrint($tables) { | ||
?> | ||
<script type="text/javascript"> | ||
|
||
history_length = 5; | ||
|
||
function setCookie(c_name, value, exdays) { | ||
var exdate = new Date(); | ||
exdate.setDate(exdate.getDate() + exdays); | ||
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); | ||
document.cookie = c_name + "=" + c_value; | ||
} | ||
|
||
function getCookie(c_name) { | ||
var i, x, y, ARRcookies = document.cookie.split(";"); | ||
for (i = 0; i < ARRcookies.length; i++) { | ||
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); | ||
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); | ||
x = x.replace(/^\s+|\s+$/g, ""); | ||
if (x == c_name) { | ||
return unescape(y); | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
function addToHistory(table) { | ||
// alert(table) | ||
var history_array = []; | ||
var history_cookie = getCookie('adminer_tables_history'); | ||
if (history_cookie != '') { | ||
history_array = JSON && JSON.parse(history_cookie) | ||
} | ||
if (history_array.indexOf(table) == -1) { | ||
if (history_array.length >= history_length) { | ||
history_array.splice(0, 1); | ||
} | ||
history_array.push(table) | ||
setCookie('adminer_tables_history', JSON.stringify(history_array), 10) | ||
} | ||
} | ||
|
||
// $(document).ready "equivalent" without jQuery. should work with current browsers | ||
document.addEventListener('DOMContentLoaded',function(){ | ||
// alert('chuila'); | ||
var tables = document.getElementById('tables').getElementsByTagName('a'); | ||
for (var i = 0; i < tables.length; i = i + 2) { | ||
var a = tables[i + 1]; | ||
var text = a.innerText || a.textContent; | ||
a.setAttribute('onclick', 'addToHistory("'+text+'")'); | ||
var a = tables[i]; | ||
a.setAttribute('onclick', 'addToHistory("'+text+'")'); | ||
} | ||
}) | ||
</script> | ||
<?php if (array_key_exists('adminer_tables_history', $_COOKIE)) : ?> | ||
<p onmouseover="menuOver(this, event);" onmouseout="menuOut(this);" style="white-space:nowrap;overflow:auto;text-overflow:ellipsis;"><?php | ||
// print_r($_COOKIE['adminer_tables_history']); | ||
foreach (array_reverse(json_decode($_COOKIE['adminer_tables_history'])) as $table) { | ||
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> "; | ||
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br>\n"; | ||
} | ||
?></p> | ||
<?php endif; ?> | ||
<?php | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
class AdminerFloatThead { | ||
|
||
private $pathToJquery; | ||
private $pathToFloatThead; | ||
|
||
/** | ||
* @param string $pathToJquery Path to jquery js library. Can be url, filesystem relative path related to the adminer directory or null (if jquery is provided by another plugin). | ||
* @param string $pathToFloatThead Path to floatThead js library. Can be url or filesystem relative path related to the adminer directory. | ||
*/ | ||
public function __construct($pathToJquery='https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js', | ||
$pathToFloatThead='https://cdnjs.cloudflare.com/ajax/libs/floatthead/2.0.3/jquery.floatThead.min.js') { | ||
$this->pathToJquery = $pathToJquery; | ||
$this->pathToFloatThead = $pathToFloatThead; | ||
} | ||
|
||
public function head() { | ||
if ($this->pathToJquery) { | ||
echo '<script src="'.h($this->pathToJquery).'"></script>'; | ||
} | ||
echo '<script src="'.h($this->pathToFloatThead).'"></script>'; | ||
echo '<script>$(document).ready(function() { $(\'#content table\').first().floatThead(); });</script>'; | ||
echo '<style type="text/css">.floatThead-container { overflow: visible !important; }</style>'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.