Layers:Review:Rename LayersController to LayersListController

This commit is contained in:
jdescottes 2013-09-30 21:22:58 +02:00
parent 64daa05140
commit 7aa407970f
3 changed files with 20 additions and 20 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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