[TYPO3-formidable] How to exclude prototype

Hauke Hain newgrp at googlemail.com
Sun Jun 13 19:04:51 CEST 2010


Hi Jérôme,

thank you very much for the new functions.
I am very happy with
   config.tx_ameosformidable.loadJsFramework = 0
as I do not use any Formidable JavaScript actions.
The next step would be formidable to include only the JavaScripts that are 
needed for running the given XML configuration properly. :)

By the way:
Of my XML configuration spokepersons I get the following JavaScript 
included. Is that ok, because I thought I deactivate any JavaScript by 
Formidable with the configuration.
This is very bad as these scripts are missing the other formidable 
JavaScripts.

Here you can see the inserted HTML

<!-- CSS file for renderlet:LISTER list -->
<link rel="stylesheet" type="text/css" 
href="http://www.typo3-test.local/typo3conf/ext/hp_review/res/lister.css" />

<script type="text/javascript" 
src="http://www.typo3-test.local/typo3conf/ext/ameos_formidable/api/base/rdt_lister/res/js/lister.js"></script>


<!-- FORMIDABLE: Formidable 'spokespersons' initialization -->
<script type="text/javascript" 
src="http://www.typo3-test.local/typo3temp/ameos_formidable/js/5/javascript_520c6bd6c4.js"></script>


<!-- FORMIDABLE: Formidable 'spokespersons' post-initialization -->
<script type="text/javascript" 
src="http://www.typo3-test.local/typo3temp/ameos_formidable/js/a/javascript_a69ad43630.js"></script>



Regards,
Hauke


"JéŽrô™me Schneider" <j.schneider at ameos.com> schrieb im Newsbeitrag 
news:mailman.1.1274272833.8370.typo3-project-formidable at lists.typo3.org...
> Hi Hauke,
>
> I modified Formidable today to allow such a feature.
> You'll find in revision 466 what you need. The revision log follows:
> -------------------
> Added new Typoscript switches that allow to fine-tune the inclusion of all 
> core js libraries.
>
>   config.tx_ameosformidable {
>     minify.enabled = 1
>     minify.gzip = 1
>
>     loadJsFramework = 1
>     loadPrototype = 1
>     loadPrototypeAddons = 1
>     mayLoadScriptaculous = 1
>   }
>
> The evaluation is processed as follow:
>
> +loadJsFramework
> +---------------
> |  |
> |  +--1(def): JS-Master switch ON
> |  |  |
> |  |  +minify.enabled
> |  |  +--------------
> |  |    |
> |  |    +--1 (def): jslibs will be minified
> |  |    |  |
> |  |    |  +minify.gzip
> |  |    |  +-----------
> |  |    |    |
> |  |    |    +--1 (def): minified+gzip libs loaded
> |  |    |    |
> |  |    |    +--0: minified but not gzip libs
> |  |    |
> |  |    +--0: js-libs will NOT be minified
> |  |      |
> |  |      +loadPrototype
> |  |      +-------------
> |  |      |  |
> |  |      |  +--1 (def): load prototype
> |  |      |  |
> |  |      |  +--0: will not load prototype
> |  |      |
> |  |      +loadPrototypeAddons
> |  |      +-------------------
> |  |        |
> |  |        +--1 (def): prototype+lowpro+Base+JSON
> |  |        |
> |  |        +--0: do not load prototype addons
> |  |
> |  +--0: will not load any js-lib of it's framework
> |
> +mayLoadScriptaculous
> +--------------------
>   |
>   |--1 (def): load scriptaculous when needed
>   |
>   +--0: will not load scriptaculous
>
> If one needs to manually handle the formidable header injection in the 
> page (to handle multiple prototype-js libraries for instance),
> it's possible to define headerData using the new user_formidablets class
>
> Example:
>
> # TYPOSCRIPT --------------
>         page.includeLibs.user_formidablets = 
> EXT:ameos_formidable/api/class.user_formidablets.php
>         page.headerData.10000 = USER
>         page.headerData.10000 {
>                 userFunc = user_formidablets->manualHeaderTag
>                 load = prototype+addons, jsframework, scriptaculous
>         }
> # /TYPOSCRIPT -------------
>
> user_formidablets->manualHeaderTag will return full <script> tags, whereas
> user_formidablets->manualHeaderPath will return only absolute web-path to 
> the library.
>
> the load parameter defines what to load (comma-separated values). The 
> order of the given libraries is important as it reflects the order of 
> headers returned.
> Possible load tokens are:
>         * minified: all core-libraries, minified
>         * minified+gzipped: all core-libraries, minified and gzipped
>         * jsframework: framework.js library
>         * prototype: the prototype.js library
>         * prototype+addons: prototype.js, lowpro.js, Base.js and json.js
>         * prototype_addonsonly: lowpro.js, Base.js and json.js
>         * scriptaculous: scriptaculous.js and effects.js
>         * scriptaculous_dragdrop: dragdrop.js for scriptaculous
>         * scriptaculous_builder: builder.js for scriptaculous
>
>
> I hope this helps
> Best regards,
> Jérôme Schneider 



More information about the TYPO3-project-formidable mailing list