| Server IP : 81.2.241.106 / Your IP : 216.73.216.165 Web Server : Apache/2.4.67 (Debian) System : Linux tranq-f.bakta.org 5.10.0-45-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : lisky ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/lisky/wp-content/plugins/weglot/app/javascripts/ |
Upload File : |
jQuery(document).ready(function ($) {
$('#update-nav-menu').bind('click', function (e) {
if (e.target && e.target.className && -1 != e.target.className.indexOf('item-edit')) {
$("input[value='#weglot_switcher'][type=text]").parents('.menu-item-settings').each(function () {
const id = $(this).attr('id').substring(19);
$(this).children('p:not( .field-move )').remove(); // remove default fields we don't need
$(this).append($('<input>').attr({ // phpcs:ignore
type: 'hidden',
id: 'edit-menu-item-title-' + id,
name: 'menu-item-title[' + id + ']',
value: weglot_data.title
}));
$(this).append($("<input>").attr({ // phpcs:ignore
type: "hidden",
id: "edit-menu-item-url-" + id,
name: "menu-item-url[" + id + "]",
value: "#weglot_switcher"
}));
$(this).append($('<input>').attr({ // phpcs:ignore
type: 'hidden',
id: 'edit-menu-item-weglot-detect-' + id,
name: 'menu-item-weglot-detect[' + id + ']',
value: 1
}));
$.each(weglot_data.list_options, (key, option) => {
const paragraph = $("<p>").attr("class", "description");
const label = $("<label>")
.attr("for", `edit-menu-item-${option.key}-${id}`)
.text(` ${option.title}`);
$(this).prepend(paragraph); // phpcs:ignore
paragraph.append(label); // phpcs:ignore
const checkbox = $("<input>").attr({
type: "checkbox",
id: `edit-menu-item-${
option.key
}-${id}`,
name: `menu-item-weglot-${
option.key
}[${id}]`,
value: 1
});
if (weglot_data.options && weglot_data.options[`menu-item-${id}`] && weglot_data.options[`menu-item-${id}`][ option.key ] === 1 ){
checkbox.prop("checked", true);
}
label.prepend(checkbox); // phpcs:ignore
})
});
}
});
});