documenting /src/viewer/livehtml.js

1 view
Skip to first unread message

agent marmorkuchen

unread,
Mar 24, 2009, 12:49:12 PM3/24/09
to groundcrew-vie...@googlegroups.com
hello there...

today, it's time to look at /src/viewer/livehtml.js

- widgets: is that array populated anywhere?

- init: it has an argument 'args', but that is never used. will it be?

- display/trigger:
+ on first sight, it seems weird that it has argument 'method' and 'args'
which are overwritten in the first lines arguments). do they only exist
for documentational purposes?
+ the display/trigger functions of the parent level are then called
with only 4 arguments, why not all of them?

- app_paint:
+ by 'app', do you mean the 'viewer application'? or one of the
plugins? in the former case, i suggest to name it viewer_paint, in the
latter it doesn't seem right, as for instance the palettes are
app_painted as well. or just name it 'paint' as it seems applicable to
any DOM element?
+ 'paint' is not the only thing it does, especially when looking at
forms. i dunno a better name yet, though.
+ the inline functions seem to be ready to be refactored into real
functions: paint_fill, paint_observe, ... in the LiveHTML namespace.
+ why is hint only available to input and textarea? it probably only
makes sense there, but would it hurt to have it available for other
elements?

cheers,
marmorkuchen
--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )
X Die Nutzung der Toilette ist den Angestellten ohne Genehmigung
/ \ untersagt - Das MGT

agent marmorkuchen

unread,
Mar 24, 2009, 3:19:03 PM3/24/09
to groundcrew-vie...@googlegroups.com
* agent marmorkuchen <marmor...@kodeaffe.de> [2009-03-24 13:10 -0400]:

> - widgets: is that array populated anywhere?

forget about this one. dunno how i could overlook this. :)

cheers,


--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )

X Die Wuensche der Wirtschaft sind unantastbar.
/ \

Joe Edelman

unread,
Mar 25, 2009, 12:54:02 PM3/25/09
to groundcrew-vie...@googlegroups.com
* init(args) - weird. i'll fix it

* display/trigger - args are for documentation; re: args[0], args[1],
etc.. I think I was just too lazy to figure out which of call/apply was
the right thing to do there. Feel free to fix it.

* app_paint() - I agree it could use a better name. Don't refactor it
into subfunctions... I like that they are always together, I think. And
I think [hint] is clearer that way.

--Joe

--
J.E. -- http://nxhx.org -- 413.250.8007

agent marmorkuchen

unread,
Mar 26, 2009, 11:10:20 AM3/26/09
to groundcrew-vie...@googlegroups.com
hoi...

* Joe Edelman <joe.e...@gmail.com> [2009-03-25 16:47 -0400]:

[...]

> * display/trigger - args are for documentation; re: args[0], args[1],
> etc.. I think I was just too lazy to figure out which of call/apply was
> the right thing to do there. Feel free to fix it.

http://github.com/marmorkuchen/groundcrew-viewer/commit/071bd49a0da71008e92a2da555ebaeaf4109e5e2

i could not come up with a better than 'things' for the conglomeration
of [Viewer.current_app].concat(LiveHTML.widgets, [Viewer]).

a disturbing fact is, though, that the function property arguments is
deprecated in Javascript 1.4. i found people who were wondering what to
use as a replacement in use cases similar to ours, but didn't find an
answer to that.


[...]

> >- display/trigger:
> > + on first sight, it seems weird that it has argument 'method' and 'args'
> > which are overwritten in the first lines arguments). do they only exist
> > for documentational purposes?
> > + the display/trigger functions of the parent level are then called
> > with only 4 arguments, why not all of them?

bye,


marmorkuchen
--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )

X Fuenf Tonnen Flachs!
/ \

Joe Edelman

unread,
Mar 26, 2009, 2:43:16 PM3/26/09
to groundcrew-vie...@googlegroups.com
This use of arguments is not deprecated. Just the use of arguments as a
property of the function itself.

In early JavaScript, it would be:

function q(){ return q.arguments; }

Then they changed it so this would work:

function q(){ return arguments; }

and then they deprecated the old way.

--Joe

--
J.E. -- http://nxhx.org -- 413.250.8007

>
Reply all
Reply to author
Forward
0 new messages