[TYPO3-ect] general approach for JS

Steffen Kamper steffen at sk-typo3.de
Wed Sep 12 10:25:47 CEST 2007


Hi Steve,

"Steve Ryan" <stever at syntithenai.com> schrieb im Newsbeitrag 
news:mailman.1.1189569116.2607.typo3-team-extension-coordination at lists.netfielders.de...
>* Just whack an include in your TS template at the end
> page.1000000000000=TEXT
> page.1000000000000.value=<script>include('EXT:jquery/jquery_compressed.js');</script>
>     // not sure about include syntax js
>
> * Should be no problem with page loading if activated unobtrusively
> page.1000000000001=TEXT
> page.1000000000001.value (
> <script>
>   $(document).ready(function() {    // jquery onload alternative
> $('a#slick-show').click(function() {
> $('#slickbox').show('slow');
> return false;
>  });
>
>   });
> </script>
> )
>
>
> * the TEXT cobjects cache fine. you could even change the TS for the
> include to load and cache the contents of the include file
>

i thought of doing something simular, but with a marker after </body> to say
page.10.marks.JSCONTAINER < plugin.tx_jscontainer

but i have to think about matching the document-subpart ... maybe it's 
needed to add a hook to pagegen-script to achieve that.

and inside the extension
- including libs
- including own scripts
- including onReady-function

for onready there are some variations for frameworks, in general
window.onload=function ...
or
$(document).ready(function...
or
Ext.onReady=function ..

So each included lib gets his own onReady-section

the most important libs that will be supported are
-prototype
-scriptacolous
-jquery
-xajax
-extjs
-motools
-dojo
-YUI

did i miss one?

This should do the job. I thought about a marker to give the user the 
possibility to move the position.
If plugin is USER caching should be no problem.

please add infos if i miss something

vg  Steffen

> ------/----------
>
> * I think pragmatically we tie in whatever javascript libraries we need
> to jazz things up for each individual extension.
>
> It is good to use shared base libraries
> - to save on bandwidth
> - common syntax
> - upgrades and bug fixes are automatically available to your extensions
>
> It also good to be able to rip a bit of js out of someones page and
> whack it in your extension folder and hack to suit.
>
> There is lots of easy to hack examples of eye candy out there. There are
> good frameworks for write once solutions to client and server side
> logic. The xajax extensions give us examples and support in working with
> that approach.
>
> Even for small amounts of additional javascript coding and even if not
> in the style of the original JS script, I think it is worth using a
> query/dom library. Saves so much JS grief. The base javascript query/dom
> libraries I've tried are prototype and jquery.  I like jquery because of
> the 'extension repository'. Lots and lots of examples. 




More information about the TYPO3-team-extension-coordination mailing list