Skip to content

Instantly share code, notes, and snippets.

@mallorydxw
Created November 27, 2012 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mallorydxw/4155139 to your computer and use it in GitHub Desktop.
Save mallorydxw/4155139 to your computer and use it in GitHub Desktop.
From d81aefc658a569e3adc84d02e8ae8782bfdc455e Mon Sep 17 00:00:00 2001
From: Tom Adams <tom@dxw.com>
Date: Tue, 27 Nov 2012 10:19:34 -0500
Subject: [PATCH] HTTPS support
---
sharethis.php | 40 ++++++++++++++++++++--------------------
wp_st_opt.js | 12 ++++++------
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/sharethis.php b/sharethis.php
index 79f6859..b74a9a3 100644
--- a/sharethis.php
+++ b/sharethis.php
@@ -58,7 +58,7 @@ function install_ShareThis(){
if($widget==false || !preg_match('/stLight.options/',$widget)){
$pkey2=get_option('st_pubid');
$widget ="<script charset=\"utf-8\" type=\"text/javascript\">var switchTo5x=true;</script>";
- $widget.="<script charset=\"utf-8\" type=\"text/javascript\" src=\"http://w.sharethis.com/button/buttons.js\"></script>";
+ $widget.="<script charset=\"utf-8\" type=\"text/javascript\" src=\"https://ws.sharethis.com/button/buttons.js\"></script>";
$widget.="<script type=\"text/javascript\">stLight.options({publisher:'$pkey2'});var st_type='wordpress".trim(get_bloginfo('version'))."';</script>";
update_option('st_widget',$widget);
}
@@ -118,7 +118,7 @@ function getNewTag($oldTag){
$qs=parse_url($url);
if($qs['query']){
$qs=$qs['query'];
- $newUrl="http://w.sharethis.com/button/sharethis.js#$qs";
+ $newUrl="https://ws.sharethis.com/button/sharethis.js#$qs";
}
else{
$newUrl=$url;
@@ -349,7 +349,7 @@ function st_request_handler() {
$pkeyUpdated=false;
}
if(!preg_match('/stLight.options/',$widget) || $pkeyUpdated==true){
- $widgetTemp="<script charset=\"utf-8\" type=\"text/javascript\" src=\"http://w.sharethis.com/button/buttons.js\"></script>";
+ $widgetTemp="<script charset=\"utf-8\" type=\"text/javascript\" src=\"https://ws.sharethis.com/button/buttons.js\"></script>";
$widgetTemp.="<script type=\"text/javascript\">stLight.options({publisher:'$publisher_id'});var st_type='wordpress".trim(get_bloginfo('version'))."';</script>";
// In case of button style = sharethis (4/7) default.
@@ -560,7 +560,7 @@ function st_options_form() {
})();
</script>
- <link rel="stylesheet" href="http://w.sharethis.com/widget/wp_ex.css" type="text/css" media="screen" />
+ <link rel="stylesheet" href="https://ws.sharethis.com/widget/wp_ex.css" type="text/css" media="screen" />
<div class="wrap">
@@ -576,13 +576,13 @@ function st_options_form() {
<span id="currentType"></span>
</span>
<ul id="carousel" class="jcarousel-skin-tango">
- <li st_type="large"><div class="buttonType">Large Icons (1/7)</div><img src="http://w.sharethis.com/images/wp_ex4.png" alt=""></li>
- <li st_type="hcount"><div class="buttonType">Horizontal Count (2/7)</div><img src="http://w.sharethis.com/images/wp_ex2.png" alt=""></li>
- <li st_type="vcount"><div class="buttonType">Vertical Count (3/7)</div><img src="http://w.sharethis.com/images/wp_ex1.png" alt=""></li>
- <li st_type="sharethis"><div class="buttonType">Classic (4/7)</div><img src="http://w.sharethis.com/images/wp_ex7.png" alt=""></li>
- <li st_type="chicklet"><div class="buttonType">Regular Buttons (5/7)</div><img src="http://w.sharethis.com/images/wp_ex5.png" alt=""></li>
- <li st_type="chicklet2"><div class="buttonType">Regular Button No-Text (6/7)</div><img src="http://w.sharethis.com/images/wp_ex6.png" alt=""></li>
- <li st_type="buttons"><div class="buttonType">Buttons (7/7)</div><img src="http://w.sharethis.com/images/wp_ex3.png" alt=""></li>
+ <li st_type="large"><div class="buttonType">Large Icons (1/7)</div><img src="https://ws.sharethis.com/images/wp_ex4.png" alt=""></li>
+ <li st_type="hcount"><div class="buttonType">Horizontal Count (2/7)</div><img src="https://ws.sharethis.com/images/wp_ex2.png" alt=""></li>
+ <li st_type="vcount"><div class="buttonType">Vertical Count (3/7)</div><img src="https://ws.sharethis.com/images/wp_ex1.png" alt=""></li>
+ <li st_type="sharethis"><div class="buttonType">Classic (4/7)</div><img src="https://ws.sharethis.com/images/wp_ex7.png" alt=""></li>
+ <li st_type="chicklet"><div class="buttonType">Regular Buttons (5/7)</div><img src="https://ws.sharethis.com/images/wp_ex5.png" alt=""></li>
+ <li st_type="chicklet2"><div class="buttonType">Regular Button No-Text (6/7)</div><img src="https://ws.sharethis.com/images/wp_ex6.png" alt=""></li>
+ <li st_type="buttons"><div class="buttonType">Buttons (7/7)</div><img src="https://ws.sharethis.com/images/wp_ex3.png" alt=""></li>
</ul>
</div>
<br/>
@@ -601,15 +601,15 @@ function st_options_form() {
<div class="version">
<span class="heading">Choose which version of the widget you would like to use:</span><br /><br />
- <input type="radio" id="get5x" ' . $fiveCheck . ' name="st_version" value="5x" class="versionItem '.$fiveTag.'" onclick="$(\'.versionImage\').attr(\'src\', \'http://www.sharethis.com/images/Image_Multi_Post-1.png\');"></input>&nbsp;
+ <input type="radio" id="get5x" ' . $fiveCheck . ' name="st_version" value="5x" class="versionItem '.$fiveTag.'" onclick="$(\'.versionImage\').attr(\'src\', \'https://www.sharethis.com/images/Image_Multi_Post-1.png\');"></input>&nbsp;
<label id="multipost_label">Multi-Post</label>
&nbsp;&nbsp;&nbsp;&nbsp;
- <input type="radio" id="get4x" ' . $fourCheck . ' name="st_version" value="4x" class="versionItem '.$fourTag.'" onclick="$(\'.versionImage\').attr(\'src\', \'http://www.sharethis.com/images/Image_Classic-1.png\');"></input>&nbsp;
+ <input type="radio" id="get4x" ' . $fourCheck . ' name="st_version" value="4x" class="versionItem '.$fourTag.'" onclick="$(\'.versionImage\').attr(\'src\', \'https://www.sharethis.com/images/Image_Classic-1.png\');"></input>&nbsp;
<label id="classic_label">Classic</label>
<br />
- <img class="versionImage" src="http://www.sharethis.com/images/' . $wImage . '"></img>
+ <img class="versionImage" src="https://www.sharethis.com/images/' . $wImage . '"></img>
</div>
<br />
<div class="services">
@@ -715,7 +715,7 @@ function st_options_form() {
<label id="hoverbar_label">Enable Hovering Bar</label>
<div style="width: 900px;">
<p class="explainText">Would you like your sharing buttons to be persistent and remain on the page as the user scrolls? Well, then Hovering Bar is for you. It shows the sharing services on the left side to present a non-intrusive yet always available experience.</p>
- <img src="http://sharethis.com/images/new/get-sharing-tools/PREVIEW_Hover.png">
+ <img src="https://sharethis.com/images/new/get-sharing-tools/PREVIEW_Hover.png">
</div><br/><br/>
<div>
@@ -754,19 +754,19 @@ function st_options_form() {
<h2 id="stepHeadings">Pick a style</h2>
<ul id="themeList" class="subOptions" style="margin-top:0px;">
<li data-value="3" class="selected">
- <a><img class="widgetIconSelected" id="opt_theme3" src="http://sharethis.com/images/fbtheme_3.png"></a>
+ <a><img class="widgetIconSelected" id="opt_theme3" src="https://sharethis.com/images/fbtheme_3.png"></a>
</li>
<li data-value="4">
- <a><img class="widgetIconSelected" id="opt_theme4" src="http://sharethis.com/images/fbtheme_4.png"></a>
+ <a><img class="widgetIconSelected" id="opt_theme4" src="https://sharethis.com/images/fbtheme_4.png"></a>
</li>
<li data-value="5">
- <a><img class="widgetIconSelected" id="opt_theme5" src="http://sharethis.com/images/fbtheme_5.png"></a>
+ <a><img class="widgetIconSelected" id="opt_theme5" src="https://sharethis.com/images/fbtheme_5.png"></a>
</li>
<li data-value="6">
- <a><img class="widgetIconSelected" id="opt_theme6" src="http://sharethis.com/images/fbtheme_6.png"></a>
+ <a><img class="widgetIconSelected" id="opt_theme6" src="https://sharethis.com/images/fbtheme_6.png"></a>
</li>
<li data-value="7">
- <a><img class="widgetIconSelected" id="opt_theme7" src="http://sharethis.com/images/fbtheme_7.png"></a>
+ <a><img class="widgetIconSelected" id="opt_theme7" src="https://sharethis.com/images/fbtheme_7.png"></a>
</li>
</ul>
<div style="clear:both;"></div>
diff --git a/wp_st_opt.js b/wp_st_opt.js
index 4e5f900..c17f128 100644
--- a/wp_st_opt.js
+++ b/wp_st_opt.js
@@ -276,8 +276,8 @@ function generateShareNow(){
var tag='<script charset="utf-8" type="text/javascript">var switchTo5x='+switchTo5x+';</script>';
- //var tag='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
- tag+='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
+ //var tag='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
+ tag+='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
tag+='<script type="text/javascript">stLight.options({publisher:"'+pubkey+'"'+getCopyNShare()+'});</script>';
if ($('#st_sharenow').attr('checked')) {
@@ -313,7 +313,7 @@ function generateShareNow(){
generateHoverbar(defaultPosition);
}else{
// Simple buttons with NO sharenow and NO hoverbar
- var tag='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
+ var tag='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
tag+='<script type="text/javascript">stLight.options({publisher:"'+pubkey+'"'+getCopyNShare()+'});</script>';
$('#st_widget').val(tag);
}
@@ -372,8 +372,8 @@ function generateHoverbar(defaultPosition) {
var tag='<script charset="utf-8" type="text/javascript">var switchTo5x='+switchTo5x+';</script>';
- //var tag='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
- tag +='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
+ //var tag='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
+ tag +='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
tag+='<script type="text/javascript">stLight.options({publisher:"'+pubkey+'"'+getCopyNShare()+'});</script>';
if ($('#st_hoverbar').attr('checked')) {
@@ -395,7 +395,7 @@ function generateHoverbar(defaultPosition) {
generateShareNow();
}else{
// Simple buttons with NO sharenow and NO hoverbar
- var tag='<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
+ var tag='<script charset="utf-8" type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>';
tag+='<script type="text/javascript">stLight.options({publisher:"'+pubkey+'"'+getCopyNShare()+'});</script>';
$('#st_widget').val(tag);
}
--
1.7.10.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment