当前位置: 首页>>代码示例>>PHP>>正文


PHP Action::script方法代码示例

本文整理汇总了PHP中Action::script方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::script方法的具体用法?PHP Action::script怎么用?PHP Action::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Action的用法示例。


在下文中一共展示了Action::script方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onEndShowScripts

 function onEndShowScripts(Action $action)
 {
     $action->inlineScript('var infinite_scroll_on_next_only = ' . ($this->on_next_only ? 'true' : 'false') . ';');
     $action->inlineScript('var ajax_loader_url = "' . $this->path('ajax-loader.gif') . '";');
     $action->script($this->path('jquery.infinitescroll.js'));
     $action->script($this->path('infinitescroll.js'));
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:7,代码来源:InfiniteScrollPlugin.php

示例2: onEndShowScripts

 function onEndShowScripts(Action $action)
 {
     if ($this->isSocial()) {
         $action->script($this->path('js/jquery.details.min.js'));
         $action->script($this->path('js/ol.js'));
         $action->script($this->path('js/chartist.min.js'));
         $action->script($this->path('js/sa.js'));
     }
     return true;
 }
开发者ID:Quix0r,项目名称:gs-socialAnalytics,代码行数:10,代码来源:SocialAnalyticsPlugin.php

示例3: onEndShowScripts

 /**
  * Load JS at runtime if we're logged in.
  *
  * @param Action $action
  * @return boolean hook result
  */
 function onEndShowScripts($action)
 {
     $user = common_current_user();
     if ($user) {
         $action->script($this->path('modplus.js'));
     }
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:14,代码来源:ModPlusPlugin.php

示例4: onEndShowStatusNetScripts

 /**
  * Link in a JavaScript script for the whitelist invite form
  *
  * @param Action $action Action being shown
  *
  * @return boolean hook flag
  */
 function onEndShowStatusNetScripts($action)
 {
     $name = $action->arg('action');
     if ($name == 'invite') {
         $action->script($this->getPath() . '/js/whitelistinvite.js');
     }
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:15,代码来源:DomainWhitelistPlugin.php

示例5: onEndShowScripts

 /**
  * Load JS at runtime if we're logged in.
  *
  * @param Action $action
  * @return boolean hook result
  */
 function onEndShowScripts($action)
 {
     $user = common_current_user();
     if ($user && common_config('attachments', 'process_links')) {
         $action->script($this->path('linkpreview.min.js'));
         $data = json_encode(array('api' => common_local_url('oembedproxy'), 'width' => common_config('attachments', 'thumbwidth'), 'height' => common_config('attachments', 'thumbheight')));
         $action->inlineScript('$(function() {SN.Init.LinkPreview && SN.Init.LinkPreview(' . $data . ');})');
     }
     return true;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:16,代码来源:LinkPreviewPlugin.php

示例6: onEndShowScripts

 /**
  * Hook for adding extra JavaScript
  *
  * This makes sure our scripts get loaded for map-related pages
  *
  * @param Action $action Action object for the page
  *
  * @return boolean event handler return
  */
 function onEndShowScripts($action)
 {
     $actionName = $action->trimmed('action');
     if (!in_array($actionName, array('showstream', 'all', 'usermap', 'allmap'))) {
         return true;
     }
     switch ($this->provider) {
         case 'cloudmade':
             $action->script('http://tile.cloudmade.com/wml/0.2/web-maps-lite.js');
             break;
         case 'google':
             $action->script(sprintf('http://maps.google.com/maps?file=api&v=2&sensor=false&key=%s', urlencode($this->apikey)));
             break;
         case 'microsoft':
             $action->script((GNUsocial::isHTTPS() ? 'https' : 'http') + '://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6');
             break;
         case 'openlayers':
             // Use our included stripped & minified OpenLayers.
             $action->script($this->path('OpenLayers/OpenLayers.js'));
             break;
         case 'yahoo':
             $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', urlencode($this->apikey)));
             break;
         case 'geocommons':
             // don't support this yet
         // don't support this yet
         default:
             return true;
     }
     $action->script(sprintf('%s?(%s)', $this->path('js/mxn.js'), $this->provider));
     $action->script($this->path('usermap.js'));
     $action->inlineScript(sprintf('var _provider = "%s";', $this->provider));
     // usermap and allmap handle this themselves
     if (in_array($actionName, array('showstream', 'all'))) {
         $action->inlineScript('$(document).ready(function() { ' . ' var user = null; ' . ($actionName == 'showstream' ? ' user = scrapeUser(); ' : '') . ' var notices = scrapeNotices(user); ' . ' var canvas = $("#map_canvas")[0]; ' . ' if (typeof(canvas) != "undefined") { showMapstraction(canvas, notices); } ' . '});');
     }
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:47,代码来源:MapstractionPlugin.php

示例7: showAdsenseCode

 /**
  * Output the bits of JavaScript code to show Adsense
  *
  * @param Action  $action Action being shown
  * @param integer $width  Width of the block
  * @param integer $height Height of the block
  * @param string  $slot   Slot identifier
  *
  * @return void
  */
 protected function showAdsenseCode($action, $width, $height, $slot)
 {
     $code = 'google_ad_client = "' . $this->client . '"; ';
     $code .= 'google_ad_slot = "' . $slot . '"; ';
     $code .= 'google_ad_width = ' . $width . '; ';
     $code .= 'google_ad_height = ' . $height . '; ';
     $action->inlineScript($code);
     $action->script($this->adScript);
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:19,代码来源:AdsensePlugin.php

示例8: onEndShowScripts

 /**
  * adds javascript to do same thing on input textarea
  *
  * @param Action $action
  */
 function onEndShowScripts($action)
 {
     if (common_logged_in()) {
         $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js');
     }
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:11,代码来源:DirectionDetectorPlugin.php

示例9: onEndShowScripts

 /**
  * Load JS at runtime.
  *
  * @param Action $action
  * @return boolean hook result
  */
 function onEndShowScripts(Action $action)
 {
     $action->script($this->path('js/modplus.js'));
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:11,代码来源:ModPlusPlugin.php

示例10: onEndShowScripts

 /**
  * adds javascript to do same thing on input textarea
  *
  * @param Action $action
  */
 function onEndShowScripts($action)
 {
     if (common_logged_in()) {
         $action->script($this->path('jquery.DirectionDetector.js'));
     }
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:11,代码来源:DirectionDetectorPlugin.php

示例11: onEndShowScripts

 /**
  * Hook for adding extra JavaScript
  *
  * This makes sure our scripts get loaded for map-related pages
  *
  * @param Action $action Action object for the page
  *
  * @return boolean event handler return
  */
 function onEndShowScripts($action)
 {
     $actionName = $action->trimmed('action');
     if (!in_array($actionName, array('showstream', 'all', 'usermap', 'allmap'))) {
         return true;
     }
     switch ($this->provider) {
         case 'cloudmade':
             $action->script('http://tile.cloudmade.com/wml/0.2/web-maps-lite.js');
             break;
         case 'google':
             $action->script(sprintf('http://maps.google.com/maps?file=api&v=2&sensor=false&key=%s', urlencode($this->apikey)));
             break;
         case 'microsoft':
             $action->script('http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6');
             break;
         case 'openlayers':
             // XXX: is this not nice...?
             $action->script('http://openlayers.org/api/OpenLayers.js');
             break;
         case 'yahoo':
             $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', urlencode($this->apikey)));
             break;
         case 'geocommons':
             // don't support this yet
         // don't support this yet
         default:
             return true;
     }
     $action->script(sprintf('%s?(%s)', common_path('plugins/Mapstraction/js/mxn.js'), $this->provider));
     $action->script(common_path('plugins/Mapstraction/usermap.js'));
     $action->inlineScript(sprintf('var _provider = "%s";', $this->provider));
     // usermap and allmap handle this themselves
     if (in_array($actionName, array('showstream', 'all'))) {
         $action->inlineScript('$(document).ready(function() { ' . ' var user = null; ' . ($actionName == 'showstream' ? ' user = scrapeUser(); ' : '') . ' var notices = scrapeNotices(user); ' . ' showMapstraction($("#map_canvas"), notices); ' . '});');
     }
     return true;
 }
开发者ID:Br3nda,项目名称:StatusNet,代码行数:47,代码来源:MapstractionPlugin.php


注:本文中的Action::script方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。