Monday, December 31, 2012

WinJS Binding

Windows 8 Application tile update


Ref:
http://msdn.microsoft.com/en-us/library/windows/apps/hh761490.aspx

Updating notification tile:

//1. Choose a tile contents template:
var tmpl = Windows.UI.Notifications.TileTemplateType.tileWideImageAndText01;

//2. Get tile xml dom:
var xml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent( tmpl )

//3. Update text:
var txt = xml.getElementsByTagName("text");
txt[0].appendChild( xml.createTextNode("Hello World") );

//4. UpdateImage:
var img = xml.getElementsByTagName("img");
img[0].setAttribute("src", "ms-appx:///images/logo.png");

//5. Create a notification via the new xml and set it to expire in 10 minutes:
var notification = new Windows.UI.Notifications.TileNotification( xml );
notification.expirationTime = new Date( (new Date()).getTime() + 600 * 1000 );

//6. Send the tile update
Windows.UI.Notifications.TileUpdateManager.createTileUpdateForApplication().update(notification);

Wednesday, November 28, 2012

What is HTML5 ARIA? - Stack Overflow

What is HTML5 ARIA? - Stack Overflow: "ARIA stands for Accessible Rich Internet Applications"

Wednesday, November 21, 2012

CSS: box-sizing

Don't Overthink It Grids | CSS-Tricks: "Gutters
The hardest part about grids is gutters. So far we've made our grid flexible by using percentages for widths. We could make the math all complicated and use percentages for gutters as well, but personally I don't like percentage gutters anyway, I like fixed pixel size gutters. Plus, we're trying to keep too much thinking out of this.

The first step toward this is using box-sizing: border-box;. I like using it on absolutely everything.

*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Now when we set a width, that element stays that width, despite padding or borders being applied."

'via Blog this'