WordPress Social Sharing Plugin – Social Warfare - Version 3.6.1

Version Description

(3 JUN 2019) = * Updated Hover Save Pin functionality to work more globally. * Fixed conflcit with hover pin button in Thrive Architect page builder. * Removed the Google Plus network share button. * Fixed an "Uncaught Error" for $ in the JS on the widgets page. * Fixed a Twitter PHP notice.

Download this release

Release Info

Developer WarfarePlugins
Plugin Icon 128x128 WordPress Social Sharing Plugin – Social Warfare
Version 3.6.1
Comparing to
See all releases

Code changes from version 3.6.0 to 3.6.1

Files changed (216) hide show
  1. .gitignore +0 -0
  2. README.md +0 -0
  3. assets/css/admin-mobile.css +0 -0
  4. assets/css/admin-mobile.min.css +0 -0
  5. assets/css/admin-mobile.sass +0 -0
  6. assets/css/admin-options-page.css +0 -0
  7. assets/css/admin-options-page.min.css +0 -0
  8. assets/css/admin-options.min.css +0 -0
  9. assets/css/admin.css +0 -0
  10. assets/css/admin.min.css +0 -0
  11. assets/css/converted_style.tmp.map +0 -0
  12. assets/css/style.css +0 -0
  13. assets/css/style.min.css +0 -0
  14. assets/css/style.scss +0 -0
  15. assets/fonts/bak/sw-icon-font.eot +0 -0
  16. assets/fonts/bak/sw-icon-font.svg +0 -0
  17. assets/fonts/bak/sw-icon-font.ttf +0 -0
  18. assets/fonts/bak/sw-icon-font.woff +0 -0
  19. assets/fonts/sw-icon-font.eot +0 -0
  20. assets/fonts/sw-icon-font.svg +0 -0
  21. assets/fonts/sw-icon-font.ttf +0 -0
  22. assets/fonts/sw-icon-font.woff +0 -0
  23. assets/images/admin-options-page/Thumbs.db +0 -0
  24. assets/images/admin-options-page/affiliate-300x150.jpg +0 -0
  25. assets/images/admin-options-page/measure-roi-300x150.jpg +0 -0
  26. assets/images/admin-options-page/new_share_counts.png +0 -0
  27. assets/images/admin-options-page/social-warfare-light.png +0 -0
  28. assets/images/admin-options-page/social-warfare-pro-light.png +0 -0
  29. assets/images/admin-options-page/socialwarfare-20x20.png +0 -0
  30. assets/images/admin-options-page/starter-guide-300x150.jpg +0 -0
  31. assets/images/img-placeholder-og.jpg +0 -0
  32. assets/images/img-placeholder-pin.jpg +0 -0
  33. assets/js/admin-options-page.js +4 -4
  34. assets/js/admin-options-page.min.js +1 -1
  35. assets/js/admin.js +551 -549
  36. assets/js/admin.min.js +1 -1
  37. assets/js/post-editor/.editorconfig +0 -0
  38. assets/js/post-editor/.eslintignore +0 -0
  39. assets/js/post-editor/.eslintrc.json +0 -0
  40. assets/js/post-editor/.gitignore +0 -0
  41. assets/js/post-editor/README.md +0 -0
  42. assets/js/post-editor/blocks.php +0 -0
  43. assets/js/post-editor/dist/blocks.build.js +0 -0
  44. assets/js/post-editor/dist/blocks.style.build.css +0 -0
  45. assets/js/post-editor/package-lock.json +0 -0
  46. assets/js/post-editor/package.json +0 -0
  47. assets/js/post-editor/src/block/click-to-tweet.js +0 -0
  48. assets/js/post-editor/src/block/pinterest.js +0 -0
  49. assets/js/post-editor/src/block/social-warfare.js +0 -0
  50. assets/js/post-editor/src/block/style.scss +0 -0
  51. assets/js/post-editor/src/blocks.js +0 -0
  52. assets/js/post-editor/src/common.scss +0 -0
  53. assets/js/script.js +40 -15
  54. assets/js/script.min.js +1 -1
  55. assets/js/sw-shortcode-generator.js +0 -0
  56. assets/js/sw-shortcode-generator.min.js +0 -0
  57. languages/social-warfare-da-DK.mo +0 -0
  58. languages/social-warfare-de_DE.mo +0 -0
  59. languages/social-warfare-en_US.mo +0 -0
  60. languages/social-warfare-es_ES.mo +0 -0
  61. languages/social-warfare-fr_FR.mo +0 -0
  62. languages/social-warfare-hy.mo +0 -0
  63. languages/social-warfare-it_IT.mo +0 -0
  64. languages/social-warfare-pt_BR.mo +0 -0
  65. languages/social-warfare-pt_PT.mo +0 -0
  66. languages/social-warfare-ru_RU.mo +0 -0
  67. languages/social-warfare-uk.mo +0 -0
  68. languages/social-warfare.pot +0 -0
  69. languages/social_warfare-el_EL.mo +0 -0
  70. languages/social_warfare-nl_NL.mo +0 -0
  71. lib/Social_Warfare.php +2 -1
  72. lib/Social_Warfare_Addon.php +0 -0
  73. lib/admin/SWP_Click_To_Tweet.php +0 -0
  74. lib/admin/SWP_Column.php +0 -0
  75. lib/admin/SWP_Settings_Link.php +0 -0
  76. lib/admin/SWP_Shortcode_Generator.php +0 -0
  77. lib/admin/SWP_Sidebar_Loader.php +0 -0
  78. lib/admin/SWP_User_Profile.php +0 -0
  79. lib/admin/assets/css/admin.css +0 -0
  80. lib/admin/assets/css/style1.css +0 -0
  81. lib/admin/assets/css/style2.css +0 -0
  82. lib/admin/assets/css/style3.css +0 -0
  83. lib/admin/assets/css/style4.css +0 -0
  84. lib/admin/assets/css/styles.css +0 -0
  85. lib/admin/assets/img/twitter-little-bird-button.png +0 -0
  86. lib/admin/assets/img/twitter-little-bird-white.png +0 -0
  87. lib/admin/assets/img/twitter-little-bird.png +0 -0
  88. lib/admin/assets/js/clickToTweet.js +0 -0
  89. lib/admin/assets/js/clickToTweet.min.js +0 -0
  90. lib/admin/assets/js/tmclicktotweet_plugin.js +0 -0
  91. lib/admin/swp_system_checker.php +0 -0
  92. lib/buttons-panel/SWP_Buttons_Panel.php +0 -0
  93. lib/buttons-panel/SWP_Buttons_Panel_Loader.php +0 -0
  94. lib/buttons-panel/SWP_Buttons_Panel_Shortcode.php +0 -0
  95. lib/buttons-panel/SWP_Buttons_Panel_Side.php +0 -0
  96. lib/buttons-panel/SWP_Buttons_Panel_Trait.php +0 -0
  97. lib/frontend-output/SWP_Header_Output.php +0 -0
  98. lib/frontend-output/SWP_Script.php +43 -12
  99. lib/frontend-output/SWP_Shortcode.php +0 -0
  100. lib/options/SWP_Option.php +0 -0
  101. lib/options/SWP_Option_Abstract.php +0 -0
  102. lib/options/SWP_Option_Button.php +0 -0
  103. lib/options/SWP_Option_Icons.php +0 -0
  104. lib/options/SWP_Option_Select.php +0 -0
  105. lib/options/SWP_Option_Text.php +0 -0
  106. lib/options/SWP_Option_Textarea.php +0 -0
  107. lib/options/SWP_Option_Toggle.php +0 -0
  108. lib/options/SWP_Options_Page.php +0 -0
  109. lib/options/SWP_Options_Page_Section.php +0 -0
  110. lib/options/SWP_Options_Page_Tab.php +0 -0
  111. lib/options/SWP_Registration_Tab_Template.php +0 -0
  112. lib/options/SWP_Section_HTML.php +0 -0
  113. lib/options/SWP_User_Options.php +0 -0
  114. lib/social-networks/SWP_Facebook.php +0 -0
  115. lib/social-networks/SWP_Google_Plus.php +0 -46
  116. lib/social-networks/SWP_Linkedin.php +0 -0
  117. lib/social-networks/SWP_Mix.php +0 -0
  118. lib/social-networks/SWP_Pinterest.php +0 -0
  119. lib/social-networks/SWP_Social_Network.php +0 -0
  120. lib/social-networks/SWP_Social_Networks_Loader.php +0 -0
  121. lib/social-networks/SWP_Stumble_Upon.php +0 -0
  122. lib/social-networks/SWP_Twitter.php +2 -1
  123. lib/update-checker/.editorconfig +0 -0
  124. lib/update-checker/Puc/v4/Factory.php +0 -0
  125. lib/update-checker/Puc/v4p4/Autoloader.php +0 -0
  126. lib/update-checker/Puc/v4p4/DebugBar/Extension.php +0 -0
  127. lib/update-checker/Puc/v4p4/DebugBar/Panel.php +0 -0
  128. lib/update-checker/Puc/v4p4/DebugBar/PluginExtension.php +0 -0
  129. lib/update-checker/Puc/v4p4/DebugBar/PluginPanel.php +0 -0
  130. lib/update-checker/Puc/v4p4/DebugBar/ThemePanel.php +0 -0
  131. lib/update-checker/Puc/v4p4/Factory.php +0 -0
  132. lib/update-checker/Puc/v4p4/InstalledPackage.php +0 -0
  133. lib/update-checker/Puc/v4p4/Metadata.php +0 -0
  134. lib/update-checker/Puc/v4p4/OAuthSignature.php +0 -0
  135. lib/update-checker/Puc/v4p4/Plugin/Info.php +0 -0
  136. lib/update-checker/Puc/v4p4/Plugin/Package.php +0 -0
  137. lib/update-checker/Puc/v4p4/Plugin/Ui.php +0 -0
  138. lib/update-checker/Puc/v4p4/Plugin/Update.php +0 -0
  139. lib/update-checker/Puc/v4p4/Plugin/UpdateChecker.php +0 -0
  140. lib/update-checker/Puc/v4p4/Scheduler.php +0 -0
  141. lib/update-checker/Puc/v4p4/StateStore.php +0 -0
  142. lib/update-checker/Puc/v4p4/Theme/Package.php +0 -0
  143. lib/update-checker/Puc/v4p4/Theme/Update.php +0 -0
  144. lib/update-checker/Puc/v4p4/Theme/UpdateChecker.php +0 -0
  145. lib/update-checker/Puc/v4p4/Update.php +0 -0
  146. lib/update-checker/Puc/v4p4/UpdateChecker.php +0 -0
  147. lib/update-checker/Puc/v4p4/UpgraderStatus.php +0 -0
  148. lib/update-checker/Puc/v4p4/Utils.php +0 -0
  149. lib/update-checker/Puc/v4p4/Vcs/Api.php +0 -0
  150. lib/update-checker/Puc/v4p4/Vcs/BaseChecker.php +0 -0
  151. lib/update-checker/Puc/v4p4/Vcs/BitBucketApi.php +0 -0
  152. lib/update-checker/Puc/v4p4/Vcs/GitHubApi.php +0 -0
  153. lib/update-checker/Puc/v4p4/Vcs/GitLabApi.php +0 -0
  154. lib/update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php +0 -0
  155. lib/update-checker/Puc/v4p4/Vcs/Reference.php +0 -0
  156. lib/update-checker/Puc/v4p4/Vcs/ThemeUpdateChecker.php +0 -0
  157. lib/update-checker/README.md +0 -0
  158. lib/update-checker/composer.json +21 -21
  159. lib/update-checker/css/puc-debug-bar.css +0 -0
  160. lib/update-checker/examples/plugin.json +51 -51
  161. lib/update-checker/examples/theme.json +4 -4
  162. lib/update-checker/js/debug-bar.js +0 -0
  163. lib/update-checker/languages/plugin-update-checker-cs_CZ.mo +0 -0
  164. lib/update-checker/languages/plugin-update-checker-cs_CZ.po +45 -45
  165. lib/update-checker/languages/plugin-update-checker-da_DK.mo +0 -0
  166. lib/update-checker/languages/plugin-update-checker-da_DK.po +0 -0
  167. lib/update-checker/languages/plugin-update-checker-de_DE.mo +0 -0
  168. lib/update-checker/languages/plugin-update-checker-de_DE.po +0 -0
  169. lib/update-checker/languages/plugin-update-checker-fa_IR.mo +0 -0
  170. lib/update-checker/languages/plugin-update-checker-fa_IR.po +0 -0
  171. lib/update-checker/languages/plugin-update-checker-fr_CA.mo +0 -0
  172. lib/update-checker/languages/plugin-update-checker-fr_CA.po +0 -0
  173. lib/update-checker/languages/plugin-update-checker-fr_FR.mo +0 -0
  174. lib/update-checker/languages/plugin-update-checker-fr_FR.po +0 -0
  175. lib/update-checker/languages/plugin-update-checker-hu_HU.mo +0 -0
  176. lib/update-checker/languages/plugin-update-checker-hu_HU.po +0 -0
  177. lib/update-checker/languages/plugin-update-checker-it_IT.mo +0 -0
  178. lib/update-checker/languages/plugin-update-checker-it_IT.po +0 -0
  179. lib/update-checker/languages/plugin-update-checker-ja.mo +0 -0
  180. lib/update-checker/languages/plugin-update-checker-ja.po +0 -0
  181. lib/update-checker/languages/plugin-update-checker-nl_BE.mo +0 -0
  182. lib/update-checker/languages/plugin-update-checker-nl_BE.po +0 -0
  183. lib/update-checker/languages/plugin-update-checker-nl_NL.mo +0 -0
  184. lib/update-checker/languages/plugin-update-checker-nl_NL.po +0 -0
  185. lib/update-checker/languages/plugin-update-checker-pt_BR.mo +0 -0
  186. lib/update-checker/languages/plugin-update-checker-pt_BR.po +0 -0
  187. lib/update-checker/languages/plugin-update-checker-sv_SE.mo +0 -0
  188. lib/update-checker/languages/plugin-update-checker-sv_SE.po +0 -0
  189. lib/update-checker/languages/plugin-update-checker.pot +0 -0
  190. lib/update-checker/license.txt +0 -0
  191. lib/update-checker/plugin-update-checker.php +0 -0
  192. lib/update-checker/vendor/Parsedown.php +0 -0
  193. lib/update-checker/vendor/ParsedownLegacy.php +0 -0
  194. lib/update-checker/vendor/readme-parser.php +0 -0
  195. lib/utilities/SWP_Auth_Helper.php +0 -0
  196. lib/utilities/SWP_CURL.php +0 -0
  197. lib/utilities/SWP_Compatibility.php +204 -10
  198. lib/utilities/SWP_Credential_Helper.php +0 -0
  199. lib/utilities/SWP_Database_Migration.php +0 -0
  200. lib/utilities/SWP_Debug_Trait.php +0 -0
  201. lib/utilities/SWP_JSON_Cache_Handler.php +0 -0
  202. lib/utilities/SWP_Localization.php +0 -0
  203. lib/utilities/SWP_Notice.php +0 -0
  204. lib/utilities/SWP_Notice_Loader.php +0 -0
  205. lib/utilities/SWP_Permalink.php +14 -1
  206. lib/utilities/SWP_Plugin_Updater.php +0 -0
  207. lib/utilities/SWP_Post_Cache.php +12 -12
  208. lib/utilities/SWP_Post_Cache_Loader.php +0 -0
  209. lib/utilities/SWP_URL_Management.php +3 -6
  210. lib/utilities/SWP_Utility.php +10 -4
  211. lib/utilities/functions.php +0 -0
  212. lib/widgets/SWP_Popular_Posts_Widget.php +0 -0
  213. lib/widgets/SWP_Widget.php +0 -0
  214. lib/widgets/SWP_Widget_Loader.php +0 -0
  215. readme.txt +9 -2
  216. social-warfare.php +2 -2
.gitignore CHANGED
File without changes
README.md CHANGED
File without changes
assets/css/admin-mobile.css CHANGED
File without changes
assets/css/admin-mobile.min.css CHANGED
File without changes
assets/css/admin-mobile.sass CHANGED
File without changes
assets/css/admin-options-page.css CHANGED
File without changes
assets/css/admin-options-page.min.css CHANGED
File without changes
assets/css/admin-options.min.css CHANGED
File without changes
assets/css/admin.css CHANGED
File without changes
assets/css/admin.min.css CHANGED
File without changes
assets/css/converted_style.tmp.map CHANGED
File without changes
assets/css/style.css CHANGED
File without changes
assets/css/style.min.css CHANGED
File without changes
assets/css/style.scss CHANGED
File without changes
assets/fonts/bak/sw-icon-font.eot CHANGED
File without changes
assets/fonts/bak/sw-icon-font.svg CHANGED
File without changes
assets/fonts/bak/sw-icon-font.ttf CHANGED
File without changes
assets/fonts/bak/sw-icon-font.woff CHANGED
File without changes
assets/fonts/sw-icon-font.eot CHANGED
File without changes
assets/fonts/sw-icon-font.svg CHANGED
File without changes
assets/fonts/sw-icon-font.ttf CHANGED
File without changes
assets/fonts/sw-icon-font.woff CHANGED
File without changes
assets/images/admin-options-page/Thumbs.db DELETED
Binary file
assets/images/admin-options-page/affiliate-300x150.jpg CHANGED
File without changes
assets/images/admin-options-page/measure-roi-300x150.jpg CHANGED
File without changes
assets/images/admin-options-page/new_share_counts.png CHANGED
File without changes
assets/images/admin-options-page/social-warfare-light.png CHANGED
File without changes
assets/images/admin-options-page/social-warfare-pro-light.png CHANGED
File without changes
assets/images/admin-options-page/socialwarfare-20x20.png CHANGED
File without changes
assets/images/admin-options-page/starter-guide-300x150.jpg CHANGED
File without changes
assets/images/img-placeholder-og.jpg CHANGED
File without changes
assets/images/img-placeholder-pin.jpg CHANGED
File without changes
assets/js/admin-options-page.js CHANGED
@@ -206,7 +206,7 @@
206
  socialWarfare.activateHoverStates();
207
  }
208
 
209
- swpConditionalFields();
210
 
211
  });
212
  }
@@ -232,13 +232,13 @@
232
 
233
  saveColorToggle();
234
 
235
- swpConditionalFields();
236
  });
237
  }
238
 
239
  function populateOptions() {
240
  jQuery('form.sw-admin-settings-form input, form.sw-admin-settings-form select').on('change', function() {
241
- swpConditionalFields();
242
 
243
  socialWarfare.newOptions = fetchAllOptions();
244
 
@@ -872,7 +872,7 @@
872
  tabNavInit();
873
  checkboxesInit();
874
  updateButtonPreviews();
875
- swpConditionalFields();
876
  updateCttDemo();
877
  updateScale();
878
  handleRegistration();
206
  socialWarfare.activateHoverStates();
207
  }
208
 
209
+ socialWarfareAdmin.conditionalFields();
210
 
211
  });
212
  }
232
 
233
  saveColorToggle();
234
 
235
+ socialWarfareAdmin.conditionalFields();
236
  });
237
  }
238
 
239
  function populateOptions() {
240
  jQuery('form.sw-admin-settings-form input, form.sw-admin-settings-form select').on('change', function() {
241
+ socialWarfareAdmin.conditionalFields();
242
 
243
  socialWarfare.newOptions = fetchAllOptions();
244
 
872
  tabNavInit();
873
  checkboxesInit();
874
  updateButtonPreviews();
875
+ socialWarfareAdmin.conditionalFields();
876
  updateCttDemo();
877
  updateScale();
878
  handleRegistration();
assets/js/admin-options-page.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";function o(e,t,o,s){var r={customColor:!1,customOutlines:!1};jQuery(t).each(function(e,t){var o=jQuery(t).val();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.customOutlines=!0:r.customColor=!0)}),r.customColor?o.slideDown():o.slideUp(),r.customOutlines?s.slideDown():s.slideUp(),r.customColor||r.customOutlines?(jQuery("body").append('<div id="color-notice"><p><span class="color-dismiss"></span><b>Note:</b> Custom colors will not show up in the preview, but will on your site.</p></div>'),jQuery(".color-dismiss").on("click",function(){jQuery("#color-notice").fadeOut("slow")})):jQuery("#color-notice").length&&jQuery("#color-notice").fadeOut("slow")}function s(t){var o,s;document.body.createTextRange?(o=document.body.createTextRange(),o.moveToElementText(t),o.select()):e.getSelection&&(s=e.getSelection(),o=document.createRange(),o.selectNodeContents(t),s.removeAllRanges(),s.addRange(o))}function r(){var e={};return jQuery("form.sw-admin-settings-form input, form.sw-admin-settings-form select, form.sw-admin-settings-form textarea").each(function(){var t,o=jQuery(this),s=o.attr("name");t="checkbox"===o.attr("type")?o.prop("checked"):o.val(),e[s]=t}),e.order_of_icons={},jQuery(".sw-active i").each(function(){var t=jQuery(this).data("network");e.order_of_icons[t]=t}),e}function a(){var e=jQuery(".sw-top-menu").offset(),t=jQuery(".sw-top-menu").width();jQuery(".sw-top-menu").css({position:"fixed",left:e.left,top:e.top,width:t}),jQuery(".sw-admin-wrapper").css("padding-top","75px")}function n(){jQuery(".sw-tab-selector").on("click",function(e){e.preventDefault(),jQuery("html, body").animate({scrollTop:0},300);var t=jQuery(this).attr("data-link");jQuery(".sw-admin-tab").hide(),jQuery("#"+t).show(),jQuery(".sw-header-menu li").removeClass("sw-active-tab"),jQuery(this).parents("li").addClass("sw-active-tab"),"swp_styles"===t&&socialWarfare.activateHoverStates(),swpConditionalFields()})}function l(){jQuery(".sw-checkbox-toggle").on("click",function(){var e=jQuery(this).attr("status"),t=jQuery(this).attr("field");"on"===e?(jQuery(this).attr("status","off"),jQuery(t).prop("checked",!1)):(jQuery(this).attr("status","on"),jQuery(t).prop("checked",!0)),u(),swpConditionalFields()})}function i(){jQuery("form.sw-admin-settings-form input, form.sw-admin-settings-form select").on("change",function(){swpConditionalFields(),socialWarfare.newOptions=r(),u()}),socialWarfare.defaultOptions=r()}function u(){socialWarfare.newOptions=r(),JSON.stringify(socialWarfare.newOptions)!==JSON.stringify(socialWarfare.defaultOptions)?jQuery(".sw-save-settings").removeClass("sw-navy-button").addClass("sw-red-button"):jQuery(".sw-save-settings").removeClass("sw-red-button").addClass("sw-navy-button")}function c(){jQuery(".sw-save-settings").on("click",function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,_();var t=r(),o={action:"swp_store_settings",security:swpAdminOptionsData.optionsNonce,settings:t};jQuery.post({url:ajaxurl,data:o,success:function(e){p(!0),socialWarfare.defaultOptions=r(),u()}})})}function _(){jQuery("body").append('<div class="sw-loading-bg"><div class="sw-loading-message">Saving Changes</div></div>')}function p(e){var t=e?"Success!":"";jQuery(".sw-loading-message").html(t).removeClass("sw-loading-message").addClass("sw-loading-complete"),jQuery(".sw-loading-bg").delay(1e3).fadeOut(1e3),setTimeout(function(){jQuery(".sw-loading-bg").remove()},2e3)}function m(){var e=(jQuery('select[name="button_shape"]').val(),jQuery('select[name="default_colors"]').val()),t=jQuery('select[name="single_colors"]').val(),o=jQuery('select[name="hover_colors"]').val();jQuery("style.swp_customColorStuff").remove();var s=jQuery('input[name="custom_color"]').val(),r="";"custom_color"!=e&&"custom_color"!=t&&"custom_color"!=o||(r=".swp_social_panel.swp_default_customColor a, html body .swp_social_panel.swp_individual_customColor .nc_tweetContainer:hover a, body .swp_social_panel.swp_other_customColor:hover a {color:white} .swp_social_panel.swp_default_customColor .nc_tweetContainer, html body .swp_social_panel.swp_individual_customColor .nc_tweetContainer:hover, body .swp_social_panel.swp_other_customColor:hover .nc_tweetContainer {background-color:"+s+";border:1px solid "+s+";}"),"custom_color_outlines"!=e&&"custom_color_outlines"!=t&&"custom_color_outlines"!=o||(r=r+" .swp_social_panel.swp_default_custom_color_outlines a, html body .swp_social_panel.swp_individual_custom_color_outlines .nc_tweetContainer:hover a, body .swp_social_panel.swp_other_custom_color_outlines:hover a { color:"+s+"; } .swp_social_panel.swp_default_custom_color_outlines .nc_tweetContainer, html body .swp_social_panel.swp_individual_custom_color_outlines .nc_tweetContainer:hover, body .swp_social_panel.swp_other_custom_color_outlines:hover .nc_tweetContainer { background:transparent; border:1px solid "+s+"; }"),jQuery("head").append('<style type="text/css" class="swp_customColorStuff">'+r+"</style>")}function y(){function e(e){var t=jQuery('select[name="'+e+'"]').val();if(0===t.indexOf("custom")){return e.slice(0,e.indexOf("_"))+"_full_color"}return t}var o=e("button_shape"),s=e("default_colors"),r=e("single_colors"),a=e("hover_colors"),n="swp_"+o+" swp_default_"+s+" swp_individual_"+r+" swp_other_"+a;if(void 0===socialWarfare.lastClass){var l=t(".swp_social_panel");if(!l.length)return;socialWarfare.lastClass=l.get().className}var n="swp_"+o+" swp_default_"+s+" swp_individual_"+r+" swp_other_"+a;jQuery(".swp_social_panel").removeClass("swp_other_medium_gray"),jQuery(".swp_social_panel").removeClass(socialWarfare.lastClass).addClass(n),socialWarfare.lastClass=n}function d(){if(0!==jQuery('select[name="button_shape"]').length){var e={full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray",light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"},t={flat_fresh:e,leaf:e,pill:e,three_dee:{full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray"},connected:e,shift:e,boxed:e,modern:{full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray",light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"},dark:{light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"}},o=jQuery('select[name="button_shape"]').val(),s=jQuery('select[name="default_colors"]').val(),r=jQuery('select[name="single_colors"]').val(),a=jQuery('select[name="hover_colors"]').val(),n=jQuery('select[name="button_shape"]').find("option").map(function(e,t){return t.value});jQuery('select[name="default_colors"] option, select[name="single_colors"] option, select[name="hover_colors"] option').remove(),jQuery.each(t[o],function(e,t){e===s?jQuery('select[name="default_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="default_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===r?jQuery('select[name="single_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="single_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===a?jQuery('select[name="hover_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="hover_colors"]').append('<option value="'+e+'">'+t+"</option>"),"custom_color"==s||"custom_color_outlines"==s||"custom_color"==r||"custom_color_outlines"==r||"custom_color"==a||"custom_color_outlines"==a?(jQuery(".customColor_wrapper").slideDown(),m()):jQuery(".customColor_wrapper").slideUp()}),jQuery('select[name="default_colors"], select[name="single_colors"], select[name="hover_colors"]').on("change",y),jQuery('select[name="button_shape"]').on("change",function(){var e=jQuery('select[name="button_shape"]').val(),o=jQuery('select[name="default_colors"]').val(),s=jQuery('select[name="single_colors"]').val(),r=jQuery('select[name="hover_colors"]').val(),a=0,l=t[e],i=l.hasOwnProperty(o),u=l.hasOwnProperty(s),c=l.hasOwnProperty(r);jQuery('select[name="default_colors"] option, select[name="single_colors"] option, select[name="hover_colors"] option').remove(),jQuery.each(t[e],function(e,t){e===o||0==i&&0==a?jQuery('select[name="default_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="default_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===s||0==u&&0==a?jQuery('select[name="single_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="single_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===r||0==c&&0==a?jQuery('select[name="hover_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="hover_colors"]').append('<option value="'+e+'">'+t+"</option>"),++a}),void 0===socialWarfare.lastClass&&(socialWarfare.lastClass="swp_flat_fresh swp_default_full_color swp_individual_full_color swp_other_full_color");var _="swp_"+e+" swp_default_"+o+" swp_individual_"+s+" swp_other_"+r;n.map(function(e,t){jQuery(".swp_social_panel").removeClass("swp_"+t.value)}),jQuery(".swp_social_panel").removeClass(socialWarfare.lastClass).addClass(_),socialWarfare.lastClass=_})}}function f(){jQuery('select[name="button_size"],select[name="button_alignment"]').on("change",function(){jQuery(".swp_social_panel").css({width:"100%"});var e,t=jQuery(".swp_social_panel").width(),o=jQuery('select[name="button_size"]').val(),s=jQuery('select[name="button_alignment"]').val();"full_width"==s&&1!=o||o>=1?(e=t/o,jQuery(".swp_social_panel").css("cssText","width:"+e+"px!important;"),jQuery(".swp_social_panel").css({transform:"scale("+o+")","transform-origin":"left"})):"full_width"!=s&&o<1&&(e=t/o,jQuery(".swp_social_panel").css({transform:"scale("+o+")","transform-origin":s})),socialWarfare.activateHoverStates()})}function w(){var e=jQuery('select[name="ctt_theme"]');e.on("change",function(){var e=jQuery('select[name="ctt_theme"]').val();jQuery(".swp_CTT").attr("class","swp_CTT").addClass(e)}),e.trigger("change")}function v(e,t){var o=jQuery(".sw-admin-wrapper");o.attr("swp-addons"),o.attr("swp-registrations");jQuery(".registration-wrapper."+t).attr("registration",e),1===parseInt(e)?(o.attr("sw-registered",e),jQuery(".sw-top-menu").attr("sw-registered",e),Q(o,"swp-registrations",t)):j(o,"swp-registrations",t)}function j(e,t,o){var s=jQuery(e).attr(t),r=s.indexOf(o);if(-1!==r){var a=r+o.length,n=s.slice(0,r)+s.slice(a);jQuery(e).attr(t,n)}}function Q(e,t,o){var s=jQuery(e).attr(t);s.includes(o)||jQuery(e).attr(t,s+o)}function h(t,o){var s=!1,r={action:"swp_register_plugin",security:swpAdminOptionsData.registerNonce,activity:"register",name_key:t,item_id:o,license_key:jQuery('input[name="'+t+'_license_key"]').val()};return _(),jQuery.post(ajaxurl,r,function(o){if("object"!=typeof(o=JSON.parse(o)))throw o;if(o.success)v("1",t),s=!0;else{alert("This license key is not currently active. Please check the status of your key at https://warfareplugins.com/my-account/license-keys/")}p(s),e.location.reload(!0)}),s}function g(t,o){var s=!1,r={action:"swp_unregister_plugin",security:swpAdminOptionsData.registerNonce,activity:"unregister",name_key:t,item_id:o};return _(),jQuery.post(ajaxurl,r,function(o){if(o=JSON.parse(o),o.success)jQuery('input[name="'+t+'_license_key"]').val(""),v("0",t),s=!0;else{alert("Sorry, we had trouble deactivating your key. Please let us know about this at https://warfareplugins.com/submit-ticket")}p(s),e.location.reload(!0)}),s}function C(){jQuery(".register-plugin").on("click",function(){return h(jQuery(this).attr("swp-addon"),jQuery(this).attr("swp-item-id").trim()),!1}),jQuery(".unregister-plugin").on("click",function(){return g(jQuery(this).attr("swp-addon"),jQuery(this).attr("swp-item-id").trim()),!1})}function b(){jQuery(".sw-buttons-sort.sw-active").sortable({connectWith:".sw-buttons-sort.sw-inactive",update:function(){u()}}),jQuery(".sw-buttons-sort.sw-inactive").sortable({connectWith:".sw-buttons-sort.sw-active",update:function(){u()}})}function O(){jQuery(".sw-system-status").on("click",function(e){e.preventDefault(),jQuery(".system-status-wrapper").slideToggle(),s(jQuery(".system-status-container").get(0))})}function k(){var e;jQuery(".swp_upload_image_button").click(function(t){t.preventDefault();var o=jQuery(this).attr("for");if(e)return void e.open();e=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),e.on("select",function(){var t=e.state().get("selection").first().toJSON();jQuery('input[name="'+o+'"').val(t.url)}),e.open()})}function x(){var e=jQuery("#ctt_preview"),t=jQuery("select[name=ctt_theme]");e.length||(e=jQuery('<style id="ctt_preview"></style>'),jQuery("head").append(e)),"none"===jQuery(t).val()&&W(),jQuery(t).on("change",function(e){"none"===e.target.value&&W()}),jQuery("textarea[name=ctt_css]").on("keyup",W)}function W(){var e=jQuery("#ctt_preview"),t=jQuery("textarea[name=ctt_css]");jQuery(e).text(jQuery(t).val())}function G(e){var t,o=e.target,s=jQuery(o).data("network"),r=(o.getBoundingClientRect(),{top:jQuery(o).position().top-50,left:jQuery(o).position().left+4});if(s.indexOf("_")>0){s=s.split("_").map(function(e){return e[0].toUpperCase()+e.slice(1,e.length)}).join(" ")}if(s=s[0].toUpperCase()+s.slice(1,s.length),t=jQuery('<span class="swp-icon-tooltip">'+s+"</span>").css(r).get(0),jQuery(this).parents(".sw-grid").first().append(t),jQuery(t).outerWidth()>jQuery(o).outerWidth()){var a=jQuery(t).outerWidth()-jQuery(o).outerWidth();r.left=r.left-a/2,jQuery(t).css(r)}jQuery(o).on("mousedown",function(e){jQuery("body").mousemove(function(){D(),jQuery("body").off("mousemove")})})}function D(e){jQuery(".swp-icon-tooltip").remove()}function S(){jQuery("[class*='sw-'][class*='-icon']").each(function(e,t){jQuery(t).hover(G,D)})}e.onload=function(){var e="[name=default_colors],[name=hover_colors], [name=single_colors]",t="[name=float_default_colors], [name=float_hover_colors], [name=float_single_colors]";jQuery("[name=custom_color],[name=custom_color_outlines],[name=float_custom_color],[name=float_custom_color_outlines]").parent().parent().hide(),jQuery(e).each(function(e,t){var o=jQuery(t).val(),s=jQuery("[name=custom_color]").parent().parent(),r=jQuery("[name=custom_color_outlines]").parent().parent();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.show():s.show())}),jQuery(t).each(function(e,t){var o=jQuery(t).val(),s=jQuery("[name=float_custom_color]").parent().parent(),r=jQuery("[name=float_custom_color_outlines]").parent().parent();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.show():s.show())}),jQuery(e).on("change",function(t){var s=(t.target.value,jQuery("[name=custom_color]").parent().parent()),r=jQuery("[name=custom_color_outlines]").parent().parent();o(t,e,s,r)}),jQuery(t).on("change",function(e){var s=(e.target.value,jQuery("[name=float_custom_color]").parent().parent()),r=jQuery("[name=float_custom_color_outlines]").parent().parent();s.hide(),r.hide(),o(e,t,s,r)})},jQuery(document).ready(function(){c(),i(),a(),n(),l(),d(),swpConditionalFields(),w(),f(),C(),b(),O(),k(),x(),S()})}(this,jQuery);
1
+ !function(e,t){"use strict";function o(e,t,o,s){var r={customColor:!1,customOutlines:!1};jQuery(t).each(function(e,t){var o=jQuery(t).val();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.customOutlines=!0:r.customColor=!0)}),r.customColor?o.slideDown():o.slideUp(),r.customOutlines?s.slideDown():s.slideUp(),r.customColor||r.customOutlines?(jQuery("body").append('<div id="color-notice"><p><span class="color-dismiss"></span><b>Note:</b> Custom colors will not show up in the preview, but will on your site.</p></div>'),jQuery(".color-dismiss").on("click",function(){jQuery("#color-notice").fadeOut("slow")})):jQuery("#color-notice").length&&jQuery("#color-notice").fadeOut("slow")}function s(t){var o,s;document.body.createTextRange?(o=document.body.createTextRange(),o.moveToElementText(t),o.select()):e.getSelection&&(s=e.getSelection(),o=document.createRange(),o.selectNodeContents(t),s.removeAllRanges(),s.addRange(o))}function r(){var e={};return jQuery("form.sw-admin-settings-form input, form.sw-admin-settings-form select, form.sw-admin-settings-form textarea").each(function(){var t,o=jQuery(this),s=o.attr("name");t="checkbox"===o.attr("type")?o.prop("checked"):o.val(),e[s]=t}),e.order_of_icons={},jQuery(".sw-active i").each(function(){var t=jQuery(this).data("network");e.order_of_icons[t]=t}),e}function a(){var e=jQuery(".sw-top-menu").offset(),t=jQuery(".sw-top-menu").width();jQuery(".sw-top-menu").css({position:"fixed",left:e.left,top:e.top,width:t}),jQuery(".sw-admin-wrapper").css("padding-top","75px")}function n(){jQuery(".sw-tab-selector").on("click",function(e){e.preventDefault(),jQuery("html, body").animate({scrollTop:0},300);var t=jQuery(this).attr("data-link");jQuery(".sw-admin-tab").hide(),jQuery("#"+t).show(),jQuery(".sw-header-menu li").removeClass("sw-active-tab"),jQuery(this).parents("li").addClass("sw-active-tab"),"swp_styles"===t&&socialWarfare.activateHoverStates(),socialWarfareAdmin.conditionalFields()})}function l(){jQuery(".sw-checkbox-toggle").on("click",function(){var e=jQuery(this).attr("status"),t=jQuery(this).attr("field");"on"===e?(jQuery(this).attr("status","off"),jQuery(t).prop("checked",!1)):(jQuery(this).attr("status","on"),jQuery(t).prop("checked",!0)),u(),socialWarfareAdmin.conditionalFields()})}function i(){jQuery("form.sw-admin-settings-form input, form.sw-admin-settings-form select").on("change",function(){socialWarfareAdmin.conditionalFields(),socialWarfare.newOptions=r(),u()}),socialWarfare.defaultOptions=r()}function u(){socialWarfare.newOptions=r(),JSON.stringify(socialWarfare.newOptions)!==JSON.stringify(socialWarfare.defaultOptions)?jQuery(".sw-save-settings").removeClass("sw-navy-button").addClass("sw-red-button"):jQuery(".sw-save-settings").removeClass("sw-red-button").addClass("sw-navy-button")}function c(){jQuery(".sw-save-settings").on("click",function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,_();var t=r(),o={action:"swp_store_settings",security:swpAdminOptionsData.optionsNonce,settings:t};jQuery.post({url:ajaxurl,data:o,success:function(e){p(!0),socialWarfare.defaultOptions=r(),u()}})})}function _(){jQuery("body").append('<div class="sw-loading-bg"><div class="sw-loading-message">Saving Changes</div></div>')}function p(e){var t=e?"Success!":"";jQuery(".sw-loading-message").html(t).removeClass("sw-loading-message").addClass("sw-loading-complete"),jQuery(".sw-loading-bg").delay(1e3).fadeOut(1e3),setTimeout(function(){jQuery(".sw-loading-bg").remove()},2e3)}function m(){var e=(jQuery('select[name="button_shape"]').val(),jQuery('select[name="default_colors"]').val()),t=jQuery('select[name="single_colors"]').val(),o=jQuery('select[name="hover_colors"]').val();jQuery("style.swp_customColorStuff").remove();var s=jQuery('input[name="custom_color"]').val(),r="";"custom_color"!=e&&"custom_color"!=t&&"custom_color"!=o||(r=".swp_social_panel.swp_default_customColor a, html body .swp_social_panel.swp_individual_customColor .nc_tweetContainer:hover a, body .swp_social_panel.swp_other_customColor:hover a {color:white} .swp_social_panel.swp_default_customColor .nc_tweetContainer, html body .swp_social_panel.swp_individual_customColor .nc_tweetContainer:hover, body .swp_social_panel.swp_other_customColor:hover .nc_tweetContainer {background-color:"+s+";border:1px solid "+s+";}"),"custom_color_outlines"!=e&&"custom_color_outlines"!=t&&"custom_color_outlines"!=o||(r=r+" .swp_social_panel.swp_default_custom_color_outlines a, html body .swp_social_panel.swp_individual_custom_color_outlines .nc_tweetContainer:hover a, body .swp_social_panel.swp_other_custom_color_outlines:hover a { color:"+s+"; } .swp_social_panel.swp_default_custom_color_outlines .nc_tweetContainer, html body .swp_social_panel.swp_individual_custom_color_outlines .nc_tweetContainer:hover, body .swp_social_panel.swp_other_custom_color_outlines:hover .nc_tweetContainer { background:transparent; border:1px solid "+s+"; }"),jQuery("head").append('<style type="text/css" class="swp_customColorStuff">'+r+"</style>")}function d(){function e(e){var t=jQuery('select[name="'+e+'"]').val();if(0===t.indexOf("custom")){return e.slice(0,e.indexOf("_"))+"_full_color"}return t}var o=e("button_shape"),s=e("default_colors"),r=e("single_colors"),a=e("hover_colors"),n="swp_"+o+" swp_default_"+s+" swp_individual_"+r+" swp_other_"+a;if(void 0===socialWarfare.lastClass){var l=t(".swp_social_panel");if(!l.length)return;socialWarfare.lastClass=l.get().className}var n="swp_"+o+" swp_default_"+s+" swp_individual_"+r+" swp_other_"+a;jQuery(".swp_social_panel").removeClass("swp_other_medium_gray"),jQuery(".swp_social_panel").removeClass(socialWarfare.lastClass).addClass(n),socialWarfare.lastClass=n}function y(){if(0!==jQuery('select[name="button_shape"]').length){var e={full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray",light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"},t={flat_fresh:e,leaf:e,pill:e,three_dee:{full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray"},connected:e,shift:e,boxed:e,modern:{full_color:"Full Color",light_gray:"Light Gray",medium_gray:"Medium Gray",dark_gray:"Dark Gray",light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"},dark:{light_gray_outlines:"Light Gray Outlines",medium_gray_outlines:"Medium Gray Outlines",dark_gray_outlines:"Dark Gray Outlines",color_outlines:"Color Outlines",custom_color:"Custom Color",custom_color_outlines:"Custom Color Outlines"}},o=jQuery('select[name="button_shape"]').val(),s=jQuery('select[name="default_colors"]').val(),r=jQuery('select[name="single_colors"]').val(),a=jQuery('select[name="hover_colors"]').val(),n=jQuery('select[name="button_shape"]').find("option").map(function(e,t){return t.value});jQuery('select[name="default_colors"] option, select[name="single_colors"] option, select[name="hover_colors"] option').remove(),jQuery.each(t[o],function(e,t){e===s?jQuery('select[name="default_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="default_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===r?jQuery('select[name="single_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="single_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===a?jQuery('select[name="hover_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="hover_colors"]').append('<option value="'+e+'">'+t+"</option>"),"custom_color"==s||"custom_color_outlines"==s||"custom_color"==r||"custom_color_outlines"==r||"custom_color"==a||"custom_color_outlines"==a?(jQuery(".customColor_wrapper").slideDown(),m()):jQuery(".customColor_wrapper").slideUp()}),jQuery('select[name="default_colors"], select[name="single_colors"], select[name="hover_colors"]').on("change",d),jQuery('select[name="button_shape"]').on("change",function(){var e=jQuery('select[name="button_shape"]').val(),o=jQuery('select[name="default_colors"]').val(),s=jQuery('select[name="single_colors"]').val(),r=jQuery('select[name="hover_colors"]').val(),a=0,l=t[e],i=l.hasOwnProperty(o),u=l.hasOwnProperty(s),c=l.hasOwnProperty(r);jQuery('select[name="default_colors"] option, select[name="single_colors"] option, select[name="hover_colors"] option').remove(),jQuery.each(t[e],function(e,t){e===o||0==i&&0==a?jQuery('select[name="default_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="default_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===s||0==u&&0==a?jQuery('select[name="single_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="single_colors"]').append('<option value="'+e+'">'+t+"</option>"),e===r||0==c&&0==a?jQuery('select[name="hover_colors"]').append('<option value="'+e+'" selected>'+t+"</option>"):jQuery('select[name="hover_colors"]').append('<option value="'+e+'">'+t+"</option>"),++a}),void 0===socialWarfare.lastClass&&(socialWarfare.lastClass="swp_flat_fresh swp_default_full_color swp_individual_full_color swp_other_full_color");var _="swp_"+e+" swp_default_"+o+" swp_individual_"+s+" swp_other_"+r;n.map(function(e,t){jQuery(".swp_social_panel").removeClass("swp_"+t.value)}),jQuery(".swp_social_panel").removeClass(socialWarfare.lastClass).addClass(_),socialWarfare.lastClass=_})}}function f(){jQuery('select[name="button_size"],select[name="button_alignment"]').on("change",function(){jQuery(".swp_social_panel").css({width:"100%"});var e,t=jQuery(".swp_social_panel").width(),o=jQuery('select[name="button_size"]').val(),s=jQuery('select[name="button_alignment"]').val();"full_width"==s&&1!=o||o>=1?(e=t/o,jQuery(".swp_social_panel").css("cssText","width:"+e+"px!important;"),jQuery(".swp_social_panel").css({transform:"scale("+o+")","transform-origin":"left"})):"full_width"!=s&&o<1&&(e=t/o,jQuery(".swp_social_panel").css({transform:"scale("+o+")","transform-origin":s})),socialWarfare.activateHoverStates()})}function w(){var e=jQuery('select[name="ctt_theme"]');e.on("change",function(){var e=jQuery('select[name="ctt_theme"]').val();jQuery(".swp_CTT").attr("class","swp_CTT").addClass(e)}),e.trigger("change")}function v(e,t){var o=jQuery(".sw-admin-wrapper");o.attr("swp-addons"),o.attr("swp-registrations");jQuery(".registration-wrapper."+t).attr("registration",e),1===parseInt(e)?(o.attr("sw-registered",e),jQuery(".sw-top-menu").attr("sw-registered",e),Q(o,"swp-registrations",t)):j(o,"swp-registrations",t)}function j(e,t,o){var s=jQuery(e).attr(t),r=s.indexOf(o);if(-1!==r){var a=r+o.length,n=s.slice(0,r)+s.slice(a);jQuery(e).attr(t,n)}}function Q(e,t,o){var s=jQuery(e).attr(t);s.includes(o)||jQuery(e).attr(t,s+o)}function h(t,o){var s=!1,r={action:"swp_register_plugin",security:swpAdminOptionsData.registerNonce,activity:"register",name_key:t,item_id:o,license_key:jQuery('input[name="'+t+'_license_key"]').val()};return _(),jQuery.post(ajaxurl,r,function(o){if("object"!=typeof(o=JSON.parse(o)))throw o;if(o.success)v("1",t),s=!0;else{alert("This license key is not currently active. Please check the status of your key at https://warfareplugins.com/my-account/license-keys/")}p(s),e.location.reload(!0)}),s}function g(t,o){var s=!1,r={action:"swp_unregister_plugin",security:swpAdminOptionsData.registerNonce,activity:"unregister",name_key:t,item_id:o};return _(),jQuery.post(ajaxurl,r,function(o){if(o=JSON.parse(o),o.success)jQuery('input[name="'+t+'_license_key"]').val(""),v("0",t),s=!0;else{alert("Sorry, we had trouble deactivating your key. Please let us know about this at https://warfareplugins.com/submit-ticket")}p(s),e.location.reload(!0)}),s}function C(){jQuery(".register-plugin").on("click",function(){return h(jQuery(this).attr("swp-addon"),jQuery(this).attr("swp-item-id").trim()),!1}),jQuery(".unregister-plugin").on("click",function(){return g(jQuery(this).attr("swp-addon"),jQuery(this).attr("swp-item-id").trim()),!1})}function b(){jQuery(".sw-buttons-sort.sw-active").sortable({connectWith:".sw-buttons-sort.sw-inactive",update:function(){u()}}),jQuery(".sw-buttons-sort.sw-inactive").sortable({connectWith:".sw-buttons-sort.sw-active",update:function(){u()}})}function O(){jQuery(".sw-system-status").on("click",function(e){e.preventDefault(),jQuery(".system-status-wrapper").slideToggle(),s(jQuery(".system-status-container").get(0))})}function k(){var e;jQuery(".swp_upload_image_button").click(function(t){t.preventDefault();var o=jQuery(this).attr("for");if(e)return void e.open();e=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),e.on("select",function(){var t=e.state().get("selection").first().toJSON();jQuery('input[name="'+o+'"').val(t.url)}),e.open()})}function x(){var e=jQuery("#ctt_preview"),t=jQuery("select[name=ctt_theme]");e.length||(e=jQuery('<style id="ctt_preview"></style>'),jQuery("head").append(e)),"none"===jQuery(t).val()&&W(),jQuery(t).on("change",function(e){"none"===e.target.value&&W()}),jQuery("textarea[name=ctt_css]").on("keyup",W)}function W(){var e=jQuery("#ctt_preview"),t=jQuery("textarea[name=ctt_css]");jQuery(e).text(jQuery(t).val())}function G(e){var t,o=e.target,s=jQuery(o).data("network"),r=(o.getBoundingClientRect(),{top:jQuery(o).position().top-50,left:jQuery(o).position().left+4});if(s.indexOf("_")>0){s=s.split("_").map(function(e){return e[0].toUpperCase()+e.slice(1,e.length)}).join(" ")}if(s=s[0].toUpperCase()+s.slice(1,s.length),t=jQuery('<span class="swp-icon-tooltip">'+s+"</span>").css(r).get(0),jQuery(this).parents(".sw-grid").first().append(t),jQuery(t).outerWidth()>jQuery(o).outerWidth()){var a=jQuery(t).outerWidth()-jQuery(o).outerWidth();r.left=r.left-a/2,jQuery(t).css(r)}jQuery(o).on("mousedown",function(e){jQuery("body").mousemove(function(){D(),jQuery("body").off("mousemove")})})}function D(e){jQuery(".swp-icon-tooltip").remove()}function S(){jQuery("[class*='sw-'][class*='-icon']").each(function(e,t){jQuery(t).hover(G,D)})}e.onload=function(){var e="[name=default_colors],[name=hover_colors], [name=single_colors]",t="[name=float_default_colors], [name=float_hover_colors], [name=float_single_colors]";jQuery("[name=custom_color],[name=custom_color_outlines],[name=float_custom_color],[name=float_custom_color_outlines]").parent().parent().hide(),jQuery(e).each(function(e,t){var o=jQuery(t).val(),s=jQuery("[name=custom_color]").parent().parent(),r=jQuery("[name=custom_color_outlines]").parent().parent();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.show():s.show())}),jQuery(t).each(function(e,t){var o=jQuery(t).val(),s=jQuery("[name=float_custom_color]").parent().parent(),r=jQuery("[name=float_custom_color_outlines]").parent().parent();-1!==o.indexOf("custom")&&(o.indexOf("outlines")>0?r.show():s.show())}),jQuery(e).on("change",function(t){var s=(t.target.value,jQuery("[name=custom_color]").parent().parent()),r=jQuery("[name=custom_color_outlines]").parent().parent();o(t,e,s,r)}),jQuery(t).on("change",function(e){var s=(e.target.value,jQuery("[name=float_custom_color]").parent().parent()),r=jQuery("[name=float_custom_color_outlines]").parent().parent();s.hide(),r.hide(),o(e,t,s,r)})},jQuery(document).ready(function(){c(),i(),a(),n(),l(),y(),socialWarfareAdmin.conditionalFields(),w(),f(),C(),b(),O(),k(),x(),S()})}(this,jQuery);
assets/js/admin.js CHANGED
@@ -1,549 +1,551 @@
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
- if (typeof $ == 'undefined') {
29
- $ = jQuery;
30
- }
31
-
32
- function swp_selected(name) {
33
- return $('select[name="' + name + '"]').val();
34
- }
35
-
36
- function swp_checked(name) {
37
- return $('[name="' + name + '"]').prop('checked');
38
- }
39
-
40
- function string_to_bool(string) {
41
- if (string === 'true') { string = true };
42
- if (string === 'false'){ string = false };
43
- return string;
44
- }
45
-
46
- // Loop through all the fields that have dependancies
47
- $("[data-dep]").each(function() {
48
- // Fetch the conditional values
49
- var condition = $(this).data('dep');
50
- var required = JSON.parse(JSON.stringify($(this).data('dep_val')));
51
-
52
- // Check if we're on the options page or somewhere else
53
- if (window.location.href.indexOf("page=social-warfare") === -1) {
54
- var conditionEl = $(this).parents('.widgets-holder-wrap').find('[data-swp-name="' + condition + '"]');
55
- } else {
56
- var conditionEl = $('[name="' + condition + '"]')[0];
57
- }
58
-
59
- var value;
60
-
61
- if (typeof conditionEl === 'undefined') {
62
- conditionEl = $('[name="' + condition + '"]')[0];
63
-
64
- if (typeof conditionEl === 'undefined') {
65
- conditionEl = $('[field$=' + condition + ']')[0];
66
- }
67
- }
68
-
69
- // Fetch the value of checkboxes or other input types
70
- if ($(conditionEl).attr('type') == 'checkbox') {
71
- value = $(conditionEl).prop('checked');
72
- } else {
73
- value = $(conditionEl).val();
74
- }
75
-
76
- value = string_to_bool(value);
77
-
78
- //* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
79
- // Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
80
-
81
- if (window.location.href.indexOf("page=social-warfare") !== -1) {
82
- // If the required value matches and it's parent is also being shown, show this conditional field
83
- if ($.inArray(value, required) !== -1 && $(conditionEl).parent('.sw-grid').is(':visible') ) {
84
- $(this).show();
85
- } else {
86
- $(this).hide();
87
- }
88
- }
89
-
90
- else {
91
- // If the required value matches, show this conditional field
92
- if ($.inArray(value, required) !== -1 || value === required) {
93
- $(this).show();
94
- } else {
95
- $(this).hide();
96
- }
97
- }
98
- });
99
-
100
- if (false === swp_checked('float_style_source') &&
101
- 'custom_color' === swp_selected('float_default_colors')
102
- || 'custom_color_outlines' === swp_selected('float_default_colors')
103
- || 'custom_color' === swp_selected('float_single_colors')
104
- || 'custom_color_outlines' === swp_selected('float_single_colors')
105
- || 'custom_color' === swp_selected('float_hover_colors')
106
- || 'custom_color_outlines' === swp_selected('float_hover_colors')) {
107
- $('.sideCustomColor_wrapper').slideDown();
108
-
109
- } else {
110
- $('.sideCustomColor_wrapper').slideUp();
111
- }
112
- }
113
-
114
- //* Only run on widgets.php
115
- if (window.location.href.indexOf("widgets.php") > -1) {
116
- //* Make sure the elements exist before trying to read them.
117
- //*
118
- var widgetFinder = setInterval(function() {
119
- if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
120
-
121
- swpWidget = $("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
122
- widgetSubmit = $(swpWidget).find("[id$=savewidget]")[0];
123
-
124
- //* Force swpConditionalFields to run when the widget is opened or saved.
125
- $(swpWidget).on("click", swpConditionalFields);
126
-
127
- $(widgetSubmit).on("click", function() {
128
- setTimeout(swpConditionalFields, 600);
129
- });
130
-
131
- }, 50);
132
- }
133
-
134
- (function(window, $) {
135
- 'use strict';
136
-
137
- if (typeof $ != 'function') {
138
-
139
- if (typeof jQuery == 'function') {
140
- $ = jQuery;
141
- }
142
- else if (typeof window.jQuery == 'function') {
143
- $ = window.jQuery
144
- }
145
- else {
146
- console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");
147
- return;
148
- }
149
- }
150
-
151
- socialWarfareAdmin.linkLength = function(input) {
152
- var tmp = '';
153
-
154
- for (var i = 0; i < 23; i++) {
155
- tmp += 'o';
156
- }
157
-
158
- return input.replace(/(http:\/\/[\S]*)/g, tmp).length;
159
- };
160
-
161
- function updateCharactersRemaining(containerSelector, characterLimit) {
162
- var input = $("#social_warfare #" + containerSelector);
163
- var container = input.parent();
164
- var remaining = characterLimit - input.val().length
165
-
166
- // Account for the permalink + whitespace being added to the tweet.
167
- if (containerSelector == "swp_custom_tweet") {
168
- var permalinkLength = 0;
169
-
170
- // Classic Editor
171
- if ($("#sample-permalink").length) {
172
- permalinkLength = $("#sample-permalink").text().length;
173
- }
174
-
175
- // Gutenberg Editor
176
- else if ($("#wp-admin-bar-view a").length) {
177
- permalinkLength = $("#wp-admin-bar-view a").attr('href').length;
178
- }
179
-
180
- if ($("#swp-twitter-handle").length) {
181
- var twitterHandle = $("#swp-twitter-handle").text();
182
- remaining -= twitterHandle.length;
183
- }
184
-
185
- remaining -= permalinkLength;
186
- }
187
-
188
- if (remaining >= 0) {
189
- container.find(".swp_CountDown").removeClass("swp_red").addClass("swp_blue")
190
- } else {
191
- container.find(".swp_CountDown").removeClass("swp_blue").addClass("swp_red")
192
- }
193
-
194
- container.find(".counterNumber").text(remaining)
195
- }
196
-
197
- function toggleCustomThumbnailFields(show) {
198
- if (typeof show === 'undefined') show = true;
199
-
200
- if (show) {
201
- $(".custom_thumb_size").show();
202
- } else {
203
- $(".custom_thumb_size").hide();
204
- }
205
- }
206
-
207
- function noticeClickHandlers() {
208
- $(".swp-notice-cta").on("click", function(e) {
209
- e.preventDefault();
210
- //* Do not use $ to get href.
211
- var link = e.target.getAttribute("href");
212
-
213
- if (typeof link == 'string' && link.length) {
214
- window.open(link);
215
- }
216
-
217
- var parent = $(this).parents(".swp-dismiss-notice");
218
-
219
- $.post({
220
- url: ajaxurl,
221
- data: {
222
- action: 'dismiss',
223
- key: parent.data("key"),
224
- timeframe: this.dataset.timeframe
225
- },
226
- success: function(result) {
227
- result = JSON.parse(result)
228
- if (result) {
229
- parent.slideUp(500);
230
- }
231
- }
232
- });
233
- });
234
- }
235
-
236
- function postEditorCheckboxChange(event) {
237
- event.preventDefault();
238
-
239
- var checked = !($(this).attr('status') == 'on');
240
- var selector = $(this).attr("field");
241
- var checkbox = $(selector);
242
-
243
- if (checked) {
244
- $(this).attr('status', 'on');
245
- checkbox.prop('checked', true).prop('value', true);
246
- } else {
247
- $(this).attr('status', 'off');
248
- checkbox.prop('checked', false).prop('value', false);
249
- }
250
- }
251
-
252
- /**
253
- * For the inputs which have a text counter, the labels are pushed too
254
- * far above and need to be brought closer.
255
- *
256
- * Top/bottom margins have no apparent effect, so we'll use positioning instead.
257
- *
258
- * @param string textareaID The textarea whose label is too close.
259
- */
260
- function updateTextareaStyle(textareaID) {
261
- var style = {
262
- top: "-25px",
263
- position: "relative"
264
- }
265
-
266
- $("#" + textareaID).css("border-top-right-radius", 0) // Makes the character counter look connected to the input.
267
- .parent().css(style); // Positions the input closer to label.
268
- }
269
-
270
-
271
- function createCharactersRemaining(selector, textLimit) {
272
- var div = '<div class="swp_CountDown"><span class="counterNumber">' + -textLimit + '</span></div>';
273
- updateTextareaStyle(selector)
274
- $("#social_warfare #" + selector).parent().prepend(div);
275
- }
276
-
277
- socialWarfareAdmin.resizeImageFields = function() {
278
- $('ul.swpmb-media-list').each(function(index, mediaList) {
279
- // Check if the media list has been created yet
280
- if ($(mediaList).is(':empty')) {
281
- //* For the Pinterest image placeholder image.
282
- if ($(mediaList).parents(".swpmb-field").attr("class").indexOf("pinterest") > 0) {
283
- var height = $(mediaList).width() * (3 / 2);
284
- } else {
285
- // Setup the Open Graph Image Placeholder
286
- var height = $(mediaList).width() * (9 / 16);
287
- }
288
-
289
- $(mediaList).css("height", height);
290
- } else {
291
- $(mediaList).css("height", "initial");
292
- }
293
- })
294
- }
295
-
296
- /**
297
- * Creates the left, right, and full-width wraps for each container.
298
- * @return {[type]} [description]
299
- */
300
- function fillContainer(container) {
301
- var positions = ['full-width', 'left', 'right'];
302
- var type = $(container).data('type');
303
-
304
- positions.forEach(function(position) {
305
- var className = '.swpmb-' + position;
306
-
307
- if ($(container).find(className)) {
308
- //* Only include child elements with the correct type.
309
- var children = $(container).find(className)
310
- .filter(function(index, child) {
311
- return $(child).hasClass(type)
312
- })
313
- if (children.length) {
314
- var wrap = $(container).find(className + '-wrap');
315
- $(wrap).append(children);
316
- }
317
- }
318
- });
319
- }
320
-
321
- /**
322
- *
323
- * @since 3.x.x | Created
324
- * @since 3.4.0 | Wrote the docblock and added comments.
325
- * @return void
326
- *
327
- */
328
- function putFieldsInContainers() {
329
- $(".swpmb-meta-container[data-type]").map(function(index, container) {
330
- var type = $(this).data('type');
331
- if (!type) {
332
- return;
333
- }
334
-
335
- var fields = $(".swpmb-field." + type);
336
-
337
- if (fields.length) {
338
- $(this).append(fields);
339
- }
340
-
341
- fillContainer(container);
342
- });
343
- }
344
-
345
- function createTextCounters() {
346
- // map CSS selector to the character limit.
347
- var textCounters = {
348
- "swp_og_title": 60,
349
- "swp_og_description": 150,
350
- "swp_pinterest_description": 500,
351
- "swp_custom_tweet": 280
352
- };
353
-
354
- Object.keys(textCounters).map(function(selector) {
355
- var textLimit = textCounters[selector];
356
-
357
- createCharactersRemaining(selector, textLimit);
358
- updateCharactersRemaining(selector, textLimit);
359
-
360
- $("#social_warfare #" + selector).on("input", function() {
361
- updateCharactersRemaining(selector, textLimit);
362
- });
363
- });
364
- }
365
-
366
- //* This method exists ONLY for version 3.4.1 of Social Warfare.
367
- //* The next version should have a more long-term sustainable way to manage
368
- //* post-editor fields with dependencies.
369
- function setTempConditionalField() {
370
- $('[field=#swp_twitter_use_open_graph]').click(function(event) {
371
- var target = $("#swp_twitter_use_open_graph");
372
-
373
- if (target.attr('value') == 'true') {
374
- $('.swpmb-meta-container[data-type=twitter]').slideUp()
375
- target.attr('value', 'true');
376
- } else {
377
- $('.swpmb-meta-container[data-type=twitter]').slideDown()
378
- target.attr('value', 'false');
379
- }
380
-
381
- socialWarfareAdmin.resizeImageFields();
382
- });
383
- }
384
-
385
-
386
- /**
387
- * The third party module used to create metaboxes (on the server) does not
388
- * provide a way to organize the HTML.
389
- *
390
- * Our fix for this is to create a new parent container with the `data-type`
391
- * attribute. The value of `data-type` represents the group of related
392
- * functionality, such as 'heading', 'open-graph', or 'pinterest'.
393
- *
394
- * Then we move the related content (matched by CSS classnames) into the
395
- * appropriate container using javascript.
396
- *
397
- * @see PHP social-warfare-pro\lib\admin\SWP_Meta_Box_Loader->before_meta_boxes()
398
- */
399
- function displayMetaBox() {
400
- if (!$($(".swpmb-media-list").length)) return;
401
-
402
- clearInterval(window.initSWMetabox);
403
-
404
- putFieldsInContainers();
405
-
406
- //* Metabox is loaded via Ajax, but we want to resize known images ASAP.
407
- //* Even a couple extra times if need be.
408
- setTimeout(socialWarfareAdmin.resizeImageFields, 600);
409
- setTimeout(socialWarfareAdmin.resizeImageFields, 1400);
410
- setTimeout(socialWarfareAdmin.resizeImageFields, 3000);
411
-
412
- //* Begin Temp code only for 3.4.1
413
- var status = $("#swp_twitter_use_open_graph").val()
414
- if (status == 'false') {
415
- $('.swpmb-meta-container[data-type=twitter]').slideDown()
416
- } else {
417
- $('.swpmb-meta-container[data-type=twitter]').slideUp()
418
- }
419
- setTempConditionalField();
420
- //* End Temp code
421
-
422
- $('ul.swpmb-media-list').find(".swpmb-overlay").click(socialWarfareAdmin.resizeImageFields);
423
- $("#social_warfare.ui-sortable-handle").click(socialWarfareAdmin.resizeImageFields); //* The open/close handle WP gives us. Images need to be resized if it was closed then opened.
424
- socialWarfareAdmin.addImageEditListeners()
425
-
426
- $("#social_warfare.postbox").show();
427
- }
428
-
429
- //* These elements are only created once an image exists
430
- socialWarfareAdmin.addImageEditListeners = function() {
431
- $('.swpmb-edit-media, .swpmb-remove-media').off(socialWarfareAdmin.resizeImageFields);
432
- $('.swpmb-edit-media, .swpmb-remove-media').on(socialWarfareAdmin.resizeImageFields);
433
- }
434
-
435
- // The network key is stored in a classname `swp-network-$network`.
436
- // @see SWP_Options_Page->establish_authorizations()
437
- socialWarfareAdmin.revokeNetworkConnection = function(event) {
438
- var button, index, networkAndTail, network;
439
- button = event.target;
440
- if ($(event.target).is('div')) {
441
- // This is the inner div holding the network text.
442
- button = event.target.parentNode;
443
- }
444
- else {
445
- button = event.target;
446
- }
447
-
448
- // First find the target class, then parse that class for a network name.
449
- index = button.className.indexOf('swp-network');
450
- index = 1 + button.className.indexOf('-', 4+index);
451
-
452
- networkAndTail = button.className.slice(index);
453
-
454
- index = networkAndTail.indexOf(' ');
455
-
456
- if ( -1 == index ) {
457
- // This was the last class in the selector
458
- network = networkAndTail;
459
- }
460
-
461
- else {
462
- // There are more classes after the selector.
463
- network = networkAndTail.slice(0, index)
464
- }
465
-
466
- /**
467
- * The disconnect URL opens in a new tab. While the user is distracted,
468
- * make an ajax request to delete these credentials and reload the page.
469
- */
470
-
471
- $.post({
472
- url: ajaxurl,
473
- data: {
474
- action: 'swp_delete_network_tokens',
475
- network: network
476
- },
477
- success: function(r) {
478
- var response = JSON.parse(r)
479
- if (response.ok) {
480
- window.location.href = response.url
481
- }
482
- else {
483
- console.log('bad response', response)
484
- }
485
- // should be redirected by server back to ?page=social-warfare
486
- }
487
- // complete: function(/*try again*/) {window.location.reload(1)}
488
- });
489
- }
490
-
491
- socialWarfareAdmin.triggerDeletePostMeta = function(event) {
492
- event.preventDefault()
493
- var message = "This will delete all Social Warfare meta keys for this post, including Open Graph, Twitter, and Pinterest descriptions and images. If you want to keep these, please copy them to an offline file first, and paste them back in after the reset. To reset, enter reset_post_meta";
494
- var prompt = window.prompt(message, 'reset_or_cancel');
495
- console.log('prompt', prompt)
496
- if (prompt == 'reset_post_meta') {
497
- jQuery.post({
498
- url: ajaxurl,
499
- data: {
500
- action: 'swp_reset_post_meta',
501
- post_id: socialWarfare.post_id
502
- },
503
- complete: function(response) {
504
- socialWarfareAdmin.resetMetaFields()
505
- }
506
- })
507
- }
508
- }
509
-
510
-
511
- socialWarfareAdmin.resetMetaFields = function() {
512
- $('#social_warfare.postbox').find('input[type=text], textarea').val('');
513
- $('#social_warfare.postbox').find('select').val('default');
514
-
515
- }
516
-
517
-
518
- socialWarfareAdmin.addEventListeners = function() {
519
- $('.swp-revoke-button').on('click', socialWarfareAdmin.revokeNetworkConnection)
520
- $('#swp_reset_button').on('click', socialWarfareAdmin.triggerDeletePostMeta)
521
- }
522
-
523
- socialWarfareAdmin.createResetButton = function() {
524
- var parent = $("#swp_reset_button");
525
-
526
- var button = jQuery('<button class="button">Reset Post Meta</button>')
527
- button.on('click', socialWarfareAdmin.triggerDeletePostMeta)
528
-
529
- parent.after(button)
530
- }
531
-
532
- $(document).ready(function() {
533
- noticeClickHandlers();
534
-
535
- if ($('#social_warfare.postbox').length) {
536
- createTextCounters();
537
- socialWarfareAdmin.createResetButton();
538
- swpConditionalFields();
539
-
540
- $(".sw-checkbox-toggle.swp-post-editor").click(postEditorCheckboxChange);
541
- $('.swp_popular_post_options select').on('change', swpConditionalFields);
542
-
543
- //* Wait for the Rilis metabox to populate itself.
544
- window.initSWMetabox = setInterval(displayMetaBox, 10);
545
- }
546
-
547
- socialWarfareAdmin.addEventListeners();
548
- });
549
- })(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
+ (function(window, $) {
16
+ 'use strict';
17
+
18
+ if (typeof $ != 'function') {
19
+
20
+ if (typeof jQuery == 'function') {
21
+ $ = jQuery;
22
+ }
23
+ else if (typeof window.jQuery == 'function') {
24
+ $ = window.jQuery
25
+ }
26
+ else {
27
+ console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");
28
+ return;
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Show and hide input fields based on conditional values.
34
+ *
35
+ * This function iterates over each element with the "dep" data attribute. For each
36
+ * such dependant element, its parent element controls whether the dependant is shown or hidden
37
+ * if the parent's value matches the condition.
38
+ *
39
+ * @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.
40
+ * @since 3.0.0 Feb 14 2018 | Mapped the required array from variable types to string.
41
+ *
42
+ * @see admin-options-page.js
43
+ * @return none
44
+ */
45
+ socialWarfareAdmin.conditionalFields = function() {
46
+ if (typeof $ == 'undefined') {
47
+ $ = jQuery;
48
+ }
49
+
50
+ function swp_selected(name) {
51
+ return $('select[name="' + name + '"]').val();
52
+ }
53
+
54
+ function swp_checked(name) {
55
+ return $('[name="' + name + '"]').prop('checked');
56
+ }
57
+
58
+ function string_to_bool(string) {
59
+ if (string === 'true') { string = true };
60
+ if (string === 'false'){ string = false };
61
+ return string;
62
+ }
63
+
64
+ // Loop through all the fields that have dependancies
65
+ $("[data-dep]").each(function() {
66
+ // Fetch the conditional values
67
+ var condition = $(this).data('dep');
68
+ var required = JSON.parse(JSON.stringify($(this).data('dep_val')));
69
+
70
+ // Check if we're on the options page or somewhere else
71
+ if (window.location.href.indexOf("page=social-warfare") === -1) {
72
+ var conditionEl = $(this).parents('.widgets-holder-wrap').find('[data-swp-name="' + condition + '"]');
73
+ } else {
74
+ var conditionEl = $('[name="' + condition + '"]')[0];
75
+ }
76
+
77
+ var value;
78
+
79
+ if (typeof conditionEl === 'undefined') {
80
+ conditionEl = $('[name="' + condition + '"]')[0];
81
+
82
+ if (typeof conditionEl === 'undefined') {
83
+ conditionEl = $('[field$=' + condition + ']')[0];
84
+ }
85
+ }
86
+
87
+ // Fetch the value of checkboxes or other input types
88
+ if ($(conditionEl).attr('type') == 'checkbox') {
89
+ value = $(conditionEl).prop('checked');
90
+ } else {
91
+ value = $(conditionEl).val();
92
+ }
93
+
94
+ value = string_to_bool(value);
95
+
96
+ //* Options page uses parent visibilty to check. Widget page does not. This could definiitely look better.
97
+ // Show or hide based on the conditional values (and the dependancy must be visible in case it is dependant)
98
+
99
+ if (window.location.href.indexOf("page=social-warfare") !== -1) {
100
+ // If the required value matches and it's parent is also being shown, show this conditional field
101
+ if ($.inArray(value, required) !== -1 && $(conditionEl).parent('.sw-grid').is(':visible') ) {
102
+ $(this).show();
103
+ } else {
104
+ $(this).hide();
105
+ }
106
+ }
107
+
108
+ else {
109
+ // If the required value matches, show this conditional field
110
+ if ($.inArray(value, required) !== -1 || value === required) {
111
+ $(this).show();
112
+ } else {
113
+ $(this).hide();
114
+ }
115
+ }
116
+ });
117
+
118
+ if (false === swp_checked('float_style_source') &&
119
+ 'custom_color' === swp_selected('float_default_colors')
120
+ || 'custom_color_outlines' === swp_selected('float_default_colors')
121
+ || 'custom_color' === swp_selected('float_single_colors')
122
+ || 'custom_color_outlines' === swp_selected('float_single_colors')
123
+ || 'custom_color' === swp_selected('float_hover_colors')
124
+ || 'custom_color_outlines' === swp_selected('float_hover_colors')) {
125
+ $('.sideCustomColor_wrapper').slideDown();
126
+
127
+ } else {
128
+ $('.sideCustomColor_wrapper').slideUp();
129
+ }
130
+ }
131
+
132
+ //* Only run on widgets.php
133
+ if (window.location.href.indexOf("widgets.php") > -1) {
134
+ //* Make sure the elements exist before trying to read them.
135
+ //*
136
+ var widgetFinder = setInterval(function() {
137
+ if (typeof swpWidget !== 'undefined') clearInterval(widgetFinder);
138
+
139
+ swpWidget = $("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0];
140
+ widgetSubmit = $(swpWidget).find("[id$=savewidget]")[0];
141
+
142
+ //* Force swpConditionalFields to run when the widget is opened or saved.
143
+ $(swpWidget).on("click", socialWarfareAdmin.conditionalFields);
144
+
145
+ $(widgetSubmit).on("click", function() {
146
+ setTimeout(socialWarfareAdmin.conditionalFields, 600);
147
+ });
148
+
149
+ }, 50);
150
+ }
151
+
152
+
153
+ socialWarfareAdmin.linkLength = function(input) {
154
+ var tmp = '';
155
+
156
+ for (var i = 0; i < 23; i++) {
157
+ tmp += 'o';
158
+ }
159
+
160
+ return input.replace(/(http:\/\/[\S]*)/g, tmp).length;
161
+ };
162
+
163
+ function updateCharactersRemaining(containerSelector, characterLimit) {
164
+ var input = $("#social_warfare #" + containerSelector);
165
+ var container = input.parent();
166
+ var remaining = characterLimit - input.val().length
167
+
168
+ // Account for the permalink + whitespace being added to the tweet.
169
+ if (containerSelector == "swp_custom_tweet") {
170
+ var permalinkLength = 0;
171
+
172
+ // Classic Editor
173
+ if ($("#sample-permalink").length) {
174
+ permalinkLength = $("#sample-permalink").text().length;
175
+ }
176
+
177
+ // Gutenberg Editor
178
+ else if ($("#wp-admin-bar-view a").length) {
179
+ permalinkLength = $("#wp-admin-bar-view a").attr('href').length;
180
+ }
181
+
182
+ if ($("#swp-twitter-handle").length) {
183
+ var twitterHandle = $("#swp-twitter-handle").text();
184
+ remaining -= twitterHandle.length;
185
+ }
186
+
187
+ remaining -= permalinkLength;
188
+ }
189
+
190
+ if (remaining >= 0) {
191
+ container.find(".swp_CountDown").removeClass("swp_red").addClass("swp_blue")
192
+ } else {
193
+ container.find(".swp_CountDown").removeClass("swp_blue").addClass("swp_red")
194
+ }
195
+
196
+ container.find(".counterNumber").text(remaining)
197
+ }
198
+
199
+ function toggleCustomThumbnailFields(show) {
200
+ if (typeof show === 'undefined') show = true;
201
+
202
+ if (show) {
203
+ $(".custom_thumb_size").show();
204
+ } else {
205
+ $(".custom_thumb_size").hide();
206
+ }
207
+ }
208
+
209
+ function noticeClickHandlers() {
210
+ $(".swp-notice-cta").on("click", function(e) {
211
+ e.preventDefault();
212
+ //* Do not use $ to get href.
213
+ var link = e.target.getAttribute("href");
214
+
215
+ if (typeof link == 'string' && link.length) {
216
+ window.open(link);
217
+ }
218
+
219
+ var parent = $(this).parents(".swp-dismiss-notice");
220
+
221
+ $.post({
222
+ url: ajaxurl,
223
+ data: {
224
+ action: 'dismiss',
225
+ key: parent.data("key"),
226
+ timeframe: this.dataset.timeframe
227
+ },
228
+ success: function(result) {
229
+ result = JSON.parse(result)
230
+ if (result) {
231
+ parent.slideUp(500);
232
+ }
233
+ }
234
+ });
235
+ });
236
+ }
237
+
238
+ function postEditorCheckboxChange(event) {
239
+ event.preventDefault();
240
+
241
+ var checked = !($(this).attr('status') == 'on');
242
+ var selector = $(this).attr("field");
243
+ var checkbox = $(selector);
244
+
245
+ if (checked) {
246
+ $(this).attr('status', 'on');
247
+ checkbox.prop('checked', true).prop('value', true);
248
+ } else {
249
+ $(this).attr('status', 'off');
250
+ checkbox.prop('checked', false).prop('value', false);
251
+ }
252
+ }
253
+
254
+ /**
255
+ * For the inputs which have a text counter, the labels are pushed too
256
+ * far above and need to be brought closer.
257
+ *
258
+ * Top/bottom margins have no apparent effect, so we'll use positioning instead.
259
+ *
260
+ * @param string textareaID The textarea whose label is too close.
261
+ */
262
+ function updateTextareaStyle(textareaID) {
263
+ var style = {
264
+ top: "-25px",
265
+ position: "relative"
266
+ }
267
+
268
+ $("#" + textareaID).css("border-top-right-radius", 0) // Makes the character counter look connected to the input.
269
+ .parent().css(style); // Positions the input closer to label.
270
+ }
271
+
272
+
273
+ function createCharactersRemaining(selector, textLimit) {
274
+ var div = '<div class="swp_CountDown"><span class="counterNumber">' + -textLimit + '</span></div>';
275
+ updateTextareaStyle(selector)
276
+ $("#social_warfare #" + selector).parent().prepend(div);
277
+ }
278
+
279
+ socialWarfareAdmin.resizeImageFields = function() {
280
+ $('ul.swpmb-media-list').each(function(index, mediaList) {
281
+ // Check if the media list has been created yet
282
+ if ($(mediaList).is(':empty')) {
283
+ //* For the Pinterest image placeholder image.
284
+ if ($(mediaList).parents(".swpmb-field").attr("class").indexOf("pinterest") > 0) {
285
+ var height = $(mediaList).width() * (3 / 2);
286
+ } else {
287
+ // Setup the Open Graph Image Placeholder
288
+ var height = $(mediaList).width() * (9 / 16);
289
+ }
290
+
291
+ $(mediaList).css("height", height);
292
+ } else {
293
+ $(mediaList).css("height", "initial");
294
+ }
295
+ })
296
+ }
297
+
298
+ /**
299
+ * Creates the left, right, and full-width wraps for each container.
300
+ * @return {[type]} [description]
301
+ */
302
+ function fillContainer(container) {
303
+ var positions = ['full-width', 'left', 'right'];
304
+ var type = $(container).data('type');
305
+
306
+ positions.forEach(function(position) {
307
+ var className = '.swpmb-' + position;
308
+
309
+ if ($(container).find(className)) {
310
+ //* Only include child elements with the correct type.
311
+ var children = $(container).find(className)
312
+ .filter(function(index, child) {
313
+ return $(child).hasClass(type)
314
+ })
315
+ if (children.length) {
316
+ var wrap = $(container).find(className + '-wrap');
317
+ $(wrap).append(children);
318
+ }
319
+ }
320
+ });
321
+ }
322
+
323
+ /**
324
+ *
325
+ * @since 3.x.x | Created
326
+ * @since 3.4.0 | Wrote the docblock and added comments.
327
+ * @return void
328
+ *
329
+ */
330
+ function putFieldsInContainers() {
331
+ $(".swpmb-meta-container[data-type]").map(function(index, container) {
332
+ var type = $(this).data('type');
333
+ if (!type) {
334
+ return;
335
+ }
336
+
337
+ var fields = $(".swpmb-field." + type);
338
+
339
+ if (fields.length) {
340
+ $(this).append(fields);
341
+ }
342
+
343
+ fillContainer(container);
344
+ });
345
+ }
346
+
347
+ function createTextCounters() {
348
+ // map CSS selector to the character limit.
349
+ var textCounters = {
350
+ "swp_og_title": 60,
351
+ "swp_og_description": 150,
352
+ "swp_pinterest_description": 500,
353
+ "swp_custom_tweet": 280
354
+ };
355
+
356
+ Object.keys(textCounters).map(function(selector) {
357
+ var textLimit = textCounters[selector];
358
+
359
+ createCharactersRemaining(selector, textLimit);
360
+ updateCharactersRemaining(selector, textLimit);
361
+
362
+ $("#social_warfare #" + selector).on("input", function() {
363
+ updateCharactersRemaining(selector, textLimit);
364
+ });
365
+ });
366
+ }
367
+
368
+ //* This method exists ONLY for version 3.4.1 of Social Warfare.
369
+ //* The next version should have a more long-term sustainable way to manage
370
+ //* post-editor fields with dependencies.
371
+ function setTempConditionalField() {
372
+ $('[field=#swp_twitter_use_open_graph]').click(function(event) {
373
+ var target = $("#swp_twitter_use_open_graph");
374
+
375
+ if (target.attr('value') == 'true') {
376
+ $('.swpmb-meta-container[data-type=twitter]').slideUp()
377
+ target.attr('value', 'true');
378
+ } else {
379
+ $('.swpmb-meta-container[data-type=twitter]').slideDown()
380
+ target.attr('value', 'false');
381
+ }
382
+
383
+ socialWarfareAdmin.resizeImageFields();
384
+ });
385
+ }
386
+
387
+
388
+ /**
389
+ * The third party module used to create metaboxes (on the server) does not
390
+ * provide a way to organize the HTML.
391
+ *
392
+ * Our fix for this is to create a new parent container with the `data-type`
393
+ * attribute. The value of `data-type` represents the group of related
394
+ * functionality, such as 'heading', 'open-graph', or 'pinterest'.
395
+ *
396
+ * Then we move the related content (matched by CSS classnames) into the
397
+ * appropriate container using javascript.
398
+ *
399
+ * @see PHP social-warfare-pro\lib\admin\SWP_Meta_Box_Loader->before_meta_boxes()
400
+ */
401
+ function displayMetaBox() {
402
+ if (!$($(".swpmb-media-list").length)) return;
403
+
404
+ clearInterval(window.initSWMetabox);
405
+
406
+ putFieldsInContainers();
407
+
408
+ //* Metabox is loaded via Ajax, but we want to resize known images ASAP.
409
+ //* Even a couple extra times if need be.
410
+ setTimeout(socialWarfareAdmin.resizeImageFields, 600);
411
+ setTimeout(socialWarfareAdmin.resizeImageFields, 1400);
412
+ setTimeout(socialWarfareAdmin.resizeImageFields, 3000);
413
+
414
+ //* Begin Temp code only for 3.4.1
415
+ var status = $("#swp_twitter_use_open_graph").val()
416
+ if (status == 'false') {
417
+ $('.swpmb-meta-container[data-type=twitter]').slideDown()
418
+ } else {
419
+ $('.swpmb-meta-container[data-type=twitter]').slideUp()
420
+ }
421
+ setTempConditionalField();
422
+ //* End Temp code
423
+
424
+ $('ul.swpmb-media-list').find(".swpmb-overlay").click(socialWarfareAdmin.resizeImageFields);
425
+ $("#social_warfare.ui-sortable-handle").click(socialWarfareAdmin.resizeImageFields); //* The open/close handle WP gives us. Images need to be resized if it was closed then opened.
426
+ socialWarfareAdmin.addImageEditListeners()
427
+
428
+ $("#social_warfare.postbox").show();
429
+ }
430
+
431
+ //* These elements are only created once an image exists
432
+ socialWarfareAdmin.addImageEditListeners = function() {
433
+ $('.swpmb-edit-media, .swpmb-remove-media').off(socialWarfareAdmin.resizeImageFields);
434
+ $('.swpmb-edit-media, .swpmb-remove-media').on(socialWarfareAdmin.resizeImageFields);
435
+ }
436
+
437
+ // The network key is stored in a classname `swp-network-$network`.
438
+ // @see SWP_Options_Page->establish_authorizations()
439
+ socialWarfareAdmin.revokeNetworkConnection = function(event) {
440
+ var button, index, networkAndTail, network;
441
+ button = event.target;
442
+ if ($(event.target).is('div')) {
443
+ // This is the inner div holding the network text.
444
+ button = event.target.parentNode;
445
+ }
446
+ else {
447
+ button = event.target;
448
+ }
449
+
450
+ // First find the target class, then parse that class for a network name.
451
+ index = button.className.indexOf('swp-network');
452
+ index = 1 + button.className.indexOf('-', 4+index);
453
+
454
+ networkAndTail = button.className.slice(index);
455
+
456
+ index = networkAndTail.indexOf(' ');
457
+
458
+ if ( -1 == index ) {
459
+ // This was the last class in the selector
460
+ network = networkAndTail;
461
+ }
462
+
463
+ else {
464
+ // There are more classes after the selector.
465
+ network = networkAndTail.slice(0, index)
466
+ }
467
+
468
+ /**
469
+ * The disconnect URL opens in a new tab. While the user is distracted,
470
+ * make an ajax request to delete these credentials and reload the page.
471
+ */
472
+
473
+ $.post({
474
+ url: ajaxurl,
475
+ data: {
476
+ action: 'swp_delete_network_tokens',
477
+ network: network
478
+ },
479
+ success: function(r) {
480
+ var response = JSON.parse(r)
481
+ if (response.ok) {
482
+ window.location.href = response.url
483
+ }
484
+ else {
485
+ console.log('bad response', response)
486
+ }
487
+ // should be redirected by server back to ?page=social-warfare
488
+ }
489
+ // complete: function(/*try again*/) {window.location.reload(1)}
490
+ });
491
+ }
492
+
493
+ socialWarfareAdmin.triggerDeletePostMeta = function(event) {
494
+ event.preventDefault()
495
+ var message = "This will delete all Social Warfare meta keys for this post, including Open Graph, Twitter, and Pinterest descriptions and images. If you want to keep these, please copy them to an offline file first, and paste them back in after the reset. To reset, enter reset_post_meta";
496
+ var prompt = window.prompt(message, 'reset_or_cancel');
497
+ console.log('prompt', prompt)
498
+ if (prompt == 'reset_post_meta') {
499
+ jQuery.post({
500
+ url: ajaxurl,
501
+ data: {
502
+ action: 'swp_reset_post_meta',
503
+ post_id: socialWarfare.post_id
504
+ },
505
+ complete: function(response) {
506
+ socialWarfareAdmin.resetMetaFields()
507
+ }
508
+ })
509
+ }
510
+ }
511
+
512
+
513
+ socialWarfareAdmin.resetMetaFields = function() {
514
+ $('#social_warfare.postbox').find('input[type=text], textarea').val('');
515
+ $('#social_warfare.postbox').find('select').val('default');
516
+
517
+ }
518
+
519
+
520
+ socialWarfareAdmin.addEventListeners = function() {
521
+ $('.swp-revoke-button').on('click', socialWarfareAdmin.revokeNetworkConnection)
522
+ $('#swp_reset_button').on('click', socialWarfareAdmin.triggerDeletePostMeta)
523
+ }
524
+
525
+ socialWarfareAdmin.createResetButton = function() {
526
+ var parent = $("#swp_reset_button");
527
+
528
+ var button = jQuery('<button class="button">Reset Post Meta</button>')
529
+ button.on('click', socialWarfareAdmin.triggerDeletePostMeta)
530
+
531
+ parent.after(button)
532
+ }
533
+
534
+ $(document).ready(function() {
535
+ noticeClickHandlers();
536
+
537
+ if ($('#social_warfare.postbox').length) {
538
+ createTextCounters();
539
+ socialWarfareAdmin.createResetButton();
540
+ socialWarfareAdmin.conditionalFields();
541
+
542
+ $(".sw-checkbox-toggle.swp-post-editor").click(postEditorCheckboxChange);
543
+ $('.swp_popular_post_options select').on('change', socialWarfareAdmin.conditionalFields);
544
+
545
+ //* Wait for the Rilis metabox to populate itself.
546
+ window.initSWMetabox = setInterval(displayMetaBox, 10);
547
+ }
548
+
549
+ socialWarfareAdmin.addEventListeners();
550
+ });
551
+ })(this, jQuery);
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- function swpConditionalFields(){function e(e){return $('select[name="'+e+'"]').val()}function t(e){return"true"===e&&(e=!0),"false"===e&&(e=!1),e}"undefined"==typeof $&&($=jQuery),$("[data-dep]").each(function(){var e=$(this).data("dep"),a=JSON.parse(JSON.stringify($(this).data("dep_val")));if(-1===window.location.href.indexOf("page=social-warfare"))var i=$(this).parents(".widgets-holder-wrap").find('[data-swp-name="'+e+'"]');else var i=$('[name="'+e+'"]')[0];var s;void 0===i&&void 0===(i=$('[name="'+e+'"]')[0])&&(i=$("[field$="+e+"]")[0]),s="checkbox"==$(i).attr("type")?$(i).prop("checked"):$(i).val(),s=t(s),-1!==window.location.href.indexOf("page=social-warfare")?-1!==$.inArray(s,a)&&$(i).parent(".sw-grid").is(":visible")?$(this).show():$(this).hide():-1!==$.inArray(s,a)||s===a?$(this).show():$(this).hide()}),!1===function(e){return $('[name="'+e+'"]').prop("checked")}("float_style_source")&&"custom_color"===e("float_default_colors")||"custom_color_outlines"===e("float_default_colors")||"custom_color"===e("float_single_colors")||"custom_color_outlines"===e("float_single_colors")||"custom_color"===e("float_hover_colors")||"custom_color_outlines"===e("float_hover_colors")?$(".sideCustomColor_wrapper").slideDown():$(".sideCustomColor_wrapper").slideUp()}var socialWarfareAdmin=socialWarfareAdmin||{},swpWidget,widgetSubmit;if(window.location.href.indexOf("widgets.php")>-1)var widgetFinder=setInterval(function(){void 0!==swpWidget&&clearInterval(widgetFinder),swpWidget=$("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0],widgetSubmit=$(swpWidget).find("[id$=savewidget]")[0],$(swpWidget).on("click",swpConditionalFields),$(widgetSubmit).on("click",function(){setTimeout(swpConditionalFields,600)})},50);!function(e,t){"use strict";function a(e,a){var i=t("#social_warfare #"+e),s=i.parent(),r=a-i.val().length;if("swp_custom_tweet"==e){var o=0;if(t("#sample-permalink").length?o=t("#sample-permalink").text().length:t("#wp-admin-bar-view a").length&&(o=t("#wp-admin-bar-view a").attr("href").length),t("#swp-twitter-handle").length){r-=t("#swp-twitter-handle").text().length}r-=o}r>=0?s.find(".swp_CountDown").removeClass("swp_red").addClass("swp_blue"):s.find(".swp_CountDown").removeClass("swp_blue").addClass("swp_red"),s.find(".counterNumber").text(r)}function i(){t(".swp-notice-cta").on("click",function(a){a.preventDefault();var i=a.target.getAttribute("href");"string"==typeof i&&i.length&&e.open(i);var s=t(this).parents(".swp-dismiss-notice");t.post({url:ajaxurl,data:{action:"dismiss",key:s.data("key"),timeframe:this.dataset.timeframe},success:function(e){(e=JSON.parse(e))&&s.slideUp(500)}})})}function s(e){e.preventDefault();var a=!("on"==t(this).attr("status")),i=t(this).attr("field"),s=t(i);a?(t(this).attr("status","on"),s.prop("checked",!0).prop("value",!0)):(t(this).attr("status","off"),s.prop("checked",!1).prop("value",!1))}function r(e){var a={top:"-25px",position:"relative"};t("#"+e).css("border-top-right-radius",0).parent().css(a)}function o(e,a){var i='<div class="swp_CountDown"><span class="counterNumber">'+-a+"</span></div>";r(e),t("#social_warfare #"+e).parent().prepend(i)}function n(e){var a=["full-width","left","right"],i=t(e).data("type");a.forEach(function(a){var s=".swpmb-"+a;if(t(e).find(s)){var r=t(e).find(s).filter(function(e,a){return t(a).hasClass(i)});if(r.length){var o=t(e).find(s+"-wrap");t(o).append(r)}}})}function l(){t(".swpmb-meta-container[data-type]").map(function(e,a){var i=t(this).data("type");if(i){var s=t(".swpmb-field."+i);s.length&&t(this).append(s),n(a)}})}function c(){var e={swp_og_title:60,swp_og_description:150,swp_pinterest_description:500,swp_custom_tweet:280};Object.keys(e).map(function(i){var s=e[i];o(i,s),a(i,s),t("#social_warfare #"+i).on("input",function(){a(i,s)})})}function d(){t("[field=#swp_twitter_use_open_graph]").click(function(e){var a=t("#swp_twitter_use_open_graph");"true"==a.attr("value")?(t(".swpmb-meta-container[data-type=twitter]").slideUp(),a.attr("value","true")):(t(".swpmb-meta-container[data-type=twitter]").slideDown(),a.attr("value","false")),socialWarfareAdmin.resizeImageFields()})}function p(){if(t(t(".swpmb-media-list").length)){clearInterval(e.initSWMetabox),l(),setTimeout(socialWarfareAdmin.resizeImageFields,600),setTimeout(socialWarfareAdmin.resizeImageFields,1400),setTimeout(socialWarfareAdmin.resizeImageFields,3e3);"false"==t("#swp_twitter_use_open_graph").val()?t(".swpmb-meta-container[data-type=twitter]").slideDown():t(".swpmb-meta-container[data-type=twitter]").slideUp(),d(),t("ul.swpmb-media-list").find(".swpmb-overlay").click(socialWarfareAdmin.resizeImageFields),t("#social_warfare.ui-sortable-handle").click(socialWarfareAdmin.resizeImageFields),socialWarfareAdmin.addImageEditListeners(),t("#social_warfare.postbox").show()}}if("function"!=typeof t)if("function"==typeof jQuery)t=jQuery;else{if("function"!=typeof e.jQuery)return void console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");t=e.jQuery}socialWarfareAdmin.linkLength=function(e){for(var t="",a=0;a<23;a++)t+="o";return e.replace(/(http:\/\/[\S]*)/g,t).length},socialWarfareAdmin.resizeImageFields=function(){t("ul.swpmb-media-list").each(function(e,a){if(t(a).is(":empty")){if(t(a).parents(".swpmb-field").attr("class").indexOf("pinterest")>0)var i=1.5*t(a).width();else var i=t(a).width()*(9/16);t(a).css("height",i)}else t(a).css("height","initial")})},socialWarfareAdmin.addImageEditListeners=function(){t(".swpmb-edit-media, .swpmb-remove-media").off(socialWarfareAdmin.resizeImageFields),t(".swpmb-edit-media, .swpmb-remove-media").on(socialWarfareAdmin.resizeImageFields)},socialWarfareAdmin.revokeNetworkConnection=function(a){var i,s,r,o;i=a.target,i=t(a.target).is("div")?a.target.parentNode:a.target,s=i.className.indexOf("swp-network"),s=1+i.className.indexOf("-",4+s),r=i.className.slice(s),s=r.indexOf(" "),o=-1==s?r:r.slice(0,s),t.post({url:ajaxurl,data:{action:"swp_delete_network_tokens",network:o},success:function(t){var a=JSON.parse(t);a.ok?e.location.href=a.url:console.log("bad response",a)}})},socialWarfareAdmin.triggerDeletePostMeta=function(t){t.preventDefault();var a=e.prompt("This will delete all Social Warfare meta keys for this post, including Open Graph, Twitter, and Pinterest descriptions and images. If you want to keep these, please copy them to an offline file first, and paste them back in after the reset. To reset, enter reset_post_meta","reset_or_cancel");console.log("prompt",a),"reset_post_meta"==a&&jQuery.post({url:ajaxurl,data:{action:"swp_reset_post_meta",post_id:socialWarfare.post_id},complete:function(e){socialWarfareAdmin.resetMetaFields()}})},socialWarfareAdmin.resetMetaFields=function(){t("#social_warfare.postbox").find("input[type=text], textarea").val(""),t("#social_warfare.postbox").find("select").val("default")},socialWarfareAdmin.addEventListeners=function(){t(".swp-revoke-button").on("click",socialWarfareAdmin.revokeNetworkConnection),t("#swp_reset_button").on("click",socialWarfareAdmin.triggerDeletePostMeta)},socialWarfareAdmin.createResetButton=function(){var e=t("#swp_reset_button"),a=jQuery('<button class="button">Reset Post Meta</button>');a.on("click",socialWarfareAdmin.triggerDeletePostMeta),e.after(a)},t(document).ready(function(){i(),t("#social_warfare.postbox").length&&(c(),socialWarfareAdmin.createResetButton(),swpConditionalFields(),t(".sw-checkbox-toggle.swp-post-editor").click(s),t(".swp_popular_post_options select").on("change",swpConditionalFields),e.initSWMetabox=setInterval(p,10)),socialWarfareAdmin.addEventListeners()})}(this,jQuery);
1
+ var socialWarfareAdmin=socialWarfareAdmin||{},swpWidget,widgetSubmit;!function(e,t){"use strict";function a(e,a){var i=t("#social_warfare #"+e),r=i.parent(),s=a-i.val().length;if("swp_custom_tweet"==e){var o=0;if(t("#sample-permalink").length?o=t("#sample-permalink").text().length:t("#wp-admin-bar-view a").length&&(o=t("#wp-admin-bar-view a").attr("href").length),t("#swp-twitter-handle").length){s-=t("#swp-twitter-handle").text().length}s-=o}s>=0?r.find(".swp_CountDown").removeClass("swp_red").addClass("swp_blue"):r.find(".swp_CountDown").removeClass("swp_blue").addClass("swp_red"),r.find(".counterNumber").text(s)}function i(){t(".swp-notice-cta").on("click",function(a){a.preventDefault();var i=a.target.getAttribute("href");"string"==typeof i&&i.length&&e.open(i);var r=t(this).parents(".swp-dismiss-notice");t.post({url:ajaxurl,data:{action:"dismiss",key:r.data("key"),timeframe:this.dataset.timeframe},success:function(e){(e=JSON.parse(e))&&r.slideUp(500)}})})}function r(e){e.preventDefault();var a=!("on"==t(this).attr("status")),i=t(this).attr("field"),r=t(i);a?(t(this).attr("status","on"),r.prop("checked",!0).prop("value",!0)):(t(this).attr("status","off"),r.prop("checked",!1).prop("value",!1))}function s(e){var a={top:"-25px",position:"relative"};t("#"+e).css("border-top-right-radius",0).parent().css(a)}function o(e,a){var i='<div class="swp_CountDown"><span class="counterNumber">'+-a+"</span></div>";s(e),t("#social_warfare #"+e).parent().prepend(i)}function n(e){var a=["full-width","left","right"],i=t(e).data("type");a.forEach(function(a){var r=".swpmb-"+a;if(t(e).find(r)){var s=t(e).find(r).filter(function(e,a){return t(a).hasClass(i)});if(s.length){var o=t(e).find(r+"-wrap");t(o).append(s)}}})}function l(){t(".swpmb-meta-container[data-type]").map(function(e,a){var i=t(this).data("type");if(i){var r=t(".swpmb-field."+i);r.length&&t(this).append(r),n(a)}})}function c(){var e={swp_og_title:60,swp_og_description:150,swp_pinterest_description:500,swp_custom_tweet:280};Object.keys(e).map(function(i){var r=e[i];o(i,r),a(i,r),t("#social_warfare #"+i).on("input",function(){a(i,r)})})}function d(){t("[field=#swp_twitter_use_open_graph]").click(function(e){var a=t("#swp_twitter_use_open_graph");"true"==a.attr("value")?(t(".swpmb-meta-container[data-type=twitter]").slideUp(),a.attr("value","true")):(t(".swpmb-meta-container[data-type=twitter]").slideDown(),a.attr("value","false")),socialWarfareAdmin.resizeImageFields()})}function p(){if(t(t(".swpmb-media-list").length)){clearInterval(e.initSWMetabox),l(),setTimeout(socialWarfareAdmin.resizeImageFields,600),setTimeout(socialWarfareAdmin.resizeImageFields,1400),setTimeout(socialWarfareAdmin.resizeImageFields,3e3);"false"==t("#swp_twitter_use_open_graph").val()?t(".swpmb-meta-container[data-type=twitter]").slideDown():t(".swpmb-meta-container[data-type=twitter]").slideUp(),d(),t("ul.swpmb-media-list").find(".swpmb-overlay").click(socialWarfareAdmin.resizeImageFields),t("#social_warfare.ui-sortable-handle").click(socialWarfareAdmin.resizeImageFields),socialWarfareAdmin.addImageEditListeners(),t("#social_warfare.postbox").show()}}if("function"!=typeof t)if("function"==typeof jQuery)t=jQuery;else{if("function"!=typeof e.jQuery)return void console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");t=e.jQuery}if(socialWarfareAdmin.conditionalFields=function(){function a(e){return t('select[name="'+e+'"]').val()}function i(e){return"true"===e&&(e=!0),"false"===e&&(e=!1),e}void 0===t&&(t=jQuery),t("[data-dep]").each(function(){var a=t(this).data("dep"),r=JSON.parse(JSON.stringify(t(this).data("dep_val")));if(-1===e.location.href.indexOf("page=social-warfare"))var s=t(this).parents(".widgets-holder-wrap").find('[data-swp-name="'+a+'"]');else var s=t('[name="'+a+'"]')[0];var o;void 0===s&&void 0===(s=t('[name="'+a+'"]')[0])&&(s=t("[field$="+a+"]")[0]),o="checkbox"==t(s).attr("type")?t(s).prop("checked"):t(s).val(),o=i(o),-1!==e.location.href.indexOf("page=social-warfare")?-1!==t.inArray(o,r)&&t(s).parent(".sw-grid").is(":visible")?t(this).show():t(this).hide():-1!==t.inArray(o,r)||o===r?t(this).show():t(this).hide()}),!1===function(e){return t('[name="'+e+'"]').prop("checked")}("float_style_source")&&"custom_color"===a("float_default_colors")||"custom_color_outlines"===a("float_default_colors")||"custom_color"===a("float_single_colors")||"custom_color_outlines"===a("float_single_colors")||"custom_color"===a("float_hover_colors")||"custom_color_outlines"===a("float_hover_colors")?t(".sideCustomColor_wrapper").slideDown():t(".sideCustomColor_wrapper").slideUp()},e.location.href.indexOf("widgets.php")>-1)var f=setInterval(function(){void 0!==swpWidget&&clearInterval(f),swpWidget=t("#widgets-right [id*=_swp_popular_posts_widget], [id*=_swp_popular_posts_widget].open")[0],widgetSubmit=t(swpWidget).find("[id$=savewidget]")[0],t(swpWidget).on("click",socialWarfareAdmin.conditionalFields),t(widgetSubmit).on("click",function(){setTimeout(socialWarfareAdmin.conditionalFields,600)})},50);socialWarfareAdmin.linkLength=function(e){for(var t="",a=0;a<23;a++)t+="o";return e.replace(/(http:\/\/[\S]*)/g,t).length},socialWarfareAdmin.resizeImageFields=function(){t("ul.swpmb-media-list").each(function(e,a){if(t(a).is(":empty")){if(t(a).parents(".swpmb-field").attr("class").indexOf("pinterest")>0)var i=1.5*t(a).width();else var i=t(a).width()*(9/16);t(a).css("height",i)}else t(a).css("height","initial")})},socialWarfareAdmin.addImageEditListeners=function(){t(".swpmb-edit-media, .swpmb-remove-media").off(socialWarfareAdmin.resizeImageFields),t(".swpmb-edit-media, .swpmb-remove-media").on(socialWarfareAdmin.resizeImageFields)},socialWarfareAdmin.revokeNetworkConnection=function(a){var i,r,s,o;i=a.target,i=t(a.target).is("div")?a.target.parentNode:a.target,r=i.className.indexOf("swp-network"),r=1+i.className.indexOf("-",4+r),s=i.className.slice(r),r=s.indexOf(" "),o=-1==r?s:s.slice(0,r),t.post({url:ajaxurl,data:{action:"swp_delete_network_tokens",network:o},success:function(t){var a=JSON.parse(t);a.ok?e.location.href=a.url:console.log("bad response",a)}})},socialWarfareAdmin.triggerDeletePostMeta=function(t){t.preventDefault();var a=e.prompt("This will delete all Social Warfare meta keys for this post, including Open Graph, Twitter, and Pinterest descriptions and images. If you want to keep these, please copy them to an offline file first, and paste them back in after the reset. To reset, enter reset_post_meta","reset_or_cancel");console.log("prompt",a),"reset_post_meta"==a&&jQuery.post({url:ajaxurl,data:{action:"swp_reset_post_meta",post_id:socialWarfare.post_id},complete:function(e){socialWarfareAdmin.resetMetaFields()}})},socialWarfareAdmin.resetMetaFields=function(){t("#social_warfare.postbox").find("input[type=text], textarea").val(""),t("#social_warfare.postbox").find("select").val("default")},socialWarfareAdmin.addEventListeners=function(){t(".swp-revoke-button").on("click",socialWarfareAdmin.revokeNetworkConnection),t("#swp_reset_button").on("click",socialWarfareAdmin.triggerDeletePostMeta)},socialWarfareAdmin.createResetButton=function(){var e=t("#swp_reset_button"),a=jQuery('<button class="button">Reset Post Meta</button>');a.on("click",socialWarfareAdmin.triggerDeletePostMeta),e.after(a)},t(document).ready(function(){i(),t("#social_warfare.postbox").length&&(c(),socialWarfareAdmin.createResetButton(),socialWarfareAdmin.conditionalFields(),t(".sw-checkbox-toggle.swp-post-editor").click(r),t(".swp_popular_post_options select").on("change",socialWarfareAdmin.conditionalFields),e.initSWMetabox=setInterval(p,10)),socialWarfareAdmin.addEventListeners()})}(this,jQuery);
assets/js/post-editor/.editorconfig CHANGED
File without changes
assets/js/post-editor/.eslintignore CHANGED
File without changes
assets/js/post-editor/.eslintrc.json CHANGED
File without changes
assets/js/post-editor/.gitignore CHANGED
File without changes
assets/js/post-editor/README.md CHANGED
File without changes
assets/js/post-editor/blocks.php CHANGED
File without changes
assets/js/post-editor/dist/blocks.build.js CHANGED
File without changes
assets/js/post-editor/dist/blocks.style.build.css CHANGED
File without changes
assets/js/post-editor/package-lock.json CHANGED
File without changes
assets/js/post-editor/package.json CHANGED
File without changes
assets/js/post-editor/src/block/click-to-tweet.js CHANGED
File without changes
assets/js/post-editor/src/block/pinterest.js CHANGED
File without changes
assets/js/post-editor/src/block/social-warfare.js CHANGED
File without changes
assets/js/post-editor/src/block/style.scss CHANGED
File without changes
assets/js/post-editor/src/blocks.js CHANGED
File without changes
assets/js/post-editor/src/common.scss CHANGED
File without changes
assets/js/script.js CHANGED
@@ -96,13 +96,13 @@ window.socialWarfare = window.socialWarfare || {};
96
  }
97
  }
98
 
99
- /**
100
- * Values from the server may be sent as strings, but may also be empty.
101
- * In this context, we are interested in strings with length only.
102
- */
103
- function isString(maybeString) {
104
  return typeof maybeString == 'string' && maybeString.length > 0;
105
- }
106
 
107
  /***************************************************************************
108
  *
@@ -844,15 +844,40 @@ window.socialWarfare = window.socialWarfare || {};
844
  *
845
  ***************************************************************************/
846
 
847
- // Create a single instance of the save button and store it in socialWarfare.
848
- socialWarfare.createHoverSaveButton = function() {
849
- var button = $(document.createElement("a"));
850
- button.css("display: none");
851
- button.addClass("swp-hover-pin-button");
852
- button.text("Save");
853
- socialWarfare.hoverSaveButton = $(button);
854
- return button;
855
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
856
 
857
 
858
  /**
96
  }
97
  }
98
 
99
+ /**
100
+ * Values from the server may be sent as strings, but may also be empty.
101
+ * In this context, we are interested in strings with length only.
102
+ */
103
+ function isString(maybeString) {
104
  return typeof maybeString == 'string' && maybeString.length > 0;
105
+ }
106
 
107
  /***************************************************************************
108
  *
844
  *
845
  ***************************************************************************/
846
 
847
+ // Create a single instance of the save button and store it in socialWarfare.
848
+ socialWarfare.createHoverSaveButton = function() {
849
+
850
+
851
+ /**
852
+ * This is a compatibility patch to make our plugin work nicely with the
853
+ * Thrive Architect plugin. This will do two things:
854
+ *
855
+ * 1. It will stop the Pinterest Save button from appearing on images
856
+ * when the post being loaded is inside of the Thrive Architect page
857
+ * builder/editor.
858
+ *
859
+ * 2. It will locate any old Save buttons that have been added previously
860
+ * that were then erroneously saved in the database. This way, whenever
861
+ * they edit a post, it will simultanously repair/remove the invalid
862
+ * markup that was stored in the database.
863
+ *
864
+ */
865
+ if( $('.tve_editor_page').length ) {
866
+ $('.sw-pinit-button').remove();
867
+ $('.sw-pinit').each( function() {
868
+ var inner_content = $('.sw-pinit').contents();
869
+ $(this).replaceWith(inner_content);
870
+ });
871
+ return;
872
+ }
873
+
874
+ var button = $(document.createElement("a"));
875
+ button.css("display: none");
876
+ button.addClass("swp-hover-pin-button");
877
+ button.text("Save");
878
+ socialWarfare.hoverSaveButton = $(button);
879
+ return button;
880
+ }
881
 
882
 
883
  /**
assets/js/script.min.js CHANGED
@@ -1 +1 @@
1
- window.socialWarfare=window.socialWarfare||{},function(a,e){"use strict";function t(a){return"string"==typeof a&&a.length>0}if("function"!=typeof e){if("function"!=typeof jQuery)return void console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");var e=jQuery}socialWarfare.paddingTop=parseInt(e("body").css("padding-top")),socialWarfare.paddingBottom=parseInt(e("body").css("padding-bottom")),socialWarfare.initPlugin=function(){if(e("body").css({paddingTop:socialWarfare.paddingTop,paddingBottom:socialWarfare.paddingBottom}),socialWarfare.establishPanels(),socialWarfare.establishBreakpoint(),socialWarfare.panels.staticHorizontal||socialWarfare.panels.floatingSide||socialWarfare.panels.floatingHorizontal){socialWarfare.createFloatHorizontalPanel(),socialWarfare.positionFloatSidePanel(),socialWarfare.activateHoverStates(),socialWarfare.handleButtonClicks(),socialWarfare.updateFloatingButtons(),"object"==typeof swpPinIt&&1==swpPinIt.enabled&&(socialWarfare.createHoverSaveButton(),socialWarfare.triggerImageListeners()),setTimeout(function(){socialWarfare.checkListeners(0,5)},2e3);var t=Date.now();e(a).scroll(function(){t+50-Date.now()<0&&(socialWarfare.updateFloatingButtons(),t=Date.now())})}};var i;socialWarfare.onWindowResize=function(){clearTimeout(i),i=setTimeout(socialWarfare.initPlugin,100)},socialWarfare.establishPanels=function(){return socialWarfare.panels={staticHorizontal:null,floatingSide:null,floatingHorizontal:null},socialWarfare.panels.staticHorizontal=e(".swp_social_panel").not(".swp_social_panelSide"),socialWarfare.panels.floatingSide=e(".swp_social_panelSide"),socialWarfare.panels},socialWarfare.activateHoverStates=function(){socialWarfare.trigger("pre_activate_buttons"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer").on("mouseenter",function(){if(!e(this).hasClass("swp_nohover")){socialWarfare.resetStaticPanel();var a=e(this).find(".swp_share").outerWidth(),t=e(this).find("i.sw").outerWidth(),i=e(this).width(),o=1+(a+35)/i;e(this).find(".iconFiller").width(a+t+25+"px"),e(this).css("flex",o+" 1 0%")}}),e(".swp_social_panel:not(.swp_social_panelSide)").on("mouseleave",socialWarfare.resetStaticPanel)},socialWarfare.resetStaticPanel=function(){e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover) .iconFiller").removeAttr("style"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover)").removeAttr("style")},socialWarfare.handleButtonClicks=function(){e(".nc_tweet, a.swp_CTT").off("click"),e(".nc_tweet, a.swp_CTT").on("click",function(t){if(e(this).hasClass("noPop"))return t;if(void 0===e(this).data("link"))return t;t.preventDefault();var i,o,r,n,s,l,c=e(this).data("link").replace("’","'");i=270,o=500,e(this).is(".pinterest, .buffer_link, .flipboard")&&(i=550,o=775),e(this).hasClass("nc_tweet")?l=e(this).parents(".nc_tweetContainer").data("network"):e(this).hasClass("swp_CTT")&&(l="ctt"),r=a.screenY+(a.innerHeight-i)/2,n=a.screenX+(a.innerWidth-o)/2,s="height="+i+",width="+o+",top="+r+",left="+n,a.open(c,l,s),socialWarfare.trackClick(l)})},socialWarfare.createFloatHorizontalPanel=function(){if(socialWarfare.panels.staticHorizontal.length){var a=socialWarfare.panels.staticHorizontal.data("float"),t=socialWarfare.panels.staticHorizontal.data("float-mobile"),i=socialWarfare.panels.staticHorizontal.data("float-color"),o=e('<div class="nc_wrapper swp_floating_horizontal_wrapper" style="background-color:'+i+'"></div>'),r="";e(".nc_wrapper").length&&e(".nc_wrapper").remove(),e(".swp_floating_horizontal_wrapper").length&&e(".swp_floating_horizontal_wrapper").remove(),"top"!=a&&"bottom"!=a&&"top"!=t&&"bottom"!=t||(r=socialWarfare.isMobile()?t:a,o.addClass(r).hide().appendTo("body"),socialWarfare.panels.floatingHorizontal=socialWarfare.panels.staticHorizontal.first().clone(),socialWarfare.panels.floatingHorizontal.addClass("nc_floater").appendTo(o),socialWarfare.updateFloatingHorizontalDimensions(),e(".swp_social_panel .swp_count").css({transition:"padding .1s linear"}))}},socialWarfare.updateFloatingHorizontalDimensions=function(){if(socialWarfare.panels.staticHorizontal.length&&socialWarfare.panels.floatingHorizontal){var a="100%",e=0,t=socialWarfare.panels.staticHorizontal,i=t.parent();i.hasClass("swp-hidden-panel-wrap")&&(i=i.parent()),void 0!==t.offset().left&&(e=t.offset().left),void 0!==t.width()&&(a=t.width()),0==e&&(e=i.offset().left),100!=a&&0!=a||(a=i.width()),socialWarfare.panels.floatingHorizontal.css({width:a,left:e})}},socialWarfare.staticPanelIsVisible=function(){var t=!1,i=e(a).scrollTop();return e(".swp_social_panel").not(".swp_social_panelSide, .nc_floater").each(function(o){var r=e(this).offset();if(void 0!==socialWarfare.floatBeforeContent&&"1"!=socialWarfare.floatBeforeContent){var n=e(".swp-content-locator").parent();0===o&&n.length&&n.offset().top>i+e(a).height()&&(t=!0)}e(this).is(":visible")&&r.top+e(this).height()>i&&r.top<i+e(a).height()&&(t=!0)}),t},socialWarfare.updateFloatingButtons=function(){if(socialWarfare.panels.staticHorizontal.length)var a=socialWarfare.panels.staticHorizontal;else{if(!socialWarfare.panels.floatingSide.length)return;var a=socialWarfare.panels.floatingSide}var t=a.data("float");if(1==socialWarfare.isMobile())var t=a.data("float-mobile");return"none"==t?e(".nc_wrapper, .swp_floating_horizontal_wrapper, .swp_social_panelSide").hide():socialWarfare.isMobile()?(socialWarfare.toggleMobileButtons(),void socialWarfare.toggleFloatingHorizontalPanel()):("right"!=t&&"left"!=t||socialWarfare.toggleFloatingVerticalPanel(),void("bottom"!=t&&"top"!=t||socialWarfare.toggleFloatingHorizontalPanel()))},socialWarfare.toggleMobileButtons=function(){socialWarfare.panels.floatingSide.hide();var a=socialWarfare.staticPanelIsVisible()?"collapse":"visible";e(".nc_wrapper, .swp_floating_horizontal_wrapper").css("visibility",a)},socialWarfare.toggleFloatingVerticalPanel=function(){var a="",e=socialWarfare.panels.floatingSide.data("float"),t=socialWarfare.staticPanelIsVisible(),i="";if(socialWarfare.isMobile())return socialWarfare.panels.floatingSide.hide();socialWarfare.panels.floatingSide&&socialWarfare.panels.floatingSide.length||(t=!0),"slide"==socialWarfare.panels.floatingSide.data("transition")?(a=e,i=t?"-150px":"5px",socialWarfare.panels.floatingSide.css(a,i).show()):t?socialWarfare.panels.floatingSide.css("opacity",1).fadeOut(300).css("opacity",0):socialWarfare.panels.floatingSide.css("opacity",0).fadeIn(300).css("display","flex").css("opacity",1)},socialWarfare.hasReferencePanel=function(){return void 0!==socialWarfare.panels.staticHorizontal&&socialWarfare.panels.staticHorizontal.length>0},socialWarfare.toggleFloatingHorizontalPanel=function(){if(socialWarfare.hasReferencePanel()&&socialWarfare.panels.floatingHorizontal){var a=socialWarfare.panels.floatingHorizontal.first(),t=socialWarfare.isMobile()?e(a).data("float-mobile"):e(a).data("float"),i="bottom"==t?socialWarfare.paddingBottom:socialWarfare.paddingTop,o="padding-"+t;"off"!=t&&(socialWarfare.staticPanelIsVisible()?(e(".nc_wrapper, .swp_floating_horizontal_wrapper").hide(),socialWarfare.isMobile()&&e("#wpadminbar").length&&e("#wpadminbar").css("top",0)):(i+=50,e(".nc_wrapper, .swp_floating_horizontal_wrapper").show(),socialWarfare.isMobile()&&"top"==t&&e("#wpadminbar").length&&e("#wpadminbar").css("top",a.parent().height())),e("body").css(o,i))}},socialWarfare.positionFloatSidePanel=function(){var e,t,i,o=socialWarfare.panels.floatingSide;if(o&&o.length&&!o.hasClass("swp_side_top")&&!o.hasClass("swp_side_bottom")){if(e=o.outerHeight(),t=a.innerHeight,e>t)return o.css("top",0);i=(t-e)/2,o.css("top",i)}},socialWarfare.createHoverSaveButton=function(){var a=e(document.createElement("a"));return a.css("display: none"),a.addClass("swp-hover-pin-button"),a.text("Save"),socialWarfare.hoverSaveButton=e(a),a},socialWarfare.triggerImageListeners=function(){e(".swp-content-locator").parent().find("img").off("mouseenter",socialWarfare.renderPinterestSaveButton),e(".swp-content-locator").parent().find("img").on("mouseenter",socialWarfare.renderPinterestSaveButton),setTimeout(socialWarfare.triggerImageListeners,2e3)},socialWarfare.getPinMedia=function(a){if(t(swpPinIt.image_source))return swpPinIt.image_source;if(t(a.attr("src")))return a.attr("src");var i=["src","lazy-src","media"],o="";if(i.some(function(e){if(t(a.data(e)))return o=a.data(e),!0}),""!=o){var r=e("<img>");return r.attr("src",o),r.prop("src")}},socialWarfare.getPinDescription=function(a){return t(a.data("pin-description"))?a.data("pin-description"):t(swpPinIt.image_description)?swpPinIt.image_description:t(a.attr("title"))?a.attr("title"):t(a.attr("alt"))?a.attr("alt"):t(swpPinIt.post_title)?swpPinIt.post_title:void 0},socialWarfare.enablePinterestSaveButtons=function(){jQuery("img").on("mouseenter",function(){var a=socialWarfare.findPinterestBrowserSaveButtons();void 0!==a&&a&&socialWarfare.removePinterestBrowserSaveButtons(a)})},socialWarfare.toggleHoverSaveDisplay=function(a){var t=a.offset().top,i=a.offset().left;switch(swpPinIt.vLocation){case"top":t+=15;break;case"middle":var o=a.height()/2-7.5-12;t+=o;break;case"bottom":t+=a.height()-15-24}switch(swpPinIt.hLocation){case"left":i+=15;break;case"center":var o=a.width()/2-7.5-60;i+=o;break;case"right":i+=a.width()-15-120}socialWarfare.hoverSaveButton.css("top",t),socialWarfare.hoverSaveButton.css("left",i),a.on("mouseleave",function(a){"swp-hover-pin-button"!=a.relatedTarget.className&&e(".swp-hover-pin-button").remove()}),e(document.body).append(socialWarfare.hoverSaveButton)},socialWarfare.renderPinterestSaveButton=function(t){function i(t){var i=e(a).width()-1264,o=e(a).height()-506,r=",top="+o+",left="+i;a.open(s,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"+r),socialWarfare.trackClick("pin_image"),e(".swp-hover-pin-button").remove()}if(!(t.relatedTarget&&"swp-hover-pin-button"==t.relatedTarget.className||e(".swp-hover-pin-button").length>0)){var o=e(t.target);if(!(void 0!=typeof swpPinIt.disableOnAnchors&&swpPinIt.disableOnAnchors&&o.parents().filter("a").length||o.outerHeight()<swpPinIt.minHeight||o.outerWidth()<swpPinIt.minWidth||o.hasClass("no_pin")||o.hasClass("no-pin"))){socialWarfare.toggleHoverSaveDisplay(o);var r=socialWarfare.getPinDescription(o),n=socialWarfare.getPinMedia(o),s="http://pinterest.com/pin/create/bookmarklet/?media="+encodeURI(n)+"&url="+encodeURI(document.URL)+"&is_video=false&description="+encodeURIComponent(r);e(".swp-hover-pin-button").on("click",i)}}},socialWarfare.findPinterestBrowserSaveButtons=function(){var e,t,i,o,r,n;return e="rgb(189, 8, 28)",t="rgb(230, 0, 35)",i="8675309",o="14px 14px",r=null,document.querySelectorAll("span").forEach(function(s,l){n=a.getComputedStyle(s),n.backgroundColor!=e&&n.backgroundColor!=t||n.backgroundSize==o&&n.zIndex==i&&(r=s)}),r},socialWarfare.removePinterestBrowserSaveButtons=function(e){var t,i,o;t=e.nextSibling,void 0!==t&&"SPAN"==t.nodeName&&(i=a.getComputedStyle(t),o="24px",0===i.width.indexOf(o)&&0===i.height.indexOf(o)&&t.remove()),e.remove()},socialWarfare.trigger=function(t){e(a).trigger(e.Event(t))},socialWarfare.trackClick=function(a){!0===swpClickTracking&&("function"==typeof ga&&ga("send","event","social_media","swp_"+a+"_share"),"object"==typeof dataLayer&&dataLayer.push({event:"swp_"+a+"_share"}))},socialWarfare.checkListeners=function(a,t){if(!(a>t)){var i=e(".swp_social_panel");if(i.length>0&&i.find(".swp_pinterest"))return void socialWarfare.handleButtonClicks();setTimeout(function(){socialWarfare.checkListeners(++a,t)},2e3)}},socialWarfare.establishBreakpoint=function(){var a=e(".swp_social_panel");socialWarfare.breakpoint=1100,(a.length&&a.data("min-width")||0==a.data("min-width"))&&(socialWarfare.breakpoint=parseInt(a.data("min-width")))},socialWarfare.isMobile=function(){return e(a).width()<socialWarfare.breakpoint},e(document).ready(function(){socialWarfare.initPlugin(),socialWarfare.panels.floatingSide.hide(),e(a).resize(socialWarfare.onWindowResize),"undefined"!=typeof swpPinIt&&swpPinIt.enabled&&socialWarfare.enablePinterestSaveButtons()}),e(a).on("load",function(){"undefined"!=typeof swpPinIt&&swpPinIt.enabled&&socialWarfare.enablePinterestSaveButtons(),a.clearCheckID=0})}(this,jQuery);
1
+ window.socialWarfare=window.socialWarfare||{},function(a,e){"use strict";function t(a){return"string"==typeof a&&a.length>0}if("function"!=typeof e){if("function"!=typeof jQuery)return void console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");var e=jQuery}socialWarfare.paddingTop=parseInt(e("body").css("padding-top")),socialWarfare.paddingBottom=parseInt(e("body").css("padding-bottom")),socialWarfare.initPlugin=function(){if(e("body").css({paddingTop:socialWarfare.paddingTop,paddingBottom:socialWarfare.paddingBottom}),socialWarfare.establishPanels(),socialWarfare.establishBreakpoint(),socialWarfare.panels.staticHorizontal||socialWarfare.panels.floatingSide||socialWarfare.panels.floatingHorizontal){socialWarfare.createFloatHorizontalPanel(),socialWarfare.positionFloatSidePanel(),socialWarfare.activateHoverStates(),socialWarfare.handleButtonClicks(),socialWarfare.updateFloatingButtons(),"object"==typeof swpPinIt&&1==swpPinIt.enabled&&(socialWarfare.createHoverSaveButton(),socialWarfare.triggerImageListeners()),setTimeout(function(){socialWarfare.checkListeners(0,5)},2e3);var t=Date.now();e(a).scroll(function(){t+50-Date.now()<0&&(socialWarfare.updateFloatingButtons(),t=Date.now())})}};var i;socialWarfare.onWindowResize=function(){clearTimeout(i),i=setTimeout(socialWarfare.initPlugin,100)},socialWarfare.establishPanels=function(){return socialWarfare.panels={staticHorizontal:null,floatingSide:null,floatingHorizontal:null},socialWarfare.panels.staticHorizontal=e(".swp_social_panel").not(".swp_social_panelSide"),socialWarfare.panels.floatingSide=e(".swp_social_panelSide"),socialWarfare.panels},socialWarfare.activateHoverStates=function(){socialWarfare.trigger("pre_activate_buttons"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer").on("mouseenter",function(){if(!e(this).hasClass("swp_nohover")){socialWarfare.resetStaticPanel();var a=e(this).find(".swp_share").outerWidth(),t=e(this).find("i.sw").outerWidth(),i=e(this).width(),o=1+(a+35)/i;e(this).find(".iconFiller").width(a+t+25+"px"),e(this).css("flex",o+" 1 0%")}}),e(".swp_social_panel:not(.swp_social_panelSide)").on("mouseleave",socialWarfare.resetStaticPanel)},socialWarfare.resetStaticPanel=function(){e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover) .iconFiller").removeAttr("style"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover)").removeAttr("style")},socialWarfare.handleButtonClicks=function(){e(".nc_tweet, a.swp_CTT").off("click"),e(".nc_tweet, a.swp_CTT").on("click",function(t){if(e(this).hasClass("noPop"))return t;if(void 0===e(this).data("link"))return t;t.preventDefault();var i,o,r,n,s,l,c=e(this).data("link").replace("’","'");i=270,o=500,e(this).is(".pinterest, .buffer_link, .flipboard")&&(i=550,o=775),e(this).hasClass("nc_tweet")?l=e(this).parents(".nc_tweetContainer").data("network"):e(this).hasClass("swp_CTT")&&(l="ctt"),r=a.screenY+(a.innerHeight-i)/2,n=a.screenX+(a.innerWidth-o)/2,s="height="+i+",width="+o+",top="+r+",left="+n,a.open(c,l,s),socialWarfare.trackClick(l)})},socialWarfare.createFloatHorizontalPanel=function(){if(socialWarfare.panels.staticHorizontal.length){var a=socialWarfare.panels.staticHorizontal.data("float"),t=socialWarfare.panels.staticHorizontal.data("float-mobile"),i=socialWarfare.panels.staticHorizontal.data("float-color"),o=e('<div class="nc_wrapper swp_floating_horizontal_wrapper" style="background-color:'+i+'"></div>'),r="";e(".nc_wrapper").length&&e(".nc_wrapper").remove(),e(".swp_floating_horizontal_wrapper").length&&e(".swp_floating_horizontal_wrapper").remove(),"top"!=a&&"bottom"!=a&&"top"!=t&&"bottom"!=t||(r=socialWarfare.isMobile()?t:a,o.addClass(r).hide().appendTo("body"),socialWarfare.panels.floatingHorizontal=socialWarfare.panels.staticHorizontal.first().clone(),socialWarfare.panels.floatingHorizontal.addClass("nc_floater").appendTo(o),socialWarfare.updateFloatingHorizontalDimensions(),e(".swp_social_panel .swp_count").css({transition:"padding .1s linear"}))}},socialWarfare.updateFloatingHorizontalDimensions=function(){if(socialWarfare.panels.staticHorizontal.length&&socialWarfare.panels.floatingHorizontal){var a="100%",e=0,t=socialWarfare.panels.staticHorizontal,i=t.parent();i.hasClass("swp-hidden-panel-wrap")&&(i=i.parent()),void 0!==t.offset().left&&(e=t.offset().left),void 0!==t.width()&&(a=t.width()),0==e&&(e=i.offset().left),100!=a&&0!=a||(a=i.width()),socialWarfare.panels.floatingHorizontal.css({width:a,left:e})}},socialWarfare.staticPanelIsVisible=function(){var t=!1,i=e(a).scrollTop();return e(".swp_social_panel").not(".swp_social_panelSide, .nc_floater").each(function(o){var r=e(this).offset();if(void 0!==socialWarfare.floatBeforeContent&&"1"!=socialWarfare.floatBeforeContent){var n=e(".swp-content-locator").parent();0===o&&n.length&&n.offset().top>i+e(a).height()&&(t=!0)}e(this).is(":visible")&&r.top+e(this).height()>i&&r.top<i+e(a).height()&&(t=!0)}),t},socialWarfare.updateFloatingButtons=function(){if(socialWarfare.panels.staticHorizontal.length)var a=socialWarfare.panels.staticHorizontal;else{if(!socialWarfare.panels.floatingSide.length)return;var a=socialWarfare.panels.floatingSide}var t=a.data("float");if(1==socialWarfare.isMobile())var t=a.data("float-mobile");return"none"==t?e(".nc_wrapper, .swp_floating_horizontal_wrapper, .swp_social_panelSide").hide():socialWarfare.isMobile()?(socialWarfare.toggleMobileButtons(),void socialWarfare.toggleFloatingHorizontalPanel()):("right"!=t&&"left"!=t||socialWarfare.toggleFloatingVerticalPanel(),void("bottom"!=t&&"top"!=t||socialWarfare.toggleFloatingHorizontalPanel()))},socialWarfare.toggleMobileButtons=function(){socialWarfare.panels.floatingSide.hide();var a=socialWarfare.staticPanelIsVisible()?"collapse":"visible";e(".nc_wrapper, .swp_floating_horizontal_wrapper").css("visibility",a)},socialWarfare.toggleFloatingVerticalPanel=function(){var a="",e=socialWarfare.panels.floatingSide.data("float"),t=socialWarfare.staticPanelIsVisible(),i="";if(socialWarfare.isMobile())return socialWarfare.panels.floatingSide.hide();socialWarfare.panels.floatingSide&&socialWarfare.panels.floatingSide.length||(t=!0),"slide"==socialWarfare.panels.floatingSide.data("transition")?(a=e,i=t?"-150px":"5px",socialWarfare.panels.floatingSide.css(a,i).show()):t?socialWarfare.panels.floatingSide.css("opacity",1).fadeOut(300).css("opacity",0):socialWarfare.panels.floatingSide.css("opacity",0).fadeIn(300).css("display","flex").css("opacity",1)},socialWarfare.hasReferencePanel=function(){return void 0!==socialWarfare.panels.staticHorizontal&&socialWarfare.panels.staticHorizontal.length>0},socialWarfare.toggleFloatingHorizontalPanel=function(){if(socialWarfare.hasReferencePanel()&&socialWarfare.panels.floatingHorizontal){var a=socialWarfare.panels.floatingHorizontal.first(),t=socialWarfare.isMobile()?e(a).data("float-mobile"):e(a).data("float"),i="bottom"==t?socialWarfare.paddingBottom:socialWarfare.paddingTop,o="padding-"+t;"off"!=t&&(socialWarfare.staticPanelIsVisible()?(e(".nc_wrapper, .swp_floating_horizontal_wrapper").hide(),socialWarfare.isMobile()&&e("#wpadminbar").length&&e("#wpadminbar").css("top",0)):(i+=50,e(".nc_wrapper, .swp_floating_horizontal_wrapper").show(),socialWarfare.isMobile()&&"top"==t&&e("#wpadminbar").length&&e("#wpadminbar").css("top",a.parent().height())),e("body").css(o,i))}},socialWarfare.positionFloatSidePanel=function(){var e,t,i,o=socialWarfare.panels.floatingSide;if(o&&o.length&&!o.hasClass("swp_side_top")&&!o.hasClass("swp_side_bottom")){if(e=o.outerHeight(),t=a.innerHeight,e>t)return o.css("top",0);i=(t-e)/2,o.css("top",i)}},socialWarfare.createHoverSaveButton=function(){if(e(".tve_editor_page").length)return e(".sw-pinit-button").remove(),void e(".sw-pinit").each(function(){var a=e(".sw-pinit").contents();e(this).replaceWith(a)});var a=e(document.createElement("a"));return a.css("display: none"),a.addClass("swp-hover-pin-button"),a.text("Save"),socialWarfare.hoverSaveButton=e(a),a},socialWarfare.triggerImageListeners=function(){e(".swp-content-locator").parent().find("img").off("mouseenter",socialWarfare.renderPinterestSaveButton),e(".swp-content-locator").parent().find("img").on("mouseenter",socialWarfare.renderPinterestSaveButton),setTimeout(socialWarfare.triggerImageListeners,2e3)},socialWarfare.getPinMedia=function(a){if(t(swpPinIt.image_source))return swpPinIt.image_source;if(t(a.attr("src")))return a.attr("src");var i=["src","lazy-src","media"],o="";if(i.some(function(e){if(t(a.data(e)))return o=a.data(e),!0}),""!=o){var r=e("<img>");return r.attr("src",o),r.prop("src")}},socialWarfare.getPinDescription=function(a){return t(a.data("pin-description"))?a.data("pin-description"):t(swpPinIt.image_description)?swpPinIt.image_description:t(a.attr("title"))?a.attr("title"):t(a.attr("alt"))?a.attr("alt"):t(swpPinIt.post_title)?swpPinIt.post_title:void 0},socialWarfare.enablePinterestSaveButtons=function(){jQuery("img").on("mouseenter",function(){var a=socialWarfare.findPinterestBrowserSaveButtons();void 0!==a&&a&&socialWarfare.removePinterestBrowserSaveButtons(a)})},socialWarfare.toggleHoverSaveDisplay=function(a){var t=a.offset().top,i=a.offset().left;switch(swpPinIt.vLocation){case"top":t+=15;break;case"middle":var o=a.height()/2-7.5-12;t+=o;break;case"bottom":t+=a.height()-15-24}switch(swpPinIt.hLocation){case"left":i+=15;break;case"center":var o=a.width()/2-7.5-60;i+=o;break;case"right":i+=a.width()-15-120}socialWarfare.hoverSaveButton.css("top",t),socialWarfare.hoverSaveButton.css("left",i),a.on("mouseleave",function(a){"swp-hover-pin-button"!=a.relatedTarget.className&&e(".swp-hover-pin-button").remove()}),e(document.body).append(socialWarfare.hoverSaveButton)},socialWarfare.renderPinterestSaveButton=function(t){function i(t){var i=e(a).width()-1264,o=e(a).height()-506,r=",top="+o+",left="+i;a.open(s,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"+r),socialWarfare.trackClick("pin_image"),e(".swp-hover-pin-button").remove()}if(!(t.relatedTarget&&"swp-hover-pin-button"==t.relatedTarget.className||e(".swp-hover-pin-button").length>0)){var o=e(t.target);if(!(void 0!=typeof swpPinIt.disableOnAnchors&&swpPinIt.disableOnAnchors&&o.parents().filter("a").length||o.outerHeight()<swpPinIt.minHeight||o.outerWidth()<swpPinIt.minWidth||o.hasClass("no_pin")||o.hasClass("no-pin"))){socialWarfare.toggleHoverSaveDisplay(o);var r=socialWarfare.getPinDescription(o),n=socialWarfare.getPinMedia(o),s="http://pinterest.com/pin/create/bookmarklet/?media="+encodeURI(n)+"&url="+encodeURI(document.URL)+"&is_video=false&description="+encodeURIComponent(r);e(".swp-hover-pin-button").on("click",i)}}},socialWarfare.findPinterestBrowserSaveButtons=function(){var e,t,i,o,r,n;return e="rgb(189, 8, 28)",t="rgb(230, 0, 35)",i="8675309",o="14px 14px",r=null,document.querySelectorAll("span").forEach(function(s,l){n=a.getComputedStyle(s),n.backgroundColor!=e&&n.backgroundColor!=t||n.backgroundSize==o&&n.zIndex==i&&(r=s)}),r},socialWarfare.removePinterestBrowserSaveButtons=function(e){var t,i,o;t=e.nextSibling,void 0!==t&&"SPAN"==t.nodeName&&(i=a.getComputedStyle(t),o="24px",0===i.width.indexOf(o)&&0===i.height.indexOf(o)&&t.remove()),e.remove()},socialWarfare.trigger=function(t){e(a).trigger(e.Event(t))},socialWarfare.trackClick=function(a){!0===swpClickTracking&&("function"==typeof ga&&ga("send","event","social_media","swp_"+a+"_share"),"object"==typeof dataLayer&&dataLayer.push({event:"swp_"+a+"_share"}))},socialWarfare.checkListeners=function(a,t){if(!(a>t)){var i=e(".swp_social_panel");if(i.length>0&&i.find(".swp_pinterest"))return void socialWarfare.handleButtonClicks();setTimeout(function(){socialWarfare.checkListeners(++a,t)},2e3)}},socialWarfare.establishBreakpoint=function(){var a=e(".swp_social_panel");socialWarfare.breakpoint=1100,(a.length&&a.data("min-width")||0==a.data("min-width"))&&(socialWarfare.breakpoint=parseInt(a.data("min-width")))},socialWarfare.isMobile=function(){return e(a).width()<socialWarfare.breakpoint},e(document).ready(function(){socialWarfare.initPlugin(),socialWarfare.panels.floatingSide.hide(),e(a).resize(socialWarfare.onWindowResize),"undefined"!=typeof swpPinIt&&swpPinIt.enabled&&socialWarfare.enablePinterestSaveButtons()}),e(a).on("load",function(){"undefined"!=typeof swpPinIt&&swpPinIt.enabled&&socialWarfare.enablePinterestSaveButtons(),a.clearCheckID=0})}(this,jQuery);
assets/js/sw-shortcode-generator.js CHANGED
File without changes
assets/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
lib/Social_Warfare.php CHANGED
@@ -400,11 +400,12 @@ class Social_Warfare {
400
  * provides for maximum extensibility to allow addons even easier access
401
  * than ever before to create and add more social networks to the plugin.
402
  *
 
 
403
  */
404
  $social_networks = array(
405
  'Social_Networks_Loader',
406
  'Social_Network',
407
- 'Google_Plus',
408
  'Facebook',
409
  'Twitter',
410
  'Linkedin',
400
  * provides for maximum extensibility to allow addons even easier access
401
  * than ever before to create and add more social networks to the plugin.
402
  *
403
+ * @since 3.6.1 | 31 MAY 2019 | Removed Google Plus
404
+ *
405
  */
406
  $social_networks = array(
407
  'Social_Networks_Loader',
408
  'Social_Network',
 
409
  'Facebook',
410
  'Twitter',
411
  'Linkedin',
lib/Social_Warfare_Addon.php CHANGED
File without changes
lib/admin/SWP_Click_To_Tweet.php CHANGED
File without changes
lib/admin/SWP_Column.php CHANGED
File without changes
lib/admin/SWP_Settings_Link.php CHANGED
File without changes
lib/admin/SWP_Shortcode_Generator.php CHANGED
File without changes
lib/admin/SWP_Sidebar_Loader.php CHANGED
File without changes
lib/admin/SWP_User_Profile.php CHANGED
File without changes
lib/admin/assets/css/admin.css CHANGED
File without changes
lib/admin/assets/css/style1.css CHANGED
File without changes
lib/admin/assets/css/style2.css CHANGED
File without changes
lib/admin/assets/css/style3.css CHANGED
File without changes
lib/admin/assets/css/style4.css CHANGED
File without changes
lib/admin/assets/css/styles.css CHANGED
File without changes
lib/admin/assets/img/twitter-little-bird-button.png CHANGED
File without changes
lib/admin/assets/img/twitter-little-bird-white.png CHANGED
File without changes
lib/admin/assets/img/twitter-little-bird.png CHANGED
File without changes
lib/admin/assets/js/clickToTweet.js CHANGED
File without changes
lib/admin/assets/js/clickToTweet.min.js CHANGED
File without changes
lib/admin/assets/js/tmclicktotweet_plugin.js CHANGED
File without changes
lib/admin/swp_system_checker.php CHANGED
File without changes
lib/buttons-panel/SWP_Buttons_Panel.php CHANGED
File without changes
lib/buttons-panel/SWP_Buttons_Panel_Loader.php CHANGED
File without changes
lib/buttons-panel/SWP_Buttons_Panel_Shortcode.php CHANGED
File without changes
lib/buttons-panel/SWP_Buttons_Panel_Side.php CHANGED
File without changes
lib/buttons-panel/SWP_Buttons_Panel_Trait.php CHANGED
File without changes
lib/frontend-output/SWP_Header_Output.php CHANGED
File without changes
lib/frontend-output/SWP_Script.php CHANGED
@@ -29,7 +29,8 @@ class SWP_Script {
29
 
30
 
31
  /**
32
- * Add this classes methods to the appropiate hooks.
 
33
  *
34
  * @since 3.1.0 | 18 JUNE 2018 | Created
35
  * @param void
@@ -280,30 +281,60 @@ class SWP_Script {
280
  /**
281
  * Creates the `socialWarfare` object and initializes it with server-side data.
282
  *
 
 
 
283
  * @since 3.4.0 | 20 NOV 2018 | Created
 
 
 
284
  * @return void
285
  *
286
  */
287
  function localize_variables() {
288
  global $post;
289
- $id = isset( $post ) ? $post->ID : 0; // No ID on SW settings page.
290
- $addons = apply_filters( 'swp_registrations', array() );
291
- $addon_vars = apply_filters( 'swp_addon_javascript_variables', array() );
292
 
293
- foreach( $addons as $addon ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  $addons[] = $addon->key;
295
  }
296
 
 
 
 
 
 
 
297
  $data = array(
298
- 'addons' => $addons,
299
- 'post_id' => $id,
300
- 'floatBeforeContent' => SWP_Utility::get_option( 'float_before_content' )
301
  );
302
 
303
- foreach( $addon_vars as $addon_key => $data_array ) {
304
- $data[$addon_key] = $data_array;
305
- }
306
-
307
  wp_localize_script( 'social_warfare_script', 'socialWarfare', $data );
308
  }
309
 
29
 
30
 
31
  /**
32
+ * This method queues up the helper methods of this class to run when
33
+ * WordPress fires off some of their hooks (e.g. wp_footer hook).
34
  *
35
  * @since 3.1.0 | 18 JUNE 2018 | Created
36
  * @param void
281
  /**
282
  * Creates the `socialWarfare` object and initializes it with server-side data.
283
  *
284
+ * We'll use this to also add a little bit of data that the JS file can use
285
+ * to accomplish its functionality like the post ID, for example.
286
+ *
287
  * @since 3.4.0 | 20 NOV 2018 | Created
288
+ * @since 3.6.1 | 17 MAY 2019 | Changed $addons to $installed_addons to avoid
289
+ * using the parent variable within its own loop.
290
+ * @param void
291
  * @return void
292
  *
293
  */
294
  function localize_variables() {
295
  global $post;
 
 
 
296
 
297
+
298
+ /**
299
+ * The post ID will be null/unset if we are on the plugin's admin
300
+ * settings page. As such, we'll just use 0.
301
+ *
302
+ */
303
+ $id = isset( $post ) ? $post->ID : 0;
304
+
305
+
306
+ /**
307
+ * We'll fetch all the registered addons so that we can list the key of
308
+ * each one in the socialWarfare.addons variable.
309
+ *
310
+ */
311
+ $installed_addons = apply_filters( 'swp_registrations', array() );
312
+ $addon_vars = apply_filters( 'swp_addon_javascript_variables', array() );
313
+
314
+
315
+ /**
316
+ * Loop through all of the addons that we found and fetch the key for
317
+ * each one. The key should be the only information we need on the
318
+ * front-end. Example keys: "pro", "affiliatewp", etc.
319
+ *
320
+ */
321
+ $addons = array();
322
+ foreach( $installed_addons as $addon ) {
323
  $addons[] = $addon->key;
324
  }
325
 
326
+
327
+ /**
328
+ * Once all the data has been collected, we'll organize it into a single
329
+ * variable for output.
330
+ *
331
+ */
332
  $data = array(
333
+ 'addons' => $addons,
334
+ 'post_id' => $id,
335
+ 'floatBeforeContent' => SWP_Utility::get_option( 'float_before_content' )
336
  );
337
 
 
 
 
 
338
  wp_localize_script( 'social_warfare_script', 'socialWarfare', $data );
339
  }
340
 
lib/frontend-output/SWP_Shortcode.php CHANGED
File without changes
lib/options/SWP_Option.php CHANGED
File without changes
lib/options/SWP_Option_Abstract.php CHANGED
File without changes
lib/options/SWP_Option_Button.php CHANGED
File without changes
lib/options/SWP_Option_Icons.php CHANGED
File without changes
lib/options/SWP_Option_Select.php CHANGED
File without changes
lib/options/SWP_Option_Text.php CHANGED
File without changes
lib/options/SWP_Option_Textarea.php CHANGED
File without changes
lib/options/SWP_Option_Toggle.php CHANGED
File without changes
lib/options/SWP_Options_Page.php CHANGED
File without changes
lib/options/SWP_Options_Page_Section.php CHANGED
File without changes
lib/options/SWP_Options_Page_Tab.php CHANGED
File without changes
lib/options/SWP_Registration_Tab_Template.php CHANGED
File without changes
lib/options/SWP_Section_HTML.php CHANGED
File without changes
lib/options/SWP_User_Options.php CHANGED
File without changes
lib/social-networks/SWP_Facebook.php CHANGED
File without changes
lib/social-networks/SWP_Google_Plus.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Google Plus
5
- *
6
- * Class to add a Google Plus share button to the available buttons
7
- *
8
- * @package SocialWarfare\Functions\Social-Networks
9
- * @copyright Copyright (c) 2018, Warfare Plugins, LLC
10
- * @license GPL-3.0+
11
- * @since 1.0.0 | Unknown | Created
12
- * @since 2.2.4 | 02 MAY 2017 | Refactored functions & updated docblocking
13
- * @since 3.0.0 | 05 APR 2018 | Rebuilt into a class-based system.
14
- * @since 3.0.9 | 04 JUN 2018 | Removed deprecated API request (share counts)
15
- *
16
- */
17
- class SWP_Google_Plus extends SWP_Social_Network {
18
-
19
-
20
- /**
21
- * The Magic __construct Method
22
- *
23
- * This method is used to instantiate the social network object. It does three things.
24
- * First it sets the object properties for each network. Then it adds this object to
25
- * the globally accessible swp_social_networks array. Finally, it fetches the active
26
- * state (does the user have this button turned on?) so that it can be accessed directly
27
- * within the object.
28
- *
29
- * @since 3.0.0 | 06 APR 2018 | Created
30
- * @param none
31
- * @return none
32
- * @access public
33
- *
34
- */
35
- public function __construct() {
36
-
37
- // Update the class properties for this network
38
- $this->name = __( 'Google Plus','social-warfare' );
39
- $this->cta = __( '+1','social-warfare' );
40
- $this->key = 'google_plus';
41
- $this->default = 'true';
42
- $this->base_share_url = 'https://plus.google.com/share?url=';
43
-
44
- $this->init_social_network();
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/social-networks/SWP_Linkedin.php CHANGED
File without changes
lib/social-networks/SWP_Mix.php CHANGED
File without changes
lib/social-networks/SWP_Pinterest.php CHANGED
File without changes
lib/social-networks/SWP_Social_Network.php CHANGED
File without changes
lib/social-networks/SWP_Social_Networks_Loader.php CHANGED
File without changes
lib/social-networks/SWP_Stumble_Upon.php CHANGED
File without changes
lib/social-networks/SWP_Twitter.php CHANGED
@@ -154,13 +154,14 @@ class SWP_Twitter extends SWP_Social_Network {
154
  /**
155
  * This is the method that generates the via=username section of the share link.
156
  *
 
157
  * @since 3.4.0 | 19 NOV 2018 | Created
158
  * @since 3.5.2 | 21 MAR 2018 | Changed access from protected to public.
159
  * @param array $post_data The array of information passed in from the buttons panel.
160
  * @return sting The via=username section of the share link.
161
  *
162
  */
163
- public function get_via_parameter( $post_data ) {
164
  if ( is_object( $post_data ) ) {
165
  // A global $post, for example
166
  $post_data = (array) $post_data;
154
  /**
155
  * This is the method that generates the via=username section of the share link.
156
  *
157
+ *
158
  * @since 3.4.0 | 19 NOV 2018 | Created
159
  * @since 3.5.2 | 21 MAR 2018 | Changed access from protected to public.
160
  * @param array $post_data The array of information passed in from the buttons panel.
161
  * @return sting The via=username section of the share link.
162
  *
163
  */
164
+ public static function get_via_parameter( $post_data ) {
165
  if ( is_object( $post_data ) ) {
166
  // A global $post, for example
167
  $post_data = (array) $post_data;
lib/update-checker/.editorconfig CHANGED
File without changes
lib/update-checker/Puc/v4/Factory.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Autoloader.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/DebugBar/Extension.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/DebugBar/Panel.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/DebugBar/PluginExtension.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/DebugBar/PluginPanel.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/DebugBar/ThemePanel.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Factory.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/InstalledPackage.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Metadata.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/OAuthSignature.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Plugin/Info.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Plugin/Package.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Plugin/Ui.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Plugin/Update.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Plugin/UpdateChecker.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Scheduler.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/StateStore.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Theme/Package.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Theme/Update.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Theme/UpdateChecker.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Update.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/UpdateChecker.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/UpgraderStatus.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Utils.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/Api.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/BaseChecker.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/BitBucketApi.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/GitHubApi.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/GitLabApi.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/Reference.php CHANGED
File without changes
lib/update-checker/Puc/v4p4/Vcs/ThemeUpdateChecker.php CHANGED
File without changes
lib/update-checker/README.md CHANGED
File without changes
lib/update-checker/composer.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "yahnis-elsts/plugin-update-checker",
3
- "type": "library",
4
- "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
5
- "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"],
6
- "homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Yahnis Elsts",
11
- "email": "whiteshadow@w-shadow.com",
12
- "homepage": "http://w-shadow.com/",
13
- "role": "Developer"
14
- }
15
- ],
16
- "require": {
17
- "php": ">=5.2.0"
18
- },
19
- "autoload": {
20
- "files": ["plugin-update-checker.php"]
21
- }
22
  }
1
+ {
2
+ "name": "yahnis-elsts/plugin-update-checker",
3
+ "type": "library",
4
+ "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
5
+ "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"],
6
+ "homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
7
+ "license": "MIT",
8
+ "authors": [
9
+ {
10
+ "name": "Yahnis Elsts",
11
+ "email": "whiteshadow@w-shadow.com",
12
+ "homepage": "http://w-shadow.com/",
13
+ "role": "Developer"
14
+ }
15
+ ],
16
+ "require": {
17
+ "php": ">=5.2.0"
18
+ },
19
+ "autoload": {
20
+ "files": ["plugin-update-checker.php"]
21
+ }
22
  }
lib/update-checker/css/puc-debug-bar.css CHANGED
File without changes
lib/update-checker/examples/plugin.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "My Example Plugin",
3
- "version": "2.0",
4
- "download_url": "http://example.com/updates/example-plugin.zip",
5
-
6
- "homepage": "http://example.com/",
7
- "requires": "4.5",
8
- "tested": "4.8",
9
- "last_updated": "2017-01-01 16:17:00",
10
- "upgrade_notice": "Here's why you should upgrade...",
11
-
12
- "author": "Janis Elsts",
13
- "author_homepage": "http://example.com/",
14
-
15
- "sections": {
16
- "description": "(Required) Plugin description. Basic HTML can be used in all sections.",
17
- "installation": "(Recommended) Installation instructions.",
18
- "changelog": "(Recommended) Changelog. <p>This section will be displayed by default when the user clicks 'View version x.y.z details'.</p>",
19
- "custom_section": "This is a custom section labeled 'Custom Section'."
20
- },
21
-
22
- "icons" : {
23
- "1x" : "http://w-shadow.com/files/external-update-example/assets/icon-128x128.png",
24
- "2x" : "http://w-shadow.com/files/external-update-example/assets/icon-256x256.png"
25
- },
26
-
27
- "banners": {
28
- "low": "http://w-shadow.com/files/external-update-example/assets/banner-772x250.png",
29
- "high": "http://w-shadow.com/files/external-update-example/assets/banner-1544x500.png"
30
- },
31
-
32
- "translations": [
33
- {
34
- "language": "fr_FR",
35
- "version": "4.0",
36
- "updated": "2016-04-22 23:22:42",
37
- "package": "http://example.com/updates/translations/french-language-pack.zip"
38
- },
39
- {
40
- "language": "de_DE",
41
- "version": "5.0",
42
- "updated": "2016-04-22 23:22:42",
43
- "package": "http://example.com/updates/translations/german-language-pack.zip"
44
- }
45
- ],
46
-
47
- "rating": 90,
48
- "num_ratings": 123,
49
-
50
- "downloaded": 1234,
51
- "active_installs": 12345
52
  }
1
+ {
2
+ "name": "My Example Plugin",
3
+ "version": "2.0",
4
+ "download_url": "http://example.com/updates/example-plugin.zip",
5
+
6
+ "homepage": "http://example.com/",
7
+ "requires": "4.5",
8
+ "tested": "4.8",
9
+ "last_updated": "2017-01-01 16:17:00",
10
+ "upgrade_notice": "Here's why you should upgrade...",
11
+
12
+ "author": "Janis Elsts",
13
+ "author_homepage": "http://example.com/",
14
+
15
+ "sections": {
16
+ "description": "(Required) Plugin description. Basic HTML can be used in all sections.",
17
+ "installation": "(Recommended) Installation instructions.",
18
+ "changelog": "(Recommended) Changelog. <p>This section will be displayed by default when the user clicks 'View version x.y.z details'.</p>",
19
+ "custom_section": "This is a custom section labeled 'Custom Section'."
20
+ },
21
+
22
+ "icons" : {
23
+ "1x" : "http://w-shadow.com/files/external-update-example/assets/icon-128x128.png",
24
+ "2x" : "http://w-shadow.com/files/external-update-example/assets/icon-256x256.png"
25
+ },
26
+
27
+ "banners": {
28
+ "low": "http://w-shadow.com/files/external-update-example/assets/banner-772x250.png",
29
+ "high": "http://w-shadow.com/files/external-update-example/assets/banner-1544x500.png"
30
+ },
31
+
32
+ "translations": [
33
+ {
34
+ "language": "fr_FR",
35
+ "version": "4.0",
36
+ "updated": "2016-04-22 23:22:42",
37
+ "package": "http://example.com/updates/translations/french-language-pack.zip"
38
+ },
39
+ {
40
+ "language": "de_DE",
41
+ "version": "5.0",
42
+ "updated": "2016-04-22 23:22:42",
43
+ "package": "http://example.com/updates/translations/german-language-pack.zip"
44
+ }
45
+ ],
46
+
47
+ "rating": 90,
48
+ "num_ratings": 123,
49
+
50
+ "downloaded": 1234,
51
+ "active_installs": 12345
52
  }
lib/update-checker/examples/theme.json CHANGED
@@ -1,5 +1,5 @@
1
- {
2
- "version": "2.0",
3
- "details_url": "http://example.com/version-2.0-details.html",
4
- "download_url": "http://example.com/example-theme-2.0.zip"
5
  }
1
+ {
2
+ "version": "2.0",
3
+ "details_url": "http://example.com/version-2.0-details.html",
4
+ "download_url": "http://example.com/example-theme-2.0.zip"
5
  }
lib/update-checker/js/debug-bar.js CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-cs_CZ.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-cs_CZ.po CHANGED
@@ -1,45 +1,45 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: plugin-update-checker\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2017-05-20 10:53+0300\n"
6
- "PO-Revision-Date: 2017-07-05 15:39+0000\n"
7
- "Last-Translator: Vojtěch Sajdl <vojtech@sajdl.com>\n"
8
- "Language-Team: Czech (Czech Republic)\n"
9
- "Language: cs-CZ\n"
10
- "Plural-Forms: nplurals=2; plural=(n != 1)\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Loco-Source-Locale: cs_CZ\n"
15
- "X-Generator: Loco - https://localise.biz/\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Loco-Parser: loco_parse_po"
21
-
22
- #: Puc/v4p1/Plugin/UpdateChecker.php:358
23
- msgid "Check for updates"
24
- msgstr "Zkontrolovat aktualizace"
25
-
26
- #: Puc/v4p1/Plugin/UpdateChecker.php:405
27
- #, php-format
28
- msgctxt "the plugin title"
29
- msgid "The %s plugin is up to date."
30
- msgstr "Plugin %s je aktuální."
31
-
32
- #: Puc/v4p1/Plugin/UpdateChecker.php:407
33
- #, php-format
34
- msgctxt "the plugin title"
35
- msgid "A new version of the %s plugin is available."
36
- msgstr "Nová verze pluginu %s je dostupná."
37
-
38
- #: Puc/v4p1/Plugin/UpdateChecker.php:409
39
- #, php-format
40
- msgid "Unknown update checker status \"%s\""
41
- msgstr "Neznámý status kontroly aktualizací \"%s\""
42
-
43
- #: Puc/v4p1/Vcs/PluginUpdateChecker.php:83
44
- msgid "There is no changelog available."
45
- msgstr "Changelog není dostupný."
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: plugin-update-checker\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-05-20 10:53+0300\n"
6
+ "PO-Revision-Date: 2017-07-05 15:39+0000\n"
7
+ "Last-Translator: Vojtěch Sajdl <vojtech@sajdl.com>\n"
8
+ "Language-Team: Czech (Czech Republic)\n"
9
+ "Language: cs-CZ\n"
10
+ "Plural-Forms: nplurals=2; plural=(n != 1)\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Loco-Source-Locale: cs_CZ\n"
15
+ "X-Generator: Loco - https://localise.biz/\n"
16
+ "X-Poedit-Basepath: ..\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Loco-Parser: loco_parse_po"
21
+
22
+ #: Puc/v4p1/Plugin/UpdateChecker.php:358
23
+ msgid "Check for updates"
24
+ msgstr "Zkontrolovat aktualizace"
25
+
26
+ #: Puc/v4p1/Plugin/UpdateChecker.php:405
27
+ #, php-format
28
+ msgctxt "the plugin title"
29
+ msgid "The %s plugin is up to date."
30
+ msgstr "Plugin %s je aktuální."
31
+
32
+ #: Puc/v4p1/Plugin/UpdateChecker.php:407
33
+ #, php-format
34
+ msgctxt "the plugin title"
35
+ msgid "A new version of the %s plugin is available."
36
+ msgstr "Nová verze pluginu %s je dostupná."
37
+
38
+ #: Puc/v4p1/Plugin/UpdateChecker.php:409
39
+ #, php-format
40
+ msgid "Unknown update checker status \"%s\""
41
+ msgstr "Neznámý status kontroly aktualizací \"%s\""
42
+
43
+ #: Puc/v4p1/Vcs/PluginUpdateChecker.php:83
44
+ msgid "There is no changelog available."
45
+ msgstr "Changelog není dostupný."
lib/update-checker/languages/plugin-update-checker-da_DK.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-da_DK.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-de_DE.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-de_DE.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fa_IR.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fa_IR.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fr_CA.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fr_CA.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fr_FR.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-fr_FR.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-hu_HU.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-hu_HU.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-it_IT.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-it_IT.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-ja.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-ja.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-nl_BE.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-nl_BE.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-nl_NL.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-nl_NL.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-pt_BR.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-pt_BR.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-sv_SE.mo CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker-sv_SE.po CHANGED
File without changes
lib/update-checker/languages/plugin-update-checker.pot CHANGED
File without changes
lib/update-checker/license.txt CHANGED
File without changes
lib/update-checker/plugin-update-checker.php CHANGED
File without changes
lib/update-checker/vendor/Parsedown.php CHANGED
File without changes
lib/update-checker/vendor/ParsedownLegacy.php CHANGED
File without changes
lib/update-checker/vendor/readme-parser.php CHANGED
File without changes
lib/utilities/SWP_Auth_Helper.php CHANGED
File without changes
lib/utilities/SWP_CURL.php CHANGED
File without changes
lib/utilities/SWP_Compatibility.php CHANGED
@@ -8,6 +8,7 @@
8
  * @license GPL-3.0+
9
  * @since 1.0.0
10
  * @since 3.0.0 | 22 FEB 2018 | Refactored into a class-based system.
 
11
  *
12
  */
13
  class SWP_Compatibility {
@@ -20,50 +21,243 @@ class SWP_Compatibility {
20
  * plugin, and Really Simple SSL.
21
  *
22
  * @since 2.1.4
 
 
23
  * @access public
24
  * @param integer $id The post ID
25
  * @return none
26
  *
27
  */
28
  public function __construct() {
29
- // Disabe Open Graph tags on Simple Podcast Press Pages
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  if ( is_plugin_active( 'simple-podcast-press/simple-podcast-press.php' ) ) {
31
  global $ob_wp_simplepodcastpress;
32
  remove_action( 'wp_head' , array( $ob_wp_simplepodcastpress, 'spp_open_graph' ) , 1 );
33
  }
 
34
 
35
- // Remove our custom fields when a post is duplicated via the Duplicate Post plugin.
36
- add_filter( 'duplicate_post_meta_keys_filter' , array( $this, 'filter_duplicate_meta_keys' ) );
37
 
38
- // Fix the links that are modified by the Really Simple SSL plugin.
39
- add_filter("rsssl_fixer_output", [$this, 'rsssl_fix_compatibility'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
 
43
 
44
  /**
45
- * A function to fix the share recovery conflict with Really Simple SSL plugin
 
 
 
 
 
 
 
46
  * @param string $html A string of html to be filtered
47
  * @return string $html The filtered string of html
48
  * @access public
49
- * @since 2.2.2
50
  *
51
  */
52
- function rsssl_fix_compatibility($html) {
53
  //replace the https back to http
54
  $html = str_replace( "swp_post_recovery_url = 'https://" , "swp_post_recovery_url = 'http://" , $html);
55
  return $html;
56
  }
57
 
 
58
  /**
59
  * Removes Social Warfare keys from the meta before post is duplicated.
60
  *
 
 
 
 
 
 
 
61
  * @param array $meta_keys All meta keys prepared for duplication.
62
  * @return array $meta_keys $meta_keys with no Social Warfare keys.
63
- * @since 3.4.2 | 10 DEC 2018 | Created
64
  *
65
  */
66
- function filter_duplicate_meta_keys( $meta_keys = array() ) {
67
  $blacklist = array( 'swp_', '_shares', 'bitly_link' );
68
 
69
  foreach( $meta_keys as $key ) {
8
  * @license GPL-3.0+
9
  * @since 1.0.0
10
  * @since 3.0.0 | 22 FEB 2018 | Refactored into a class-based system.
11
+ * @since 3.6.1 | 22 MAY 2019 | Added the Pin Button Cleaner. Updated docblocks.
12
  *
13
  */
14
  class SWP_Compatibility {
21
  * plugin, and Really Simple SSL.
22
  *
23
  * @since 2.1.4
24
+ * @since 3.6.1 | 22 MAY 2019 | Added the Pin Button Cleaner
25
+ * @since 3.6.1 | 22 MAY 2019 | Moved core functionality into separate methods.
26
  * @access public
27
  * @param integer $id The post ID
28
  * @return none
29
  *
30
  */
31
  public function __construct() {
32
+ $this->queue_compatibility_filter_hooks();
33
+ $this->make_simple_podcast_press_compatible();
34
+ }
35
+
36
+
37
+ /**
38
+ * A method to hook into custom hooks provided by other plugins. These allow
39
+ * us access to their functionality to allow for easy compatibility patches.
40
+ *
41
+ * @since 3.6.1 | 22 MAY 2019 | Created
42
+ * @param void
43
+ * @return void
44
+ *
45
+ */
46
+ public function queue_compatibility_filter_hooks() {
47
+
48
+
49
+ /**
50
+ * This will remove our custom meta fields from a newly duplicated post
51
+ * so that when Duplicate Post plugin does it's thing, the share counts
52
+ * and other data won't be duplicated with the post.
53
+ *
54
+ */
55
+ add_filter( 'duplicate_post_meta_keys_filter' , array( $this, 'filter_duplicate_meta_keys' ) );
56
+
57
+
58
+ /**
59
+ * This will make it so that the Really Simple SSL plugin won't be able
60
+ * to hijack and manipulate the URL's that we are attempting to use for
61
+ * the share recovery features.
62
+ *
63
+ */
64
+ add_filter("rsssl_fixer_output", array( $this, 'rsssl_fix_compatibility') );
65
+
66
+
67
+ /**
68
+ * A method used to clean out pin buttons that were generated by the JS
69
+ * inside of a page builder html and then subsequently saved into the content.
70
+ *
71
+ */
72
+ add_filter( 'the_content', array( $this, 'clean_out_pin_buttons' ) );
73
+ }
74
+
75
+
76
+ /**
77
+ * A method used to disable the open graph tags from the Podcast Press
78
+ * plugin to allow ours to be the only ones in the markup.
79
+ *
80
+ * @since 3.6.1 | 22 MAY 2019 | Created
81
+ * @param void
82
+ * @return void
83
+ *
84
+ */
85
+ public function make_simple_podcast_press_compatible() {
86
  if ( is_plugin_active( 'simple-podcast-press/simple-podcast-press.php' ) ) {
87
  global $ob_wp_simplepodcastpress;
88
  remove_action( 'wp_head' , array( $ob_wp_simplepodcastpress, 'spp_open_graph' ) , 1 );
89
  }
90
+ }
91
 
 
 
92
 
93
+ /**
94
+ * A method to clean out Pinterest save buttons that have been erroneously
95
+ * saved to the database.
96
+ *
97
+ * Some theme/page builders have taken the HTML generated by the javascript
98
+ * and saved that HTML directly into the database. Since the JS creates the
99
+ * pinterest save button on each page load, this has resulted in multiple
100
+ * instances of the save button being generated, saved, generated, saved, etc.
101
+ *
102
+ * This function will search the_content via the WordPress hook of the same
103
+ * name and remove them.
104
+ *
105
+ * @since 3.6.1 | 21 MAY 2019 | Created
106
+ * @param string $content The string of content passed in by WordPress core.
107
+ * @return string $content The modified content.
108
+ *
109
+ */
110
+ public function clean_out_pin_buttons( $content ) {
111
+
112
 
113
+ /**
114
+ * If the content that is passed in is empty, then just bail out as we
115
+ * don't have anything that will need processing/filtering.
116
+ *
117
+ */
118
+ if( empty( $content ) ) {
119
+ return $content;
120
+ }
121
+
122
+
123
+ /**
124
+ * If the content doesn't contain any pinit buttons, just bail out and
125
+ * return the content. We don't have anything to process here.
126
+ *
127
+ */
128
+ if (strpos($content, 'sw-pinit-button') === false) {
129
+ return $content;
130
+ }
131
+
132
+
133
+ /**
134
+ * We'll be using PHP's DOMDocument to make our alterations to the
135
+ * content, so if it doesn't exist, we'll need to bail out. This has
136
+ * been available since PHP 5, but some server's may have it manually
137
+ * turned off in their configuration settings. Better safe than sorry.
138
+ *
139
+ */
140
+ if( !class_exists( 'DOMDocument' ) ) {
141
+ return $content;
142
+ }
143
+
144
+
145
+ // DOMDocument works better with an XML delcaration.
146
+ if ( false === strpos( $content, '?xml version' ) ) {
147
+ $xml_statement = '<?xml version="1.0" encoding="UTF-8"?>';
148
+ $content = $xml_statement . $content;
149
+ $added_xml_statement = true;
150
+ }
151
+
152
+
153
+ /**
154
+ * The content is most likely not going to be a properly formatted
155
+ * HTML document. As such, it's going to throw some annoying PHP errors
156
+ * whilst still getting and parsing the information that we need. As
157
+ * such, we'll just turn off error reporting and then turn it back on
158
+ * after we're done here.
159
+ *
160
+ * This function returns the previous error reporting status. We can use
161
+ * this to revert the setting back to the user's default when we are done.
162
+ *
163
+ */
164
+ $libxml_error_status = libxml_use_internal_errors(true);
165
+
166
+
167
+ /**
168
+ * Load the content text into a DOMDocument object, and then we'll use
169
+ * that object to create a DOMXPath object which will allow us jQuery-like
170
+ * traversal of the DOM to make our adjustments.
171
+ *
172
+ */
173
+ $dom = new DOMDocument();
174
+ $dom->loadHTML( $content );
175
+ $xpath = new DOMXPath( $dom );
176
+
177
+
178
+ /**
179
+ * This will locate and remove all of the .sw-pinit-button anchor tags
180
+ * that have been placed throughout the content.
181
+ *
182
+ */
183
+ $nodes = $xpath->query("//*[contains(@class, 'sw-pinit-button')]");
184
+ foreach( $nodes as $node ) {
185
+ $parent = $node->parentNode;
186
+ $parent->removeChild($node);
187
+ }
188
+
189
+
190
+ /**
191
+ * The anchor tags, along with the images in the content, were wrapped
192
+ * in a div wrapper. This loop will locate those wrappers and remove
193
+ * them without removing their content (i.e. the user's images).
194
+ *
195
+ */
196
+ $nodes = $xpath->query("//*[contains(@class, 'sw-pinit')]");
197
+ foreach( $nodes as $node ) {
198
+ $parent = $node->parentNode;
199
+ while ($node->hasChildNodes()) {
200
+ $parent->insertBefore($node->lastChild, $node->nextSibling);
201
+ }
202
+ $parent->removeChild($node);
203
+ }
204
+
205
+
206
+ /**
207
+ * When everything is done, we'll save the HTML, turn error reporting
208
+ * back to their default settings, clear the errors, and remove the XML
209
+ * information that we added above. Then, of course, we'll return the
210
+ * modified content.
211
+ *
212
+ */
213
+ $content = $dom->saveHTML();
214
+ libxml_use_internal_errors( $libxml_error_status );
215
+ libxml_clear_errors();
216
+
217
+ if ( $added_xml_statement ) {
218
+ $content = str_replace( $xml_statement, '', $content );
219
+ }
220
+
221
+ return $content;
222
  }
223
 
224
 
225
  /**
226
+ * A function to fix the share recovery conflict with Really Simple SSL
227
+ * plugin. Their plugin was using some sort of find/replace to ensure that
228
+ * all links on the site use the HTTPS protocol. However, share recovery is
229
+ * specifically attempting to fetch share counts for the old non-ssl
230
+ * protocol, so we need to make sure that we undo this replacement before
231
+ * fetching share counts.
232
+ *
233
+ * @since 2.2.2 | 01 JAN 2018 | Created
234
  * @param string $html A string of html to be filtered
235
  * @return string $html The filtered string of html
236
  * @access public
 
237
  *
238
  */
239
+ public function rsssl_fix_compatibility($html) {
240
  //replace the https back to http
241
  $html = str_replace( "swp_post_recovery_url = 'https://" , "swp_post_recovery_url = 'http://" , $html);
242
  return $html;
243
  }
244
 
245
+
246
  /**
247
  * Removes Social Warfare keys from the meta before post is duplicated.
248
  *
249
+ * This method is a specific compatibility patch for the plugin Duplicate
250
+ * Posts. Since our share counts, social media images, descriptions, etc.,
251
+ * are all stored in post meta fields, they get duplicated when a post is
252
+ * duplicated. This results in wrong or unuseful data on the new post. This
253
+ * method stops that from happening.
254
+ *
255
+ * @since 3.4.2 | 10 DEC 2018 | Created
256
  * @param array $meta_keys All meta keys prepared for duplication.
257
  * @return array $meta_keys $meta_keys with no Social Warfare keys.
 
258
  *
259
  */
260
+ public function filter_duplicate_meta_keys( $meta_keys = array() ) {
261
  $blacklist = array( 'swp_', '_shares', 'bitly_link' );
262
 
263
  foreach( $meta_keys as $key ) {
lib/utilities/SWP_Credential_Helper.php CHANGED
File without changes
lib/utilities/SWP_Database_Migration.php CHANGED
File without changes
lib/utilities/SWP_Debug_Trait.php CHANGED
File without changes
lib/utilities/SWP_JSON_Cache_Handler.php CHANGED
File without changes
lib/utilities/SWP_Localization.php CHANGED
File without changes
lib/utilities/SWP_Notice.php CHANGED
File without changes
lib/utilities/SWP_Notice_Loader.php CHANGED
File without changes
lib/utilities/SWP_Permalink.php CHANGED
@@ -173,10 +173,22 @@ class SWP_Permalink {
173
  $url = apply_filters( 'post_link', $permalink, $post, $leavename );
174
 
175
  // Ignore all filters and just start with the site url on the home page
176
- if( is_front_page() ):
177
  $url = get_site_url();
178
  endif;
179
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  // Check if they're using cross domain recovery
181
  $current_domain = SWP_Utility::get_option( 'current_domain' );
182
  $former_domain = SWP_Utility::get_option( 'former_domain' );
@@ -186,6 +198,7 @@ class SWP_Permalink {
186
 
187
  // Filter the Protocol
188
  $protocol = SWP_Utility::get_option( 'recovery_protocol' );
 
189
  if ( $protocol == 'https' && strpos( $url,'https' ) === false ) :
190
  $url = str_replace( 'http','https',$url );
191
  elseif ( $protocol == 'http' && strpos( $url,'https' ) !== false ) :
173
  $url = apply_filters( 'post_link', $permalink, $post, $leavename );
174
 
175
  // Ignore all filters and just start with the site url on the home page
176
+ if( is_front_page() ) :
177
  $url = get_site_url();
178
  endif;
179
 
180
+ // The URL is missing any kind of protocol.
181
+ if ( false === strpos( $url, '//' ) || 0 == strpos( $url, '//') ) {
182
+ $protocol = is_ssl() ? 'https' : 'http';
183
+
184
+ // For shared load servers. See https://codex.wordpress.org/Function_Reference/is_ssl
185
+ if ('http' == $protocol && isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
186
+ $protocol = 'https';
187
+ }
188
+
189
+ $url = $protocol . $url;
190
+ }
191
+
192
  // Check if they're using cross domain recovery
193
  $current_domain = SWP_Utility::get_option( 'current_domain' );
194
  $former_domain = SWP_Utility::get_option( 'former_domain' );
198
 
199
  // Filter the Protocol
200
  $protocol = SWP_Utility::get_option( 'recovery_protocol' );
201
+
202
  if ( $protocol == 'https' && strpos( $url,'https' ) === false ) :
203
  $url = str_replace( 'http','https',$url );
204
  elseif ( $protocol == 'http' && strpos( $url,'https' ) !== false ) :
lib/utilities/SWP_Plugin_Updater.php CHANGED
File without changes
lib/utilities/SWP_Post_Cache.php CHANGED
@@ -223,24 +223,24 @@ class SWP_Post_Cache {
223
  return 24;
224
  }
225
 
226
- // Integer in hours of the current age of the post.
227
- $current_time = floor( date( 'U' ) );
228
  $publication_time = get_post_time( 'U' , false , $this->post_id );
229
- $post_age = $current_time - $publication_time;
230
 
231
- // If it's less than 21 days old.
232
- if ( $post_age < ( 21 * 86400 ) ) {
233
- return 1;
234
  }
235
 
236
  // If it's less than 60 days old.
237
- if ( $post_age < ( 60 * 86400 ) ) {
238
- return 4;
239
- }
240
 
241
- // If it's really old.
242
- return 12;
243
- }
244
 
245
 
246
  /**
223
  return 24;
224
  }
225
 
226
+ // Integer in hours of the current age of the post.
227
+ $current_time = floor( date( 'U' ) );
228
  $publication_time = get_post_time( 'U' , false , $this->post_id );
229
+ $post_age = $current_time - $publication_time;
230
 
231
+ // If it's less than 21 days old.
232
+ if ( $post_age < ( 21 * 86400 ) ) {
233
+ return 1;
234
  }
235
 
236
  // If it's less than 60 days old.
237
+ if ( $post_age < ( 60 * 86400 ) ) {
238
+ return 4;
239
+ }
240
 
241
+ // If it's really old.
242
+ return 12;
243
+ }
244
 
245
 
246
  /**
lib/utilities/SWP_Post_Cache_Loader.php CHANGED
File without changes
lib/utilities/SWP_URL_Management.php CHANGED
@@ -85,12 +85,9 @@ class SWP_URL_Management {
85
  * it to the end of the URL, and return the modified array.
86
  *
87
  */
88
- $separator = ( true == strpos( $array['url'], '?' ) ? '&' : '?' );
89
- $utm_source = 'utm_source=' . $array['network'];
90
- $utm_medium = '&utm_medium=' . SWP_Utility::get_option( 'analytics_medium' );
91
- $utm_campaign = '&utm_campaign=' . SWP_Utility::get_option( 'analytics_campaign' );
92
- $url_string = $separator . $utm_source . $utm_medium . $utm_campaign;
93
- $array['url'] .= $url_string;
94
 
95
  return $array;
96
  }
85
  * it to the end of the URL, and return the modified array.
86
  *
87
  */
88
+ $array['url'] = add_query_arg( 'utm_source', $array['network'], $array['url'] );
89
+ $array['url'] = add_query_arg( 'utm_medium', SWP_Utility::get_option( 'analytics_medium' ), $array['url'] );
90
+ $array['url'] = add_query_arg( 'utm_campaign', SWP_Utility::get_option( 'analytics_campaign' ), $array['url'] );
 
 
 
91
 
92
  return $array;
93
  }
lib/utilities/SWP_Utility.php CHANGED
@@ -502,12 +502,18 @@ class SWP_Utility {
502
  */
503
  static function get_image_id_by_url( $image_url ) {
504
  global $wpdb;
505
- $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
506
 
507
- if ( !is_array( $attachment ) || !is_numeric( $attachment[0] ) ) {
508
- return false;
 
 
 
509
  }
510
 
511
- return $attachment[0];
 
 
 
 
512
  }
513
  }
502
  */
503
  static function get_image_id_by_url( $image_url ) {
504
  global $wpdb;
 
505
 
506
+ $prepared_statement = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url );
507
+ $attachment = $wpdb->get_col( $prepared_statement );
508
+
509
+ if ( is_object( $attachment ) && is_numeric( $attachment->ID ) ) {
510
+ return $attachment->ID;
511
  }
512
 
513
+ if ( is_array( $attachment ) && isset( $attachment['ID'] ) ) {
514
+ return $attachment['ID'];
515
+ }
516
+
517
+ return false;
518
  }
519
  }
lib/utilities/functions.php CHANGED
File without changes
lib/widgets/SWP_Popular_Posts_Widget.php CHANGED
File without changes
lib/widgets/SWP_Widget.php CHANGED
File without changes
lib/widgets/SWP_Widget_Loader.php CHANGED
File without changes
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: holas84, dustinwstout, webinator, warfareplugins, cdegraff1, ckmahoney
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: 4.5.0
5
- Tested up to: 5.1
6
- Stable tag: 3.6.0
7
  Requires PHP: 5.6
8
  License: GNU General Public License v2.0 or later
9
 
@@ -194,6 +194,13 @@ We have a growing archive of <a href="https://warfareplugins.com/support/" rel="
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
 
197
  = 3.6.0 (2 MAY 2019) =
198
  * Updated Hover Save Pin functionality to work more globally.
199
  * Updated how Facebook share counts are requested.
2
  Contributors: holas84, dustinwstout, webinator, warfareplugins, cdegraff1, ckmahoney
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: 4.5.0
5
+ Tested up to: 5.2
6
+ Stable tag: 3.6.1
7
  Requires PHP: 5.6
8
  License: GNU General Public License v2.0 or later
9
 
194
 
195
  == Changelog ==
196
 
197
+ = 3.6.1 (3 JUN 2019) =
198
+ * Updated Hover Save Pin functionality to work more globally.
199
+ * Fixed conflcit with hover pin button in Thrive Architect page builder.
200
+ * Removed the Google Plus network share button.
201
+ * Fixed an "Uncaught Error" for $ in the JS on the widgets page.
202
+ * Fixed a Twitter PHP notice.
203
+
204
  = 3.6.0 (2 MAY 2019) =
205
  * Updated Hover Save Pin functionality to work more globally.
206
  * Updated how Facebook share counts are requested.
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.6.0
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.6.0' );
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.6.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.6.1' );
20
  define( 'SWP_PLUGIN_FILE', __FILE__ );
21
  define( 'SWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
22
  define( 'SWP_PLUGIN_DIR', dirname( __FILE__ ) );