]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use script() to write out javascript <script> tags
authorCraig Andrews <candrews@integralblue.com>
Thu, 6 Aug 2009 00:15:00 +0000 (20:15 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 6 Aug 2009 00:15:00 +0000 (20:15 -0400)
plugins/FBConnect/FBC_XDReceiver.php
plugins/FBConnect/FBConnectPlugin.php
plugins/Realtime/RealtimePlugin.php

index d9677fca7b4b2531c852fb14f78fd132205cfa8f..19251cca4d0dd6b74897bacf80d7e40b6fdedbe6 100644 (file)
@@ -56,10 +56,7 @@ class FBC_XDReceiverAction extends Action
                                           'lang' => $language));
         $this->elementStart('head');
         $this->element('title', null, 'cross domain receiver page');
-        $this->element('script',
-            array('src' =>
-                'http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js',
-                'type' => 'text/javascript'), '');
+        $this->script('http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js');
         $this->elementEnd('head');
         $this->elementStart('body');
         $this->elementEnd('body');
index 2fb10a6758bf40fe513a91eaa413a34d695ff599..9aa96c59d716ba03af0ba2bccacc3419355095b0 100644 (file)
@@ -144,11 +144,7 @@ class FBConnectPlugin extends Plugin
     function onEndShowFooter($action)
     {
         if ($this->reqFbScripts($action)) {
-
-            $action->element('script',
-                array('type' => 'text/javascript',
-                      'src'  => 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php'),
-                      '');
+            $action->script('http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php');
         }
     }
 
index 507f0194d7a3c726eb05112f8272b23e435b4da8..75bb8a91e9250a58132bdf40bda40e10d80151ef 100644 (file)
@@ -84,9 +84,7 @@ class RealtimePlugin extends Plugin
         $scripts = $this->_getScripts();
 
         foreach ($scripts as $script) {
-            $action->element('script', array('type' => 'text/javascript',
-                                             'src' => $script),
-                         ' ');
+            $action->script($script);
         }
 
         $user = common_current_user();
@@ -201,8 +199,8 @@ class RealtimePlugin extends Plugin
 
     function _getScripts()
     {
-        return array(common_path('plugins/Realtime/realtimeupdate.js'),
-                     common_path('plugins/Realtime/json2.js'));
+        return array('plugins/Realtime/realtimeupdate.js',
+                     'plugins/Realtime/json2.js');
     }
 
     function _updateInitialize($timeline, $user_id)