Discussion:
[Wt-interest] Question about chat.js reference in Chat widget-embedding example
K. Frank
2016-05-18 15:13:40 UTC
Permalink
Hello List!

I am looking at the chat-embedding example from the blog post:

https://www.webtoolkit.eu/wt/blog/2010/12/17/widgetset_mode_and_cross_origin_requests

(Thanks Koen for the link to this post.)

I am browsing the chat code:

https://www.webtoolkit.eu/wt/src/simplechat

and I don't see any js source.

I copied the js link in the blog post:

<div id="chat"></div>
<script src="http://www.webtoolkit.eu/wt/examples/simplechat/chat.js?div=chat">
</script>

into a local html file that I am experimenting with, and the embedding
seems to work. But where does the js file come from? Is it part of
the chat example? Does it get generated automatically?

I've downloaded chat.js, but that didn't give me much insight. It begins,
for what it's worth::

if (typeof window.$ === 'undefined') {/*!
* jQuery JavaScript Library v1.4b1pre
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://docs.jquery.com/License
...
...
(function(z,w){function
la(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function
Ia(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function
Z(a,b,d,

My practical question is: If I want to embed my own Wt widget into
some non-Wt html, what do I need for my js "glue" (presumably
analogous to chat.js), and how do I create it?

(By the way, I never see any text in any of the embedded chat widgets,
neither in those on the www.webtoolkit.eu web pages nor in my local
embedding test. I do see text in the simplechat example:

https://www.webtoolkit.eu/wt/examples/simplechat/simplechat.wt

including text entered into the embedded chat widgets. That is, the
behavior I see is that the embedded chat widgets can "transmit" but
don't "receive".)


Thanks.


K. Frank
Koen Deforche
2016-05-19 11:05:13 UTC
Permalink
Hey Frank,
Post by K. Frank
and I don't see any js source.
<div id="chat"></div>
<script src="
http://www.webtoolkit.eu/wt/examples/simplechat/chat.js?div=chat">
</script>
into a local html file that I am experimenting with, and the embedding
seems to work. But where does the js file come from? Is it part of
the chat example? Does it get generated automatically?
It gets generated automatically for a 'WidgetSet' entrypoint.
Post by K. Frank
My practical question is: If I want to embed my own Wt widget into
some non-Wt html, what do I need for my js "glue" (presumably
analogous to chat.js), and how do I create it?
(By the way, I never see any text in any of the embedded chat widgets,
neither in those on the www.webtoolkit.eu web pages nor in my local
https://www.webtoolkit.eu/wt/examples/simplechat/simplechat.wt
including text entered into the embedded chat widgets. That is, the
behavior I see is that the embedded chat widgets can "transmit" but
don't "receive".)
There was a deployment issue, thanks for pointing it out. That's been fixed
now.

With few exceptions, you can do exactly the same in the same way in a
widget-set deployed applications as for a plain Wt application.
You will want to be a bit more careful with importing CSS files, etc... as
this might also influence the host page.
The main feature that's lacking in a widget-set application is internal
path handling.

Regards,
Koen
K. Frank
2016-05-19 13:56:37 UTC
Permalink
Hello Koen!
Post by Koen Deforche
Hey Frank,
Post by K. Frank
and I don't see any js source.
...
But where does the js file come from? Is it part of
the chat example? Does it get generated automatically?
It gets generated automatically for a 'WidgetSet' entrypoint.
Thank you. That makes sense.
Post by Koen Deforche
...
Post by K. Frank
(By the way, I never see any text in any of the embedded chat widgets,
neither in those on the www.webtoolkit.eu web pages nor in my local
https://www.webtoolkit.eu/wt/examples/simplechat/simplechat.wt
including text entered into the embedded chat widgets. That is, the
behavior I see is that the embedded chat widgets can "transmit" but
don't "receive".)
There was a deployment issue, thanks for pointing it out. That's been fixed
now.
I can confirm that the embedded chat clients work for me now.
Post by Koen Deforche
With few exceptions, you can do exactly the same in the same way in a
widget-set deployed applications as for a plain Wt application.
You will want to be a bit more careful with importing CSS files, etc... as
this might also influence the host page.
The main feature that's lacking in a widget-set application is internal path
handling.
Regards,
Koen
Thanks for your additional explanations.


K. Frank

Loading...