Project

General

Profile

Actions

Feature #17035

closed

Approach and patch for removing all inline JavaScript

Added by Ralf Hettinger about 17 years ago. Updated about 11 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-02-24
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

Description

Installations with extensive GMENUs and rollover effects will still have major parts of JavaScript within the HTML source.

This is alright according server load, since this JavaScript mainly consists of image variables which might change on different pages depending on ACT, CUR and the like and therefore would result in different external .js files anyway when outsourced. But there might be circumstances (e.g. beautifying HTML source or optimizing for search engines), where this behaviour is disliked: the actual content of a page is outputted beneath loads of JavaScript code.

As an approach, the following patch against typo3/sysext/cms/tslib/class.tslib_pagegen.php introduces an additional TS property (config.removeAdditionalJS = external might be set), that only will have an effect if TS property config.removeDefaultJS is already set to external. Then, all the inline JavaScript will be outsourced to external files.

If considered to be merged to class.tslib_pagegen.php, the feature config.removeAdditionalJS should be marked as an advanced feature to be applied very carefully, since it requires decent configuration of other parts of the installation - some examples:
- imgNameNotRandom should be set for all menus; else the typo3temp directory will very quickly be congested by .js files (containing randomly named image variables)
- The default JavaScript libraries in media/scripts for [X]MENU_LAYERS (and probably other JavaScripts as well) will not work any more without modification since they rely on inline JavaScript (related to Bug 2970, but it doesn't fully solve the problem).

(issue imported from #M5064)


Files

class.tslib_pagegen.php.patch (3.21 KB) class.tslib_pagegen.php.patch Administrator Admin, 2007-02-24 17:31
5064_4.2.patch (3.25 KB) 5064_4.2.patch Administrator Admin, 2008-04-05 12:51
0005064_4.4trunk-rev6791.patch (3.81 KB) 0005064_4.4trunk-rev6791.patch Administrator Admin, 2010-01-16 18:57

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #15889: Clean up inline javascript in menu_layers.phpRejected2006-03-23

Actions
Related to TYPO3 Core - Task #46358: Separate ext:statictemplates code from coreClosed2013-03-16

Actions
Actions

Also available in: Atom PDF