Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

what i would have loved 10 years ago was a jquery for windows, $('#32770').find('OK').click().. not sure if thats relevant still

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.


The jQuery for windows that I found to have worked is AutoHotKey. But the syntax is something out of a morse code book:

    #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.)


I find AutoIt's BASIC-like syntax is a little nicer for complex tasks than AutoHotKey, although AutoItX (usable from C++, VB, C#, F#, and other managed languages) is the nicest to use of all.


Yes, you can make native-looking Universal Windows Apps with WinJS, distributed through the Store. They can call the same Windows Runtime API's as C++ or C# can. Many of Microsoft's built-in apps use WinJS.

XAML provides the declarative approach that you're suggesting, and was available ~10 years ago.


IBM actually had a research project back in 2000-2001 that worked this way, called "Sash": http://www.ibm.com/developerworks/library/it-0701art3/

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: