[TYPO3-core] RFC #6833: Possibility to add inline JS to page

Steffen Kamper steffen at sk-typo3.de
Mon Nov 26 17:07:46 CET 2007


conclusion after discussion => new patch and doc

new option "inlineJS"
for usage with
page.inlineJS (CARRAY)
or
$GLOBALS['TSFE']->inlineJS (array)

Now inlineJS is independent from config.removeDefaultJS

vg  Steffen


"Steffen Kamper" <steffen at sk-typo3.de> schrieb im Newsbeitrag 
news:mailman.1.1196067786.10910.typo3-team-core at lists.netfielders.de...
> Hi,
>
> this is a SVN patch request.
>
> Branches: Trunk only
>
> Bugtracker Reference:
> http://bugs.typo3.org/view.php?id=6833
>
> Feature:
> If you want to add inline JS, you normally have to include this manually
> with page.headerData.
>
> This feature allows you to add inline JS with 2 ways
> 1) from TS
> page.additionalInlineJS.1000 = TEXT
> page.additionalInlineJS.1000.value (
>  function xyz (fff) {
>    alert(fff);
>  }
> )
>
> 2) from php (e.g. Extension)
> $GLOBALS['TSFE']->additionalInlineJS[] = '
>    function aaaa(bbbb) {
>        alert(bbbb);
>    }
> ';
>
> The advantage is, that this inline code will
> 1) included to the other inline JS and, if configured, included in 
> external
> file (removeDefaultJS)
>
> 2) will also minified if configured (minifyJS)
>
> vg  Steffen
>
>
>
> 


begin 666 20071126_inlineJS.diff
M26YD97 at Z('1Y<&\S+W-Y<V5X="]C;7,O='-L:6(O8VQA<W,N='-L:6)?<&%G
M96=E;BYP:' -"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T-"BTM+2!T>7!O,R]S
M>7-E>'0O8VUS+W1S;&EB+V-L87-S+G1S;&EB7W!A9V5G96XN<&AP"2AR979I
M<VEO;B R-S8V*0T**RLK('1Y<&\S+W-Y<V5X="]C;7,O='-L:6(O8VQA<W,N
M='-L:6)?<&%G96=E;BYP:' )*'=O<FMI;F<@8V]P>2D-"D! ("TS,C8L-R K
M,S(V+#<@0$ -"B )("H at 0')E='5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T^8V]N=&5N="X](&-H<B at Q,"DN
M)&)O9'E486<["B *( HM"0DO+R!$:78M<V5C=&EO;G,**PD)"2\O($1I=BUS
M96-T:6]N<PH@"0EI9B H)$=,3T)!3%-;)U131D4G72T^9&EV4V5C=&EO;BD)
M>PH@"0D))$=,3T)!3%-;)U131D4G72T^8V]N=&5N="X](&-H<B at Q,"DN)$=,
M3T)!3%-;)U131D4G72T^9&EV4V5C=&EO;CL*( D)?0H@"BT)"2\O(%!A9V4@
M8V]N=&5N= HK"0D)+R\@4&%G92!C;VYT96YT"B )"21'3$]"04Q36R=44T9%
M)UTM/F-O;G1E;G0N/2!C:'(H,3 I+B1P86=E0V]N=&5N=#L*( HM"0DO+R!%
M;F1I;F<@<&%G90HK"0D)+R\@16YD:6YG('!A9V4*( D))$=,3T)!3%-;)U13
M1D4G72T^8V]N=&5N="X](&-H<B at Q,"DN)SPO8F]D>3XG.PH@"0EI9B H)$=,
M3T)!3%-;)U131D4G72T^<%-E='5P6R=F<F%M95-E="XG72D)>PH@"0D))$=,
M3T)!3%-;)U131D4G72T^8V]N=&5N="X](&-H<B at Q,"DN)SPO;F]F<F%M97,^
#)SL*
`
end

begin 666 jsInline-doku.txt
M041$(%1O(%134D5&/3Y004=%+4]B:F5C= T*#0II;FQI;F5*4PE#05)205D-
M"DEN<V5R=',@:6YL:6YE($IA=F%S8W)I<'0@:6X@=&AE(&AE861E<BUS96-T
M:6]N+B!$;VXG="!U<V4@<V-R:7!T+71A9W, at 87,@=&AE>2!A<F4 at 861D960@
M8GD at 5%E03S,N#0H-"D5X86UP;&4Z#0IP86=E+FEN;&EN94I3+C$P(#T at 5$58
M5 T*<&%G92YI;FQI;F5*4RXQ,"YV86QU92 ](&9U;F-T:6]N(&$H=F%L*2![
M(&%L97)T*'9A;"D[('T-"@T*=VET:"!C;VYF:6<N<F5M;W9E1&5F875L=$I3
M/65X=&5R;F%L('1H92!I;FQI;F5*4R!I<R!M;W9E9"!T;R!E>'1E<FYA;"!F
M:6QE+ at T*=VET:"!C;VYF:6<N;6EN:69Y2E,],2!T:&4@:6YL:6YE2E,@=VEL
8;"!B92!M:6YI9FEE9"!A<R!W96QL+ at T*
`
end



More information about the TYPO3-team-core mailing list