aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manifest.deploy4
-rw-r--r--source/App.js1
-rw-r--r--source/main.js10
-rw-r--r--source/moduleManager.js68
-rw-r--r--source/notes.js6
5 files changed, 50 insertions, 39 deletions
diff --git a/manifest.deploy b/manifest.deploy
index 4e13cbc..5f35306 100644
--- a/manifest.deploy
+++ b/manifest.deploy
@@ -4,8 +4,10 @@
"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": {
- "128": "/assets/biblez128.png",
+ "32": "/assets/biblez32.png",
"60": "/assets/biblez60.png",
+ "90": "/assets/biblez90.png",
+ "128": "/assets/biblez128.png",
"256": "/assets/biblez256.png",
"512": "/assets/biblez512.png"
},
diff --git a/source/App.js b/source/App.js
index 9550160..28732f2 100644
--- a/source/App.js
+++ b/source/App.js
@@ -93,7 +93,6 @@ enyo.kind({
openNotes: function (inSender, inEvent) {
this.$.notes.setOsisRef(inEvent.osisRef);
this.$.notes.setNoteId(inEvent.noteId);
- this.$.notes.setFocus();
this.$.panel.setIndex(5);
},
diff --git a/source/main.js b/source/main.js
index d7b8d28..663019b 100644
--- a/source/main.js
+++ b/source/main.js
@@ -15,11 +15,10 @@ enyo.kind({
passage: ""
},
components:[
- {kind: "Signals", onOrientationChange: "handleOrientation"},
+ //{kind: "Signals", onOrientationChange: "handleOrientation"},
{kind: "biblez.versePopup", name: "versePopup", onBookmark: "handleBookmark", onHighlight: "handleHighlight", onNoteTap: "handleNoteTap"},
{name: "fontMenu", kind: "biblez.fontMenu", onFontSize: "handleFontSize", onFont: "handleFont"},
{name: "notePopup", kind: "biblez.notePopup", onEdit: "handleNoteTap"},
- //{kind: "Signals", onbeforeunload: "handleUnload"},
{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"}
@@ -175,15 +174,15 @@ enyo.kind({
},
renderModuleMenu: function (inModules) {
+ var lastModule = null;
if(!inModules)
inModules = this.modules;
- if(this.settings)
- var lastModule = this.settings.lastModule;
+ if(this.settings.lastModule)
+ lastModule = this.settings.lastModule;
this.$.moduleMenu.destroyClientControls();
var mods = [];
this.modules.forEach(enyo.bind(this, function (mod, idx) {
if ((lastModule && lastModule === mod.modKey)) {
- //mods.push({content: mod.config.moduleKey, index: idx, active: true, style: "background-color: lightblue"});
this.$.btnModules.setContent(lastModule);
mods.push({active: true, components: [
{content: mod.config.moduleKey, index: idx},
@@ -366,7 +365,6 @@ enyo.kind({
},
handleNoteTap: function (inSender, inEvent) {
- //console.log(inEvent);
if (this.userData[inEvent.osisRef] && this.userData[inEvent.osisRef].noteId !== undefined)
inEvent["noteId"] = this.userData[inEvent.osisRef].noteId;
this.doOpenNotes(inEvent);
diff --git a/source/moduleManager.js b/source/moduleManager.js
index 5740d45..0c5badb 100644
--- a/source/moduleManager.js
+++ b/source/moduleManager.js
@@ -117,21 +117,26 @@ enyo.kind({
},
getRepos: function () {
- sword.installMgr.getRepositories(enyo.bind(this, function (inError, inRepos) {
- if (!inError) {
- api.put({id: "repos", repos: inRepos, lastRepoUpdate: {time: new Date().getTime()}},
- enyo.bind(this, function (inError, inId) {
- if(!inError)
- this.setupRepoPicker(inRepos);
- else
- this.handleError(inError);
- })
- );
+ if(navigator.onLine)
+ sword.installMgr.getRepositories(enyo.bind(this, function (inError, inRepos) {
+ if (!inError) {
+ api.put({id: "repos", repos: inRepos, lastRepoUpdate: {time: new Date().getTime()}},
+ enyo.bind(this, function (inError, inId) {
+ if(!inError)
+ this.setupRepoPicker(inRepos);
+ else
+ this.handleError(inError);
+ })
+ );
- } else {
- this.handleError(inError);
- }
- }));
+ } else {
+ this.handleError(inError);
+ }
+ }));
+ else {
+ this.$.spinner.stop();
+ this.handleError({message: $L("You need an internet connection to download modules!")});
+ }
},
setupRepoPicker: function (inRepos, currentRepo) {
@@ -163,22 +168,27 @@ enyo.kind({
this.modules = allModules[inRepo.name.replace(" ", "")].modules;
this.prepareLangList(this.modules);
} else {
- sword.installMgr.getModules(inRepo, enyo.bind(this, function (inError, inModules) {
- //enyo.log(inError, inModules, inModules.length);
- if(!inError) {
- if(!allModules) allModules = {id: "downloadedModules"};
- allModules[inRepo.name.replace(" ", "")] = {modules: inModules, name: inRepo.name};
- api.put(allModules, enyo.bind(this, function (inError, inId) {
- if(inError)
- this.handleError(inError);
- }));
- this.modules = inModules;
- this.prepareLangList(this.modules);
+ if (navigator.onLine)
+ sword.installMgr.getModules(inRepo, enyo.bind(this, function (inError, inModules) {
+ //enyo.log(inError, inModules, inModules.length);
+ if(!inError) {
+ if(!allModules) allModules = {id: "downloadedModules"};
+ allModules[inRepo.name.replace(" ", "")] = {modules: inModules, name: inRepo.name};
+ api.put(allModules, enyo.bind(this, function (inError, inId) {
+ if(inError)
+ this.handleError(inError);
+ }));
+ this.modules = inModules;
+ this.prepareLangList(this.modules);
- } else {
- this.handleError((inError.message) ? inError.message : inError);
- }
- }));
+ } else {
+ this.handleError((inError.message) ? inError.message : inError);
+ }
+ }));
+ else {
+ this.$.spinner.stop();
+ this.handleError({message: $L("You need an internet connection to download modules!")});
+ }
}
} else
this.handleError(inError);
diff --git a/source/notes.js b/source/notes.js
index 3507080..5f24983 100644
--- a/source/notes.js
+++ b/source/notes.js
@@ -36,11 +36,11 @@ enyo.kind({
},
osisRefChanged: function (inSender, inEvent) {
+ this.$.noteInput.setValue("");
this.$.label.setContent($L("Notes for") + " " + api.formatOsis(this.osisRef));
},
noteIdChanged: function () {
- this.$.noteInput.setValue("");
if (this.noteId !== null) {
api.getNote(this.noteId, enyo.bind(this, function (inError, inNote) {
if(!inError) {
@@ -74,8 +74,10 @@ enyo.kind({
},
handleBack: function() {
- if(this.$.noteInput.getValue() !== "")
+ if(this.$.noteInput.getValue() !== "" || this.$.noteInput.getValue() !== " ") {
this.updateNote();
+ this.$.noteInput.setValue(" ");
+ }
this.doBack();
},