aboutsummaryrefslogtreecommitdiffstats
path: root/source/main.js
diff options
context:
space:
mode:
authorzefanja <zefanja@freenet.de>2014-01-01 14:48:30 +0700
committerzefanja <zefanja@freenet.de>2014-01-01 14:48:30 +0700
commitab849f2858e2757bd5cc43bbcefff876ad87529c (patch)
tree76085e446c76caab4e4a31dfe33855f6e2d6d1e6 /source/main.js
parentb7b8491538739c35dd326eef25a4df3377bcb820 (diff)
downloadbiblez-ng-ab849f2858e2757bd5cc43bbcefff876ad87529c.tar.gz
* added new view to show all personal data (bookmarks, notes, highlights)
* improved first start view
Diffstat (limited to 'source/main.js')
-rw-r--r--source/main.js46
1 files changed, 30 insertions, 16 deletions
diff --git a/source/main.js b/source/main.js
index f0cd675..26d7f7f 100644
--- a/source/main.js
+++ b/source/main.js
@@ -7,7 +7,8 @@ enyo.kind({
onOpenPreferences: "",
onModuleChanged: "",
onOpenBC: "",
- onOpenNotes: ""
+ onOpenNotes: "",
+ onOpenDataView: ""
},
published: {
passage: ""
@@ -22,9 +23,8 @@ enyo.kind({
{name: "bcPopup", classes: "biblez-bc-popup", kind: "onyx.Popup", modal: true, floating: true, components: [
{kind: "biblez.bcSelector", name: "bcSelector", onSelect: "passageChanged", onBack: "closePopup"}
]},
- {kind: "onyx.MoreToolbar", name: "topTB", components: [
+ {kind: "onyx.MoreToolbar", showing: false, name: "topTB", components: [
{name: "moduleSelector", kind: "onyx.MenuDecorator", onSelect: "moduleSelected", components: [
- //{kind: "onyx.IconButton", src: "assets/modules.png"},
{kind: "onyx.Button", name: "btnModules", classes: "tb-button", style: "background-color: #934A15;"},
{kind: "onyx.Menu", name: "moduleMenu"}
]},
@@ -56,14 +56,14 @@ enyo.kind({
]}
]}
]},
- {kind: "onyx.IconButton", src: "assets/font.png", ontap: "handleFontMenu", style:"position:absolute; right:0;"},
+ {name: "btFont", kind: "onyx.IconButton", src: "assets/font.png", ontap: "handleFontMenu", style:"position:absolute; right:0;"},
//{name: "btnPrefs", kind:"onyx.IconButton", src: "assets/settings.png", ontap: "handlePrefs"},
//{name: "plus", kind: "onyx.IconButton", src: "assets/add.png", style:"position:absolute;right:0;", ontap: "doOpenModuleManager"},
/*{kind: "onyx.InputDecorator", components: [
{kind: "onyx.Input", placeholder: "Enter a passage...", onchange: "handlePassage", name: "passageInput", value: "Matt 1"}
]}*/
]},
- {name: "mainPanel", kind: "Panels", fit: true, ondragfinish: "handleChangeChapter", onTransitionStart: "handlePanelIndex", arrangerKind: "LeftRightArranger", margin: 0, classes: "background", components: [
+ {name: "mainPanel", kind: "Panels", fit: true, animate: false, ondragfinish: "handleChangeChapter", onTransitionStart: "handlePanelIndex", arrangerKind: "LeftRightArranger", margin: 0, classes: "background", components: [
{},
{kind: "FittableColumns", noStretch: true, components: [
{fit: true},
@@ -78,6 +78,10 @@ enyo.kind({
{fit: true}
]},
{},
+ {name: "firstStart", classes: "center", style: "margin-top: 100px;", components: [
+ {content: $L("You have no modules installed. Open the Module Manager to install one."), style: "font-weight: bold; margin-bottom: 20px;"},
+ {kind: "onyx.Button", classes: "onyx-affirmative", content: $L("Open Module Manager"), ontap: "doOpenModuleManager"}
+ ]}
]},
],
@@ -138,14 +142,15 @@ enyo.kind({
sword.moduleMgr.getModules(enyo.bind(this, function(inError, inModules) {
if (!inError) {
if(inModules.length !== 0) {
- this.$.moduleSelector.show();
- this.$.btnPassage.show();
+ this.$.mainPanel.setIndex(2);
+ this.$.mainPanel.draggable = true;
+ this.$.topTB.show();
this.modules = inModules;
this.renderModuleMenu(this.modules);
} else {
- this.$.moduleSelector.hide();
- this.$.btnPassage.hide();
- this.$.main.setContent("<center>" + $L("You have no modules installed. Tap on the '+' to install one!" + "</center>"));
+ this.$.topTB.hide();
+ this.$.mainPanel.draggable = false;
+ this.$.mainPanel.setIndex(5);
}
} else {
this.handleError(inError);
@@ -213,6 +218,11 @@ enyo.kind({
this.$.spinner.start();
if (typeof passage === "string") {
+ //BibleZ currently supports only Book.Chapter Osis passages in the mainView
+ if(passage.split(".").length > 2) {
+ passage = passage.slice(0, passage.lastIndexOf("."));
+ }
+
this.currentPassage.osis = passage.replace(" ", ".");
this.currentPassage.label = passage.replace(".", " ");
}
@@ -339,14 +349,16 @@ enyo.kind({
},
handleChangeChapter: function (inSender, inEvent) {
- if(this.currentModule) {
- if(this.panelIndex === 1) {
- this.handlePassage(sword.verseKey.previous(this.currentPassage.osis, this.currentModule.config.Versification).osis);
- } else if(this.panelIndex === 3) {
- this.handlePassage(sword.verseKey.next(this.currentPassage.osis, this.currentModule.config.Versification).osis);
+ if(this.$.mainPanel.getIndex() !== 5) {
+ if(this.currentModule) {
+ if(this.panelIndex === 1) {
+ this.handlePassage(sword.verseKey.previous(this.currentPassage.osis, this.currentModule.config.Versification).osis);
+ } else if(this.panelIndex === 3) {
+ this.handlePassage(sword.verseKey.next(this.currentPassage.osis, this.currentModule.config.Versification).osis);
+ }
}
+ this.$.mainPanel.setIndexDirect(2);
}
- this.$.mainPanel.setIndexDirect(2);
},
handleVerseTap: function (inSender, inEvent) {
@@ -407,6 +419,8 @@ enyo.kind({
this.doOpenModuleManager();
else if(inEvent.originator.action === "preferences")
this.doOpenPreferences();
+ else
+ this.doOpenDataView({section: inEvent.originator.action});
},
handlePanelIndex: function (inSender, inEvent) {