# HG changeset patch # User Atul Varma # Date 1259346343 18000 # Node ID 524737788e6bbaab6ffa507655518a46267ca6c7 # Parent fb1ca1cf7a197f555590244843e875426390b26e added basic form diff -r fb1ca1cf7a19 -r 524737788e6b mozilla-the-big-picture.html --- a/mozilla-the-big-picture.html Fri Nov 27 12:12:50 2009 -0500 +++ b/mozilla-the-big-picture.html Fri Nov 27 13:25:43 2009 -0500 @@ -6,6 +6,12 @@ Mozilla: The Big Picture +
+URL: +
+JSON: +
@@ -14,8 +20,24 @@ diff -r fb1ca1cf7a19 -r 524737788e6b mozilla-the-big-picture.js --- a/mozilla-the-big-picture.js Fri Nov 27 12:12:50 2009 -0500 +++ b/mozilla-the-big-picture.js Fri Nov 27 13:25:43 2009 -0500 @@ -10,6 +10,8 @@ ObserverManager.prototype = { add: function add(topic, observer) { + if (typeof(observer) == "function") + observer = {observe: observer}; if (!(topic in this.observers)) this.observers[topic] = []; this.observers[topic].push(observer); @@ -183,21 +185,19 @@ } }; -function makeInterface(url, options) { - if (!options) - options = {}; - - var DEFAULT_THUMBNAIL_SIZE = 100; - - var container = $('
'); +function CropperInterface(options) { var canvas = document.createElement("canvas"); - container.append(canvas); - $("#pics").append(container); - var selImg = new SelectableImage(url, canvas); + $(options.selectableContainer).append(canvas); + this.selectableImage = new SelectableImage(options.url, canvas); - var thumbnailSize = options.thumbnailSize || DEFAULT_THUMBNAIL_SIZE; + var thumbnailSize = options.thumbnailSize || this.DEFAULT_THUMBNAIL_SIZE; var thumbnailCanvas = document.createElement("canvas"); - $("#thumbnails").append(thumbnailCanvas); - var thumbnail = new Thumbnail(selImg, thumbnailCanvas, - thumbnailSize); + $(options.thumbnailContainer).append(thumbnailCanvas); + this.thumbnail = new Thumbnail(this.selectableImage, + thumbnailCanvas, + thumbnailSize); } + +CropperInterface.prototype = { + DEFAULT_THUMBNAIL_SIZE: 100 +};