Project

General

Profile

Actions

Feature #17035

closed

Approach and patch for removing all inline JavaScript

Added by Ralf Hettinger over 17 years ago. Updated over 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 #1

Updated by Benni Mack over 16 years ago

Hey Ralf,

I set the target version to 4.3 as we forgot about this issue for 4.2 (feature freeze is over) and I definitely want this going in the next version then!

Actions #2

Updated by Ralf Hettinger over 16 years ago

Hi Benjamin,

I have not been sending this to the list for 4.2 since there exist quite a lot of pitfalls that aren't solved by default - as mentioned in the initial report.

config.removeAdditionalJS = external as introduced in the patch could get some installations into serious trouble (believe me, I've had a quite congested tempdir once before - which is no fun at all)...

Actions #3

Updated by Ralf Hettinger over 16 years ago

With 4.2 coming up quickly, there's a new patch since the old one won't work anymore for 4.2
Just in case someone needs this ;)

Actions #4

Updated by Ralf Hettinger almost 15 years ago

New patch which would apply for 4.3 / current trunk...

Actions #5

Updated by Xavier Perseguers over 13 years ago

  • Category deleted (Communication)
  • Target version changed from 4.6.0 to 4.6.0-beta1
Actions #6

Updated by Xavier Perseguers over 13 years ago

  • Target version deleted (4.6.0-beta1)
Actions #7

Updated by Christian Kuhn over 11 years ago

  • Status changed from New to Rejected

With 6.1 issue #46358, the _layers menus where moved to statictemplates, and statictemplates was removed from core afterwards. This issue won't be solved in the core anymore.

Actions

Also available in: Atom PDF