Browse Source

Bundle names fixes, base widget fixes, other widgets fixes

tags/2.0.0-beta
Alexander Kochetov 12 years ago
parent
commit
b1460fe558
  1. 1
      yii/bootstrap/Alert.php
  2. 1
      yii/bootstrap/Modal.php
  3. 1
      yii/bootstrap/TypeAhead.php
  4. 11
      yii/bootstrap/Widget.php
  5. 39
      yii/bootstrap/assets.php
  6. 2280
      yii/bootstrap/assets/js/bootstrap.js
  7. 6
      yii/bootstrap/assets/js/bootstrap.min.js

1
yii/bootstrap/Alert.php

@ -77,6 +77,7 @@ class Alert extends Widget
{ {
parent::init(); parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/alert');
$this->initOptions(); $this->initOptions();
echo Html::beginTag('div', $this->options) . "\n"; echo Html::beginTag('div', $this->options) . "\n";

1
yii/bootstrap/Modal.php

@ -102,6 +102,7 @@ class Modal extends Widget
{ {
parent::init(); parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/modal');
$this->initOptions(); $this->initOptions();
echo $this->renderToggleButton() . "\n"; echo $this->renderToggleButton() . "\n";

1
yii/bootstrap/TypeAhead.php

@ -68,6 +68,7 @@ class TypeAhead extends Widget
*/ */
public function run() public function run()
{ {
$this->getView()->registerAssetBundle('yii/bootstrap/typeahead');
echo $this->renderField(); echo $this->renderField();
$this->registerPlugin('typeahead'); $this->registerPlugin('typeahead');
} }

11
yii/bootstrap/Widget.php

@ -25,7 +25,10 @@ class Widget extends \yii\base\Widget
* @var boolean whether to use the responsive version of Bootstrap. * @var boolean whether to use the responsive version of Bootstrap.
*/ */
public static $responsive = true; public static $responsive = true;
/**
* @var boolean whether to use the transition effects.
*/
public static $transition = true;
/** /**
* @var array the HTML attributes for the widget container tag. * @var array the HTML attributes for the widget container tag.
*/ */
@ -67,9 +70,11 @@ class Widget extends \yii\base\Widget
{ {
$id = $this->options['id']; $id = $this->options['id'];
$view = $this->getView(); $view = $this->getView();
$view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap');
$bundle = static::$responsive ? 'yii/bootstrap-responsive' : 'yii/bootstrap'; if (static::$transition) {
$view->registerAssetBundle($bundle); $view->registerAssetBundle('yii/bootstrap/transition');
}
if ($this->pluginOptions !== false) { if ($this->pluginOptions !== false) {
$options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions); $options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions);

39
yii/bootstrap/assets.php

@ -1,115 +1,108 @@
<?php <?php
return array( return array(
'yii/bootstrap/css' => array( 'yii/bootstrap' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'css' => array( 'css' => array(
YII_DEBUG ? 'css/bootstrap.css' : 'css/bootstrap.min.css', YII_DEBUG ? 'css/bootstrap.css' : 'css/bootstrap.min.css',
), ),
), ),
'yii/bootstrap/css-responsive' => array( 'yii/bootstrap/responsive' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'css' => array( 'css' => array(
YII_DEBUG ? 'css/bootstrap-responsive.css' : 'css/bootstrap-responsive.min.css', YII_DEBUG ? 'css/bootstrap-responsive.css' : 'css/bootstrap-responsive.min.css',
), ),
'depends' => array('yii/bootstrap/css'), 'depends' => array('yii/bootstrap'),
),
'yii/bootstrap/all' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
YII_DEBUG ? 'js/bootstrap.js' : 'js/bootstrap.min.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
), ),
'yii/bootstrap/affix' => array( 'yii/bootstrap/affix' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-affix.js', 'js/bootstrap-affix.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/alert' => array( 'yii/bootstrap/alert' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-alert.js', 'js/bootstrap-alert.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/button' => array( 'yii/bootstrap/button' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-button.js', 'js/bootstrap-button.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/carousel' => array( 'yii/bootstrap/carousel' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-carousel.js', 'js/bootstrap-carousel.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/collapse' => array( 'yii/bootstrap/collapse' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-collapse.js', 'js/bootstrap-collapse.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/dropdown' => array( 'yii/bootstrap/dropdown' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-dropdown.js', 'js/bootstrap-dropdown.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/modal' => array( 'yii/bootstrap/modal' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-modal.js', 'js/bootstrap-modal.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/popover' => array( 'yii/bootstrap/popover' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-popover.js', 'js/bootstrap-popover.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/tooltip', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap/tooltip', 'yii/bootstrap'),
), ),
'yii/bootstrap/scrollspy' => array( 'yii/bootstrap/scrollspy' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-scrollspy.js', 'js/bootstrap-scrollspy.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/tab' => array( 'yii/bootstrap/tab' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-tab.js', 'js/bootstrap-tab.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/tooltip' => array( 'yii/bootstrap/tooltip' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-tooltip.js', 'js/bootstrap-tooltip.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/transition' => array( 'yii/bootstrap/transition' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-transition.js', 'js/bootstrap-transition.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
'yii/bootstrap/typeahead' => array( 'yii/bootstrap/typeahead' => array(
'sourcePath' => __DIR__ . '/assets', 'sourcePath' => __DIR__ . '/assets',
'js' => array( 'js' => array(
'js/bootstrap-typeahead.js', 'js/bootstrap-typeahead.js',
), ),
'depends' => array('yii/jquery', 'yii/bootstrap/css'), 'depends' => array('yii/jquery', 'yii/bootstrap'),
), ),
); );

2280
yii/bootstrap/assets/js/bootstrap.js vendored

File diff suppressed because it is too large Load Diff

6
yii/bootstrap/assets/js/bootstrap.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save