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


PHP Gdn_Controller::addJsFile方法代码示例

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


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

示例1: attachButtonBarResources

 /**
  * Insert buttonbar resources
  *
  * This method is abstracted because it is invoked by multiple controllers.
  *
  * @param Gdn_Controller $Sender
  */
 protected function attachButtonBarResources($Sender, $Formatter)
 {
     if (!in_array($Formatter, $this->Formats)) {
         return;
     }
     $Sender->addJsFile('buttonbar.js', 'plugins/ButtonBar');
     $Sender->addJsFile('jquery.hotkeys.js', 'plugins/ButtonBar');
     $Sender->addDefinition('ButtonBarLinkUrl', t('ButtonBar.LinkUrlText', 'Enter your URL:'));
     $Sender->addDefinition('ButtonBarImageUrl', t('ButtonBar.ImageUrlText', 'Enter image URL:'));
     $Sender->addDefinition('ButtonBarBBCodeHelpText', t('ButtonBar.BBCodeHelp', 'You can use <b><a href="http://en.wikipedia.org/wiki/BBCode" target="_new">BBCode</a></b> in your post.'));
     $Sender->addDefinition('ButtonBarHtmlHelpText', t('ButtonBar.HtmlHelp', 'You can use <b><a href="http://htmlguide.drgrog.com/cheatsheet.php" target="_new">Simple Html</a></b> in your post.'));
     $Sender->addDefinition('ButtonBarMarkdownHelpText', t('ButtonBar.MarkdownHelp', 'You can use <b><a href="http://en.wikipedia.org/wiki/Markdown" target="_new">Markdown</a></b> in your post.'));
     $Sender->addDefinition('InputFormat', $Formatter);
 }
开发者ID:adlerj,项目名称:vanilla,代码行数:21,代码来源:class.buttonbar.plugin.php

示例2: base_render_before

 /**
  * Add Timeago to all controllers
  *
  * @since  2.0.0
  * @access public
  * @param  Gdn_Controller $sender
  */
 public function base_render_before($sender)
 {
     // Plugin definitions for use in Javascript
     $definitions = array('locale' => array('prefixAgo' => t('timeago.prefixAgo', null), 'prefixFromNow' => t('timeago.prefixFromNow', null), 'suffixAgo' => t('timeago.suffixAgo', 'ago'), 'suffixFromNow' => t('timeago.suffixFromNow', 'from now'), 'seconds' => t('timeago.seconds', 'less than a minute'), 'minute' => t('timeago.minute', 'about a minute'), 'minutes' => t('timeago.minutes', '%d minutes'), 'hour' => t('timeago.hour', 'about an hour'), 'hours' => t('timeago.hours', 'about %d hours'), 'day' => t('timeago.day', 'a day'), 'days' => t('timeago.days', '%d days'), 'month' => t('timeago.month', 'about a month'), 'months' => t('timeago.months', '%d months'), 'year' => t('timeago.year', 'about a year'), 'years' => t('timeago.years', '%d years'), 'wordSeparator' => t('timeago.wordSeparator', ' '), 'numbers' => array()));
     $sender->addDefinition('Timeago', json_encode($definitions));
     // Add required assets
     $sender->addJsFile('timeago.min.js', 'plugins/timeago');
 }
开发者ID:Nordic-T,项目名称:vanilla-plugins,代码行数:15,代码来源:class.timeago.plugin.php

示例3: homeController_homepage_create

 /**
  * Homepage of VanillaForums.org.
  *
  * @param Gdn_Controller $sender
  */
 public function homeController_homepage_create($sender)
 {
     try {
         $AddonModel = new AddonModel();
         $Addon = $AddonModel->getSlug('vanilla-core', true);
         $sender->setData('CountDownloads', val('CountDownloads', $Addon));
         $sender->setData('Version', val('Version', $Addon));
         $sender->setData('DateUploaded', val('DateInserted', $Addon));
     } catch (Exception $ex) {
     }
     $sender->title('The most powerful custom community solution in the world');
     $sender->setData('Description', "Vanilla is forum software that powers discussions on hundreds of thousands of sites. Built for flexibility and integration, Vanilla is the best, most powerful community solution in the world.");
     $sender->Head->addTag('meta', array('name' => 'description', 'content' => $sender->data('Description')));
     $sender->clearJsFiles();
     $sender->addJsFile('jquery.js', 'vforg');
     $sender->addJsFile('easySlider1.7.js', 'vforg');
     saveToConfig('Garden.Embed.Allow', false, false);
     // Prevent JS errors
     $sender->clearCssFiles();
     $sender->addCssFile('vforg-home.css', 'vforg');
     $sender->MasterView = 'empty';
     $sender->render('index', 'home', 'vforg');
 }
开发者ID:vanilla,项目名称:community,代码行数:28,代码来源:class.hooks.php

示例4: addPasswordStrength

 /**
  * Set password strength meter on a form.
  *
  * @param Gdn_Controller $Controller The controller to add the password strength information to.
  */
 public function addPasswordStrength($Controller)
 {
     $Controller->addJsFile('password.js');
     $Controller->addDefinition('MinPassLength', c('Garden.Registration.MinPasswordLength'));
     $Controller->addDefinition('PasswordTranslations', implode(',', [t('Password Too Short', 'Too Short'), t('Password Contains Username', 'Contains Username'), t('Password Very Weak', 'Very Weak'), t('Password Weak', 'Weak'), t('Password Ok', 'OK'), t('Password Good', 'Good'), t('Password Strong', 'Strong')]));
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:11,代码来源:class.usermodel.php

示例5: base_render_before

 /**
  * Adds 'Discussion' item to menu.
  *
  * 'base_render_before' will trigger before every pageload across apps.
  * If you abuse this hook, Tim will throw a Coke can at your head.
  *
  * @since 2.0.0
  * @package Vanilla
  *
  * @param Gdn_Controller $sender The sending controller object.
  */
 public function base_render_before($sender)
 {
     if ($sender->Menu) {
         $sender->Menu->addLink('Discussions', t('Discussions'), '/discussions', false, ['Standard' => true]);
     }
     if (!inSection('Dashboard')) {
         // Spoilers assets
         $sender->addJsFile('spoilers.js', 'vanilla');
         $sender->addCssFile('spoilers.css', 'vanilla');
         $sender->addDefinition('Spoiler', t('Spoiler'));
         $sender->addDefinition('show', t('show'));
         $sender->addDefinition('hide', t('hide'));
     }
     // Add user's viewable roles to gdn.meta if user is logged in.
     if (!$sender->addDefinition('Roles')) {
         if (Gdn::session()->isValid()) {
             $roleModel = new RoleModel();
             Gdn::controller()->addDefinition("Roles", $roleModel->getPublicUserRoles(Gdn::session()->UserID, "Name"));
         }
     }
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:32,代码来源:class.hooks.php

示例6: addJsFiles

 /**
  * Add Javascript files required for autocomplete / username token.
  *
  * @param Gdn_Controller $Sender
  */
 protected function addJsFiles($Sender)
 {
     $Sender->addJsFile('jquery.tokeninput.js');
     $Sender->addJsFile('authorselector.js', 'plugins/AuthorSelector');
 }
开发者ID:vanilla,项目名称:addons,代码行数:10,代码来源:class.authorselector.plugin.php


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