echo "<link rel=\"icon\" type=\"image/png\" href=\"images/themes/{$conf['theme']}/Introduction.png\" />\n";
echo "<script type=\"text/javascript\" src=\"libraries/js/jquery.js\"></script>";
echo "<script type=\"text/javascript\">// <!-- \n";
- echo "$(document).ready(function() { \n";
+ echo "$(function() { \n";
echo " if (window.parent.frames.length > 1)\n";
echo " $('#csstheme', window.parent.frames[0].document).attr('href','themes/{$conf['theme']}/global.css');\n";
echo "}); // --></script>\n";
$history_window_id = htmlentities('history:'.$_REQUEST['server']);
echo "<script type=\"text/javascript\">
- $('#toplink_sql').click(function() {
+ $('#toplink_sql').on('click', function() {
window.open($(this).attr('href'),'{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
- $('#toplink_history').click(function() {
+ $('#toplink_history').on('click', function() {
window.open($(this).attr('href'),'{$history_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
- $('#toplink_find').click(function() {
+ $('#toplink_find').on('click', function() {
window.open($(this).attr('href'),'{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus();
return false;
});
if (isset($_SESSION['sharedUsername'])) {
printf("
- $('#toplink_logout').click(function() {
+ $('#toplink_logout').on('click', function() {
return confirm('%s');
});", str_replace("'", "\'", $lang['strconfdropcred']));
}
function triggerAc(ac) {
if (ac) {
jQuery.ppa.attrs
- .bind('keyup.ac_action', autocomplete)
- .bind('focus.ac_action', autocomplete)
- .bind('keypress.ac_action', move)
+ .on('keyup.ac_action', autocomplete)
+ .on('focus.ac_action', autocomplete)
+ .on('keydown.ac_action', move)
.addClass('ac_field');
}
else {
jQuery.ppa.attrs
.removeClass('ac_field')
- .unbind('.ac_action');
+ .off('.ac_action');
}
}
show();
jQuery.ppa.numrow = find('tr').length;
}
+
}
});
}
/* if pressing enter, fire a click on the selected line */
if (event.keyCode == 13) {
if (jQuery.ppa.i > 0) {
- jQuery.ppa.fklist.find('tr').eq(jQuery.ppa.i).click();
+ jQuery.ppa.fklist.find('tr').eq(jQuery.ppa.i).trigger('click');
}
return false;
}
return true;
}
-/* bind actions on values lines: hover for style change, click for select */
-with(jQuery('tr.acline')) {
- live('mouseover', function () {
- selectVal(jQuery('table.ac_values tr').index(this));
- });
-
- live('click', function () {
- var a = jQuery(this).find('td > a.fkval');
+$(document).on('mouseover', 'tr.acline', function() {
+ selectVal(jQuery('table.ac_values tr').index(this));
+});
- for (i=0; i < a.length; i++) {
- jQuery('input[name="values['+ a[i].name +']"]').val(jQuery(a[i]).text());
- }
- hideAc();
- });
-}
+$(document).on('click', 'tr.acline', function() {
+ var a = jQuery(this).find('td > a.fkval');
+ for (i=0; i < a.length; i++) {
+ jQuery('input[name="values['+ a[i].name +']"]').val(jQuery(a[i]).text());
+ }
+ hideAc();
+});
-jQuery('#fkprev').live('click', function () {
+$(document).on('click', '#fkprev', function () {
jQuery.ppa.o -= 11;
/* get the field that is the previous html elt from the #fklist
* and trigger its focus to refresh the list AND actually
jQuery('#fklist').prev().focus();
});
-jQuery('#fknext').live('click', function () {
+$(document).on('click', '#fknext', function () {
jQuery.ppa.o += 11;
/* get the field that is the previous html elt from the #fklist
* and trigger its focus to refresh the list AND actually
jQuery('#fklist').prev().focus();
});
-jQuery(document).ready(function () {
+jQuery(function () {
/* register some global value in the ppa namespace */
jQuery.ppa = {
fklist: jQuery('#fklist'),
};
/* close the list when clicking outside of it */
- jQuery.ppa.fkbg.click(function (e) {
+ jQuery.ppa.fkbg.on('click', function (e) {
hideAc();
});
/* do not submit the form when selecting a value by pressing enter */
jQuery.ppa.attrs
- .keydown(function (e) {
+ .on('keydown', function (e) {
if (e.keyCode == 13 && jQuery.ppa.fklist[0].style.display == 'block')
return false;
});
/* enable/disable auto-complete according to the checkbox */
triggerAc(
- jQuery('#no_ac').click(function () {
+ jQuery('#no_ac').on('click', function () {
triggerAc(this.checked);
})[0].checked
);
-$(document).ready(function() {
+$(function() {
var timeid = query = null;
var controlLink = $('#control');
}
}
- controlLink.toggle(
- function() {
+ controlLink.on('click', function() {
+ if (!timeid) {
$(errmsg).hide();
timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh);
controlLink.html('<img src="'+ Database.str_stop.icon +'" alt="" /> '
+ Database.str_stop.text + ' '
);
- },
- function() {
+ } else {
$(errmsg).hide();
$(loading).hide();
window.clearInterval(timeid);
+ timeid = null;
if (query) query.abort();
controlLink.html('<img src="'+ Database.str_start.icon +'" alt="" /> '
+ Database.str_start.text
);
}
- );
+ return false; /* disable event propagation */
+ });
/* preload images */
$('#control img').hide()
.show();
/* start refreshing */
- controlLink.click();
+ controlLink.trigger('click');
});
-$(document).ready(function() {
+$(function() {
/* init some needed tags and values */
root: $('#root')
};
- $("a.fk").live('click', function (event) {
+ $("a.fk").on('click', function (event) {
/* make the cursor being a waiting cursor */
$('body').css('cursor','wait');
return false; // do not refresh the page
});
- $(".fk_delete").live('click', function (event) {
+ $(document).on('click', '.fk_delete', function (event) {
with($(this).closest('div')) {
data('ref').closest('tr').find('a.'+data('refclass')).closest('div').removeClass('highlight');
remove();