diff --git a/editor/sahliedit.js b/editor/sahliedit.js index f71e8d7..678a60e 100644 --- a/editor/sahliedit.js +++ b/editor/sahliedit.js @@ -84,20 +84,6 @@ Sahli = (function() { function Sahli() { this.emptyfiledef = new emptyfiledef; - this.bob = { - "file": "", - "name": "", - "amiga": true, - "filetype": 'plain', - "width": "", - "author": "", - "font": "Propaz", - "color": [0, 0, 0, 0], - "bg": [0, 0, 0, 0], - "line1": "", - "line2": "", - "text": "" - }; this.emptyslidesdef = { "background": "", "template": "", @@ -264,6 +250,7 @@ entry.line2 = $("#entryline2").val(); entry.text = $("#entrytext").val(); entry.file = $("#entryfile").val(); + entry.filetype = $("#entryfiletype").val(); return this.buildlist(this.data); }; diff --git a/editor/sahliedit.litcoffee b/editor/sahliedit.litcoffee index 8cf00cd..412b89c 100644 --- a/editor/sahliedit.litcoffee +++ b/editor/sahliedit.litcoffee @@ -104,20 +104,6 @@ a html template, and a css file. class Sahli constructor: -> @emptyfiledef = new emptyfiledef - @bob = { - "file": "", - "name": "", - "amiga": true, - "filetype": 'plain', - "width": "", - "author": "", - "font": "Propaz", - "color": [ 0,0,0,0 ], - "bg": [ 0,0,0,0 ], - "line1": "", - "line2": "", - "text": "" - } @emptyslidesdef = { "background": "", "template": "", @@ -233,6 +219,7 @@ insert it into the array at end position. A la the draggon-dropping. entry.line2 = $("#entryline2").val() entry.text = $("#entrytext").val() entry.file = $("#entryfile").val() + entry.filetype = $("#entryfiletype").val() @buildlist @data editline: (data,pos) -> diff --git a/sahli.js b/sahli.js index 9e6219b..2dce473 100644 --- a/sahli.js +++ b/sahli.js @@ -34,24 +34,41 @@ var Sahli = function () { this.nonfsheight = document.height - 40; this.loadpic = function (picdata, inserthere) { - var jumptable = { - 'plain':this.loadplain(picdata,inserthere), - 'xbin':this.loadxbin(), - 'ice':this.loadice(), - 'avatar':this.loadavatar(), - 'pcboard':this.loadpcboard(), - 'ansi':this.loadansi(), - 'idf':this.loadidf(), - 'bin':this.loadbin(), - 'adf':this.loadadf(), - 'tundra':this.loadtundra() + switch (picdata.filetype) { + case 'plain': + this.loadplain(picdata, inserthere); + break; + case 'ansi': + this.loadansi(picdata, inserthere); + break; + case 'xbin': + this.loadxbin(picdata, inserthere); + break; + case 'ice': + this.loadice(picdata, inserthere); + break; + case 'avatar': + this.loadavatar(picdata, inserthere); + break; + case 'pcboard': + this.loadpcboard(picdata, inserthere); + break; + case 'idf': + this.loadidf(picdata, inserthere); + break; + case 'adf': + this.loadadf(picdata, inserthere); + break; + case 'tundra': + this.loadtundra(picdata, inserthere); + break; + default: + this.loadplain(picdata, inserthere); } - console.log('here'); - jumptable[picdata.filetype]; - } + }; - this.loadplain = function(picdata, inserthere) { - ref = this; + this.loadplain = function (picdata, inserthere) { + var ref = this; var pdiv = $('
'); var canv = document.createElement('canvas'); var req = new XMLHttpRequest();