diff --git a/composer.json b/composer.json index c6e0db3..303e84d 100644 --- a/composer.json +++ b/composer.json @@ -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": [ @@ -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": [ { @@ -31,5 +30,10 @@ "psr-4": { "matejch\\pageGuide\\tests\\": "tests/" } + }, + "config": { + "allow-plugins": { + "yiisoft/yii2-composer": true + } } } diff --git a/composer.lock b/composer.lock index c1555ca..ea93b47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "afa6df6d62a33e19ab9c824eb65fd244", + "content-hash": "76db5ced5d41b04da589cd5075db3b6c", "packages": [ { "name": "bower-asset/inputmask", @@ -27,27 +27,12 @@ "http://opensource.org/licenses/mit-license.php" ] }, - { - "name": "bower-asset/intro.js", - "version": "v2.9.3", - "source": { - "type": "git", - "url": "git@github.com:usablica/intro.js.git", - "reference": "b46bbcd8af46be2ae3b43aba850334b12ff03cdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/usablica/intro.js/zipball/b46bbcd8af46be2ae3b43aba850334b12ff03cdb", - "reference": "b46bbcd8af46be2ae3b43aba850334b12ff03cdb" - }, - "type": "bower-asset" - }, { "name": "bower-asset/jquery", "version": "3.6.0", "source": { "type": "git", - "url": "git@github.com:jquery/jquery-dist.git", + "url": "https://github.com/jquery/jquery-dist.git", "reference": "e786e3d9707ffd9b0dd330ca135b66344dcef85a" }, "dist": { @@ -470,5 +455,5 @@ "php": ">=7.2.0" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/package.json b/package.json index 89c7c5e..7938920 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/readme/Create page guide.png b/readme/Create page guide.png index 4092a6e..987f438 100644 Binary files a/readme/Create page guide.png and b/readme/Create page guide.png differ diff --git a/src/assets/IntrojsAsset.php b/src/assets/IntrojsAsset.php index 654f838..e9fdd3a 100644 --- a/src/assets/IntrojsAsset.php +++ b/src/assets/IntrojsAsset.php @@ -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', ]; } \ No newline at end of file diff --git a/src/messages/cs/view.php b/src/messages/cs/view.php index 2df5912..7f4344d 100644 --- a/src/messages/cs/view.php +++ b/src/messages/cs/view.php @@ -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', diff --git a/src/messages/en/view.php b/src/messages/en/view.php index 6dab3dd..94b8f5f 100644 --- a/src/messages/en/view.php +++ b/src/messages/en/view.php @@ -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', diff --git a/src/messages/it/view.php b/src/messages/it/view.php index 26de316..4d7138a 100644 --- a/src/messages/it/view.php +++ b/src/messages/it/view.php @@ -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', diff --git a/src/messages/sk/view.php b/src/messages/sk/view.php index e7b5921..447bd51 100644 --- a/src/messages/sk/view.php +++ b/src/messages/sk/view.php @@ -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', diff --git a/src/views/page-guide/partials/_rule.php b/src/views/page-guide/partials/_rule.php index a424b6c..151c48d 100644 --- a/src/views/page-guide/partials/_rule.php +++ b/src/views/page-guide/partials/_rule.php @@ -25,6 +25,12 @@ 'top' => Yii::t('pageGuide/view','top') ], ['class' => 'form-control js-position']) ?> + +
+ + +
+
diff --git a/src/views/page-guide/templates/_rule.php b/src/views/page-guide/templates/_rule.php index 2cfb57e..7844527 100644 --- a/src/views/page-guide/templates/_rule.php +++ b/src/views/page-guide/templates/_rule.php @@ -22,6 +22,12 @@ 'top' => Yii::t('pageGuide/view','top') ], ['class' => 'form-control js-position']) ?>
+ +
+ + +
+
diff --git a/src/views/page-guide/update.php b/src/views/page-guide/update.php index 1322080..73d9308 100644 --- a/src/views/page-guide/update.php +++ b/src/views/page-guide/update.php @@ -1,9 +1,9 @@ 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'; ?> diff --git a/src/web/js/assist.js b/src/web/js/assist.js index 6ef9449..66d9efa 100644 --- a/src/web/js/assist.js +++ b/src/web/js/assist.js @@ -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) { @@ -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]'; @@ -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); diff --git a/src/web/js/assist.min.js b/src/web/js/assist.min.js index d842d52..41af04f 100644 --- a/src/web/js/assist.min.js +++ b/src/web/js/assist.min.js @@ -1 +1 @@ -"use strict";function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c