Diff of /trunk/extensions/WeCoWi/WeCoWi.php [r485] .. [r486] Maximize Restore

  Switch to side-by-side view

--- a/trunk/extensions/WeCoWi/WeCoWi.php
+++ b/trunk/extensions/WeCoWi/WeCoWi.php
@@ -18,6 +18,7 @@
 $wgHooks['LanguageGetMagic'][]             = 'wfAddCustomVariableLang';
 $wgHooks['ParserGetVariableValueSwitch'][] = 'wfGetCustomVariable';
 $wgHooks['SkinBuildSidebar'][] = 'SocialSidebar';
+$wgHooks['BeforePageDisplay'][] = 'SocialSidebarScripts';
  
 function wfAddCustomVariable(&$magicWords) {
         foreach($GLOBALS['wgCustomVariables'] as $var) $magicWords[] = "MAG_$var";
@@ -57,21 +58,21 @@
         return true;
         }
 function SocialSidebar ($skin, &$bar ) {
-        $bar['socialsidebar'] = '<ul><li id="twitter"><span class="social">
-			<a href="https://twitter.com/share" class="twitter-share-button" data-via="WeCoWi" data-lang="de">Twittern</a>
-<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div>
-			</span></li>
-			<li id="google"><span class="social">
-			<g:plusone size="small"></g:plusone></span></li>
-			<li id="facebook"><span class="social">
-			<script>(function(d, s, id) {
+        $out .= '<ul><li id="twitter"><span class="social">\n';
+		$out .= '<a href="https://twitter.com/share" class="twitter-share-button" data-via="WeCoWi" data-lang="de">Twittern</a>';	
+        $out .= '</span></li><li id="google"><span class="social"><g:plusone size="small"></g:plusone></span></li>';
+        $out .= '<li id="facebook"><span class="social"><fb:like send="false" layout="button_count" width="60" show_faces="true"></fb:like></span></li></ul>';
+        $bar['Social Networks'] = $out;
+	return true;
+}
+function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) {	
+		$out->addScript( '<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>' );	
+		$out->addScript('<script>(function(d, s, id) {
 					  var js, fjs = d.getElementsByTagName(s)[0];
 					  if (d.getElementById(id)) {return;}
 					  js = d.createElement(s); js.id = id;
 					  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
 					  fjs.parentNode.insertBefore(js, fjs);
-					}(document, "script", "facebook-jssdk"));</script>
-					<fb:like send="false" layout="button_count" width="60" show_faces="true"></fb:like></span></li>
-					</ul>';
-	return true;
+					}(document, "script", "facebook-jssdk"));</script>');
+		$out->addScript( '<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang:de} </script>');
 }