Skip to content

Commit

Permalink
Correção para pacote composer
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-gasparin committed Jun 13, 2021
1 parent 9a01a63 commit ae3fc7f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/AutoTutorial.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace AndreGasparin\AutoTutorial;
/**

use Adianti\Widget\Base\TScript;

/**
* Por: André Gasparin
*/
class AutoTutorial
Expand All @@ -12,11 +15,7 @@ class AutoTutorial

public function __construct()
{
echo '
<script src="https://unpkg.com/driver.js/dist/driver.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/driver.js/dist/driver.min.css">
';


$this->id = uniqid();
$this->header = "function tutorial".$this->id."(){ const con".$this->id." = new Driver( { animate: false, doneBtnText: 'Concluir', closeBtnText: 'Fechar', nextBtnText: 'Próximo', prevBtnText: 'Anterior'} ); con".$this->id.".defineSteps([ ";
}
Expand Down Expand Up @@ -81,8 +80,12 @@ public function run($debug = false)
$js .= ' tutorial'.$this->id.'(); ';
$js .= ' });';

TScript::create($js);
TScript::create('
$("<link/>", { rel: "stylesheet", type: "text/css", href: "vendor/andregasparin/autotutorial/src/driver.min.css" }).appendTo("head");
$.getScript("vendor/andregasparin/autotutorial/src/driver.min.js", function(){ '.$js.' });
');
echo "<style> .driver-highlighted-element { z-index: 100004 !important; pointer-events: none !important; } </style>";

if($debug == true) echo 'JS: <pre>'.$js.'</pre>';
}

Expand All @@ -102,4 +105,4 @@ public function debug()
echo '</pre>';
}

}
}

0 comments on commit ae3fc7f

Please sign in to comment.