| 1 |
// JS codes by WP Adminify |
| 2 |
|
| 3 |
(function($) { |
| 4 |
'use strict'; |
| 5 |
|
| 6 |
// adminbar sticky class add/remove |
| 7 |
$(window).scroll(function() { |
| 8 |
var scroll = $(window).scrollTop(); |
| 9 |
if (scroll >= 1) { |
| 10 |
$(".adminify-top_bar").addClass("is-sticky"); |
| 11 |
} else { |
| 12 |
$(".adminify-top_bar").removeClass("is-sticky"); |
| 13 |
} |
| 14 |
}); |
| 15 |
|
| 16 |
// wp adminify adminbar menu displaying issue fixed START |
| 17 |
if (!$("#wp-admin-bar-top-secondary").length) { |
| 18 |
$("#wp-toolbar.quicklinks").append(` <ul id = "wp-adminify-default-top-secondary" > </ul> `) |
| 19 |
} |
| 20 |
// wp adminify adminbar menu displaying issue fixed END |
| 21 |
|
| 22 |
// Icon Class replaced when adminify_ui is disabled |
| 23 |
$("body:not(.adminify-ui) div[class*=' dashicons-adminify']").each( |
| 24 |
function() { |
| 25 |
var el_class = $(this).attr('class').replace("dashicons-before dashicons-adminify-", "adminify-menu-icon "); |
| 26 |
$(this).attr('class', el_class); |
| 27 |
} |
| 28 |
); |
| 29 |
|
| 30 |
// scroll to top class added to body / its currently working for gravity form header |
| 31 |
window.addEventListener( |
| 32 |
'scroll', |
| 33 |
function(e) { |
| 34 |
var distanceY = window.pageYOffset || document.documentElement.scrollTop, |
| 35 |
scrollTo = 40, |
| 36 |
header = document.querySelector("body"); |
| 37 |
if (distanceY > scrollTo) { |
| 38 |
header.classList.add("adminify-scrollto-sticky"); |
| 39 |
} else { |
| 40 |
if (header.classList.contains("adminify-scrollto-sticky")) { |
| 41 |
header.classList.remove("adminify-scrollto-sticky"); |
| 42 |
} |
| 43 |
} |
| 44 |
} |
| 45 |
); |
| 46 |
|
| 47 |
// Folder div made full width and content placed to bottom |
| 48 |
if (window.matchMedia('(max-width: 500px)').matches) { |
| 49 |
setTimeout( |
| 50 |
() => { |
| 51 |
var folder_height = $(".wp-adminify--folder-app").height(); |
| 52 |
$('#wpbody-content').css('margin-top', (folder_height + 180)); |
| 53 |
}, |
| 54 |
1500 |
| 55 |
); |
| 56 |
} |
| 57 |
|
| 58 |
var adminHeight = $('.wp-adminify.adminify-top_bar').height(); |
| 59 |
$('.wp-adminify-admin-bar.position-bottom').css('padding-bottom', adminHeight * 1.25); |
| 60 |
|
| 61 |
// User Wrapper On / Off |
| 62 |
|
| 63 |
var openBtn = $(".wp-adminify--user--account"), |
| 64 |
colseBtn = $(".user-wrapper-close"), |
| 65 |
menu = $(".wp-adminify--user--wrapper"); |
| 66 |
|
| 67 |
// Open menu when click on menu button |
| 68 |
openBtn.on( |
| 69 |
"click", |
| 70 |
function(e) { |
| 71 |
menu.addClass("active"); |
| 72 |
} |
| 73 |
); |
| 74 |
|
| 75 |
// Close menu when click on Close button |
| 76 |
colseBtn.on( |
| 77 |
"click", |
| 78 |
function() { |
| 79 |
menu.removeClass("active"); |
| 80 |
} |
| 81 |
); |
| 82 |
|
| 83 |
// Close menu when click on anywhere on the document |
| 84 |
$(document).on( |
| 85 |
"click", |
| 86 |
function(e) { |
| 87 |
var target = $(e.target); |
| 88 |
if (target.is(".wp-adminify--user--wrapper *, .wp-adminify--user--wrapper, img.avatar.avatar-45.photo.is-rounded") === false) { |
| 89 |
menu.removeClass("active"); |
| 90 |
e.stopPropagation(); |
| 91 |
} |
| 92 |
} |
| 93 |
); |
| 94 |
|
| 95 |
// Widget #dashboard_right_now count style |
| 96 |
|
| 97 |
jQuery("#dashboard_right_now li a").html( |
| 98 |
function() { |
| 99 |
var text = jQuery(this).text().trim().split(" "); |
| 100 |
var first = text.shift(); |
| 101 |
return (text.length > 0 ? "<span class='counter'>" + first + "</span> " : first) + text.join(" "); |
| 102 |
} |
| 103 |
); |
| 104 |
|
| 105 |
// Accordion |
| 106 |
|
| 107 |
jQuery(".accordion .accordion-body").css("display", "none"); |
| 108 |
|
| 109 |
jQuery('body').on( |
| 110 |
'click', |
| 111 |
'.accordion-button, .accordion-opener', |
| 112 |
function(e) |
| 113 |
// jQuery(".accordion-button, .accordion-opener").on('click', function (e) |
| 114 |
{ |
| 115 |
e.preventDefault(); |
| 116 |
jQuery(this).toggleClass('show'); |
| 117 |
|
| 118 |
var jQuerythis = jQuery(this); |
| 119 |
|
| 120 |
if (jQuerythis.next().hasClass('show')) { |
| 121 |
jQuerythis.next().removeClass('show'); |
| 122 |
jQuerythis.next().slideUp(100); |
| 123 |
} else { |
| 124 |
jQuerythis.parent().parent().find('.accordion-body').removeClass('show'); |
| 125 |
jQuerythis.parent().parent().find('.accordion-body').slideUp(100); |
| 126 |
jQuerythis.prev('.accordion-title').toggleClass('show'); |
| 127 |
jQuerythis.next().toggleClass('show'); |
| 128 |
jQuerythis.next().slideToggle(100); |
| 129 |
} |
| 130 |
} |
| 131 |
); |
| 132 |
|
| 133 |
// Admin Columns Accordions |
| 134 |
|
| 135 |
$('.accordion-opener').on( |
| 136 |
'click', |
| 137 |
function(e) { |
| 138 |
e.preventDefault(); |
| 139 |
|
| 140 |
let $this = $(this); |
| 141 |
|
| 142 |
if ($this.next().hasClass('show')) { |
| 143 |
$this.next().removeClass('show'); |
| 144 |
$this.next().slideUp(100); |
| 145 |
} else { |
| 146 |
$this.parent().parent().find('.accordion-body').removeClass('show'); |
| 147 |
$this.parent().parent().find('.accordion-body').slideUp(100); |
| 148 |
$this.prev('.accordion-title').toggleClass('show'); |
| 149 |
$this.next().toggleClass('show'); |
| 150 |
$this.next().slideToggle(100); |
| 151 |
} |
| 152 |
} |
| 153 |
); |
| 154 |
|
| 155 |
$(window).on( |
| 156 |
'load', |
| 157 |
function() { |
| 158 |
|
| 159 |
// WP_Adminify.animateCSS('body.wp-adminify', 'fadeIn'); |
| 160 |
// WP_Adminify.animateCSS('.my-element', 'fadeIn').then((message) => { |
| 161 |
// // Do something after the animation |
| 162 |
// }); |
| 163 |
|
| 164 |
// Circle Menu Functions |
| 165 |
var $circle_menu = $('#circle-menu'); |
| 166 |
var direction = 'left-half'; |
| 167 |
if ("undefined" != typeof WPAdminify_QuickMenu && WPAdminify_QuickMenu.is_rtl) { |
| 168 |
direction = 'right-half'; |
| 169 |
} |
| 170 |
$(".wp-adminify-loader").delay(300).fadeOut("slow"); |
| 171 |
if ($circle_menu.length) { |
| 172 |
$circle_menu.circleMenu({ |
| 173 |
direction: direction, |
| 174 |
trigger: 'hover', |
| 175 |
delay: 200 |
| 176 |
}).fadeIn("slow").show(); |
| 177 |
} |
| 178 |
|
| 179 |
// Adminbar Loader |
| 180 |
$(".wp-adminify-topbar-loader").delay(100).fadeOut("fast"); |
| 181 |
setTimeout(function() { $('.wp-adminify.adminify-top_bar').fadeIn('fast'); }, 100); |
| 182 |
|
| 183 |
// Menu Editor Preloader |
| 184 |
setTimeout(function() { $('.wp-adminify-menu-editor-loader').css({ 'display': 'none' }); }, 700) |
| 185 |
setTimeout(function() { $('.wp-adminify--menu--editor--settings').addClass('loaded'); }, 700); |
| 186 |
|
| 187 |
} |
| 188 |
); |
| 189 |
|
| 190 |
// Google page speed origin on / off |
| 191 |
|
| 192 |
jQuery('.origin-summery-trigger button').on( |
| 193 |
'click', |
| 194 |
function() { |
| 195 |
alert('clicked!'); |
| 196 |
jQuery('.result-body').toggleClass('show-origin'); |
| 197 |
} |
| 198 |
); |
| 199 |
|
| 200 |
// Wrap content get extra margin if folder options exist |
| 201 |
jQuery('body').has('#wp-adminify--folder-app').addClass('has-folder-options'); |
| 202 |
|
| 203 |
// tippy('[data-tippy-content]'); |
| 204 |
|
| 205 |
// Admin Topbar Search |
| 206 |
function admin_top_search_hide_result() { |
| 207 |
$("#top-header-search-results").hide(); |
| 208 |
} |
| 209 |
|
| 210 |
function admin_top_search_show_result() { |
| 211 |
$("#top-header-search-results").show(); |
| 212 |
} |
| 213 |
|
| 214 |
$("#top-header-search-input").on( |
| 215 |
"input", |
| 216 |
function() { |
| 217 |
var search_val = $("#top-header-search-input").val(); |
| 218 |
admin_top_bar_search(search_val); |
| 219 |
if (!search_val.length) { |
| 220 |
admin_top_search_hide_result(); |
| 221 |
} |
| 222 |
} |
| 223 |
); |
| 224 |
|
| 225 |
var cansearch; |
| 226 |
|
| 227 |
function admin_top_bar_search(searchTerm) { |
| 228 |
|
| 229 |
// Admin Bar Search |
| 230 |
if (cansearch == false) { |
| 231 |
return; |
| 232 |
} |
| 233 |
|
| 234 |
if (searchTerm == "") { |
| 235 |
return; |
| 236 |
} |
| 237 |
|
| 238 |
// var count_rows = $('#top-header-search-results .top-header-result-table > tbody > tr').length; |
| 239 |
// console.log(count_rows); |
| 240 |
// $("#top-header-search-results").css('display','block'); |
| 241 |
|
| 242 |
$.ajax({ |
| 243 |
url: WPAdminify.ajax_url, |
| 244 |
type: "post", |
| 245 |
data: { |
| 246 |
action: "adminify_all_search", |
| 247 |
security: WPAdminify.security_nonce, |
| 248 |
search: searchTerm |
| 249 |
}, |
| 250 |
beforeSend: function(xhr) { |
| 251 |
cansearch = false; |
| 252 |
}, |
| 253 |
success: function(response) { |
| 254 |
|
| 255 |
if (response) { |
| 256 |
var data = JSON.parse(response); |
| 257 |
|
| 258 |
// if (data.error) { |
| 259 |
// Toastr Code here |
| 260 |
// } else { |
| 261 |
admin_top_search_show_result(); |
| 262 |
|
| 263 |
$("#top-header-search-results .top-header-results-wrapper").html(data); |
| 264 |
|
| 265 |
// $("#top-header-search-results").show(); |
| 266 |
cansearch = true; |
| 267 |
// } |
| 268 |
} |
| 269 |
}, |
| 270 |
}); |
| 271 |
} |
| 272 |
|
| 273 |
var WP_Adminify = { |
| 274 |
|
| 275 |
ToggleSwitcher: function(key, value) { |
| 276 |
if (key == "") { |
| 277 |
return; |
| 278 |
} |
| 279 |
jQuery.ajax({ |
| 280 |
url: WPAdminify.ajax_url, |
| 281 |
type: "post", |
| 282 |
data: { |
| 283 |
action: "wp_adminify_color_mode", |
| 284 |
security: WPAdminify.security_nonce, |
| 285 |
key: key, |
| 286 |
value: value, |
| 287 |
} |
| 288 |
}); |
| 289 |
}, |
| 290 |
|
| 291 |
// Light/Dark Mode |
| 292 |
Color_Mode_Switcher: function() { |
| 293 |
$('#light-dark-switcher-btn').on( |
| 294 |
'click', |
| 295 |
function() { |
| 296 |
var color_mode = $("#light-dark-switcher-btn").is(":checked") ? 'dark' : 'light'; |
| 297 |
WP_Adminify.ToggleSwitcher("color_mode", color_mode); |
| 298 |
if (color_mode === 'dark') { |
| 299 |
$("body").removeClass("adminify-light-mode"); |
| 300 |
$("body").addClass("adminify-dark-mode"); |
| 301 |
} else if (color_mode === 'light') { |
| 302 |
$("body").removeClass("adminify-dark-mode"); |
| 303 |
$("body").addClass("adminify-light-mode"); |
| 304 |
} |
| 305 |
} |
| 306 |
); |
| 307 |
}, |
| 308 |
|
| 309 |
// Screens Tab |
| 310 |
Screen_Option_Switcher: function() { |
| 311 |
$('#screen-option-switcher-btn').on( |
| 312 |
'click', |
| 313 |
function() { |
| 314 |
var screen_options_tab = $("#screen-option-switcher-btn").is(":checked") ? 1 : 0; |
| 315 |
WP_Adminify.ToggleSwitcher("screen_options_tab", screen_options_tab); |
| 316 |
if (screen_options_tab) { |
| 317 |
$('#screen-options-link-wrap').css('display', 'none'); |
| 318 |
} |
| 319 |
} |
| 320 |
); |
| 321 |
}, |
| 322 |
|
| 323 |
// Help Tab |
| 324 |
Help_Tab: function() { |
| 325 |
$('#help-option-switcher-btn').on( |
| 326 |
'click', |
| 327 |
function() { |
| 328 |
var adminify_help_tab = $("#help-option-switcher-btn").is(":checked") ? 1 : 0; |
| 329 |
WP_Adminify.ToggleSwitcher("adminify_help_tab", adminify_help_tab); |
| 330 |
if (adminify_help_tab) { |
| 331 |
$('#contextual-help-link-wrap').css('display', 'none'); |
| 332 |
} |
| 333 |
} |
| 334 |
); |
| 335 |
}, |
| 336 |
|
| 337 |
// Hide WP Links |
| 338 |
Hide_WP_Links: function() { |
| 339 |
$('#hide-wp-links-switcher-btn').on( |
| 340 |
'click', |
| 341 |
function() { |
| 342 |
var hide_wp_links = $("#hide-wp-links-switcher-btn").is(":checked") ? 1 : 0; |
| 343 |
WP_Adminify.ToggleSwitcher("hide_wp_links", hide_wp_links); |
| 344 |
} |
| 345 |
); |
| 346 |
}, |
| 347 |
|
| 348 |
// Copy Active Plugins |
| 349 |
Copy_Active_Plugins: function(e) { |
| 350 |
e.preventDefault(); |
| 351 |
$('.adminify-copy-btn').copyToClipboard({ |
| 352 |
parent: '.adminify-server-info', |
| 353 |
content: '.adminify-active-plugins-data', |
| 354 |
onSuccess: function($element, source, selection) { |
| 355 |
$('span', $element).text($element.attr("data-text-copied")); |
| 356 |
setTimeout( |
| 357 |
function() { |
| 358 |
$('span', $element).text($element.attr("data-text")); |
| 359 |
}, |
| 360 |
200000 |
| 361 |
); |
| 362 |
} |
| 363 |
}); |
| 364 |
}, |
| 365 |
|
| 366 |
Dismiss_Notice: function() { |
| 367 |
$('div[data-dismissible] .notice-dismiss,div[data-dismissible] .adminify-notice-dismiss, div[data-dismissible] .dismiss-this').on( |
| 368 |
'click', |
| 369 |
function(event) { |
| 370 |
event.preventDefault(); |
| 371 |
var $this = $(this); |
| 372 |
var attr_value, option_name, dismissible_length, data; |
| 373 |
|
| 374 |
attr_value = $this.closest("div[data-dismissible]").attr('data-dismissible').split('-'); |
| 375 |
|
| 376 |
// remove the dismissible length from the attribute value and rejoin the array. |
| 377 |
dismissible_length = attr_value.pop(); |
| 378 |
option_name = attr_value.join('-'); |
| 379 |
data = { |
| 380 |
'action': 'adminify_dismiss_admin_notice', |
| 381 |
'option_name': option_name, |
| 382 |
'dismissible_length': dismissible_length, |
| 383 |
'notice_nonce': WPAdminify.notice_nonce |
| 384 |
}; |
| 385 |
|
| 386 |
// We can also pass the url value separately from ajaxurl for front end AJAX implementations |
| 387 |
$.post(WPAdminify.ajax_url, data); |
| 388 |
$this.closest("div[data-dismissible]").hide('slow'); |
| 389 |
} |
| 390 |
); |
| 391 |
}, |
| 392 |
|
| 393 |
animateCSS: function(element, animation, prefix = 'animate__') { |
| 394 |
// We create a Promise and return it |
| 395 |
new Promise( |
| 396 |
(resolve, reject) => { |
| 397 |
var animationName = `${prefix}${animation}`; |
| 398 |
var node = document.querySelector(element); |
| 399 |
|
| 400 |
node.classList.add(`${prefix}animated`, animationName); |
| 401 |
|
| 402 |
// When the animation ends, we clean the classes and resolve the Promise |
| 403 |
function handleAnimationEnd(event) { |
| 404 |
event.stopPropagation(); |
| 405 |
node.classList.remove(`${prefix}animated`, animationName); |
| 406 |
resolve('Animation ended'); |
| 407 |
} |
| 408 |
|
| 409 |
node.addEventListener('animationend', handleAnimationEnd, { once: true }); |
| 410 |
} |
| 411 |
); |
| 412 |
}, |
| 413 |
|
| 414 |
VersionRollback: function() { |
| 415 |
$('select.wp-adminify-rollback-select').on( |
| 416 |
'change', |
| 417 |
function() { |
| 418 |
var $this = $(this), |
| 419 |
$rollbackButton = $this.next('.wp-adminify-rollback-button'), |
| 420 |
placeholderText = $rollbackButton.data('placeholder-text'), |
| 421 |
placeholderUrl = $rollbackButton.data('placeholder-url'); |
| 422 |
$rollbackButton.html(placeholderText.replace('{VERSION}', $this.val())); |
| 423 |
$rollbackButton.attr('href', placeholderUrl.replace('VERSION', $this.val())); |
| 424 |
} |
| 425 |
).trigger('change'); |
| 426 |
|
| 427 |
$('body').removeClass('wp-adminify--popup-show'); |
| 428 |
|
| 429 |
$('.wp-adminify-rollback-button').on( |
| 430 |
'click', |
| 431 |
function(event) { |
| 432 |
event.preventDefault(); |
| 433 |
var $this = $(this); |
| 434 |
$('body').addClass('wp-adminify--popup-show'); |
| 435 |
$('.wp-adminify-dialog-ok').on( |
| 436 |
'click', |
| 437 |
function(event) { |
| 438 |
event.preventDefault(); |
| 439 |
location.href = $this.attr('href'); |
| 440 |
} |
| 441 |
); |
| 442 |
} |
| 443 |
); |
| 444 |
}, |
| 445 |
|
| 446 |
}; |
| 447 |
|
| 448 |
// Documents Loaded |
| 449 |
$( |
| 450 |
function() { |
| 451 |
|
| 452 |
// Adminify vertical menu |
| 453 |
|
| 454 |
$('.adminify-accordion-v-menu #adminmenu .wp-submenu, .adminify-toggle-v-menu #adminmenu .wp-submenu').hide(); |
| 455 |
$('.adminify-accordion-v-menu .wp-adminify-active .wp-submenu').show(); |
| 456 |
$('.adminify-accordion-v-menu #adminmenu .wp-adminify-parent > a.menu-top, .adminify-toggle-v-menu #adminmenu .wp-adminify-parent > a.menu-top').data('href', $(this).attr('href')).removeAttr('href'); |
| 457 |
|
| 458 |
// Adminify Accordion type vertical menu |
| 459 |
|
| 460 |
$(".adminify-accordion-v-menu #adminmenu .wp-adminify-parent > a.menu-top").on( |
| 461 |
'click', |
| 462 |
function(e) { |
| 463 |
$(this).each( |
| 464 |
function() { |
| 465 |
$(".wp_adminify_admin-menu ul").slideUp().parent('li.menu-top').removeClass('wp-adminify-active'); |
| 466 |
$(this).next().is(":visible") || $(this).next().slideDown().parent('li.menu-top').toggleClass('wp-adminify-active'); |
| 467 |
} |
| 468 |
) |
| 469 |
e.stopPropagation() |
| 470 |
} |
| 471 |
); |
| 472 |
|
| 473 |
// Adminify Toggle type vertical menu |
| 474 |
|
| 475 |
$(".adminify-toggle-v-menu #adminmenu .wp-adminify-parent > a.menu-top").on( |
| 476 |
'click', |
| 477 |
function() { |
| 478 |
$(this).parent(".adminify-toggle-v-menu #adminmenu li.wp-adminify-parent").toggleClass('wp-adminify-active'); |
| 479 |
} |
| 480 |
); |
| 481 |
|
| 482 |
// Extra space appears on Folder Widget in Horizontal Menu mode |
| 483 |
var hmenuHeight = $('.wp-adminify-horizontal-menu').height(); |
| 484 |
$('.wp-adminify.horizontal-menu.has-folder-options .wp-adminify--folder-widget').css('top', hmenuHeight * 1.05); |
| 485 |
|
| 486 |
function fixClasses() { |
| 487 |
var width = $(window).innerWidth(); |
| 488 |
if (width <= 767) { |
| 489 |
$('body').removeClass('folded auto-fold'); |
| 490 |
} |
| 491 |
if (width <= 1023 && width > 767) { |
| 492 |
$('body').addClass('folded'); |
| 493 |
} |
| 494 |
} |
| 495 |
|
| 496 |
fixClasses(); |
| 497 |
|
| 498 |
$(window).on( |
| 499 |
'resize', |
| 500 |
function() { |
| 501 |
fixClasses(); |
| 502 |
} |
| 503 |
); |
| 504 |
|
| 505 |
$('.navbar-brand .navbar-burger').on( |
| 506 |
'click', |
| 507 |
function() { |
| 508 |
if ($(window).innerWidth() <= 767) { |
| 509 |
$('body').toggleClass('adminify-collapse-menu'); |
| 510 |
$('#adminmenumain').toggleClass('adminify-menu-expanded'); |
| 511 |
window.scrollTo(0, 0); |
| 512 |
} else { |
| 513 |
jQuery('#collapse-button').trigger('click'); |
| 514 |
} |
| 515 |
} |
| 516 |
); |
| 517 |
|
| 518 |
// Range Slider |
| 519 |
|
| 520 |
// var textinput = $( ".range-value" ).val(); |
| 521 |
// var myslider = $( ".range-slider" ).slider({ |
| 522 |
// min: 0, |
| 523 |
// max: 900, |
| 524 |
// range: "min", |
| 525 |
// value: $(".range-value").val(), |
| 526 |
// slide: function( event, ui ) { |
| 527 |
// $(".range-value").val(ui.value); |
| 528 |
// } |
| 529 |
// }); |
| 530 |
|
| 531 |
// $( ".range-value" ).on( "keyup", function() { |
| 532 |
// myslider.slider( "value", this.value ); |
| 533 |
// }); |
| 534 |
|
| 535 |
// WP_Adminify.ToggleSwitcher(); |
| 536 |
WP_Adminify.Color_Mode_Switcher(); |
| 537 |
WP_Adminify.Screen_Option_Switcher(); |
| 538 |
WP_Adminify.Help_Tab(); |
| 539 |
WP_Adminify.Hide_WP_Links(); |
| 540 |
WP_Adminify.Dismiss_Notice(); |
| 541 |
WP_Adminify.VersionRollback(); |
| 542 |
// WP_Adminify.Copy_Active_Plugins(); |
| 543 |
|
| 544 |
// Copy to Clipboard Section |
| 545 |
(function(n) { |
| 546 |
n.fn.copyToClipboard = function(e) { |
| 547 |
var t = n.extend({ |
| 548 |
parent: "body", |
| 549 |
content: "", |
| 550 |
onSuccess: function() {}, |
| 551 |
onError: function() {} |
| 552 |
}, |
| 553 |
e |
| 554 |
); |
| 555 |
return this.each( |
| 556 |
function() { |
| 557 |
var e = n(this); |
| 558 |
e.on( |
| 559 |
"click", |
| 560 |
function() { |
| 561 |
var n = e.parents(t.parent).find(t.content); |
| 562 |
var o = document.createRange(); |
| 563 |
var c = window.getSelection(); |
| 564 |
o.selectNodeContents(n[0]); |
| 565 |
c.removeAllRanges(); |
| 566 |
c.addRange(o); |
| 567 |
try { |
| 568 |
var r = document.execCommand("copy"); |
| 569 |
var a = r ? "onSuccess" : "onError"; |
| 570 |
t[a](e, n, c.toString()) |
| 571 |
} catch (i) {} |
| 572 |
c.removeAllRanges() |
| 573 |
} |
| 574 |
); |
| 575 |
} |
| 576 |
) |
| 577 |
} |
| 578 |
})(jQuery); |
| 579 |
|
| 580 |
$('.adminify-copy-btn').on( |
| 581 |
'click', |
| 582 |
function(e) { |
| 583 |
e.preventDefault(); |
| 584 |
$('.adminify-copy-btn').copyToClipboard({ |
| 585 |
parent: '.adminify-server-info', |
| 586 |
content: '.adminify-active-plugins-data', |
| 587 |
onSuccess: function($element, source, selection) { |
| 588 |
$('span', $element).text($element.attr("data-text-copied")); |
| 589 |
setTimeout( |
| 590 |
function() { |
| 591 |
$('span', $element).text($element.attr("data-text")); |
| 592 |
}, |
| 593 |
2000 |
| 594 |
); |
| 595 |
} |
| 596 |
}); |
| 597 |
} |
| 598 |
); |
| 599 |
|
| 600 |
if ($(window).innerWidth() <= 1200) { |
| 601 |
$('.adminify-search-expand').on( |
| 602 |
'click', |
| 603 |
function() { |
| 604 |
$('.top-header--search--form').toggleClass('adminify-form-expand'); |
| 605 |
} |
| 606 |
); |
| 607 |
} |
| 608 |
|
| 609 |
// betterlinks menu settings |
| 610 |
if (WPAdminify_ThirdParty.better_links.active === true) { |
| 611 |
var { menu_name, submenu_manage, submenu_name, submenu_settings } = WPAdminify_ThirdParty.better_links; |
| 612 |
|
| 613 |
if ($("body").hasClass("toplevel_page_betterlinks")) { |
| 614 |
if (menu_name) { |
| 615 |
$('.toplevel_page_betterlinks #toplevel_page_betterlinks .wp-menu-name').text(menu_name); |
| 616 |
} |
| 617 |
setTimeout( |
| 618 |
() => { |
| 619 |
if (menu_name) { |
| 620 |
$('.toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu .wp-submenu-head').text(menu_name); |
| 621 |
} |
| 622 |
if (submenu_manage) { |
| 623 |
$('.toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(2) a').text(submenu_manage); |
| 624 |
} |
| 625 |
if (submenu_name) { |
| 626 |
$('.toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(3) a').text(submenu_name); |
| 627 |
} |
| 628 |
if (submenu_settings) { |
| 629 |
$('.toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(4) a').text(submenu_settings); |
| 630 |
} |
| 631 |
}, |
| 632 |
500 |
| 633 |
); |
| 634 |
} |
| 635 |
} |
| 636 |
|
| 637 |
} |
| 638 |
); |
| 639 |
|
| 640 |
})(jQuery); |
| 641 |
|