andyet/ICanHaz.js — pull request #47 by AsaAyers (2012-02-12 21:51:50+00:00)
Title: Allow dots in script ids

I'm using underscores instead of CamelCase for my templates, but wanted a way to separate the templates into distinct namespaces. Using id="my_namespace.templateA" doesn't work well with ICanHaz. it has to be invoked as ich['my_namespace.templateA'](). My fork parses the ID which creates an ich.my_namespace object which has a templateA function. Now I can use ich.my_namespace.templateA(). I also made sure you can't overwrite an existing template and a template can't overwrite part of an already namespaced path.

If all 3 of these are in a page, the first is valid, but the other two are not.
id="my_namespace.test1"
id="my_namespace"
id="my_namespace.test1.invalid_template_name"