change the filetype when loading to appropriate value

This commit is contained in:
Iam Naughton Phier 2014-08-06 14:33:53 +03:00
parent d1e2b9d1bf
commit bb8a665aa6
3 changed files with 40 additions and 3 deletions

View file

@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.7.1
(function() {
var Sahli, ansiorascii, arraytocolor, booltoint, colortoarray, colortoname, dec2hex, dumpjson, hex2dec, inttobool, loadsahli, newsahli, statustobool;
var Sahli, ansiorascii, arraytocolor, booltoint, colortoarray, colortoname, dec2hex, dumpjson, hex2dec, inttobool, loadsahli, newsahli, resolvefiletype, statustobool;
$(function() {
return $("h1").hide().slideDown(500);
@ -231,6 +231,8 @@
$("#entryindex").val(pos);
$("#entryname").val(data.name);
$("#entryauthor").val(data.author);
$("#entryfiletpye").val(data.filetype);
$("#entryfiletype").children()[resolvefiletype(data.filetype)].selected = true;
$("#entryamiga").val(data.amiga);
$("#entryamiga").children()[1].textContent = ansiorascii(data.amiga);
$("#entryfont").val(data.font);
@ -267,6 +269,23 @@
}
};
resolvefiletype = function(filetype) {
var options;
options = {
"plain": 0,
"ansi": 1,
"xbin": 2,
"ice": 3,
"adf": 4,
"avatar": 5,
"bin": 6,
"idf": 7,
"pcboard": 8,
"tundra": 9
};
return options[filetype];
};
ansiorascii = function(status) {
if (status === 0) {
return "Ansi";