WP init
This commit is contained in:
@@ -0,0 +1,905 @@
|
||||
span.hfe-shortcode-col-wrap > input {
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
font-size: 12px;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
padding: 4px 8px;
|
||||
margin: 0;
|
||||
}
|
||||
input.hfe-large-text{
|
||||
width: 99%;
|
||||
}
|
||||
.hfe-options-row-heading {
|
||||
border-right: 1px solid #E1E1E1;
|
||||
padding: 15px;
|
||||
width: 45%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.hfe-options-row td {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
zoom: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.hfe-options-table .hfe-options-row-content {
|
||||
padding: 15px 10px;
|
||||
position: relative;
|
||||
width: 55%;
|
||||
}
|
||||
.hfe-options-table.widefat {
|
||||
border-width: 0;
|
||||
}
|
||||
.hfe-options-row-heading label {
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
line-height: 1.4em;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 0 0 3px;
|
||||
color: #333;
|
||||
}
|
||||
.hfe-options-row-content select {
|
||||
width: 95%;
|
||||
}
|
||||
.hfe_radio_options {
|
||||
display: inline-block;
|
||||
}
|
||||
li#toplevel_page_Settings-page,
|
||||
.wp-admin #adminmenu .wp-submenu a[href="themes.php?page=hfe-settings"],
|
||||
.wp-admin #adminmenu .wp-submenu a[href="themes.php?page=hfe-guide"],
|
||||
.wp-admin #adminmenu .wp-submenu a[href="themes.php?page=hfe-about"] {
|
||||
display: none;
|
||||
}
|
||||
.post-type-elementor-hf .wp-submenu a[href ="edit.php?post_type=elementor-hf" ] {
|
||||
color: #ffffff !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
.toplevel_page_hfe .wp-submenu a[href ="post-new.php?post_type=elementor-hf" ],
|
||||
.toplevel_page_hfe .wp-submenu a[href ="admin.php?page=hfe#onboarding" ],
|
||||
.toplevel_page_hfe .wp-submenu a[href ="admin.php?page=hfe#onboardingsuccess" ],
|
||||
.toplevel_page_uaepro .wp-submenu a[href ="post-new.php?post_type=elementor-hf" ] {
|
||||
display: none !important;
|
||||
}
|
||||
.hfe-heading-inline {
|
||||
font-size: 23px;
|
||||
font-weight: 400;
|
||||
margin: 0;
|
||||
padding: 9px 0 4px 0;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.hfe-selected-template-type-custom .hfe-shortcode {
|
||||
display: table-row;
|
||||
}
|
||||
.hfe-selected-template-type-custom .bsf-target-rules-row,
|
||||
.hfe-selected-template-type-custom .enable-for-canvas,
|
||||
.hfe-shortcode,
|
||||
.hfe-selected-template-type-none .bsf-target-rules-row,
|
||||
.hfe-selected-template-type-none .hfe-shortcode,
|
||||
.hfe-selected-template-type-none .enable-for-canvas,
|
||||
.hfe-guide-content .form-table th {
|
||||
display: none;
|
||||
}
|
||||
/* Notice */
|
||||
#header-footer-install-notice img.custom-logo {
|
||||
height: 30px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
#header-footer-install-notice .notice-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
#header-footer-install-notice .notice-content {
|
||||
margin-left: 0px;
|
||||
}
|
||||
#header-footer-install-notice .notice-dismiss {
|
||||
height: 100%;
|
||||
}
|
||||
/* EHF Settings - Step by Step guide */
|
||||
#ehf-meta-box .inside,
|
||||
.hfe-admin-guide-section.hfe-admin-about-section {
|
||||
padding: 0px;
|
||||
}
|
||||
.appearance_page_hfe-guide .nav-tab-wrapper,
|
||||
.appearance_page_hfe-about .nav-tab-wrapper,
|
||||
.appearance_page_hfe-settings .nav-tab-wrapper {
|
||||
margin-right: 18px;
|
||||
margin-bottom: 30px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.post-type-elementor-hf .nav-tab-wrapper {
|
||||
margin-bottom: 18px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.post-type-elementor-hf .wrap h1.wp-heading-inline,
|
||||
.hfe-heading-inline {
|
||||
margin-top: 10px
|
||||
}
|
||||
.hfe-admin-about-section,
|
||||
.hfe-subscription-row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.hfe-subscription-row .hfe-input-container {
|
||||
width: 50%;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
.hfe-guide-modal-content .hfe-checkbox-container {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.hfe-guide-modal-content .hfe-admin-column-50:not(.hfe-admin-column-last) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/* Form CSS */
|
||||
.hfe-subscription-row {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.hfe-subscription-row .hfe-subscribe-field:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.hfe-subscription-row .hfe-subscribe-field {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #585F66;
|
||||
padding: 10px 15px;
|
||||
box-shadow: none;
|
||||
min-height: 44px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
background-position: right 10px top 55%;
|
||||
margin: 0;
|
||||
}
|
||||
.hfe-subscription-row .subscription-label {
|
||||
color: #585F66;
|
||||
margin: 12px 10px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
font-weight: 400;
|
||||
padding: 0 5px;
|
||||
font-size: 14px;
|
||||
left: 0;
|
||||
-webkit-transition: all 0.25s ease;
|
||||
transition: all 0.25s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.hfe-subscription-row input#hfe_subscribe_accept {
|
||||
border: 1px solid #585F66;
|
||||
border-radius: 3px;
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
||||
.hfe-guide-modal-popup .hfe-guide-modal-popup-wrapper .hfe-subscription-row .hfe-input-container:nth-of-type(3) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.hfe-subscription-row .hfe-input-container:not(.subscription-success, .subscription-error) .hfe-subscribe-field:hover {
|
||||
border-color: #2271b1;
|
||||
}
|
||||
.hfe-subscription-row .hfe-subscribe-field:hover,
|
||||
.hfe-subscription-row .hfe-subscribe-field:focus {
|
||||
color: #2c3338;
|
||||
}
|
||||
.hfe-subscription-row .subscription-anim .subscription-label {
|
||||
background-color: #fff;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
margin-top: 0;
|
||||
padding: 0 4px;
|
||||
top: -5px;
|
||||
transition: all 0.125s ease;
|
||||
-webkit-transition: all 0.125s ease;
|
||||
color: #2271b1;
|
||||
}
|
||||
.hfe-subscription-row .subscription-error .hfe-subscribe-field,
|
||||
.hfe-subscription-row .subscription-error .hfe-subscribe-field:focus {
|
||||
border-color: #ff0000;
|
||||
}
|
||||
.hfe-subscription-row .subscription-error .subscription-desc,
|
||||
.hfe-subscription-row .subscription-anim.subscription-error .subscription-label {
|
||||
color: #ff0000;
|
||||
}
|
||||
.hfe-subscription-row .subscription-success .hfe-subscribe-field,
|
||||
.hfe-subscription-row .subscription-success .hfe-subscribe-field:focus {
|
||||
border-color: #66a700;
|
||||
}
|
||||
.hfe-subscription-row .subscription-anim.subscription-success .subscription-label {
|
||||
color: #66a700;
|
||||
}
|
||||
.hfe-input-container .subscription-desc {
|
||||
padding-left: 2px;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.hfe-input-container.subscription-error .subscription-desc {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
input[type="text"].hfe-subscribe-field,
|
||||
select.hfe-subscribe-field {
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
padding: 10px 15px;
|
||||
outline: none;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.hfe-guide-content p.submit {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.hfe-privacy-policy-container {
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
.hfe-subscription-step-2-active ~ .hfe-privacy-policy-container {
|
||||
display: block;
|
||||
}
|
||||
.hfe-privacy-policy-container .hfe-subscription-policy {
|
||||
margin: 0;
|
||||
padding-top: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.button-subscription-skip:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
.button-subscription-skip {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: .8em;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
}
|
||||
.hfe-guide-content .button {
|
||||
text-transform: uppercase;
|
||||
padding: 10px 20px;
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
}
|
||||
.hfe-guide-content .button.submitting {
|
||||
margin-right: 3px;
|
||||
}
|
||||
/* EHF Settings - About Us */
|
||||
.hfe-admin-about-section {
|
||||
margin: 0px 19px 23px 0px;
|
||||
padding: 40px;
|
||||
line-height: 2;
|
||||
}
|
||||
.hfe-admin-about-section p,
|
||||
.hfe-admin-addons .addon-item,
|
||||
.hfe-admin-addons .addon-item p,
|
||||
.hfe-admin-about-section ul {
|
||||
font-size: 15px;
|
||||
}
|
||||
.hfe-admin-about-us {
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.hfe-admin-about-section h1,
|
||||
.hfe-admin-about-section h2,
|
||||
.hfe-admin-about-section h3,
|
||||
.hfe-admin-about-section h4,
|
||||
.hfe-admin-about-section h5 {
|
||||
margin-top: 0;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.hfe-clear:before {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.hfe-clear:after,
|
||||
.hfe-admin-columns:after {
|
||||
clear: both;
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.hfe-admin-columns .hfe-admin-column-40 {
|
||||
width: 40%;
|
||||
}
|
||||
.hfe-admin-columns .hfe-admin-column-50 {
|
||||
width: 50%;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.hfe-admin-columns .hfe-admin-column-60 {
|
||||
width: 60%;
|
||||
}
|
||||
.hfe-admin-columns .hfe-admin-column-last .hfe-guide-content {
|
||||
width: 100%;
|
||||
}
|
||||
.hfe-admin-about-section figure {
|
||||
margin: 0;
|
||||
padding-top: 0px;
|
||||
}
|
||||
.hfe-admin-about-section figure img {
|
||||
width: 100%;
|
||||
box-shadow: 0 0 8px rgb(0 0 0 / 10%);
|
||||
}
|
||||
.hfe-admin-about-section figure figcaption {
|
||||
font-size: 15px;
|
||||
color: #686868;
|
||||
margin-top: 5px;
|
||||
text-align: center;
|
||||
line-height: initial;
|
||||
}
|
||||
.hfe-admin-about-section .hfe-admin-column-40 {
|
||||
padding-left: 15px;
|
||||
}
|
||||
.hfe-admin-about-section .hfe-admin-column-60 {
|
||||
padding-right: 15px;
|
||||
}
|
||||
.hfe-admin-about-section *,
|
||||
.hfe-admin-about-section *::before,
|
||||
.hfe-admin-about-section *::after,
|
||||
.hfe-admin-addons *,
|
||||
.hfe-admin-addons *::before,
|
||||
.hfe-admin-addons *::after {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* About Us - Plugins section */
|
||||
.hfe-admin-addons .addon-container:last-child {
|
||||
padding-right: 10px;
|
||||
}
|
||||
.hfe-admin-addons .addon-container:first-child,
|
||||
.hfe-admin-addons .addon-container {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.hfe-admin-addons {
|
||||
padding: 0 27px 0px 10px;
|
||||
}
|
||||
.hfe-admin-addons .addon-item .details {
|
||||
padding: 20px;
|
||||
}
|
||||
.hfe-admin-addons .addon-item img {
|
||||
padding: 13px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
.hfe-admin-addons .addons-container{
|
||||
margin-left: -20px;
|
||||
margin-right: -20px;
|
||||
}
|
||||
.hfe-admin-addons .addon-container {
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
width: 33.333333%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.hfe-admin-addons h4 {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.hfe-admin-addons .addon-item {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 3px;
|
||||
margin: 0;
|
||||
}
|
||||
.hfe-admin-addons .addon-item img {
|
||||
float: left;
|
||||
max-width: 80px;
|
||||
}
|
||||
.hfe-admin-addons .addon-item h5 {
|
||||
margin: 0 0 15px 90px;
|
||||
font-size: 17px;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.hfe-admin-addons .addon-item p {
|
||||
margin: 0 0 0 90px;
|
||||
}
|
||||
.hfe-admin-addons .website-link {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.hfe-admin-addons .addon-item .details {
|
||||
padding: 30px 20px;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
height: 28px;
|
||||
margin: 0;
|
||||
padding: 0 10px 1px;
|
||||
box-shadow: 0 1px 0 #cccccc;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #cccccc;
|
||||
background: #f7f7f7;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button:hover,
|
||||
.hfe-admin-addons .addon-item .action-button .button:focus {
|
||||
background: #fafafa;
|
||||
border-color: #999;
|
||||
color: #23282d;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-primary {
|
||||
background: #0085ba;
|
||||
border-color: #0073aa #006799 #006799;
|
||||
box-shadow: 0 1px 0 #006799;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-primary:hover,
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-primary:focus {
|
||||
background: #008ec2;
|
||||
border-color: #006799;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-secondary {
|
||||
color: #555;
|
||||
border-color: #cccccc;
|
||||
background: #f7f7f7;
|
||||
box-shadow: 0 1px 0 #cccccc;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-secondary:hover,
|
||||
.hfe-admin-addons .addon-item .action-button .button.button-secondary:focus {
|
||||
background: #fafafa;
|
||||
border-color: #999;
|
||||
color: #23282d;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button .button.disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f7f7f7;
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 20px;
|
||||
min-height: 75px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .actions .msg {
|
||||
background-color: #f7f7f7;
|
||||
border: none;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
z-index: 99;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .actions .msg.success,
|
||||
.hfe-admin-addons .addon-item .status .status-active,
|
||||
.hfe-admin-addons .addon-item .action-button button.status-active .fa {
|
||||
color: #2a9b39;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .actions .msg.error,
|
||||
.hfe-admin-addons .addon-item .status .status-inactive,
|
||||
.hfe-admin-addons .addon-item .action-button button.status-inactive .fa {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .status {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .status .status-download {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .upgrade-button {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .upgrade-button a {
|
||||
font-weight: 600;
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
padding: 8px 5px;
|
||||
}
|
||||
.hfe-admin-addons .addon-item .action-button a.button {
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
}
|
||||
.hfe-admin-addons .addon-item .action-button button {
|
||||
background: none;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 3px;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
padding: 8px 5px;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button:hover, .hfe-admin-addons .addon-item .action-button button.loading {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button .fa {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button .fa.fa-spinner {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button.status-download .fa {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button.disabled {
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button button.loading .fa {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.hfe-admin-addons .addon-item .action-button a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Modal Popup */
|
||||
.hfe-guide-modal-header {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .heading {
|
||||
background: #ffffff;
|
||||
padding: 5px 20px;
|
||||
margin-top: 0;
|
||||
box-shadow: 0 0 8px rgb(0 0 0 / 10%);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-guide-section.hfe-admin-about-section,
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-column-50:not(.hfe-admin-column-last) {
|
||||
margin: 0px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-column-50:not(.hfe-admin-column-last),
|
||||
.hfe-admin-column-last .hfe-guide-content form {
|
||||
padding: 50px;
|
||||
}
|
||||
.hfe-guide-modal-overlay {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
visibility: hidden;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 9999;
|
||||
opacity: 0;
|
||||
background: rgba(0,0,0,0.75);
|
||||
-webkit-transition: all .5s;
|
||||
transition: all .5s;
|
||||
}
|
||||
.hfe-guide-modal-content {
|
||||
width: 70%;
|
||||
background-color: #ffffff;
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
transition: all .5s;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper {
|
||||
z-index: 99999;
|
||||
top: 51%;
|
||||
transform: translateY(-50%);
|
||||
margin-bottom: 20px;
|
||||
visibility: hidden;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
bottom: auto;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .subscription-anim .subscription-label {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-about-section {
|
||||
background-color: #f1f3f5;
|
||||
}
|
||||
.hfe-admin-about-section h3 {
|
||||
font-size: 20px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-guide-content form {
|
||||
padding: 0px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-guide-content {
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 2px 30px 0 rgb(0 0 0 / 8%);
|
||||
border: 0px;
|
||||
padding: 50px 50px 25px 50px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-columns .hfe-admin-column-50.hfe-admin-column-last {
|
||||
width: 50%;
|
||||
margin: 0;
|
||||
padding: 50px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-columns .hfe-admin-column-50 {
|
||||
width: 50%;
|
||||
background: unset;
|
||||
border: 0px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .heading {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-logo {
|
||||
height: 35px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper h3 {
|
||||
width: 100%;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-about-section.hfe-admin-columns.hfe-admin-guide-section {
|
||||
max-height: 75vh;
|
||||
overflow: auto;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-about-section-column {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-subscription-step-1-active .hfe-subscription-step-2,
|
||||
.hfe-guide-modal-popup-wrapper .hfe-subscription-step-2-active .hfe-subscription-step-1 {
|
||||
display: none;
|
||||
}
|
||||
/* Limited this only for modal Popup */
|
||||
.hfe-guide-modal-popup-wrapper .hfe-subscription-row .hfe-input-container,
|
||||
.hfe-guide-modal-popup-wrapper .button {
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-subscription-row {
|
||||
display: block;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-about-section-column h2 {
|
||||
font-size: 28px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.hfe-admin-about-section-column h3 {
|
||||
margin-bottom: 0;
|
||||
padding: 15px 30px;
|
||||
border-bottom: 1px solid #c3c4c7;
|
||||
}
|
||||
.hfe-admin-about-section-column h3 {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.hfe-show {
|
||||
z-index: 9999;
|
||||
}
|
||||
.hfe-show .hfe-modal-close,
|
||||
.hfe-show .hfe-modal-close.action-button,
|
||||
.hfe-show .hfe-guide-modal-content {
|
||||
visibility: visible;
|
||||
}
|
||||
.hfe-show .hfe-guide-modal-overlay {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
.hfe-show .hfe-guide-modal-content {
|
||||
opacity: 1;
|
||||
}
|
||||
.hfe-input-container.hfe-error .hfe-subscribe-field {
|
||||
border-color: #d11212;
|
||||
}
|
||||
span.hfe-subscribe-message {
|
||||
width: 100%;
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
padding: 15px;
|
||||
}
|
||||
span.hfe-subscribe-message.success {
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
border-left: 4px solid #93d776;
|
||||
}
|
||||
span.hfe-subscribe-message.error {
|
||||
color: #d11212;
|
||||
background-color: #f2dede96;
|
||||
border-left: 4px solid #c01a1a66;
|
||||
}
|
||||
span.dashicons.dashicons-update.hfe-loader {
|
||||
animation: rotation 2s infinite linear;
|
||||
vertical-align: text-top;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
@media (max-width: 1249px) {
|
||||
.hfe-admin-addons .addon-container {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.hfe-admin-addons .addon-container {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.hfe-admin-about-section .hfe-admin-column-40 {
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.hfe-admin-about-section .hfe-admin-column-60 {
|
||||
width: 100%;
|
||||
padding-right: 0;
|
||||
}
|
||||
.hfe-admin-addons .addon-item {
|
||||
margin: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.hfe-subscription-row,
|
||||
.hfe-admin-about-section {
|
||||
display: block;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper p.button,
|
||||
.hfe-admin-about-section figure {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.hfe-admin-guide-section.hfe-admin-columns .hfe-admin-column-50,
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-columns .hfe-admin-column-50.hfe-admin-column-last,
|
||||
.hfe-subscription-row .hfe-input-container {
|
||||
width: 100%;
|
||||
}
|
||||
.hfe-guide-modal-popup-wrapper .hfe-admin-columns .hfe-admin-column-50.hfe-admin-column-last,
|
||||
.hfe-guide-modal-popup-wrapper .hfe-guide-content,
|
||||
.hfe-admin-guide-section .hfe-admin-column-50:not(.hfe-admin-column-last) {
|
||||
padding: 15px;
|
||||
}
|
||||
.hfe-subscribe-email span.dashicons.dashicons-email {
|
||||
font-size: 15px;
|
||||
height: 15px;
|
||||
line-height: 1;
|
||||
width: 15px;
|
||||
}
|
||||
.hfe-subscribe-email input.hfe-subscribe-field {
|
||||
min-height: unset;
|
||||
font-size: 10px;
|
||||
}
|
||||
.hfe-subscribe-field {
|
||||
padding: 5px;
|
||||
}
|
||||
.hfe-admin-guide-section.hfe-admin-about-section {
|
||||
display: block;
|
||||
}
|
||||
.hfe-guide-content .button {
|
||||
font-size: 10px;
|
||||
}
|
||||
.hfe-checkbox-container {
|
||||
display: flex;
|
||||
}
|
||||
.hfe-admin-columns .hfe-admin-column-last {
|
||||
padding-top: 0px;
|
||||
}
|
||||
.hfe-subscription-row select.hfe-subscribe-field {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.hfe-admin-about-section-column h3 {
|
||||
border-bottom: 0px;
|
||||
}
|
||||
.hfe-admin-about-us {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.hfe-admin-addons .addon-container,
|
||||
.hfe-admin-addons .addon-container:last-child {
|
||||
padding-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
#toplevel_page_hfe .wp-submenu li a[href*="https://ultimateelementor.com/pricing/?utm_source=wp-admin&utm_medium=menu&utm_campaign=uae-upgrade"]{
|
||||
background-color:#04a382;
|
||||
color:#fff;
|
||||
font-size:13px;
|
||||
font-weight:500;
|
||||
line-height:20px;
|
||||
padding-right:12px!important;
|
||||
padding-left:12px!important
|
||||
}
|
||||
|
||||
#toplevel_page_hfe .wp-submenu li a[href*="https://ultimateelementor.com/pricing/?utm_source=wp-admin&utm_medium=menu&utm_campaign=uae-upgrade"]:hover
|
||||
{
|
||||
background-color:#018d71;
|
||||
color:#fff;
|
||||
font-size:13px;
|
||||
font-weight:500;
|
||||
line-height:20px;
|
||||
padding-right:12px!important;
|
||||
padding-left:12px!important
|
||||
}
|
||||
|
||||
.uae-plugins-go-pro{
|
||||
color: #93003C;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.uae-plugins-go-pro:active,
|
||||
.uae-plugins-go-pro:focus,
|
||||
.uae-plugins-go-pro:hover
|
||||
{
|
||||
color:#93003C;
|
||||
opacity:.8;
|
||||
}
|
||||
|
||||
/* Rating Stars in Plugin List - Remove all borders and outlines */
|
||||
tr[data-plugin*="header-footer-elementor"] a[href*="reviews"],
|
||||
tr[data-plugin*="header-footer-elementor"] a[href*="reviews"]:focus,
|
||||
tr[data-plugin*="header-footer-elementor"] a[href*="reviews"]:active,
|
||||
tr[data-plugin*="header-footer-elementor"] a[href*="reviews"]:hover,
|
||||
tr[data-plugin*="header-footer-elementor"] .plugin-description-actions a[href*="reviews"],
|
||||
tr[data-plugin*="header-footer-elementor"] .plugin-description-actions a[href*="reviews"]:focus,
|
||||
tr[data-plugin*="header-footer-elementor"] .plugin-description-actions a[href*="reviews"]:active,
|
||||
tr[data-plugin*="header-footer-elementor"] .plugin-description-actions a[href*="reviews"]:hover {
|
||||
text-decoration: none !important;
|
||||
outline: 0 !important;
|
||||
outline: none !important;
|
||||
border: 0 !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
-moz-box-shadow: none !important;
|
||||
background: transparent !important;
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
tr[data-plugin*="header-footer-elementor"] a[href*="reviews"]:hover,
|
||||
tr[data-plugin*="header-footer-elementor"] .plugin-description-actions a[href*="reviews"]:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
tr[data-plugin*="header-footer-elementor/header-footer-elementor.php"] .plugin-description-actions a[href*="reviews"] .dashicons {
|
||||
vertical-align: top;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
/* Rating star styles for plugin meta links */
|
||||
.hfe-rating-star {
|
||||
color: #ffb900;
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
@@ -0,0 +1,512 @@
|
||||
;( function( $ ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Global settings access.
|
||||
var settings = {
|
||||
iconActivate: '<i class="fa fa-toggle-on fa-flip-horizontal" aria-hidden="true"></i>',
|
||||
iconDeactivate: '<i class="fa fa-toggle-on" aria-hidden="true"></i>',
|
||||
iconInstall: '<i class="fa fa-cloud-download" aria-hidden="true"></i>'
|
||||
};
|
||||
|
||||
var HFEAdmin = {
|
||||
|
||||
/**
|
||||
* Start the engine.
|
||||
*
|
||||
* @since 1.3.9
|
||||
*/
|
||||
_init: function() {
|
||||
|
||||
var ehf_hide_shortcode_field = function() {
|
||||
var selected = $('#ehf_template_type').val() || 'none';
|
||||
$( '.hfe-options-table' ).removeClass().addClass( 'hfe-options-table widefat hfe-selected-template-type-' + selected );
|
||||
}
|
||||
|
||||
var $document = $( document );
|
||||
|
||||
$document.on( 'change', '#ehf_template_type', function( e ) {
|
||||
ehf_hide_shortcode_field();
|
||||
});
|
||||
|
||||
ehf_hide_shortcode_field();
|
||||
|
||||
// Templates page modal popup.
|
||||
HFEAdmin._display_modal();
|
||||
|
||||
$( '.hfe-subscribe-field' ).on( 'keyup', function( e ) {
|
||||
$( '.hfe-subscribe-message' ).remove();
|
||||
});
|
||||
|
||||
$document.on( 'focusout change', '.hfe-subscribe-field', HFEAdmin._validate_single_field );
|
||||
$document.on( 'click input', '.hfe-subscribe-field', HFEAdmin._animate_fields );
|
||||
|
||||
$document.on( 'click', '.hfe-guide-content .submit-1', HFEAdmin._step_one_subscribe );
|
||||
$document.on( 'click', '.hfe-guide-content .submit-2', HFEAdmin._step_two_subscribe );
|
||||
|
||||
$document.on('click', '.hfe-guide-content .button-subscription-skip', HFEAdmin._close_modal );
|
||||
|
||||
// About us - addons functionality.
|
||||
if ( $( '.hfe-admin-addons' ).length ) {
|
||||
|
||||
$document.on( 'click', '.hfe-admin-addons .addon-item button', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
if ( $( this ).hasClass( 'disabled' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HFEAdmin._addons( $( this ) );
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
if( "yes" === hfe_admin_data.show_all_hfe ) {
|
||||
// Add the "View All" button next to the "Add New" button.
|
||||
const addNewButton = document.querySelector('.page-title-action');
|
||||
if ( addNewButton ) {
|
||||
// Create the new button.
|
||||
const customButton = document.createElement('a');
|
||||
customButton.href = hfe_admin_data.hfe_edit_url;
|
||||
customButton.textContent = hfe_admin_data.view_all_text;
|
||||
customButton.className = 'page-title-action';
|
||||
customButton.style.marginLeft = '10px';
|
||||
addNewButton.insertAdjacentElement('afterend', customButton);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_animate_fields: function ( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var parentWrapper = $( this ).parents( '.hfe-input-container' );
|
||||
parentWrapper.addClass( 'subscription-anim' );
|
||||
},
|
||||
|
||||
_validate_single_field: function ( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
HFEAdmin._validate_field( event.target );
|
||||
},
|
||||
|
||||
_validate_field: function ( target ) {
|
||||
|
||||
var field = $( target );
|
||||
var fieldValue = field.val() || '';
|
||||
var parentWrapper = field.parents( '.hfe-input-container' );
|
||||
var fieldStatus = fieldValue.length ? true : false;
|
||||
|
||||
if ( ( field.hasClass( 'hfe-subscribe-email' ) && false === HFEAdmin._is_valid_email( fieldValue ) )) {
|
||||
fieldStatus = false;
|
||||
}
|
||||
|
||||
if ( fieldStatus ) {
|
||||
parentWrapper.removeClass( 'subscription-error' ).addClass( 'subscription-success' );
|
||||
} else {
|
||||
parentWrapper.removeClass( 'subscription-success subscription-anim' ).addClass( 'subscription-error' );
|
||||
|
||||
if ( field.hasClass( 'hfe-subscribe-email' ) && fieldValue.length ) {
|
||||
parentWrapper.addClass( 'subscription-anim' );
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Subscribe Form Step One
|
||||
*
|
||||
*/
|
||||
_step_one_subscribe: function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
var form_one_wrapper = $( '.hfe-subscription-step-1' );
|
||||
|
||||
var first_name_field = form_one_wrapper.find( '.hfe-subscribe-field[name="hfe_subscribe_name"]' );
|
||||
var email_field = form_one_wrapper.find( '.hfe-subscribe-field[name="hfe_subscribe_email"]' );
|
||||
|
||||
HFEAdmin._validate_field( first_name_field );
|
||||
HFEAdmin._validate_field( email_field );
|
||||
|
||||
if ( form_one_wrapper.find( '.hfe-input-container' ).hasClass( 'subscription-error' )) {
|
||||
return;
|
||||
}
|
||||
|
||||
$( '.hfe-guide-content' ).addClass( 'hfe-subscription-step-2-active' ).removeClass( 'hfe-subscription-step-1-active' );
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Subscribe Form
|
||||
*
|
||||
*/
|
||||
_step_two_subscribe: function( event ) {
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
var submit_button = $(this);
|
||||
|
||||
var is_modal = $( '.hfe-guide-modal-popup.hfe-show' );
|
||||
|
||||
var first_name_field = $('.hfe-subscribe-field[name="hfe_subscribe_name"]');
|
||||
var email_field = $('.hfe-subscribe-field[name="hfe_subscribe_email"]');
|
||||
var user_type_field = $('.hfe-subscribe-field[name="wp_user_type"]');
|
||||
var build_for_field = $('.hfe-subscribe-field[name="build_website_for"]');
|
||||
var accept_field = $('.hfe_subscribe_accept[name="hfe_subscribe_accept"]');
|
||||
|
||||
var subscription_first_name = first_name_field.val() || '';
|
||||
var subscription_email = email_field.val() || '';
|
||||
var subscription_user_type = user_type_field.val() || '';
|
||||
var subscription_build_for = build_for_field.val() || '';
|
||||
var button_text = submit_button.find( '.hfe-submit-button-text' );
|
||||
var subscription_accept = accept_field.is( ':checked' ) ? '1' : '0';
|
||||
|
||||
HFEAdmin._validate_field( first_name_field );
|
||||
HFEAdmin._validate_field( email_field );
|
||||
HFEAdmin._validate_field( user_type_field );
|
||||
HFEAdmin._validate_field( build_for_field );
|
||||
|
||||
$( '.hfe-subscribe-message' ).remove();
|
||||
|
||||
if ( $( '.hfe-input-container' ).hasClass( 'subscription-error' )) {
|
||||
return;
|
||||
}
|
||||
|
||||
submit_button.removeClass( 'submitted' );
|
||||
|
||||
if( ! submit_button.hasClass( 'submitting' ) ) {
|
||||
submit_button.addClass( 'submitting' );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
var subscription_fields = {
|
||||
EMAIL: subscription_email,
|
||||
FIRSTNAME: subscription_first_name,
|
||||
PAGE_BUILDER: "1",
|
||||
WP_USER_TYPE: subscription_user_type,
|
||||
BUILD_WEBSITE_FOR: subscription_build_for,
|
||||
OPT_IN: subscription_accept,
|
||||
SOURCE: hfe_admin_data.data_source
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url : hfe_admin_data.ajax_url,
|
||||
type : 'POST',
|
||||
data : {
|
||||
action : 'hfe-update-subscription',
|
||||
nonce : hfe_admin_data.nonce,
|
||||
data: JSON.stringify( subscription_fields ),
|
||||
},
|
||||
beforeSend: function() {
|
||||
console.groupCollapsed( 'Email Subscription' );
|
||||
|
||||
button_text.append( '<span class="dashicons dashicons-update hfe-loader"></span>' );
|
||||
|
||||
},
|
||||
})
|
||||
.done( function ( response ) {
|
||||
|
||||
$( '.hfe-loader.dashicons-update' ).remove();
|
||||
|
||||
submit_button.removeClass( 'submitting' ).addClass('submitted');
|
||||
|
||||
if( response.success === true ) {
|
||||
$('.hfe-admin-about-section form').trigger( "reset" );
|
||||
$( '.hfe-input-container' ).removeClass( 'subscription-success subscription-anim' );
|
||||
|
||||
submit_button.after( '<span class="hfe-subscribe-message success">' + hfe_admin_data.subscribe_success + '</span>' );
|
||||
} else {
|
||||
submit_button.after( '<span class="hfe-subscribe-message error">' + hfe_admin_data.subscribe_error + '</span>' );
|
||||
}
|
||||
|
||||
if( is_modal.length ) {
|
||||
window.setTimeout( function () {
|
||||
window.location = $( '.hfe-guide-modal-popup' ).data( 'new-page' );
|
||||
}, 3000 );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* email Validation
|
||||
*
|
||||
*/
|
||||
_is_valid_email: function(eMail) {
|
||||
if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test( eMail ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Display the Modal Popup
|
||||
*
|
||||
*/
|
||||
_display_modal: function() {
|
||||
var hf_new_post = $( '.post-type-elementor-hf' ).find( '.page-title-action' );
|
||||
|
||||
var modal_wrapper = $( '.hfe-guide-modal-popup' );
|
||||
var display_allow = hfe_admin_data.popup_dismiss;
|
||||
|
||||
if( 'dismissed' !== display_allow[0] ) {
|
||||
// Display Modal Popup on click of Add new button.
|
||||
hf_new_post.on( 'click', function(e) {
|
||||
if( modal_wrapper.length && ! modal_wrapper.hasClass( 'hfe-show' ) ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
modal_wrapper.addClass( 'hfe-show' );
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the Modal Popup
|
||||
*
|
||||
*/
|
||||
_close_modal: function() {
|
||||
var modal_wrapper = $( '.hfe-guide-modal-popup' );
|
||||
var new_page_link = modal_wrapper.data( 'new-page' );
|
||||
|
||||
$.ajax({
|
||||
url: hfe_admin_data.ajax_url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action : 'hfe_admin_modal',
|
||||
nonce : hfe_admin_data.nonce,
|
||||
},
|
||||
});
|
||||
|
||||
if( modal_wrapper.hasClass( 'hfe-show' ) ) {
|
||||
modal_wrapper.removeClass( 'hfe-show' );
|
||||
}
|
||||
|
||||
window.location = new_page_link;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle addon state.
|
||||
*/
|
||||
_addons: function( $button ) {
|
||||
|
||||
var $addon = $button.closest( '.addon-item' ),
|
||||
plugin = $button.attr( 'data-plugin' ),
|
||||
addonType = $button.attr( 'data-type' ),
|
||||
addonSlug = $button.attr( 'data-slug' ),
|
||||
addonFile = $button.attr( 'data-file' ),
|
||||
state,
|
||||
cssClass,
|
||||
stateText,
|
||||
buttonText,
|
||||
errorText,
|
||||
successText;
|
||||
|
||||
if ( $button.hasClass( 'status-go-to-url' ) ) {
|
||||
|
||||
// Open url in new tab.
|
||||
window.open( $button.attr( 'data-site' ), '_blank' );
|
||||
return;
|
||||
}
|
||||
|
||||
$button.prop( 'disabled', true ).addClass( 'loading' );
|
||||
$button.html( '<span class="dashicons dashicons-update hfe-loader"></span>' );
|
||||
|
||||
if ( $button.hasClass( 'status-active' ) ) {
|
||||
|
||||
// Deactivate.
|
||||
state = 'deactivate';
|
||||
cssClass = 'status-inactive';
|
||||
cssClass += ' button button-secondary';
|
||||
stateText = hfe_admin_data.addon_inactive;
|
||||
buttonText = hfe_admin_data.addon_activate;
|
||||
errorText = hfe_admin_data.addon_deactivate;
|
||||
|
||||
} else if ( $button.hasClass( 'status-inactive' ) ) {
|
||||
|
||||
// Activate.
|
||||
state = 'activate';
|
||||
cssClass = 'status-active';
|
||||
cssClass += ' button button-secondary disabled';
|
||||
stateText = hfe_admin_data.addon_active;
|
||||
buttonText = hfe_admin_data.addon_deactivate;
|
||||
buttonText = hfe_admin_data.addon_activated;
|
||||
errorText = hfe_admin_data.addon_activate;
|
||||
|
||||
} else if ( $button.hasClass( 'status-download' ) ) {
|
||||
|
||||
// Install & Activate.
|
||||
state = 'install';
|
||||
cssClass = 'status-active';
|
||||
cssClass += ' button disabled';
|
||||
stateText = hfe_admin_data.addon_active;
|
||||
buttonText = hfe_admin_data.addon_activated;
|
||||
errorText = settings.iconInstall;
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
HFEAdmin._set_addon_state( plugin, state, addonType, addonSlug, function( res ) {
|
||||
|
||||
if ( res.success ) {
|
||||
if ( 'install' === state ) {
|
||||
successText = res.msg;
|
||||
$button.attr( 'data-plugin', addonFile );
|
||||
|
||||
stateText = hfe_admin_data.addon_inactive;
|
||||
buttonText = ( addonType === 'theme' || addonType === 'plugin' ) ? hfe_admin_data.addon_activate : settings.iconActivate + hfe_admin_data.addon_activate;
|
||||
cssClass = ( addonType === 'theme' || addonType === 'plugin' ) ? 'status-inactive button button-secondary' : 'status-inactive';
|
||||
} else {
|
||||
successText = res.data;
|
||||
}
|
||||
$addon.find( '.actions' ).append( '<div class="msg success">' + successText + '</div>' );
|
||||
$addon.find( 'span.status-label' )
|
||||
.removeClass( 'status-active status-inactive status-download' )
|
||||
.addClass( cssClass )
|
||||
.removeClass( 'button button-primary button-secondary disabled' )
|
||||
.text( stateText );
|
||||
$button
|
||||
.removeClass( 'status-active status-inactive status-download' )
|
||||
.removeClass( 'button button-primary button-secondary disabled' )
|
||||
.addClass( cssClass ).html( buttonText );
|
||||
} else {
|
||||
|
||||
if ( 'install' === state && ( addonType === 'theme' || addonType === 'plugin' ) ) {
|
||||
$addon.find( '.actions' ).append( '<div class="msg error">' + res.msg + '</div>' );
|
||||
$button.addClass( 'status-go-to-url' ).removeClass( 'status-download' );
|
||||
} else {
|
||||
var error_msg = ( 'object' === typeof res.data ) ? hfe_admin_data.plugin_error : res.data;
|
||||
$addon.find( '.actions' ).append( '<div class="msg error">' + error_msg + '</div>' );
|
||||
}
|
||||
|
||||
if( 'ultimate-elementor' === addonSlug ) {
|
||||
$button.addClass( 'status-go-to-url' );
|
||||
$button.html( hfe_admin_data.visit_site );
|
||||
} else {
|
||||
$button.html( hfe_admin_data.addon_download );
|
||||
}
|
||||
}
|
||||
|
||||
$button.prop( 'disabled', false ).removeClass( 'loading' );
|
||||
|
||||
// Automatically clear the messages after 3 seconds.
|
||||
setTimeout( function() {
|
||||
$( '.addon-item .msg' ).remove();
|
||||
}, 3000 );
|
||||
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Change plugin/addon state.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @param {string} plugin Plugin/Theme URL for download.
|
||||
* @param {string} state State status activate|deactivate|install.
|
||||
* @param {string} addonType Plugin/Theme type addon or plugin.
|
||||
* @param {string} addonSlug Plugin/Theme slug addon or plugin.
|
||||
* @param {Function} callback Callback for get result from AJAX.
|
||||
*/
|
||||
_set_addon_state: function( plugin, state, addonType, addonSlug, callback ) {
|
||||
|
||||
var actions = {
|
||||
'activate': 'hfe_activate_addon',
|
||||
'install': '',
|
||||
},
|
||||
action = actions[ state ];
|
||||
|
||||
if ( ! action && 'install' !== state ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data_result = {
|
||||
success : false,
|
||||
msg : hfe_admin_data.subscribe_error,
|
||||
};
|
||||
|
||||
if( 'install' === state ) {
|
||||
|
||||
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
|
||||
wp.updates.requestFilesystemCredentials();
|
||||
}
|
||||
|
||||
if( 'theme' === addonType ) {
|
||||
|
||||
wp.updates.installTheme ( {
|
||||
slug: addonSlug,
|
||||
success: function() {
|
||||
data_result.success = true;
|
||||
data_result.msg = hfe_admin_data.theme_installed;
|
||||
|
||||
},
|
||||
error: function( xhr ) {
|
||||
console.log( xhr.errorCode );
|
||||
if ( 'folder_exists' === xhr.errorCode ) {
|
||||
data_result.success = true;
|
||||
data_result.msg = hfe_admin_data.addon_exists;
|
||||
} else {
|
||||
data_result.success = false;
|
||||
data_result.msg = hfe_admin_data.plugin_error;
|
||||
}
|
||||
},
|
||||
}).always( function () {
|
||||
callback( data_result );
|
||||
});
|
||||
|
||||
} else if( 'plugin' === addonType ) {
|
||||
|
||||
wp.updates.installPlugin ( {
|
||||
slug: addonSlug,
|
||||
success: function() {
|
||||
data_result.success = true;
|
||||
data_result.msg = hfe_admin_data.plugin_installed;
|
||||
},
|
||||
error: function( xhr ) {
|
||||
console.log( xhr.errorCode );
|
||||
if ( 'folder_exists' === xhr.errorCode ) {
|
||||
data_result.success = true;
|
||||
data_result.msg = hfe_admin_data.addon_exists;
|
||||
} else {
|
||||
data_result.success = false;
|
||||
data_result.msg = hfe_admin_data.plugin_error;
|
||||
}
|
||||
},
|
||||
}).always( function () {
|
||||
callback( data_result );
|
||||
});
|
||||
}
|
||||
|
||||
} else if( 'activate' === state ) {
|
||||
|
||||
var data = {
|
||||
action: action,
|
||||
nonce: hfe_admin_data.nonce,
|
||||
plugin: plugin,
|
||||
type: addonType,
|
||||
slug: addonSlug
|
||||
};
|
||||
|
||||
$.post( hfe_admin_data.ajax_url, data, function( res ) {
|
||||
callback( res );
|
||||
} ).fail( function( xhr ) {
|
||||
console.log( xhr.responseText );
|
||||
} );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$( document ).ready( function( e ) {
|
||||
HFEAdmin._init();
|
||||
});
|
||||
|
||||
window.HFEAdmin = HFEAdmin;
|
||||
|
||||
} )( jQuery );
|
||||
Reference in New Issue
Block a user