diff options
author | zefanja <zefanja@freenet.de> | 2014-04-18 15:24:10 +0700 |
---|---|---|
committer | zefanja <zefanja@freenet.de> | 2014-04-18 15:24:10 +0700 |
commit | 6748232f02d8bb4db8ef7eefa4c593a66b6d7b64 (patch) | |
tree | 25edf549d4eb33e4fafed974373bdc7ff03ac611 | |
parent | ea662b8f986c746444c7f851f8a17764c2ae1736 (diff) | |
download | biblez-ng-6748232f02d8bb4db8ef7eefa4c593a66b6d7b64.tar.gz |
* if the screen is big enough personal data will be displayed in a sidebar
-rw-r--r-- | biblez.appcache | 3 | ||||
-rw-r--r-- | manifest.deploy | 2 | ||||
-rw-r--r-- | manifest.desktop | 2 | ||||
-rw-r--r-- | source/App.css | 11 | ||||
-rw-r--r-- | source/dataView.js | 18 | ||||
-rw-r--r-- | source/main.js | 73 |
6 files changed, 75 insertions, 34 deletions
diff --git a/biblez.appcache b/biblez.appcache index 67add2c..292b087 100644 --- a/biblez.appcache +++ b/biblez.appcache @@ -1,10 +1,11 @@ CACHE MANIFEST -# v15 - 2014-04-17 +# v16 - 2014-04-18 CACHE: icon.png index.html assets/add.png assets/back.png +assets/hide.png assets/biblez128.png assets/biblez256.png assets/bookmark.png diff --git a/manifest.deploy b/manifest.deploy index 0c43c1c..5267575 100644 --- a/manifest.deploy +++ b/manifest.deploy @@ -1,6 +1,6 @@ { "name": "BibleZ", - "version": "1.3.6", + "version": "1.3.7", "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 0fe83ba..371d417 100644 --- a/manifest.desktop +++ b/manifest.desktop @@ -1,6 +1,6 @@ { "name": "BibleZ", - "version": "1.3.6", + "version": "1.3.7", "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 dcbdab8..97e29b7 100644 --- a/source/App.css +++ b/source/App.css @@ -120,6 +120,13 @@ font-style: italic; } +/* SIDEBAR */ +.sidebar { + /* border-left: 2px solid #000; */ + box-shadow: -4px 0px 4px rgba(0,0,0,0.3); + position: absolute; +} + /* MODULE MANAGER */ .item { @@ -135,6 +142,10 @@ background-color: #c4e3fe; } +.list-selected-bold { + font-weight: bold; +} + .content-container { margin: 10px; } diff --git a/source/dataView.js b/source/dataView.js index 4db82d2..e102995 100644 --- a/source/dataView.js +++ b/source/dataView.js @@ -12,7 +12,8 @@ enyo.kind({ components: [ {name: "messagePopup", kind: "onyx.Popup", centered: true, floating: true, classes: "message-popup"}, {kind: "onyx.MoreToolbar", layoutKind:"FittableColumnsLayout", components: [ - {kind: "onyx.IconButton", src: "assets/back.png", ontap: "handleBack"}, + {name: "btBack", kind: "onyx.IconButton", src: "assets/back.png", ontap: "handleBack"}, + {name: "btHide", kind: "onyx.IconButton", src: "assets/hide.png", showing: false, ontap: "handleBack"}, {kind: "onyx.RadioGroup", onActivate:"sectionActivated", classes: "center", fit: true, defaultKind: "onyx.IconButton", components: [ {name: "rbBm", src: "assets/bookmarksTB.png", section: "bookmarks", style: "margin: 0 10px;"}, {name: "rbNotes", src: "assets/notesTB.png", section: "notes", style: "margin: 0 10px;"}, @@ -32,6 +33,11 @@ enyo.kind({ data: [], + showHideButton: function () { + this.$.btHide.show(); + this.$.btBack.hide(); + }, + sectionActivated: function (inSender, inEvent) { if (inEvent.originator.getActive()) { this.setSection(inEvent.originator.section); @@ -96,15 +102,19 @@ enyo.kind({ setupItem: function(inSender, inEvent) { var data = this.data[inEvent.index]; this.$.itemOsis.setContent(api.formatOsis(data.osisRef)); - if(this.section === "highlights") + if(this.section === "highlights") { this.$.item.applyStyle("background-color", data.color); - else + this.$.itemOsis.addRemoveClass("list-selected-bold", inSender.isSelected(inEvent.index)); + } else { this.$.item.applyStyle("background-color", null); + this.$.itemOsis.addRemoveClass("list-selected-bold", inSender.isSelected(inEvent.index)); + } if(this.section === "notes") this.$.itemText.setContent(data.text); else this.$.itemText.setContent(""); - //this.$.index.setContent(inEvent.index); + this.$.item.addRemoveClass("list-selected", inSender.isSelected(inEvent.index)); + }, handleListTap: function (inSender, inEvent) { diff --git a/source/main.js b/source/main.js index a4e5bbb..420fdd4 100644 --- a/source/main.js +++ b/source/main.js @@ -73,28 +73,16 @@ enyo.kind({ ]}, //{name: "btFont", kind: "onyx.IconButton", src: "assets/font.png", ontap: "handleFontMenu"} ]}, - {name: "mainPanel", kind: "Panels", draggable: false, /*index: 2, */fit: true, ondragfinish: "handleChangeChapter", onTransitionStart: "handlePanelIndex", arrangerKind: "LeftRightArranger", margin: 0, classes: "background", components: [ - {name: "verseList", kind: "VerseList", touch: false, thumb: false, touchOverscroll: false, count: 0, onSetupItem: "setVerses", onScroll: "handleOnScroll", classes: "enyo-selectable", components: [ - {name: "text", allowHtml: true, style: "display: inline;", ontap: "handleVerseTap", onclick: "handleVerseTap"}, - {name: "imgBm", tag: "img", style: "display: inline;", showing: false, src: "assets/bookmark.png"}, - {name: "imgNote", content: "", allowHtml: true, style: "display: inline; margin: 0 3px;", showing: false, ontap: "handleVerseTap", onclick: "handleVerseTap"} - ]} - - /*{}, - {kind: "FittableColumns", noStretch: true, components: [ - {fit: true}, - {content: "< Previous", classes: "chapter-nav chapter-nav-left"} - ]},*/ - /*{name: "verseScroller", kind: "enyo.Scroller", onScrollStop: "handleScrolling", thumb: false, touch: true, touchOverscroll: false, fit: true, components: [ - //{classes: "center", components: [{kind: "onyx.Spinner", name: "spinner", classes: "onyx-light center"}]}, - //{name: "main", classes: "verse-view", allowHtml: true, onclick: "handleVerseTap"} - ]},*/ - /*{kind: "FittableColumns", noStretch: true, components: [ - {content: "Next >", classes: "chapter-nav chapter-nav-right"}, - {fit: true} + {name: "mainView", kind: "enyo.FittableColumns", fit: true, components: [ + {name: "mainPanel", kind: "Panels", draggable: false, /*index: 2, */fit: true, ondragfinish: "handleChangeChapter", onTransitionStart: "handlePanelIndex", arrangerKind: "LeftRightArranger", margin: 0, classes: "background", components: [ + {name: "verseList", kind: "VerseList", touch: true, thumb: false, touchOverscroll: false, count: 0, onSetupItem: "setVerses", onScroll: "handleOnScroll", classes: "enyo-selectable", components: [ + {name: "text", allowHtml: true, style: "display: inline;", ontap: "handleVerseTap", onclick: "handleVerseTap"}, + {name: "imgBm", tag: "img", style: "display: inline;", showing: false, src: "assets/bookmark.png"}, + {name: "imgNote", content: "", allowHtml: true, style: "display: inline; margin: 0 3px;", showing: false, ontap: "handleVerseTap", onclick: "handleVerseTap"} + ]} ]}, - {}*/ - ]}, + {name: "sidebar", content: "", classes: "sidebar", showing: false, style: "width: 320px;"} + ]} ], currentModule: null, @@ -263,7 +251,7 @@ enyo.kind({ }, passageChanged: function (inSender, inEvent) { - //console.log("passagedChanged: ", inEvent); + //console.log("passageChanged: ", inEvent); this.$.bcPopup.hide(); if (!inEvent.offsetRef) { delete inEvent.originator; @@ -303,16 +291,17 @@ enyo.kind({ return true; }, - handlePassage: function (inOsis) { - //console.log("handlePassage", inOsis, this.passage); + handlePassage: function (inOsis, inEvent) { + //console.log("handlePassage", inOsis, inEvent, this.passage); this.verses = []; this.$.verseList.setCount(this.verses.length); this.$.verseList.refresh(); var verseNumber = this.passage.verseNumber ? this.passage.verseNumber : 0; - if (typeof inOsis === "string") { + if (typeof inOsis === "string" || (inEvent && inEvent.osisRef && !inEvent.label && !inEvent.chapter)) { //BibleZ currently supports only Book.Chapter Osis passages in the mainView + inOsis = (inEvent.osisRef) ? inEvent.osisRef : inOsis; if(inOsis.split(".").length > 2) { verseNumber = parseInt(inOsis.slice(inOsis.lastIndexOf(".")+1, inOsis.length), 10); inOsis = inOsis.slice(0, inOsis.lastIndexOf(".")); @@ -324,7 +313,10 @@ enyo.kind({ label: inOsis.replace(".", " "), chapter: parseInt(inOsis.split(".")[1], 10) }; + this.settings["lastRead"] = this.passage; + api.put(this.settings); } + this.$.btnPassage.setContent((this.passage.label) ? this.passage.label : api.formatOsis(this.passage.osisRef)); this.loadText(this.passage.osisRef, enyo.bind(this, function (inError, inResult) { if(!inError) { @@ -776,8 +768,27 @@ enyo.kind({ this.doOpenAbout(); else if(inEvent.originator.action === "font") this.handleFontMenu(); - else - this.doOpenDataView({section: inEvent.originator.action}); + else { + if(enyo.Panels.isScreenNarrow()) + this.doOpenDataView({section: inEvent.originator.action}); + else { + this.$.sidebar.show(); + this.$.mainView.resized(); + this.$.verseList.reset(this.offset); + if(!this.$.dataView) { + this.$.sidebar.createComponent({name: "dataView", kind: "biblez.dataView", onBack: "handleBack", onVerse: "handlePassage"}, {owner: this}).render(); + this.$.dataView.showHideButton(); + } + this.$.dataView.updateSection(inEvent.originator.action); + } + } + }, + + handleBack: function (inSender, inEvent) { + this.$.sidebar.destroyClientControls(); + this.$.sidebar.hide(); + this.$.mainView.resized(); + this.$.verseList.reset(this.offset); }, handlePanelIndex: function (inSender, inEvent) { @@ -805,6 +816,14 @@ enyo.kind({ } }, + resizeHandler: function () { + this.inherited(arguments); + if(enyo.Panels.isScreenNarrow()) { + this.$.sidebar.destroyClientControls(); + this.$.sidebar.hide(); + } + }, + handleError: function (inMessage) { this.$.messagePopup.setContent(inMessage); this.$.messagePopup.show(); |