From 85485e58b8eb1bd33a04200e89be0298fde7ce68 Mon Sep 17 00:00:00 2001 From: markmoulard Date: Sun, 22 Jun 2014 14:26:37 +0200 Subject: [PATCH 01/11] Sass template integration based on the less template --- src/js/manager/stylesheet.js | 8 +++-- src/js/module/stitches.js | 2 +- src/js/stylesheet/sass.js | 62 +++++++++++++++++++++++++++++++++++ src/js/util/templates.js | 26 +++++++++++++-- src/templates/less.tpl | 2 +- src/templates/sass-markup.tpl | 7 ++++ src/templates/sass.tpl | 16 +++++++++ src/templates/stitches.tpl | 5 ++- 8 files changed, 120 insertions(+), 8 deletions(-) create mode 100644 src/js/stylesheet/sass.js create mode 100644 src/templates/sass-markup.tpl create mode 100644 src/templates/sass.tpl diff --git a/src/js/manager/stylesheet.js b/src/js/manager/stylesheet.js index edc6e42f..301092cd 100644 --- a/src/js/manager/stylesheet.js +++ b/src/js/manager/stylesheet.js @@ -11,16 +11,18 @@ define([ "wrap/jquery", "stylesheet/css", - "stylesheet/less" + "stylesheet/less", + "stylesheet/sass" ], -function ($, CssStylesheet, LessStylesheet) { +function ($, CssStylesheet, LessStylesheet, SassStylesheet) { "use strict"; // **Canvas stylesheet managers** var managers = { css: CssStylesheet, - less: LessStylesheet + less: LessStylesheet, + sass: SassStylesheet }; // **Module definition** diff --git a/src/js/module/stitches.js b/src/js/module/stitches.js index 4dbe1166..133a23ba 100644 --- a/src/js/module/stitches.js +++ b/src/js/module/stitches.js @@ -34,7 +34,7 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style prefix: "sprite", // default stylesheet class prefix padding: 5, // default padding around sprites in pixels uri: false, // whether or not to include the data-uri image (quite large) - stylesheet: "css" // either css or less at the moment + stylesheet: "css" // either css, less or sass at the moment }; /** diff --git a/src/js/stylesheet/sass.js b/src/js/stylesheet/sass.js new file mode 100644 index 00000000..993190de --- /dev/null +++ b/src/js/stylesheet/sass.js @@ -0,0 +1,62 @@ +/** + * # stylesheet/sass + * + * Base constructor for the SASS stylesheet manager + * + * > http://draeton.github.io/stitches
+ * > Copyright 2013 Matthew Cobbs
+ * > Licensed under the MIT license. + */ + +define([ + "wrap/jquery", + "util/util", + "util/templates", + "stylesheet/base" +], +function ($, util, templates, BaseStylesheet) { + + "use strict"; + + var defaults = { + filename: "spritesheet.png" + }; + + /** + * ## SassStylesheet + * Create a new `SassStylesheet` instance + * + * @constructor + * @param {object} options + */ + var SassStylesheet = function (options) { + this.settings = $.extend({}, defaults, options); + }; + + util.inherit(SassStylesheet, BaseStylesheet, { + template: templates.sassMarkup, + + /** + * ### @get + * Returns a stylesheet to place images with spritesheet + * + * @param {array} sprites A list of sprites + * @param {string} spritesheet The data URL of the spritesheet + * @param {string} prefix Used to create CSS classes + * @param {boolean} uri Switch including image as data URI + * @return string + */ + get: function (sprites, spritesheet, prefix, uri) { + var backgroundImage = uri ? spritesheet : this.settings.filename; + + return templates.sass({ + prefix: prefix, + backgroundImage: backgroundImage, + sprites: sprites + }); + } + }); + + return SassStylesheet; + +}); \ No newline at end of file diff --git a/src/js/util/templates.js b/src/js/util/templates.js index cf21ccae..3a03015f 100644 --- a/src/js/util/templates.js +++ b/src/js/util/templates.js @@ -15,9 +15,11 @@ define([ "tpl!../../templates/css.tpl", "tpl!../../templates/css-markup.tpl", "tpl!../../templates/less.tpl", - "tpl!../../templates/less-markup.tpl" + "tpl!../../templates/less-markup.tpl", + "tpl!../../templates/sass.tpl", + "tpl!../../templates/sass-markup.tpl" ], -function (stitchesTemplate, downloadsTemplate, spriteTemplate, cssTemplate, cssMarkupTemplate, lessTemplate, lessMarkupTemplate) { +function (stitchesTemplate, downloadsTemplate, spriteTemplate, cssTemplate, cssMarkupTemplate, lessTemplate, lessMarkupTemplate, sassTemplate, sassMarkupTemplate) { "use strict"; @@ -91,6 +93,26 @@ function (stitchesTemplate, downloadsTemplate, spriteTemplate, cssTemplate, cssM */ lessMarkup: function () { return lessMarkupTemplate.apply(this, arguments); + }, + + /** + * ### @sass + * Returns the sass template + * + * @return string + */ + sass: function () { + return sassTemplate.apply(this, arguments); + }, + + /** + * ### @sassMarkup + * Returns the sass markup template + * + * @return string + */ + sassMarkup: function () { + return sassMarkupTemplate.apply(this, arguments); } }; diff --git a/src/templates/less.tpl b/src/templates/less.tpl index b5f976e1..eb88609b 100644 --- a/src/templates/less.tpl +++ b/src/templates/less.tpl @@ -5,7 +5,7 @@ }\n \n .<%= prefix %> {\n - background-image: url(<%= backgroundImage %>); + background-image: url(<%= backgroundImage %>);\n background-repeat: no-repeat;\n display: block;\n <% $.map(sprites, function (sprite) { %> diff --git a/src/templates/sass-markup.tpl b/src/templates/sass-markup.tpl new file mode 100644 index 00000000..96fd1b0f --- /dev/null +++ b/src/templates/sass-markup.tpl @@ -0,0 +1,7 @@ +<% $.map(sprites, function (sprite) { %> +<% if (tooltip) { %> + +<% } else { %> +\n +<% } %> +<% }); %> \ No newline at end of file diff --git a/src/templates/sass.tpl b/src/templates/sass.tpl new file mode 100644 index 00000000..55cb2a21 --- /dev/null +++ b/src/templates/sass.tpl @@ -0,0 +1,16 @@ +@mixin stitches-<%= prefix %>($x: 0, $y: 0, $width: 0, $height: 0)\n + background-position: $x $y\n + width: $width\n + height: $height\n +\n +.<%= prefix %> \n + background-image: url(<%= backgroundImage %>)\n + background-repeat: no-repeat\n + display: block\n +<% $.map(sprites, function (sprite) { %> +\n + <%= prefix %>-<%= sprite.name %>\n + @include stitches-<%= prefix %>(<%= sprite.left(true) %>, <%= sprite.top(true) %>, <%= sprite.image.width %>px, <%= sprite.image.height %>px)\n + \n +<% }); %> +\n \ No newline at end of file diff --git a/src/templates/stitches.tpl b/src/templates/stitches.tpl index db7c89ce..71fb1c0b 100644 --- a/src/templates/stitches.tpl +++ b/src/templates/stitches.tpl @@ -90,7 +90,7 @@
- +
From 19497f3ebb5c142bcf1cfe67af858921715664f2 Mon Sep 17 00:00:00 2001 From: markmoulard Date: Mon, 30 Jun 2014 07:08:41 +0200 Subject: [PATCH 02/11] Responsive design (percentage units) integration --- src/js/manager/stylesheet.js | 5 ++++- src/js/module/sprite.js | 16 ++++------------ src/js/module/stitches.js | 35 +++++++++++++++++++++++++++++------ src/js/stylesheet/base.js | 2 +- src/js/stylesheet/css.js | 7 +++++-- src/js/stylesheet/less.js | 7 +++++-- src/js/stylesheet/sass.js | 7 +++++-- src/js/util/util.js | 11 ----------- src/templates/css-markup.tpl | 2 +- src/templates/css.tpl | 22 +++++++++++++++++++--- src/templates/less-markup.tpl | 2 +- src/templates/less.tpl | 30 +++++++++++++++++++++++++++++- src/templates/sass-markup.tpl | 2 +- src/templates/sass.tpl | 29 +++++++++++++++++++++++++++-- src/templates/stitches.tpl | 12 ++++++++++++ 15 files changed, 143 insertions(+), 46 deletions(-) diff --git a/src/js/manager/stylesheet.js b/src/js/manager/stylesheet.js index 301092cd..053ef584 100644 --- a/src/js/manager/stylesheet.js +++ b/src/js/manager/stylesheet.js @@ -56,8 +56,11 @@ function ($, CssStylesheet, LessStylesheet, SassStylesheet) { var spritesheet = options.spritesheet; var prefix = options.prefix; var uri = options.uri; + var width = options.width; + var height = options.height; + var units = options.units; - var styles = this.manager.get(sprites, spritesheet, prefix, uri); + var styles = this.manager.get(sprites, spritesheet, prefix, uri, width, height, units); styles = styles.replace(/\\n/g, "\n"); return styles; diff --git a/src/js/module/sprite.js b/src/js/module/sprite.js index 8d37b629..4fec0155 100644 --- a/src/js/module/sprite.js +++ b/src/js/module/sprite.js @@ -210,28 +210,20 @@ function($, util, templates) { * ### @left * Returns the x position of the sprite accounting for padding * - * @param {boolean} isPx Method returns px value * @return number || string */ - left: function (isPx) { - var left = this.x + this.padding; - - // left style position is always negative - return isPx ? util.toPx(-left) : left; + left: function () { + return (this.x + this.padding); }, /** * ### @top * Returns the y position of the sprite accounting for padding * - * @param {boolean} isPx Method returns px value * @return number || string */ - top: function (isPx) { - var top = this.y + this.padding; - - // top style postion is always negative - return isPx ? util.toPx(-top) : top; + top: function (unit, canvasHeight) { + return (this.y + this.padding); }, /** diff --git a/src/js/module/stitches.js b/src/js/module/stitches.js index 133a23ba..e1940b13 100644 --- a/src/js/module/stitches.js +++ b/src/js/module/stitches.js @@ -29,12 +29,16 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style "use strict"; + var UNIT_PIXELS = "pixel"; + var UNIT_PERCENT = "percent"; + var defaults = { layout: "compact", // default canvas sprite placement layout prefix: "sprite", // default stylesheet class prefix padding: 5, // default padding around sprites in pixels uri: false, // whether or not to include the data-uri image (quite large) - stylesheet: "css" // either css, less or sass at the moment + stylesheet: "css", // either css, less or sass at the moment + units: UNIT_PIXELS // Units of the spritesheet }; /** @@ -84,6 +88,9 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style if (store && !store.disabled) { settings = store.get("stitches-settings"); + if (!settings.units) { + settings.units = UNIT_PIXELS; + } } if (settings) { @@ -304,6 +311,15 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style self.updateSettings(); } }, + units: { + "change": function (e) { + var $checked = this.$element.find("input[name=units]:checked"); + var value = $checked.val(); + self.settings.units = value; + + self.updateSettings(); + } + }, prefix: { "input blur": function (e) { var value = $(e.currentTarget).val(); @@ -500,7 +516,6 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style */ openSettings: function (e) { this.closePalettes(); - this.palettes.settings.configure({ source: this.settings, inputs: { @@ -508,7 +523,8 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style stylesheet: this.settings.stylesheet, prefix: this.settings.prefix, padding: this.settings.padding, - uri: this.settings.uri + uri: this.settings.uri, + units: this.settings.units } }); @@ -655,6 +671,7 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style prefix: this.settings.prefix, spritesheet: this.spritesheet, stylesheet: this.stylesheet, + units: this.units, stylesheetWithUri: this.stylesheetWithUri, stylesheetType: stylesheetManager.type, stylesheetLines: this.stylesheet.split("\n").length, @@ -718,12 +735,15 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style sprites: this.canvas.sprites, dimensions: this.canvas.dimensions }); - + this.stylesheetWithUri = stylesheetManager.getStylesheet({ sprites: this.canvas.sprites, spritesheet: this.spritesheet, prefix: this.settings.prefix, - uri: true + uri: true, + width: this.canvas.dimensions.width, + height: this.canvas.dimensions.height, + units: this.settings.units }); this.markup = stylesheetManager.getMarkup({ @@ -747,7 +767,10 @@ function($, Modernizr, store, util, templates, fileManager, layoutManager, style sprites: this.canvas.sprites, spritesheet: this.spritesheet, prefix: this.settings.prefix, - uri: this.settings.uri + uri: this.settings.uri, + width: this.canvas.dimensions.width, + height: this.canvas.dimensions.height, + units: this.settings.units }); } diff --git a/src/js/stylesheet/base.js b/src/js/stylesheet/base.js index 2c548b5e..7d7f434e 100644 --- a/src/js/stylesheet/base.js +++ b/src/js/stylesheet/base.js @@ -45,7 +45,7 @@ function ($) { * @param {boolean} uri Switch including image as data URI * @return string */ - get: function (sprites, spritesheet, prefix, uri) {}, + get: function (sprites, spritesheet, prefix, uri, width, height, units) {}, /** * ### @markup diff --git a/src/js/stylesheet/css.js b/src/js/stylesheet/css.js index 8e41b475..13df17af 100644 --- a/src/js/stylesheet/css.js +++ b/src/js/stylesheet/css.js @@ -46,13 +46,16 @@ function ($, util, templates, BaseStylesheet) { * @param {boolean} uri Switch including image as data URI * @return string */ - get: function (sprites, spritesheet, prefix, uri) { + get: function (sprites, spritesheet, prefix, uri, width, height, units) { var backgroundImage = uri ? spritesheet : this.settings.filename; return templates.css({ prefix: prefix, backgroundImage: backgroundImage, - sprites: sprites + sprites: sprites, + canvasWidth: width, + canvasHeight: height, + units: units }); } }); diff --git a/src/js/stylesheet/less.js b/src/js/stylesheet/less.js index 062cf168..c4ceceab 100644 --- a/src/js/stylesheet/less.js +++ b/src/js/stylesheet/less.js @@ -46,13 +46,16 @@ function ($, util, templates, BaseStylesheet) { * @param {boolean} uri Switch including image as data URI * @return string */ - get: function (sprites, spritesheet, prefix, uri) { + get: function (sprites, spritesheet, prefix, uri, width, height, units) { var backgroundImage = uri ? spritesheet : this.settings.filename; return templates.less({ prefix: prefix, backgroundImage: backgroundImage, - sprites: sprites + sprites: sprites, + canvasWidth: width, + canvasHeight: height, + units: units }); } }); diff --git a/src/js/stylesheet/sass.js b/src/js/stylesheet/sass.js index 993190de..42241977 100644 --- a/src/js/stylesheet/sass.js +++ b/src/js/stylesheet/sass.js @@ -46,13 +46,16 @@ function ($, util, templates, BaseStylesheet) { * @param {boolean} uri Switch including image as data URI * @return string */ - get: function (sprites, spritesheet, prefix, uri) { + get: function (sprites, spritesheet, prefix, uri, width, height, units) { var backgroundImage = uri ? spritesheet : this.settings.filename; return templates.sass({ prefix: prefix, backgroundImage: backgroundImage, - sprites: sprites + sprites: sprites, + canvasWidth: width, + canvasHeight: height, + units: units }); } }); diff --git a/src/js/util/util.js b/src/js/util/util.js index ecda87ee..9d8d004b 100644 --- a/src/js/util/util.js +++ b/src/js/util/util.js @@ -86,17 +86,6 @@ function ($) { e.preventDefault(); e.stopPropagation(); } - }, - - /** - * ### @toPx - * Convet a number to px for stylesheets - * - * @param {string} num Pixel value - * @return string - */ - toPx: function (num) { - return num ? num + "px" : "0"; } }; diff --git a/src/templates/css-markup.tpl b/src/templates/css-markup.tpl index 0c36709c..efefa031 100644 --- a/src/templates/css-markup.tpl +++ b/src/templates/css-markup.tpl @@ -1,6 +1,6 @@ <% $.map(sprites, function (sprite) { %> <% if (tooltip) { %> -\n +\n <% } else { %> \n <% } %> diff --git a/src/templates/css.tpl b/src/templates/css.tpl index fc452767..774fb9dc 100644 --- a/src/templates/css.tpl +++ b/src/templates/css.tpl @@ -1,14 +1,30 @@ .<%= prefix %> {\n background-image: url(<%= backgroundImage %>);\n +<% if (units == "pixel") { %> background-repeat: no-repeat;\n +<% } else {%> + max-width: 100%;\n +<% } %> display: block;\n }\n <% $.map(sprites, function (sprite) { %> \n +<% if (units == "percent") { %> +.<%= prefix %>-<%= sprite.name %>-sizeNormal {\n + width: <%= sprite.width %>px;\n + height: <%= sprite.height %>px;\n +}\n +<% } %> + .<%= prefix %>-<%= sprite.name %> {\n - width: <%= sprite.image.width %>px;\n - height: <%= sprite.image.height %>px;\n - background-position: <%= sprite.left(true) %> <%= sprite.top(true) %>;\n +<% if (units == "percent") { %> + background-size : <%= ((canvasWidth / sprite.width) * 100) %>% <%= ((canvasHeight / sprite.height) * 100) %>%;\n + background-position: <%= ((sprite.left() / (canvasWidth - sprite.width)) * 100) %>% <%= ((sprite.top() / (canvasHeight - sprite.height)) * 100) %>%;\n +<% } else { %> + width: <%= sprite.width %>px;\n + height: <%= sprite.height %>px;\n + background-position: -<%= sprite.left() %>px -<%= sprite.top() %>px;\n +<% } %> }\n <% }); %> \ No newline at end of file diff --git a/src/templates/less-markup.tpl b/src/templates/less-markup.tpl index 96fd1b0f..0be3f5cd 100644 --- a/src/templates/less-markup.tpl +++ b/src/templates/less-markup.tpl @@ -1,6 +1,6 @@ <% $.map(sprites, function (sprite) { %> <% if (tooltip) { %> - + <% } else { %> \n <% } %> diff --git a/src/templates/less.tpl b/src/templates/less.tpl index eb88609b..9564eb9f 100644 --- a/src/templates/less.tpl +++ b/src/templates/less.tpl @@ -1,17 +1,45 @@ +<% if (units == "pixel") { %> .stitches-<%= prefix %>(@x: 0, @y: 0, @width: 0, @height: 0) {\n background-position: @x @y;\n width: @width;\n height: @height;\n }\n +<% } else if (units == "percent") { %> +.stitches-<%= prefix %>(@x: 0, @y: 0, @width: 0, @height: 0) {\n + background-position: percentage(@x / (<%= canvasWidth %> - @width)) percentage(@y / (<%= canvasHeight %> - @height));\n + background-size: percentage(<%= canvasWidth %> / @width) percentage(<%= canvasHeight %> / @height);\n +}\n +<% } %> +\n +<% if (units == "percent") { %> +.stitches-<%= prefix %>-sizeNormal(@width: 0, @height: 0) {\n + width: @width;\n + height: @height;\n +} \n +<% }%> .<%= prefix %> {\n background-image: url(<%= backgroundImage %>);\n +<% if (units == "pixel") { %> background-repeat: no-repeat;\n +<% } else if (units == "percent") { %> + max-width: 100%;\n +<% } %> display: block;\n <% $.map(sprites, function (sprite) { %> \n +<% if (units == "percent") { %> + &.<%= prefix %>-<%= sprite.name %>-sizeNormal {\n + .stitches-<%= prefix %>-sizeNormal(<%= sprite.width %>px, <%= sprite.height %>px);\n + }\n +<% } %> + &.<%= prefix %>-<%= sprite.name %> {\n - .stitches-<%= prefix %>(<%= sprite.left(true) %>, <%= sprite.top(true) %>, <%= sprite.image.width %>px, <%= sprite.image.height %>px);\n +<% if (units == "pixel") { %> + .stitches-<%= prefix %>(-<%= sprite.left() %>px, -<%= sprite.top() %>px, <%= sprite.width %>px, <%= sprite.height %>px);\n +<% } else if (units == "percent") { %> + .stitches-<%= prefix %>(<%= sprite.left() %>, <%= sprite.top() %>, <%= sprite.width %>, <%= sprite.height %>);\n +<% } %> }\n <% }); %> }\n \ No newline at end of file diff --git a/src/templates/sass-markup.tpl b/src/templates/sass-markup.tpl index 96fd1b0f..0be3f5cd 100644 --- a/src/templates/sass-markup.tpl +++ b/src/templates/sass-markup.tpl @@ -1,6 +1,6 @@ <% $.map(sprites, function (sprite) { %> <% if (tooltip) { %> - + <% } else { %> \n <% } %> diff --git a/src/templates/sass.tpl b/src/templates/sass.tpl index 55cb2a21..8b1f3a0f 100644 --- a/src/templates/sass.tpl +++ b/src/templates/sass.tpl @@ -1,16 +1,41 @@ +<% if (units == "pixel") { %> @mixin stitches-<%= prefix %>($x: 0, $y: 0, $width: 0, $height: 0)\n background-position: $x $y\n width: $width\n height: $height\n \n +<% } else if (units == "percent") { %> +@mixin stitches-<%= prefix %>($x: 0, $y: 0, $width: 0, $height: 0)\n + background-position: percentage($x / (<%= canvasWidth %> - $width)) percentage($y / (<%= canvasHeight %> - $height))\n + background-size: percentage(<%= canvasWidth %> / $width) percentage(<%= canvasHeight %> / $height)\n +\n +<% } %> +<% if (units == "percent") { %> +@mixin stitches-<%= prefix %>-sizeNormal($width: 0, $height: 0)\n + width: $width\n + height: $height\n +\n +<% }%> .<%= prefix %> \n background-image: url(<%= backgroundImage %>)\n +<% if (units == "pixel") { %> background-repeat: no-repeat\n +<% } else { %> + max-width: 100%\n +<% } %> display: block\n <% $.map(sprites, function (sprite) { %> -\n +<% if (units == "percent") { %> + .<%= prefix %>-<%= sprite.name %>-sizeNormal\n + @include stitches-<%= prefix %>-sizeNormal(<%= sprite.width %>px, <%= sprite.height %>px)\n + \n +<% } %> <%= prefix %>-<%= sprite.name %>\n - @include stitches-<%= prefix %>(<%= sprite.left(true) %>, <%= sprite.top(true) %>, <%= sprite.image.width %>px, <%= sprite.image.height %>px)\n +<% if (units == "pixel") { %> + @include stitches-<%= prefix %>(<%= sprite.left() %>px, <%= sprite.top() %>px, <%= sprite.width %>px, <%= sprite.height %>px)\n +<% } else if (units == "percent") { %> + @include stitches-<%= prefix %>(<%= sprite.left() %>, <%= sprite.top() %>, <%= sprite.width %>, <%= sprite.height %>)\n +<% } %> \n <% }); %> \n \ No newline at end of file diff --git a/src/templates/stitches.tpl b/src/templates/stitches.tpl index 71fb1c0b..dfab7f44 100644 --- a/src/templates/stitches.tpl +++ b/src/templates/stitches.tpl @@ -103,6 +103,18 @@ + +
+ +
+ + +
+
From 688c113d69831748d47fd65a73cb10860d2bed0b Mon Sep 17 00:00:00 2001 From: markmoulard Date: Mon, 30 Jun 2014 08:01:49 +0200 Subject: [PATCH 03/11] Release of the new version --- build/stitches/js/stitches-1.3.5.js | 271 ----------------------- build/stitches/js/stitches-1.3.5.min.js | 2 - build/stitches/js/stitches-1.3.6.js | 281 ++++++++++++++++++++++++ build/stitches/js/stitches-1.3.6.min.js | 2 + 4 files changed, 283 insertions(+), 273 deletions(-) delete mode 100644 build/stitches/js/stitches-1.3.5.js delete mode 100644 build/stitches/js/stitches-1.3.5.min.js create mode 100644 build/stitches/js/stitches-1.3.6.js create mode 100644 build/stitches/js/stitches-1.3.6.min.js diff --git a/build/stitches/js/stitches-1.3.5.js b/build/stitches/js/stitches-1.3.5.js deleted file mode 100644 index e92ae87f..00000000 --- a/build/stitches/js/stitches-1.3.5.js +++ /dev/null @@ -1,271 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n-1;n-=1)if(e[n]&&t(e[n],n,e))break}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){if(n||!hasProp(e,i))r&&typeof t!="string"?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function d(e){var t,n;for(t=0;e[t];t+=1){n=e[t];if(n===".")e.splice(t,1),t-=1;else if(n===".."){if(t===1&&(e[2]===".."||e[0]===".."))break;t>0&&(e.splice(t-1,2),t-=2)}}}function v(e,t,n){var r,i,s,u,a,f,l,c,h,p,v,m=t&&t.split("/"),g=m,y=o.map,b=y&&y["*"];e&&e.charAt(0)==="."&&(t?(getOwn(o.pkgs,t)?g=m=[t]:g=m.slice(0,m.length-1),e=g.concat(e.split("/")),d(e),i=getOwn(o.pkgs,r=e[0]),e=e.join("/"),i&&e===r+"/"+i.main&&(e=r)):e.indexOf("./")===0&&(e=e.substring(2)));if(n&&(m||b)&&y){u=e.split("/");for(a=u.length;a>0;a-=1){l=u.slice(0,a).join("/");if(m)for(f=m.length;f>0;f-=1){s=getOwn(y,m.slice(0,f).join("/"));if(s){s=getOwn(s,l);if(s){c=s,h=a;break}}}if(c)break;!p&&b&&getOwn(b,l)&&(p=getOwn(b,l),v=a)}!c&&p&&(c=p,h=v),c&&(u.splice(0,h,c),e=u.join("/"))}return e}function m(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===r.contextName)return t.parentNode.removeChild(t),!0})}function g(e){var t=getOwn(o.paths,e);if(t&&isArray(t)&&t.length>1)return m(e),t.shift(),r.require.undef(e),r.require([e]),!0}function y(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function b(e,t,n,i){var s,o,u,a,f=null,c=t?t.name:null,d=e,m=!0,g="";return e||(m=!1,e="_@r"+(h+=1)),a=y(e),f=a[0],e=a[1],f&&(f=v(f,c,i),o=getOwn(l,f)),e&&(f?o&&o.normalize?g=o.normalize(e,function(e){return v(e,c,i)}):g=v(e,c,i):(g=v(e,c,i),a=y(g),f=a[0],g=a[1],n=!0,s=r.nameToUrl(g))),u=f&&!o&&!n?"_unnormalized"+(p+=1):"",{prefix:f,name:g,parentMap:t,unnormalized:!!u,url:s,originalName:d,isDefine:m,id:(f?f+"!"+g:g)+u}}function w(e){var t=e.id,n=getOwn(u,t);return n||(n=u[t]=new r.Module(e)),n}function E(e,t,n){var r=e.id,i=getOwn(u,r);hasProp(l,r)&&(!i||i.defineEmitComplete)?t==="defined"&&n(l[r]):w(e).on(t,n)}function S(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(u,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function x(){globalDefQueue.length&&(apsp.apply(f,[f.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function T(e){delete u[e]}function N(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var s=r.id,o=getOwn(u,s);o&&!e.depMatched[i]&&!n[s]&&(getOwn(t,s)?(e.defineDep(i,l[s]),e.check()):N(o,t,n))}),n[r]=!0)}function C(){var e,n,i,a,f=o.waitSeconds*1e3,l=f&&r.startTime+f<(new Date).getTime(),c=[],h=[],p=!1,d=!0;if(t)return;t=!0,eachProp(u,function(t){e=t.map,n=e.id;if(!t.enabled)return;e.isDefine||h.push(t);if(!t.error)if(!t.inited&&l)g(n)?(a=!0,p=!0):(c.push(n),m(n));else if(!t.inited&&t.fetched&&e.isDefine){p=!0;if(!e.prefix)return d=!1}});if(l&&c.length)return i=makeError("timeout","Load timeout for modules: "+c,null,c),i.contextName=r.contextName,S(i);d&&each(h,function(e){N(e,{},{})}),(!l||a)&&p&&(isBrowser||isWebWorker)&&!s&&(s=setTimeout(function(){s=0,C()},50)),t=!1}function k(e){hasProp(l,e[0])||w(b(e[0],null,!0)).init(e[1],e[2])}function L(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function A(e){var t=e.currentTarget||e.srcElement;return L(t,r.onScriptLoad,"load","onreadystatechange"),L(t,r.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function O(){var e;x();while(f.length){e=f.shift();if(e[0]===null)return S(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));k(e)}}var t,n,r,i,s,o={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},map:{},config:{}},u={},a={},f=[],l={},c={},h=1,p=1;return i={require:function(e){return e.require?e.require:e.require=r.makeRequire(e.map)},exports:function(e){e.usingExports=!0;if(e.map.isDefine)return e.exports?e.exports:e.exports=l[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return o.config&&getOwn(o.config,e.map.id)||{}},exports:l[e.map.id]}}},n=function(e){this.events=getOwn(a,e.id)||{},this.map=e,this.shim=getOwn(o.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},n.prototype={init:function(e,t,n,r){r=r||{};if(this.inited)return;this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check()},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(this.fetched)return;this.fetched=!0,r.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();r.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))},load:function(){var e=this.map.url;c[e]||(c[e]=!0,r.load(this.map.id,e))},check:function(){if(!this.enabled||this.enabling)return;var e,t,n=this.map.id,i=this.depExports,s=this.exports,o=this.factory;if(!this.inited)this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error)try{s=r.execCb(n,o,i,s)}catch(a){e=a}else s=r.execCb(n,o,i,s);this.map.isDefine&&(t=this.module,t&&t.exports!==undefined&&t.exports!==this.exports?s=t.exports:s===undefined&&this.usingExports&&(s=this.exports));if(e)return e.requireMap=this.map,e.requireModules=[this.map.id],e.requireType="define",S(this.error=e)}else s=o;this.exports=s,this.map.isDefine&&!this.ignore&&(l[n]=s,req.onResourceLoad&&req.onResourceLoad(r,this.map,this.depMaps)),delete u[n],this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}},callPlugin:function(){var e=this.map,t=e.id,n=b(e.prefix);this.depMaps.push(n),E(n,"defined",bind(this,function(n){var i,s,a,f=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null,c=r.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){n.normalize&&(f=n.normalize(f,function(e){return v(e,l,!0)})||""),s=b(e.prefix+"!"+f,this.map.parentMap),E(s,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),a=getOwn(u,s.id),a&&(this.depMaps.push(s),this.events.error&&a.on("error",bind(this,function(e){this.emit("error",e)})),a.enable());return}i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(u,function(e){e.map.id.indexOf(t+"_unnormalized")===0&&T(e.map.id)}),S(e)}),i.fromText=bind(this,function(n,s){var u=e.name,a=b(u),f=useInteractive;s&&(n=s),f&&(useInteractive=!1),w(a),hasProp(o.config,t)&&(o.config[u]=o.config[t]);try{req.exec(n)}catch(l){return S(makeError("fromtexteval","fromText eval for "+t+" failed: "+l,l,[t]))}f&&(useInteractive=!0),this.depMaps.push(a),r.completeLoad(u),c([u],i)}),n.load(e.name,c,i,o)})),r.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,s,o;if(typeof e=="string"){e=b(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,o=getOwn(i,e.id);if(o){this.depExports[t]=o(this);return}this.depCount+=1,E(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&E(e,"error",this.errback)}n=e.id,s=u[n],!hasProp(i,n)&&s&&!s.enabled&&r.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(u,e.id);t&&!t.enabled&&r.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e==="error"&&delete this.events[e]}},r={config:o,contextName:e,registry:u,defined:l,urlFetched:c,defQueue:f,Module:n,makeModuleMap:b,nextTick:req.nextTick,configure:function(e){e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/");var t=o.pkgs,n=o.shim,i={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?t==="map"?mixin(o[t],e,!0,!0):mixin(o[t],e,!0):o[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),(e.exports||e.init)&&!e.exportsFn&&(e.exportsFn=r.makeShimExports(e)),n[t]=e}),o.shim=n),e.packages&&(each(e.packages,function(e){var n;e=typeof e=="string"?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),o.pkgs=t),eachProp(u,function(e,t){!e.inited&&!e.map.unnormalized&&(e.map=b(t))}),(e.deps||e.callback)&&r.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function s(o,a,f){var c,h,p;return n.enableBuildCallback&&a&&isFunction(a)&&(a.__requireJsBuild=!0),typeof o=="string"?isFunction(a)?S(makeError("requireargs","Invalid require call"),f):t&&hasProp(i,o)?i[o](u[t.id]):req.get?req.get(r,o,t):(h=b(o,t,!1,!0),c=h.id,hasProp(l,c)?l[c]:S(makeError("notloaded",'Module name "'+c+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(O(),r.nextTick(function(){O(),p=w(b(null,t)),p.skipMap=n.skipMap,p.init(o,a,f,{enabled:!0}),C()}),s)}return n=n||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var n,i,s=e.lastIndexOf("."),o=e.split("/")[0],u=o==="."||o==="..";return s!==-1&&(!u||s>1)&&(n=e.substring(s,e.length),e=e.substring(0,s)),i=r.nameToUrl(v(e,t&&t.id,!0),n||".fake"),n?i:i.substring(0,i.length-5)},defined:function(e){return hasProp(l,b(e,t,!1,!0).id)},specified:function(e){return e=b(e,t,!1,!0).id,hasProp(l,e)||hasProp(u,e)}}),t||(s.undef=function(e){x();var n=b(e,t,!0),r=getOwn(u,e);delete l[e],delete c[n.url],delete a[e],r&&(r.events.defined&&(a[e]=r.events),T(e))}),s},enable:function(e){var t=getOwn(u,e.id);t&&w(e).enable()},completeLoad:function(e){var t,n,r,i=getOwn(o.shim,e)||{},s=i.exports;x();while(f.length){n=f.shift();if(n[0]===null){n[0]=e;if(t)break;t=!0}else n[0]===e&&(t=!0);k(n)}r=getOwn(u,e);if(!t&&!hasProp(l,e)&&r&&!r.inited){if(o.enforceDefine&&(!s||!getGlobal(s))){if(g(e))return;return S(makeError("nodefine","No define call for "+e,null,[e]))}k([e,i.deps||[],i.exportsFn])}C()},nameToUrl:function(e,t){var n,r,i,s,u,a,f,l,c;if(req.jsExtRegExp.test(e))l=e+(t||"");else{n=o.paths,r=o.pkgs,u=e.split("/");for(a=u.length;a>0;a-=1){f=u.slice(0,a).join("/"),i=getOwn(r,f),c=getOwn(n,f);if(c){isArray(c)&&(c=c[0]),u.splice(0,a,c);break}if(i){e===i.name?s=i.location+"/"+i.main:s=i.location,u.splice(0,a,s);break}}l=u.join("/"),l+=t||(/\?/.test(l)?"":".js"),l=(l.charAt(0)==="/"||l.match(/^[\w\+\.\-]+:/)?"":o.baseUrl)+l}return o.urlArgs?l+((l.indexOf("?")===-1?"?":"&")+o.urlArgs):l},load:function(e,t){req.load(r,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=A(e);r.completeLoad(t.id)}},onScriptError:function(e){var t=A(e);if(!g(t.id))return S(makeError("scripterror","Script error",e,[t.id]))}},r.require=r.makeRequire(),r}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState==="interactive")return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.4",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=typeof window!="undefined"&&!!navigator&&!!document,isWebWorker=!isBrowser&&typeof importScripts!="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(typeof define!="undefined")return;if(typeof requirejs!="undefined"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=undefined}typeof require!="undefined"&&!isFunction(require)&&(cfg=require,require=undefined),req=requirejs=function(e,t,n,r){var i,s,o=defContextName;return!isArray(e)&&typeof e!="string"&&(s=e,isArray(t)?(e=t,t=n,n=r):e=[]),s&&s.context&&(o=s.context),i=getOwn(contexts,o),i||(i=contexts[o]=req.s.newContext(o)),s&&i.configure(s),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick=typeof setTimeout!="undefined"?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=function(e){throw e},req.load=function(e,t,n){var r=e&&e.config||{},i;if(isBrowser)return i=r.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),i.type=r.scriptType||"text/javascript",i.charset="utf-8",i.async=!0,i.setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)):(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)),i.src=n,currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;isWebWorker&&(importScripts(n),e.completeLoad(t))},isBrowser&&eachReverse(scripts(),function(e){head||(head=e.parentNode),dataMain=e.getAttribute("data-main");if(dataMain)return cfg.baseUrl||(src=dataMain.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath,dataMain=mainScript),dataMain=dataMain.replace(jsSuffixRegExp,""),cfg.deps=cfg.deps?cfg.deps.concat(dataMain):[dataMain],!0}),define=function(e,t,n){var r,i;typeof e!="string"&&(n=t,t=e,e=null),isArray(t)||(n=t,t=[]),!t.length&&isFunction(n)&&n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t)),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this); -/** - * # wrap/jquery - * - * Wrap global instance for use in RequireJS modules - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # wrap/modernizr - * - * Wrap global instance for use in RequireJS modules - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/* Copyright (c) 2010-2012 Marcus Westin */ - -/** - * # util/util - * - * This is the home for wayward methods who have lost their way. - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * Adapted from the official plugin text.js - * - * Uses UnderscoreJS micro-templates : http://documentcloud.github.com/underscore/#template - * @author Julien Cabanès - * @version 0.2 - * - * @license RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/** - * # util/templates - * - * Utility methods for referencing js templates - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # manager/file - * - * Methods for loading files to the canvas and giving updates on their - * progress - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # layout/base - * - * Base constructor for the canvas layout managers. Used to determine - * canvas dimensions and to place sprites without intersections (overlap) - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # layout/compact - * - * Constructor for the compact canvas layout manager. Used to determine - * canvas dimensions and to place sprites without intersections (overlap). - * Places sprites in the most compact rectangle possible - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # layout/vertical - * - * Constructor for the vertical canvas layout manager. Used to determine - * canvas dimensions and to place sprites without intersections (overlap). - * Places sprites in a vertical column - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # layout/horizontal - * - * Constructor for the horizontal canvas layout manager. Used to determine - * canvas dimensions and to place sprites without intersections (overlap). - * Places sprites in a horizontal row - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # manager/layout - * - * Methods for setting the canvas layout and stitching the sprites together - * (i.e. placing them on the canvas) - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # stylesheet/base - * - * Base constructor for the stylesheet managers - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # stylesheet/css - * - * Base constructor for the CSS stylesheet manager - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # stylesheet/less - * - * Base constructor for the LESS stylesheet manager - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # manager/stylesheet - * - * Methods for setting the canvas stylesheet type and making the stylesheets - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/drop-box - * - * Constructor for the drag and drop element. Used to allow users to drag - * files onto a DOM element to initiate processing - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # util/array - * - * Utility methods for working with arrays - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/sprite - * - * Constructor for the sprite element, which holds sprite dimensions, - * position, and display info. Used for manipulation of a single - * sprite on the canvas - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/canvas - * - * Constructor for the sprite sheet canvas element, which holds and displays - * all placed sprites. Used for manipulating sprite placement and - * state - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/toolbar - * - * Constructor for UI toolbars - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/palette - * - * Constructor for UI palettes (i.e. dialogs). Inherits from `Toolbar` - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # module/stitches - * - * Constructor for the stitches module, which encapsulates all of the UI - * functionality. Instantiated with a DOM element, into which all of the - * markup is injected and to which the behaviors are attached. Typically - * used in a DOM ready callback - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - */ - -/** - * # Stitches - * - * ### _An HTML5 Sprite Sheet Generator_ - * - * > http://draeton.github.io/stitches
- * > Copyright 2013 Matthew Cobbs
- * > Licensed under the MIT license. - * - * Stitches is an HTML5 sprite sheet generator. - * - * Stitches is developed by Matthew Cobbs in concert with the lovely open-source - * community at Github. Thanks are owed to the developers at Twitter for - * [Bootstrap](http://twitter.github.io/bootstrap), and - * [Glyphicons](http://glyphicons.com/) for some cool little icons. - * - * Addtionally, I want to thank [James Taylor](https://github.io/jbt) - * for the [Docker](https://github.io/jbt/docker) documentation tool, and most - * of all the good folks who develop [RequireJS](http://requirejs.org/) and - * [GruntJS](http://gruntjs.com/), for helping this all make sense. - */ - -define("wrap/jquery",[],function(){return jQuery}),define("wrap/modernizr",[],function(){return Modernizr}),function(){function o(){try{return r in t&&t[r]}catch(e){return!1}}var e={},t=window,n=t.document,r="localStorage",i="__storejs__",s;e.disabled=!1,e.set=function(e,t){},e.get=function(e){},e.remove=function(e){},e.clear=function(){},e.transact=function(t,n,r){var i=e.get(t);r==null&&(r=n,n=null),typeof i=="undefined"&&(i=n||{}),r(i),e.set(t,i)},e.setAll=function(){},e.getAll=function(){},e.serialize=function(e){return JSON.stringify(e)},e.deserialize=function(e){if(typeof e!="string")return undefined;try{return JSON.parse(e)}catch(t){return e||undefined}};if(o())s=t[r],e.set=function(t,n){return typeof t=="object"?e.setAll(t):n===undefined?e.remove(t):(s.setItem(t,e.serialize(n)),n)},e.get=function(t){return t===undefined?e.getAll():e.deserialize(s.getItem(t))},e.remove=function(e){s.removeItem(e)},e.clear=function(){s.clear()},e.setAll=function(t){for(var n in t)t[n]=e.set(n,t[n])},e.getAll=function(){var t={};for(var n=0;ndocument.w=window