DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Page JavaScript Selector

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Jean-David Gadina
Changed:2008-04-07T16:06:55
Author:Jean-David Gadina
Email:info@macmade.net
Info 3:
Info 4:

Page JavaScript Selector

Extension Key: j s_select

Copyright 2000-2002, Jean-David Gadina, <info@macmade.net>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Page JavaScript Selector 1

Introduction 2

What does it do? 2

Compatibility notice 2

Users manual 2

Installation 2

Extension update 2

Static TypoScript template 3

Adding a specific JavaScript to a page 3

Administration 4

Specifying the JS storage directory 4

Configuration 5

Reference 5

Known problems 5

To-Do list 5

Changelog 5

Introduction

What does it do?

This extension allows you to select one or more javascript(s) for each page of the tree.

Compatibility notice

Prior to version 1.0.0, the js_select extension should run on any version of TYPO3, on PHP 4 and 5. Version 1.0.0 and later are designed exclusively for PHP 5.2.

Users manual

Installation

The installation of this extension is very simple. Just connect to the Typo3 Extension Repository and download «Page JavaScript Selector» (js_select), located in the backend section.

From the extension manager, you'll be able to specify the directory where you will store your JS files (you must manually create this folder). By default, it's fileadmin/js/. Note that you can specify multiple directories, by separating them by a comma. Specified paths are relative to the TYPO3 site path.

You can also choose from here the allowed extensions for the JS files.

If you keep your JS files in sub-directories, you can also get them by enabling the third option.

img-1

Extension update

If you are upgrading from an older version, you will have to update the database. From the extension manager, you'll see an update option.

If you don't see this item in the menu, that means that your database doesn't need to be updated.

img-2

On the update page, you'll see the list of the TYPO3 pages that will be updated.

img-3

Simple click the «Update» button, and you're done.

Static TypoScript template

In order to enable this new version, you'll also have to include it's static template into your main TypoScript template, as it's not included by default anymore.

img-4

Adding a specific JavaScript to a page

Once the extension is installed, you'll be able to specify one or more JavaScript(s) for each of your pages. This is done through the page headers:

img-5

You'll find in the selector all the JS files located in the directory you've set during the install process. Just click on a filename to add it.

You'll also be able to define the inheritance mode for the selected JavaScripts. These options of course only have an effect if the recursivity option is set (see the next section).

The default setting (normal) will allow inheritance

If «Skip» is set, selected JavaScripts from this page won't be inherited, but JavaScripts from the pages above will be.

If «Stop» is set, selected JavaScripts from this page and the above won't be inherited.

Administration

The whole configuration of the plugin is available through the constant editor. Please see the Configuration section for more details.

img-6

Specifying the JS storage directory

You can override the settings made from the extension manager about the JS directory through the page TSConfig. In order to do this, edit the properties of a page, and place the following code in the TSConfig field:

tx_jsselect.jsDir = path/to/a/directory,path/to/another/directory

Specified paths are relative to the TYPO3 site path.

Configuration

Reference

Here's the complete reference of the TypoScript options for the plugin. Remember that you can set each one through the constant editor.

recursive

Property

recursive

Data type

boolean

Description

Also check for javascript(s) on the top pages.

Default

0

defer

Property

defer

Data type

boolean

Description

Enable the JavaScript defer option.

Default

0

jsComments

Property

jsComments

Data type

boolean

Description

Add JS comments in the HTML source code.

Default

1

type

Property

type

Data type

string

Description

The type parameter of the <script> tag.

Default

text/javascript

charset

Property

charset

Data type

string

Description

The charset parameter of the <script> tag.

Default

utf-8

[tsref:plugin.tx_jssselect_pi1.]

Known problems

None at the time. Just contact me if you find some.

To-Do list

Please contact me if you have any suggestion about this extension.

Changelog

1.0.0: 4th public release.

  • This extension is now only compatible with PHP 5.
  • Added the possibility to specify multiple JS directories, including or not the sub-directories.
  • Added the possibility to set the JS directory from the page TSConfig.
  • Added an option to set the inheritance mode from the page properties.

0.3.0: Third public release.

Added an option to remove the JS comments in the HTML source code.

  • Fixed a bug with the recursive option. Thanx to Wolfgang Klinger for the debug.

  • 0.2.1: Bug fix release.

    Fixed a bug which could prevent a page to display correctly on old browsers, when no javascript is specified.

  • 0.2.0: Second public release.

    Fixed a bug with the database field used to store the JS files.

    Added a recursive option.

  • 0.1.0: First public release.

img-7 Page JavaScript Selector - 5