diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Facebook/FacebookPlugin.php | 4 | ||||
-rw-r--r-- | plugins/GoogleAnalyticsPlugin.php | 8 | ||||
-rw-r--r-- | plugins/PiwikAnalyticsPlugin.php | 15 | ||||
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 6 | ||||
-rw-r--r-- | plugins/UserFlag/UserFlagPlugin.php | 4 |
5 files changed, 10 insertions, 27 deletions
diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index 047477d9c..40c911cce 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -185,7 +185,6 @@ class FacebookPlugin extends Plugin // XXX: Facebook says we don't need this FB_RequireFeatures(), // but we actually do, for IE and Safari. Gar. - $js = '<script type="text/javascript">'; $js .= ' $(document).ready(function () {'; $js .= ' FB_RequireFeatures('; $js .= ' ["XFBML"], function() {'; @@ -219,7 +218,6 @@ class FacebookPlugin extends Plugin $js .= ' }'; $js .= ' );'; $js .= ' });'; - $js .= '</script>'; $js = sprintf($js, $apikey, $login_url, $logout_url); @@ -227,7 +225,7 @@ class FacebookPlugin extends Plugin $js = str_replace(' ', '', $js); - $action->raw(" $js"); // leading two spaces to make it line up + $action->inlineScript($js); } } diff --git a/plugins/GoogleAnalyticsPlugin.php b/plugins/GoogleAnalyticsPlugin.php index 7f3d209ee..6891ee6a7 100644 --- a/plugins/GoogleAnalyticsPlugin.php +++ b/plugins/GoogleAnalyticsPlugin.php @@ -67,11 +67,7 @@ class GoogleAnalyticsPlugin extends Plugin 'pageTracker._trackPageview();'. '} catch(err) {}', $this->code); - $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw($js1); - $action->elementEnd('script'); - $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw($js2); - $action->elementEnd('script'); + $action->inlineScript($js1); + $action->inlineScript($js2); } } diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php index 54faa0bdb..fefd09867 100644 --- a/plugins/PiwikAnalyticsPlugin.php +++ b/plugins/PiwikAnalyticsPlugin.php @@ -81,25 +81,20 @@ class PiwikAnalyticsPlugin extends Plugin function onEndShowScripts($action) { - $piwikCode = <<<ENDOFPIWIK - -<!-- Piwik --> -<script type="text/javascript"> + $piwikCode1 = <<<ENDOFPIWIK var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$this->piwikroot}" : "http://{$this->piwikroot}"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> +ENDOFPIWIK; + $piwikCode2 = <<<ENDOFPIWIK try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$this->piwikId}); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} -</script> -<!-- End Piwik Tag --> - ENDOFPIWIK; - $action->raw($piwikCode); + $action->inlineScript($piwikCode1); + $action->inlineScript($piwikCode2); return true; } } diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 030df405b..3e33fdaf1 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -105,15 +105,11 @@ class RealtimePlugin extends Plugin $realtimeUI = ' RealtimeUpdate.initActions("'.$url.'", "'.$timeline.'", "'. $pluginPath .'");'; } - $action->elementStart('script', array('type' => 'text/javascript')); - $script = ' $(document).ready(function() { '. $realtimeUI. $this->_updateInitialize($timeline, $user_id). '}); '; - $action->raw($script); - - $action->elementEnd('script'); + $action->inlineScript($script); return true; } diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index e13c2555a..75dcca4fc 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -145,9 +145,7 @@ class UserFlagPlugin extends Plugin function onEndShowScripts($action) { - $action->elementStart('script', array('type' => 'text/javascript')); - $action->raw('/*<![CDATA[*/ if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); } /*]]>*/'); - $action->elementEnd('script'); + $action->inlineScript('if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); }'); return true; } } |