Commit c1a735b1 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

ajax: Upgrade to jquery-ui 1.10.1

This is the version currently in Debian.

* wrap/python/ajax/trans.html: Adjust to
the newer version.
parent d8b3062b
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<link rel="icon" href="http://spot.lrde.epita.fr/img/favicon.ico" type="image/x-icon"> <link rel="icon" href="http://spot.lrde.epita.fr/img/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://spot.lrde.epita.fr/img/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="http://spot.lrde.epita.fr/img/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.tipTip.minified.js"></script> <script type="text/javascript" src="js/jquery.tipTip.minified.js"></script>
<script type="text/javascript" src="js/jquery.ba-bbq.min.js"></script> <script type="text/javascript" src="js/jquery.ba-bbq.min.js"></script>
<script type="text/javascript" src="js/jquery.ba-dotimeout.min.js"></script> <script type="text/javascript" src="js/jquery.ba-dotimeout.min.js"></script>
...@@ -165,9 +165,9 @@ ...@@ -165,9 +165,9 @@
$.spotvars.internalchange = false; $.spotvars.internalchange = false;
var o = $('input[name="o"]').val(); var o = $('input[name="o"]').val();
hideOrShowPanels(o, duration); hideOrShowPanels(o, duration);
$("#output-tabs").tabs("select", "#tabs-o" + o); $("#output-tabs").tabs('option', 'active', $("#tabs-o" + o).index());
var t = $('input[name="t"]').val(); var t = $('input[name="t"]').val();
$("#translator-tabs").tabs('select', '#tabs-t' + t); $("#translator-tabs").tabs('option', 'active', $('#tabs-t' + t).index());
updateResults(); updateResults();
} }
...@@ -241,10 +241,14 @@ ...@@ -241,10 +241,14 @@
// it has been %-decoded by firefox, which // it has been %-decoded by firefox, which
// cause problems when formulae include '&'. // cause problems when formulae include '&'.
var fragment = location.href.replace(/^[^#]*#?(.*)$/, '$1'); var fragment = location.href.replace(/^[^#]*#?(.*)$/, '$1');
console.log("fragment: " + fragment);
$("#results-body") $("#results-body")
.load("/cgi-bin/spotcgi.py", .load("/cgi-bin/spotcgi.py",
fragment, fragment,
function(response, status, xhr) { function(response, status, xhr) {
console.log(response);
console.log(status);
console.log(xhr);
$.doTimeout('res-update'); $.doTimeout('res-update');
if (status == "error") { if (status == "error") {
var msg = "Sorry but there was an error: "; var msg = "Sorry but there was an error: ";
...@@ -280,6 +284,10 @@ ...@@ -280,6 +284,10 @@
} }
}); });
$('.collapsible .head').click(function(e) { $('.collapsible .head').click(function(e) {
var target = $(e.target);
if (!e.target.classList.contains('head')) {
return true;
}
if (e.ctrlKey) { if (e.ctrlKey) {
if ($(this).attr('id') != 'ltl-head') if ($(this).attr('id') != 'ltl-head')
$(this).parent().hide('fast').addClass("killed"); $(this).parent().hide('fast').addClass("killed");
...@@ -288,16 +296,16 @@ ...@@ -288,16 +296,16 @@
} }
return false; return false;
}); });
$("#output-tabs").bind("tabsselect", function(event, ui) { $("#output-tabs").on("tabsactivate", function(event, ui) {
var v = ui.panel.id[6]; // 'tabs-om' => 'm'. var v = ui.newPanel[0].id[6]; // 'tabs-om' => 'm'.
$('input[name="o"]').val(v) $('input[name="o"]').val(v)
if (!autoUpdate()) if (!autoUpdate())
hideOrShowPanels(v, 'fast') hideOrShowPanels(v, 'fast')
return true; return true;
}); });
$('#output-tabs').tabs('select', '#tabs-oa'); $('#output-tabs').tabs('option', 'active', $('#tabs-oa').index());
$('#translator-tabs').bind("tabsselect", function(event, ui) { $('#translator-tabs').on("tabsactivate", function(event, ui) {
$('input[name="t"]').val(ui.panel.id.substring(6)); $('input[name="t"]').val(ui.newPanel[0].id.substring(6));
autoUpdate(); autoUpdate();
return true; return true;
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment