Commit 6c66c02eb1bb9ffff1bc64c33884fc8883573036
1 parent
07a62660
big commti
Showing
7 changed files
with
49 additions
and
59 deletions
Show diff stats
frontend/assets/AppAsset.php
| @@ -23,8 +23,7 @@ class AppAsset extends AssetBundle | @@ -23,8 +23,7 @@ class AppAsset extends AssetBundle | ||
| 23 | 'http://fonts.googleapis.com/css?family=Roboto:400,300,700&subset=latin,cyrillic-ext', | 23 | 'http://fonts.googleapis.com/css?family=Roboto:400,300,700&subset=latin,cyrillic-ext', |
| 24 | ]; | 24 | ]; |
| 25 | public $js = [ | 25 | public $js = [ |
| 26 | - //'js/js_head.js', | ||
| 27 | - //'js/js_footer.js', | 26 | + |
| 28 | '/js/artbox_basket.js', | 27 | '/js/artbox_basket.js', |
| 29 | 'js/script.js', | 28 | 'js/script.js', |
| 30 | 'js/new_script.js', | 29 | 'js/new_script.js', |
frontend/assets/FlipclockAsset.php
| @@ -23,6 +23,7 @@ class FlipclockAsset extends AssetBundle | @@ -23,6 +23,7 @@ class FlipclockAsset extends AssetBundle | ||
| 23 | 'flipclock/compiled/flipclock.min.js' | 23 | 'flipclock/compiled/flipclock.min.js' |
| 24 | ]; | 24 | ]; |
| 25 | public $jsOptions = array( | 25 | public $jsOptions = array( |
| 26 | - 'position' => \yii\web\View::POS_END | 26 | + 'position' => \yii\web\View::POS_END, |
| 27 | + 'depends' => ['yii\web\JqueryAsset'] | ||
| 27 | ); | 28 | ); |
| 28 | } | 29 | } |
frontend/config/main.php
| @@ -19,7 +19,13 @@ return [ | @@ -19,7 +19,13 @@ return [ | ||
| 19 | 19 | ||
| 20 | ], | 20 | ], |
| 21 | 'components' => [ | 21 | 'components' => [ |
| 22 | - | 22 | + 'assetManager' => [ |
| 23 | + 'bundles' => [ | ||
| 24 | + 'yii\web\JqueryAsset' =>[ | ||
| 25 | + 'jsOptions' => ['position' => \yii\web\View::POS_END] | ||
| 26 | + ] | ||
| 27 | + ], | ||
| 28 | + ], | ||
| 23 | 'authManager' => [ | 29 | 'authManager' => [ |
| 24 | 'class' => 'yii\rbac\DbManager', | 30 | 'class' => 'yii\rbac\DbManager', |
| 25 | ], | 31 | ], |
frontend/views/catalog/product.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * @var $product Product | 3 | * @var $product Product |
| 4 | + * @var $this View | ||
| 4 | */ | 5 | */ |
| 5 | use common\components\artboximage\ArtboxImageHelper; | 6 | use common\components\artboximage\ArtboxImageHelper; |
| 6 | use common\models\Orders; | 7 | use common\models\Orders; |
| @@ -11,6 +12,7 @@ use frontend\assets\FotoramaAsset; | @@ -11,6 +12,7 @@ use frontend\assets\FotoramaAsset; | ||
| 11 | use yii\bootstrap\ActiveForm; | 12 | use yii\bootstrap\ActiveForm; |
| 12 | use yii\bootstrap\Html; | 13 | use yii\bootstrap\Html; |
| 13 | use yii\helpers\Url; | 14 | use yii\helpers\Url; |
| 15 | +use yii\web\View; | ||
| 14 | use yii\widgets\MaskedInput; | 16 | use yii\widgets\MaskedInput; |
| 15 | use frontend\assets\FlipclockAsset; | 17 | use frontend\assets\FlipclockAsset; |
| 16 | FotoramaAsset::register($this); | 18 | FotoramaAsset::register($this); |
| @@ -176,13 +178,11 @@ use frontend\assets\FlipclockAsset; | @@ -176,13 +178,11 @@ use frontend\assets\FlipclockAsset; | ||
| 176 | <div class="event_title"> <?= Html::a('Акция!!! '.$event->name,Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?></div> | 178 | <div class="event_title"> <?= Html::a('Акция!!! '.$event->name,Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?></div> |
| 177 | <div class="event_time">До конца осталось:</div> | 179 | <div class="event_time">До конца осталось:</div> |
| 178 | <div class="clock_<?= $event->primaryKey ?> clock_product_first "></div> | 180 | <div class="clock_<?= $event->primaryKey ?> clock_product_first "></div> |
| 179 | - <script type="text/javascript"> | ||
| 180 | - var clock; | ||
| 181 | - | ||
| 182 | - $(document).ready(function() { | 181 | + <?php |
| 182 | + $js = " | ||
| 183 | var clock; | 183 | var clock; |
| 184 | 184 | ||
| 185 | - clock = $('.clock_<?= $event->primaryKey ?>').FlipClock({ | 185 | + clock = $('.clock_$event->primaryKey').FlipClock({ |
| 186 | clockFace: 'DailyCounter', | 186 | clockFace: 'DailyCounter', |
| 187 | language: 'ru', | 187 | language: 'ru', |
| 188 | classes: { | 188 | classes: { |
| @@ -197,12 +197,13 @@ use frontend\assets\FlipclockAsset; | @@ -197,12 +197,13 @@ use frontend\assets\FlipclockAsset; | ||
| 197 | }, | 197 | }, |
| 198 | }); | 198 | }); |
| 199 | 199 | ||
| 200 | - clock.setTime(<?= strtotime($event->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | 200 | + clock.setTime( ".strtotime($event->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
| 201 | clock.setCountdown(true); | 201 | clock.setCountdown(true); |
| 202 | clock.start(); | 202 | clock.start(); |
| 203 | + "; | ||
| 204 | + $this->registerJs($js,['position'=>View::POS_END]) | ||
| 205 | + ?> | ||
| 203 | 206 | ||
| 204 | - }); | ||
| 205 | - </script> | ||
| 206 | 207 | ||
| 207 | </div> | 208 | </div> |
| 208 | <?php endif; ?> | 209 | <?php endif; ?> |
frontend/views/event/_objects.php
| 1 | <?php | 1 | <?php |
| 2 | use yii\helpers\Html; | 2 | use yii\helpers\Html; |
| 3 | -use frontend\helpers\TextHelper; | ||
| 4 | use yii\helpers\Url; | 3 | use yii\helpers\Url; |
| 5 | use frontend\components\Text; | 4 | use frontend\components\Text; |
| 6 | use frontend\assets\FlipclockAsset; | 5 | use frontend\assets\FlipclockAsset; |
| 6 | +use yii\web\View; | ||
| 7 | + | ||
| 7 | FlipclockAsset::register($this); | 8 | FlipclockAsset::register($this); |
| 8 | ?> | 9 | ?> |
| 9 | <div class="news_item"> | 10 | <div class="news_item"> |
| @@ -23,13 +24,9 @@ FlipclockAsset::register($this); | @@ -23,13 +24,9 @@ FlipclockAsset::register($this); | ||
| 23 | if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ | 24 | if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ |
| 24 | ?> | 25 | ?> |
| 25 | <div class="clock_style clock_<?= $model->primaryKey ?>"></div> | 26 | <div class="clock_style clock_<?= $model->primaryKey ?>"></div> |
| 26 | - <script type="text/javascript"> | ||
| 27 | - var clock; | ||
| 28 | - | ||
| 29 | - $(document).ready(function() { | ||
| 30 | - var clock; | ||
| 31 | 27 | ||
| 32 | - clock = $('.clock_<?= $model->primaryKey ?>').FlipClock({ | 28 | + <?php $js = "var clock; |
| 29 | + clock = $('.clock_". $model->primaryKey ."').FlipClock({ | ||
| 33 | clockFace: 'DailyCounter', | 30 | clockFace: 'DailyCounter', |
| 34 | language: 'ru', | 31 | language: 'ru', |
| 35 | classes: { | 32 | classes: { |
| @@ -44,21 +41,14 @@ FlipclockAsset::register($this); | @@ -44,21 +41,14 @@ FlipclockAsset::register($this); | ||
| 44 | }, | 41 | }, |
| 45 | }); | 42 | }); |
| 46 | 43 | ||
| 47 | - clock.setTime(<?= strtotime($model->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | 44 | + clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
| 48 | clock.setCountdown(true); | 45 | clock.setCountdown(true); |
| 49 | - clock.start(); | ||
| 50 | - | ||
| 51 | - }); | ||
| 52 | - </script> | 46 | + clock.start();"; |
| 47 | + $this->registerJs($js,['position'=>View::POS_END]) ?> | ||
| 53 | 48 | ||
| 54 | - | ||
| 55 | - <?php | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - ?> | 49 | + <?php}?> |
| 59 | </div> | 50 | </div> |
| 60 | - <div class="both"></div> | ||
| 61 | - | 51 | + <div class="both"></div> |
| 62 | 52 | ||
| 63 | 53 | ||
| 64 | 54 |
frontend/views/layouts/main.php
| @@ -30,7 +30,7 @@ use common\models\Event; | @@ -30,7 +30,7 @@ use common\models\Event; | ||
| 30 | <link type="image/ico" href="http://www.linija-svitla.ua/images/icon.ico" rel="SHORTCUT ICON"/> | 30 | <link type="image/ico" href="http://www.linija-svitla.ua/images/icon.ico" rel="SHORTCUT ICON"/> |
| 31 | <link rel="icon" href="http://www.linija-svitla.ua/images/icon.ico" type="image/x-icon"/> | 31 | <link rel="icon" href="http://www.linija-svitla.ua/images/icon.ico" type="image/x-icon"/> |
| 32 | 32 | ||
| 33 | - <script language="JavaScript" type="text/JavaScript" src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> | 33 | + |
| 34 | <meta name="google-site-verification" content="m60Ax2153voy05Xdtit_bnBVjuZG-fv0Zu14jLjb4Tk"/> | 34 | <meta name="google-site-verification" content="m60Ax2153voy05Xdtit_bnBVjuZG-fv0Zu14jLjb4Tk"/> |
| 35 | 35 | ||
| 36 | 36 |
frontend/widgets/views/slider.php
| @@ -20,33 +20,26 @@ FlipclockAsset::register($this); | @@ -20,33 +20,26 @@ FlipclockAsset::register($this); | ||
| 20 | if(!empty($image->end_at) && strtotime($image->end_at) > strtotime(date("Y-m-d"))){ | 20 | if(!empty($image->end_at) && strtotime($image->end_at) > strtotime(date("Y-m-d"))){ |
| 21 | ?> | 21 | ?> |
| 22 | <div class="clock_style clock_<?= $image->primaryKey ?>"></div> | 22 | <div class="clock_style clock_<?= $image->primaryKey ?>"></div> |
| 23 | - <script type="text/javascript"> | ||
| 24 | - var clock; | ||
| 25 | - | ||
| 26 | - $(document).ready(function() { | ||
| 27 | - var clock; | ||
| 28 | - | ||
| 29 | - clock = $('.clock_<?= $image->primaryKey ?>').FlipClock({ | ||
| 30 | - clockFace: 'DailyCounter', | ||
| 31 | - language: 'ru', | ||
| 32 | - classes: { | ||
| 33 | - active: 'flip-clock-active', | ||
| 34 | - before: 'flip-clock-before', | ||
| 35 | - divider: 'flip-clock-divider', | ||
| 36 | - dot: 'flip-clock-dot', | ||
| 37 | - label: 'flip-clock-label', | ||
| 38 | - flip: 'flip', | ||
| 39 | - play: 'play', | ||
| 40 | - wrapper: 'flip-clock-wrapper' | ||
| 41 | - }, | ||
| 42 | - }); | ||
| 43 | - | ||
| 44 | - clock.setTime(<?= strtotime($image->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | ||
| 45 | - clock.setCountdown(true); | ||
| 46 | - clock.start(); | ||
| 47 | - | ||
| 48 | - }); | ||
| 49 | - </script> | 23 | + <?php $js = "var clock; |
| 24 | + clock = $('.clock_". $image->primaryKey ."').FlipClock({ | ||
| 25 | + clockFace: 'DailyCounter', | ||
| 26 | + language: 'ru', | ||
| 27 | + classes: { | ||
| 28 | + active: 'flip-clock-active', | ||
| 29 | + before: 'flip-clock-before', | ||
| 30 | + divider: 'flip-clock-divider', | ||
| 31 | + dot: 'flip-clock-dot', | ||
| 32 | + label: 'flip-clock-label', | ||
| 33 | + flip: 'flip', | ||
| 34 | + play: 'play', | ||
| 35 | + wrapper: 'flip-clock-wrapper' | ||
| 36 | + }, | ||
| 37 | + }); | ||
| 38 | + | ||
| 39 | + clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); | ||
| 40 | + clock.setCountdown(true); | ||
| 41 | + clock.start();"; | ||
| 42 | + $this->registerJs($js,['position'=>View::POS_END]) ?> | ||
| 50 | 43 | ||
| 51 | 44 | ||
| 52 | <?php | 45 | <?php |