-
Notifications
You must be signed in to change notification settings - Fork 2
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 #63 from ahmedkaludi/2.4.6
2.4.6
- Loading branch information
Showing
21 changed files
with
590 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
var strict; | ||
|
||
jQuery(document).ready(function ($) { | ||
/** | ||
* DEACTIVATION FEEDBACK FORM | ||
*/ | ||
// show overlay when clicked on "deactivate" | ||
wpm_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="wp-multilang"] .row-actions .deactivate a'); | ||
wpm_deactivate_link_url = wpm_deactivate_link.attr('href'); | ||
|
||
wpm_deactivate_link.click(function (e) { | ||
e.preventDefault(); | ||
// only show feedback form once per 30 days | ||
var c_value = wpm_admin_get_cookie("wpm_hide_deactivate_feedback"); | ||
|
||
if (c_value === undefined) { | ||
$('#wpm-reloaded-feedback-overlay').show(); | ||
} else { | ||
// click on the link | ||
window.location.href = wpm_deactivate_link_url; | ||
} | ||
}); | ||
// show text fields | ||
$('#wpm-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 | ||
$('#wpm-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 = "wpm_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/"; | ||
|
||
$('#wpm-reloaded-feedback-overlay').hide(); | ||
if ('wpm-reloaded-feedback-submit' === this.id) { | ||
// Send form data | ||
$.ajax({ | ||
type: 'POST', | ||
url: ajaxurl, | ||
dataType: 'json', | ||
data: { | ||
action: 'wpm_send_feedback', | ||
data: $('#wpm-reloaded-feedback-content form').serialize() | ||
}, | ||
complete: function (MLHttpRequest, textStatus, errorThrown) { | ||
// deactivate the plugin and close the popup | ||
$('#wpm-reloaded-feedback-overlay').remove(); | ||
window.location.href = wpm_deactivate_link_url; | ||
|
||
} | ||
}); | ||
} else { | ||
$('#wpm-reloaded-feedback-overlay').remove(); | ||
window.location.href = wpm_deactivate_link_url; | ||
} | ||
}); | ||
// close form without doing anything | ||
$('.wpm-feedback-not-deactivate').click(function (e) { | ||
$('#wpm-reloaded-feedback-overlay').hide(); | ||
}); | ||
|
||
function wpm_admin_get_cookie (name) { | ||
var i, x, y, wpm_cookies = document.cookie.split( ";" ); | ||
for (i = 0; i < wpm_cookies.length; i++) | ||
{ | ||
x = wpm_cookies[i].substr( 0, wpm_cookies[i].indexOf( "=" ) ); | ||
y = wpm_cookies[i].substr( wpm_cookies[i].indexOf( "=" ) + 1 ); | ||
x = x.replace( /^\s+|\s+$/g, "" ); | ||
if (x === name) | ||
{ | ||
return unescape( y ); | ||
} | ||
} | ||
} | ||
|
||
}); // document ready |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 | ||
*/ | ||
#wpm-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 */ | ||
} | ||
#wpm-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%;} | ||
.wpm-feedback-not-deactivate { display: block; text-align: right; } | ||
|
||
#wpm-reloaded-feedback-content h3{ | ||
margin:5px; | ||
font-size: 1em; | ||
} | ||
|
||
@media screen and (max-width:400px){ | ||
#wpm-reloaded-feedback-content { | ||
padding:0px; | ||
padding-bottom:50px; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
<?php | ||
/** | ||
* WP Multilang Additional Settings | ||
* | ||
* @category Admin | ||
* @package WPM/Admin | ||
* @author Magazine3 | ||
* @since 1.0 | ||
*/ | ||
|
||
namespace WPM\Includes\Admin\Settings; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; // Exit if accessed directly | ||
} | ||
|
||
/** | ||
* WPM_Settings_Upgrade_Pro. | ||
*/ | ||
class WPM_Settings_Upgrade_Pro extends WPM_Settings_Page { | ||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() { | ||
$this->id = 'upgradetopro'; | ||
$this->label = __( 'Upgrade to Pro', 'wp-multilang' ); | ||
|
||
parent::__construct(); | ||
} | ||
} |
Oops, something went wrong.