Monthly Archives: November 2007 - Page 2

HTML5 Media Support from WebKit and Opera

icon gold HTML5 Media Support from WebKit and OperaAnother nice feature from the HTML5 draft specification is now available in the WebKit nightly builds for Mac OS X. The new HTML5

<video src=sample.mov autoplay></video>

To make a button that gives the user basic playback controls you could do this:

<script>
function playPause() {
  var myVideo = document.getElementsByTagName('video')[0];
  if (myVideo.paused)
    myVideo.play();
  else
    myVideo.pause();
}
</script>
<input type=button onclick="playPause()" value="Play/Pause">

The specification also defines a set of events that can be used to react to changes in media playback and load state. For example:

myVideo.addEventListener('ended', function () {
  alert('video playback finished')
} );

To play audio from JavaScript you can simply do this:

var audio = new Audio("song.mp3");
audio.play();

The implementation is still a work in progress and not all features (including the ‘controls’ attribute which gives native playback controls) of the specification are there yet. The current implementation supports all formats that QuickTime supports, including installed 3rd party codecs.

The example below uses the ‘poster’ attribute of the

Opera‘s implementation is similar, including informative text when the media is not available:

<video controls src="demo.ogg" id="myVideo">Theora decoder not found</video>

ASP.NET MVC Framework (Part 1)

Today Scott Guthrie released first post from a series of post describing the new .NET model – MVC(Model View Controller).
It provides a structured model that enforces a clear separation of concerns within applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and can optionally provide more control over the HTML that is emitted from them.

In his post he shows how easily a simple E-Commerce application is build. The sample project is availabe in the new Visual Studio 2008 Project Templates.

Great plus for developers is that when created the solution includes also a unit test project!
step1 ASP.NET MVC Framework (Part 1)
You can use any unit testing framework (including NUnit, MBUnit, MSTest, XUnit, and others) with the ASP.NET MVC Framework. VS 2008 Professional now includes built-in testing project support for MSTest (previously in VS 2005 this required a Visual Studio Team System SKU), and our default ASP.NET MVC project template automatically creates one of these projects when you use VS 2008.

We’ll also be shipping project template downloads for NUnit, MBUnit and other unit test frameworks as well, so if you prefer to use those instead you’ll also have an easy one click way to create your application and have a test project immediately ready to use with it.

Understanding the Folder Structure of a Project

The default directory structure of an ASP.NET MVC Application has 3 top-level directories:

* /Controllers
* /Models
* /Views

As you can probably guess, we recommend putting your Controller classes underneath the /Controllers directory, your data model classes underneath your /Models directory, and your view templates underneath your /Views directory.

While the ASP.NET MVC framework doesn’t force you to always use this structure, the default project templates use this pattern and we recommend it as an easy way to structure your application. Unless you have a good reason to use an alternative file layout, I’d recommend using this default pattern.

Mapping URLs to Controller Classes

In most web frameworks (ASP, PHP, JSP, ASP.NET WebForms, etc), incoming URLs typically map to template files stored on disk. For example, a “/Products.aspx” or “/Products.php” URL typically has an underlying Products.aspx or Products.php template file on disk that handles processing it. When a http request for a web application comes into the web server, the web framework runs code specified by the template file on disk, and this code then owns handling the processing of the request. Often this code uses the HTML markup within the Products.aspx or Products.php file to help with generating the response sent back to the client.

MVC frameworks typically map URLs to server code in a different way. Instead of mapping URLs to template files on disk, they instead map URLs directly to classes. These classes are called “Controllers” and they own processing incoming requests, handling user input and interactions, and executing appropriate application and data logic based on them. A Controller class will then typically call a separate “View” component that owns generating the actual HTML output for the request.

Also here are his conclusion words:
Summary

This first blog post is a pretty long one, but hopefully helps provide a reasonably broad look at how all the different components of the new ASP.NET MVC Framework fit together, and how you can build a common real world scenario with it. The first public preview of the ASP.NET MVC bits will be available in a few weeks, and you’ll be able to use them to do all of the steps I outlined above.

While many of the concepts inherent to MVC (in particular the idea of separation of concerns) are probably new to a lot of people reading this, hopefully this blog post has also show how the ASP.NET MVC implementation we’ve been working on fits pretty cleanly into the existing ASP.NET, .NET, and Visual Studio feature-set. You can use .ASPX, .ASCX and .MASTER files and ASP.NET AJAX to create your ASP.NET MVC Views. Non-UI features in ASP.NET today like Forms Authentication, Windows Authentication, Membership, Roles, Url Authorization, Caching, Session State, Profiles, Health Monitoring, Configuration, Compilation, Localization, and HttpModules/HttpHandlers all fully support the MVC model.

If you don’t like the MVC model or don’t find it natural to your style of development, you definitely don’t have to use it. It is a totally optional offering – and does not replace the existing WebForms Page Controller model. Both WebForms and MVC will be fully supported and enhanced going forward. You can even build a single application and have parts of it written using WebForms and parts written using an MVC approach if you want.

Read the whole article

Scripteka.com – The Prototype extensions repository

logo Scripteka.com   The Prototype extensions repositoryAfter releasing Prototype 1.6.0, yesturday Juriy Zaytsev & Maxim Chernyak officially launched Scripteka.com, the Prototype extensions repository and library. The intention is to provide a central place to organize plugins for the Prototype community.

With Scripteka you can:

* 1) View an extensive library of useful (or useless) prototype based extensions
* 2) Rate and use rating to find the coolest scripts out there
* 3) Submit your own creations and get community feedback
* 4) Subscribe to the newest additions to the library

Prototype 1.6.0, script.aculo.us 1.8.0, and the Bungee book now available

codesample1 Prototype 1.6.0, script.aculo.us 1.8.0, and the Bungee book now availableThis is big news for Prototype fans. The latest release is online, but its not a single piece of joy. You have also new script.aculo.us and awesome book.

The final versions of Prototype 1.6.0, script.aculo.us 1.8.0, and the Prototype & script.aculo.us book are now available. Prototype 1.6.0 is the most significant update to the framework since its inception over two years ago. We’re very excited about the changes in this release, and what better way to celebrate than with an update to script.aculo.us and a book covering all the new goodness?

Prototype 1.6.0 released

This version of Prototype brings a number of major enhancements to the core APIs as well as the usual slew of bug fixes and performance optimizations. For the full story, see the CHANGELOG and the release notes for 1.6.0_rc0 and 1.6.0_rc1. API highlights include:

* Ajax transport objects are now automatically wrapped in an Ajax.Response object.
* Ajax.Response includes support for accessing JSON response bodies as JavaScript objects via the responseJSON property.
* The class API now includes full support for inheritance and superclass method calls. (See Mislav’s tutorial for more info.)
* Class objects now have an addMethods method for adding instance methods after creation.
* Elements can be created easily with the new Element(…) syntax.
* Element#insert provides a unified API to DOM element and HTML fragment insertion.
* Element#select is an alias for getElementsBySelector and is now the preferred way to find elements by class name.
* Element#wrap lets you easily wrap an element inside another element in place.
* Enumerable methods on Array are now backed by native Array#forEach implementations when possible.
* Enumerable now has aliases for equivalent JavaScript 1.6 Array methods, and support for JavaScript 1.6’s context parameter for automatic callback binding.
* Enumerable#grep now calls the match method on its first argument, so you can use it to e.g. filter an array of DOM nodes by CSS selector.
* Event objects are now automatically extended with instance methods, so you can write e.g. event.stop() instead of Event.stop(event).
* Prototype’s event API now supports firing DOM-based custom events with Element#fire.
* The new dom:loaded custom event fires when the entire document has loaded and is ready for manipulation.
* Function#curry allows for partial application of function arguments.
* Function#wrap facilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
* Function#delay delays invocation of the function by the given number of seconds.
* Function#defer schedules the function to run as soon as the interpreter is idle.
* The Hash API has changed, and you must now use Hash#get and Hash#set instead of directly accessing properties on Hash instances.
* String#interpolate is a shortcut for instantiating a Template from the string and calling evaluate on it.
* Object properties can now be used in template replacement strings.

script.aculo.us 1.8.0 released

script.aculo.us 1.8.0 is fully compatible with Prototype 1.6.0 and includes several improvements since the last version; see the announcement on Thomas’ blog for more details. Here’s what’s new:

* Complete rewrite of the in-place editing controls.
* Full CSS inheritance support for Effect.Morph.
* Support for tweening between two values of an element property or method call with Effect.Tween.
* A new sound API for playing interface sound effect MP3s.
* Numerous bug fixes and performance improvements.

Download Prototype 1.6.0

Visual Studio 2008 and the .NET Framework 3.5 final soon!

bb188238.bits hero left generic Visual Studio 2008 and the .NET Framework 3.5 final soon!Today, during the keynote address at Microsoft TechEd Developers 2007, S. “Soma” Somasegar, corporate vice president of the Developer Division at Microsoft Corp., announced that Microsoft will release Visual Studio 2008 and the .NET Framework 3.5 by the end of November 2007. Visual Studio 2008 and the .NET Framework 3.5 enable developers at all levels to rapidly create connected applications that offer compelling user experiences for Windows Vista, Windows Server 2008, the 2007 Microsoft Office system, mobile devices and the Web. Soma also unveiled plans to open new opportunities for Visual Studio partners, as well as to deliver new tools and resources for developers, including a first Community Technology Preview (CTP) of the Microsoft Sync Framework and new capabilities for Popfly Explorer.

“The highly social and visual nature of the Web has fundamentally changed what users expect from all applications they interact with, regardless of whether it’s on a customer-facing Web site or Windows rich client application, or a desktop business application built using Microsoft Office,” said Somasegar. “Traditionally, organizations have been hard pressed to deliver the richer, more connected applications and services they need to boost productivity, drive revenue and stay ahead of the competition. With Visual Studio 2008 and the .NET Framework 3.5, it is easy for developers to use the skills they already have to build compelling applications that take advantage of the latest platforms.”

press release

Announcing Dojo 1.0

logo Announcing Dojo 1.0
Yes, its true – Dojo 1.0 is avilable now! Here is what the package offers:

Dojo 1.0 includes:

* Accessibility including keyboard navigation, low vision support, and ARIA markup for assistive technologies
* High performance grid widget supporting 100,000+ rows of data
* Browser-native 2-D and 3-D charting
* A full library of easy-to-use, attractive UI controls
* Universal data access for simple and fast data-driven widget development
* Internationalization with localizations provided for 13 major languages
* CSS-driven themes to make customization and extension simple
* Dojo Offline, based on Google Gears, which makes offline applications easy to build
* Support for the OpenAjax Alliance Hub 1.0 to guarantee interoperability with other toolkits
* Native 2-D and 3-D vector graphics drawing
* Access to many more widgets and extensions through the Dojo package system

Check out their demo page

Aptana Studio 1.0 Released!

here Aptana Studio 1.0 Released!
The guys at Aptana Labs have done great job again. They finally released stable version of Aptana. Here is part from their message to all of us:

We are very proud to release Aptana Studio 1.0 (formerly Aptana IDE). After over two years of non-stop development and over a million downloads, we have finally reached “1.0″. Along with the release of 1.0, we have also created two editions of the product: Community and Professional. The Community Edition is the keystone of the Studio product, where all core features and capabilities are developed. The Professional Edition brings additional features and services beyond the free Community edition.

Some of the new features we’ve added to Aptana Studio 1.0 Community Edition:

* CSS Preview
* HTML, CSS, and JavaScript Formatting
* Code drag and drop
* Visual ScriptDoc Explorer
* Enhanced Dynamic Help System
* Tons of User Interface Polish

Some of the extra features we’ve added to Aptana Studio 1.0 Professional:

* JSON Editor
* Internet Explorer Debugging
* Remote Project Creation
* FTPS and SFTP Support
* Reporting Engine

Besides new features, the Professional Edition also includes priority support and access to the latest nightly and prereleased features across all of our development, including RadRails, PHP, Adobe AIR, and iPhone support.
Aptana Studio isn’t the only product we’re working on, and you’ll see more from us soon. In the mean time, if you are using Aptana Studio professionally, support our efforts by ‘going Pro’. Whichever edition you chose to use, Community or Professional, we look forward to your feedback, feature requests, and comments. It is our community that helps us build a better product — a product that ultimately is for you.

Get started by visiting their home page and read all about it!