mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
initial
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
var size = this.readSizeFromURL_();
|
||||
var piskel = new pskl.model.Piskel(size.width, size.height);
|
||||
piskel.setDescriptor("New Piskel", "Some text ...");
|
||||
|
||||
var layer = new pskl.model.Layer("Layer 1");
|
||||
var frame = new pskl.model.Frame(size.width, size.height);
|
||||
|
||||
18
js/controller/settings/SaveController.js
Normal file
18
js/controller/settings/SaveController.js
Normal file
@@ -0,0 +1,18 @@
|
||||
(function () {
|
||||
var ns = $.namespace("pskl.controller.settings");
|
||||
|
||||
ns.SaveController = function (piskelController) {
|
||||
this.piskelController = piskelController;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
ns.SaveController.prototype.init = function () {
|
||||
this.titleInput = document.getElementById("save-title");
|
||||
this.descriptionInput = document.getElementById("save-description");
|
||||
|
||||
this.titleInput.value = this.piskelController.piskel.getDescriptor().name;
|
||||
this.descriptionInput.value = this.piskelController.piskel.getDescriptor().description;
|
||||
};
|
||||
})();
|
||||
@@ -13,6 +13,10 @@
|
||||
'import' : {
|
||||
template : 'templates/settings/import.html',
|
||||
controller : ns.ImportController
|
||||
},
|
||||
'save' : {
|
||||
template : 'templates/settings/save.html',
|
||||
controller : ns.SaveController
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* @constructor
|
||||
* @param {Number} width
|
||||
* @param {Number} height
|
||||
* @param {String} name
|
||||
* @param {String} description
|
||||
*/
|
||||
ns.Piskel = function (width, height) {
|
||||
if (width && height) {
|
||||
@@ -16,6 +18,8 @@
|
||||
|
||||
/** @type {Number} */
|
||||
this.height = height;
|
||||
|
||||
this.descriptor = null;
|
||||
} else {
|
||||
throw 'Missing arguments in Piskel constructor : ' + Array.prototype.join.call(arguments, ",");
|
||||
}
|
||||
@@ -96,4 +100,15 @@
|
||||
this.layers.splice(index, 1);
|
||||
};
|
||||
|
||||
ns.Piskel.prototype.getDescriptor = function () {
|
||||
return this.descriptor;
|
||||
};
|
||||
|
||||
ns.Piskel.prototype.setDescriptor = function (name, desc) {
|
||||
this.descriptor = {
|
||||
name : name,
|
||||
description : desc
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
0
js/model/PiskelDescriptor.js
Normal file
0
js/model/PiskelDescriptor.js
Normal file
Reference in New Issue
Block a user