first commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
(function($) {
|
||||
|
||||
$(document).ready(function($){
|
||||
|
||||
// Hide Custom Url if image link is not set to custom url
|
||||
$('body').on('change', '.oceanwp-container select[id$="images_link"]', function(e){
|
||||
var images_link = $(this);
|
||||
if ( images_link.val() != 'custom_url' ) {
|
||||
images_link.closest('.oceanwp-container').find('input[id$="custom_url"]').val('').parent().animate({opacity: 'hide' , height: 'hide'}, 200);
|
||||
} else {
|
||||
images_link.closest('.oceanwp-container').find('input[id$="custom_url"]').parent().animate({opacity: 'show' , height: 'show'}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
// Modfiy options when search for is changed
|
||||
$('body').on('change', '.oceanwp-container input:radio[id$="search_for"]', function(e){
|
||||
var search_for = $(this);
|
||||
if ( search_for.val() != 'username' ) {
|
||||
search_for.closest('.oceanwp-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
||||
search_for.closest('.oceanwp-container').find('select[id$="images_link"]').val('image_url');
|
||||
search_for.closest('.oceanwp-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'show' , height: 'show'}, 200);
|
||||
search_for.closest('.oceanwp-container').find('.oceanwp-header-wrap').animate({opacity: 'hide' , height: 'hide'}, 200);
|
||||
} else {
|
||||
search_for.closest('.oceanwp-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'show' , height: 'show'}, 200);
|
||||
search_for.closest('.oceanwp-container').find('select[id$="images_link"]').val('image_url');
|
||||
search_for.closest('.oceanwp-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'hide' , height: 'hide'}, 200);
|
||||
search_for.closest('.oceanwp-container').find('.oceanwp-header-wrap').animate({opacity: 'show' , height: 'show'}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
// Hide header infos if display header is not set to yesurl
|
||||
$('body').on('change', '.oceanwp-container select[id$="display_header"]', function(e){
|
||||
var display_header = $(this);
|
||||
if ( display_header.val() != 'yes' ) {
|
||||
display_header.closest('.oceanwp-container').find('.oceanwp-display-header-options').animate({opacity: 'hide' , height: 'hide'}, 200);
|
||||
} else {
|
||||
display_header.closest('.oceanwp-container').find('.oceanwp-display-header-options').animate({opacity: 'show' , height: 'show'}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
}); // Document Ready
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(n){n("body").on("change",'.oceanwp-container select[id$="images_link"]',function(e){var i=n(this);"custom_url"!=i.val()?i.closest(".oceanwp-container").find('input[id$="custom_url"]').val("").parent().animate({opacity:"hide",height:"hide"},200):i.closest(".oceanwp-container").find('input[id$="custom_url"]').parent().animate({opacity:"show",height:"show"},200)}),n("body").on("change",'.oceanwp-container input:radio[id$="search_for"]',function(e){var i=n(this);"username"!=i.val()?(i.closest(".oceanwp-container").find('select[id$="images_link"] option[value="user_url"]').animate({opacity:"hide",height:"hide"},200),i.closest(".oceanwp-container").find('select[id$="images_link"]').val("image_url"),i.closest(".oceanwp-container").find('input[id$="blocked_users"]').closest("p").animate({opacity:"show",height:"show"},200),i.closest(".oceanwp-container").find(".oceanwp-header-wrap").animate({opacity:"hide",height:"hide"},200)):(i.closest(".oceanwp-container").find('select[id$="images_link"] option[value="user_url"]').animate({opacity:"show",height:"show"},200),i.closest(".oceanwp-container").find('select[id$="images_link"]').val("image_url"),i.closest(".oceanwp-container").find('input[id$="blocked_users"]').closest("p").animate({opacity:"hide",height:"hide"},200),i.closest(".oceanwp-container").find(".oceanwp-header-wrap").animate({opacity:"show",height:"show"},200))}),n("body").on("change",'.oceanwp-container select[id$="display_header"]',function(e){var i=n(this);"yes"!=i.val()?i.closest(".oceanwp-container").find(".oceanwp-display-header-options").animate({opacity:"hide",height:"hide"},200):i.closest(".oceanwp-container").find(".oceanwp-display-header-options").animate({opacity:"show",height:"show"},200)})});
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
$(".oceanwp-newsletter-form-wrap #mc-embedded-subscribe-form").on("submit", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = $(this);
|
||||
var email = element.find('.email').val();
|
||||
var valid = true;
|
||||
|
||||
element.find(".err-msg").hide();
|
||||
|
||||
if ($.trim(email).length == 0) {
|
||||
valid = false;
|
||||
element.find(".email-err.req").show();
|
||||
} else if (!isValidEmailAddress(email)) {
|
||||
valid = false;
|
||||
element.find(".email-err.not-valid").show();
|
||||
}
|
||||
|
||||
if (element.find(".gdpr").length && !element.find(".gdpr").is(":checked")) {
|
||||
valid = false;
|
||||
element.find(".gdpr-err.err-msg").show();
|
||||
}
|
||||
|
||||
element.find(".res-msg").hide();
|
||||
|
||||
if (valid) {
|
||||
element.find("button").attr("disabled", true);
|
||||
|
||||
var data = {
|
||||
action: "oceanwp_mailchimp_request",
|
||||
email: email,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: oceanwpLocalize.ajax_url,
|
||||
data: data,
|
||||
success: function( response ) {
|
||||
element.find("button").attr("disabled", false);
|
||||
|
||||
if (response.status) {
|
||||
element.find(".res-msg.success").show().delay(5000).fadeOut();
|
||||
} else {
|
||||
element.find(".res-msg.failed").show().delay(5000).fadeOut();
|
||||
}
|
||||
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function isValidEmailAddress(emailAddress) {
|
||||
var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
|
||||
return pattern.test(emailAddress);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
function isValidEmailAddress(e){return new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i).test(e)}jQuery(document).ready(function(n){n(".oceanwp-newsletter-form-wrap #mc-embedded-subscribe-form").on("submit",function(e){e.preventDefault();var d=n(this),i=d.find(".email").val(),a=!0;if(d.find(".err-msg").hide(),0==n.trim(i).length?(a=!1,d.find(".email-err.req").show()):isValidEmailAddress(i)||(a=!1,d.find(".email-err.not-valid").show()),d.find(".gdpr").length&&!d.find(".gdpr").is(":checked")&&(a=!1,d.find(".gdpr-err.err-msg").show()),d.find(".res-msg").hide(),a){d.find("button").attr("disabled",!0);var s={action:"oceanwp_mailchimp_request",email:i};n.ajax({type:"POST",url:oceanwpLocalize.ajax_url,data:s,success:function(e){d.find("button").attr("disabled",!1),e.status?d.find(".res-msg.success").show().delay(5e3).fadeOut():d.find(".res-msg.failed").show().delay(5e3).fadeOut()},complete:function(){}})}})});
|
||||
@@ -0,0 +1,14 @@
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
/* ==============================================
|
||||
ON CLICK
|
||||
============================================== */
|
||||
function owpShareOnClick( href ) {
|
||||
var windowWidth = '640',
|
||||
windowHeight = '480',
|
||||
windowTop = screen.height / 2 - windowHeight / 2,
|
||||
windowLeft = screen.width / 2 - windowWidth / 2,
|
||||
shareWindow = 'toolbar=0,status=0,width=' + windowWidth + ',height=' + windowHeight + ',top=' + windowTop + ',left=' + windowLeft;
|
||||
|
||||
open( href, '', shareWindow );
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var $j=jQuery.noConflict();function owpShareOnClick(t){var e=screen.height/2-240,n=screen.width/2-320;open(t,"","toolbar=0,status=0,width=640,height=480,top="+e+",left="+n)}
|
||||
Reference in New Issue
Block a user