Skip to content

Commit

Permalink
Merge pull request #11 from Matej-ch/intro_version_update
Browse files Browse the repository at this point in the history
Intro version update
  • Loading branch information
Matej-ch authored Jun 9, 2022
2 parents 621a24d + cb3091b commit 54ac862
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 30 deletions.
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "matejch/yii2-page-guide",
"description": "Ability to add guide to pages for user orientation",
"type": "yii2-extension",
"version": "1.2.1",
"version": "1.3.0",
"keywords": ["yii2","extension","guide"],
"license": "MIT",
"authors": [
Expand All @@ -13,8 +13,7 @@
],
"require": {
"php": ">=7.2.0",
"yiisoft/yii2": "~2.0.42",
"bower-asset/intro.js": "^2.9"
"yiisoft/yii2": "~2.0.42"
},
"repositories": [
{
Expand All @@ -31,5 +30,10 @@
"psr-4": {
"matejch\\pageGuide\\tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true
}
}
}
21 changes: 3 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yii2-page-guide",
"version": "1.2.1",
"version": "1.3.0",
"description": "Page guide extension\r ====================\r Ability to add guide to pages for user orientation",
"main": "",
"scripts": {
Expand Down
Binary file modified readme/Create page guide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/assets/IntrojsAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

class IntrojsAsset extends AssetBundle
{
public $sourcePath = '@vendor/bower-asset/intro.js/minified/';

public $css = [
'introjs.min.css',
'https://cdn.jsdelivr.net/npm/intro.js@5.1.0/introjs.css',
];

public $js = [
'intro.min.js',
'https://cdn.jsdelivr.net/npm/intro.js@5.1.0/intro.min.js',
];

public $jsOptions = [
'defer' => 'defer',
];
}
1 change: 1 addition & 0 deletions src/messages/cs/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'step' => 'Krok',
'element' => 'Element na který napojit návod',
'element_help' => 'Nápověda k elementu',
'element_title' => 'Titulek nápovedy',
'help_4' => 'Přesuňte požadovaný element sem',
'rule_element' => 'Element',
'intro' => 'Obsah',
Expand Down
1 change: 1 addition & 0 deletions src/messages/en/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'help_3' => 'Every page you want to use for creating page guides must have widget PageAssist on it from widget directory',
'step' => 'Step',
'element' => 'Element for linking information',
'element_title' => 'Assistance title',
'element_help' => 'Assistance for element',
'help_4' => 'Moved element from other window here',
'rule_element' => 'Element',
Expand Down
1 change: 1 addition & 0 deletions src/messages/it/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'step' => 'Passo',
'element' => 'Elemento per collegare le informazioni',
'element_help' => 'Assistenza per l\'elemento',
'element_title' => 'Assistance title',
'help_4' => 'Muovere l\'elemento dall\'altra finestra qui',
'rule_element' => 'Elemento',
'intro' => 'Contenuto',
Expand Down
1 change: 1 addition & 0 deletions src/messages/sk/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'help_3' => 'Na stránkach ktorých chcete vytvoriť pomocníka musí mať widget PageAssist z adresára widget',
'step' => 'Krok',
'element' => 'Element na ktorý napojiť návod',
'element_title' => 'Titulok nápovedy',
'element_help' => 'Nápoveda k elementu',
'help_4' => 'Presuňte požadovaný element sem',
'rule_element' => 'Element',
Expand Down
6 changes: 6 additions & 0 deletions src/views/page-guide/partials/_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
'top' => Yii::t('pageGuide/view','top')
], ['class' => 'form-control js-position']) ?>
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_title') ?></label>
<input name="PageGuide[rules][<?= $index ?>][title]" value="<?= $rule['title'] ?? '' ?>" class="form-control js-title">
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_help') ?></label>
<textarea name="PageGuide[rules][<?= $index ?>][intro]" cols="30" rows="10" class="form-control js-intro"><?= $rule['intro'] ?? '' ?></textarea>
Expand Down
6 changes: 6 additions & 0 deletions src/views/page-guide/templates/_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
'top' => Yii::t('pageGuide/view','top')
], ['class' => 'form-control js-position']) ?>
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_title') ?></label>
<input name="PageGuide[rules][][title]" value="" class="form-control js-title">
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_help') ?></label>
<textarea name="PageGuide[rules][][intro]" cols="30" rows="10" class="form-control js-intro"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions src/views/page-guide/update.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/* @var $this yii\web\View */
/* @var $model \matejch\pageGuide\PageGuide */
/* @var $model \matejch\pageGuide\models\PageGuide*/

$this->title = Yii::t('pageGuide/view','update guide',['id' => $model->id]);
$this->title = Yii::t('pageGuide/view','update guide',['id' => $model->url]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('pageGuide/view','page guide'), 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Update';
?>
Expand Down
4 changes: 3 additions & 1 deletion src/web/js/assist.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ document.addEventListener('DOMContentLoaded',() => {

intro.setOption("prevLabel",window.guideLabels.prevLabel || 'Prev' );
intro.setOption("nextLabel",window.guideLabels.nextLabel || 'Next' );
intro.setOption("skipLabel",window.guideLabels.skipLabel || 'Skip' );
intro.setOption("skipLabel", '×');
intro.setOption("doneLabel",window.guideLabels.doneLabel || 'Done' );

if(window.guideCallbacks) {
Expand Down Expand Up @@ -128,6 +128,7 @@ document.addEventListener('DOMContentLoaded',() => {
container.querySelector('.js-step').name = 'PageGuide[rules]['+step+'][step]';
container.querySelector('.js-step').value = step + 1;
container.querySelector('.js-position').name = 'PageGuide[rules]['+step+'][position]';
container.querySelector('.js-title').name = 'PageGuide[rules]['+step+'][title]';
container.querySelector('.js-element').name = 'PageGuide[rules]['+step+'][element]';
container.querySelector('.js-intro').name = 'PageGuide[rules]['+step+'][intro]';

Expand Down Expand Up @@ -155,6 +156,7 @@ document.addEventListener('DOMContentLoaded',() => {
tmpl.querySelector('.js-step').name = 'PageGuide[rules]['+count+'][step]';
tmpl.querySelector('.js-step').value = count + 1;
tmpl.querySelector('.js-position').name = 'PageGuide[rules]['+count+'][position]';
tmpl.querySelector('.js-title').name = 'PageGuide[rules]['+count+'][title]';
tmpl.querySelector('.js-element').name = 'PageGuide[rules]['+count+'][element]';
tmpl.querySelector('.js-intro').name = 'PageGuide[rules]['+count+'][intro]';
document.getElementById('js-el-container').appendChild(tmpl);
Expand Down
2 changes: 1 addition & 1 deletion src/web/js/assist.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54ac862

Please sign in to comment.