diff options
-rw-r--r-- | manifest.deploy | 2 | ||||
-rw-r--r-- | manifest.desktop | 2 | ||||
-rw-r--r-- | source/App.css | 8 | ||||
-rw-r--r-- | source/main.js | 19 | ||||
-rw-r--r-- | source/notes.js | 21 |
5 files changed, 38 insertions, 14 deletions
diff --git a/manifest.deploy b/manifest.deploy index 5cabcfc..9f9af5c 100644 --- a/manifest.deploy +++ b/manifest.deploy @@ -1,6 +1,6 @@ { "name": "BibleZ", - "version": "1.3.8", + "version": "1.3.9", "description": "BibleZ is an easy to use offline bible reader app for your FirefoxOS device! Enjoy the full bible at your fingertips. <b>Features:</b> <ul><li>many available bibles in different languages (e.g. ESV, KJV, NET (free version), ...)</li><li>notes</li><li>bookmarks</li><li>highlights</li><li>history of last read scriptures</li><li>no internet connection required (only for downloading modules)</li></ul> BibleZ is based on the SWORD Project (http://crosswire.org) and licenced under GPLv3. If you have any problems with this app just send an eMail to <a href:mailto:info@zefanjas.de>info@zefanjas.de</a>!", "launch_path": "/index.html", "icons": { diff --git a/manifest.desktop b/manifest.desktop index 921c143..0986433 100644 --- a/manifest.desktop +++ b/manifest.desktop @@ -1,6 +1,6 @@ { "name": "BibleZ", - "version": "1.3.8", + "version": "1.3.9", "description": "BibleZ is an easy to use offline bible reader app for your Firefox! Enjoy the full bible at your fingertips. <b>Features:</b> <ul><li>many available bibles in different languages (e.g. ESV, KJV, NET (free version), ...)</li><li>notes</li><li>bookmarks</li><li>highlights</li><li>history of last read scriptures</li><li>no internet connection required (only for downloading modules)</li></ul> BibleZ is based on the SWORD Project (http://crosswire.org) and licenced under GPLv3. If you have any problems with this app just send an eMail to <a href:mailto:info@zefanjas.de>info@zefanjas.de</a>!", "launch_path": "/biblez-ng/app/index.html", "icons": { diff --git a/source/App.css b/source/App.css index ac0295d..81de9f9 100644 --- a/source/App.css +++ b/source/App.css @@ -75,6 +75,14 @@ width: 465px; } +.biblez-notes-popup { + background: #eee; + color: black; + height: 250px; + width: 465px; + border: 0; +} + .tb-button { padding: 5px; } diff --git a/source/main.js b/source/main.js index d81bd84..15f57c9 100644 --- a/source/main.js +++ b/source/main.js @@ -21,9 +21,8 @@ enyo.kind({ {name: "notePopup", kind: "biblez.notePopup", onEdit: "handleNoteTap"}, {name: "footnotePopup", kind: "biblez.footnotePopup"}, {name: "messagePopup", kind: "onyx.Popup", centered: true, floating: true, classes: "message-popup"}, - {name: "bcPopup", classes: "biblez-bc-popup", kind: "onyx.Popup", modal: true, floating: true, components: [ - //{kind: "biblez.bcSelector", name: "bcSelector", onSelect: "passageChanged", onBack: "closePopup"} - ]}, + {name: "bcPopup", classes: "biblez-bc-popup", kind: "onyx.Popup", modal: true, floating: true}, + {name: "stuffPopup", classes: "biblez-notes-popup onyx-light", kind: "onyx.Popup", scrim: true, autoDismiss: false, modal: true, floating: true, centered: true}, {kind: "enyo.FittableColumns", fit: true, name: "mainView", components: [ {kind: "enyo.FittableRows", fit: true, components: [ {kind: "onyx.Toolbar", showing: false, classes: "main-toolbar", noStretch: true, name: "topTB", layoutKind: "FittableColumnsLayout", components: [ @@ -493,7 +492,14 @@ enyo.kind({ handleNoteTap: function (inSender, inEvent) { if (this.userData[inEvent.osisRef] && this.userData[inEvent.osisRef].noteId !== undefined) inEvent["noteId"] = this.userData[inEvent.osisRef].noteId; - this.doOpenNotes(inEvent); + if(!enyo.Panels.isScreenNarrow()) { + if(!this.$.notes) this.$.stuffPopup.createComponent({name: "notes", kind: "biblez.notes", onBack: "closePopup", onChange: "handleNote"}, {owner: this}).render(); + this.$.notes.setOsisRef(inEvent.osisRef); + this.$.notes.setNoteId(inEvent.noteId); + this.$.stuffPopup.show(); + } else + this.doOpenNotes(inEvent); + this.$.notePopup.hide(); }, handleNote: function (inSender, inEvent) { @@ -509,7 +515,7 @@ enyo.kind({ handleBcSelector: function (inSender, inEvent) { if(!enyo.Panels.isScreenNarrow()) { - this.$.bcPopup.createComponent({kind: "biblez.bcSelector", name: "bcSelector", onSelect: "passageChanged", onBack: "closePopup"}, {owner: this}).render(); + if(!this.$.bcSelector) this.$.bcPopup.createComponent({kind: "biblez.bcSelector", name: "bcSelector", onSelect: "passageChanged", onBack: "closePopup"}, {owner: this}).render(); this.$.bcSelector.setModule(this.currentModule); this.$.bcPopup.showAtEvent(inEvent); } else @@ -520,6 +526,9 @@ enyo.kind({ if(this.$.bcSelector) this.$.bcPopup.destroyClientControls(); this.$.bcPopup.hide(); + if(this.$.notes) + this.$.stuffPopup.destroyClientControls(); + this.$.stuffPopup.hide(); }, handleFontMenu: function (inSender, inEvent) { diff --git a/source/notes.js b/source/notes.js index 6441c32..690488f 100644 --- a/source/notes.js +++ b/source/notes.js @@ -1,7 +1,7 @@ enyo.kind({ name: "biblez.notes", kind: "enyo.FittableRows", - fit: true, + classes: "enyo-fit", events: { onBack: "", onChange: "" @@ -13,13 +13,13 @@ enyo.kind({ }, components: [ {name: "messagePopup", kind: "onyx.Popup", scrim: true, centered: true, floating: true, classes: "message-popup"}, - {kind: "onyx.MoreToolbar", components: [ + {kind: "onyx.Toolbar", components: [ {kind: "onyx.IconButton", src: "assets/back.png", ontap: "handleBack"}, {name: "label", content: $L("Notes")} ]}, - {kind: "enyo.Scroller", touch: true, fit: true, style: "text-align: center;", components: [ + {kind: "enyo.Scroller", fit: true, style: "text-align: center;", components: [ {kind: "onyx.InputDecorator", style: "margin: 10px;", alwaysLooksFocused: true, components: [ - {name: "noteInput", kind: "onyx.RichText", classes: "note-input", placeholder: "Enter your note here", allowHmtl: false} + {name: "noteInput", kind: "onyx.RichText", classes: "note-input", placeholder: "Enter your note here", allowHmtl: false, oninput: "handleInput"} ]}, {tag: "br"}, {name: "btDelete", kind: "onyx.Button", content: $L("Delete Note"), disabled: true, classes: "onyx-negative", style: "margin: 10px;", ontap: "removeNote"} @@ -28,7 +28,7 @@ enyo.kind({ rendered: function () { this.inherited(arguments); - this.$.noteInput.applyStyle("width", window.innerWidth > 700 ? 600 + "px" : window.innerWidth-40 + "px"); + this.$.noteInput.applyStyle("width", !enyo.Panels.isScreenNarrow() ? 420 + "px" : window.innerWidth-40 + "px"); }, setFocus: function () { @@ -54,6 +54,11 @@ enyo.kind({ } }, + handleInput: function (inSender, inEvent) { + //enyo.job(this.id + ":update", this.bindSafely("updateNote", inSender.getValue()), 200); + return true; + }, + updateNote: function (inSender, inEvent) { api.putNote({id: this.noteId, text: this.$.noteInput.getValue().replace(/"/g, '"'), osisRef: this.osisRef}, enyo.bind(this, function (inError, inId) { if(!inError) { @@ -78,8 +83,9 @@ enyo.kind({ if(this.$.noteInput.getValue() !== "") { this.updateNote(); this.$.noteInput.setValue(" "); - } - this.doBack(); + } else + this.doBack(); + return true; }, handleError: function (inMessage) { @@ -87,5 +93,6 @@ enyo.kind({ inMessage = inMessage.message; this.$.messagePopup.setContent(inMessage); this.$.messagePopup.show(); + return true; } });
\ No newline at end of file |