You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Harald Geritzer <h....@gmail.com> on 2008/04/24 14:13:49 UTC

[T5] Javascript links rendered on bottom of page?

hi all,

is there a special reason for rendering the javascript includes on bottom of the page in latest 
5.0.12 snapshot?

i got a fckeditor on my page and it seems like my editor field wants to initialize the FCKeditor 
before the script ist even loaded?

any hints welcome,
harald


<script type="text/javascript">
var editor_html = new FCKeditor('html');
editor_html.BasePath = '/wtp/assets/rd/t5/components/fckeditor/';
editor_html.ToolbarSet = 'Default';
editor_html.Height = '300px';
editor_html.Width = '100%';
editor_html.Value = '';
editor_html.Create();

</script>

...

<script src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/prototype.js" 
type="text/javascript"></script><script 
src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/scriptaculous.js" 
type="text/javascript"></script><script src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/effects.js" 
type="text/javascript"></script><script src="/wtp/assets/tapestry/5.0.12-SNAPSHOT/tapestry.js" 
type="text/javascript"></script><script src="/wtp/assets/rd/t5/components/Indicator.js" 
type="text/javascript"></script><script src="/wtp/assets/rd/t5/components/fckeditor/fckeditor.js" 
type="text/javascript"></script><script type="text/javascript">
<!--
Tapestry.DEBUG_ENABLED = true;
Tapestry.onDOMLoaded(function() {
Tapestry.init({"validate":[["index",[["required","Sie müssen einen Wert für Index 
angeben."]]],["name",[["required","Sie müssen einen Wert für Name 
angeben."]]],["language",[["required","Sie müssen einen Wert für Sprache 
angeben."]]],["contentType",[["required","Sie müssen einen Wert für Typ 
angeben."]]],["selectShop",[["required","Sie müssen einen Wert für Select Shop 
angeben."]]],["contentLocation",[["required","Sie müssen einen Wert für Ort 
angeben."]]],["depth",[["required","Sie müssen einen Wert für Tiefe angeben."]]]]});
});
// -->
</script></body></html>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Chris Lewis <ch...@bellsouth.net>.
Harald,

I'm honestly not clear on what the initial issue with that was (I'm not
the original author), but it may have had to do with the fact that the
component wrote out script code directly using the MarkupWriter instead
of PageRenderSupport. It was originally written for a much earlier
version of T5, so naturally things have streamlined.

Anyway, it's been removed and committed as my quick tests didn't yield
any problems. For further chats/concerns/requests with this component,
please use its associated user list or issue system:

http://groups.google.com/group/t5components-user
http://code.google.com/p/tapestry5-components/issues/list

sincerely,
chris

Harald Geritzer wrote:
>
> hi chris,
>
> after having a second look at your code i think you don't even need
> the replacement at all
> as the new version uses the "replaceTextArea()" instead of assigning
> the text via javascript.
> in writeScript() the replacement of \r,' occurs but _value is written
> out before in afterRender() and is not used again after the replacement.
>
> harald
>
> Chris Lewis schrieb:
>> Harald,
>>
>> Can I convince you to file an issue, if that is an issue?
>>
>> http://code.google.com/p/tapestry5-components/issues/list
>>
>> If you can, provide an example situation that would cause a problem.
>>
>> thanks!
>>
>> Harald Geritzer wrote:
>>> Chris Lewis schrieb:
>>>> Hi Harald,
>>>>
>>>> tapestry5-components has an editor component (which uses fck):
>>>>
>>>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html
>>>>
>>>>
>>> ty,
>>>
>>> guess in writeScript():
>>>
>>> _value = _value.replace('\r', '\\');   //this is needed for javascript
>>> to be able to extend a string                     across multiple lines
>>> _value = _value.replace("'", "&#39;"); //this is needed because the
>>> string delimiter is ' for the                         script below
>>>
>>> _value.replace should be better replaced by _value.replaceAll  ?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

-- 
http://thegodcode.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Harald Geritzer <h....@gmail.com>.
hi chris,

after having a second look at your code i think you don't even need the replacement at all
as the new version uses the "replaceTextArea()" instead of assigning the text via javascript.
in writeScript() the replacement of \r,' occurs but _value is written out before in afterRender() 
and is not used again after the replacement.

harald

Chris Lewis schrieb:
> Harald,
> 
> Can I convince you to file an issue, if that is an issue?
> 
> http://code.google.com/p/tapestry5-components/issues/list
> 
> If you can, provide an example situation that would cause a problem.
> 
> thanks!
> 
> Harald Geritzer wrote:
>> Chris Lewis schrieb:
>>> Hi Harald,
>>>
>>> tapestry5-components has an editor component (which uses fck):
>>>
>>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html
>>>
>> ty,
>>
>> guess in writeScript():
>>
>> _value = _value.replace('\r', '\\');   //this is needed for javascript
>> to be able to extend a string                     across multiple lines
>> _value = _value.replace("'", "&#39;"); //this is needed because the
>> string delimiter is ' for the                         script below
>>
>> _value.replace should be better replaced by _value.replaceAll  ?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Chris Lewis <ch...@bellsouth.net>.
Harald,

Can I convince you to file an issue, if that is an issue?

http://code.google.com/p/tapestry5-components/issues/list

If you can, provide an example situation that would cause a problem.

thanks!

Harald Geritzer wrote:
> Chris Lewis schrieb:
>> Hi Harald,
>>
>> tapestry5-components has an editor component (which uses fck):
>>
>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html
>>
>
> ty,
>
> guess in writeScript():
>
> _value = _value.replace('\r', '\\');   //this is needed for javascript
> to be able to extend a string                     across multiple lines
> _value = _value.replace("'", "&#39;"); //this is needed because the
> string delimiter is ' for the                         script below
>
> _value.replace should be better replaced by _value.replaceAll  ?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

-- 
http://thegodcode.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Harald Geritzer <h....@gmail.com>.
Chris Lewis schrieb:
> Hi Harald,
> 
> tapestry5-components has an editor component (which uses fck):
> 
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html

ty,

guess in writeScript():

_value = _value.replace('\r', '\\');   //this is needed for javascript to be able to extend 
a string 					across multiple lines
_value = _value.replace("'", "&#39;"); //this is needed because the string delimiter is 
' for the 						script below

_value.replace should be better replaced by _value.replaceAll  ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Chris Lewis <ch...@bellsouth.net>.
Hi Harald,

tapestry5-components has an editor component (which uses fck):

http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html

A fix for this issue has just been committed to svn, if you're
interested in an already-integrated version. In any cayse Davor is
right, so if you're going to roll your own do as he suggested.

chris

Harald Geritzer wrote:
>
> hi all,
>
> is there a special reason for rendering the javascript includes on
> bottom of the page in latest 5.0.12 snapshot?
>
> i got a fckeditor on my page and it seems like my editor field wants
> to initialize the FCKeditor before the script ist even loaded?
>
> any hints welcome,
> harald
>
>
> <script type="text/javascript">
> var editor_html = new FCKeditor('html');
> editor_html.BasePath = '/wtp/assets/rd/t5/components/fckeditor/';
> editor_html.ToolbarSet = 'Default';
> editor_html.Height = '300px';
> editor_html.Width = '100%';
> editor_html.Value = '';
> editor_html.Create();
>
> </script>
>
> ...
>
> <script src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/prototype.js"
> type="text/javascript"></script><script
> src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/scriptaculous.js"
> type="text/javascript"></script><script
> src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/effects.js"
> type="text/javascript"></script><script
> src="/wtp/assets/tapestry/5.0.12-SNAPSHOT/tapestry.js"
> type="text/javascript"></script><script
> src="/wtp/assets/rd/t5/components/Indicator.js"
> type="text/javascript"></script><script
> src="/wtp/assets/rd/t5/components/fckeditor/fckeditor.js"
> type="text/javascript"></script><script type="text/javascript">
> <!--
> Tapestry.DEBUG_ENABLED = true;
> Tapestry.onDOMLoaded(function() {
> Tapestry.init({"validate":[["index",[["required","Sie müssen einen
> Wert für Index angeben."]]],["name",[["required","Sie müssen einen
> Wert für Name angeben."]]],["language",[["required","Sie müssen einen
> Wert für Sprache angeben."]]],["contentType",[["required","Sie müssen
> einen Wert für Typ angeben."]]],["selectShop",[["required","Sie müssen
> einen Wert für Select Shop
> angeben."]]],["contentLocation",[["required","Sie müssen einen Wert
> für Ort angeben."]]],["depth",[["required","Sie müssen einen Wert für
> Tiefe angeben."]]]]});
> });
> // -->
> </script></body></html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

-- 
http://thegodcode.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Javascript links rendered on bottom of page?

Posted by Davor Hrg <hr...@gmail.com>.
This a recommendation from YSlow,

because it helps wrowser render page faster by leaving
javascript part for the end.

you should put your initialization code in onload...


Davor Hrg


On Thu, Apr 24, 2008 at 2:13 PM, Harald Geritzer <h....@gmail.com>
wrote:

>
> hi all,
>
> is there a special reason for rendering the javascript includes on bottom
> of the page in latest 5.0.12 snapshot?
>
> i got a fckeditor on my page and it seems like my editor field wants to
> initialize the FCKeditor before the script ist even loaded?
>
> any hints welcome,
> harald
>
>
> <script type="text/javascript">
> var editor_html = new FCKeditor('html');
> editor_html.BasePath = '/wtp/assets/rd/t5/components/fckeditor/';
> editor_html.ToolbarSet = 'Default';
> editor_html.Height = '300px';
> editor_html.Width = '100%';
> editor_html.Value = '';
> editor_html.Create();
>
> </script>
>
> ...
>
> <script src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/prototype.js"
> type="text/javascript"></script><script
> src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/scriptaculous.js"
> type="text/javascript"></script><script
> src="/wtp/assets/scriptaculous/5.0.12-SNAPSHOT/effects.js"
> type="text/javascript"></script><script
> src="/wtp/assets/tapestry/5.0.12-SNAPSHOT/tapestry.js"
> type="text/javascript"></script><script
> src="/wtp/assets/rd/t5/components/Indicator.js"
> type="text/javascript"></script><script
> src="/wtp/assets/rd/t5/components/fckeditor/fckeditor.js"
> type="text/javascript"></script><script type="text/javascript">
> <!--
> Tapestry.DEBUG_ENABLED = true;
> Tapestry.onDOMLoaded(function() {
> Tapestry.init({"validate":[["index",[["required","Sie müssen einen Wert
> für Index angeben."]]],["name",[["required","Sie müssen einen Wert für Name
> angeben."]]],["language",[["required","Sie müssen einen Wert für Sprache
> angeben."]]],["contentType",[["required","Sie müssen einen Wert für Typ
> angeben."]]],["selectShop",[["required","Sie müssen einen Wert für Select
> Shop angeben."]]],["contentLocation",[["required","Sie müssen einen Wert für
> Ort angeben."]]],["depth",[["required","Sie müssen einen Wert für Tiefe
> angeben."]]]]});
> });
> // -->
> </script></body></html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>