Cmd.js 542 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Created by Daniel on 20.07.15.
  3. */
  4. Cmd = function ( editorRef ) {
  5. this.id = -1;
  6. this.serialized = false;
  7. this.updatable = false;
  8. this.type = '';
  9. this.name = '';
  10. if ( editorRef !== undefined ) {
  11. Cmd.editor = editorRef;
  12. }
  13. this.editor = Cmd.editor;
  14. };
  15. Cmd.prototype.toJSON = function () {
  16. var output = {};
  17. output.type = this.type;
  18. output.id = this.id;
  19. output.name = this.name;
  20. return output;
  21. };
  22. Cmd.prototype.fromJSON = function ( json ) {
  23. this.type = json.type;
  24. this.id = json.id;
  25. this.name = json.name;
  26. };