From 805ea1a484ca4935aa0eef3ce7c8944dcd230f21 Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Sun, 14 Oct 2012 21:34:50 +0800
Subject: [PATCH 1/2] Issue #1498768 by hswong3i: Coder cleanup with minor
 warnings + lessc CSS cleanup.

---
 ShareThisForm.css                      |  384 +++++++++++++++-----------------
 ShareThisForm.js                       |  158 ++++++-------
 img/._b_classic.png                    |  Bin 325 -> 0 bytes
 img/._button.png                       |  Bin 325 -> 0 bytes
 img/._hcount.png                       |  Bin 325 -> 0 bytes
 img/._large.png                        |  Bin 325 -> 0 bytes
 img/._preview_bg.png                   |  Bin 204 -> 0 bytes
 img/._preview_sprite.png               |  Bin 204 -> 0 bytes
 img/._small.png                        |  Bin 325 -> 0 bytes
 img/._vcount.png                       |  Bin 325 -> 0 bytes
 img/._widget.png                       |  Bin 204 -> 0 bytes
 sharethis.install                      |    3 +-
 sharethis.module                       |  114 +++++-----
 stlib_picker.css                       |  173 +++++++-------
 stlib_picker.js                        |  206 ++++++++---------
 views/sharethis.views.inc              |    2 +-
 views/sharethis_handler_field_link.inc |    4 +-
 17 files changed, 506 insertions(+), 538 deletions(-)
 delete mode 100644 img/._b_classic.png
 delete mode 100644 img/._button.png
 delete mode 100644 img/._hcount.png
 delete mode 100644 img/._large.png
 delete mode 100644 img/._preview_bg.png
 delete mode 100644 img/._preview_sprite.png
 delete mode 100644 img/._small.png
 delete mode 100644 img/._vcount.png
 delete mode 100644 img/._widget.png

diff --git a/ShareThisForm.css b/ShareThisForm.css
index 11e494f..63913b3 100644
--- a/ShareThisForm.css
+++ b/ShareThisForm.css
@@ -1,244 +1,222 @@
 .st_form {
-	color:#333333;
-	padding:10px;	
-	margin:0px;
-	margin-bottom: 25px;
-	
-	border:1px solid darkgrey;
-	-moz-border-radius: 10px;
-	-webkit-border-radius: 10px;
-	border-radius: 10px;
-	
-	background: #eaeeef; 
-    background: -moz-linear-gradient(top, #eaeeef 0%, #fff 90%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eaeeef), color-stop(90%,#fff)); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeeef', endColorstr='#fff',GradientType=0 );
-}
-
-.st_formButton, .st_formButtonSave {
-	margin:0px;
-	margin-bottom:10px;
-	margin-right:7px;
-	padding:10px;
-	display:inline-block;
-	color:#056D2D;
-	text-align:center;
-	font-size:1.2em;
-	width:120px;
-	cursor:pointer;
-	
-	border:1px solid #888888;
-	-moz-border-radius: 5px;
-	-webkit-border-radius: 5px;
-	border-radius: 5px;
-	
-	background: #eeeeee; 
-    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(90%,#cccccc)); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 );	
-}
-
-.st_formButton:hover, .st_formButtonSave:hover {
-	background: #cccccc; 
-	border:1px solid #aaaaaa;
-	
-    background: -moz-linear-gradient(top, #cccccc 0%, #eeeeee 90%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cccccc), color-stop(90%,#eeeeee)); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 );
-}
-
+  color: #333333;
+  padding: 10px;
+  margin: 0px;
+  margin-bottom: 25px;
+  border: 1px solid darkgrey;
+  -moz-border-radius: 10px;
+  -webkit-border-radius: 10px;
+  border-radius: 10px;
+  background: #eaeeef;
+  background: -moz-linear-gradient(top, #eaeeef 0%, #ffffff 90%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eaeeef), color-stop(90%, #ffffff));
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#eaeeef', endColorstr='#fff', GradientType=0);
+}
+.st_formButton,
+.st_formButtonSave {
+  margin: 0px;
+  margin-bottom: 10px;
+  margin-right: 7px;
+  padding: 10px;
+  display: inline-block;
+  color: #056D2D;
+  text-align: center;
+  font-size: 1.2em;
+  width: 120px;
+  cursor: pointer;
+  border: 1px solid #888888;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+  background: #eeeeee;
+  background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(90%, #cccccc));
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);
+}
+.st_formButton:hover,
+.st_formButtonSave:hover {
+  background: #cccccc;
+  border: 1px solid #aaaaaa;
+  background: -moz-linear-gradient(top, #cccccc 0%, #eeeeee 90%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #cccccc), color-stop(90%, #eeeeee));
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#cccccc', endColorstr='#eeeeee', GradientType=0);
+}
 .st_formSubtitle {
-	font-size:.7em;
-	color:black;	
+  font-size: .7em;
+  color: black;
 }
-
 .st_widgetPic {
-	position:absolute;
-	left:206px;
-	display:block;
-	background:white;
-	padding:10px;
-	border:1px solid black;
-	-moz-border-radius: 5px;
-	-webkit-border-radius: 5px;
-	border-radius: 5px;		
-}
-
+  position: absolute;
+  left: 206px;
+  display: block;
+  background: white;
+  padding: 10px;
+  border: 1px solid black;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+}
 .st_widgetPicContain {
-	display:block;
-	height:285px;
-	overflow:hidden;	
-	
-	border:1px solid #aaaaaa;
-	-moz-border-radius: 5px;
-	-webkit-border-radius: 5px;
-	border-radius: 5px;	
-}
-
-.st_multi .st_widgetPicContain img{
-	margin-top:-285px;
-}
-
+  display: block;
+  height: 285px;
+  overflow: hidden;
+  border: 1px solid #aaaaaa;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+}
+.st_multi .st_widgetPicContain img {
+  margin-top: -285px;
+}
 .st_widgetPic img {
-	margin:0px;
-	padding:0px;
-	display:block;
+  margin: 0px;
+  padding: 0px;
+  display: block;
 }
-
 .st_widgetContain {
-	width:800px;	
-	height:340px;
-	position:relative;
+  width: 800px;
+  height: 340px;
+  position: relative;
 }
-
 .st_buttonContain {
-	height:340px;	
-}
-
-.st_select, .st_select:hover {
-	background: #aaaaaa; 
-	border: 2px solid #118811;
-	margin-bottom:8px;
-}
-
-.st_formPickerLeft, .st_formPickerMid, .st_formPickerRight {
-	display:block;
-	float:left;
-	height:294px;
-	width:327px;
-	border:1px solid black;
-	-moz-border-radius: 5px;
-    -webkit-border-radius: 5px;
-    border-radius:5px;
-    overflow:hidden;
-}
-
+  height: 340px;
+}
+.st_select,
+.st_select:hover {
+  background: #aaaaaa;
+  border: 2px solid #118811;
+  margin-bottom: 8px;
+}
+.st_formPickerLeft,
+.st_formPickerMid,
+.st_formPickerRight {
+  display: block;
+  float: left;
+  height: 294px;
+  width: 327px;
+  border: 1px solid black;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+  overflow: hidden;
+}
 .st_formPickerMid {
-	width:100px;
-	border:none;
-	margin-top:40px;
+  width: 100px;
+  border: none;
+  margin-top: 40px;
 }
-
 .st_clear {
-	clear:both;	
-}
-
-#st_formULLeft, #st_formULRight  {
-	display:block;
-	overflow-y:scroll;	
-	height:255px;
-	margin:0px;
-	list-style:none;
-	background-color: #eeeeee;
-}
-
+  clear: both;
+}
+#st_formULLeft,
+#st_formULRight {
+  display: block;
+  overflow-y: scroll;
+  height: 255px;
+  margin: 0px;
+  list-style: none;
+  background-color: #eeeeee;
+}
 .st_formULHeader {
-	display:block;
-	font-size:1.2em;
-	padding:10px;
-	background-color: #115511;
-	color:#115511;
-	
-	background: #eeeeee; 
-    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(90%,#cccccc)); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 );	
-}
-
+  display: block;
+  font-size: 1.2em;
+  padding: 10px;
+  background-color: #115511;
+  color: #115511;
+  background: #eeeeee;
+  background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(90%, #cccccc));
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);
+}
 .st_pickerLi {
-	border-bottom:1px solid black;	
-	padding:5px;
-	background: #ffffee; 
-	cursor:pointer;
+  border-bottom: 1px solid black;
+  padding: 5px;
+  background: #ffffee;
+  cursor: pointer;
 }
-
 .st_pickerLi:hover {
-	background:#aaffcc;
+  background: #aaffcc;
 }
-
-.st_selectLi, .st_selectLi:hover {
-	background:#88dd11;
+.st_selectLi,
+.st_selectLi:hover {
+  background: #88dd11;
 }
-
 .st_arrow {
-	display:block;
-	height:35px;
-	width:35px;
-	margin:30px;
-	margin-bottom:10px;
-	margin-top:10px;
-	overflow:hidden;
-	cursor:pointer;
-}
-
+  display: block;
+  height: 35px;
+  width: 35px;
+  margin: 30px;
+  margin-bottom: 10px;
+  margin-top: 10px;
+  overflow: hidden;
+  cursor: pointer;
+}
 .st_up:hover {
-	margin-top:-152px;
+  margin-top: -152px;
 }
-
 .st_left {
-	margin-top:-37px;
+  margin-top: -37px;
 }
-
 .st_left:hover {
-	margin-top:-189px;
+  margin-top: -189px;
 }
-
 .st_right {
-	margin-top:-75px;	
+  margin-top: -75px;
 }
-
 .st_right:hover {
-	margin-top:-227px;	
+  margin-top: -227px;
 }
-
 .st_down {
-	margin-top:-114px;	
+  margin-top: -114px;
 }
-
 .st_down:hover {
-	margin-top:-266px;	
+  margin-top: -266px;
 }
-
 .st_formMessage {
-	color:red;	
+  color: red;
 }
-
 .st_buttonSelectImage {
-	left:206px;
-	display:block;
-	background:white;
-	padding:10px;
-	border:1px solid #aaaaaa;
-	-moz-border-radius: 5px;
-	-webkit-border-radius: 5px;
-	border-radius: 5px;		
-}
-
+  left: 206px;
+  display: block;
+  background: white;
+  padding: 10px;
+  border: 1px solid #aaaaaa;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+}
 .st_buttonSelectSprite {
-	display:block;
-	padding:0px;
-	margin:0px;
+  display: block;
+  padding: 0px;
+  margin: 0px;
 }
-
 .st_spriteCover {
-	position:absolute;
-	left:219px;
-	top:100px;
-	display:block;
-	margin:10px;	
-	overflow:hidden;
-	height:73px;
-	width:600px;
-	z-index:5;
-}
-
+  position: absolute;
+  left: 219px;
+  top: 100px;
+  display: block;
+  margin: 10px;
+  overflow: hidden;
+  height: 73px;
+  width: 600px;
+  z-index: 5;
+}
 .st_buttonContain {
-	position:relative;
-	width:400px;
-}
-
-.stbc_ { margin-top: -90px; }
-.stbc_large { margin-top: -10px; }
-.stbc_hcount { margin-top: -244px; }
-.stbc_vcount { margin-top: -315px; }
-.stbc_button { margin-top: -166px; }
\ No newline at end of file
+  position: relative;
+  width: 400px;
+}
+.stbc_ {
+  margin-top: -90px;
+}
+.stbc_large {
+  margin-top: -10px;
+}
+.stbc_hcount {
+  margin-top: -244px;
+}
+.stbc_vcount {
+  margin-top: -315px;
+}
+.stbc_button {
+  margin-top: -166px;
+}
diff --git a/ShareThisForm.js b/ShareThisForm.js
index d5bc29b..10ad84c 100644
--- a/ShareThisForm.js
+++ b/ShareThisForm.js
@@ -2,87 +2,87 @@
  * @file
  * This file contains most of the code for the configuration page.
  */
- 
+
 // Create the drupal ShareThis object for clean code and namespacing:
 var drupal_st = {
-	// These are handlerd for updating the widget pic class.
-	multiW: function() {
-		jQuery(".st_widgetPic").addClass("st_multi");
-	},
-	classicW: function() {
-		jQuery(".st_widgetPic").removeClass("st_multi");
-	},
-	// These are the handlers for updating the button pic class (stbc = sharethisbuttonclass).
-	smallChicklet: function () {
-		drupal_st.removeButtonClasses();
-		jQuery("#stb_sprite").addClass("stbc_");
-	},
-	largeChicklet: function () {
-		drupal_st.removeButtonClasses();
-		jQuery("#stb_sprite").addClass("stbc_large");
-	},
-	hcount: function() {
-		drupal_st.removeButtonClasses();
-		jQuery("#stb_sprite").addClass("stbc_hcount");
-	},
-	vcount: function() {
-		drupal_st.removeButtonClasses();
-		jQuery("#stb_sprite").addClass("stbc_vcount");
-	},
-	button: function() {
-		drupal_st.removeButtonClasses();
-		jQuery("#stb_sprite").addClass("stbc_button");
-	},
-	// This is a helper function for updating button pictures.
-	removeButtonClasses: function() {
-		var toRemove = jQuery("#stb_sprite");
-		toRemove.removeClass("stbc_");
-		toRemove.removeClass("stbc_large");
-		toRemove.removeClass("stbc_hcount");
-		toRemove.removeClass("stbc_vcount");
-		toRemove.removeClass("stbc_button");
-	},
-	//Write helper functions for saving:
-	getWidget: function () {
-		return jQuery(".st_widgetPic").hasClass("st_multiW") ? '5x': '4x';
-	},
-	getButtons: function () {
-		var selectedButton = 'large';
-		var buttonButtons = jQuery(".st_wIm");
-		buttonButtons.each(function () {
-			if (jQuery(this).hasClass("st_select")) {
-				selectedButton = jQuery(this).attr("id").substring(3);
-			}
-		});
-		console.log(selectedButton);
-		return selectedButton;
-	},
-	setupServiceText: function () {
-		jQuery("#edit-sharethis-service-option").css({display:"none"});
-	},
-	// Function to add various events to our html form elements
-	addEvents: function() {
-		jQuery("#edit-sharethis-widget-option-st-multi").click(drupal_st.multiW);
-		jQuery("#edit-sharethis-widget-option-st-direct").click(drupal_st.classicW);
-		
-		jQuery("#edit-sharethis-button-option-stbc-").click(drupal_st.smallChicklet);
-		jQuery("#edit-sharethis-button-option-stbc-large").click(drupal_st.largeChicklet);
-		jQuery("#edit-sharethis-button-option-stbc-hcount").click(drupal_st.hcount);
-		jQuery("#edit-sharethis-button-option-stbc-vcount").click(drupal_st.vcount);
-		jQuery("#edit-sharethis-button-option-stbc-button").click(drupal_st.button);
-		
-		jQuery(".st_formButtonSave").click(drupal_st.updateOptions);
-	},
-	serviceCallback: function() {
-		var services = stlib_picker.getServices("myPicker");
-		var outputString = "";
-		for(i=0;i<services.length;i++) {
-			outputString += "\"" + _all_services[services[i]].title + ":"
-			outputString += services[i] + "\","
-		}
-		outputString = outputString.substring(0, outputString.length-1);
-		jQuery("#edit-sharethis-service-option").attr("value", outputString);
-	}
+  // These are handlerd for updating the widget pic class.
+  multiW: function() {
+    jQuery(".st_widgetPic").addClass("st_multi");
+  },
+  classicW: function() {
+    jQuery(".st_widgetPic").removeClass("st_multi");
+  },
+  // These are the handlers for updating the button pic class (stbc = sharethisbuttonclass).
+  smallChicklet: function () {
+    drupal_st.removeButtonClasses();
+    jQuery("#stb_sprite").addClass("stbc_");
+  },
+  largeChicklet: function () {
+    drupal_st.removeButtonClasses();
+    jQuery("#stb_sprite").addClass("stbc_large");
+  },
+  hcount: function() {
+    drupal_st.removeButtonClasses();
+    jQuery("#stb_sprite").addClass("stbc_hcount");
+  },
+  vcount: function() {
+    drupal_st.removeButtonClasses();
+    jQuery("#stb_sprite").addClass("stbc_vcount");
+  },
+  button: function() {
+    drupal_st.removeButtonClasses();
+    jQuery("#stb_sprite").addClass("stbc_button");
+  },
+  // This is a helper function for updating button pictures.
+  removeButtonClasses: function() {
+    var toRemove = jQuery("#stb_sprite");
+    toRemove.removeClass("stbc_");
+    toRemove.removeClass("stbc_large");
+    toRemove.removeClass("stbc_hcount");
+    toRemove.removeClass("stbc_vcount");
+    toRemove.removeClass("stbc_button");
+  },
+  //Write helper functions for saving:
+  getWidget: function () {
+    return jQuery(".st_widgetPic").hasClass("st_multiW") ? '5x': '4x';
+  },
+  getButtons: function () {
+    var selectedButton = 'large';
+    var buttonButtons = jQuery(".st_wIm");
+    buttonButtons.each(function () {
+      if (jQuery(this).hasClass("st_select")) {
+        selectedButton = jQuery(this).attr("id").substring(3);
+      }
+    });
+    console.log(selectedButton);
+    return selectedButton;
+  },
+  setupServiceText: function () {
+    jQuery("#edit-sharethis-service-option").css({display:"none"});
+  },
+  // Function to add various events to our html form elements
+  addEvents: function() {
+    jQuery("#edit-sharethis-widget-option-st-multi").click(drupal_st.multiW);
+    jQuery("#edit-sharethis-widget-option-st-direct").click(drupal_st.classicW);
+
+    jQuery("#edit-sharethis-button-option-stbc-").click(drupal_st.smallChicklet);
+    jQuery("#edit-sharethis-button-option-stbc-large").click(drupal_st.largeChicklet);
+    jQuery("#edit-sharethis-button-option-stbc-hcount").click(drupal_st.hcount);
+    jQuery("#edit-sharethis-button-option-stbc-vcount").click(drupal_st.vcount);
+    jQuery("#edit-sharethis-button-option-stbc-button").click(drupal_st.button);
+
+    jQuery(".st_formButtonSave").click(drupal_st.updateOptions);
+  },
+  serviceCallback: function() {
+    var services = stlib_picker.getServices("myPicker");
+    var outputString = "";
+    for(i=0;i<services.length;i++) {
+      outputString += "\"" + _all_services[services[i]].title + ":"
+      outputString += services[i] + "\","
+    }
+    outputString = outputString.substring(0, outputString.length-1);
+    jQuery("#edit-sharethis-service-option").attr("value", outputString);
+  }
 };
 //After the page is loaded, we want to add events to dynamically created elements.
 jQuery(document).ready(drupal_st.addEvents);
diff --git a/img/._b_classic.png b/img/._b_classic.png
deleted file mode 100644
index 196c912e84556d469f746901632f040d908d0200..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVt6RK
z5~||`P&O7-1=w_uxE2s4=jZAr78K;9>gA@EB&H;mBwA(rx_FkP=6V(fCl{rr<~b)8
zl#~{wLd;+k0@B6|3_7^=q38;!ECA|ED#*z!E-^6R<bayO2%#BZG?dH02~!zaoSKuG
MT#}ieM@Wkh0E}-mmjD0&

diff --git a/img/._button.png b/img/._button.png
deleted file mode 100644
index 9c0fe9e8dfa41de50c57b417c7e7e1cf742e28be..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVt6Q5
z0M+pVC>x8a0&F@+TnmVj^K<nQ3kq^l^>R~75>paO60Nd*T|7%tb3KcLlZ#SQ^PCe4
zN=l1TA!aZN0cm3f1|8h`P;`Y<765f7735?VmlzmuazIUCgwPBy8p>thgsF@yPR&V8
MF3HT#Bcw$L09imZUjP6A

diff --git a/img/._hcount.png b/img/._hcount.png
deleted file mode 100644
index ceec7af35caecdd3b61123e6965c137c17fa4b6c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVt6R~
z0IK5!P&O7-1=w_uxE2s4=jZAr78K;9>gA@EB&H;mBwA(rx_FkP=6V(fCl{rr<~b)8
zl#~{wLd;+k0@B6|3_7^=q38;!ECA|ED#*z!E-^6R<bayO2%#BZG?dH02~!zaoSKuG
MT#}ieM@Wkh0KT;}&Hw-a

diff --git a/img/._large.png b/img/._large.png
deleted file mode 100644
index 82004a4127733855e91c80b14ad905e84cbd24c4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVz|5i
zK2*mGplmFv3b5%QaV;Q9&d=3LEGWoH)yqvSNlZyBNwmuLb@41o&Gjq}PA*DK&2vsH
zC@C#Ug_yx81f-1_7<6#!L(vsdSpd|TRFIQdTw-9r$pJNm5kfP-XegI~6Q(k<I5j6V
Mxg;|`kB}B208ZdFYXATM

diff --git a/img/._preview_bg.png b/img/._preview_bg.png
deleted file mode 100644
index c00ec29c50502812de70ca8a09a396e8d4d80304..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 204
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDI}@hl()@y`G;5x_AdB#7bR_imt4kd7HZ
zY=WkZ5g{&`oS&<gSWu9Ys#jQ=Sd^Gol9`vvP^fPJ1lA@giRLB-#;Mls`T6NNsWBBs
W2F@8p`MIgqH6U&2U{O7Y5CZ_r86+|Q

diff --git a/img/._preview_sprite.png b/img/._preview_sprite.png
deleted file mode 100644
index e1e1316e86f6a05281ababdc0c814fb7f3480e21..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 204
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDI}@hl()@y`G;5x_AdB#7bR_a#83ARRM+
z*aS@*BSKs>IX_n~v7jI)Rj;r#u_!UGBr`9Sp-|rd2&_#~63tBvOj4}f^YhblQe!HN
W44gBH@^e$IYe3r4!J>K)AqD`~BP2@z

diff --git a/img/._small.png b/img/._small.png
deleted file mode 100644
index 397d507bfb7c8ee5c88c11d9236d57221891986a..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVt6Qf
z0IK5!P&O7-1=w_uxE2s4=jZAr78K;9>gA@EB&H;mBwA(rx_FkP=6V(fCl{rr<~b)8
zl#~{wLd;+k0@B6|3_7^=q38;!ECA|ED#*z!E-^6R<bayO2%#BZG?dH02~!zaoSKuG
MT#}ieM@Wkh0HJj>t^fc4

diff --git a/img/._vcount.png b/img/._vcount.png
deleted file mode 100644
index dd9ad0d55ab2474cd9cefac65d7305119567c2c9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 325
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFfa-OX&|4`6-Xn10D_6iatsLxVt6PA
z6a?#d0c6CYssNh~64wHv<osN{#DapHRK48PlEjq6l0>U)Ul-4k)LhTv;N+sz)I8_J
zf|AmrREQajLO|M>fk6kiJ``Ocl?6bZNd-BX#U%y?oE%V77$GzRjD~U<IAJOyi&Jw_
NlS?x5^9X4X0s!*SGw%QZ

diff --git a/img/._widget.png b/img/._widget.png
deleted file mode 100644
index 3ddde8ebccbd42c99f784efd46e17dd6be718df0..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 204
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDI}@hl()@y`G;5x_AdB#7bRB9Ly7ju}8~
zf~JiTAugJnpR1QxP>_?VS6G@@l$ckNnU~5?sBZuS)+Q;5W`-$-sn+iK`RO^SF%?Dz
V&KX7dxvADQAZ_VjQ9Xzd0|0aiBZ&Y2

diff --git a/sharethis.install b/sharethis.install
index 45dfd8e..4b45e89 100644
--- a/sharethis.install
+++ b/sharethis.install
@@ -1,4 +1,5 @@
-<?php // $Id$
+<?php
+
 /**
  * @file
  * This file holds the install information for the ShareThis Module.
diff --git a/sharethis.module b/sharethis.module
index b11b052..0d3f23f 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -1,21 +1,23 @@
 <?php
+
 /**
  * @file
  * A module that adds one of the ShareThis widget to your website.
  */
 
 /**
- * Implements hook_help.
+ * Implements hook_help().
  *
  * Displays help and module information.
  *
- * @param path 
+ * @param path
  *   Which path of the site we're using to display help
- * @param arg 
+ * @param arg
  *   Array that holds the current path as returned from arg() function
  */
 function sharethis_help($path, $arg) {
   global $base_url;
+
   switch ($path) {
     case 'admin/config/services/sharethis':
       return '<p>' . t('Choose the widget, button family, and services for using <a href="@sharethis">ShareThis</a> to share content online.', array('@sharethis' => 'http://sharethis.com')) . '</p>';
@@ -38,13 +40,13 @@ function sharethis_help($path, $arg) {
 function sharethis_permission() {
   return array(
     'administer sharethis' => array(
-      'title' => t('Administer ShareThis'), 
+      'title' => t('Administer ShareThis'),
       'description' => t('Change the settings for how ShareThis behaves on the site.'),
     ),
   );
 }
 
- /**
+/**
  * This is the main configuration form for the admin page.
  */
 function sharethis_configuration_form($form, &$form_state) {
@@ -53,13 +55,15 @@ function sharethis_configuration_form($form, &$form_state) {
   $my_path = drupal_get_path('module', 'sharethis');
   // Load the css and js for our module's configuration.
   drupal_add_css($my_path . '/ShareThisForm.css');
-  drupal_add_js('https://ws.sharethis.com/share5x/js/stcommon.js', 'external');  //This is ShareThis's common library - has a serviceList of all the objects that are currently supported.
+  // This is ShareThis's common library - has a serviceList of all the objects
+  // that are currently supported.
+  drupal_add_js('https://ws.sharethis.com/share5x/js/stcommon.js', 'external');
   drupal_add_js($my_path . '/ShareThisForm.js');
   drupal_add_js($my_path . '/stlib_picker.js');
   drupal_add_css($my_path . '/stlib_picker.css');
   $current_options_array = sharethis_get_options_array();
   global $base_url;
-  
+
   // Create the variables related to widget choice.
   $widget_type = $current_options_array['widget'];
   $widget_markup = "";
@@ -72,12 +76,12 @@ function sharethis_configuration_form($form, &$form_state) {
   $service_string = $current_options_array['services'];
   $service_string_markup = "";
   foreach (explode(",", $service_string) as $name => $string) {
-    $key = explode(":", substr($string, 0, -1));
+    $key = explode(":", drupal_substr($string, 0, -1));
     $key = $key[1];
     $service_string_markup .= "\"" . $key . "\",";
   }
-  $service_string_markup = substr($service_string_markup, 0, -1);
-  
+  $service_string_markup = drupal_substr($service_string_markup, 0, -1);
+
   // Create an array of node types.
   $node_type_array = node_type_get_types();
   $node_type_options = array();
@@ -91,7 +95,7 @@ function sharethis_configuration_form($form, &$form_state) {
   $publisher = $current_options_array['publisherID'];
   // Create the variables for teasers.
   $teaser = $current_options_array['viewMode'] == "1" ? TRUE : FALSE;
-  
+
   $form = array();
   $form['options'] = array(
     '#type' => 'fieldset',
@@ -100,14 +104,14 @@ function sharethis_configuration_form($form, &$form_state) {
   $form['options']['sharethis_widget_option'] = array(
     '#options' => array(
       'st_multi' => t("Multi-Post Widget"),
-      'st_direct' => t("Direct-Post Widget")
+      'st_direct' => t("Direct-Post Widget"),
     ),
     '#default_value' => $widget_type,
     '#type' => 'radios',
     '#required' => TRUE,
     '#title' => t("Choose a widget type:"),
     '#prefix' => '<div class="st_widgetContain"><div class="st_widgetPic ' . $widget_markup . '"><div class="st_widgetPicContain"><img src="' . $base_url . '/' . $my_path . '/img/widget.png"></img></div></div>',
-    '#suffix' => '</div>'
+    '#suffix' => '</div>',
   );
   $form['options']['sharethis_button_option'] = array(
     '#required' => TRUE,
@@ -117,12 +121,12 @@ function sharethis_configuration_form($form, &$form_state) {
       'stbc_' => t("Small Chicklets"),
       'stbc_button' => t("Classic Buttons"),
       'stbc_vcount' => t("Vertical Counters"),
-      'stbc_hcount' => t("Horizontal Counters")
+      'stbc_hcount' => t("Horizontal Counters"),
     ),
     '#default_value' => $button_choice,
     '#title' => t("Choose a button style:"),
     '#prefix' => '<div class="st_widgetContain"><div class="st_spriteCover"><img id="stb_sprite" class="st_buttonSelectSprite ' . $button_choice . '" src="' . $base_url . '/' . $my_path . '/img/preview_sprite.png"></img></div><div class="st_widgetPic"><img class="st_buttonSelectImage" src="' . $base_url . '/' . $my_path . '/img/preview_bg.png"></img></div>',
-    '#suffix' => '</div>'
+    '#suffix' => '</div>',
   );
   $form['options']['sharethis_service_option'] = array(
     '#description' => t("<b>Add</b> a service by selecting it on the right and clicking the <i>left arrow</i>.  <b>Remove</b> it by clicking the <i>right arrow</i>.<br /><b>Change the order</b> of services under \"Selected Services\" by using the <i>up</i> and <i>down</i> arrows."),
@@ -159,7 +163,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#required' => TRUE,
     '#type' => 'checkboxes',
     '#options' => $node_type_options,
-    '#default_value' => $nodes_selected
+    '#default_value' => $nodes_selected,
   );
   $form['context']['sharethis_teaser_option'] = array(
     '#title' => t('Only full view'),
@@ -203,7 +207,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#title' => t("Insert a publisher key (optional)."),
     '#description' => t("When you install the module, we create a random publisher key.  You can register the key with ShareThis by contacting customer support.  Otherwise, you can go to <a href='http://www.sharethis.com/account'>ShareThis</a> and create an account.<br />Your official publisher key can be found under 'My Account'.<br />It allows you to get detailed analytics about sharing done on your site."),
     '#type' => 'textfield',
-    '#default_value' => $publisher
+    '#default_value' => $publisher,
   );
   $form['advanced']['sharethis_late_load'] = array(
     '#title' => t('Late Load'),
@@ -230,12 +234,12 @@ function sharethis_configuration_form($form, &$form_state) {
  * Form submission handler for sharethis_configuration_form().
  */
 function sharethis_configuration_form_validate($form, &$form_state) {
-  //Additional filters for the service option input
-  
+  // Additional filters for the service option input
+
   // Sanitize the publisher ID option.  Since it's a text field, remove anything that resembles code
   $form_state['values']['sharethis_service_option'] = filter_xss($form_state['values']['sharethis_service_option'], array());
 
-  //Additional filters for the option extras input
+  // Additional filters for the option extras input
   $form_state['values']['sharethis_option_extras'] = (isset($form_state['values']['sharethis_option_extras'])) ? $form_state['values']['sharethis_option_extras'] : array();
 
   // Implode the node options
@@ -253,9 +257,9 @@ function sharethis_configuration_form_validate($form, &$form_state) {
   // Ensure default value for twitter handle
   $form_state['values']['sharethis_twitter_handle'] = (isset($form_state['values']['sharethis_twitter_handle'])) ? $form_state['values']['sharethis_twitter_handle'] : '';
 }
- 
- /**
- * Implements hook_menu.
+
+/**
+ * Implements hook_menu().
  *
  * This is the ShareThis Config Menu.
  */
@@ -265,20 +269,20 @@ function sharethis_menu() {
     'description' => 'Choose the widget, button family, and services for using ShareThis to share content online.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('sharethis_configuration_form'),
-    'access arguments' => array('administer sharethis')
+    'access arguments' => array('administer sharethis'),
   );
   return $items;
 }
 
- /**
- * Implements hook_node_view.
+/**
+ * Implements hook_node_view().
  *
  * Inserts ShareThis widget code onto each node view.
  * TODO: Want to add the option somewhere to select nodes.
  *
- * @param node 
+ * @param node
  *   The node that is being acted upon
- * @param view_mode 
+ * @param view_mode
  *   The type of view (teaser, full, etc)
  * @param langcode
  *   Information about the language
@@ -293,7 +297,7 @@ function sharethis_node_view($node, $view_mode, $langcode) {
   }
   // First get all of the options for the sharethis widget from the database:
   $data_options = sharethis_get_options_array();
-  
+
   // This looks to see if the path variable has been posted by some rewrite module.
   // This is not super efficient, O(N), but N is often less than 20.
   $is_path = FALSE;
@@ -312,19 +316,19 @@ function sharethis_node_view($node, $view_mode, $langcode) {
 
   // Pathauto integration !
   if (module_exists('pathauto')) {
-    $path_module = '/' . drupal_lookup_path('alias',"node/" . $node->nid);
+    $path_module = '/' . drupal_lookup_path('alias', "node/" . $node->nid);
   }
 
   global $base_url;
   // Get the full path to insert into the Share Buttons.
-  $mPath = $base_url . $path_module;
-  $mTitle = $node->title;
-  
+  $data_path = $base_url . $path_module;
+  $data_title = $node->title;
+
   // Only display the ShareThis buttons if this node fits all the requirements
   if (strpos($data_options['nodeType'], $node->type) !== FALSE) { // Make sure this is the right type of node.
     if (($data_options['viewMode'] == "1") && ($view_mode == "teaser")) { // If "don't show for teaser" is enabled, and this is a teaser, don't do anything
       // Do nothing.
-    } 
+    }
     else {
       // Check where we want to display the ShareThis widget.
       switch (variable_get('sharethis_location', 'content')) {
@@ -333,14 +337,14 @@ function sharethis_node_view($node, $view_mode, $langcode) {
             '#tag' => 'div', // Wrap it in a div.
             '#type' => 'html_tag',
             '#attributes' => array('class' => 'sharethis-buttons'),
-            '#value' => sharethis_get_button_HTML($data_options, $mPath, $mTitle),
+            '#value' => sharethis_get_button_html($data_options, $data_path, $data_title),
             '#weight' => intval(variable_get('sharethis_weight', 10)),
           );
-        break;
+          break;
         case 'links':
           $links['sharethis'] = array(
             'html' => TRUE,
-            'title' => sharethis_get_button_HTML($data_options, $mPath, $mTitle),
+            'title' => sharethis_get_button_html($data_options, $data_path, $data_title),
             'attributes' => array('class' => 'sharethis-buttons'),
           );
           $node->content['links']['sharethis'] = array(
@@ -353,7 +357,7 @@ function sharethis_node_view($node, $view_mode, $langcode) {
             '#type' => 'html_tag',
             '#weight' => intval(variable_get('sharethis_weight', 10)),
           );
-        break;
+          break;
       }
     }
   }
@@ -385,14 +389,14 @@ function sharethis_get_options_array() {
  * sharethisGet_button_HTML is the function that creates the ShareThis code
  * It returns the appropriate html based on your settings.
  */
-function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {
+function sharethis_get_button_html($data_options, $data_path, $data_title) {
   // Inject the extra services.
   foreach ($data_options['option_extras'] as $service) {
     $data_options['services'] .= ',"' . $service . '"';
   }
 
   // The share buttons are simply spans of the form class='st_SERVICE_BUTTONTYPE' -- "st" stands for ShareThis.
-  $type = substr($data_options['buttons'], 4);
+  $type = drupal_substr($data_options['buttons'], 4);
   $type = $type == "_" ? "" : check_plain($type);
   $service_array = explode(",", $data_options['services']);
   $st_spans = "";
@@ -407,26 +411,26 @@ function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {
     }
 
     // Find the service code name.
-    $serviceCodeName = substr($service[1], 0, -1);
+    $service_code_name = drupal_substr($service[1], 0, -1);
 
     // Switch the title on a per-service basis if required.
-    $title = $mTitle;
-    switch ($serviceCodeName) {
+    $title = $data_title;
+    switch ($service_code_name) {
       case 'twitter':
-        $title = empty($data_options['twitter_suffix']) ? $mTitle : check_plain($mTitle) . ' ' . check_plain($data_options['twitter_suffix']);
+        $title = empty($data_options['twitter_suffix']) ? $data_title : check_plain($data_title) . ' ' . check_plain($data_options['twitter_suffix']);
         break;
     }
 
     // Sanitize the service code for display.
-    $display = check_plain($serviceCodeName);
+    $display = check_plain($service_code_name);
 
     // Put together the span attributes.
     $attributes = array(
-      'st_url' => $mPath,
+      'st_url' => $data_path,
       'st_title' => $title,
       'class' => 'st_' . $display . $type,
     );
-    if ($serviceCodeName == 'twitter') {
+    if ($service_code_name == 'twitter') {
       if (!empty($data_options['twitter_handle'])) {
         $attributes['st_via'] = $data_options['twitter_handle'];
       }
@@ -504,25 +508,25 @@ function sharethis_block_contents() {
     // First get all of the options for the sharethis widget from the database:
     $data_options = sharethis_get_options_array();
     $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
-    $mPath = url($_GET['q'], array('absolute' => TRUE));
-    $mTitle = drupal_get_title();
-    return sharethis_get_button_HTML($data_options, $mPath, $mTitle);
+    $data_path = url($_GET['q'], array('absolute' => TRUE));
+    $data_title = drupal_get_title();
+    return sharethis_get_button_html($data_options, $data_path, $data_title);
   }
 }
 
 /**
- * Implements hook_comment_view.
+ * Implements hook_comment_view().
  */
 function sharethis_comment_view($comment, $view_mode, $langcode) {
   if (variable_get('sharethis_comments', FALSE)) {
     $data_options = sharethis_get_options_array();
     $path = isset($_GET['q']) ? $_GET['q'] : '<front>';
-    $mPath = url($_GET['q'], array(
+    $data_path = url($_GET['q'], array(
       'absolute' => TRUE,
       'fragment' => 'comment-' . $comment->cid,
     ));
-    $mTitle = drupal_get_title();
-    $html = sharethis_get_button_HTML($data_options, $mPath, $mTitle);
+    $data_title = drupal_get_title();
+    $html = sharethis_get_button_html($data_options, $data_path, $data_title);
     $comment->content['sharethis'] = array(
       '#type' => 'html_tag',
       '#value' => $html,
@@ -547,7 +551,7 @@ function sharethis_contextual_links_view_alter(&$element, $items) {
 }
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function sharethis_views_api() {
   return array(
diff --git a/stlib_picker.css b/stlib_picker.css
index 843eb43..4f5a26c 100644
--- a/stlib_picker.css
+++ b/stlib_picker.css
@@ -1,120 +1,105 @@
-.stp_pickerLeft, .stp_pickerArrow, .stp_pickerRight {
-	display:block;
-	float:left;
-	height:254px;
-	width:250px;
-	border:1px solid black;
-	-moz-border-radius: 4px;
-    -webkit-border-radius: 4px;
-    border-radius:4px;
-    overflow:hidden;
-}
-
+.stp_pickerLeft,
+.stp_pickerArrow,
+.stp_pickerRight {
+  display: block;
+  float: left;
+  height: 254px;
+  width: 250px;
+  border: 1px solid black;
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+  border-radius: 4px;
+  overflow: hidden;
+}
 .stp_pickerArrow {
-	width:92px;
-	border:none;
-	margin-top:40px;
+  width: 92px;
+  border: none;
+  margin-top: 40px;
 }
-
-
 .stp_header {
-	display:block;
-	font-size:1.25em;
-	border-bottom:1px solid black;
-	padding:8px;
-	background-color: #115511;
-	color:#115511;
-	
-	background: #eeeeee; 
-    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(90%,#cccccc)); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 );	
-}
-
-.stp_ulLeft, .stp_ulRight  {
-	display:block;
-	overflow-y:scroll;	
-	height:215px;
-	margin:0px !important;
-	padding:0px;
-	list-style:none;
-	background-color: #eeeeee;
-}
-
+  display: block;
+  font-size: 1.25em;
+  border-bottom: 1px solid black;
+  padding: 8px;
+  background-color: #115511;
+  color: #115511;
+  background: #eeeeee;
+  background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 90%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(90%, #cccccc));
+  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);
+}
+.stp_ulLeft,
+.stp_ulRight {
+  display: block;
+  overflow-y: scroll;
+  height: 215px;
+  margin: 0px !important;
+  padding: 0px;
+  list-style: none;
+  background-color: #eeeeee;
+}
 .stp_li {
-	border-bottom:1px solid #ccc;	
-	padding:0px;
-	margin:0px;
-	padding-top:5px;
-	background: #ffffee; 
-	vertical-align:center;
-}
-
+  border-bottom: 1px solid #ccc;
+  padding: 0px;
+  margin: 0px;
+  padding-top: 5px;
+  background: #ffffee;
+  vertical-align: center;
+}
 .stp_li img {
-	display:inline-	block;
-	margin:0px;
-	padding:0px;
-	margin-left:5px;
+  display: inline- block;
+  margin: 0px;
+  padding: 0px;
+  margin-left: 5px;
 }
-
 .stp_liText {
-	display:inline-block;
-	vertical-align:top;
-	margin:0px;
-	padding:5px;
-	margin-left:10px;
-	font-size:1.2em;
-	font-family:sans-serif;
-	overflow:hidden;
-}
-
+  display: inline-block;
+  vertical-align: top;
+  margin: 0px;
+  padding: 5px;
+  margin-left: 10px;
+  font-size: 1.2em;
+  font-family: sans-serif;
+  overflow: hidden;
+}
 .stp_arrow {
-	display:block;
-	height:35px;
-	width:35px;
-	margin:30px;
-	margin-bottom:10px;
-	margin-top:10px;
-	overflow:hidden;
-}
-
+  display: block;
+  height: 35px;
+  width: 35px;
+  margin: 30px;
+  margin-bottom: 10px;
+  margin-top: 10px;
+  overflow: hidden;
+}
 .stp_li:hover {
-	background: #ddddcc; 
+  background: #ddddcc;
 }
-
-.stp_select, .stp_select:hover {
-	background:#ccccbb;
+.stp_select,
+.stp_select:hover {
+  background: #ccccbb;
 }
-
 .stp_up:hover {
-	margin-top:-152px;
+  margin-top: -152px;
 }
-
 .stp_left {
-	margin-top:-37px;
+  margin-top: -37px;
 }
-
 .stp_left:hover {
-	margin-top:-189px;
+  margin-top: -189px;
 }
-
 .stp_right {
-	margin-top:-75px;	
+  margin-top: -75px;
 }
-
 .stp_right:hover {
-	margin-top:-227px;	
+  margin-top: -227px;
 }
-
 .stp_down {
-	margin-top:-114px;	
+  margin-top: -114px;
 }
-
 .stp_down:hover {
-	margin-top:-266px;	
+  margin-top: -266px;
 }
-
 .stp_clear {
-	clear:both;
-	width:500px;
-}
\ No newline at end of file
+  clear: both;
+  width: 500px;
+}
diff --git a/stlib_picker.js b/stlib_picker.js
index d4223e6..fd570cb 100644
--- a/stlib_picker.js
+++ b/stlib_picker.js
@@ -9,111 +9,111 @@ var stlib_picker = {};
 stlib_picker.pickerList = [];
 stlib_picker.defaultServices = ["sharethis", "tumblr", "bebo"];
 stlib_picker.getServices = function (id) {
-	var func = stlib_picker.pickerList[id]["getServices"];
-	return func();
+  var func = stlib_picker.pickerList[id]["getServices"];
+  return func();
 }
 
 //Creates the picker - make sure it has a unique ID
 stlib_picker.setupPicker = function(jQElement, newDefaults, callback) {
-	console.log("setting up picker");
-	console.log(jQElement);
-	//Make an array to store any needed options
-	var optionsArray = [];
-	optionsArray["El"] = jQElement;
-	optionsArray["isSelect"] = false;
-	optionsArray["getServices"] = function() {
-		var answer = [];
-		var lis = jQElement.children(".stp_pickerLeft").find(".stp_li");
-		lis.each(function() {
-			answer.push(jQuery(this).attr("id").substring(6));
-		});
-		return answer;
-	};
-	
-	//Append the three divs that are needed:
-	jQElement.append("<div class='stp_pickerLeft'><span class='stp_header'>Selected Service</span><ul class='stp_ulLeft'></ul></div>");
-	jQElement.append("<div class='stp_pickerArrow'><div class='stp_arrow'><img class='stp_up' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-												  "<div class='stp_arrow'><img class='stp_left' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-												  "<div class='stp_arrow'><img class='stp_right' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-												  "<div class='stp_arrow'><img class='stp_down' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-					"</div>");
-	jQElement.append("<div class='stp_pickerRight'><span class='stp_header'>Possible Services</span><ul class='stp_ulRight'></ul></div>");
-	jQElement.append("<div class='stp_clear'></div>");
-	
-	//Add default Services
-	var pickerDefaults = [];
-	if (newDefaults) {
-		pickerDefaults = newDefaults;
-	} else {
-		pickerDefaults = stlib_picker.defaultServices;
-	}
-	
-	//Add all the services to the picker:
-	jQuery.each(_all_services, function(key, value) {
-		if(jQuery.inArray(key, pickerDefaults) == -1) {
-			var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
-			ul.append("<li id='st_li_" + key + "' class='stp_li'><img src='http://w.sharethis.com/images/"+key+"_32.png'></img><span class='stp_liText'>" + value.title + "</span></li>");
-		}
-	});
-	for(i=0;i<pickerDefaults.length;i++) {
-		var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
-		ul.append("<li id='st_li_" + pickerDefaults[i] + "' class='stp_li'><img src='http://w.sharethis.com/images/"+pickerDefaults[i]+"_32.png'></img><span class='stp_liText'>" + _all_services[pickerDefaults[i]].title + "</span></li>");
-	}
-	
-	//Add the various Event handlers 
-	//Need to make sure that we don't get confused when there are multiple pickers
-	jQElement.find(".stp_li").click(function() {
-		jQElement.find(".stp_select").removeClass("stp_select");
-		jQuery(this).addClass("stp_select");
-		stlib_picker.pickerList[jQElement.attr("id")]["isSelect"] = true;
-	});
-	
-	var arrowDiv = jQElement.children(".stp_pickerArrow").children(".stp_arrow");
-	arrowDiv.children(".stp_up").click(function() {
-		if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-			var li = jQElement.find(".stp_select");
-			var prev = li.prev();
-			if (prev.length != 0) {
-				prev.before(li);
-			}
-			if (callback) {
-				callback();
-			}
-		}
-	});
-	arrowDiv.children(".stp_left").click(function() {
-		if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-			var li = jQElement.find(".stp_select");
-			var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
-			ul.prepend(li);
-			if (callback) {
-				callback();
-			}
-		}
-	});
-	arrowDiv.children(".stp_right").click(function() {
-		if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-			var li = jQElement.find(".stp_select");
-			var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
-			ul.prepend(li);
-			if (callback) {
-				callback();
-			}
-		}
-	});
-	arrowDiv.children(".stp_down").click(function() {
-		if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
-			var li = jQElement.find(".stp_select");
-			var next = li.next();
-			if (next.length != 0) {
-				next.after(li);
-			}
-			if (callback) {
-				callback();
-			}
-		}
-	});
-		
-	//Save the options (and the picker) globally
-	stlib_picker.pickerList[jQElement.attr("id")] = optionsArray;
+  console.log("setting up picker");
+  console.log(jQElement);
+  //Make an array to store any needed options
+  var optionsArray = [];
+  optionsArray["El"] = jQElement;
+  optionsArray["isSelect"] = false;
+  optionsArray["getServices"] = function() {
+    var answer = [];
+    var lis = jQElement.children(".stp_pickerLeft").find(".stp_li");
+    lis.each(function() {
+      answer.push(jQuery(this).attr("id").substring(6));
+    });
+    return answer;
+  };
+
+  //Append the three divs that are needed:
+  jQElement.append("<div class='stp_pickerLeft'><span class='stp_header'>Selected Service</span><ul class='stp_ulLeft'></ul></div>");
+  jQElement.append("<div class='stp_pickerArrow'><div class='stp_arrow'><img class='stp_up' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+                          "<div class='stp_arrow'><img class='stp_left' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+                          "<div class='stp_arrow'><img class='stp_right' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+                          "<div class='stp_arrow'><img class='stp_down' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+          "</div>");
+  jQElement.append("<div class='stp_pickerRight'><span class='stp_header'>Possible Services</span><ul class='stp_ulRight'></ul></div>");
+  jQElement.append("<div class='stp_clear'></div>");
+
+  //Add default Services
+  var pickerDefaults = [];
+  if (newDefaults) {
+    pickerDefaults = newDefaults;
+  } else {
+    pickerDefaults = stlib_picker.defaultServices;
+  }
+
+  //Add all the services to the picker:
+  jQuery.each(_all_services, function(key, value) {
+    if(jQuery.inArray(key, pickerDefaults) == -1) {
+      var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
+      ul.append("<li id='st_li_" + key + "' class='stp_li'><img src='http://w.sharethis.com/images/"+key+"_32.png'></img><span class='stp_liText'>" + value.title + "</span></li>");
+    }
+  });
+  for(i=0;i<pickerDefaults.length;i++) {
+    var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
+    ul.append("<li id='st_li_" + pickerDefaults[i] + "' class='stp_li'><img src='http://w.sharethis.com/images/"+pickerDefaults[i]+"_32.png'></img><span class='stp_liText'>" + _all_services[pickerDefaults[i]].title + "</span></li>");
+  }
+
+  //Add the various Event handlers
+  //Need to make sure that we don't get confused when there are multiple pickers
+  jQElement.find(".stp_li").click(function() {
+    jQElement.find(".stp_select").removeClass("stp_select");
+    jQuery(this).addClass("stp_select");
+    stlib_picker.pickerList[jQElement.attr("id")]["isSelect"] = true;
+  });
+
+  var arrowDiv = jQElement.children(".stp_pickerArrow").children(".stp_arrow");
+  arrowDiv.children(".stp_up").click(function() {
+    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
+      var li = jQElement.find(".stp_select");
+      var prev = li.prev();
+      if (prev.length != 0) {
+        prev.before(li);
+      }
+      if (callback) {
+        callback();
+      }
+    }
+  });
+  arrowDiv.children(".stp_left").click(function() {
+    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
+      var li = jQElement.find(".stp_select");
+      var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
+      ul.prepend(li);
+      if (callback) {
+        callback();
+      }
+    }
+  });
+  arrowDiv.children(".stp_right").click(function() {
+    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
+      var li = jQElement.find(".stp_select");
+      var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
+      ul.prepend(li);
+      if (callback) {
+        callback();
+      }
+    }
+  });
+  arrowDiv.children(".stp_down").click(function() {
+    if (stlib_picker.pickerList[jQElement.attr("id")]["isSelect"]) {
+      var li = jQElement.find(".stp_select");
+      var next = li.next();
+      if (next.length != 0) {
+        next.after(li);
+      }
+      if (callback) {
+        callback();
+      }
+    }
+  });
+
+  //Save the options (and the picker) globally
+  stlib_picker.pickerList[jQElement.attr("id")] = optionsArray;
 }
\ No newline at end of file
diff --git a/views/sharethis.views.inc b/views/sharethis.views.inc
index d602345..8f91753 100644
--- a/views/sharethis.views.inc
+++ b/views/sharethis.views.inc
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_views_data().
+ * Implements hook_views_data().
  */
 function sharethis_views_data() {
   $data = array();
diff --git a/views/sharethis_handler_field_link.inc b/views/sharethis_handler_field_link.inc
index b65faca..706a24c 100644
--- a/views/sharethis_handler_field_link.inc
+++ b/views/sharethis_handler_field_link.inc
@@ -18,10 +18,10 @@ class sharethis_handler_field_link extends views_handler_field_entity {
 
   function render_sharethis_link($entity) {
     global $base_url;
-    $path = $base_url . url('node/'. $entity->nid);
+    $path = $base_url . url('node/' . $entity->nid);
     return sharethis_get_button_HTML(sharethis_get_options_array(), $path, $entity->title);
 
-    /**
+    /*
      * @todo
      * The line below requires theming of the sharethis button HTML as described
      * in http://drupal.org/node/1335836 . Once the theming issue is resolved,
-- 
1.7.9.5


From 9426cc3964e0d359e5de631902fbc1c3628b4fad Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Sun, 14 Oct 2012 22:07:09 +0800
Subject: [PATCH 2/2] Issue #1498768 by hswong3i: Coder cleanup with minor
 warnings + lessc CSS cleanup (Part 2).

---
 ShareThisForm.js |   15 +++++++++++----
 sharethis.module |   21 +++++++++++++++++++--
 stlib_picker.js  |   50 ++++++++++++++++++++++++++++++--------------------
 3 files changed, 60 insertions(+), 26 deletions(-)

diff --git a/ShareThisForm.js b/ShareThisForm.js
index 10ad84c..6449072 100644
--- a/ShareThisForm.js
+++ b/ShareThisForm.js
@@ -12,6 +12,7 @@ var drupal_st = {
   classicW: function() {
     jQuery(".st_widgetPic").removeClass("st_multi");
   },
+
   // These are the handlers for updating the button pic class (stbc = sharethisbuttonclass).
   smallChicklet: function () {
     drupal_st.removeButtonClasses();
@@ -33,6 +34,7 @@ var drupal_st = {
     drupal_st.removeButtonClasses();
     jQuery("#stb_sprite").addClass("stbc_button");
   },
+
   // This is a helper function for updating button pictures.
   removeButtonClasses: function() {
     var toRemove = jQuery("#stb_sprite");
@@ -42,7 +44,8 @@ var drupal_st = {
     toRemove.removeClass("stbc_vcount");
     toRemove.removeClass("stbc_button");
   },
-  //Write helper functions for saving:
+
+  // Write helper functions for saving:
   getWidget: function () {
     return jQuery(".st_widgetPic").hasClass("st_multiW") ? '5x': '4x';
   },
@@ -60,6 +63,7 @@ var drupal_st = {
   setupServiceText: function () {
     jQuery("#edit-sharethis-service-option").css({display:"none"});
   },
+
   // Function to add various events to our html form elements
   addEvents: function() {
     jQuery("#edit-sharethis-widget-option-st-multi").click(drupal_st.multiW);
@@ -73,6 +77,7 @@ var drupal_st = {
 
     jQuery(".st_formButtonSave").click(drupal_st.updateOptions);
   },
+
   serviceCallback: function() {
     var services = stlib_picker.getServices("myPicker");
     var outputString = "";
@@ -84,7 +89,9 @@ var drupal_st = {
     jQuery("#edit-sharethis-service-option").attr("value", outputString);
   }
 };
-//After the page is loaded, we want to add events to dynamically created elements.
+
+// After the page is loaded, we want to add events to dynamically created elements.
 jQuery(document).ready(drupal_st.addEvents);
-//After it's all done, hide the text field for the service picker so that no one messes up the data.
-jQuery(document).ready(drupal_st.setupServiceText);
\ No newline at end of file
+
+// After it's all done, hide the text field for the service picker so that no one messes up the data.
+jQuery(document).ready(drupal_st.setupServiceText);
diff --git a/sharethis.module b/sharethis.module
index 0d3f23f..29d9685 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -50,19 +50,23 @@ function sharethis_permission() {
  * This is the main configuration form for the admin page.
  */
 function sharethis_configuration_form($form, &$form_state) {
+  global $base_url;
+
   // First, setup variables we will need.
   // Get the path variables setup.
   $my_path = drupal_get_path('module', 'sharethis');
+
   // Load the css and js for our module's configuration.
   drupal_add_css($my_path . '/ShareThisForm.css');
+
   // This is ShareThis's common library - has a serviceList of all the objects
   // that are currently supported.
   drupal_add_js('https://ws.sharethis.com/share5x/js/stcommon.js', 'external');
   drupal_add_js($my_path . '/ShareThisForm.js');
   drupal_add_js($my_path . '/stlib_picker.js');
   drupal_add_css($my_path . '/stlib_picker.css');
+
   $current_options_array = sharethis_get_options_array();
-  global $base_url;
 
   // Create the variables related to widget choice.
   $widget_type = $current_options_array['widget'];
@@ -70,8 +74,10 @@ function sharethis_configuration_form($form, &$form_state) {
   if ($widget_type == "st_multi") {
     $widget_markup = "st_multi";
   }
+
   // Create the variables related to button choice.
   $button_choice = check_plain($current_options_array['buttons']);
+
   // Create the variables related to services chosen.
   $service_string = $current_options_array['services'];
   $service_string_markup = "";
@@ -88,11 +94,14 @@ function sharethis_configuration_form($form, &$form_state) {
   foreach ($node_type_array as $k => $v) {
     $node_type_options[$k] = $v->name;
   }
+
   // Figure out which nodeTypes are currently selected
   $nodes_string = $current_options_array['nodeType'];
   $nodes_selected = explode(",", $nodes_string);
+
   // Create the variables for publisher keys.
   $publisher = $current_options_array['publisherID'];
+
   // Create the variables for teasers.
   $teaser = $current_options_array['viewMode'] == "1" ? TRUE : FALSE;
 
@@ -148,9 +157,11 @@ function sharethis_configuration_form($form, &$form_state) {
     ),
     '#default_value' => variable_get('sharethis_option_extras', array()),
   );
+
   $form['additional_settings'] = array(
     '#type' => 'vertical_tabs',
   );
+
   $form['context'] = array(
     '#type' => 'fieldset',
     '#title' => t('Context'),
@@ -197,6 +208,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#options' => drupal_map_assoc(array(-100, -50, -25, -10, 0, 10, 25, 50, 100)),
     '#default_value' => variable_get('sharethis_weight', 10),
   );
+
   $form['advanced'] = array(
     '#type' => 'fieldset',
     '#title' => t('Advanced'),
@@ -227,6 +239,7 @@ function sharethis_configuration_form($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => variable_get('sharethis_twitter_handle', ''),
   );
+
   return system_settings_form($form);
 }
 
@@ -288,6 +301,8 @@ function sharethis_menu() {
  *   Information about the language
  */
 function sharethis_node_view($node, $view_mode, $langcode) {
+  global $base_url;
+
   // Don't display if the user is currently searching, or in the RSS feed.
   switch ($view_mode) {
     case 'search_result':
@@ -306,6 +321,7 @@ function sharethis_node_view($node, $view_mode, $langcode) {
       $is_path = TRUE;
     }
   }
+
   // This will choose the path to use.
   if ($is_path) {
     $path_module = $node->path;
@@ -319,7 +335,6 @@ function sharethis_node_view($node, $view_mode, $langcode) {
     $path_module = '/' . drupal_lookup_path('alias', "node/" . $node->nid);
   }
 
-  global $base_url;
   // Get the full path to insert into the Share Buttons.
   $data_path = $base_url . $path_module;
   $data_title = $node->title;
@@ -435,10 +450,12 @@ function sharethis_get_button_html($data_options, $data_path, $data_title) {
         $attributes['st_via'] = $data_options['twitter_handle'];
       }
     }
+
     // Only show the display text if the type is set.
     if (!empty($type)) {
       $attributes['displaytext'] = check_plain($display);
     }
+
     // Render the span tag.
     $st_spans .= theme('html_tag', array(
       'element' => array(
diff --git a/stlib_picker.js b/stlib_picker.js
index fd570cb..f9318f7 100644
--- a/stlib_picker.js
+++ b/stlib_picker.js
@@ -1,9 +1,18 @@
-//This library requires JQuery
-//It also requires stcommon.js in your header for an official list of services
-//stlib_picker.defaultServices defines the services from stcommon that get loaded as the default services in the picker
-//Styling can be found in stlib_picker.css and should be linked in the page.
-//To get selected services as an array of strings:  (ie ["twitter", "sharethis", "facebook"] )
-//   Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();
+/**
+ * This library requires JQuery.
+ *
+ * It also requires stcommon.js in your header for an official list of services
+ * stlib_picker.defaultServices defines the services from stcommon that get
+ * loaded as the default services in the picker.
+ *
+ * Styling can be found in stlib_picker.css and should be linked in the page.
+ *
+ * To get selected services as an array of strings
+ * (i.e. ["twitter", "sharethis", "facebook"]):
+ * @code
+ *   Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();
+ * @endcode
+ */
 
 var stlib_picker = {};
 stlib_picker.pickerList = [];
@@ -13,11 +22,12 @@ stlib_picker.getServices = function (id) {
   return func();
 }
 
-//Creates the picker - make sure it has a unique ID
+// Creates the picker - make sure it has a unique ID
 stlib_picker.setupPicker = function(jQElement, newDefaults, callback) {
   console.log("setting up picker");
   console.log(jQElement);
-  //Make an array to store any needed options
+
+  // Make an array to store any needed options
   var optionsArray = [];
   optionsArray["El"] = jQElement;
   optionsArray["isSelect"] = false;
@@ -30,17 +40,17 @@ stlib_picker.setupPicker = function(jQElement, newDefaults, callback) {
     return answer;
   };
 
-  //Append the three divs that are needed:
+  // Append the three divs that are needed:
   jQElement.append("<div class='stp_pickerLeft'><span class='stp_header'>Selected Service</span><ul class='stp_ulLeft'></ul></div>");
   jQElement.append("<div class='stp_pickerArrow'><div class='stp_arrow'><img class='stp_up' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                          "<div class='stp_arrow'><img class='stp_left' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                          "<div class='stp_arrow'><img class='stp_right' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-                          "<div class='stp_arrow'><img class='stp_down' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
-          "</div>");
+    "<div class='stp_arrow'><img class='stp_left' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+    "<div class='stp_arrow'><img class='stp_right' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+    "<div class='stp_arrow'><img class='stp_down' src='http://www.sharethis.com/images/Direction_Icons_Sprite.png'></img></div>" +
+    "</div>");
   jQElement.append("<div class='stp_pickerRight'><span class='stp_header'>Possible Services</span><ul class='stp_ulRight'></ul></div>");
   jQElement.append("<div class='stp_clear'></div>");
 
-  //Add default Services
+  // Add default Services
   var pickerDefaults = [];
   if (newDefaults) {
     pickerDefaults = newDefaults;
@@ -48,20 +58,20 @@ stlib_picker.setupPicker = function(jQElement, newDefaults, callback) {
     pickerDefaults = stlib_picker.defaultServices;
   }
 
-  //Add all the services to the picker:
+  // Add all the services to the picker:
   jQuery.each(_all_services, function(key, value) {
     if(jQuery.inArray(key, pickerDefaults) == -1) {
       var ul = jQElement.children(".stp_pickerRight").children(".stp_ulRight");
       ul.append("<li id='st_li_" + key + "' class='stp_li'><img src='http://w.sharethis.com/images/"+key+"_32.png'></img><span class='stp_liText'>" + value.title + "</span></li>");
     }
   });
-  for(i=0;i<pickerDefaults.length;i++) {
+  for(i=0; i < pickerDefaults.length; i++) {
     var ul = jQElement.children(".stp_pickerLeft").children(".stp_ulLeft");
     ul.append("<li id='st_li_" + pickerDefaults[i] + "' class='stp_li'><img src='http://w.sharethis.com/images/"+pickerDefaults[i]+"_32.png'></img><span class='stp_liText'>" + _all_services[pickerDefaults[i]].title + "</span></li>");
   }
 
-  //Add the various Event handlers
-  //Need to make sure that we don't get confused when there are multiple pickers
+  // Add the various Event handlers
+  // Need to make sure that we don't get confused when there are multiple pickers
   jQElement.find(".stp_li").click(function() {
     jQElement.find(".stp_select").removeClass("stp_select");
     jQuery(this).addClass("stp_select");
@@ -114,6 +124,6 @@ stlib_picker.setupPicker = function(jQElement, newDefaults, callback) {
     }
   });
 
-  //Save the options (and the picker) globally
+  // Save the options (and the picker) globally
   stlib_picker.pickerList[jQElement.attr("id")] = optionsArray;
-}
\ No newline at end of file
+}
-- 
1.7.9.5

