-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
152 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace dkhlystov\lightbox\controllers; | ||
|
||
use Yii; | ||
use yii\web\Controller; | ||
|
||
/** | ||
* Lightbox for mobile. | ||
*/ | ||
class TouchController extends Controller | ||
{ | ||
|
||
/** | ||
* @var boolean Disable csrf validation. | ||
*/ | ||
public $enableCsrfValidation = false; | ||
|
||
/** | ||
* @var string Use custom layout. | ||
*/ | ||
public $layout = '@dkhlystov/lightbox/views/layout'; | ||
|
||
/** | ||
* Render lightbox for mobile | ||
* @return void | ||
*/ | ||
public function actionImage() | ||
{ | ||
$request = Yii::$app->getRequest(); | ||
|
||
//read images | ||
$src = $request->post('src', []); | ||
|
||
//ckicked index | ||
$touch = array_search($request->post('touch'), $src); | ||
|
||
return $this->render('@dkhlystov/lightbox/views/lightbox', [ | ||
'src' => $src, | ||
'touch' => (integer) $touch, | ||
]); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php $this->beginPage() ?> | ||
<?php $this->beginPage(); ?> | ||
<!DOCTYPE html> | ||
<html xml:lang="<?= Yii::$app->language ?>" lang="<?= Yii::$app->language ?>" dir="ltr"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<?php $this->head() ?> | ||
<?php $this->head(); ?> | ||
</head> | ||
<body><?php $this->beginBody() ?> | ||
<body><?php $this->beginBody(); ?> | ||
<div class="wrapper"><?= $content ?></div> | ||
<?php $this->endBody() ?></body> | ||
<?php $this->endBody(); ?></body> | ||
</html> | ||
<?php $this->endPage() ?> | ||
<?php $this->endPage(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
<?php | ||
|
||
use dkhlystov\lightbox\TouchAsset; | ||
use dkhlystov\lightbox\assets\TouchAsset; | ||
use yii\helpers\Html; | ||
|
||
//стили | ||
TouchAsset::register($this); | ||
|
||
?> | ||
<div class="header"><span><?= $touch+1 ?></span>/<?= sizeof($src) ?></div> | ||
<?= Html::beginTag('div', ['class'=>'container', 'data-touch'=>$touch]) ?><?php foreach ($src as $s) { ?> | ||
<?= Html::beginTag('div', ['class'=>'block', 'data-src'=>$s]) ?><div class="loading"></div><div class="buffer"><img></div><img class="preview"><?= Html::endTag('div'); ?> | ||
<?php } ?><?= Html::endTag('div'); ?> | ||
<div class="header"><span><?= $touch + 1 ?></span>/<?= sizeof($src) ?></div> | ||
<?= Html::beginTag('div', ['class' => 'container', 'data-touch' => $touch]) ?><?php foreach ($src as $s) { ?> | ||
<?= Html::beginTag('div', ['class' => 'block', 'data-src' => $s]) ?><div class="loading"></div><div class="buffer"><img></div><img class="preview"><?= Html::endTag('div') ?> | ||
<?php } ?><?= Html::endTag('div') ?> |
Oops, something went wrong.