diff --git a/apps/dragboard/ChangeLog b/apps/dragboard/ChangeLog index 67bc62a4b..48a1ffb03 100644 --- a/apps/dragboard/ChangeLog +++ b/apps/dragboard/ChangeLog @@ -2,3 +2,4 @@ 0.02: Added some missing code. 0.03: Made the code shorter and somewhat more readable by writing some functions. Also made it work as a library where it returns the text once finished. The keyboard is now made to exit correctly when the 'back' event is called. The keyboard now uses theme colors correctly, although it still looks best with dark theme. The numbers row is now solidly green - except for highlights. 0.04: Now displays the opened text string at launch. +0.05: Now scrolls text when string gets longer than screen width. diff --git a/apps/dragboard/ChangeLog~ b/apps/dragboard/ChangeLog~ new file mode 100644 index 000000000..67bc62a4b --- /dev/null +++ b/apps/dragboard/ChangeLog~ @@ -0,0 +1,4 @@ +0.01: New App! +0.02: Added some missing code. +0.03: Made the code shorter and somewhat more readable by writing some functions. Also made it work as a library where it returns the text once finished. The keyboard is now made to exit correctly when the 'back' event is called. The keyboard now uses theme colors correctly, although it still looks best with dark theme. The numbers row is now solidly green - except for highlights. +0.04: Now displays the opened text string at launch. diff --git a/apps/dragboard/lib.js b/apps/dragboard/lib.js index d846055c1..b9b19f982 100644 --- a/apps/dragboard/lib.js +++ b/apps/dragboard/lib.js @@ -49,11 +49,12 @@ exports.input = function(options) { g.setColor(BGCOLOR); g.fillRect(0,4+20,176,13+20); g.setColor(0.2,0,0); - g.fillRect(3,4+20,5+text.length*6,13+20); + var rectLen = text.length<27? text.length*6:27*6; + g.fillRect(3,4+20,5+rectLen,13+20); g.setColor(0.7,0,0); - g.fillRect(text.length*6+5,4+20,10+text.length*6,13+20); + g.fillRect(rectLen+5,4+20,rectLen+10,13+20); g.setColor(1,1,1); - g.drawString(text, 5, 5+20); + g.drawString(text.length<=27? text.substr(-27, 27) : '<- '+text.substr(-24,24), 5, 5+20); } drawAbcRow(); @@ -213,7 +214,7 @@ exports.input = function(options) { // Make a space or backspace by swiping right or left on screen above green rectangle - else { + else if (event.y > 20+4) { if (event.b == 0) { g.setColor(HLCOLOR); if (event.x < g.getWidth()/2) { diff --git a/apps/dragboard/metadata.json b/apps/dragboard/metadata.json index f852a12f5..f9c73ddde 100644 --- a/apps/dragboard/metadata.json +++ b/apps/dragboard/metadata.json @@ -1,6 +1,6 @@ { "id": "dragboard", "name": "Dragboard", - "version":"0.04", + "version":"0.05", "description": "A library for text input via swiping keyboard", "icon": "app.png", "type":"textinput", diff --git a/apps/dragboard/metadata.json~ b/apps/dragboard/metadata.json~ new file mode 100644 index 000000000..f852a12f5 --- /dev/null +++ b/apps/dragboard/metadata.json~ @@ -0,0 +1,14 @@ +{ "id": "dragboard", + "name": "Dragboard", + "version":"0.04", + "description": "A library for text input via swiping keyboard", + "icon": "app.png", + "type":"textinput", + "tags": "keyboard", + "supports" : ["BANGLEJS2"], + "screenshots": [{"url":"screenshot.png"}], + "readme": "README.md", + "storage": [ + {"name":"textinput","url":"lib.js"} + ] +}