From 7aa407970f88539cc4c3016a96316a0bfd1f085c Mon Sep 17 00:00:00 2001 From: jdescottes Date: Mon, 30 Sep 2013 21:22:58 +0200 Subject: [PATCH] Layers:Review:Rename LayersController to LayersListController --- js/app.js | 20 +++++++++---------- ...sController.js => LayersListController.js} | 12 +++++------ piskel-script-list.js | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) rename js/controller/{LayersController.js => LayersListController.js} (81%) diff --git a/js/app.js b/js/app.js index aa5a3c46..9340d089 100644 --- a/js/app.js +++ b/js/app.js @@ -26,12 +26,12 @@ this.animationController = new pskl.controller.AnimatedPreviewController(this.piskelController, $('#preview-canvas-container')); this.animationController.init(); - + this.previewsController = new pskl.controller.PreviewFilmController(this.piskelController, $('#preview-list')); this.previewsController.init(); - - this.layersController = new pskl.controller.LayersController(this.piskelController); - this.layersController.init(); + + this.layersListController = new pskl.controller.LayersListController(this.piskelController); + this.layersListController.init(); this.settingsController = new pskl.controller.SettingsController(this.piskelController); this.settingsController.init(); @@ -56,7 +56,7 @@ this.toolController = new pskl.controller.ToolController(); this.toolController.init(); - + this.paletteController = new pskl.controller.PaletteController(); this.paletteController.init(); @@ -65,8 +65,8 @@ drawingLoop.start(); this.initBootstrapTooltips_(); - - + + /** * True when piskel is running in static mode (no back end needed). * When started from APP Engine, appEngineToken_ (Boolean) should be set on window.pskl @@ -102,7 +102,7 @@ this.animationController.render(delta); this.previewsController.render(delta); }, - + readSizeFromURL_ : function () { var sizeParam = this.readUrlParameter_("size"), size; @@ -179,7 +179,7 @@ // additional values only used with latest app-engine backend formData.append('name', $('#piskel-name').val()); formData.append('frames', this.piskelController.getFrameCount()); - + // Get image/png data for first frame formData.append('preview', this.getFirstFrameAsPNGData_()); @@ -188,7 +188,7 @@ xhr.open('POST', "save", true); } - + xhr.onload = function(e) { if (this.status == 200) { if (pskl.app.isStaticVersion) { diff --git a/js/controller/LayersController.js b/js/controller/LayersListController.js similarity index 81% rename from js/controller/LayersController.js rename to js/controller/LayersListController.js index 898f463b..ed8c7786 100644 --- a/js/controller/LayersController.js +++ b/js/controller/LayersListController.js @@ -1,11 +1,11 @@ (function () { var ns = $.namespace('pskl.controller'); - ns.LayersController = function (piskelController) { + ns.LayersListController = function (piskelController) { this.piskelController = piskelController; }; - ns.LayersController.prototype.init = function () { + ns.LayersListController.prototype.init = function () { this.layerItemTemplate_ = pskl.utils.Template.get('layer-item-template'); this.rootEl = document.querySelectorAll('.layers-list-container')[0]; this.layersListEl = document.querySelectorAll('.layers-list')[0]; @@ -17,13 +17,13 @@ this.renderLayerList_(); }; - ns.LayersController.prototype.renderLayerList_ = function () { + ns.LayersListController.prototype.renderLayerList_ = function () { this.layersListEl.innerHTML = ''; var layers = this.piskelController.getLayers(); layers.forEach(this.addLayerItem.bind(this)); }; - ns.LayersController.prototype.addLayerItem = function (layer) { + ns.LayersListController.prototype.addLayerItem = function (layer) { var layerItemHtml = pskl.utils.Template.replace(this.layerItemTemplate_, { layername : layer.getName() }); @@ -34,7 +34,7 @@ this.layersListEl.insertBefore(layerItem, this.layersListEl.firstChild); }; - ns.LayersController.prototype.onClick_ = function (evt) { + ns.LayersListController.prototype.onClick_ = function (evt) { var el = evt.target || evt.srcElement; if (el.nodeName == 'BUTTON') { this.onButtonClick_(el); @@ -44,7 +44,7 @@ } }; - ns.LayersController.prototype.onButtonClick_ = function (button) { + ns.LayersListController.prototype.onButtonClick_ = function (button) { var action = button.getAttribute('data-action'); if (action == 'up') { this.piskelController.moveLayerUp(); diff --git a/piskel-script-list.js b/piskel-script-list.js index c59f13f0..a35ebdcf 100644 --- a/piskel-script-list.js +++ b/piskel-script-list.js @@ -2,7 +2,7 @@ exports.scripts = [ // Core libraries - "js/lib/jquery-1.8.0.js","js/lib/jquery-ui-1.10.3.custom.js","js/lib/pubsub.js","js/lib/bootstrap/bootstrap.js", + "js/lib/jquery-1.8.0.js","js/lib/jquery-ui-1.10.3.custom.js","js/lib/pubsub.js","js/lib/bootstrap/bootstrap.js", // GIF Encoding libraries "js/lib/gif/gif.worker.js", "js/lib/gif/gif.js", @@ -10,7 +10,7 @@ exports.scripts = [ // Application wide configuration "js/Constants.js", "js/Events.js", - + // Libraries "js/utils/core.js", "js/utils/CanvasUtils.js", @@ -44,7 +44,7 @@ exports.scripts = [ "js/controller/PiskelController.js", "js/controller/DrawingController.js", "js/controller/PreviewFilmController.js", - "js/controller/LayersController.js", + "js/controller/LayersListController.js", "js/controller/AnimatedPreviewController.js", "js/controller/ToolController.js", "js/controller/PaletteController.js", @@ -56,7 +56,7 @@ exports.scripts = [ // Services "js/service/LocalStorageService.js", "js/service/HistoryService.js", - "js/service/KeyboardEventService.js", + "js/service/KeyboardEventService.js", "js/service/ImageUploadService.js", // Tools