colors in sahli ascii example now change when changed/loaded
This commit is contained in:
parent
3d7cf11518
commit
1a7bd94ac1
4 changed files with 51 additions and 19 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
// Generated by CoffeeScript 1.7.1
|
// Generated by CoffeeScript 1.7.1
|
||||||
(function() {
|
(function() {
|
||||||
var Sahli, ansiorascii, arraytocolor, booltoint, colorindex, colortoarray, colortoname, dec2hex, dumpjson, emptyfiledef, hex2dec, inttobool, loadsahli, newsahli, resolvefiletype, statustobool;
|
var Sahli, ansiorascii, arraytocolor, booltoint, colorindex, colortoarray, colortoname, dec2hex, dumpjson, emptyfiledef, hex2dec, inttobool, loadsahli, newsahli, resolvefiletype, sahlicolor, statustobool;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
return $("h1").hide().slideDown(500);
|
return $("h1").hide().slideDown(500);
|
||||||
|
|
@ -46,6 +46,11 @@
|
||||||
$(".groupbox p").css({
|
$(".groupbox p").css({
|
||||||
margin: "0 0 .25em 0"
|
margin: "0 0 .25em 0"
|
||||||
});
|
});
|
||||||
|
$(".colorbox").change((function(_this) {
|
||||||
|
return function() {
|
||||||
|
return sahlicolor();
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
$("#entryfilepick").change(function() {
|
$("#entryfilepick").change(function() {
|
||||||
if (this.files[0] != null) {
|
if (this.files[0] != null) {
|
||||||
return $("#entryfile").val(this.files[0].name);
|
return $("#entryfile").val(this.files[0].name);
|
||||||
|
|
@ -313,7 +318,8 @@
|
||||||
$("#entryline1").val(data.line1);
|
$("#entryline1").val(data.line1);
|
||||||
$("#entryline2").val(data.line2);
|
$("#entryline2").val(data.line2);
|
||||||
$("#entrytext").val(data.text);
|
$("#entrytext").val(data.text);
|
||||||
return $("#entryfile").val(data.file);
|
$("#entryfile").val(data.file);
|
||||||
|
return sahlicolor();
|
||||||
};
|
};
|
||||||
|
|
||||||
return Sahli;
|
return Sahli;
|
||||||
|
|
@ -453,6 +459,17 @@
|
||||||
return names[colorname];
|
return names[colorname];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sahlicolor = function() {
|
||||||
|
var bg, fg;
|
||||||
|
fg = $('#entrycolor').val();
|
||||||
|
bg = $('#entrybg').val();
|
||||||
|
console.log('sahlicolor', fg, bg);
|
||||||
|
return $('#sahliascii').css({
|
||||||
|
'color': fg,
|
||||||
|
'background': bg
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
newsahli = function() {
|
newsahli = function() {
|
||||||
var newentry, sahli;
|
var newentry, sahli;
|
||||||
sahli = new Sahli;
|
sahli = new Sahli;
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,14 @@ Also hide the editor until needed, and initialize some elements.
|
||||||
@.value = "1"
|
@.value = "1"
|
||||||
$(".45box").css {width:'45%',display:'inline-block'}
|
$(".45box").css {width:'45%',display:'inline-block'}
|
||||||
$(".groupbox p").css {margin:"0 0 .25em 0"}
|
$(".groupbox p").css {margin:"0 0 .25em 0"}
|
||||||
|
$(".colorbox").change =>
|
||||||
|
sahlicolor()
|
||||||
|
|
||||||
$("#entryfilepick").change ->
|
$("#entryfilepick").change ->
|
||||||
if @.files[0]? then $("#entryfile").val @.files[0].name
|
if @.files[0]? then $("#entryfile").val @.files[0].name
|
||||||
$("#entryfile").click ->
|
$("#entryfile").click ->
|
||||||
$("#entryfilepick").click()
|
$("#entryfilepick").click()
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
The sahli file definition format is as follows:
|
The sahli file definition format is as follows:
|
||||||
|
|
@ -201,7 +205,7 @@ insert it into the array at end position. A la the draggon-dropping.
|
||||||
additem: (item,pos) ->
|
additem: (item,pos) ->
|
||||||
entry = @genentryline item,pos
|
entry = @genentryline item,pos
|
||||||
entry.dblclick =>
|
entry.dblclick =>
|
||||||
@editline item,pos
|
@editline item,pos
|
||||||
|
|
||||||
genentryline: (item,pos) ->
|
genentryline: (item,pos) ->
|
||||||
arrows = "<span class='ui-icon ui-icon-arrowthick-2-n-s'></span>"
|
arrows = "<span class='ui-icon ui-icon-arrowthick-2-n-s'></span>"
|
||||||
|
|
@ -274,6 +278,7 @@ insert it into the array at end position. A la the draggon-dropping.
|
||||||
$("#entryline2").val data.line2
|
$("#entryline2").val data.line2
|
||||||
$("#entrytext").val data.text
|
$("#entrytext").val data.text
|
||||||
$("#entryfile").val data.file
|
$("#entryfile").val data.file
|
||||||
|
sahlicolor()
|
||||||
|
|
||||||
|
|
||||||
A Helper function to dump json out of an object as text:
|
A Helper function to dump json out of an object as text:
|
||||||
|
|
@ -386,6 +391,16 @@ Similarly, need to be able to get the color index.
|
||||||
}
|
}
|
||||||
names[colorname]
|
names[colorname]
|
||||||
|
|
||||||
|
|
||||||
|
A function for changing the fore and background colors of the sahli ascii example
|
||||||
|
|
||||||
|
sahlicolor = ->
|
||||||
|
fg = $('#entrycolor').val()
|
||||||
|
bg = $('#entrybg').val()
|
||||||
|
console.log 'sahlicolor',fg,bg
|
||||||
|
$('#sahliascii').css {'color':fg,'background':bg}
|
||||||
|
|
||||||
|
|
||||||
When clicking 'New' we want to make a brand new Sahli, and then clear out
|
When clicking 'New' we want to make a brand new Sahli, and then clear out
|
||||||
the buttons and create the editor bit as blank.
|
the buttons and create the editor bit as blank.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,18 +95,18 @@
|
||||||
<select name="color" id='entrycolor' class='colorbox'>
|
<select name="color" id='entrycolor' class='colorbox'>
|
||||||
<option value="#E0E0E0">Light Grey</option>
|
<option value="#E0E0E0">Light Grey</option>
|
||||||
<option value="#A0A0E0">Light Blue</option>
|
<option value="#A0A0E0">Light Blue</option>
|
||||||
<option value="#9AFe2e">Light Green</option>
|
<option value="#9AFE2E">Light Green</option>
|
||||||
<option value="#FF0000">Red</option>
|
<option value="#FF0000">Red</option>
|
||||||
<option value="#FF8000">Orange</option>
|
<option value="#FF8000">Orange</option>
|
||||||
<option value="#FFFF00">Yellow</option>
|
<option value="#FFFF00">Yellow</option>
|
||||||
<option value="#00f000">Green</option>
|
<option value="#00F000">Green</option>
|
||||||
<option value="#2efeF7">Cyan</option>
|
<option value="#2EFEF7">Cyan</option>
|
||||||
<option value="#2efeF7">Blue</option>
|
<option value="#002EF7">Blue</option>
|
||||||
<option value="#0b0b3b">Navy</option>
|
<option value="#0B0B3B">Navy</option>
|
||||||
<option value="#FF00FF">Magenta</option>
|
<option value="#FF00FF">Magenta</option>
|
||||||
<option value="#8000FF">Purple</option>
|
<option value="#8000FF">Purple</option>
|
||||||
<option value="#0a2a0a">Dark Green</option>
|
<option value="#0A2A0A">Dark Green</option>
|
||||||
<option value="#3b3b3b">Dark Grey</option>
|
<option value="#3B3B3B">Dark Grey</option>
|
||||||
<option value="#FFFFFF">White</option>
|
<option value="#FFFFFF">White</option>
|
||||||
<option value="#000000">Black</option>
|
<option value="#000000">Black</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -116,25 +116,25 @@
|
||||||
<select name="bg" id='entrybg' class='colorbox'>
|
<select name="bg" id='entrybg' class='colorbox'>
|
||||||
<option value="#E0E0E0">Light Grey</option>
|
<option value="#E0E0E0">Light Grey</option>
|
||||||
<option value="#A0A0E0">Light Blue</option>
|
<option value="#A0A0E0">Light Blue</option>
|
||||||
<option value="#9AFe2e">Light Green</option>
|
<option value="#9AFE2E">Light Green</option>
|
||||||
<option value="#FF0000">Red</option>
|
<option value="#FF0000">Red</option>
|
||||||
<option value="#FF8000">Orange</option>
|
<option value="#FF8000">Orange</option>
|
||||||
<option value="#FFFF00">Yellow</option>
|
<option value="#FFFF00">Yellow</option>
|
||||||
<option value="#00f000">Green</option>
|
<option value="#00F000">Green</option>
|
||||||
<option value="#2efeF7">Cyan</option>
|
<option value="#2EFEF7">Cyan</option>
|
||||||
<option value="#2efeF7">Blue</option>
|
<option value="#002EF7">Blue</option>
|
||||||
<option value="#0b0b3b">Navy</option>
|
<option value="#0B0B3B">Navy</option>
|
||||||
<option value="#FF00FF">Magenta</option>
|
<option value="#FF00FF">Magenta</option>
|
||||||
<option value="#8000FF">Purple</option>
|
<option value="#8000FF">Purple</option>
|
||||||
<option value="#0a2a0a">Dark Green</option>
|
<option value="#0A2A0A">Dark Green</option>
|
||||||
<option value="#3b3b3b">Dark Grey</option>
|
<option value="#3B3B3B">Dark Grey</option>
|
||||||
<option value="#FFFFFF">White</option>
|
<option value="#FFFFFF">White</option>
|
||||||
<option value="#000000">Black</option>
|
<option value="#000000">Black</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
<div class='45box'>
|
<div class='45box'>
|
||||||
<pre>
|
<pre id='sahliascii'>
|
||||||
________________________, ._____,
|
________________________, ._____,
|
||||||
| ___|___ | | | | |_____|
|
| ___|___ | | | | |_____|
|
||||||
|_____ | _ | | |__| |
|
|_____ | _ | | |__| |
|
||||||
|
|
|
||||||
2
todo.txt
2
todo.txt
|
|
@ -5,7 +5,7 @@ x 2014-08-07 @EDITOR button to insert an entry - make it insert a blank
|
||||||
|
|
||||||
x 2014-08-06 @EDITOR dump to screen or file, not to console when saving
|
x 2014-08-06 @EDITOR dump to screen or file, not to console when saving
|
||||||
x 2014-08-06 @EDITOR save (print) routine
|
x 2014-08-06 @EDITOR save (print) routine
|
||||||
@EDITOR text/bg colors change 'SAHLI' thing
|
x 2014-08-07 @EDITOR text/bg colors change 'SAHLI' thing
|
||||||
x 2014-08-07 @EDITOR update the line item when saving - what the heck is 'line item?' (meant update the listing to show edits)
|
x 2014-08-07 @EDITOR update the line item when saving - what the heck is 'line item?' (meant update the listing to show edits)
|
||||||
|
|
||||||
x 2014-08-07 (A) fix color functions to use alpha (so they show up!)
|
x 2014-08-07 (A) fix color functions to use alpha (so they show up!)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue