. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 94.23.64.18 / Your IP :
216.73.216.185 [
Web Server : Apache System : Linux webm005.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : villadal ( 6036) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/villadal/www/old/wp-content/plugins/sitepress-multilingual-cms/res/js/ |
Upload File : |
/*globals jQuery, ajaxurl */
jQuery(document).ready(function () {
'use strict';
var otgsNotice = jQuery('.otgs-notice');
var otgsCollapseText = '.otgs-notice-collapse-text';
var otgsCollapsedText = '.otgs-notice-collapsed-text';
jQuery( otgsCollapsedText ).hide();
var preventDefaultEvent = function (event) {
if (typeof(event.preventDefault) !== 'undefined') {
event.preventDefault();
} else {
event.returnValue = false;
}
};
var noticeAction = function (noticeBox, action) {
if (noticeBox) {
var ajaxAction = 'otgs-' + action + '-notice';
var noticeId = _.escape( noticeBox.data('id') );
var noticeGroup = noticeBox.data('group');
var nonce = noticeBox.data('nonce');
jQuery.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: ajaxAction,
'id': noticeId,
'group': noticeGroup,
nonce: nonce
},
dataType: 'json'
});
}
};
var toggleNotice = function ( contentToMinimize, contentToMaximize ) {
contentToMinimize.toggle();
contentToMaximize.toggle();
};
otgsNotice.on('click', '.notice-dismiss, a.otgs-dismiss-link', function (event) {
preventDefaultEvent(event);
var noticeBox = jQuery(this).closest('.is-dismissible');
noticeAction(noticeBox, 'dismiss');
});
otgsNotice.on('click', '.notice-hide, a.otgs-hide-link', function (event) {
preventDefaultEvent(event);
var noticeBox = jQuery(this).closest('.is-dismissible');
noticeAction(noticeBox, 'hide');
});
otgsNotice.on('click', '.otgs-notice-collapse-hide', function (event) {
preventDefaultEvent(event);
jQuery( this ).toggle();
var noticeCollapseText = jQuery(this).siblings( otgsCollapseText );
var noticeCollapsedText = jQuery(this).siblings( otgsCollapsedText );
toggleNotice( noticeCollapseText, noticeCollapsedText );
});
otgsNotice.on('click', '.otgs-notice-collapse-show', function (event) {
preventDefaultEvent(event);
jQuery(this).closest( otgsCollapsedText ).siblings( '.otgs-notice-collapse-hide' ).toggle();
var noticeCollapseCollapseText = jQuery(this).closest( otgsCollapsedText ).siblings( otgsCollapseText );
var noticeCollapseCollapsedText = jQuery(this).closest( otgsCollapsedText );
toggleNotice( noticeCollapseCollapseText, noticeCollapseCollapsedText );
});
otgsNotice.on('click', '.notice-action.notice-action-link', function (event) {
var groupToDismiss = jQuery(this).data('dismiss-group');
var nonce = jQuery(this).data('nonce');
var jsCallback = jQuery(this).data('js-callback');
if (groupToDismiss) {
if (jsCallback && typeof window[jsCallback] === 'function') {
window[jsCallback](jQuery(this), function () {
dismissGroup(groupToDismiss, nonce);
});
} else {
dismissGroup(groupToDismiss, nonce);
}
}
});
var dismissGroup = function (groupToDismiss, nonce) {
jQuery.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'otgs-dismiss-group',
group: groupToDismiss,
nonce: nonce
},
dataType: 'json',
complete: function () {
location.reload();
}
});
};
});