Re: Pharo 9/64 Bit & Seaside 3.4.4

Johan Brichau <[email protected]> Fri, 30 Jul 2021 08:50:17 +0200
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
--===============2917702426375815180==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_CF6C37DC-3C89-42EA-90F4-06685BDFD286"


--Apple-Mail=_CF6C37DC-3C89-42EA-90F4-06685BDFD286
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi Ian,

jQuery is not loaded, so you need to add jQuery to your application.
Take a look at references to JQDevelopmentLibrary or JQDeploymentLibrary =
to add it:

	| application |
	application :=3D WAAdmin register: self asApplicationAt: =
'javascript/jquery'.
	application preferenceAt: #scriptGeneratorClass put: =
JQScriptGenerator.
	application=20
		addLibrary: JQDeploymentLibrary;
		addLibrary: JQAllFunctionalTestsLibrary.

Or, if you decide to host the jQuery source outside of the Smalltalk =
image (recommended for production!), you can add it in the updateRoot: =
method of your root component. For example:

updateRoot: aRoot
	super updateRoot: aRoot
	aRoot javascript resourceUrl: '/js-libs/jquery-3.3.1.min.js=E2=80=99=
.

Or, even better, use a CDN:

updateRoot: aRoot
	super updateRoot: aRoot
	aRoot javascript url: =
'https://code.jquery.com/jquery-3.6.0.min.js=E2=80=99.


Let me know if it still does not work
Johan


> On 29 Jul 2021, at 20:30, Ian <[email protected]> wrote:
>=20
> Apologies,
>=20
> I should finish this note with the actual error:
>=20
> Uncaught ReferenceError: $ is not defined
>     onclick http://localhost:8080/todo:1 =
<http://localhost:8080/todo:1>
>=20
> JQuery is thus shown not to be loading.
>=20
> Thx!
>=20
> Ian
>=20
> Sent with ProtonMail <https://protonmail.com/> Secure Email.
>=20
> =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 =
Original Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=
=80=90
> On Thursday, July 29th, 2021 at 2:26 PM, Ian =
<[email protected]> wrote:
>> Hi All,
>>=20
>> Newbie question here.
>>=20
>> I am working through Chapter 21.6/21.6.1 of the Seaside book using =
both it and the Github version (Square Brackets Associates) as a cross =
reference for new material.
>>=20
>> I am running into an issue where when adding the jQuery functionality =
as described in section 21.6.1, 'Adding an Effect,' I do not get the =
effect.  For some reason the code that is supposed to add jQuery to a =
page:=20
>>=20
>> renderHeadingOn: html
>>     | helpId |
>>     helpId :=3D html nextId.
>>     (html heading)
>>         class: 'helplink';
>>         onClick: ((html jQuery new id: helpId)  ***** <<<------ HERE
>>             slideToggle: 1 seconds);
>>         with: self model title.
>>     (html div)
>>         id: helpId;
>>         class: 'help';
>>         style: 'display: none';
>>         with: 'The ToDo app enhanced with jQuery.'
>>=20
>> Does not result in the rendered page getting the <link script element =
added to the head section nor in the <script> tag before the closing =
body tag (all according to firefox's developer tools as per:
>>=20
>> <image.png>
>>=20
>> Any help would be greatly appreciated.
>>=20
>> Kind Regards,
>>=20
>> Ian
>>=20
>> Sent with ProtonMail <https://protonmail.com/> Secure Email.
>>=20
>=20
> _______________________________________________
> seaside mailing list
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


--Apple-Mail=_CF6C37DC-3C89-42EA-90F4-06685BDFD286
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Hi =
Ian,<div class=3D""><br class=3D""></div><div class=3D"">jQuery is not =
loaded, so you need to add jQuery to your application.</div><div =
class=3D"">Take a look at references to JQDevelopmentLibrary or =
JQDeploymentLibrary to add it:</div><div class=3D""><br =
class=3D""></div><div class=3D""><div class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>| =
application |</div><div class=3D""><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>application :=3D WAAdmin =
register: self asApplicationAt: 'javascript/jquery'.</div><div =
class=3D""><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>application preferenceAt: #scriptGeneratorClass put: =
JQScriptGenerator.</div><div class=3D""><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>application&nbsp;</div><div =
class=3D""><span class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span>addLibrary: JQDeploymentLibrary;</div><div class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span>addLibrary: JQAllFunctionalTestsLibrary.</div></div><div =
class=3D""><br class=3D""></div><div class=3D"">Or, if you decide to =
host the jQuery source outside of the Smalltalk image (recommended for =
production!), you can add it in the updateRoot: method of your root =
component. For example:</div><div class=3D""><br class=3D""></div><div =
class=3D"">updateRoot: aRoot</div><div class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>super =
updateRoot: aRoot</div><div class=3D""><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>aRoot javascript resourceUrl: =
'/js-libs/jquery-3.3.1.min.js=E2=80=99.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Or, even better, use a CDN:</div><div =
class=3D""><br class=3D""></div><div class=3D""><div =
class=3D"">updateRoot: aRoot</div><div class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;">	</span>super =
updateRoot: aRoot</div><div class=3D""><span class=3D"Apple-tab-span" =
style=3D"white-space: pre;">	</span>aRoot javascript url: '<a =
href=3D"https://code.jquery.com/jquery-3.6.0.min.js=E2=80=99" =
class=3D"">https://code.jquery.com/jquery-3.6.0.min.js=E2=80=99</a>.</div>=
</div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">Let me know if it still does not =
work</div><div class=3D"">Johan</div><div class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 29 Jul 2021, at 20:30, Ian &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div =
class=3D"">Apologies,<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">I should finish this note with the =
actual error:<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">Uncaught ReferenceError: $ is not =
defined<br class=3D""></div><div class=3D"">&nbsp;&nbsp;&nbsp; onclick =
<a href=3D"http://localhost:8080/todo:1" =
class=3D"">http://localhost:8080/todo:1</a><br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"">JQuery is thus shown not =
to be loading.<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">Thx!<br class=3D""></div><div =
class=3D""><br class=3D""></div><div =
class=3D"protonmail_signature_block"><div =
class=3D"protonmail_signature_block-user"><div class=3D"">Ian<br =
class=3D""></div></div><div class=3D""><br class=3D""></div><div =
class=3D"protonmail_signature_block-proton">Sent with <a =
href=3D"https://protonmail.com/" target=3D"_blank" =
class=3D"">ProtonMail</a> Secure Email.</div></div><div class=3D""><br =
class=3D""></div><div class=3D"protonmail_quote">
        =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 =
Original Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=
=80=90<br class=3D"">
        On Thursday, July 29th, 2021 at 2:26 PM, Ian &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:<br class=3D"">
        <blockquote class=3D"protonmail_quote" type=3D"cite">
            <div class=3D"">Hi All,<br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"">Newbie question here.<br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">I =
am working through Chapter 21.6/21.6.1 of the Seaside book using both it =
and the Github version (Square Brackets Associates) as a cross reference =
for new material.<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">I am running into an issue where when =
adding the jQuery functionality as described in section 21.6.1, 'Adding =
an Effect,' I do not get the effect.&nbsp; For some reason the code that =
is supposed to add jQuery to a page: <br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"">renderHeadingOn: html<br =
class=3D""></div><div class=3D"">&nbsp;&nbsp;&nbsp; | helpId |<br =
class=3D""></div><div class=3D"">&nbsp;&nbsp;&nbsp; helpId :=3D html =
nextId.<br class=3D""></div><div class=3D"">&nbsp;&nbsp;&nbsp; (html =
heading)<br class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class: =
'helplink';<br class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; onClick: ((html =
jQuery new id: helpId)&nbsp; ***** &lt;&lt;&lt;------ HERE<br =
class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; slideToggle: 1 seconds);<br class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with: self model =
title.<br class=3D""></div><div class=3D"">&nbsp;&nbsp;&nbsp; (html =
div)<br class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id: helpId;<br =
class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class: 'help';<br =
class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: 'display: =
none';<br class=3D""></div><div =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with: 'The ToDo =
app enhanced with jQuery.'<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">Does not result in the rendered page =
getting the &lt;link script element added to the head section nor in the =
&lt;script&gt; tag before the closing body tag (all according to =
firefox's developer tools as per:<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D""><span =
id=3D"cid:[email protected]">&lt;image.png&gt;</span><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">Any =
help would be greatly appreciated.<br class=3D""></div><div class=3D""><br=
 class=3D""></div><div class=3D"">Kind Regards,<br class=3D""></div><div =
class=3D""><br class=3D""></div><div =
class=3D"protonmail_signature_block"><div =
class=3D"protonmail_signature_block-user"><div class=3D"">Ian<br =
class=3D""></div></div><div class=3D""><br class=3D""></div><div =
class=3D"protonmail_signature_block-proton">Sent with <a target=3D"_blank"=
 href=3D"https://protonmail.com/" rel=3D"noreferrer nofollow noopener" =
class=3D"">ProtonMail</a> Secure Email.</div></div><div class=3D""><br =
class=3D""></div>
        </blockquote><br class=3D"">
    </div>_______________________________________________<br =
class=3D"">seaside mailing list<br class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br =
class=3D"">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seas=
ide<br class=3D""></div></blockquote></div><br =
class=3D""></div></body></html>=

--Apple-Mail=_CF6C37DC-3C89-42EA-90F4-06685BDFD286--

--===============2917702426375815180==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kc2Vhc2lkZSBt
YWlsaW5nIGxpc3QKc2Vhc2lkZUBsaXN0cy5zcXVlYWtmb3VuZGF0aW9uLm9yZwpodHRwOi8vbGlz
dHMuc3F1ZWFrZm91bmRhdGlvbi5vcmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3NlYXNpZGUK

--===============2917702426375815180==--