N°7315 - Migrate usages of WebPage::add_linked_script() to absolute URIs to ensure they are correctly loaded no matter the endpoint location

This commit is contained in:
Molkobain
2024-01-17 22:59:32 +01:00
parent e00112d6e1
commit db4dfe1ba3
11 changed files with 43 additions and 30 deletions

View File

@@ -39,10 +39,10 @@ class SetupPage extends NiceWebPage
public function __construct($sTitle)
{
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/jquery.blockUI.js");
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/@popperjs/core/dist/umd/popper.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy-bundle.umd.js');
$this->add_linked_script("../setup/setup.js");
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "setup/setup.js");
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css');
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-combodo/font-combodo.css');
$this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy.css');

View File

@@ -217,7 +217,7 @@ HTML;
}
}
}
$oPage->add_linked_script('../setup/setup.js');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'setup/setup.js');
$oPage->add_script("function CanMoveForward()\n{\n".$oStep->JSCanMoveForward()."\n}\n");
$oPage->add_script("function CanMoveBackward()\n{\n".$oStep->JSCanMoveBackward()."\n}\n");
$oPage->add('<form id="wiz_form" class="ibo-setup--wizard" method="post">');

View File

@@ -2307,7 +2307,7 @@ class WizStepSummary extends WizardStep
$oPage->add('<fieldset id="installation_progress"><legend>Progress of the installation</legend>');
$oPage->add('<div id="progress_content">');
$oPage->add_linked_script('../setup/jquery.progression.js');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'setup/jquery.progression.js');
$oPage->add('<p class="center"><span id="setup_msg">Ready to start...</span></p><div style="display:block;margin-left: auto; margin-right:auto;" id="progress">0%</div>');
$oPage->add('</div>'); // progress_content
$oPage->add('</fieldset>');