From 16824386eb38ec1d48877da1791c107b1400df7d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Nov 2013 21:33:14 -0500 Subject: [PATCH] Use a textarea instead of a prompt for export to prevent truncation in Chrome. --- css/main.css | 5 +++++ script/engine.js | 51 ++++++++++++++++++++++++++++++------------------ script/events.js | 4 ++++ 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/css/main.css b/css/main.css index b788226..ff4b75e 100644 --- a/css/main.css +++ b/css/main.css @@ -427,6 +427,11 @@ body.noMask .eventTitle:after { min-height: 100px; } +#description textarea { + width: 100%; + height: 225px; +} + body.noMask #description { color: white; } diff --git a/script/engine.js b/script/engine.js index 57130b1..11c47cd 100644 --- a/script/engine.js +++ b/script/engine.js @@ -200,11 +200,10 @@ var Engine = { scenes: { start: { text: ['export or import save data, for backing up', - 'or migrating computers'], + 'or migrating computers'], buttons: { 'export': { text: 'export', - nextScene: 'end', onChoose: Engine.export64 }, 'import': { @@ -217,22 +216,22 @@ var Engine = { } } }, - 'confirm': { - text: ['are you sure?', - 'if the code is invalid, all data will be lost.', - 'this is irreversible.'], - buttons: { - 'yes': { - text: 'yes', - nextScene: 'end', - onChoose: Engine.import64 - }, - 'no': { - text: 'no', - nextScene: 'end' - } - } - } + 'confirm': { + text: ['are you sure?', + 'if the code is invalid, all data will be lost.', + 'this is irreversible.'], + buttons: { + 'yes': { + text: 'yes', + nextScene: 'end', + onChoose: Engine.import64 + }, + 'no': { + text: 'no', + nextScene: 'end' + } + } + } } }); }, @@ -243,7 +242,21 @@ var Engine = { string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\n/g, ''); - prompt("save this.",string64); + Events.startEvent({ + title: 'Export', + scenes: { + start: { + text: ['save this.'], + textarea: string64, + buttons: { + 'done': { + text: 'got it', + nextScene: 'end' + } + } + } + } + }); }, import64: function() { diff --git a/script/events.js b/script/events.js index 35fad8f..239f406 100644 --- a/script/events.js +++ b/script/events.js @@ -611,6 +611,10 @@ var Events = { $('
').text(scene.text[i]).appendTo(desc); } + if(scene.textarea) { + $('