/* * Copyright (c) 2011 RĂ³bert Pataki * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * ---------------------------------------------------------------------------------------- * * Check out my GitHub: http://github.com/heartcode/ * Send me an email: heartcode@robertpataki.com * Follow me on Twitter: http://twitter.com/#iHeartcode * Blog: http://heartcode.robertpataki.com */ /** * CanvasLoader uses the HTML5 canvas element in modern browsers and VML in IE6/7/8 to create and animate the most popular preloader shapes (oval, spiral, rectangle, square and rounded rectangle).

* It is important to note that CanvasLoader doesn't show up and starts rendering automatically on instantiation. To start rendering and display the loader use the show() method. * @module CanvasLoader **/ (function (window) { "use strict"; /** * CanvasLoader is a JavaScript UI library that draws and animates circular preloaders using the Canvas HTML object.

* A CanvasLoader instance creates two canvas elements which are placed into a placeholder div (the id of the div has to be passed in the constructor). The second canvas is invisible and used for caching purposes only.

* If no id is passed in the constructor, the canvas objects are paced in the document directly. * @class CanvasLoader * @constructor * @param id {String} The id of the placeholder div * @param opt {Object} Optional parameters

* Possible values of optional parameters:
*