aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--biblez.appcache3
m---------lib/sword0
-rw-r--r--manifest.deploy2
-rw-r--r--manifest.desktop2
-rw-r--r--source/App.css8
-rw-r--r--source/App.js2
-rw-r--r--source/kinds.js9
-rw-r--r--source/main.js99
8 files changed, 75 insertions, 50 deletions
diff --git a/biblez.appcache b/biblez.appcache
index a1a0bcf..982891b 100644
--- a/biblez.appcache
+++ b/biblez.appcache
@@ -1,5 +1,5 @@
CACHE MANIFEST
-# v6 - 2014-02-14
+# v7 - 2014-04-10
CACHE:
icon.png
index.html
@@ -32,6 +32,7 @@ assets/oldPaper.png
assets/search.png
assets/settings.png
assets/twitter_32.png
+assets/spinner.gif
build/app.css
build/app.js
build/enyo.css
diff --git a/lib/sword b/lib/sword
-Subproject bfa06ce3d5db98b6ab46af566cfe833bd6d14fa
+Subproject d0909a8f897216bf7c733da21a193c5d6c8c546
diff --git a/manifest.deploy b/manifest.deploy
index 80fb69b..7061b1d 100644
--- a/manifest.deploy
+++ b/manifest.deploy
@@ -1,6 +1,6 @@
{
"name": "BibleZ",
- "version": "1.2.2",
+ "version": "1.3.0",
"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 a623254..2a9e7a9 100644
--- a/manifest.desktop
+++ b/manifest.desktop
@@ -1,6 +1,6 @@
{
"name": "BibleZ",
- "version": "1.2.2",
+ "version": "1.3.3",
"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 6ebf8f5..a18e106 100644
--- a/source/App.css
+++ b/source/App.css
@@ -220,6 +220,14 @@
padding-right: 8px;
}
+.caps-rtol {
+ float: right;
+ color: #934A15;
+ font-size: 4em;
+ padding-top: 4px;
+ padding-left: 8px;
+}
+
h3, h1 {
font-size: 1.3em;
}
diff --git a/source/App.js b/source/App.js
index ce85847..1d01664 100644
--- a/source/App.js
+++ b/source/App.js
@@ -32,7 +32,7 @@ enyo.kind({
handleBack: function (inSender, inEvent) {
this.$.panel.selectPanelByName("main");
- if(inSender.name !== "bcSelector" && inSender.name !== "notes" && inSender.name !== "settings")
+ if(inSender.name !== "bcSelector" && inSender.name !== "notes" && inSender.name !== "settings" && inSender.name !== "dataView")
enyo.asyncMethod(inSender, "destroy");
return true;
},
diff --git a/source/kinds.js b/source/kinds.js
index d0a7c2d..c318870 100644
--- a/source/kinds.js
+++ b/source/kinds.js
@@ -18,15 +18,6 @@ enyo.kind({
this.$.generator.setClientStyle(this.clientStyle);
},
- generatePage: function() {
- this.inherited(arguments);
- //this.doOffset({offset: this.$.generator.getRowOffset(), rowSize: this.rowSize});
- },
-
- getRowSize: function () {
- return this.rowSize;
- },
-
reset: function (inIndex) {
this.getSelection().clear();
this.invalidateMetrics();
diff --git a/source/main.js b/source/main.js
index 548355d..bb5b9b8 100644
--- a/source/main.js
+++ b/source/main.js
@@ -114,6 +114,7 @@ enyo.kind({
reachedBottom: false,
offset: 0,
rowSize: 0,
+ hasVerseNumber: 0,
create: function () {
this.inherited(arguments);
@@ -229,7 +230,7 @@ enyo.kind({
//Load the verses
if(this.passage === this.settings.lastRead || !this.settings.lastRead)
- this.handlePassage();
+ this.handlePassage(this.passage);
if(this.settings)
this.setPassage((this.settings.lastRead) ? this.settings.lastRead : this.passage);
@@ -266,23 +267,24 @@ enyo.kind({
}
if (!this.reachedBottom && !this.reachedTop && !inEvent.offsetRef)
- this.handlePassage();
+ this.handlePassage(this.passage);
//Persist current passage
this.addToHistory(this.passage);
this.settings["lastRead"] = this.passage;
api.put(this.settings);
- this.$.btnPassage.setContent((this.passage.label) ? this.passage.label : this.passage.book + " " + this.passage.chapter);
+ this.$.btnPassage.setContent((this.passage.label) ? this.passage.label : api.formatOsis(this.passage.osisRef));
//Adjust the TB Icons
this.$.topTB.resized();
return true;
},
handlePassage: function (inOsis) {
- //console.log("PASSAGE", inOsis, this.passage);
- //this.$.main.setContent("");
- //this.$.spinner.start();
+ this.verses = [];
+ this.$.verseList.setCount(this.verses.length);
+ this.$.verseList.refresh();
+
var verseNumber = this.passage.verseNumber ? this.passage.verseNumber : 0;
if (typeof inOsis === "string") {
@@ -293,23 +295,36 @@ enyo.kind({
} else
verseNumber = 0;
- this.passage.osisRef = inOsis;
- this.passage.label = inOsis.replace(".", " ");
- this.passage.chapter = parseInt(inOsis.split(".")[1], 10);
+ this.passage = {
+ osisRef: inOsis,
+ label: inOsis.replace(".", " "),
+ chapter: parseInt(inOsis.split(".")[1], 10)
+ };
}
this.loadText(this.passage.osisRef, enyo.bind(this, function (inError, inResult) {
if(!inError) {
this.footnotes = inResult.footnotes;
this.verses = inResult.verses;
+ var caps = "";
+ if(inResult.rtol) {
+ this.$.verseList.applyStyle("text-align", "right");
+ caps = "<br><div class='caps-rtol'>" + this.passage.chapter + "</div>";
+ } else {
+ this.$.verseList.applyStyle("text-align", "left");
+ caps = "<br><div class='caps'>" + this.passage.chapter + "</div>";
+ }
this.handleUserData(this.passage.osisRef);
- this.verses.unshift({osisRef: this.passage.osisRef, text: "<br><div class='caps'>" + this.passage.chapter + "</div>"});
+ this.verses.unshift({osisRef: this.passage.osisRef, text: caps});
this.$.verseList.setCount(this.verses.length);
this.$.verseList.refresh();
- if (verseNumber === 0)
+ if (verseNumber === 0) {
this.$.verseList.scrollToStart();
- else
+ this.hasVerseNumber = 0;
+ } else {
this.$.verseList.scrollToRow(verseNumber+1);
+ this.hasVerseNumber = verseNumber+1;
+ }
this.renderHistory();
} else {
if(inError.code && inError.code === 123) {
@@ -351,28 +366,12 @@ enyo.kind({
return true;
},
- handleListPosition: function (inSender, inEvent) {
- var b = inEvent.scrollBounds;
- if(b && b.top > 0 && this.verses.length !== 0) {
- this.rowSize = this.$.verseList.getRowSize();
- this.offset = Math.round(b.top / this.rowSize);
- if (this.verses[this.offset] && this.verses[this.offset].osisRef) {
- this.setPassage({offsetRef: this.verses[this.offset].osisRef});
- }
- }
- /*if (this.verses[inEvent.offset] && this.verses[inEvent.offset].osisRef) {
- this.setPassage({offsetRef: this.verses[inEvent.offset].osisRef});
- this.offset = inEvent.offset;
- }
- console.log("OFFSET", this.offset); */
- return true;
- },
-
renderHistory: function (inSender, inEvent) {
this.$.historyMenu.destroyClientControls();
var hisItems = [];
this.history.forEach(enyo.bind(this, function (item, idx) {
- hisItems.push({content: api.formatOsis(item.osisRef), index: idx, osisRef: item.osisRef});
+ if(item.osisRef)
+ hisItems.push({content: api.formatOsis(item.osisRef), index: idx, osisRef: item.osisRef});
}));
this.$.historyMenu.createComponents(hisItems, {owner: this.$.historyMenu});
this.$.historyMenu.render();
@@ -615,7 +614,7 @@ enyo.kind({
yDir = b.yDir;
if(b && b.top > 0) {
- this.rowSize = this.$.verseList.getRowSize();
+ this.rowSize = Math.round(b.height / this.verses.length); // this.$.verseList.getRowSize();
this.offset = Math.round(b.top / this.rowSize);
if (this.verses[this.offset] && this.verses[this.offset].osisRef) {
this.setPassage({offsetRef: this.verses[this.offset].osisRef});
@@ -648,11 +647,21 @@ enyo.kind({
}
if(inBottom === true) {
//Load next verses
- var next = sword.verseKey.next(this.verses[this.verses.length-1].osisRef.slice(0,this.verses[this.verses.length-1].osisRef.lastIndexOf(".")), this.currentModule.config.Versification);
- //console.log("NEXT:", next);
+ var n = this.verses[this.verses.length-1].osisRef.slice(0,this.verses[this.verses.length-1].osisRef.lastIndexOf("."));
+ if (n === "Rev.22") {
+ inCallback();
+ return;
+ }
+ var next = sword.verseKey.next(n, this.currentModule.config.Versification);
this.loadText(next.osisRef, enyo.bind(this, function (inError, inResult) {
if(!inError) {
- this.verses.push({osisRef: next.osisRef, text: "<br><div class='caps'>" + next.chapter + "</div>"});
+ var caps = "";
+ if(inResult.rtol) {
+ this.$.verseList.applyStyle("text-align", "right");
+ caps = "<br><div class='caps-rtol'>" + next.chapter + "</div>";
+ } else
+ caps = "<br><div class='caps'>" + next.chapter + "</div>";
+ this.verses.push({osisRef: next.osisRef, text: caps});
this.verses.push.apply(this.verses, inResult.verses);
if(inResult.hasOwnProperty("footnotes"))
this.footnotes = api.extend(this.footnotes, inResult.footnotes);
@@ -665,7 +674,12 @@ enyo.kind({
inCallback();
}));
} else {
- var previous = sword.verseKey.previous(this.verses[1].osisRef.slice(0,this.verses[1].osisRef.lastIndexOf(".")), this.currentModule.config.Versification);
+ var p = this.verses[1].osisRef.slice(0,this.verses[1].osisRef.lastIndexOf("."));
+ if (p === "Gen.1") {
+ inCallback();
+ return;
+ }
+ var previous = sword.verseKey.previous(p, this.currentModule.config.Versification);
//console.log("Previous:", previous);
this.loadText(previous.osisRef, enyo.bind(this, function (inError, inResult) {
if(!inError) {
@@ -674,10 +688,21 @@ enyo.kind({
var l = inResult.verses.length;
inResult.verses.push.apply(inResult.verses, this.verses);
this.verses = inResult.verses;
- this.verses.unshift({osisRef: previous, text: "<br><div class='caps'>" + previous.chapter + "</div>"});
+ var caps = "";
+ if(inResult.rtol) {
+ this.$.verseList.applyStyle("text-align", "right");
+ caps = "<br><div class='caps-rtol'>" + previous.chapter + "</div>";
+ } else
+ caps = "<br><div class='caps'>" + previous.chapter + "</div>";
+ this.verses.unshift({osisRef: previous.osisRef, text: caps});
this.$.verseList.setCount(this.verses.length);
this.$.verseList.refresh();
- this.$.verseList.scrollToRow(l+1);
+ if (this.hasVerseNumber === 0)
+ this.$.verseList.scrollToRow(l+1);
+ else {
+ this.$.verseList.scrollToRow(l+this.hasVerseNumber);
+ this.hasVerseNumber = 0;
+ }
this.handleUserData(previous.osisRef);
} else {
this.handleError(inError.message);