diff --git a/src/AutoTutorial.php b/src/AutoTutorial.php index af30d66..c84f525 100644 --- a/src/AutoTutorial.php +++ b/src/AutoTutorial.php @@ -1,6 +1,9 @@ - - '; - + $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([ "; } @@ -81,8 +80,12 @@ public function run($debug = false) $js .= ' tutorial'.$this->id.'(); '; $js .= ' });'; - TScript::create($js); + TScript::create(' + $("", { 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 ""; + if($debug == true) echo 'JS:
'.$js.'
'; } @@ -102,4 +105,4 @@ public function debug() echo ''; } -} \ No newline at end of file +}