[Seaside] Scripts at bottom?

Boris Popov, DeepCove Labs boris at deepcovelabs.com
Thu Feb 10 14:04:55 UTC 2011


Here's what I ended up doing/hacking for the time being, so you get
better idea of what effect I'm trying to achieve,

MyLibrary>>updateRoot: aHtmlRoot
	super updateRoot: aHtmlRoot.
	aHtmlRoot javascript url:
'https://yandex.st/modernizr/1.6/modernizr.min.js'.
	aHtmlRoot javascript bottom url:
'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'.
	aHtmlRoot javascript bottom with: 'jQuery.noConflict();'.

WAContentElement>>bottom
	self attributeAt: 'bottom' put: true.

WAHtmlRoot>>writeElementsOn: aDocument
	aDocument
		openTag: 'title';
		nextPutAll: title;
		closeTag: 'title'.
	(headElements reject: [:ea | self demoteElement: ea])
		do: [:each | aDocument print: each].

WAHtmlRoot>>closeOn: aDocument
	(headElements select: [:ea | self demoteElement: ea]) do: 
			[:each |
			each attributes removeKey: 'bottom'.
			aDocument print: each].
	aDocument scriptGenerator close: self on: aDocument.
	self writeFootOn: aDocument.

WAHtmlRoot>>demoteElement: ea
	^(ea isKindOf: WAHtmlElement) and: [ea attributeAt: 'bottom'
ifAbsent: [false]].

-Boris

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Julian
Fitzell
Sent: Wednesday, February 09, 2011 7:21 PM
To: Seaside - general discussion
Subject: Re: [Seaside] Scripts at bottom?

Isn't that what #addLoadScript does? The code looks like the default
script generator writes the scripts out just before closing the </body>.
Is that what you mean?

On Wed, Feb 9, 2011 at 10:13 PM, Boris Popov, DeepCove Labs
<boris at deepcovelabs.com> wrote:
> Is there a hook somewhere that I missed to push some of the scripts in
the library from head to bottom of html similar to updateRoot:? So far I
patched a couple of methods on WAHtmlRoot, but I don't much like
overrides.
>
> Sent from my iPhone_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list