18 Eylül 2014 Perşembe

What is New with WinJS 3.0? / WinJS 3.0 ile Gelen Yenilikler

Türkçe metin için, lütfen sayfanın aşağısına gidiniz.

A new version of Windows Javascript Library has been released recently - WinJS 3.0. The new release offers developers some new features one of which, I think the greatest one, is cross-platform/cross-browser support. That means we can use WinJS for our websites as well as for building HTML-based mobile apps across different platforms using technologies like Apache Cordova. You can get the detailed information from this page. In this post, I am going to show you how to include WinJS controls in a PhoneGap project that is built for Windows Phone 8.
First, let's make a new project using CLI or PhoneGap templates, and open it in Visual Studio. I named my project as WinJSDemo. Your project structure should look like this:


Now, we need to install WinJS. I prefer downloading the zip file on this page and copying the js, font and css files to my project (under www folder). You can also use NuGet package manager among the other options to install WinJS, but NuGet doesn't download the necessary files I've mentioned above to my project. Therefore, the best is to download the zip file from the website.

From now on, you should be able to run any code on this page. Remember to put a reference to ui.js, base.js and ui-dark.css ( or ui-light.css) files on your html pages.


You can download my sample project if you wish. If anything seems unclear or wrong to you, let me know by leaving a comment.

Thank you...

--------------------------------------------------------------------------------------------------------------------------

Çok kısa bir süre önce (aslında dün :)) Windows Javascript kütüphanesinin yeni bir versiyonu yayınlandı: WinJS 3.0. Yeni versiyon geliştiricilere birçok yenilik sunuyor ki bence bu yeniliklerin en büyüğü cross-platform/cross-browser desteği. Bu şu anlama geliyor: Artık WinJS'i oluşturduğumuz web sitelerinde kullanabileceğimiz gibi Apache Cordova gibi teknolojileri kullanarak oluşturduğumuz HTML tabanlı mobil uygulamalarda da kullanabileceğiz. Ayrıntılı bilgiyi dilerseniz bu sayfadan alabilirsiniz. Bende bu yazımda bazı WinJS kontrollerini Windows Phone 8 için oluşturduğumuz PhoneGap uygulamasında nasıl kullanabileceğimizi anlatacağım.

Öncelikle CLI ya da PhoneGap şablonlarını kullanarak yeni bir proje oluşturalım ve oluşturduğunuz projeyi Visual Studio'da açalım. CLI ile nasıl proje oluşturacağınızı bilmiyorsanız bu yazıma bakmanızı öneririm. Ben projeme WinJSDemo ismini verdim. Projenizin yapısı genel olarak aşağıdaki gibi olmalı:



Şimdi sıra WinJS'i kurmakta. Ben bu sayfada yer alan zip dosyasını indirip gerekli js, css ve font dosyalarını projeme (www klasörünün altına) kopyalamayı tercihe diyorum. İsterseniz NuGet gibi yazılımları kullanarak da bu işlemi yapabilirsiniz fakat NuGet az önce bahsettiğim dosyaları projeme indirmiyor. Bundan dolayı bence en iyisi web sitesinden zip dosyasını indirmek.

Bu aşamadan sonra, bu sayfada yer alan örnek kodları kendi projenizde çalıştırabiliyor olmalısınız. Unutmamanız gereken bir diğer şey ise ui.js, base.js ve ui-dark.css (veya ui-light.css) dosyalarını html sayfalarınızda referans göstermeniz.


İsterseniz benim oluşturduğum örnek projeyi indirebilirsiniz. Eğer kafanızı karıştıran, anlamadığınız ya da yanlış olduğunu düşündüğünüz bir yer olursa, lütfen yorumlarınızda belirtin.

Kolay gelsin...

Hiç yorum yok:

Yorum Gönder