Version Description
(16 AUG 2018) = * Fixed a minor DOMDocument warning that was appearing when data-pin-description was ON
Download this release
Release Info
Developer | WarfarePlugins |
Plugin | WordPress Social Sharing Plugin – Social Warfare |
Version | 3.2.1 |
Comparing to | |
See all releases |
Code changes from version 3.2.0 to 3.2.1
- .gitignore +0 -6
- README.md +0 -0
- css/admin-options-page.css +0 -0
- css/admin-options-page.min.css +0 -0
- css/admin-options.min.css +0 -0
- css/admin.css +0 -0
- css/admin.min.css +0 -0
- css/style.css +0 -0
- css/style.min.css +0 -0
- fonts/sw-icon-font.eot +0 -0
- fonts/sw-icon-font.svg +0 -0
- fonts/sw-icon-font.ttf +0 -0
- fonts/sw-icon-font.woff +0 -0
- functions/Social_Warfare.php +0 -0
- functions/admin/SWP_Click_To_Tweet.php +0 -0
- functions/admin/SWP_Column.php +0 -0
- functions/admin/SWP_Settings_Link.php +0 -0
- functions/admin/SWP_Shortcode_Generator.php +0 -0
- functions/admin/SWP_User_Profile.php +0 -0
- functions/admin/assets/css/admin.css +0 -0
- functions/admin/assets/css/style1.css +0 -0
- functions/admin/assets/css/style2.css +0 -0
- functions/admin/assets/css/style3.css +0 -0
- functions/admin/assets/css/style4.css +0 -0
- functions/admin/assets/css/styles.css +0 -0
- functions/admin/assets/img/twitter-little-bird-button.png +0 -0
- functions/admin/assets/img/twitter-little-bird-white.png +0 -0
- functions/admin/assets/img/twitter-little-bird.png +0 -0
- functions/admin/assets/js/clickToTweet.js +0 -0
- functions/admin/assets/js/clickToTweet.min.js +0 -0
- functions/admin/assets/js/tmclicktotweet_plugin.js +0 -0
- functions/admin/options-fetch.php +0 -0
- functions/admin/options-registration.php +0 -0
- functions/admin/registration.php +0 -0
- functions/admin/swp_system_checker.php +0 -0
- functions/frontend-output/SWP_Buttons_Panel.php +0 -0
- functions/frontend-output/SWP_Display.php +0 -0
- functions/frontend-output/SWP_Header_Output.php +0 -0
- functions/frontend-output/SWP_Option_Page_Registration.php +0 -0
- functions/frontend-output/SWP_Script.php +0 -0
- functions/frontend-output/SWP_Shortcode.php +0 -0
- functions/includes/SWP_Addon.php +0 -0
- functions/includes/registration.php +0 -0
- functions/options/SWP_Addon_Registration.php +0 -0
- functions/options/SWP_Option.php +0 -0
- functions/options/SWP_Option_Icons.php +0 -0
- functions/options/SWP_Option_Select.php +0 -0
- functions/options/SWP_Option_Text.php +0 -0
- functions/options/SWP_Option_Textarea.php +0 -0
- functions/options/SWP_Option_Toggle.php +0 -0
- functions/options/SWP_Options_Page.php +0 -0
- functions/options/SWP_Options_Page_Section.php +0 -0
- functions/options/SWP_Options_Page_Tab.php +0 -0
- functions/options/SWP_Section_HTML.php +0 -0
- functions/options/SWP_User_Options.php +0 -0
- functions/social-networks/SWP_Facebook.php +0 -0
- functions/social-networks/SWP_Google_Plus.php +0 -0
- functions/social-networks/SWP_Linkedin.php +0 -0
- functions/social-networks/SWP_Pinterest.php +0 -0
- functions/social-networks/SWP_Social_Network.php +0 -0
- functions/social-networks/SWP_Social_Networks_Loader.php +0 -0
- functions/social-networks/SWP_Stumble_Upon.php +0 -0
- functions/social-networks/SWP_Twitter.php +0 -0
- functions/utilities/SWP_Abstract.php +0 -0
- functions/utilities/SWP_CURL.php +0 -0
- functions/utilities/SWP_Compatibility.php +0 -0
- functions/utilities/SWP_Database_Migration.php +0 -0
- functions/utilities/SWP_JSON_Cache_Handler.php +0 -0
- functions/utilities/SWP_Localization.php +0 -0
- functions/utilities/SWP_Notice.php +0 -0
- functions/utilities/SWP_Notice_Loader.php +0 -0
- functions/utilities/SWP_Permalink.php +0 -0
- functions/utilities/SWP_Plugin_Updater.php +0 -0
- functions/utilities/SWP_Post_Cache.php +0 -0
- functions/utilities/SWP_Post_Cache_Loader.php +0 -0
- functions/utilities/SWP_URL_Management.php +0 -0
- functions/utilities/SWP_Utility_Trait.php +0 -0
- functions/utilities/utility.php +0 -0
- functions/widgets/SWP_Popular_Posts_Widget.php +0 -0
- functions/widgets/SWP_Widget.php +0 -0
- images/admin-options-page/Thumbs.db +0 -0
- images/admin-options-page/affiliate-300x150.jpg +0 -0
- images/admin-options-page/measure-roi-300x150.jpg +0 -0
- images/admin-options-page/new_share_counts.png +0 -0
- images/admin-options-page/social-warfare-light.png +0 -0
- images/admin-options-page/social-warfare-pro-light.png +0 -0
- images/admin-options-page/socialwarfare-20x20.png +0 -0
- images/admin-options-page/starter-guide-300x150.jpg +0 -0
- images/img-placeholder-og.jpg +0 -0
- images/img-placeholder-pin.jpg +0 -0
- js/admin-options-page.js +0 -0
- js/admin-options-page.min.js +0 -0
- js/admin.js +356 -356
- js/admin.min.js +0 -0
- js/script.js +0 -0
- js/script.min.js +0 -0
- js/sw-shortcode-generator.js +0 -0
- js/sw-shortcode-generator.min.js +0 -0
- languages/social-warfare-da-DK.mo +0 -0
- languages/social-warfare-de_DE.mo +0 -0
- languages/social-warfare-en_US.mo +0 -0
- languages/social-warfare-es_ES.mo +0 -0
- languages/social-warfare-fr_FR.mo +0 -0
- languages/social-warfare-hy.mo +0 -0
- languages/social-warfare-it_IT.mo +0 -0
- languages/social-warfare-pt_BR.mo +0 -0
- languages/social-warfare-pt_PT.mo +0 -0
- languages/social-warfare-ru_RU.mo +0 -0
- languages/social-warfare-uk.mo +0 -0
- languages/social-warfare.pot +0 -0
- languages/social_warfare-el_EL.mo +0 -0
- languages/social_warfare-nl_NL.mo +0 -0
- readme.txt +4 -1
- social-warfare.php +2 -2
.gitignore
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
functions/admin/SWP_Options_Pseudo_Code.php
|
2 |
-
functions/options/options-page-working.php
|
3 |
-
functions/options/options.txt
|
4 |
-
remote-sync.json
|
5 |
-
.remote-sync.json
|
6 |
-
.DS_Store
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
File without changes
|
css/admin-options-page.css
CHANGED
File without changes
|
css/admin-options-page.min.css
CHANGED
File without changes
|
css/admin-options.min.css
CHANGED
File without changes
|
css/admin.css
CHANGED
File without changes
|
css/admin.min.css
CHANGED
File without changes
|
css/style.css
CHANGED
File without changes
|
css/style.min.css
CHANGED
File without changes
|
fonts/sw-icon-font.eot
CHANGED
File without changes
|
fonts/sw-icon-font.svg
CHANGED
File without changes
|
fonts/sw-icon-font.ttf
CHANGED
File without changes
|
fonts/sw-icon-font.woff
CHANGED
File without changes
|
functions/Social_Warfare.php
CHANGED
File without changes
|
functions/admin/SWP_Click_To_Tweet.php
CHANGED
File without changes
|
functions/admin/SWP_Column.php
CHANGED
File without changes
|
functions/admin/SWP_Settings_Link.php
CHANGED
File without changes
|
functions/admin/SWP_Shortcode_Generator.php
CHANGED
File without changes
|
functions/admin/SWP_User_Profile.php
CHANGED
File without changes
|
functions/admin/assets/css/admin.css
CHANGED
File without changes
|
functions/admin/assets/css/style1.css
CHANGED
File without changes
|
functions/admin/assets/css/style2.css
CHANGED
File without changes
|
functions/admin/assets/css/style3.css
CHANGED
File without changes
|
functions/admin/assets/css/style4.css
CHANGED
File without changes
|
functions/admin/assets/css/styles.css
CHANGED
File without changes
|
functions/admin/assets/img/twitter-little-bird-button.png
CHANGED
File without changes
|
functions/admin/assets/img/twitter-little-bird-white.png
CHANGED
File without changes
|
functions/admin/assets/img/twitter-little-bird.png
CHANGED
File without changes
|
functions/admin/assets/js/clickToTweet.js
CHANGED
File without changes
|
functions/admin/assets/js/clickToTweet.min.js
CHANGED
File without changes
|
functions/admin/assets/js/tmclicktotweet_plugin.js
CHANGED
File without changes
|
functions/admin/options-fetch.php
CHANGED
File without changes
|
functions/admin/options-registration.php
CHANGED
File without changes
|
functions/admin/registration.php
CHANGED
File without changes
|
functions/admin/swp_system_checker.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Buttons_Panel.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Display.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Header_Output.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Option_Page_Registration.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Script.php
CHANGED
File without changes
|
functions/frontend-output/SWP_Shortcode.php
CHANGED
File without changes
|
functions/includes/SWP_Addon.php
CHANGED
File without changes
|
functions/includes/registration.php
CHANGED
File without changes
|
functions/options/SWP_Addon_Registration.php
CHANGED
File without changes
|
functions/options/SWP_Option.php
CHANGED
File without changes
|
functions/options/SWP_Option_Icons.php
CHANGED
File without changes
|
functions/options/SWP_Option_Select.php
CHANGED
File without changes
|
functions/options/SWP_Option_Text.php
CHANGED
File without changes
|
functions/options/SWP_Option_Textarea.php
CHANGED
File without changes
|
functions/options/SWP_Option_Toggle.php
CHANGED
File without changes
|
functions/options/SWP_Options_Page.php
CHANGED
File without changes
|
functions/options/SWP_Options_Page_Section.php
CHANGED
File without changes
|
functions/options/SWP_Options_Page_Tab.php
CHANGED
File without changes
|
functions/options/SWP_Section_HTML.php
CHANGED
File without changes
|
functions/options/SWP_User_Options.php
CHANGED
File without changes
|
functions/social-networks/SWP_Facebook.php
CHANGED
File without changes
|
functions/social-networks/SWP_Google_Plus.php
CHANGED
File without changes
|
functions/social-networks/SWP_Linkedin.php
CHANGED
File without changes
|
functions/social-networks/SWP_Pinterest.php
CHANGED
File without changes
|
functions/social-networks/SWP_Social_Network.php
CHANGED
File without changes
|
functions/social-networks/SWP_Social_Networks_Loader.php
CHANGED
File without changes
|
functions/social-networks/SWP_Stumble_Upon.php
CHANGED
File without changes
|
functions/social-networks/SWP_Twitter.php
CHANGED
File without changes
|
functions/utilities/SWP_Abstract.php
CHANGED
File without changes
|
functions/utilities/SWP_CURL.php
CHANGED
File without changes
|
functions/utilities/SWP_Compatibility.php
CHANGED
File without changes
|
functions/utilities/SWP_Database_Migration.php
CHANGED
File without changes
|
functions/utilities/SWP_JSON_Cache_Handler.php
CHANGED
File without changes
|
functions/utilities/SWP_Localization.php
CHANGED
File without changes
|
functions/utilities/SWP_Notice.php
CHANGED
File without changes
|
functions/utilities/SWP_Notice_Loader.php
CHANGED
File without changes
|
functions/utilities/SWP_Permalink.php
CHANGED
File without changes
|
functions/utilities/SWP_Plugin_Updater.php
CHANGED
File without changes
|
functions/utilities/SWP_Post_Cache.php
CHANGED
File without changes
|
functions/utilities/SWP_Post_Cache_Loader.php
CHANGED
File without changes
|
functions/utilities/SWP_URL_Management.php
CHANGED
File without changes
|
functions/utilities/SWP_Utility_Trait.php
CHANGED
File without changes
|
functions/utilities/utility.php
CHANGED
File without changes
|
functions/widgets/SWP_Popular_Posts_Widget.php
CHANGED
File without changes
|
functions/widgets/SWP_Widget.php
CHANGED
File without changes
|
images/admin-options-page/Thumbs.db
ADDED
Binary file
|
images/admin-options-page/affiliate-300x150.jpg
CHANGED
File without changes
|
images/admin-options-page/measure-roi-300x150.jpg
CHANGED
File without changes
|
images/admin-options-page/new_share_counts.png
CHANGED
File without changes
|
images/admin-options-page/social-warfare-light.png
CHANGED
File without changes
|
images/admin-options-page/social-warfare-pro-light.png
CHANGED
File without changes
|
images/admin-options-page/socialwarfare-20x20.png
CHANGED
File without changes
|
images/admin-options-page/starter-guide-300x150.jpg
CHANGED
File without changes
|
images/img-placeholder-og.jpg
CHANGED
File without changes
|
images/img-placeholder-pin.jpg
CHANGED
File without changes
|
js/admin-options-page.js
CHANGED
File without changes
|
js/admin-options-page.min.js
CHANGED
File without changes
|
js/admin.js
CHANGED
@@ -1,356 +1,356 @@
|
|
1 |
-
/**
|
2 |
-
*
|
3 |
-
* Functions for widgets and global utility functions.
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package SocialWarfare\Admin\Functions
|
7 |
-
* @copyright Copyright (c) 2018, Warfare Plugins, LLC
|
8 |
-
* @license GPL-3.0+
|
9 |
-
*/
|
10 |
-
|
11 |
-
var socialWarfareAdmin = socialWarfareAdmin || {};
|
12 |
-
var swpWidget, widgetSubmit;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Show and hide input fields based on conditional values.
|
16 |
-
*
|
17 |
-
* This function iterates over each element with the "dep" data attribute. For each
|
18 |
-
* such dependant element, its parent element controls whether the dependant is shown or hidden
|
19 |
-
* if the parent's value matches the condition.
|
20 |
-
*
|
21 |
-
* @since 3.0.0 Feb 12 2018 | Brought func in from admin-options-page.js and set to global scope; Updated variable names for semantics, switched to Yoda condietionals.
|
22 |
-
* @since 3.0.0 Feb 14 2018 | Mapped the required array from variable types to string.
|
23 |
-
*
|
24 |
-
* @see admin-options-page.js
|
25 |
-
* @return none
|
26 |
-
*/
|
27 |
-
function swpConditionalFields() {
|
28 |
-
|
29 |
-
function swp_selected(name) {
|
30 |
-
return jQuery('select[name="' + name + '"]').val();
|
31 |
-
}
|
32 |
-
|
33 |
-
function swp_checked(name) {
|
34 |
-
return jQuery( '[name="' + name + '"]' ).prop( 'checked' );
|
35 |
-
}
|
36 |
-
|
37 |
-
function string_to_bool(string) {
|
38 |
-
if( string === 'true') { string = true };
|
39 |
-
if( string === 'false') { string = false };
|
40 |
-
return string;
|
41 |
-
}
|
42 |
-
|
43 |
-
// Loop through all the fields that have dependancies
|
44 |
-
jQuery( '[data-dep]' ).each( function() {
|
45 |
-
|
46 |
-
// Fetch the conditional values
|
47 |
-
var condition = jQuery(this).data( 'dep' );
|
48 |
-
var required = JSON.parse( JSON.stringify( jQuery(this).data( 'dep_val' ) ) );
|
49 |
-
|
50 |
-
// Check if we're on the options page or somewhere else
|
51 |
-
if (window.location.href.indexOf("page=social-warfare") === -1) {
|
52 |
-
var conditionEl = jQuery(this).parents('.widgets-holder-wrap').find( '[data-swp-name="' + condition + '"]' );
|
53 |
-
} else {
|
54 |
-
var conditionEl = jQuery( '[name="' + condition + '"]' )[0];
|
55 |
-
}
|
56 |
-
|
57 |
-
var value;
|
58 |
-
|
59 |
-
if (typeof conditionEl === 'undefined') {
|
60 |
-
conditionEl = jQuery( '[name="' + condition + '"]' )[0];
|
61 |
-
|
62 |
-
if (typeof conditionEl === 'undefined') {
|
63 |
-
conditionEl = jQuery( '[fieldjQuery=' + condition + ']' )[0];
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
// Fetch the value of checkboxes or other input types
|
68 |
-
if ( jQuery( conditionEl ).attr( 'type' ) == 'checkbox' ) {
|
69 |
-
value = jQuery( conditionEl ).prop( 'checked' );
|
70 |
-
} else {
|
71 |
-
value = jQuery( conditionEl ).val();
|
72 |
-
}
|
73 |
-
value = string_to_bool(value);
|
74 |
-
|
75 |
-
//* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
|
76 |
-
// Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
|
77 |
-
|
78 |
-
if (window.location.href.indexOf("page=social-warfare") !== -1) {
|
79 |
-
|
80 |
-
// If the required value matches and it's parent is also being shown, show this conditional field
|
81 |
-
if (jQuery.inArray( value, required ) !== -1 && jQuery( conditionEl ).parent( '.sw-grid' ).is( ':visible' ) ) {
|
82 |
-
jQuery(this).show();
|
83 |
-
} else {
|
84 |
-
jQuery(this).hide();
|
85 |
-
}
|
86 |
-
} else {
|
87 |
-
|
88 |
-
// If the required value matches, show this conditional field
|
89 |
-
if (jQuery.inArray( value, required ) !== -1 || value === required ) {
|
90 |
-
jQuery(this).show();
|
91 |
-
} else {
|
92 |
-
jQuery(this).hide();
|
93 |
-
}
|
94 |
-
}
|
95 |
-
});
|
96 |
-
|
97 |
-
if ( false === swp_checked('float_style_source') &&
|
98 |
-
'custom_color' === swp_selected('float_default_colors')
|
99 |
-
|| 'custom_color_outlines' === swp_selected('float_default_colors')
|
100 |
-
|| 'custom_color' === swp_selected('float_single_colors')
|
101 |
-
|| 'custom_color_outlines' === swp_selected('float_single_colors')
|
102 |
-
|| 'custom_color' === swp_selected('float_hover_colors')
|
103 |
-
|| 'custom_color_outlines' === swp_selected('float_hover_colors') ) {
|
104 |
-
jQuery( '.sideCustomColor_wrapper' ).slideDown();
|
105 |
-
|
106 |
-
} else {
|
107 |
-
jQuery( '.sideCustomColor_wrapper' ).slideUp();
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
//* Only run on widgets.php
|
112 |
-
if (window.location.href.indexOf("widgets.php") > -1 ) {
|
113 |
-
|
114 |
-
//* Make sure the elements exist before trying to read them.
|
115 |
-
var widgetFinder = setInterval(function() {
|
116 |
-
if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
|
117 |
-
|
118 |
-
swpWidget = jQuery("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
|
119 |
-
widgetSubmit = jQuery(swpWidget).find("[idjQuery=savewidget]")[0];
|
120 |
-
|
121 |
-
//* Force swpConditionalFields to run when the widget is opened or saved.
|
122 |
-
jQuery(swpWidget).on("click", swpConditionalFields);
|
123 |
-
jQuery(widgetSubmit).on("click", function() {
|
124 |
-
setTimeout(swpConditionalFields, 600);
|
125 |
-
});
|
126 |
-
|
127 |
-
}, 50);
|
128 |
-
}
|
129 |
-
|
130 |
-
(function( window, jQuery, undefined ) {
|
131 |
-
'use strict';
|
132 |
-
|
133 |
-
socialWarfareAdmin.linkLength = function( input ) {
|
134 |
-
var tmp = '';
|
135 |
-
|
136 |
-
for ( var i = 0; i < 23; i++ ) {
|
137 |
-
tmp += 'o';
|
138 |
-
}
|
139 |
-
|
140 |
-
return input.replace( /(http:\/\/[\S]*)/g, tmp ).length;
|
141 |
-
};
|
142 |
-
|
143 |
-
// Function for SM Title Counting
|
144 |
-
function smTitleRemaining() {
|
145 |
-
var smTitle = jQuery( '#social_warfare textarea#swp_og_title' ).val();
|
146 |
-
var remaining = 60 - smTitle.length;
|
147 |
-
if ( smTitle.length > 0 && remaining >= 0 ) {
|
148 |
-
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
149 |
-
} else if ( smTitle.length > 0 && remaining < 0 ) {
|
150 |
-
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
151 |
-
} else {
|
152 |
-
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
153 |
-
}
|
154 |
-
jQuery( '#social_warfare .swp_og_title .counterNumber' ).html( remaining );
|
155 |
-
}
|
156 |
-
|
157 |
-
// Function for SM Description Counting
|
158 |
-
function smDescriptionRemaining() {
|
159 |
-
var smDescription = jQuery( '#social_warfare textarea#swp_og_description' ).val();
|
160 |
-
var remaining = 160 - smDescription.length;
|
161 |
-
if ( smDescription.length > 0 && remaining >= 0 ) {
|
162 |
-
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
163 |
-
} else if ( smDescription.length > 0 && remaining < 0 ) {
|
164 |
-
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
165 |
-
} else {
|
166 |
-
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
167 |
-
}
|
168 |
-
jQuery( '#social_warfare .swp_og_description .counterNumber' ).html( remaining );
|
169 |
-
}
|
170 |
-
|
171 |
-
// Function for SM Description Counting
|
172 |
-
function swpPinterestRemaining() {
|
173 |
-
var pinterestDescription = jQuery( '#social_warfare textarea#swp_pinterest_description' ).val();
|
174 |
-
if (!pinterestDescription) {
|
175 |
-
pinterestDescription = '';
|
176 |
-
}
|
177 |
-
var remaining = 500 - pinterestDescription.length;
|
178 |
-
if ( pinterestDescription.length > 0 && remaining >= 0 ) {
|
179 |
-
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
180 |
-
} else if ( pinterestDescription.length > 0 && remaining < 0 ) {
|
181 |
-
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
182 |
-
} else {
|
183 |
-
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
184 |
-
}
|
185 |
-
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .counterNumber' ).html( remaining );
|
186 |
-
}
|
187 |
-
|
188 |
-
// Function for Twitter Box Counting
|
189 |
-
function twitterRemaining() {
|
190 |
-
var smTwitter = jQuery( '#social_warfare textarea#swp_custom_tweet' ).val();
|
191 |
-
var handle = jQuery( '#social_warfare .twitterIDWrapper label' ).html();
|
192 |
-
var linkSpace;
|
193 |
-
|
194 |
-
if ( smTwitter.indexOf( 'http' ) > -1 || smTwitter.indexOf( 'https' ) > -1 ) {
|
195 |
-
linkSpace = 0;
|
196 |
-
jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'line-through' });
|
197 |
-
} else {
|
198 |
-
linkSpace = 23;
|
199 |
-
jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'none' });
|
200 |
-
}
|
201 |
-
|
202 |
-
var remaining;
|
203 |
-
if ( 'undefined' === typeof handle ) {
|
204 |
-
remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace;
|
205 |
-
} else {
|
206 |
-
remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace - handle.length - 6;
|
207 |
-
}
|
208 |
-
|
209 |
-
if ( smTwitter.length > 0 && remaining >= 0 ) {
|
210 |
-
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
211 |
-
} else if ( smTwitter.length > 0 && remaining < 0 ) {
|
212 |
-
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
213 |
-
} else {
|
214 |
-
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
215 |
-
}
|
216 |
-
|
217 |
-
jQuery( '#social_warfare .swp_customTweetWrapper .counterNumber' ).html( remaining );
|
218 |
-
}
|
219 |
-
|
220 |
-
function toggleCustomThumbnailFields(show) {
|
221 |
-
if (typeof show === 'undefined') show = true;
|
222 |
-
|
223 |
-
if (show) {
|
224 |
-
jQuery(".custom_thumb_size").show();
|
225 |
-
}
|
226 |
-
else {
|
227 |
-
jQuery(".custom_thumb_size").hide();
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
function noticeClickHandlers() {
|
232 |
-
jQuery(".swp-notice-cta").on("click", function(e) {
|
233 |
-
e.preventDefault();
|
234 |
-
//* Do not use jQuery to get href.
|
235 |
-
var link = e.target.getAttribute("href");
|
236 |
-
|
237 |
-
if (typeof link == 'string' && link.length) {
|
238 |
-
window.open(link);
|
239 |
-
}
|
240 |
-
|
241 |
-
var parent = jQuery(this).parents(".swp-dismiss-notice");
|
242 |
-
|
243 |
-
jQuery.post({
|
244 |
-
url: ajaxurl,
|
245 |
-
data: {
|
246 |
-
action: 'dismiss',
|
247 |
-
key: parent.data("key"),
|
248 |
-
timeframe: this.dataset.timeframe
|
249 |
-
},
|
250 |
-
success: function(result) {
|
251 |
-
result = JSON.parse(result)
|
252 |
-
if (result) {
|
253 |
-
parent.slideUp(500);
|
254 |
-
}
|
255 |
-
}
|
256 |
-
});
|
257 |
-
});
|
258 |
-
}
|
259 |
-
|
260 |
-
jQuery( document ).ready( function() {
|
261 |
-
noticeClickHandlers();
|
262 |
-
|
263 |
-
if ( jQuery( '#social_warfare.postbox' ).length ) {
|
264 |
-
|
265 |
-
// Add the CountDown Box for the Social Media Title
|
266 |
-
jQuery( '#social_warfare #swp_og_title' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">60</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
267 |
-
|
268 |
-
// Add the CountDown Box for the Social Media Description
|
269 |
-
jQuery( '#social_warfare #swp_og_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">150</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
270 |
-
|
271 |
-
// Add the CountDown Box for the Twitter Box
|
272 |
-
jQuery( '#social_warfare #swp_customTweet' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">118</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
273 |
-
|
274 |
-
// Add the CountDown Box for the Pinterest Box
|
275 |
-
jQuery( '#social_warfare #swp_pinterest_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">140</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
276 |
-
|
277 |
-
smTitleRemaining();
|
278 |
-
jQuery( '#social_warfare textarea#swp_og_title' ).on( 'input', function() {
|
279 |
-
smTitleRemaining();
|
280 |
-
});
|
281 |
-
|
282 |
-
smDescriptionRemaining();
|
283 |
-
jQuery( '#social_warfare textarea#swp_og_description' ).on( 'input', function() {
|
284 |
-
smDescriptionRemaining();
|
285 |
-
});
|
286 |
-
|
287 |
-
twitterRemaining();
|
288 |
-
jQuery( '#social_warfare textarea#swp_customTweet' ).on( 'input', function() {
|
289 |
-
twitterRemaining();
|
290 |
-
});
|
291 |
-
|
292 |
-
swpPinterestRemaining();
|
293 |
-
jQuery( '#social_warfare textarea#swp_pinterest_description' ).on( 'input', function() {
|
294 |
-
swpPinterestRemaining();
|
295 |
-
});
|
296 |
-
|
297 |
-
// Setup an initilazation loop
|
298 |
-
var swpPostInit = setInterval( function() {
|
299 |
-
|
300 |
-
var swpOgImage = jQuery( '.swp_og_imageWrapper ul.swpmb-media-list' );
|
301 |
-
var swpPinImage = jQuery( '.swp_pinterest_imageWrapper ul.swpmb-media-list' );
|
302 |
-
|
303 |
-
var smWidth, smHeight;
|
304 |
-
|
305 |
-
// Check if the media list has been created yet
|
306 |
-
if ( swpOgImage.length && swpOgImage.is( ':empty' ) ) {
|
307 |
-
// Setup the Open Graph Image Placeholder
|
308 |
-
smWidth = swpOgImage.width();
|
309 |
-
smHeight = smWidth * ( 9 / 16 );
|
310 |
-
swpOgImage.css({ height: smHeight + 'px' });
|
311 |
-
} else {
|
312 |
-
smHeight = swpOgImage.find( 'img' ).height();
|
313 |
-
swpOgImage.css({ height: smHeight + 'px' });
|
314 |
-
}
|
315 |
-
|
316 |
-
var pinWidth, pinHeight;
|
317 |
-
|
318 |
-
if ( swpPinImage.length && swpPinImage.is( ':empty' ) ) {
|
319 |
-
// Setup the Open Graph Image Placeholder
|
320 |
-
pinWidth = swpPinImage.width();
|
321 |
-
pinHeight = pinWidth * ( 3 / 2 );
|
322 |
-
swpPinImage.css({ height: pinHeight + 'px' });
|
323 |
-
} else {
|
324 |
-
pinHeight = swpPinImage.find( 'img' ).height();
|
325 |
-
swpPinImage.css({
|
326 |
-
height: pinHeight + 'px'
|
327 |
-
});
|
328 |
-
}
|
329 |
-
}, 1000 );
|
330 |
-
}
|
331 |
-
|
332 |
-
swpConditionalFields();
|
333 |
-
jQuery( '.swp_popular_post_options select' ).on( 'change', function() {
|
334 |
-
swpConditionalFields();
|
335 |
-
});
|
336 |
-
|
337 |
-
|
338 |
-
/*
|
339 |
-
var customThumbnailSelect = jQuery("#widget-swp_popular_posts_widget-2-thumb_size");
|
340 |
-
|
341 |
-
if (customThumbnailSelect.value === 'custom') {
|
342 |
-
toggleCustomThumbnailFields();
|
343 |
-
}
|
344 |
-
|
345 |
-
jQuery(customThumbnailSelect).on("change", function(e) {
|
346 |
-
console.log("changing");
|
347 |
-
console.log(e.target.value);
|
348 |
-
if (e.target.value === 'custom') {
|
349 |
-
toggleCustomThumbnailFields();
|
350 |
-
} else {
|
351 |
-
toggleCustomThumbnailFields(false);
|
352 |
-
}
|
353 |
-
});
|
354 |
-
*/
|
355 |
-
});
|
356 |
-
})( this, jQuery );
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* Functions for widgets and global utility functions.
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package SocialWarfare\Admin\Functions
|
7 |
+
* @copyright Copyright (c) 2018, Warfare Plugins, LLC
|
8 |
+
* @license GPL-3.0+
|
9 |
+
*/
|
10 |
+
|
11 |
+
var socialWarfareAdmin = socialWarfareAdmin || {};
|
12 |
+
var swpWidget, widgetSubmit;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Show and hide input fields based on conditional values.
|
16 |
+
*
|
17 |
+
* This function iterates over each element with the "dep" data attribute. For each
|
18 |
+
* such dependant element, its parent element controls whether the dependant is shown or hidden
|
19 |
+
* if the parent's value matches the condition.
|
20 |
+
*
|
21 |
+
* @since 3.0.0 Feb 12 2018 | Brought func in from admin-options-page.js and set to global scope; Updated variable names for semantics, switched to Yoda condietionals.
|
22 |
+
* @since 3.0.0 Feb 14 2018 | Mapped the required array from variable types to string.
|
23 |
+
*
|
24 |
+
* @see admin-options-page.js
|
25 |
+
* @return none
|
26 |
+
*/
|
27 |
+
function swpConditionalFields() {
|
28 |
+
|
29 |
+
function swp_selected(name) {
|
30 |
+
return jQuery('select[name="' + name + '"]').val();
|
31 |
+
}
|
32 |
+
|
33 |
+
function swp_checked(name) {
|
34 |
+
return jQuery( '[name="' + name + '"]' ).prop( 'checked' );
|
35 |
+
}
|
36 |
+
|
37 |
+
function string_to_bool(string) {
|
38 |
+
if( string === 'true') { string = true };
|
39 |
+
if( string === 'false') { string = false };
|
40 |
+
return string;
|
41 |
+
}
|
42 |
+
|
43 |
+
// Loop through all the fields that have dependancies
|
44 |
+
jQuery( '[data-dep]' ).each( function() {
|
45 |
+
|
46 |
+
// Fetch the conditional values
|
47 |
+
var condition = jQuery(this).data( 'dep' );
|
48 |
+
var required = JSON.parse( JSON.stringify( jQuery(this).data( 'dep_val' ) ) );
|
49 |
+
|
50 |
+
// Check if we're on the options page or somewhere else
|
51 |
+
if (window.location.href.indexOf("page=social-warfare") === -1) {
|
52 |
+
var conditionEl = jQuery(this).parents('.widgets-holder-wrap').find( '[data-swp-name="' + condition + '"]' );
|
53 |
+
} else {
|
54 |
+
var conditionEl = jQuery( '[name="' + condition + '"]' )[0];
|
55 |
+
}
|
56 |
+
|
57 |
+
var value;
|
58 |
+
|
59 |
+
if (typeof conditionEl === 'undefined') {
|
60 |
+
conditionEl = jQuery( '[name="' + condition + '"]' )[0];
|
61 |
+
|
62 |
+
if (typeof conditionEl === 'undefined') {
|
63 |
+
conditionEl = jQuery( '[fieldjQuery=' + condition + ']' )[0];
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
// Fetch the value of checkboxes or other input types
|
68 |
+
if ( jQuery( conditionEl ).attr( 'type' ) == 'checkbox' ) {
|
69 |
+
value = jQuery( conditionEl ).prop( 'checked' );
|
70 |
+
} else {
|
71 |
+
value = jQuery( conditionEl ).val();
|
72 |
+
}
|
73 |
+
value = string_to_bool(value);
|
74 |
+
|
75 |
+
//* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
|
76 |
+
// Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
|
77 |
+
|
78 |
+
if (window.location.href.indexOf("page=social-warfare") !== -1) {
|
79 |
+
|
80 |
+
// If the required value matches and it's parent is also being shown, show this conditional field
|
81 |
+
if (jQuery.inArray( value, required ) !== -1 && jQuery( conditionEl ).parent( '.sw-grid' ).is( ':visible' ) ) {
|
82 |
+
jQuery(this).show();
|
83 |
+
} else {
|
84 |
+
jQuery(this).hide();
|
85 |
+
}
|
86 |
+
} else {
|
87 |
+
|
88 |
+
// If the required value matches, show this conditional field
|
89 |
+
if (jQuery.inArray( value, required ) !== -1 || value === required ) {
|
90 |
+
jQuery(this).show();
|
91 |
+
} else {
|
92 |
+
jQuery(this).hide();
|
93 |
+
}
|
94 |
+
}
|
95 |
+
});
|
96 |
+
|
97 |
+
if ( false === swp_checked('float_style_source') &&
|
98 |
+
'custom_color' === swp_selected('float_default_colors')
|
99 |
+
|| 'custom_color_outlines' === swp_selected('float_default_colors')
|
100 |
+
|| 'custom_color' === swp_selected('float_single_colors')
|
101 |
+
|| 'custom_color_outlines' === swp_selected('float_single_colors')
|
102 |
+
|| 'custom_color' === swp_selected('float_hover_colors')
|
103 |
+
|| 'custom_color_outlines' === swp_selected('float_hover_colors') ) {
|
104 |
+
jQuery( '.sideCustomColor_wrapper' ).slideDown();
|
105 |
+
|
106 |
+
} else {
|
107 |
+
jQuery( '.sideCustomColor_wrapper' ).slideUp();
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
//* Only run on widgets.php
|
112 |
+
if (window.location.href.indexOf("widgets.php") > -1 ) {
|
113 |
+
|
114 |
+
//* Make sure the elements exist before trying to read them.
|
115 |
+
var widgetFinder = setInterval(function() {
|
116 |
+
if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
|
117 |
+
|
118 |
+
swpWidget = jQuery("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
|
119 |
+
widgetSubmit = jQuery(swpWidget).find("[idjQuery=savewidget]")[0];
|
120 |
+
|
121 |
+
//* Force swpConditionalFields to run when the widget is opened or saved.
|
122 |
+
jQuery(swpWidget).on("click", swpConditionalFields);
|
123 |
+
jQuery(widgetSubmit).on("click", function() {
|
124 |
+
setTimeout(swpConditionalFields, 600);
|
125 |
+
});
|
126 |
+
|
127 |
+
}, 50);
|
128 |
+
}
|
129 |
+
|
130 |
+
(function( window, jQuery, undefined ) {
|
131 |
+
'use strict';
|
132 |
+
|
133 |
+
socialWarfareAdmin.linkLength = function( input ) {
|
134 |
+
var tmp = '';
|
135 |
+
|
136 |
+
for ( var i = 0; i < 23; i++ ) {
|
137 |
+
tmp += 'o';
|
138 |
+
}
|
139 |
+
|
140 |
+
return input.replace( /(http:\/\/[\S]*)/g, tmp ).length;
|
141 |
+
};
|
142 |
+
|
143 |
+
// Function for SM Title Counting
|
144 |
+
function smTitleRemaining() {
|
145 |
+
var smTitle = jQuery( '#social_warfare textarea#swp_og_title' ).val();
|
146 |
+
var remaining = 60 - smTitle.length;
|
147 |
+
if ( smTitle.length > 0 && remaining >= 0 ) {
|
148 |
+
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
149 |
+
} else if ( smTitle.length > 0 && remaining < 0 ) {
|
150 |
+
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
151 |
+
} else {
|
152 |
+
jQuery( '#social_warfare .swp_og_title .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
153 |
+
}
|
154 |
+
jQuery( '#social_warfare .swp_og_title .counterNumber' ).html( remaining );
|
155 |
+
}
|
156 |
+
|
157 |
+
// Function for SM Description Counting
|
158 |
+
function smDescriptionRemaining() {
|
159 |
+
var smDescription = jQuery( '#social_warfare textarea#swp_og_description' ).val();
|
160 |
+
var remaining = 160 - smDescription.length;
|
161 |
+
if ( smDescription.length > 0 && remaining >= 0 ) {
|
162 |
+
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
163 |
+
} else if ( smDescription.length > 0 && remaining < 0 ) {
|
164 |
+
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
165 |
+
} else {
|
166 |
+
jQuery( '#social_warfare .swp_og_description .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
167 |
+
}
|
168 |
+
jQuery( '#social_warfare .swp_og_description .counterNumber' ).html( remaining );
|
169 |
+
}
|
170 |
+
|
171 |
+
// Function for SM Description Counting
|
172 |
+
function swpPinterestRemaining() {
|
173 |
+
var pinterestDescription = jQuery( '#social_warfare textarea#swp_pinterest_description' ).val();
|
174 |
+
if (!pinterestDescription) {
|
175 |
+
pinterestDescription = '';
|
176 |
+
}
|
177 |
+
var remaining = 500 - pinterestDescription.length;
|
178 |
+
if ( pinterestDescription.length > 0 && remaining >= 0 ) {
|
179 |
+
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
180 |
+
} else if ( pinterestDescription.length > 0 && remaining < 0 ) {
|
181 |
+
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
182 |
+
} else {
|
183 |
+
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
184 |
+
}
|
185 |
+
jQuery( '#social_warfare .swp_pinterest_descriptionWrapper .counterNumber' ).html( remaining );
|
186 |
+
}
|
187 |
+
|
188 |
+
// Function for Twitter Box Counting
|
189 |
+
function twitterRemaining() {
|
190 |
+
var smTwitter = jQuery( '#social_warfare textarea#swp_custom_tweet' ).val();
|
191 |
+
var handle = jQuery( '#social_warfare .twitterIDWrapper label' ).html();
|
192 |
+
var linkSpace;
|
193 |
+
|
194 |
+
if ( smTwitter.indexOf( 'http' ) > -1 || smTwitter.indexOf( 'https' ) > -1 ) {
|
195 |
+
linkSpace = 0;
|
196 |
+
jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'line-through' });
|
197 |
+
} else {
|
198 |
+
linkSpace = 23;
|
199 |
+
jQuery( '.tweetLinkSection' ).css({ 'text-decoration': 'none' });
|
200 |
+
}
|
201 |
+
|
202 |
+
var remaining;
|
203 |
+
if ( 'undefined' === typeof handle ) {
|
204 |
+
remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace;
|
205 |
+
} else {
|
206 |
+
remaining = 280 - socialWarfareAdmin.linkLength( smTwitter ) - linkSpace - handle.length - 6;
|
207 |
+
}
|
208 |
+
|
209 |
+
if ( smTwitter.length > 0 && remaining >= 0 ) {
|
210 |
+
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_red' ).addClass( 'swp_blue' );
|
211 |
+
} else if ( smTwitter.length > 0 && remaining < 0 ) {
|
212 |
+
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).addClass( 'swp_red' );
|
213 |
+
} else {
|
214 |
+
jQuery( '#social_warfare .swp_customTweetWrapper .swp_CountDown' ).removeClass( 'swp_blue' ).removeClass( 'swp_red' );
|
215 |
+
}
|
216 |
+
|
217 |
+
jQuery( '#social_warfare .swp_customTweetWrapper .counterNumber' ).html( remaining );
|
218 |
+
}
|
219 |
+
|
220 |
+
function toggleCustomThumbnailFields(show) {
|
221 |
+
if (typeof show === 'undefined') show = true;
|
222 |
+
|
223 |
+
if (show) {
|
224 |
+
jQuery(".custom_thumb_size").show();
|
225 |
+
}
|
226 |
+
else {
|
227 |
+
jQuery(".custom_thumb_size").hide();
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
function noticeClickHandlers() {
|
232 |
+
jQuery(".swp-notice-cta").on("click", function(e) {
|
233 |
+
e.preventDefault();
|
234 |
+
//* Do not use jQuery to get href.
|
235 |
+
var link = e.target.getAttribute("href");
|
236 |
+
|
237 |
+
if (typeof link == 'string' && link.length) {
|
238 |
+
window.open(link);
|
239 |
+
}
|
240 |
+
|
241 |
+
var parent = jQuery(this).parents(".swp-dismiss-notice");
|
242 |
+
|
243 |
+
jQuery.post({
|
244 |
+
url: ajaxurl,
|
245 |
+
data: {
|
246 |
+
action: 'dismiss',
|
247 |
+
key: parent.data("key"),
|
248 |
+
timeframe: this.dataset.timeframe
|
249 |
+
},
|
250 |
+
success: function(result) {
|
251 |
+
result = JSON.parse(result)
|
252 |
+
if (result) {
|
253 |
+
parent.slideUp(500);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
});
|
257 |
+
});
|
258 |
+
}
|
259 |
+
|
260 |
+
jQuery( document ).ready( function() {
|
261 |
+
noticeClickHandlers();
|
262 |
+
|
263 |
+
if ( jQuery( '#social_warfare.postbox' ).length ) {
|
264 |
+
|
265 |
+
// Add the CountDown Box for the Social Media Title
|
266 |
+
jQuery( '#social_warfare #swp_og_title' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">60</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
267 |
+
|
268 |
+
// Add the CountDown Box for the Social Media Description
|
269 |
+
jQuery( '#social_warfare #swp_og_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">150</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
270 |
+
|
271 |
+
// Add the CountDown Box for the Twitter Box
|
272 |
+
jQuery( '#social_warfare #swp_customTweet' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">118</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
273 |
+
|
274 |
+
// Add the CountDown Box for the Pinterest Box
|
275 |
+
jQuery( '#social_warfare #swp_pinterest_description' ).parent().prepend( '<div class="swp_CountDown"><span class="counterNumber">140</span> ' + swp_localize_admin.swp_characters_remaining + '</div>' );
|
276 |
+
|
277 |
+
smTitleRemaining();
|
278 |
+
jQuery( '#social_warfare textarea#swp_og_title' ).on( 'input', function() {
|
279 |
+
smTitleRemaining();
|
280 |
+
});
|
281 |
+
|
282 |
+
smDescriptionRemaining();
|
283 |
+
jQuery( '#social_warfare textarea#swp_og_description' ).on( 'input', function() {
|
284 |
+
smDescriptionRemaining();
|
285 |
+
});
|
286 |
+
|
287 |
+
twitterRemaining();
|
288 |
+
jQuery( '#social_warfare textarea#swp_customTweet' ).on( 'input', function() {
|
289 |
+
twitterRemaining();
|
290 |
+
});
|
291 |
+
|
292 |
+
swpPinterestRemaining();
|
293 |
+
jQuery( '#social_warfare textarea#swp_pinterest_description' ).on( 'input', function() {
|
294 |
+
swpPinterestRemaining();
|
295 |
+
});
|
296 |
+
|
297 |
+
// Setup an initilazation loop
|
298 |
+
var swpPostInit = setInterval( function() {
|
299 |
+
|
300 |
+
var swpOgImage = jQuery( '.swp_og_imageWrapper ul.swpmb-media-list' );
|
301 |
+
var swpPinImage = jQuery( '.swp_pinterest_imageWrapper ul.swpmb-media-list' );
|
302 |
+
|
303 |
+
var smWidth, smHeight;
|
304 |
+
|
305 |
+
// Check if the media list has been created yet
|
306 |
+
if ( swpOgImage.length && swpOgImage.is( ':empty' ) ) {
|
307 |
+
// Setup the Open Graph Image Placeholder
|
308 |
+
smWidth = swpOgImage.width();
|
309 |
+
smHeight = smWidth * ( 9 / 16 );
|
310 |
+
swpOgImage.css({ height: smHeight + 'px' });
|
311 |
+
} else {
|
312 |
+
smHeight = swpOgImage.find( 'img' ).height();
|
313 |
+
swpOgImage.css({ height: smHeight + 'px' });
|
314 |
+
}
|
315 |
+
|
316 |
+
var pinWidth, pinHeight;
|
317 |
+
|
318 |
+
if ( swpPinImage.length && swpPinImage.is( ':empty' ) ) {
|
319 |
+
// Setup the Open Graph Image Placeholder
|
320 |
+
pinWidth = swpPinImage.width();
|
321 |
+
pinHeight = pinWidth * ( 3 / 2 );
|
322 |
+
swpPinImage.css({ height: pinHeight + 'px' });
|
323 |
+
} else {
|
324 |
+
pinHeight = swpPinImage.find( 'img' ).height();
|
325 |
+
swpPinImage.css({
|
326 |
+
height: pinHeight + 'px'
|
327 |
+
});
|
328 |
+
}
|
329 |
+
}, 1000 );
|
330 |
+
}
|
331 |
+
|
332 |
+
swpConditionalFields();
|
333 |
+
jQuery( '.swp_popular_post_options select' ).on( 'change', function() {
|
334 |
+
swpConditionalFields();
|
335 |
+
});
|
336 |
+
|
337 |
+
|
338 |
+
/*
|
339 |
+
var customThumbnailSelect = jQuery("#widget-swp_popular_posts_widget-2-thumb_size");
|
340 |
+
|
341 |
+
if (customThumbnailSelect.value === 'custom') {
|
342 |
+
toggleCustomThumbnailFields();
|
343 |
+
}
|
344 |
+
|
345 |
+
jQuery(customThumbnailSelect).on("change", function(e) {
|
346 |
+
console.log("changing");
|
347 |
+
console.log(e.target.value);
|
348 |
+
if (e.target.value === 'custom') {
|
349 |
+
toggleCustomThumbnailFields();
|
350 |
+
} else {
|
351 |
+
toggleCustomThumbnailFields(false);
|
352 |
+
}
|
353 |
+
});
|
354 |
+
*/
|
355 |
+
});
|
356 |
+
})( this, jQuery );
|
js/admin.min.js
CHANGED
File without changes
|
js/script.js
CHANGED
File without changes
|
js/script.min.js
CHANGED
File without changes
|
js/sw-shortcode-generator.js
CHANGED
File without changes
|
js/sw-shortcode-generator.min.js
CHANGED
File without changes
|
languages/social-warfare-da-DK.mo
CHANGED
File without changes
|
languages/social-warfare-de_DE.mo
CHANGED
File without changes
|
languages/social-warfare-en_US.mo
CHANGED
File without changes
|
languages/social-warfare-es_ES.mo
CHANGED
File without changes
|
languages/social-warfare-fr_FR.mo
CHANGED
File without changes
|
languages/social-warfare-hy.mo
CHANGED
File without changes
|
languages/social-warfare-it_IT.mo
CHANGED
File without changes
|
languages/social-warfare-pt_BR.mo
CHANGED
File without changes
|
languages/social-warfare-pt_PT.mo
CHANGED
File without changes
|
languages/social-warfare-ru_RU.mo
CHANGED
File without changes
|
languages/social-warfare-uk.mo
CHANGED
File without changes
|
languages/social-warfare.pot
CHANGED
File without changes
|
languages/social_warfare-el_EL.mo
CHANGED
File without changes
|
languages/social_warfare-nl_NL.mo
CHANGED
File without changes
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: holas84, dustinwstout, webinator, warfareplugins, nutsandboltsmedi
|
|
3 |
Tags: sharing buttons, social media share, floating share buttons, facebook share, google plus share, linkedin share, pin it, pinterest save, mix button, tweet button, twitter share, click to tweet, social sharing buttons, social share, social sharing, social media sharing, wordpress social sharing plugin, social sharing plugin, share buttons, share counts
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 3.2.
|
7 |
License: GNU General Public License v2.0 or later
|
8 |
|
9 |
The most beautiful, responsive, lightning fast social share buttons built to boost shares and drive more traffic without slowing down your site.
|
@@ -193,6 +193,9 @@ We have a growing archive of <a href="https://warfareplugins.com/support/" rel="
|
|
193 |
|
194 |
== Changelog ==
|
195 |
|
|
|
|
|
|
|
196 |
= 3.2.0 (13 AUG 2018) =
|
197 |
* Shoutout to our Warfare Community beta testers- thank you so much!
|
198 |
* Created shortcode for Pinterest Image.
|
3 |
Tags: sharing buttons, social media share, floating share buttons, facebook share, google plus share, linkedin share, pin it, pinterest save, mix button, tweet button, twitter share, click to tweet, social sharing buttons, social share, social sharing, social media sharing, wordpress social sharing plugin, social sharing plugin, share buttons, share counts
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 3.2.1
|
7 |
License: GNU General Public License v2.0 or later
|
8 |
|
9 |
The most beautiful, responsive, lightning fast social share buttons built to boost shares and drive more traffic without slowing down your site.
|
193 |
|
194 |
== Changelog ==
|
195 |
|
196 |
+
= 3.2.1 (16 AUG 2018) =
|
197 |
+
* Fixed a minor DOMDocument warning that was appearing when data-pin-description was ON
|
198 |
+
|
199 |
= 3.2.0 (13 AUG 2018) =
|
200 |
* Shoutout to our Warfare Community beta testers- thank you so much!
|
201 |
* Created shortcode for Pinterest Image.
|
social-warfare.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Social Warfare
|
4 |
* Plugin URI: https://warfareplugins.com
|
5 |
* Description: A plugin to maximize social shares and drive more traffic using the fastest and most intelligent share buttons on the market, calls to action via in-post click-to-tweets, popular posts widgets based on share popularity, link-shortening, Google Analytics and much, much more!
|
6 |
-
* Version: 3.2.
|
7 |
* Author: Warfare Plugins
|
8 |
* Author URI: https://warfareplugins.com
|
9 |
* Text Domain: social-warfare
|
@@ -16,7 +16,7 @@ defined( 'WPINC' ) || die;
|
|
16 |
* Define plugin constants for use throughout the plugin (Version and Directories)
|
17 |
*
|
18 |
*/
|
19 |
-
define( 'SWP_VERSION' , '3.2.
|
20 |
define( 'SWP_PLUGIN_FILE', __FILE__ );
|
21 |
define( 'SWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
22 |
define( 'SWP_PLUGIN_DIR', dirname( __FILE__ ) );
|
3 |
* Plugin Name: Social Warfare
|
4 |
* Plugin URI: https://warfareplugins.com
|
5 |
* Description: A plugin to maximize social shares and drive more traffic using the fastest and most intelligent share buttons on the market, calls to action via in-post click-to-tweets, popular posts widgets based on share popularity, link-shortening, Google Analytics and much, much more!
|
6 |
+
* Version: 3.2.1
|
7 |
* Author: Warfare Plugins
|
8 |
* Author URI: https://warfareplugins.com
|
9 |
* Text Domain: social-warfare
|
16 |
* Define plugin constants for use throughout the plugin (Version and Directories)
|
17 |
*
|
18 |
*/
|
19 |
+
define( 'SWP_VERSION' , '3.2.1' );
|
20 |
define( 'SWP_PLUGIN_FILE', __FILE__ );
|
21 |
define( 'SWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
22 |
define( 'SWP_PLUGIN_DIR', dirname( __FILE__ ) );
|