Commit 291f7c2f authored by Felix Kopp's avatar Felix Kopp Committed by Christian Kuhn
Browse files

[TASK] Move JavaScript files out of t3lib

t3lib folder should diminish and finally dissolve itself.
Moves JS files out of t3lib to corresponding extension folders.

Change-Id: Iffdbd1a919dadae923034d38dedafa68a902da26
Resolves: #48379
Releases: 6.2
Reviewed-on: https://review.typo3.org/20903
Tested-by: Wouter Wolters
Reviewed-by: Wouter Wolters
Reviewed-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 34dc73da
......@@ -106,7 +106,7 @@ class BackendController {
'toolbarmanager' => 'sysext/backend/Resources/Public/JavaScript/toolbarmanager.js',
'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js',
'iecompatibility' => 'sysext/backend/Resources/Public/JavaScript/iecompatibility.js',
'evalfield' => '../t3lib/jsfunc.evalfield.js',
'evalfield' => 'js/jsfunc.evalfield.js',
'flashmessages' => '../t3lib/js/extjs/ux/flashmessages.js',
'tabclosemenu' => '../t3lib/js/extjs/ux/ext.ux.tabclosemenu.js',
'notifications' => '../t3lib/js/extjs/notifications.js',
......@@ -118,7 +118,7 @@ class BackendController {
'backendcontentiframe' => 'js/extjs/backendcontentiframe.js',
'modulepanel' => 'js/extjs/modulepanel.js',
'viewportConfiguration' => 'js/extjs/viewportConfiguration.js',
'util' => '../t3lib/js/extjs/util.js'
'util' => 'sysext/backend/Resources/Public/JavaScript/util.js'
);
if ($this->debug) {
unset($this->jsFiles['loginrefresh']);
......
......@@ -423,7 +423,7 @@ class PageLayoutController {
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
// JavaScript:
$this->doc->JScode = '<script type="text/javascript" ' . 'src="' . GeneralUtility::createVersionNumberedFilename(($GLOBALS['BACK_PATH'] . '../t3lib/jsfunc.updateform.js')) . '">' . '</script>';
$this->doc->JScode = '<script type="text/javascript" ' . 'src="' . GeneralUtility::createVersionNumberedFilename(($GLOBALS['BACK_PATH'] . 'js/jsfunc.updateform.js')) . '">' . '</script>';
$this->doc->JScode .= $this->doc->wrapScriptTags('
if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
if (top.fsMod) top.fsMod.navFrameHighlightedID["web"] = "pages' . intval($this->id) . '_"+top.fsMod.currentBank; ' . intval($this->id) . ';
......
......@@ -150,7 +150,7 @@ class TreeElement {
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer = $GLOBALS['SOBE']->doc->getPageRenderer();
$pageRenderer->loadExtJs();
$pageRenderer->addJsFile('../t3lib/js/extjs/tree/tree.js');
$pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/tree.js');
$pageRenderer->addInlineLanguageLabelFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('lang') . 'locallang_csh_corebe.xlf', 'tcatree');
$pageRenderer->addExtOnReadyCode('
TYPO3.Components.Tree.StandardTreeItemData["' . $id . '"] = ' . $treeData . ';
......
......@@ -46,8 +46,7 @@ class ValueSlider {
* @todo Define visibility
*/
public function renderWizard(&$params, &$pObj) {
$jsPath = '../t3lib/js/extjs/components/slider/';
$pObj->loadJavascriptLib($jsPath . 'ValueSlider.js');
$pObj->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/ValueSlider.js');
$field = $params['field'];
$value = $params['row'][$field];
// If Slider is used in a flexform
......
......@@ -5308,7 +5308,7 @@ function ' . $evalData . '(value) {
'textareaResize' => !$GLOBALS['BE_USER']->uc['resizeTextareas'] == '0'
);
$pageRenderer->addInlineSettingArray('', $resizableSettings);
$this->loadJavascriptLib('../t3lib/jsfunc.evalfield.js');
$this->loadJavascriptLib('js/jsfunc.evalfield.js');
$this->loadJavascriptLib('jsfunc.tbe_editor.js');
$this->loadJavascriptLib('jsfunc.placeholder.js');
// Needed for tceform manipulation (date picker)
......@@ -5323,18 +5323,18 @@ function ' . $evalData . '(value) {
// If IRRE fields were processed, add the JavaScript functions:
if ($this->inline->inlineCount) {
$GLOBALS['SOBE']->doc->getPageRenderer()->loadScriptaculous();
$this->loadJavascriptLib('../t3lib/jsfunc.inline.js');
$this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js');
$out .= '
inline.setPrependFormFieldNames("' . $this->inline->prependNaming . '");
inline.setNoTitleString("' . addslashes(BackendUtility::getNoRecordTitle(TRUE)) . '");
';
// Always include JS functions for Suggest fields as we don't know what will come
$this->loadJavascriptLib('../t3lib/js/jsfunc.tceforms_suggest.js');
$this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_suggest.js');
} else {
// If Suggest fields were processed, add the JS functions
if ($this->suggest->suggestCount > 0) {
$pageRenderer->loadScriptaculous();
$this->loadJavascriptLib('../t3lib/js/jsfunc.tceforms_suggest.js');
$this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_suggest.js');
}
}
// Toggle icons:
......
......@@ -1581,7 +1581,7 @@ class DocumentTemplate {
*/
protected function loadCshJavascript() {
$this->pageRenderer->loadExtJS();
$this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/contexthelp.js');
$this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/contexthelp.js');
$this->pageRenderer->addExtDirectCode();
}
......
......@@ -1530,7 +1530,7 @@ class QueryGenerator {
$out = '';
if ($this->extJSCODE) {
$out .= '
<script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . '../t3lib/jsfunc.evalfield.js"></script>
<script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . 'js/jsfunc.evalfield.js"></script>
<script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . 'jsfunc.tbe_editor.js"></script>
<script language="javascript" type="text/javascript">
TBE_EDITOR.formname = "' . $formname . '";
......
......@@ -6813,7 +6813,7 @@ class ContentObjectRenderer {
}
/**
* Returns a JavaScript <script> section with some function calls to JavaScript functions from "t3lib/jsfunc.updateform.js" (which is also included by setting a reference in $GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate'])
* Returns a JavaScript <script> section with some function calls to JavaScript functions from "typo3/js/jsfunc.updateform.js" (which is also included by setting a reference in $GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate'])
* The JavaScript codes simply transfers content into form fields of a form which is probably used for editing information by frontend users. Used by fe_adminLib.inc.
*
* @param array $dataArray Data array which values to load into the form fields from $formName (only field names found in $fieldList)
......@@ -6845,7 +6845,7 @@ class ContentObjectRenderer {
/*]]>*/
</script>
';
$GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate'] = '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename(($GLOBALS['TSFE']->absRefPrefix . 't3lib/jsfunc.updateform.js')) . '"></script>';
$GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate'] = '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename(($GLOBALS['TSFE']->absRefPrefix . 'typo3/js/jsfunc.updateform.js')) . '"></script>';
return $JSPart;
}
......
......@@ -611,7 +611,7 @@ class FormContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConten
$badMess = isset($conf['badMess.']) ? $this->cObj->stdWrap($conf['badMess'], $conf['badMess.']) : $conf['badMess'];
$emailMess = isset($conf['emailMess.']) ? $this->cObj->stdWrap($conf['emailMess'], $conf['emailMess.']) : $conf['emailMess'];
$validateForm = ' onsubmit="return validateForm(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($formName) . ',' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue(implode(',', $fieldlist)) . ',' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($goodMess) . ',' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($badMess) . ',' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($emailMess) . ')"';
$GLOBALS['TSFE']->additionalHeaderData['JSFormValidate'] = '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename(($GLOBALS['TSFE']->absRefPrefix . 't3lib/jsfunc.validateform.js')) . '"></script>';
$GLOBALS['TSFE']->additionalHeaderData['JSFormValidate'] = '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename(($GLOBALS['TSFE']->absRefPrefix . 'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.validateform.js')) . '"></script>';
} else {
$validateForm = '';
}
......
......@@ -65,7 +65,7 @@ class JavaScriptMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu
var ' . $this->JSVarName . $a . '=0;';
}
$JScode .= $this->generate_level($levels, 1, $this->id, $this->menuArr, $this->MP_array) . LF;
$GLOBALS['TSFE']->additionalHeaderData['JSMenuCode'] = '<script type="text/javascript" src="' . $GLOBALS['TSFE']->absRefPrefix . 't3lib/jsfunc.menu.js"></script>';
$GLOBALS['TSFE']->additionalHeaderData['JSMenuCode'] = '<script type="text/javascript" src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.menu.js"></script>';
$GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= $JScode;
// Printing:
$allFormCode = '';
......
......@@ -340,8 +340,8 @@ class TypoScriptFrontendController {
/*
Eg. insert JS-functions in this array ($additionalHeaderData) to include them once. Use associative keys.
Keys in use:
JSFormValidate : <script type="text/javascript" src="'.$GLOBALS["TSFE"]->absRefPrefix.'t3lib/jsfunc.validateform.js"></script>
JSincludeFormupdate : <script type="text/javascript" src="t3lib/jsfunc.updateform.js"></script>
JSFormValidate : <script type="text/javascript" src="'.$GLOBALS["TSFE"]->absRefPrefix.'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.validateform.js"></script>
JSincludeFormupdate : <script type="text/javascript" src="typo3/js/jsfunc.updateform.js"></script>
JSMenuCode, JSMenuCode_menu : JavaScript for the JavaScript menu
JSCode : reserved
JSImgCode : reserved
......
......@@ -289,7 +289,7 @@ class AdminPanelView {
<a id="TSFE_ADMIN"></a>
<form id="TSFE_ADMIN_PANEL_FORM" name="TSFE_ADMIN_PANEL_FORM" action="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT')) . '#TSFE_ADMIN" method="get" onsubmit="document.forms.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[DUMMY]\'].value=Math.random().toString().substring(2,8)">' . $query . '<table class="typo3-adminPanel">' . $header . $moduleContent . $footer . '</table></form>';
if ($GLOBALS['BE_USER']->uc['TSFE_adminConfig']['display_top']) {
$out .= '<script type="text/javascript" src="t3lib/jsfunc.evalfield.js"></script>';
$out .= '<script type="text/javascript" src="typo3/js/jsfunc.evalfield.js"></script>';
$out .= '<script type="text/javascript">/*<![CDATA[*/' . \TYPO3\CMS\Core\Utility\GeneralUtility::minifyJavaScript('
var evalFunc = new evalFunc();
// TSFEtypo3FormFieldSet()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment