Commit d9a31fea by Crisu83

upgraded bootstrap.js to 2.1.0-wip and update the demo

parent a45375e3
...@@ -9,23 +9,23 @@ ...@@ -9,23 +9,23 @@
/** /**
* Bootstrap application component. * Bootstrap application component.
* Used for registering Bootstrap core functionality.
*/ */
class Bootstrap extends CApplicationComponent class Bootstrap extends CApplicationComponent
{ {
// Bootstrap plugins. // Bootstrap plugins.
const PLUGIN_ALERT = 'alert'; const PLUGIN_ALERT = 'alert';
const PLUGIN_BUTTON = 'button'; const PLUGIN_BUTTON = 'button';
const PLUGIN_CAROUSEL = 'carousel'; const PLUGIN_CAROUSEL = 'carousel';
const PLUGIN_COLLAPSE = 'collapse'; const PLUGIN_COLLAPSE = 'collapse';
const PLUGIN_DROPDOWN = 'dropdown'; const PLUGIN_DROPDOWN = 'dropdown';
const PLUGIN_MODAL = 'modal'; const PLUGIN_MODAL = 'modal';
const PLUGIN_POPOVER = 'popover'; const PLUGIN_POPOVER = 'popover';
const PLUGIN_SCROLLSPY = 'scrollspy'; const PLUGIN_SCROLLSPY = 'scrollspy';
const PLUGIN_TAB = 'tab'; const PLUGIN_TAB = 'tab';
const PLUGIN_TOOLTIP = 'tooltip'; const PLUGIN_TOOLTIP = 'tooltip';
const PLUGIN_TRANSITION = 'transition'; const PLUGIN_TRANSITION = 'transition';
const PLUGIN_TYPEAHEAD = 'typeahead'; const PLUGIN_TYPEAHEAD = 'typeahead';
// todo: add the affix plugin in version 2.1.0
/** /**
* @var boolean whether to register the Bootstrap core CSS (bootstrap.min.css). * @var boolean whether to register the Bootstrap core CSS (bootstrap.min.css).
...@@ -80,16 +80,16 @@ class Bootstrap extends CApplicationComponent ...@@ -80,16 +80,16 @@ class Bootstrap extends CApplicationComponent
if (Yii::app() instanceof CConsoleApplication) if (Yii::app() instanceof CConsoleApplication)
return; return;
if ($this->coreCss) if ($this->coreCss !== false)
$this->registerCss(); $this->registerCoreCss();
if ($this->responsiveCss) if ($this->responsiveCss !== false)
$this->registerResponsiveCss(); $this->registerResponsiveCss();
if ($this->yiiCss) if ($this->yiiCss !== false)
$this->registerYiiCss(); $this->registerYiiCss();
if ($this->enableJS) if ($this->enableJS !== false)
$this->registerCoreScripts(); $this->registerCoreScripts();
parent::init(); parent::init();
...@@ -98,7 +98,7 @@ class Bootstrap extends CApplicationComponent ...@@ -98,7 +98,7 @@ class Bootstrap extends CApplicationComponent
/** /**
* Registers the Bootstrap CSS. * Registers the Bootstrap CSS.
*/ */
public function registerCss() public function registerCoreCss()
{ {
Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap.css'); Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap.css');
} }
...@@ -130,7 +130,7 @@ class Bootstrap extends CApplicationComponent ...@@ -130,7 +130,7 @@ class Bootstrap extends CApplicationComponent
*/ */
public function registerCoreScripts() public function registerCoreScripts()
{ {
$this->registerJS(); $this->registerJS(Yii::app()->clientScript->coreScriptPosition);
$this->registerTooltip(); $this->registerTooltip();
$this->registerPopover(); $this->registerPopover();
} }
...@@ -145,7 +145,7 @@ class Bootstrap extends CApplicationComponent ...@@ -145,7 +145,7 @@ class Bootstrap extends CApplicationComponent
/** @var CClientScript $cs */ /** @var CClientScript $cs */
$cs = Yii::app()->getClientScript(); $cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery'); $cs->registerCoreScript('jquery');
$cs->registerScriptFile($this->getAssetsUrl().'/js/bootstrap.min.js', $position); $cs->registerScriptFile($this->getAssetsUrl().'/js/bootstrap.js', $position);
} }
/** /**
...@@ -331,7 +331,7 @@ class Bootstrap extends CApplicationComponent ...@@ -331,7 +331,7 @@ class Bootstrap extends CApplicationComponent
} }
/** /**
* Returns the version number. * Returns the extension version number.
* @return string the version * @return string the version
*/ */
public function getVersion() public function getVersion()
......
...@@ -86,12 +86,10 @@ class SiteController extends Controller ...@@ -86,12 +86,10 @@ class SiteController extends Controller
); );
$rawData = array(); $rawData = array();
for ($i = 0; $i < 100; $i++) for ($i = 0; $i < 8; $i++)
$rawData[] = array('id'=>$i + 1); $rawData[] = array('id'=>$i + 1);
$listDataProvider = new CArrayDataProvider($rawData, array( $listDataProvider = new CArrayDataProvider($rawData);
'pagination'=>array('pageSize'=>8),
));
$phpLighter = new CTextHighlighter(); $phpLighter = new CTextHighlighter();
$phpLighter->language = 'PHP'; $phpLighter->language = 'PHP';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment