$jybridScripts = Jybrid\Factory::getScripts();
// Long way $jybridScriptConfig = \Jybrid\Factory::getScripts()->getConfiguration();
// for debugging uncompressed scripts scriptname.js \Jybrid\Factory::getScripts()->getConfiguration()->setUseUncompressedScripts(true|false);
In Production-Mode you don't need the configuration above
Default in jybrid is without "defer". There is currently no "delay-mechanism" that loads the jybrid initialisation scripts later
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script defer src="../jybrid.js"></script> </head> <body> ...... </body> </html>
Examples of more useful locations for scripts /templates/myTemplate/assets/js/ /media/scripts
Jybrid\Factory::getScripts()->addScriptDir('/templates/myTemplate/assets/js/'); // or Jybrid\Factory::getScripts()->addScriptDir('/media/scripts'); // or Jybrid\Factory::getScripts()->addScriptDir('FULL-SERVER-DIRECTORY/media/scripts'); // wherever the place is
/home/users/myUserAccount/public_html/myTemplate/js/jybrid.js will be out to Browser as /myTemplate/js/jybrid.js this method maybe is handy for the following case Jybrid\Factory::getScripts()->addScriptDir(dirname(__DIR__,2)'/myAssets');
In each newly added ScriptDirectory the scripts requested by Jybrid are searched first (priority)
// short Way Jybrid\Factory::getScripts()->addScript(new Jybrid\Scripts\Core(['scriptName' => 'jQuery', 'fileName' => 'jquery.js','useScriptLoadTimeout' => true]));
Jybrid\Factory::getScripts()->addScript(new Jybrid\Scripts\Core(['scriptName' => 'jQuery', 'fileName' => 'jquery.js', 'dir' => '/media/scripts/jQuery-3.0']));
The setLockScript works only if the script was set with an method of Jybrid\Factory::getScripts();
$scriptObject = new Jybrid\Scripts\Core(['scriptName' => 'jQuery', 'fileName' => 'jquery.js', 'dir' => '/media/scripts/jQuery-3.0','useScriptLoadTimeout' => true])
The "scriptName" parameter specifies a possible group of files. This parameter can be used to set several scripts of the same name in the priority queue. However, only the file that is highest in the order is taken. Examples: "jybrid","jybrid_debug", "jquery"... whatever you want.
The file name must be the correct filename of this file. uncompressed-scripts
If you specify the directory here, you will disable the priority queue for this "scriptName"group. It is tried to find this file in this directory. If the file is not found in this directory, an error will be thrown.
So, use this parameter only as a last resort. I am sure that with the above mentioned means "Jybrid\Factory:: getScripts ()->addScriptDir (' FULL-SERVER-DIRECTORY/media/scripts');" there are plenty of ways to avoid this.