domo and protoype.js

39 views
Skip to first unread message

kstubs

unread,
Nov 15, 2012, 6:07:49 PM11/15/12
to prototype-s...@googlegroups.com
Has anyone used domo in a solution along with their prototype.js solution?
I am looking for an improved architecture to develop client side solutions with. Of course I am huge on prototype, just looking for an alternative to delivering static CSS and HTML, or rather, a better way to roll together a rich prototype.js ui class and dependent HTML dom content and CSS.
Thanks,
Karl

Victor

unread,
Nov 16, 2012, 4:08:23 AM11/16/12
to prototype-s...@googlegroups.com
What is domo? Share a link please.

kstubs

unread,
Nov 16, 2012, 10:28:32 AM11/16/12
to prototype-s...@googlegroups.com
Domo
http://domo-js.com/

I'm also looking at Eyeballs and Choco as possible, MVC like, frameworks to sit on top of Prototype.

kstubs

unread,
Nov 16, 2012, 12:46:53 PM11/16/12
to prototype-s...@googlegroups.com
Here's sample code:

Victor

unread,
Nov 20, 2012, 4:53:18 AM11/20/12
to prototype-s...@googlegroups.com
Domo
http://domo-js.com/

From the J2EE developer's point of view it looks like return back to 2000s, to Servlets and tons of HTML/CSS markup in code. IMHO all advanced Java developers agree that moving HTML markup from Java code into separate JSP files was great step forward.

kstubs

unread,
Nov 26, 2012, 10:57:27 AM11/26/12
to prototype-s...@googlegroups.com
Agreed!  I'm not too keen on this idea but have been searching for a solution to better encapsulate my code and assets.  I do not consider domo the answer, but was an interesting idea.
Something we are doing in prototype with the Template class does put HTML markup directly into the JS code.  I am trying to mediate this though by collecting all of my template markup in a separate JS namespaced object.  This is helping a lot.  And if you don't mind inline style markup in the result, you can do the same thing, keep all of your style together in a separate JS object.

Karl..

Marc

unread,
Nov 27, 2012, 2:24:34 AM11/27/12
to prototype-s...@googlegroups.com
At Mad Mimi I created an extension to Template which looks something like this:

Template.from = function(id) {
  if(!$(id)) {
    console.warn("Missing template for " + id);
  } else {
    return new Template($(id).innerHTML.replace(/%23%7B(.*)%7D/g, "#{$1}"));
  }
};

Then in your HTML you'd have script blocks that look something like this:

<script id="my_template" type="text/template">
  This is a #{template}.
</script>


And in your JS you'd simply go:

Template.from('my_template').evaluate({ template: "Template in my HTML where it should be" });

-- Marc
Reply all
Reply to author
Forward
0 new messages