-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from ahmedkaludi/1.0.17
1.0.17
- Loading branch information
Showing
325 changed files
with
16,242 additions
and
11,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* makebetter admin css*/ | ||
|
||
/** | ||
PLUGINS ADMIN PAGE | ||
*/ | ||
#cwv-reloaded-feedback-overlay { | ||
/* Height & width depends on how you want to reveal the overlay (see JS below) */ | ||
height: 100%; | ||
width: 100%; | ||
position: fixed; /* Stay in place */ | ||
z-index: 10000; /* Sit on top */ | ||
left: 0; | ||
top: 0; | ||
background-color: rgb(120,120,120); /* Black fallback color */ | ||
background-color: rgba(0,0,0, 0.5); /* Black w/opacity */ | ||
} | ||
#cwv-reloaded-feedback-content { | ||
position: relative; | ||
top: 25%; /* 25% from the top */ | ||
width: 500px; | ||
max-width: 100%; | ||
margin: auto; | ||
margin-top: 30px; /* 30px top margin to avoid conflict with the close button on smaller screens */ | ||
max-height: 50%; | ||
padding: 20px; | ||
background-color: #fff; | ||
overflow-y: auto; | ||
} | ||
.mb-box{display: none;width:100%;} | ||
.cwv-feedback-not-deactivate { display: block; text-align: right; } | ||
|
||
#cwv-reloaded-feedback-content h3{ | ||
margin:5px; | ||
font-size: 1em; | ||
} | ||
|
||
@media screen and (max-width:400px){ | ||
#cwv-reloaded-feedback-content { | ||
padding:0px; | ||
padding-bottom:50px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
var strict; | ||
|
||
jQuery(document).ready(function ($) { | ||
/** | ||
* DEACTIVATION FEEDBACK FORM | ||
*/ | ||
// show overlay when clicked on "deactivate" | ||
cwv_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="core-web-vitals-pagespeed-booster"] .row-actions .deactivate a'); | ||
cwv_deactivate_link_url = cwv_deactivate_link.attr('href'); | ||
|
||
cwv_deactivate_link.click(function (e) { | ||
e.preventDefault(); | ||
|
||
// only show feedback form once per 30 days | ||
var c_value = cwv_admin_get_cookie("cwv_hide_deactivate_feedback"); | ||
|
||
if (c_value === undefined) { | ||
$('#cwv-reloaded-feedback-overlay').show(); | ||
} else { | ||
// click on the link | ||
window.location.href = cwv_deactivate_link_url; | ||
} | ||
}); | ||
// show text fields | ||
$('#cwv-reloaded-feedback-content input[type="radio"]').click(function () { | ||
// show text field if there is one | ||
var inputValue = $(this).attr("value"); | ||
var targetBox = $("." + inputValue); | ||
$(".mb-box").not(targetBox).hide(); | ||
$(targetBox).show(); | ||
}); | ||
// send form or close it | ||
$('#cwv-reloaded-feedback-content .button').click(function (e) { | ||
e.preventDefault(); | ||
// set cookie for 30 days | ||
var exdate = new Date(); | ||
exdate.setSeconds(exdate.getSeconds() + 2592000); | ||
document.cookie = "cwv_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/"; | ||
|
||
$('#cwv-reloaded-feedback-overlay').hide(); | ||
if ('cwv-reloaded-feedback-submit' === this.id) { | ||
// Send form data | ||
$.ajax({ | ||
type: 'POST', | ||
url: ajaxurl, | ||
dataType: 'json', | ||
data: { | ||
action: 'cwv_send_feedback', | ||
data: $('#cwv-reloaded-feedback-content form').serialize() | ||
}, | ||
complete: function (MLHttpRequest, textStatus, errorThrown) { | ||
// deactivate the plugin and close the popup | ||
$('#cwv-reloaded-feedback-overlay').remove(); | ||
window.location.href = cwv_deactivate_link_url; | ||
|
||
} | ||
}); | ||
} else { | ||
$('#cwv-reloaded-feedback-overlay').remove(); | ||
window.location.href = cwv_deactivate_link_url; | ||
} | ||
}); | ||
// close form without doing anything | ||
$('.cwv-feedback-not-deactivate').click(function (e) { | ||
$('#cwv-reloaded-feedback-overlay').hide(); | ||
}); | ||
|
||
function cwv_admin_get_cookie (name) { | ||
var i, x, y, cwv_cookies = document.cookie.split( ";" ); | ||
for (i = 0; i < cwv_cookies.length; i++) | ||
{ | ||
x = cwv_cookies[i].substr( 0, cwv_cookies[i].indexOf( "=" ) ); | ||
y = cwv_cookies[i].substr( cwv_cookies[i].indexOf( "=" ) + 1 ); | ||
x = x.replace( /^\s+|\s+$/g, "" ); | ||
if (x === name) | ||
{ | ||
return unescape( y ); | ||
} | ||
} | ||
} | ||
|
||
}); // document ready |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.