WinJS: The Windows Library for JavaScript
dev.windows.com
dev.windows.com
<div class="listView win-selectionstylefilled"
data-win-control="WinJS.UI.ListView"
data-win-options="{
itemDataSource: Sample.ListView.data.dataSource,
itemTemplate: select('.smallListIconTextTemplate'),
header: select('.header'),
selectionMode: 'none',
tapBehavior: 'none',
layout: { type: WinJS.UI.ListLayout }
}">
</div>
The ListView control looks quite powerful, but unfortunately that power comes at the cost of learning a new templating language and all its quirks. Where is the `select` method defined? Is it user accessible Javascript, or is it hidden deep inside the library? What if I wanted to capitalize my headers - would `data-win-options` evaluate Javascript? If it does, what is its binding? Does it use a custom expression parser? If so, what are its quirks? How do I create a reusable component out of this? How would I parameterize it?There are a few custom tags here: 'data-win-control', 'data-win-options' and 'data-win-bind'. How many others are there, and how much time would I have to spend in their API docs to grok them?
Having worked with ERB, HAML, and Angular extensively, and after dabbling with Mustache, and thus relearning a different way to do the same thing over and over, it has become apparent to me that templating languages ought to do string interpolation and stop at that and leave the programming part to a programming language.
You include some js and a manifest and your site detects if it's running in a store container and gives you access to the device...camera, disk, tpm. That's pretty cool.
I wonder how secure something like that can ever be...but its a neat idea.
What is this? Is it a way to access the windows api from javascript? Is it a library of web UI components like Telerik?
So many projects seem to suffer from this same problem, just say what you are doing in clear unambiguous short sentences right at the top with an example or a picture and the world would be a much better place.
Use WinJS to build first class apps with HTML, CSS, and JavaScript. You can use WinJS not only for your Universal Windows apps using HTML/JS, but also for your websites, and when using HTML-based app technologies like Apache Cordova. WinJS provides high quality infrastructure like page controls, promises, and data-binding; polished UI features like virtualizing collections; and high performance Windows controls such as ListView, FlipView, and Semantic Zoom. This is a comprehensive toolkit for you to use with confidence in its performance and polish, whether as a standalone solution or with other frameworks and libraries.
???
... or not: some of the other comments suggest that the source data for these views is MS-specific. OK, I should have expected that :-(
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.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.
#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.)and noticed a ton of jank while scrolling. A quick look at chrome's timeline reveals a nasty listener leak. Hopefully, it's user error and not a flaw in the library.
Autohotkey et.al are impressive in terms of functionality, but holy hell is the syntax and structure awful.
Let's you do UI automation in PowerShell. This example starts calc.exe and clicks buttons 1, 2, 3:
Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name [1-3] | Invoke-UIAButtonClick;If a JavaScript runtime like nodejs had access to the same interfaces as PowerShell or to COM I'd be over the moon.
It would be very powerful, you'd effectively be opening up windows shell programming (OS scripting) to tens of millions of developers rather than the 1% that take the time to learn PowerShell.
I've actually experienced this first hand. There's a small but prolific community on OSX who do this for Window Management and Automation; see https://github.com/jasonm23/phoenix and http://hammerspoon.org
They're great to work with, and it's easy to build your own abstractions on top since they actually have a real language that you can work with. Imagine this for instance:
Windows.find(window => window.title == "Sublime Text")
.moveTo(Screen.find(screen => screen.name.contains("Dell"))
It's so bizarre to me this isn't a thing in Windows. It's a super good thing to have.Your best bet for Windows automation might be AutoItX, a DLL/COM control that can be used from C++, C#, or other managed languages such as F#.
That's subjective.
(Note: I spend most of my time writing JS, but am extremely familiar with C# and Java)
I'm aware I can open the .js files in a text editor, but that's like saying I could work on a C# project by just editing the .cs files in a text editor. Sure that's possible... but I would rather use the IDE.
You can't use WinJS with Windows 7.
They should also publish a sample website demo project for the rest of the planet that isn't using 8.1.
Isn't this kind of like asking why Docker doesn't run on a Linux kernel from 2009? Windows 7 is six years old, don't be shocked some of Microsoft's newer things might use newer platforms.
Guess it's good they're giving folks a free upgrade.
http://www.netmarketshare.com/operating-system-market-share....
So it's lame that they're releasing software that doesn't work for the majority of their users, because they're trying to shove Windows 8 down people's throats, which is quite frankly terrible user experience.
Of course new versions of Windows introduce new features! If you want to use those new features, you need the new version.
Backward compatibility means that once they introduce a feature in one version of Windows, they go to great lengths to keep that feature working in subsequent versions.
It doesn't mean they have to backport every new feature into old versions of the OS.
Also, Windows 8.1 doesn't have to be a terrible experience. Just get Start8 for $5, or whatever Start menu replacement you like, and you essentially have a much-improved Windows 7.
I shouldn't be required to purchase a 3rd party application to tweak a stupid setting easily. Having to code a solution and work with the Windows Registry is hell and something that most people won't bother doing.
If your business strategy is "there's a cheap $5 3rd party app that fixes that!" - you deserve to go out of business.
Whether you like Windows 8 or not, doesn't change the fact that Windows 7 is six years old, and you can't run off an old operating system forever.