by mc_hammer · 11y ago · 0 comments
anyway on win JS, have an upvote, but my advice is to stop extending html into some javascript/xml hybrid.
i think a functional approach there would be really sweet
<div data-ref="listview1">
<button>1</button>
<button>2</button>
........
</div>
winJS('listview1').all('button').onclick(dostuff)
lets extract the logic from the view, so its way more easy to maintain than <div class="button-well">
<button data-win-bind="onclick: changeSelectionMode">ReadOnly</button>
<button data-win-bind="onclick: changeSelectionMode">Single</button>
<button data-win-bind="onclick: changeSelectionMode">Extended</button>
<button data-win-bind="onclick: changeSelectionMode">Multi</button>
</div>
also when you create a control on the fly you can see the difference in keystrokes: $('body').append('<button>').onclick(dostuff)
//versus
body.innerHTML += '<button data-win-bind="onclick: changeslelectionmode">'; initBinds();
can you actually make native controls in win10 or windows mobile with this? that would be really cool also. #IfWinActive ahk_class LWJGL
{
*^=::
{
SendInput t
Sleep 150
SendInput %macro1%{enter}
return
}
}
This sends commands to a minecraft window (LWJGL is somehow what windows sees.)XAML provides the declarative approach that you're suggesting, and was available ~10 years ago.
I played with it a bit at the time and was amazed it never took off. Probably it was just too far ahead of its time; JavaScript was still stuck in its "oh, that's what you use to make icons dance on crappy web pages" bad-reputation era.