<p>There's one point I want to nitpick on, you can make karma usable with any library even if it uses jquery internally. Jquery is especially well suited for this since it the least invasive (it even injects just one object).</p>
<p><blockquote type="cite">On 4 Nov 2009 05:04, "Bryan Berry" <<a href="mailto:bryan@olenepal.org">bryan@olenepal.org</a>> wrote:<br><br>I am refactoring jquery.karma.js using test-driven development.<br>
<br>
I think you did a great job in writing it in the first place, but I am<br>
far to lazy to manually test out the entire library every time I make a<br>
change.<br>
<br>
Reading through jquery.karma.js, I have some questions:<br>
<br>
--- the init function ---<br>
You have an init function that receives the assets to be loaded as an<br>
argument but actually loading them happens in the first part of the if<br>
statement of karma.main . To me it would make more sense to just pass<br>
the assets as an argument to karma.main({ /* assets object */}) and not<br>
the function call back as currently.<br>
<br>
Ideally I would like the use of Karma in lesson.js to be as simple as<br>
<br>
var k = Karma({ images: [ .....], sounds : [...], surfaces : [....]})<br>
<br>
// the rest of the code for a lesson<br>
<br>
I don't understand the if statement in karma.main. It seems to me that<br>
the callback to main function would never be called. That the first if<br>
clause will always be true and karma.main() won't be called a second<br>
time.<br>
<br>
--- taking out the jquery inside Karma ---<br>
<br>
I like how we have packaged karma as a jquery library because it gives<br>
us a standard pattern to follow. That said, I don't want to use jquery<br>
internally to the library so dojo or prototype fans can use it freely<br>
<br>
--- to prototype or not to prototype? ----<br>
<br>
I intend to use monkey-patch the Object object with the function create<br>
<br>
so Object.prototype.create = function ...<br>
<br>
this create function will be implemented in Ecmascript 5 and it matches<br>
Crockford's object(o) function for prototypal inheritance. This is my<br>
excuse for monkey patching ;)<br>
<br>
-- KButton ----<br>
<br>
What is the purpose of KButton?<br>
<br>
<br>
--- mouse.getRelativeCanvasPosition, handleEvents ---<br>
<br>
do you have any code that uses these functions so I can see an example<br>
of them in action?<br>
<br>
<br>
<br>
those are the main questions I have for now. Thanks for reading this far<br>
in a long e-mail ;)<br>
<br>
I know you are very busy with your exams right now, but do u think we<br>
could chat in the next couple days for about an hour about the structure<br>
of jquery.karma.js?<br>
<br>
I am on the east coast of the US right now so timezones are easier :)<br>
<br>
--<br>
Bryan W. Berry<br>
Senior Engineer<br>
OLE Nepal, <a href="http://www.olenepal.org" target="_blank">http://www.olenepal.org</a><br>
<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</blockquote></p>