Removed deprecated event.

This commit is contained in:
SamTV12345 2023-08-08 18:00:19 +02:00
parent 219bf8295c
commit d1fd315c86
7 changed files with 14 additions and 14 deletions

View file

@ -164,7 +164,7 @@
$(window).resize(adjust);
// Allow for manual triggering if needed.
$ta.bind('autosize', adjust);
$ta.on('autosize', adjust);
// Call adjust in case the textarea already contains text.
adjust();

View file

@ -40,7 +40,7 @@ $(document).ready(() => {
socket.emit('saveSettings', $('.settings').val());
} else {
alert('Invalid JSON');
$('.settings').focus();
$('.settings').trigger('focus');
}
});
@ -62,7 +62,7 @@ const isJSONClean = (data) => {
// this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}'
cleanSettings = cleanSettings.replace(',]', ']').replace(',}', '}');
try {
return typeof jQuery.parseJSON(cleanSettings) === 'object';
return typeof JSON.parseJSON(cleanSettings) === 'object';
} catch (e) {
return false; // the JSON failed to be parsed
}

View file

@ -227,7 +227,7 @@ exports.chat = (() => {
if ((evt.altKey === true && evt.which === 67) || evt.which === 27) {
// If we're in chat already..
$(':focus').trigger('blur'); // required to do not try to remove!
padeditor.ace.focus(); // Sends focus back to pad
padeditor.ace.trigger('focus'); // Sends focus back to pad
evt.preventDefault();
return false;
}

View file

@ -410,7 +410,7 @@ const pad = {
const postAceInit = () => {
padeditbar.init();
setTimeout(() => {
padeditor.ace.focus();
padeditor.ace.trigger('focus');
}, 0);
$('#options-stickychat').on('click', () => { chat.stickToScreen(); });
// if we have a cookie for always showing chat then show it

View file

@ -201,7 +201,7 @@ exports.padeditbar = new class {
if (this.isEnabled() && this.commands[cmd]) {
this.commands[cmd](cmd, padeditor.ace, item);
}
if (padeditor.ace) padeditor.ace.focus();
if (padeditor.ace) padeditor.ace.trigger('focus');
}
// cb is deprecated (this function is synchronous so a callback is unnecessary).
@ -312,7 +312,7 @@ exports.padeditbar = new class {
// Timeslider probably..
$('#editorcontainerbox').trigger('focus'); // Focus back onto the pad
} else {
padeditor.ace.focus(); // Sends focus back to pad
padeditor.ace.trigger('focus'); // Sends focus back to pad
// The above focus doesn't always work in FF, you have to hit enter afterwards
evt.preventDefault();
}

View file

@ -33,7 +33,7 @@ $._farbtastic = function (container, options) {
fb.linkTo = function (callback) {
// Unbind previous nodes
if (typeof fb.callback == 'object') {
$(fb.callback).unbind('keyup', fb.updateValue);
$(fb.callback).off('keyup').on('keyup').on('keyup', fb.updateValue);
}
// Reset color
@ -45,7 +45,7 @@ $._farbtastic = function (container, options) {
}
else if (typeof callback == 'object' || typeof callback == 'string') {
fb.callback = $(callback);
fb.callback.bind('keyup', fb.updateValue);
fb.callback.on('keyup', fb.updateValue);
if (fb.callback[0].value) {
fb.setColor(fb.callback[0].value);
}
@ -388,7 +388,7 @@ $._farbtastic = function (container, options) {
fb.mousedown = function (event) {
// Capture mouse
if (!$._farbtastic.dragging) {
$(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
$(document).on('mousemove', fb.mousemove).on('mouseup', fb.mouseup);
$._farbtastic.dragging = true;
}
@ -429,8 +429,8 @@ $._farbtastic = function (container, options) {
*/
fb.mouseup = function () {
// Uncapture mouse
$(document).unbind('mousemove', fb.mousemove);
$(document).unbind('mouseup', fb.mouseup);
$(document).off('mousemove').on('mousemove',fb.mousemove);
$(document).off('mouseup').on('mouseup', fb.mouseup);
$._farbtastic.dragging = false;
}
@ -519,7 +519,7 @@ $._farbtastic = function (container, options) {
fb.initWidget();
// Install mousedown handler (the others are set on the document on-demand)
$('canvas.farbtastic-overlay', container).mousedown(fb.mousedown);
$('canvas.farbtastic-overlay', container).on('mousedown',fb.mousedown);
// Set linked elements/callback
if (options.callback) {

View file

@ -123,7 +123,7 @@
$dropdown.find('.list').css('max-height', $maxListHeight + 'px');
} else {
$dropdown.focus();
$dropdown.trigger('focus');
}
});