I am a web developer. Tech-wise, I focus on high-performance UI programming and web accessibility. I used to do UX but I hated it and stay firmly on the execution side of the fence these days.

May
26
comment Knockout textInput and maskedinput plugin
@marcus - no, it is you who misunderstands. I am not telling you to use the textinput binding. I am suggesting you to write a delegate binding that uses a maskedinput library of some kind which can call mutation callbacks and have its value programatically changed. You may find my answer wearisome, but it is the 'proper' way to separate view concerns in a Knockout MVC application. Leave your passive aggressive 'sigh' for someone who actually owes you something.
May
26
comment Knockout textInput and maskedinput plugin
@marcus - Knockout does not listen to input events; bindings do, as and when you tell them. You should ideally to give your jQuery plugin a callback to fire when the input mutates, and that callback should mutate the model value, rather than having your binding create an event listener on top of the plugin. I'm assuming MaskedInput provides such a thing; if it does not you might want to use a different library or just implement the behaviour yourself in the binding with jQuery.
May
25
answered Is there a better way to implement a functional recursive findById in javascript than this?
May
25
comment Knockout textInput and maskedinput plugin
@marcus - no: custom bindings have an init and an update method. Init gets an element and an initial value; in that method you can call your jQuery plugin. Update gets a new model value and the element. In that method you do whatever it is your jQuery plugin recommends you do when you want to update the input programatically. There is no 'merging' of code; your custom binding methods are just delegate functions.
May
24
answered How to either determine SVG text box width, or force line breaks after 'x' characters?
May
24
answered Word Wrap in Raphael JS / SVG
May
24
comment How do I design a Javascript Object to not use any public properties?
@AndrewBerg - avoiding constructors seems to be something of a fad in the JS world at the moment, and I'm not really sure it's warranted. Most of the reasons I've seen for it aren't terribly compelling. But whatever you do to create your objects, you are going to need a function if you want private state - only function closures provide lexical privacy in JavaScript. If you are reading a source that tells you to use e.g. prototypes exclusively and eschew private state completely, I would hint to you that not everyone who claims to state 'agreed best practices' actually does so.
May
23
revised How do I - and should I - spy on required modules with Jasmine?
deleted 103 characters in body
May
23
revised How do I - and should I - spy on required modules with Jasmine?
edited title
May
23
accepted Is there any reason I wouldn't use "let"?
May
23
answered Knockout textInput and maskedinput plugin
May
23
asked How do I - and should I - spy on required modules with Jasmine?
May
13
awarded Civic Duty
May
13
revised Is there any reason I wouldn't use "let"?
added 27 characters in body
May
13
comment Is there any reason I wouldn't use "let"?
@thefourtheye - are there any deficiencies in transpilers like 6to5 with these keywords? Surely they should just swap const and let our for 'var'?
May
13
asked Is there any reason I wouldn't use "let"?
May
2
awarded Yearling
May
2
awarded Autobiographer
Apr
27
answered Knockout.js validation fails with a type="number" input field
Apr
25
awarded Supporter
1 2 3 4 5