mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7315 - Migrate deprecated usages of WebPage::add_linked_script()
This commit is contained in:
@@ -2429,7 +2429,7 @@ HTML;
|
||||
$sInputType = self::ENUM_INPUT_TYPE_IMAGE;
|
||||
$aEventsList[] = 'validate';
|
||||
$aEventsList[] = 'change';
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/edit_image.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/edit_image.js');
|
||||
$oDocument = $value; // Value is an ormDocument objectm
|
||||
$sDefaultUrl = $oAttDef->Get('default_image');
|
||||
if (is_object($oDocument) && !$oDocument->IsEmpty()) {
|
||||
@@ -2545,11 +2545,11 @@ HTML;
|
||||
$sHTMLValue .= '</div></div>';
|
||||
$sHTMLValue .= '<div>'.$sReloadSpan.'</div>'; // No validation span for this one: it does handle its own validation!
|
||||
$sHTMLValue .= "<input name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" type=\"hidden\" id=\"$iId\" value=\"\"/>\n";
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/form_handler.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/console_form_handler.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/field_set.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/form_field.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/subform_field.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/form_handler.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/console_form_handler.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/field_set.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/form_field.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/subform_field.js');
|
||||
$oPage->add_ready_script(
|
||||
<<<JS
|
||||
$('#{$iId}_field_set').field_set($sFieldSetOptions);
|
||||
@@ -2575,9 +2575,9 @@ JS
|
||||
case 'Set':
|
||||
case 'TagSet':
|
||||
$sInputType = self::ENUM_INPUT_TYPE_TAGSET;
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/selectize.min.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/selectize.min.js');
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/selectize.default.css');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.itop-set-widget.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/jquery.itop-set-widget.js');
|
||||
|
||||
$oPage->add_dict_entry('Core:AttributeSet:placeholder');
|
||||
|
||||
@@ -3452,7 +3452,7 @@ EOF
|
||||
// Dummy collapsible section created in order to get JS files
|
||||
$oCollapsibleSection = new CollapsibleSection('');
|
||||
foreach ($oCollapsibleSection->GetJsFilesUrlRecursively(true) as $sJSFile) {
|
||||
$oPage->add_linked_script($sJSFile);
|
||||
$oPage->LinkScriptFromURI($sJSFile);
|
||||
}
|
||||
}
|
||||
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
|
||||
|
||||
@@ -563,8 +563,8 @@ JS
|
||||
}
|
||||
|
||||
if (!$bEditMode) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/dashlet.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/dashboard.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/dashlet.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/dashboard.js');
|
||||
}
|
||||
|
||||
return $oDashboard;
|
||||
@@ -1118,8 +1118,8 @@ JS
|
||||
*/
|
||||
protected function RenderEditionTools(WebPage $oPage, DashboardLayoutUIBlock $oDashboard, $aExtraParams)
|
||||
{
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/blueimp-file-upload/js/jquery.fileupload.js');
|
||||
$oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.iframe-transport.js');
|
||||
$oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.fileupload.js');
|
||||
$sId = utils::Sanitize($this->GetId(), '', 'element_identifier');
|
||||
|
||||
$sMenuTogglerId = "ibo-dashboard-menu-toggler-{$sId}";
|
||||
|
||||
@@ -161,8 +161,8 @@ class UIExtKeyWidget
|
||||
public function DisplaySelect(WebPage $oPage, $iMaxComboLength, $bAllowTargetCreation, $sTitle, DBObjectset $oAllowedValues, $value, $bMandatory, $sFieldName, $sFormPrefix = '', $aArgs = array(), &$sInputType = '')
|
||||
{
|
||||
$sTitle = addslashes($sTitle);
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/extkeywidget.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/forms-json-utils.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/extkeywidget.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/forms-json-utils.js');
|
||||
|
||||
$bCreate = (!$this->bSearchMode) && (UserRights::IsActionAllowed($this->sTargetClass, UR_ACTION_MODIFY) && $bAllowTargetCreation);
|
||||
$bExtensions = true;
|
||||
@@ -368,7 +368,7 @@ JS
|
||||
*/
|
||||
public function DisplayRadio(WebPage $oPage, $iMaxComboLength, $bAllowTargetCreation, DBObjectset $oAllowedValues, $value, $sFieldName, $sDisplayStyle)
|
||||
{
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/forms-json-utils.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/forms-json-utils.js');
|
||||
|
||||
$bCreate = (!$this->bSearchMode) && (UserRights::IsActionAllowed($this->sTargetClass, UR_ACTION_BULK_MODIFY) && $bAllowTargetCreation);
|
||||
$bExtensions = true;
|
||||
@@ -477,8 +477,8 @@ JS
|
||||
$this->bSearchMode = $bSearchMode;
|
||||
}
|
||||
$sTitle = addslashes($sTitle);
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/extkeywidget.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/forms-json-utils.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/extkeywidget.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/forms-json-utils.js');
|
||||
|
||||
$bCreate = (!$this->bSearchMode) && (UserRights::IsActionAllowed($this->sTargetClass, UR_ACTION_BULK_MODIFY) && $bAllowTargetCreation);
|
||||
$bExtensions = true;
|
||||
|
||||
@@ -516,7 +516,7 @@ class ormCaseLog {
|
||||
$sScript = '<script src="'.$sFileAbsUrl.'"></></script>';
|
||||
$sHtml .= $sScript;
|
||||
} else {
|
||||
$oP->add_linked_script($sFileAbsUrl);
|
||||
$oP->LinkScriptFromURI($sFileAbsUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,8 +203,8 @@ abstract class AbstractAttachmentsRenderer
|
||||
$this->oPage->add(Dict::S('UI:Attachments:DropYourFileHint').'</div>');
|
||||
|
||||
|
||||
$this->oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/blueimp-file-upload/js/jquery.iframe-transport.js');
|
||||
$this->oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/blueimp-file-upload/js/jquery.fileupload.js');
|
||||
$this->oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.iframe-transport.js');
|
||||
$this->oPage->LinkScriptFromAppRoot('node_modules/blueimp-file-upload/js/jquery.fileupload.js');
|
||||
|
||||
$this->oPage->add_ready_script(
|
||||
<<<JS
|
||||
|
||||
@@ -110,10 +110,10 @@ ApplicationMenu::CheckMenuIdEnabled('ConfigEditor');
|
||||
$oP = new iTopWebPage(Dict::S('config-edit-title'));
|
||||
$oP->set_base(utils::GetAbsoluteUrlAppRoot().'pages/');
|
||||
$sAceDir = 'node_modules/ace-builds/src-min/';
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sAceDir.'ace.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sAceDir.'mode-php.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sAceDir.'theme-eclipse.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sAceDir.'ext-searchbox.js');
|
||||
$oP->LinkScriptFromAppRoot($sAceDir.'ace.js');
|
||||
$oP->LinkScriptFromAppRoot($sAceDir.'mode-php.js');
|
||||
$oP->LinkScriptFromAppRoot($sAceDir.'theme-eclipse.js');
|
||||
$oP->LinkScriptFromAppRoot($sAceDir.'ext-searchbox.js');
|
||||
|
||||
try {
|
||||
$sOperation = utils::ReadParam('operation', '');
|
||||
|
||||
@@ -17,7 +17,7 @@ class HubConnectorPage extends NiceWebPage
|
||||
$sModuleImagesDir = utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/images';
|
||||
|
||||
$sUserPrefs = appUserPreferences::GetAsJSON();
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/utils.js');
|
||||
$this->LinkScriptFromAppRoot('js/utils.js');
|
||||
$this->add_script(<<<JS
|
||||
var oUserPreferences = $sUserPrefs;
|
||||
JS
|
||||
|
||||
@@ -263,7 +263,7 @@ try {
|
||||
}
|
||||
|
||||
$oPage = new SetupPage(''); // Title will be set later, depending on $sOperation
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/js/hub.js');
|
||||
$oPage->LinkScriptFromModule('itop-hub-connector/js/hub.js');
|
||||
$oPage->add_linked_stylesheet('../css/font-combodo/font-combodo.css');
|
||||
|
||||
$oPage->add_style(<<<CSS
|
||||
|
||||
@@ -305,7 +305,7 @@ try {
|
||||
$sCloseUrl = utils::GetAbsoluteUrlModulesRoot().'/itop-hub-connector/images/black-close.svg';
|
||||
|
||||
$oPage = new HubConnectorPage(Dict::S('iTopHub:Connect'));
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/js/hub.js');
|
||||
$oPage->LinkScriptFromModule('itop-hub-connector/js/hub.js');
|
||||
$oPage->add_linked_stylesheet('../css/font-combodo/font-combodo.css');
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/css/hub.css');
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ try
|
||||
case 'stimulus': // Form displayed when applying a stimulus (state change)
|
||||
case 'apply_stimulus': // Form displayed when applying a stimulus (state change)
|
||||
foreach (ObjectController::EnumRequiredForModificationJsFilesRelPaths() as $sJsFileRelPath) {
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "$sJsFileRelPath");
|
||||
$oP->LinkScriptFromAppRoot($sJsFileRelPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ ApplicationMenu::CheckMenuIdEnabled('UniversalSearchMenu');
|
||||
$oAppContext = new ApplicationContext();
|
||||
|
||||
$oP = new iTopWebPage(Dict::S('UI:UniversalSearchTitle'));
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/forms-json-utils.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/wizardhelper.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/wizard.utils.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/extkeywidget.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/jquery.blockUI.js");
|
||||
$oP->LinkScriptFromAppRoot("js/forms-json-utils.js");
|
||||
$oP->LinkScriptFromAppRoot("js/wizardhelper.js");
|
||||
$oP->LinkScriptFromAppRoot("js/wizard.utils.js");
|
||||
$oP->LinkScriptFromAppRoot("js/extkeywidget.js");
|
||||
$oP->LinkScriptFromAppRoot("js/jquery.blockUI.js");
|
||||
|
||||
// From now on the context is limited to the the selected organization ??
|
||||
|
||||
|
||||
@@ -2208,7 +2208,7 @@ EOF
|
||||
case 'cke_browse':
|
||||
$oPage = new NiceWebPage(Dict::S('UI:BrowseInlineImages'));
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'node_modules/magnific-popup/dist/magnific-popup.css');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/magnific-popup/dist/jquery.magnific-popup.min.js');
|
||||
$oPage->LinkScriptFromAppRoot('node_modules/magnific-popup/dist/jquery.magnific-popup.min.js');
|
||||
$sAppRootUrl = utils::GetAbsoluteUrlAppRoot();
|
||||
$sImgUrl = $sAppRootUrl.INLINEIMAGE_DOWNLOAD_URL;
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ try
|
||||
// Main program
|
||||
//
|
||||
$oP = new iTopWebPage(Dict::S('Menu:TagAdminMenu+'));
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/forms-json-utils.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/wizardhelper.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/wizard.utils.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/extkeywidget.js");
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/jquery.blockUI.js");
|
||||
$oP->LinkScriptFromAppRoot("js/forms-json-utils.js");
|
||||
$oP->LinkScriptFromAppRoot("js/wizardhelper.js");
|
||||
$oP->LinkScriptFromAppRoot("js/wizard.utils.js");
|
||||
$oP->LinkScriptFromAppRoot("js/extkeywidget.js");
|
||||
$oP->LinkScriptFromAppRoot("js/jquery.blockUI.js");
|
||||
|
||||
$sBaseClass = 'TagSetFieldData';
|
||||
$sClass = utils::ReadParam('class', '', false, 'class');
|
||||
|
||||
@@ -39,10 +39,10 @@ class SetupPage extends NiceWebPage
|
||||
public function __construct($sTitle)
|
||||
{
|
||||
parent::__construct($sTitle);
|
||||
$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(utils::GetAbsoluteUrlAppRoot() . "setup/setup.js");
|
||||
$this->LinkScriptFromAppRoot("js/jquery.blockUI.js");
|
||||
$this->LinkScriptFromAppRoot('node_modules/@popperjs/core/dist/umd/popper.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/tippy.js/dist/tippy-bundle.umd.js');
|
||||
$this->LinkScriptFromAppRoot("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');
|
||||
|
||||
@@ -217,7 +217,7 @@ HTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'setup/setup.js');
|
||||
$oPage->LinkScriptFromAppRoot('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">');
|
||||
|
||||
@@ -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(utils::GetAbsoluteUrlAppRoot() . 'setup/jquery.progression.js');
|
||||
$oPage->LinkScriptFromAppRoot('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>');
|
||||
|
||||
@@ -62,7 +62,7 @@ class WebResourcesHelper
|
||||
//when ckeditor is loaded in ajax, CKEDITOR_BASEPATH is not well defined (this constant is used to load additional js)
|
||||
$oPage->add_script("if (! window.CKEDITOR_BASEPATH) { var CKEDITOR_BASEPATH = '".utils::GetAbsoluteUrlAppRoot()."js/ckeditor/';}");
|
||||
foreach (static::GetJSFilesRelPathsForCKEditor() as $sFile) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sFile);
|
||||
$oPage->LinkScriptFromAppRoot($sFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class WebResourcesHelper
|
||||
}
|
||||
|
||||
foreach (static::GetJSFilesRelPathsForC3JS() as $sFile) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sFile);
|
||||
$oPage->LinkScriptFromAppRoot($sFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,13 +135,13 @@ class WebResourcesHelper
|
||||
*/
|
||||
public static function EnableSimpleGraphInWebPage(WebPage &$oPage): void
|
||||
{
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/raphael-min.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/fraphael.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/raphael-min.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/fraphael.js');
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery-contextmenu/src/jquery.contextMenu.css');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery-contextmenu/src/jquery.contextMenu.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.positionBy.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.popupmenu.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.mousewheel.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/simple_graph.js');
|
||||
$oPage->LinkScriptFromAppRoot('node_modules/jquery-contextmenu/src/jquery.contextMenu.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/jquery.positionBy.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/jquery.popupmenu.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/jquery.mousewheel.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/simple_graph.js');
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,8 @@ class ErrorPage extends NiceWebPage
|
||||
{
|
||||
$oKpi = new ExecutionKPI();
|
||||
parent::__construct($sTitle);
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "js/jquery.blockUI.js");
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "setup/setup.js");
|
||||
$this->LinkScriptFromAppRoot("js/jquery.blockUI.js");
|
||||
$this->LinkScriptFromAppRoot("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_saas("css/setup.scss");
|
||||
|
||||
@@ -152,20 +152,20 @@ JS
|
||||
parent::InitializeLinkedScripts();
|
||||
|
||||
// Used throughout the app.
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery/dist/jquery.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.blockUI.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/jquery/dist/jquery.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery.blockUI.js');
|
||||
if (utils::IsDevelopmentEnvironment()) // Needed since many other plugins still rely on oldies like $.browser
|
||||
{
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.dev-params.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.dev.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.dev-params.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.dev.js');
|
||||
} else {
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.prod.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-migrate.prod.min.js');
|
||||
}
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery-ui-dist/jquery-ui.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/jquery-ui-dist/jquery-ui.min.js');
|
||||
|
||||
// Used throughout the app.
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/utils.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/latinise/latinise.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/utils.js');
|
||||
$this->LinkScriptFromAppRoot('js/latinise/latinise.min.js');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,13 +77,12 @@ class UnauthenticatedWebPage extends NiceWebPage
|
||||
$this->SetContentType('text/html');
|
||||
|
||||
// - bootstrap
|
||||
$this->add_linked_script(UAWP_PORTAL_PUBLIC_FOLDER_ABSOLUTE_URL . 'lib/bootstrap/js/bootstrap.min.js');
|
||||
$this->LinkScriptFromURI(UAWP_PORTAL_PUBLIC_FOLDER_ABSOLUTE_URL . 'lib/bootstrap/js/bootstrap.min.js');
|
||||
|
||||
// Note: Since 2.6.0 moment was moved from portal to iTop core
|
||||
$sMomentURL = utils::GetAbsoluteUrlAppRoot().'/js/moment-with-locales.min.js';
|
||||
$this->add_linked_script($sMomentURL);
|
||||
$this->LinkScriptFromAppRoot('js/moment-with-locales.min.js');
|
||||
|
||||
$this->add_linked_script(UAWP_PORTAL_PUBLIC_FOLDER_ABSOLUTE_URL . 'lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js');
|
||||
$this->LinkScriptFromURI(UAWP_PORTAL_PUBLIC_FOLDER_ABSOLUTE_URL . 'lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js');
|
||||
|
||||
// CSS files
|
||||
$this->add_linked_stylesheet(UAWP_PORTAL_PUBLIC_FOLDER_ABSOLUTE_URL . 'lib/bootstrap/css/bootstrap.min.css');
|
||||
|
||||
@@ -172,49 +172,49 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
|
||||
parent::InitializeLinkedScripts();
|
||||
|
||||
// Used by forms
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/leave_handler.js');
|
||||
$this->LinkScriptFromAppRoot('js/leave_handler.js');
|
||||
|
||||
// Used by external keys, DM viewer
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.treeview.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery.treeview.min.js');
|
||||
|
||||
// Used by advanced search, date(time) attributes. Coupled to the PrepareWidgets() JS function.
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-ui-timepicker-addon.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-ui-timepicker-addon-i18n.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-ui-timepicker-addon.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery-ui-timepicker-addon-i18n.min.js');
|
||||
|
||||
// Used by external keys and other drop down lists
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/selectize.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/selectize-plugin-a11y/selectize-plugin-a11y.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.multiselect.js');
|
||||
$this->LinkScriptFromAppRoot('js/selectize.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/selectize-plugin-a11y/selectize-plugin-a11y.js');
|
||||
$this->LinkScriptFromAppRoot('js/jquery.multiselect.js');
|
||||
|
||||
// Used by inline image, CKEditor and other places
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/magnific-popup/dist/jquery.magnific-popup.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/magnific-popup/dist/jquery.magnific-popup.min.js');
|
||||
|
||||
// Used by date(time) attibutes, activity panel, ...
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/moment-with-locales.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/moment-with-locales.min.js');
|
||||
|
||||
// Used by the newsroom
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/showdown/dist/showdown.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/showdown/dist/showdown.min.js');
|
||||
|
||||
// Tooltips
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/@popperjs/core/dist/umd/popper.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy-bundle.umd.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/@popperjs/core/dist/umd/popper.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/tippy.js/dist/tippy-bundle.umd.min.js');
|
||||
|
||||
// Toasts
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/toastify-js/src/toastify.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/toastify-js/src/toastify.js');
|
||||
|
||||
// Keyboard shortcuts
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/mousetrap/mousetrap.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/mousetrap/plugins/record/mousetrap-record.min.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/pages/backoffice/keyboard-shortcuts.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/mousetrap/mousetrap.min.js');
|
||||
$this->LinkScriptFromAppRoot('node_modules/mousetrap/plugins/record/mousetrap-record.min.js');
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/keyboard-shortcuts.js');
|
||||
|
||||
// Used throughout the app.
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/pages/backoffice/toolbox.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/pages/backoffice/on-ready.js');
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/toolbox.js');
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/on-ready.js');
|
||||
|
||||
// Used by dashboard editor
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/property_field.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/icon_select.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/ajaxfileupload.js');
|
||||
$this->LinkScriptFromAppRoot('js/property_field.js');
|
||||
$this->LinkScriptFromAppRoot('js/icon_select.js');
|
||||
$this->LinkScriptFromAppRoot('js/ajaxfileupload.js');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -871,7 +871,7 @@ HTML;
|
||||
/** @var \iBackofficeLinkedScriptsExtension $oExtensionInstance */
|
||||
foreach (MetaModel::EnumPlugins('iBackofficeLinkedScriptsExtension') as $oExtensionInstance) {
|
||||
foreach ($oExtensionInstance->GetLinkedScriptsAbsUrls() as $sScriptUrl) {
|
||||
$this->add_linked_script($sScriptUrl);
|
||||
$this->LinkScriptFromURI($sScriptUrl);
|
||||
}
|
||||
}
|
||||
// - API: Early inline scripts
|
||||
|
||||
@@ -315,7 +315,7 @@ JS;
|
||||
}
|
||||
// - JS files
|
||||
foreach (static::EnumRequiredForModificationJsFilesRelPaths() as $sJsFileRelPath) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sJsFileRelPath);
|
||||
$oPage->LinkScriptFromAppRoot($sJsFileRelPath);
|
||||
}
|
||||
|
||||
// Note: Code duplicated to the case 'apply_modify' in UI.php when a data integrity issue has been found
|
||||
@@ -771,7 +771,7 @@ JS;
|
||||
protected function AddRequiredForModificationJsFilesToPage(iTopWebPage &$oPage): void
|
||||
{
|
||||
foreach (static::EnumRequiredForModificationJsFilesRelPaths() as $sJsFileRelPath) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot() . "$sJsFileRelPath");
|
||||
$oPage->LinkScriptFromAppRoot($sJsFileRelPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class iTopNewsroomController extends Controller
|
||||
public function OperationViewAll()
|
||||
{
|
||||
$oPage = new iTopWebPage(Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:Title'));
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/pages/backoffice/itop-newsroom.view-all.js');
|
||||
$oPage->LinkScriptFromAppRoot('js/pages/backoffice/itop-newsroom.view-all.js');
|
||||
// Add title block
|
||||
// Make bulk actions block
|
||||
$oBulkActionsBlock = PanelUIBlockFactory::MakeForInformation(Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:Title'));
|
||||
|
||||
@@ -255,7 +255,7 @@ JS
|
||||
|
||||
// Add Set JS files to the page as we used a renderer ourselves, they are not added automatically by the page
|
||||
foreach (Set::DEFAULT_JS_FILES_REL_PATH as $sJsFile) {
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().$sJsFile);
|
||||
$oPage->LinkScriptFromAppRoot($sJsFile);
|
||||
}
|
||||
|
||||
$oPage->AddSubBlock($oNotificationsPanel);
|
||||
|
||||
@@ -84,7 +84,7 @@ class ConsoleBlockRenderer extends BlockRenderer
|
||||
}
|
||||
// JS files
|
||||
foreach ($oBlock->GetJsFilesUrlRecursively(true) as $sFileAbsUrl) {
|
||||
$oPage->add_linked_script($sFileAbsUrl);
|
||||
$oPage->LinkScriptFromURI($sFileAbsUrl);
|
||||
}
|
||||
static::AddCssJsTemplatesToPageRecursively($oPage, $oBlock, $aContextParams);
|
||||
}
|
||||
|
||||
@@ -235,8 +235,8 @@ function FormatDatesInPreview(sRadioSelector, sPreviewSelector)
|
||||
}
|
||||
EOF
|
||||
);
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/tabularfieldsselector.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.dragtable.js');
|
||||
$oP->LinkScriptFromAppRoot('js/tabularfieldsselector.js');
|
||||
$oP->LinkScriptFromAppRoot('js/jquery.dragtable.js');
|
||||
$oP->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/dragtable.css');
|
||||
|
||||
$oForm = FormUIBlockFactory::MakeStandard("export-form");
|
||||
|
||||
Reference in New Issue
Block a user