Permalink
Browse files

Download externals from HTTPS

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@940 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 6669450 commit b3fc4c0ea298c7c2e025326184f868826a53a5c7 jakubvrana committed Jul 29, 2009
Showing with 32 additions and 16 deletions.
  1. +4 −11 adminer/editing.js
  2. +25 −3 adminer/functions.js
  3. +1 −0 changes.txt
  4. +1 −1 compile.php
  5. +1 −0 released.js
  6. +0 −1 todo.txt
View
@@ -1,19 +1,12 @@
// Adminer specific functions
function body_load() {
- var script = document.createElement('script');
- script.src = '../externals/jush/jush.js';
- script.onload = function () {
- jush.style('../externals/jush/jush.css');
+ var jush_root = '../externals/jush/';
+ load_script(jush_root + 'jush.js', function () {
+ jush.style(jush_root + 'jush.css');
jush.highlight_tag('pre');
jush.highlight_tag('code');
- }
- script.onreadystatechange = function () {
- if (script.readyState == 'loaded' || script.readyState == 'complete') {
- script.onload();
- }
- }
- document.body.appendChild(script);
+ });
}
View
@@ -6,13 +6,35 @@ function toggle(id) {
return true;
}
-function verify_version(version) {
- document.cookie = 'adminer_version=0';
+function load_script(src, onload) {
var script = document.createElement('script');
- script.src = 'http://www.adminer.org/version.php?version=' + version;
+ script.src = src;
+ script.onload = onload;
+ script.onreadystatechange = function () {
+ if (script.readyState == 'loaded' || script.readyState == 'complete') {
+ onload();
+ }
+ }
document.body.appendChild(script);
}
+function verify_version(version) {
+ document.cookie = 'adminer_version=0';
+ load_script('https://adminer.svn.sourceforge.net/svnroot/adminer/released.js', function () {
+ document.cookie = 'adminer_version=' + released;
+ var re = /^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)/;
+ var v1 = re.exec(version);
+ var v2 = re.exec(released);
+ if (v1 && v2 && (+v1[1] < +v2[1]
+ || (v1[1] == v2[1] && (+v1[2] < +v2[2]
+ || (v1[2] == v2[2] && (+v1[3] < +v2[3]
+ || (v1[3] == v2[3] && v1[4]
+ ))))))) {
+ document.getElementById('version').innerHTML = released;
+ }
+ });
+}
+
function form_check(el, name) {
var elems = el.form.elements;
for (var i=0; i < elems.length; i++) {
View
@@ -15,6 +15,7 @@ Clear history (thanks to paranoiq)
Remove Delete button from Edit page - use mass operation for it
Faster multiple update, clone and delete
Faster table list in navigation
+Download version checker and syntax highlighting from HTTPS
Use HTML Strict instead of XHTML
Remove function minification for performance and customization
Fix grant ALL PRIVILEGES with GRANT OPTION
View
@@ -180,7 +180,7 @@ function compile_file($match) {
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&amp;version=' . $VERSION;
$file = preg_replace('~\\.\\./adminer/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
$file = preg_replace('~\\.\\./adminer/((plus|cross|up|down|arrow)\\.gif)~', '" . ' . $replace, $file);
-$file = str_replace("../externals/jush/", "http://jush.sourceforge.net/", $file);
+$file = str_replace("../externals/jush/", "https://jush.svn.sourceforge.net/svnroot/jush/trunk/", $file); // mixed-content warning if Adminer runs on HTTPS and external files on HTTP
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file);
View
@@ -0,0 +1 @@
+var released = '1.11.1';
View
@@ -13,7 +13,6 @@ Edit default values directly in table creation
Offer enum and set items in search - whisperer
Use event $intervals + microseconds in relative date functions
Table status cache - SHOW TABLE STATUS is slow with big InnoDB tables
-Download external files (version checker and JUSH) from trusted HTTPS if Adminer runs in HTTPS (mixed-content warning)
? Ability to select external style - list downloaded by JavaScript
? Column and table names auto-completition in SQL textarea
? Save uploaded files after error to session variable instead of hidden field

0 comments on commit b3fc4c0

Please sign in to comment.