Could you have used or extended https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/hqwebapp/static/hqwebapp/js/knockout-bindings.js#L128? Notice my attribution comment is the same as yours :)