Skip to content

Commit

Permalink
new asset WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Aug 30, 2014
1 parent 936fb71 commit dd4f98e
Show file tree
Hide file tree
Showing 74 changed files with 31 additions and 18,698 deletions.
2 changes: 1 addition & 1 deletion Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function run()
echo Html::beginTag($tag, $options) . "\n";
echo $this->renderItems() . "\n";
echo Html::endTag($tag) . "\n";
$this->registerWidget('accordion', AccordionAsset::className());
$this->registerWidget('accordion');
}

/**
Expand Down
26 changes: 0 additions & 26 deletions AccordionAsset.php

This file was deleted.

2 changes: 1 addition & 1 deletion AutoComplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AutoComplete extends InputWidget
public function run()
{
echo $this->renderWidget();
$this->registerWidget('autocomplete', AutoCompleteAsset::className());
$this->registerWidget('autocomplete');
}

/**
Expand Down
26 changes: 0 additions & 26 deletions AutoCompleteAsset.php

This file was deleted.

3 changes: 1 addition & 2 deletions ButtonAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
*/
class ButtonAsset extends AssetBundle
{
public $sourcePath = '@yii/jui/assets';
public $js = [
'jquery.ui.button.js',
'jquery.ui/ui/button.js',
];
public $depends = [
'yii\jui\CoreAsset',
Expand Down
9 changes: 4 additions & 5 deletions CoreAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
*/
class CoreAsset extends AssetBundle
{
public $sourcePath = '@yii/jui/assets';
public $js = [
'jquery.ui.core.js',
'jquery.ui.widget.js',
'jquery.ui.position.js',
'jquery.ui.mouse.js',
'jquery.ui/ui/core.js',
'jquery.ui/ui/widget.js',
'jquery.ui/ui/position.js',
'jquery.ui/ui/mouse.js',
];
public $depends = [
'yii\web\JqueryAsset',
Expand Down
6 changes: 3 additions & 3 deletions DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ public function run()
$language = $this->language ? $this->language : Yii::$app->language;
if ($language != 'en-US') {
$view = $this->getView();
DatePickerRegionalAsset::register($view);
DatePickerLanguageAsset::register($view);

$options = Json::encode($this->clientOptions);
$view->registerJs("$('#{$containerID}').datepicker($.extend({}, $.datepicker.regional['{$language}'], $options));");

$options = $this->clientOptions;
$this->clientOptions = false; // the datepicker js widget is already registered
$this->registerWidget('datepicker', DatePickerAsset::className(), $containerID);
$this->registerWidget('datepicker', $containerID);
$this->clientOptions = $options;
} else {
$this->registerWidget('datepicker', DatePickerAsset::className(), $containerID);
$this->registerWidget('datepicker', $containerID);
}
}

Expand Down
26 changes: 0 additions & 26 deletions DatePickerAsset.php

This file was deleted.

5 changes: 2 additions & 3 deletions DatePickerRegionalAsset.php → DatePickerLanguageAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class DatePickerRegionalAsset extends AssetBundle
class DatePickerLanguageAsset extends AssetBundle
{
public $sourcePath = '@yii/jui/assets';
public $js = [
'jquery.ui.datepicker-i18n.js',
];
public $depends = [
'yii\jui\DatePickerAsset',
'yii\jui\JuiAsset',
];
}
2 changes: 1 addition & 1 deletion Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public function init()
public function run()
{
echo Html::endTag('div') . "\n";
$this->registerWidget('dialog', DialogAsset::className());
$this->registerWidget('dialog');
}
}
28 changes: 0 additions & 28 deletions DialogAsset.php

This file was deleted.

2 changes: 1 addition & 1 deletion Draggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function init()
public function run()
{
echo Html::endTag('div') . "\n";
$this->registerWidget('draggable', DraggableAsset::className());
$this->registerWidget('draggable');
}
}
25 changes: 0 additions & 25 deletions DraggableAsset.php

This file was deleted.

2 changes: 1 addition & 1 deletion Droppable.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function init()
public function run()
{
echo Html::endTag('div') . "\n";
$this->registerWidget('droppable', DroppableAsset::className());
$this->registerWidget('droppable');
}
}
25 changes: 0 additions & 25 deletions DroppableAsset.php

This file was deleted.

8 changes: 5 additions & 3 deletions EffectAsset.php → JuiAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class EffectAsset extends AssetBundle
class JuiAsset extends AssetBundle
{
public $sourcePath = '@yii/jui/assets';
public $js = [
'jquery.ui.effect-all.js',
'jquery-ui/jquery-ui.js',
];
public $css = [
'jquery-ui/themes/smoothness/jquery-ui.css',
];
public $depends = [
'yii\web\JqueryAsset',
Expand Down
5 changes: 1 addition & 4 deletions Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ public function run()
parent::run();

$view = $this->getView();
MenuAsset::register($view);
/* @var $themeAsset \yii\web\AssetBundle */
$themeAsset = Widget::$theme;
$themeAsset::register($view);
JuiAsset::register($view);

$id = $this->options['id'];
if ($this->clientOptions !== false) {
Expand Down
25 changes: 0 additions & 25 deletions MenuAsset.php

This file was deleted.

2 changes: 1 addition & 1 deletion ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public function init()
public function run()
{
echo Html::endTag('div') . "\n";
$this->registerWidget('progressbar', ProgressBarAsset::className());
$this->registerWidget('progressbar');
}
}
25 changes: 0 additions & 25 deletions ProgressBarAsset.php

This file was deleted.

2 changes: 1 addition & 1 deletion Resizable.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public function init()
public function run()
{
echo Html::endTag('div') . "\n";
$this->registerWidget('resizable', ResizableAsset::className());
$this->registerWidget('resizable');
}
}
25 changes: 0 additions & 25 deletions ResizableAsset.php

This file was deleted.

0 comments on commit dd4f98e

Please sign in to comment.