File picker issue fixed

This commit is contained in:
Howland Owl 2014-04-16 00:54:12 +03:00
parent e3599a446f
commit 78176ddb46
2 changed files with 50 additions and 20 deletions

View file

@ -55,6 +55,10 @@ Also hide the editor until needed, and initialize some elements.
stuff[1].textContent = 'Ascii'
@.value = "1"
$(".45box").css {width:'45%',float:'left'}
$("#entryfilepick").change ->
if @.files[0]? then $("#entryfile").val @.files[0].name
$("#entryfile").click ->
$("#entryfilepick").click()
)
The sahli file definition format is as follows:
@ -109,6 +113,12 @@ edit button.
edit: ->
$('#buttonbox').hide()
$('#listsave').button {icons: {primary:"ui-icon-disk"}}
.click =>
alert 'SAVE ME'
You need to save the order, and extract these in that order; moving around
does not alter the array. Alternately, _have_ it alter the array.
@buildlist @data
buildlist: (data) ->
@ -118,19 +128,37 @@ edit button.
additem: (item) ->
$("<li class='entry' id='#{item.file}'><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>#{item.author} : #{item.name} : #{item.file}</li>")
entry = $("<li class='entry' id='#{item.file}'><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>#{item.author} : #{item.name} : #{item.file}</li>")
entry.dblclick =>
@.editline item
editline: (data) ->
$("#formica").dialog {
width:'800',
modal: false,
title:'Line Item', buttons: [{
title:"Entry #{data.file} ",
buttons: [{
text: "OK",
click: ->
$(@).dialog "close"
}]
}
}]
}
$("#entryname").val data.name
$("#entryauthor").val data.author
$("#entryamiga").val data.amiga
$("#entryfont").val data.font
fix these color entries to supply rgb() bits
$("#entrycolor").val data.color
$("#entrybg").val data.bg
$("#entrywidth").val data.width
$("#entryline1").val data.line1
$("#entryline2").val data.line2
$("#entrytext").val data.text
$("#entryfile").val data.file
Need to change the file name, but we don't seem to have the ability to do so.
A Helper function to dump json out of an object as text:

View file

@ -19,6 +19,7 @@
<div class='hidden' id='list'>
<ol id='sortlist'>
</ol>
<p id='listsave'>Save</p>
</div>
<div class='hidden' id='formica'>
@ -29,15 +30,16 @@
<div class='drop'>
<ul>
<label for="file">File name:</label>
<input type="file" name="file" value="" placeholder="">
<input id='entryfile' type="text" name="file" value="" placeholder="">
<input class='hidden' id='entryfilepick' type="file" name="pickfile" value="" placeholder="">
</ul>
<ul>
<label for="file">Title:</label>
<input type="text" name="name" value="" placeholder="">
<input id='entryname' type="text" name="name" value="" placeholder="">
</ul>
<ul>
<label for="author">Author's name:</label>
<input type="text" name="author" value="" placeholder="">
<input id='entryauthor' type="text" name="author" value="" placeholder="">
</ul>
</div>
</div>
@ -46,30 +48,30 @@
<div class='drop' id='fl'>
<ul>
<label for="file">Ascii or Ansi?</label>
<button name="amiga" id='amiga' type='button' value='1'>Ascii</button>
<button id='entryamiga' name="amiga" id='amiga' type='button' value='1'>Ascii</button>
</ul>
<ul>
<label for="width">With of file:</label>
<input type="number" name="width" value="80" placeholder="">
<input id='entrywidth' type="number" name="width" value="80" placeholder="">
</ul>
<ul>
<label for="font">Font:</label>
<select name="font">
<select id='entryfont' name="font">
<option value="Propaz">Propaz</option>
<option value="Topaz13">Topaz13</option>
<option value="mOsOul">mOsOul</option>
<option value="MicroKnight">Microknight</option>
<option value="Ansifont">Ansifont</option>
<!-- <option value="Topaz13">Topaz13</option> -->
<!-- <option value="mOsOul">mOsOul</option> -->
<!-- <option value="MicroKnight">Microknight</option> -->
<option value="ansifont">Ansifont</option>
</select>
</ul>
<div class='45box'>
<ul>
<label for="color">Text Color:</label>
<input type="color" name="color" value="#D0D0D0" placeholder="" class="colorbox">
<input id='entrycolor' type="color" name="color" value="#D0D0D0" placeholder="" class="colorbox">
</ul>
<ul>
<label for="bg">Background color:</label>
<input type="color" name="bg" value="#000000" placeholder="" class="colorbox">
<input id='entrybg' type="color" name="bg" value="#000000" placeholder="" class="colorbox">
</ul>
</div>
<div class='45box'>
@ -88,15 +90,15 @@
<div class='drop'>
<ul>
<label for="line1">Optional Info line 1:</label>
<input type="text" name="line1" value="" placeholder="">
<input id='entryline1' type="text" name="line1" value="" placeholder="">
</ul>
<ul>
<label for="line2">Optional Info line 2:</label>
<input type="text" name="line2" value="" placeholder="">
<input id='entryline2' type="text" name="line2" value="" placeholder="">
</ul>
<ul>
<label for="text">Optional Text (notes, comments, etc):</label>
<textarea name='text'></textarea>
<textarea id='entrytext' name='text'></textarea>
</ul>
</div>
</ol>