<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wonderolie</title>
	<atom:link href="http://www.wonderolie.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wonderolie.nl</link>
	<description>Interactive design, Front-end, Flash, Flex, jQuery, Silverlight</description>
	<lastBuildDate>Sun, 11 Mar 2012 19:55:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript MVC: a simple todo list</title>
		<link>http://www.wonderolie.nl/2012/javascript-mvc-a-simple-todo-list/</link>
		<comments>http://www.wonderolie.nl/2012/javascript-mvc-a-simple-todo-list/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 19:41:08 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web developing]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=169</guid>
		<description><![CDATA[Download the source You can download, and check the source from my github account A lot of beginning javascript developers might find it hard to start with design patterns. And for most projects larger frameworks, for example backbone.js would be overkill. I created a very simple todo example application based on mvc. I tried to [...]]]></description>
			<content:encoded><![CDATA[<h4>Download the source</h4>
<p>You can download, and check the source from my <a title="github account from jeroenoliemans" href="https://github.com/jeroenoliemans/wonderolie/tree/master/TodoMVC">github account</a></p>
<p>A lot of beginning javascript developers might find it hard to start with design patterns. And for most projects larger frameworks, for example backbone.js would be overkill. I created a very simple todo example application based on mvc. I tried to keep the app as clean and concise as possible. Therefore the application is “ugly”, no styling no images etc. I did use jQuery for event dispatching, to my opinion this easier to understand and to maintain than pure javascript events.</p>
<h3>Application structure</h3>
<p>The application has three main classes and i did not follow the mvc pattern really strictly, for example i could have implemented the model more strictly, with getters an setters, and for example use a singleton for for the model. I did however decoupled the model from the view by the controller.</p>
<h3>The Model</h3>
<p>The model module is essentially one private array which stores the todo items and is exposed by some public methods.</p>
<pre>var Model = function () {
        var _todos = new Array();    

	var notifyController = function () {
            $('body').trigger('updateView');
	}
        // public methods
	return  {
		addTodo: function ( todo ) {
                    _todos.push(todo);
                   notifyController();
		},
                editTodo: function( index, newTodo ){
                    _todos[index] = newTodo;
                },
                deleteTodo: function ( index ) {
                   _todos.splice(index,1);
                   notifyController();
		},
                getData: function(){
                    return _todos;
                }
	};
};
</pre>
<h4>The View</h4>
<p>the view module below handles the user events and updates the view (html file). The view is coupled with the html file. The main events are the “add-event”, triggered by the “add” link and the enter key, and the delete event which the “delete” link triggers.</pre>
<pre>
var View = function () {
	var updateView = function ( todos ) {
            $('#todoList li').remove();
            for( var i = 0, len = todos.length; i < len; i++ ){
              $('#todoList')
               .append( '&lt;li&gt;' + todos[i]
               + '&lt;a data-index="' + i + '" href="#"&gt;remove&lt;/a&gt;&lt;/li&gt;');
            }
	};

        //set the handlers for the view
        var initView = function(){
            //add
            $("#addTodoButton").on("click", function(){
                var event = jQuery.Event("addItem");
                event.todo = $('#addTodo')[0].value;
                $('body').trigger(event);
                $('#addTodo')[0].value = '';
            });
            // track enter key
            $('#addTodo').on("keypress", function(e){
              if(e.which == 13){
                var event = jQuery.Event("addItem");
                event.todo = $('#addTodo')[0].value;
                $('body').trigger(event);
                $('#addTodo')[0].value = '';
               }
              });

            //delete
            $('#todoList a').live("click", function(e){
                var $todo = e.currentTarget;
                var event = jQuery.Event("deleteItem");
                event.index = $($todo).attr('data-index');
                $('body').trigger(event);
            });
        };
        initView();

	return  {
		updateView: function (todos) {
                    updateView(todos);
		}
	};
};
</pre>
<h3>The Controller</h3>
<p>The controller module listens for the events disposed by the view module, the controller is aware of the model and the view.</p>
<pre>var Controller = function (view, model) {
        var _view = view;
        var _model = model;

        // event binding
        $('body').bind('addItem', function(e) {
           _model.addTodo( e.todo );
        });
         $('body').bind('deleteItem', function(e) {
           _model.deleteTodo( e.index );
        });
        $('body').bind('updateView', function(e) {
            _view.updateView( _model.getData() );
        });
};</pre>
<h3>The Application</h3>
<p>The last script is the simple initialize script which binds the MVC modules together. The model and the view are instantiated and passed to the controller.</p>
<pre>//init
var model = Model();
var view = View();
var controller = Controller(view, model);</pre>
<p>The current application is very simple. If the app would be extended I would start by creating a “todo” view item, this would separate the single todo item from the listing ( and perhaps sorting ) of the todo items. Extending applications like this maintain a clear separation of functions, which definitely helps if an applications grows larger.</p>
<h4>Download the source</h4>
<p>You can download, and check the source from my <a title="github account from jeroenoliemans" href="https://github.com/jeroenoliemans/wonderolie/tree/master/TodoMVC">github account</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2012/javascript-mvc-a-simple-todo-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Tangled Web, book review</title>
		<link>http://www.wonderolie.nl/2012/the-tangled-web-book-review/</link>
		<comments>http://www.wonderolie.nl/2012/the-tangled-web-book-review/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 12:05:31 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[web developing]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=150</guid>
		<description><![CDATA[Author: Michal Zalewski publisher: O’Reilly Media ( No Starch Press ) pages: 273 Introduction I liked the book, the book is thorough, on a tough subject. What I missed is a more practical approach of the secure web, almost all web developers are also intrigued by hackers. to my opinion hacking itself could make developers [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://shop.oreilly.com/product/9781593273880.do"><img class="alignnone" src="http://www.wonderolie.nl/wp-content/uploads/2012/03/thetangleweb.gif" alt="Book cover of The tangled web" width="180" height="236" /></a></p>
<ul>
<li>Author: Michal Zalewski</li>
<li>publisher: O’Reilly Media ( No Starch Press )</li>
<li>pages: 273</li>
</ul>
<h3>Introduction</h3>
<p>I liked the book, the book is thorough, on a tough subject. What I missed is a more practical approach of the secure web, almost all web developers are also intrigued by hackers. to my opinion hacking itself could make developers understanding the holes of the web more easily. I really would liked some more practical examples of websites and how to brake them.</p>
<p>The book is handy for reference ( although the internet is might be more useful ). I expected to learn some fundamentals to cope with security issues in the daily live of webdeveloping, that after reading the book and messing around with some code examples my awareness for possible security flaws would be raised.</p>
<h3>Security Awareness</h3>
<p>The untangled web partially raised my awareness. Since i read the book i am more aware of the possibility of security issues in many layers of the web, plugins, java applets and other stuff that lives on the internet. Again what I missed was a more practical approach. For example the book could start with a simple php site implementation. This should be of no concern for the average reader of this book. With the example site created the book could have show ways how to hack the site. I know this might not be the most ethical methodology, but for me it would be the best way to remember all the information about security issues and how to prevent them.</p>
<h3>The Future</h3>
<p>Later chapters describe some modern features of the web. Luckily most of the these are reasonably robust, for example web sockets and web workers. In this section the book becomes also more practical and more fun to read. I enjoyed the epilogue of the book where the analogy is made between the society en the online society which hasn&#8217;t had any time yet to form human-based ethics. Regarding piracy and security.</p>
<h3>Conclusion</h3>
<p>There is a lot to be said about web security, much more than i would have known. I hope i have raised my own awareness regarding security to implement it in my daily job. However i will have a hard time selling the extra time in advance to clients.</p>
<p>I must compliment the author for writing this reference book about security issues on the internet. It is easy to see that a lot of research has gone into this book. Bottom line this isn’t a fun developing book but it will certainly improve your quality as a developer.</p>
<p>The books <a href="http://shop.oreilly.com/product/9781593273880.do">product page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2012/the-tangled-web-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book review: JavaScript Web Applications</title>
		<link>http://www.wonderolie.nl/2011/book-review-javascript-web-applications/</link>
		<comments>http://www.wonderolie.nl/2011/book-review-javascript-web-applications/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 21:11:40 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=123</guid>
		<description><![CDATA[Author: Alex MacCaw publisher: O&#8217;Reilly Media pages: 280 Introduction A book to create javascript applications for the intermediate javascript developer. This book gives you a kickstart, helps you choose the right framework, and architectural choices for your application Review The book has a fast pace, no thoroughly introduction of MVC, I think this is justified. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://shop.oreilly.com/product/0636920018421.do"><img class="alignnone" src="http://www.wonderolie.nl/wp-content/uploads/2011/11/javacript-web-applications.gif" alt="Book cover of Javacript Web Applications" width="180" height="236" /></a></p>
<ul>
<li>Author: Alex MacCaw</li>
<li>publisher: O&#8217;Reilly Media</li>
<li>pages: 280</li>
</ul>
<h3>Introduction</h3>
<p>A book to create javascript applications for the intermediate javascript developer. This book gives you a kickstart, helps you choose the right framework, and architectural choices for your application</p>
<h3>Review</h3>
<p>The book has a fast pace, no thoroughly introduction of MVC, I think this is justified. MVC has been explained a lot of times the last decade. The author of this book explains a lot of modern frameworks en modern technologies</p>
<p>This book is not for the novice javscript developers even the intermediate developers can have a hard task grasping the contents of this book. You need to understand the core of javascript and jQuery as well as design patterns, at least a couple of them to get the most out of this book.</p>
<p>Personally for me the topic of this book is a bit overkill for the web applications I develop. Hence if the scale of my webapps grows more complex I will definitely turn to this book. It will explain a lot of usefull state of the art Javascript MVC frameworks.</p>
<p>After explaining several ways of working with events in javascript application the author starts digging into MVC. First a chapter on Models and ORM (Object-relational mapping) and how to populate your model with external data. Offline as well as online storage of the model is also described in this chapter. The next chapter is about the controller, the best ways of event delegation and accessing the views. And finally the views itself, with modern js templating techniques. After the MVC foundation Spine.js and Backbone.js are introduced and explained. Two of the most known patterns for small ( spine.js ) to large ( Backbone.js ) web applications.</p>
<p>I also liked to addional information on modern topics like LESS ans CSS 3 and NodeJS. For me this was pure complementary information, and I had rather seen some more introduction in the beginning.</p>
<h3>Bottom line</h3>
<p>JavaScript Web Application is a must have book to plan and develop larger applications. It tells you everything you need to know to structure a application, but I think it would help to read other book before this book to get the most out of it, for example <a title="Javascript Patterns" href="http://shop.oreilly.com/product/9780596806767.do">Javascript Patterns</a>. The books <a href="http://shop.oreilly.com/product/0636920018421.do">product page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/book-review-javascript-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Node.js on Windows part 1: simple introduction</title>
		<link>http://www.wonderolie.nl/2011/node-js-on-windows-part-1-simple-introduction/</link>
		<comments>http://www.wonderolie.nl/2011/node-js-on-windows-part-1-simple-introduction/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 20:16:13 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=114</guid>
		<description><![CDATA[For a couple of months I was intrigued by node.js, but i couldn’t find any simple guides to start with node on windows. It turns out it is actually very simple to start learning node.js on windows. To start you need 4 things. The windows node server, nodejs.exe download at http://nodejs.org A hello world node [...]]]></description>
			<content:encoded><![CDATA[<p>For a couple of months I was intrigued by node.js, but i couldn’t find any simple guides to start with node on windows. It turns out it is actually very simple to start learning node.js on windows. To start you need 4 things.</p>
<ol>
<li>The windows node server, nodejs.exe download at <a title="nodejs site" href="http://nodejs.org">http://nodejs.org</a></li>
<li>A hello world node script ( example.js )</li>
<li>A command promt, set at the same locations as the script en node server</li>
<li>And of course a browser</li>
</ol>
<h3>Hello World script</h3>
<p>Save the script below as example.js in the same directory as the downloaded node.exe file.</p>
<pre>
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('&lt;h1&gt;Hello Nodejs&lt;/h1&gt;');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
</pre>
<h3>Start your first node script</h3>
<p>Now all you need to do are the following steps.</p>
<ol>
<li>Start node.exe</li>
<li>execute the script with the command prompt:  node example.js</li>
<li>browse to the node server wich is running at: http://127.0.0.1:1337/</li>
</ol>
<p>Your screen should be comparable to the screenshot below</p>
<p><img src="http://www.wonderolie.nl/wp-content/uploads/2011/11/node-setup.jpg" alt="a screenshot of the node.js setup" /></p>
<p>I hope this was as easy for you as it was for me. For now I hope to wire some more intersting blog posts about Node on Windows, for example Node on IIS, but in the next post I will explore node.js a bit deeper</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/node-js-on-windows-part-1-simple-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supercharged JavaScript Graphics book review.</title>
		<link>http://www.wonderolie.nl/2011/supercharged-javascript-graphics-book-review/</link>
		<comments>http://www.wonderolie.nl/2011/supercharged-javascript-graphics-book-review/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 18:51:05 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=106</guid>
		<description><![CDATA[Author: Raffaele Cecco publisher: O&#8217;Reilly Media pages: 280 Introduction A pleasant book written by an author with lots of experience. The examples are fun, and realistic. The tempo of the book is easy to follow for intermediate JavaScript developers. Review I like that the book begins with a DHTML example, this makes the reader really [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://oreilly.com/catalog/9781449393632/"><img alt="Book cover of Supercharged JavaScript Graphics" src="http://www.wonderolie.nl/wp-content/uploads/2011/08/supercharged-javascript-graphics.gif" class="alignnone" width="180" height="236" /></a></p>
<ul>
<li>Author: Raffaele Cecco</li>
<li>publisher: O&#8217;Reilly Media</li>
<li>pages: 280</li>
</ul>
<h3>Introduction</h3>
<p>A pleasant book written by an author with lots of experience. The examples are fun, and realistic. The tempo of the book is easy to follow for intermediate JavaScript developers.</p>
<h3>Review</h3>
<p>I like that the book begins with a DHTML example, this makes the reader really understand the fact that building the web is possible with many tools and that each tool has its cons and pros. The newest toys ( canvas, webgl etc ) aren’t necessarily the best or the fastest to build a proper user experience. In the beginning of the book the reader get acquainted with; the browser landscape, sprites, framerates and best practices for working with the DOM which is a pain for performance. The code examples are clear and luckily without excessive comments, which makes the example easy to read for the more experienced developers which are books target group.</p>
<p>The next chapters concern page enhancing techniques like scrolling effects, ui-libraries and shows the best way to create user interface elements form scratch. Al these chapters are a fine introduction for the more performance hungry subjects of games. </p>
<p>The second part of the book dicusses games, staring with a DHTML version of space invaders. This game example incorporates a lot previeous learned techniques en demonstrates the power and performance of well used DHTML.</p>
<p>Of course the power of the newer toys are easy to see with the examples in the book for example the ( recursive ) tree example is a brilliant example of the performance of the canvas element. The bigger part of this book emphasizes on the canvas element. The book clearly demonstrates the posibillities and raw power of the element.</p>
<p>The following chapters cover mobile javascript graphics, phonegap and the Google Charts API.<br />
At first the mix of topics seemed strange to me, however the chapter were really fun to read and I will definitilly use Google Charts in upcoming projects if needed.  jQuery Mobile is equally interesting, though personally I would probably take a more responsive way in the future with embedding the touch events into a global library for websites.</p>
<h3>Bottom line</h3>
<p>this book definitely is a fun read supported by excellent examples for medior to advanced javascript developers who develop applications at his moment, the author makes use of contemporary, but proven libraries and API’s . Which is a plus these days with swift innovation cycles.</p>
<p>The books <a href="http://oreilly.com/catalog/9781449393632">product page</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/supercharged-javascript-graphics-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Canvas book review</title>
		<link>http://www.wonderolie.nl/2011/html5-canvas-book-review/</link>
		<comments>http://www.wonderolie.nl/2011/html5-canvas-book-review/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 11:17:17 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=101</guid>
		<description><![CDATA[Author: Steve Fulton, Jeff Fulton publisher: O&#8217;Reilly Media pages: 652 Summary Finally one extensive book over the Canvas element. This should attract the more creative ( Javascript ) programmers. I find it hard to describe the entry level of this book, however I get the feeling that novice to medior (JavaScript) developers should get along [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://oreilly.com/catalog/0636920013327"><img alt="Book cover of HTML5 CANVAS" src="http://www.wonderolie.nl/wp-content/uploads/2011/06/oreilly-canvas.gif" class="alignnone" width="180" height="236" /></a></p>
<ul>
<li>Author: Steve Fulton, Jeff Fulton</li>
<li>publisher: O&#8217;Reilly Media</li>
<li>pages: 652</li>
</ul>
<h3>Summary</h3>
<p>Finally one extensive book over the Canvas element. This should attract the more creative ( Javascript ) programmers. I find it hard to describe the entry level of this book, however I get the feeling that novice to medior (JavaScript) developers should get along with the book.</p>
<h3>Review</h3>
<p>I like the introduction of the all the canvas properties, the authors filled the book with easy to follow comprehensive examples. The examples let the reader experiment with the features of Canvas. Most of the examples have some minor cross-browser issues since the canvas element is not stable yet, but the book describes these issues open and sincere which I liked. After the reader gets acquainted with the canvas element the books start with game programming and animation mathematics. The animations and math reminds me of former actionscript book, but still I learned a lot from these chapters. Flash cannot be compared one-on-one with canvas regarding; performance, animation, collision detection and resource management.</p>
<p>After the game sections the book briefly touches mobile applications with phoneGap and 3d with webGL. I liked these sections but I am not sure if these sections are relevant for this book.</p>
<p>But still the canvas is an amazing element and this books opens up a new world in html, for example chapter 5 shows some impressive examples of how easy it is to combine video with canvas; transformations, bitmap filtering its all possible. It is exiting to see that every new browser generation will be faster and will open new possibilities.</p>
<p>It would be nice to see some additional information in the next edition regarding business applications, for example how to overcome sandbox issues when uploading images to canvas.</p>
<h3>Conclusion</h3>
<p>But overall I can recommend this book to every developer who wants to be creative with the web. This book provides a solid path for developing Canvas games/ applications with a solid performance. The books <a href="http://oreilly.com/catalog/0636920013327">product page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/html5-canvas-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rotate canvas on mouse drag</title>
		<link>http://www.wonderolie.nl/2011/rotate-canvas-on-mouse-drag/</link>
		<comments>http://www.wonderolie.nl/2011/rotate-canvas-on-mouse-drag/#comments</comments>
		<pubDate>Tue, 24 May 2011 18:38:46 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=89</guid>
		<description><![CDATA[Get the source at Github For a larger project of mine i needed to find a way to rotate cavas elements on mousedrag. So here’s my attempt to create this user interface functionality. Source and example Watch the demo Seperate steps First I divided the script into logical steps to simplify the problem. create a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/jeroenoliemans/wonderolie/tree/master/RotateCanvas" title="github repository link">Get the source at Github</a></p>
<p>For a larger project of mine i needed to find a way to rotate cavas elements on mousedrag. So here’s my attempt to create this user interface functionality. </p>
<h3>Source and example</h3>
<p><a href="http://www.wonderolie.nl/examples/rotatecanvas/" title="demo">Watch the demo</a></p>
<p><a href="http://www.wonderolie.nl/examples/rotatecanvas/"><img src="http://www.wonderolie.nl/wp-content/uploads/2011/05/rotatecanvas.jpg" alt="rotate canvas demo" /></a></p>
<h3>Seperate steps</h3>
<p>First I divided the script into logical steps to simplify the problem.</p>
<ol>
<li>create a update function for the canvas.</li>
<li>setup the mousehandlers to register the “drag” event</li>
<li>create a helper function to calculate the angle between 2 coordinates</li>
</ol>
<p>The key for this functionality is that the starting angle of the drag always differs. This causes the canvas drawing to jump to unwanted angles if the script does not compensate for this. </p>
<pre>
$( model.cnv ).mousedown(function(event){
    // calculate click angle minus the last angle
    var clickAngle = getAngle(cX + offX, cY + offY, event.clientX, event.clientY )
       - model.angle;
    $( model.cnv ).bind("mousemove", clickAngle, function(event){
      // calculate move angle minus the angle onclick
      model.angle =  ( getAngle( cX + offX, cY + offY, event.clientX, event.clientY  )
       - clickAngle);
      updateRectangle(model.angle);
    });
});
</pre>
<p>I have not tested the script with other shapes than rectangles and squares, but the script should work fine as long as the canvas elements have ‘bounding box’ with a width and height. Of course this example is a starting point and the interface could use some custom cursors or icons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/rotate-canvas-on-mouse-drag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: The Definitive Guide, Sixth Edition</title>
		<link>http://www.wonderolie.nl/2011/javascript-the-definitive-guide-sixth-edition/</link>
		<comments>http://www.wonderolie.nl/2011/javascript-the-definitive-guide-sixth-edition/#comments</comments>
		<pubDate>Fri, 06 May 2011 20:38:34 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=85</guid>
		<description><![CDATA[Author: David Flanagan publisher: O&#8217;Reilly Media pages: 1100 Summary Novice to advanced this book will open the web as your playground, a full course on JavaScript including the new features and API’s of HTML5. It will be hard to find any topic about JavaScript which not discussed in this book. Review First a short introduction [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.wonderolie.nl/wp-content/uploads/2011/05/JS-definitive-guide.gif" alt="Javascript the definitive guide: book cover" /></p>
<ul>
<li>Author: David Flanagan</li>
<li>publisher: O&#8217;Reilly Media</li>
<li>pages: 1100</li>
</ul>
<h3>Summary</h3>
<p>Novice to advanced this book will open the web as your playground, a full course on JavaScript including the new features and API’s of HTML5. It will  be hard to find any topic about JavaScript which not discussed in this book. </p>
<h3>Review</h3>
<p>First a short introduction about me as the reviewer of this extensive Javascript book. I have worked with JavaScript for about 6 years, the last 2 years I dived more deeply into JavaScript, the main reason for this is freedom. I was mentally unrestricted in Flash and Actionscript 3, and I needed to free my mind for javascript as well.</p>
<p>Before this book I  have read two other O&#8217;Reilly JavaScript publications; JavaScript the good parts and Javascript Patterns. Both excellent books to get a firm grasp of : structure, development and best practices of JavaScript.</p>
<p>For me the timing was right to dig deeper into the &#8220;framework&#8221; of JavaScript.</p>
<p>It immediately became clear that a lot of research has been packed into this book. The first sections explains the core features of Javascript this should get the reader quickly programming JavaScript in a right way. It is nice to see that the code examples in this section are short and self explanatory.</p>
<p>I read the second part with a lot of fun, this section fully prepares developers for ECMAScript 5 and HTLM 5. I learned a lot of new stuff and browser specific details. Possible pitfalls implementing new standards are clearly described. Some of the chapters I really liked were: Handling Events (17), Scripted Media and Graphics ( 21 )  and HTML5 API’s (22).</p>
<p>The reference is very handy, I already  have used it a lot of times. It is nice to have good reference, it’s a fast, reliable and up-to-date way to look things up once familliair with the reference layout. Most times faster than a google request. With the confidence of getting clear and concise code examples.</p>
<p>To conclude this review I can say that this book is a must have for every “future-eager” front-end developer. This book reminds me of my worn “Essential Actionscript 3.0” book. “Essential Javascript” a.k.a Javascript the definitive guide 6th Edition can be bought <a href="http://oreilly.com/catalog/9780596805524/" title="the product page of: Javascript the definitive guide" />O’Reilly</a> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/javascript-the-definitive-guide-sixth-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessible Animated Canvas Menu</title>
		<link>http://www.wonderolie.nl/2011/accessible-animated-canvas-menu/</link>
		<comments>http://www.wonderolie.nl/2011/accessible-animated-canvas-menu/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 18:48:18 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=77</guid>
		<description><![CDATA[Get the source at Github A few years ago a lot of websites used an animated flash menu for their navigation. The smarter ones were build progressive above the html list. This is a canvas implementation of the same principle. Source and example Watch the demo Thinking about the menu I had several strategies. Create [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/jeroenoliemans/wonderolie/tree/master/CanvasMenu" title="github repository link">Get the source at Github</a><br />
A few years ago a lot of websites used an animated flash menu for their navigation. The smarter ones were build progressive above the html list. This is a canvas implementation of the same principle.</p>
<h3>Source and example</h3>
<p><a href="http://www.wonderolie.nl/examples/CanvasMenu/" title="demo">Watch the demo</a></p>
<p><a href="http://www.wonderolie.nl/examples/CanvasMenu/" title="demo"><img src="http://www.wonderolie.nl/wp-content/uploads/2011/03/canvasmenu.jpg" alt="canvas menu" /></a></p>
<p>Thinking about the menu I had several strategies. </p>
<ul>
<li>Create a canvas for each menu item</li>
<li>Create one canvas which contains the menu items and one moving canvas for the hover animation</li>
</ul>
<p>I chose for the latter one because i had the feeling that the performance would be better with large menu’s. Of course more creative menu’s can be be created with separate canvas elements for each menu item.</p>
<p>The script consist of three parts.</p>
<ul>
<li>Reading out the html and building the menu and creating the animation canvas.</li>
<li>Event handling.</li>
<li>Tracking the mouse position for button clicks and hover states.</li>
</ul>
<p>This way it is possible again to create irritating accessible menu’s <img src='http://www.wonderolie.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  . Luckily most clients nowadays avoids animating menu. But trends are known to die end come back again. I still need to find a proper way to position canvas elements and offsetting the origin for mouse calculations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/accessible-animated-canvas-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book review: jQuery 1.4 Plugin Development</title>
		<link>http://www.wonderolie.nl/2011/book-review-jquery-1-4-plugin-development/</link>
		<comments>http://www.wonderolie.nl/2011/book-review-jquery-1-4-plugin-development/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 20:49:24 +0000</pubDate>
		<dc:creator>Wonderolie</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.wonderolie.nl/?p=72</guid>
		<description><![CDATA[Author: Giulio Bai publisher: packt publishing pages: 261 Introduction Previous month Packt Publishing send me a request by e-mail for a book review. Of course I was honoured and since the book fitted nicely in my main interest, namely webdevelopment, I read the book and wrote the review below. First impression, a good book with [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Author: Giulio Bai</li>
<li>publisher: packt publishing</li>
<li>pages: 261</li>
</ul>
<h3>Introduction</h3>
<p>Previous month Packt Publishing send me a request by e-mail for a book review. Of course I was honoured and since the book fitted nicely in my main interest, namely webdevelopment, I read the book and wrote the review below.</p>
<p>First impression, a good book with a fast pace. First three global chapters, then on to the fun stuff creating plugins.</p>
<p><a href="https://www.packtpub.com/jquery-plugin-development-beginners-guide/book"  title="A great for developing jQuery plugins"><img src="http://www.wonderolie.nl/examples/review-jqueryplugindevelopement/book_jqueryplugindev-232x300.jpg" alt="Book: Jquery Plugin development" /></a></p>
<h3>Review</h3>
<p>The first three chapters provide a concise but clear introduction to the jQuery API and how to create plugins. The rest of the book describes the creation of plugins in different categories. For example images, audio or form plugins.  I really liked this setup, the instructions are very clear and only describe the core of the plugin’s, sometimes with a little added CSS. The advantage of this approach that it is easy for beginners to understand the inner workings of existing plugins. With this understanding it will be easy to expand the plugins  to the requirements of the reader. The past years I have used and modified a lot of plugins, I wish I had a book like this from the start.</p>
<p>Even with the experience of a few years of jquery the book is a nice recapitulation of the inner working of the plugins used daily. This book also reminded of some forgotten plugins I wanted to check out.</p>
<p>Another aspect I liked is that the author starts including a custom jquery.center.js plugin to be used in the gallery plugin ( chapter 4 ) and the video plugin ( chapter 6 ) right from the start, this  teaches DRY right from the start ( of course with the cost of additional HTTPRequests, but that’s another topic ).</p>
<p>After the first half of the book the plugins get slightly more complex. During these chapters the author familiarizes the reader with more complex jQuery subjects like: custom filters, regular expressions and regular JavaScript. It is nice to see that regular Javascript is used when possible, it is good that the author shows how elegant it is to use Javascript inside jQuery. To my opinion too many developers try to avoid regular Javascript if possible, that a shame because the real power comes with jQuery and JavaScript together.</p>
<p>The last chapter is fun to the the author discusses some of his favourite plugins. The showcased plugin are either very useful and easy to use or display the possible power of jQuery/ Javascript.</p>
<p>Overall this book is a perfect addition to a jQuery learning book. It teaches the creation of jQuery plugins as well as the structure and thoughts behind common plugins. This knowledge comes in very handy exploring the vast amount of jQuery plugins.</p>
<p> if you’re interested, you can buy <a href="https://www.packtpub.com/jquery-plugin-development-beginners-guide/book"  title="A great for developing jQuery plugins">the book</a> at Packt publishing.</p>
<h3>Chapters</h3>
<ol>
<li>What is jQuery About?</li>
<li>Plugins Basics</li>
<li>Our First jQuery Plugin</li>
<li>Media Plugins: Images Plugins</li>
<li>Media Plugins: Audio Plugins</li>
<li>Media Plugins: Video Plugins</li>
<li>Form Plugins</li>
<li>User Interface Plugins</li>
<li>User Interface Plugins: Tooltip Plugins</li>
<li>User Interface Plugins: Menu and Navigation Plugins</li>
<li>Animation Plugins</li>
<li>Utility Plugins</li>
<li>Top jQuery Plugins</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.wonderolie.nl/2011/book-review-jquery-1-4-plugin-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

