Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* fixed displaying of long notes

* added antijingoist improvements (new background, ...)
  • Loading branch information...
commit c4be804d56e3aaaef1c80208b6e7b0727cc9be3a 1 parent f0eb90f
@zefanja authored
View
2  frontend/biblez.application/appinfo.json
@@ -1,6 +1,6 @@
{
"id": "de.zefanjas.biblez.enyo",
- "version": "0.5.1",
+ "version": "0.5.2",
"vendor": "zefanjas",
"type": "web",
"main": "index.html",
View
232 frontend/biblez.application/source/biblez.js
@@ -1,15 +1,15 @@
/*### BEGIN LICENSE
# Copyright (C) 2011 Stephan Tetzel <info@zefanjas.de>
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
+#
+# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
### END LICENSE*/
@@ -21,7 +21,7 @@ enyo.kind({
{kind: "ApplicationEvents", onBack: "goToMainView"},
{kind: "ApplicationEvents", onUnload: "savePassage"},
{kind: "PalmService", service: "palm://com.palm.applicationManager/", method: "open"},
-
+
{kind: "AppMenu", components: [
{caption: $L("Module Manager"), onclick: "openModuleMgr"},
{caption: $L("Preferences"), onclick: "openPrefs"},
@@ -48,7 +48,7 @@ enyo.kind({
{kind: "Spinner", showing: true},
{kind: "Spacer"},
{icon: "images/font.png", onclick: "openFontMenu"},
- {name: "btSidebar", icon: "images/sidebar.png", toggling: true, onclick: "openSidebar"}
+ {name: "btSidebar", icon: "images/sidebar.png", toggling: true, onclick: "openSidebar"}
]},
{name: "modMenu", kind: "Menu", lazy: false},
{name: "historyMenu", kind: "Menu", lazy: false},
@@ -61,7 +61,7 @@ enyo.kind({
{kind: "Button", caption: $L("Open Module Manager"), className: "first-start-button", onclick: "openModuleMgr"}
]},
{name: "sidebarContainer", className: "main-sidebar",components: [
- {name: "noteBmSidebar", kind: "BibleZ.Sidebar", className: "sidebar-inner", onVerse: "handleSidebarVerse", onSearch: "handleSearch"}
+ {name: "noteBmSidebar", kind: "BibleZ.Sidebar", className: "sidebar-inner", onVerse: "handleSidebarVerse", onSearch: "handleSearch"}
]}
]}
]},
@@ -76,7 +76,7 @@ enyo.kind({
dbSets: window.localStorage,
verses: {}
},
-
+
pluginReady: false,
pluginSpeechReady: false,
@@ -86,7 +86,7 @@ enyo.kind({
enyo.application.hebrewFont = "";
enyo.application.greekFont = "";
enyo.application.modManViewLeft = true;
-
+
this.$.firstStart.hide();
this.$.mainToolbar.hide();
this.$.biblezHint.hide();
@@ -96,7 +96,7 @@ enyo.kind({
this.currentModule = undefined;
this.currentFontSize = 20;
this.currentFont = "Prelude";
-
+
this.position = 0;
this.$.plugin.addCallback("returnModules", enyo.bind(this, "handleGetModules"), true);
this.$.plugin.addCallback("returnVerses", enyo.bind(this, "handleGetVerses"), true);
@@ -109,7 +109,7 @@ enyo.kind({
this.$.plugin.addCallback("returnGetDetails", enyo.bind(this, "handleGetDetails"), true);
this.$.plugin.addCallback("returnSearch", enyo.bind(this, "handleSearchResults"), true);
this.$.plugin.addCallback("returnSearchProcess", enyo.bind(this, "handleSearchProcess"), true);
-
+
enyo.keyboard.setResizesWindow(false);
window.setTimeout(enyo.bind(this, this.isPluginReady), 10000);
@@ -122,16 +122,16 @@ enyo.kind({
rendered: function () {
this.inherited(arguments);
- if (enyo.fetchDeviceInfo().keyboardAvailable)
+ if (enyo.fetchDeviceInfo().keyboardAvailable)
this.$.btSidebar.setToggling(false);
},
-
+
//SERVICE STUFF
callFileService: function () {
enyo.log("Calling service...");
this.$.fileHelper.readDir();
},
-
+
//SIDEBAR STUFF
openSidebar: function () {
if (!enyo.fetchDeviceInfo().keyboardAvailable) {
@@ -150,22 +150,22 @@ enyo.kind({
this.$.mainPane.selectViewByName("sidebarView");
}
},
-
+
handleSidebarVerse: function (inSender, inEvent) {
//enyo.log(this.$.noteBmSidebar.getPassage());
if (!enyo.fetchDeviceInfo().keyboardAvailable) {
this.$.selector.setVerse(this.$.noteBmSidebar.getVerse());
this.getVerses(this.$.noteBmSidebar.getPassage());
- } else {
+ } else {
this.$.selector.setVerse(this.$.sidebarView.getVerse());
this.$.selector.setCurrentPassage(this.$.sidebarView.getPassage());
//this.getVerses(this.$.sidebarView.getPassage());
this.$.mainPane.selectViewByName("verseView");
}
},
-
+
//POPUP STUFF
-
+
handleVerseTap: function(inSender, inEvent) {
this.$.versePopup.setTappedVerse(this.$.mainView.tappedVerse);
this.$.versePopup.setVerse(enyo.byId("verse"+this.$.mainView.tappedVerse).innerHTML.replace(/<[^>]*>/g, ""));
@@ -184,7 +184,7 @@ enyo.kind({
this.$.versePopup.setNoteCaption($L("Note") + " + ");
}
},
-
+
handleNote: function () {
if (enyo.byId("noteIcon"+this.$.mainView.tappedVerse).innerHTML !== "") {
biblezTools.removeNote(this.$.selector.getBnumber(), this.$.selector.getChapter(), this.$.mainView.tappedVerse, enyo.bind(this, this.getNotes));
@@ -194,25 +194,25 @@ enyo.kind({
this.openAddNote();
}
},
-
+
openAddNote: function () {
//enyo.keyboard.setResizesWindow(false);
this.$.versePopup.close();
this.$.notePopup.clearInput();
this.$.notePopup.openAtCenter();
-
+
//this.$.notePopup.setFocus();
-
+
},
-
+
addNote: function (inSender, inEvent) {
if (inSender.edit === false) {
biblezTools.addNote(this.$.selector.getBnumber(), this.$.selector.getChapter(), this.$.mainView.tappedVerse, enyo.json.stringify(this.$.notePopup.getNote()), "", "", "", enyo.bind(this, this.getNotes));
} else {
biblezTools.updateNote(this.$.selector.getBnumber(), this.$.selector.getChapter(), this.$.mainView.tappedVerse, enyo.json.stringify(this.$.notePopup.getNote()), "", "", "", enyo.bind(this, this.getNotes));
- }
+ }
},
-
+
getNotes: function() {
biblezTools.getNotes(this.$.selector.bnumber, this.$.selector.chapter, enyo.bind(this.$.mainView, this.$.mainView.setNotes));
if (!enyo.fetchDeviceInfo().keyboardAvailable)
@@ -220,7 +220,7 @@ enyo.kind({
else
biblezTools.getNotes(-1,-1,enyo.bind(this.$.sidebarView, this.$.sidebarView.handleNotes));
},
-
+
openShowNote: function (inSender, inEvent) {
//enyo.log("Show Notes...");
//this.$.noteView.setNote(inSender.notes[inSender.tappedNote].note);
@@ -235,7 +235,7 @@ enyo.kind({
else
this.$.notePopup.openAtCenter();
},
-
+
handleBookmark: function (inSender, inEvent) {
this.$.versePopup.close();
if (enyo.byId("bmIcon"+this.$.mainView.tappedVerse).innerHTML !== "") {
@@ -243,9 +243,9 @@ enyo.kind({
enyo.byId("bmIcon"+this.$.mainView.tappedVerse).innerHTML = "";
} else {
biblezTools.addBookmark(this.$.selector.getBnumber(), this.$.selector.getChapter(), this.$.mainView.tappedVerse, "", "", "", enyo.bind(this, this.getBookmarks));
- }
+ }
},
-
+
getBookmarks: function() {
biblezTools.getBookmarks(this.$.selector.bnumber, this.$.selector.chapter, enyo.bind(this.$.mainView, this.$.mainView.setBookmarks));
if (!enyo.fetchDeviceInfo().keyboardAvailable)
@@ -253,7 +253,7 @@ enyo.kind({
else
biblezTools.getBookmarks(-1,-1,enyo.bind(this.$.sidebarView, this.$.sidebarView.handleBookmarks));
},
-
+
handleHighlight: function (inSender, inEvent) {
//enyo.log("BG:",enyo.byId("verse"+this.$.mainView.tappedVerse).style.backgroundColor);
if (enyo.byId("verse"+this.$.mainView.tappedVerse).style.backgroundColor.search("rgba") == -1) {
@@ -262,9 +262,9 @@ enyo.kind({
biblezTools.updateHighlight(this.$.selector.getBnumber(), this.$.selector.getChapter(), this.$.mainView.tappedVerse,inSender.getColor(), "",enyo.bind(this, this.getHighlights));
}
enyo.byId("verse"+this.$.mainView.tappedVerse).style.backgroundColor = inSender.getColor();
-
+
},
-
+
getHighlights: function() {
biblezTools.getHighlights(this.$.selector.bnumber, this.$.selector.chapter, enyo.bind(this.$.mainView, this.$.mainView.setHighlights));
if (!enyo.fetchDeviceInfo().keyboardAvailable)
@@ -272,52 +272,54 @@ enyo.kind({
else
biblezTools.getHighlights(-1,-1,enyo.bind(this.$.sidebarView, this.$.sidebarView.handleHighlights));
},
-
+
hideColors: function (inSender, inEvent) {
//this.$.versePopup.hideColors();
},
-
+
openAbout: function () {
this.$.biblezAbout.openAtCenter();
},
-
+
showError: function (message) {
this.$.errorMsg.setContent(message);
this.$.errorDialog.openAtCenter();
},
-
+
closeError: function (message) {
this.$.errorDialog.close();
},
-
+
selectModule: function (inSender, inEvent) {
this.$.modMenu.openAtEvent(inEvent);
},
-
+
openHistoryMenu: function (inSender, inEvent) {
this.$.historyMenu.openAtEvent(inEvent);
},
-
+
openFontMenu: function (inSender, inEvent) {
this.$.fontMenu.openAtEvent(inEvent);
this.$.fontMenu.setFontSize(this.currentFontSize);
this.$.fontMenu.setFont(this.currentFont);
},
-
+
changeFontSize: function (inSender, inEvent) {
if (inSender) {this.currentFontSize = inSender.getFontSize();}
this.$.mainView.setFontSize(this.currentFontSize);
},
-
+
changeFont: function (inSender, inEvent) {
if (inSender) {
if (inSender.getFont() == "greek") {
this.currentFont = enyo.application.greekFont;
} else if (inSender.getFont() == "hebrew") {
this.currentFont = enyo.application.hebrewFont;
+ } else if (inSender.getFont() == "custom") {
+ this.currentFont = enyo.application.customFont;
} else {
this.currentFont = inSender.getFont();
- }
+ }
}
this.$.mainView.setFont(this.currentFont);
},
@@ -332,9 +334,9 @@ enyo.kind({
this.$.spinner.hide();
this.readText(content);
},
-
+
//PREFERENCES
-
+
changeBackground: function () {
switch (this.$.prefs.getBackground()) {
case "palm":
@@ -352,20 +354,20 @@ enyo.kind({
case "white":
this.$.mainView.setClassName("scroller-white");
break;
-
+
}
},
-
+
changeLinebreak: function (inSender, inEvent) {
this.$.mainView.setLinebreak(inSender.getLinebreak());
},
-
+
//HYBRID STUFF
-
+
readText: function(text) {
if(this.pluginSpeechReady) {
var status = this.$.pluginSpeech.callPluginMethod("playAudio",text);
- enyo.log("status = " + status);
+ enyo.log("status = " + status);
} else {
this.showError("Plugin not ready!");
}
@@ -383,7 +385,7 @@ enyo.kind({
//this.$.plugin.hide();
this.getModules();
},
-
+
handleGetModules: function(modules) {
//enyo.log("INFO: " + modules);
var mods = enyo.json.parse(modules);
@@ -395,11 +397,11 @@ enyo.kind({
comp[j].destroy();
}
}
-
+
if (mods.length > 0) {
this.$.firstStart.hide();
this.$.mainToolbar.show();
-
+
//Check if saved Module currently exists
var ifModule = 0;
if (this.dbSets["lastRead"]) {
@@ -408,12 +410,12 @@ enyo.kind({
ifModule = 1;
}
}
- }
+ }
this.currentModule = (this.dbSets["lastRead"] && ifModule == 1)? enyo.json.parse(this.dbSets["lastRead"]).module : mods[0];
-
+
//Get current Booknames
this.getBooknames(this.currentModule.name);
-
+
//this.currentModule = mods[0];
var kindName = "";
for (var i=0;i<mods.length;i++) {
@@ -425,7 +427,7 @@ enyo.kind({
}
this.$.modMenu.render();
//this.$.modMenu.setItems(tmp); //???
-
+
if (this.start === 0) {
if (this.dbSets.lastRead) {
var lastRead = enyo.json.parse(this.dbSets.lastRead);
@@ -443,10 +445,11 @@ enyo.kind({
this.$.prefs.setLinebreak(lastRead.linebreak);
enyo.application.hebrewFont = (lastRead.hebrewFont) ? lastRead.hebrewFont : "";
enyo.application.greekFont = (lastRead.greekFont) ? lastRead.greekFont : "";
- this.$.prefs.setCustomFonts(enyo.application.hebrewFont, enyo.application.greekFont);
- }
+ enyo.application.customFont = (lastRead.customFont) ? lastRead.customFont : "";
+ this.$.prefs.setCustomFonts(enyo.application.hebrewFont, enyo.application.greekFont, enyo.application.customFont);
+ }
}
- this.start = 1;
+ this.start = 1;
} else {
enyo.log("NO MODULES");
this.$.mainToolbar.hide();
@@ -455,7 +458,7 @@ enyo.kind({
//this.$.mainPane.selectViewByName("verseView");
}
},
-
+
handleSelectModules: function (inSender, inEvent) {
enyo.log("MODULE: " + inSender.module.name);
this.currentModule = inSender.module;
@@ -469,7 +472,7 @@ enyo.kind({
//this.getBooknames(this.currentModule.name);
this.getVerses(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter(), inSender.module.name);
},
-
+
handleBooknames: function(response) {
//enyo.log(response);
this.$.selector.createSection("books", enyo.json.parse(response));
@@ -479,24 +482,24 @@ enyo.kind({
else
this.$.sidebarView.setBookNames(enyo.json.parse(response));
if (this.$.mainPane.getViewName() == "verseView") {
- this.getVerses(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter(), this.currentModule.name);
+ this.getVerses(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter(), this.currentModule.name);
}
-
+
},
-
+
handleGetVerses: function(verses, passage) {
//this.showError(enyo.json.parse(verses));
//enyo.log(verses);
this.$.selector.setCurrentPassage(passage);
this.verses = enyo.json.parse(verses);
-
+
if (enyo.json.parse(verses).length !== 0) {
this.$.mainView.show();
this.$.biblezHint.hide();
this.$.mainView.setVerses(enyo.json.parse(verses), this.$.selector.verse);
this.$.mainView.setPrevChapter(this.$.selector.getPrevPassage().passage);
this.$.mainView.setNextChapter(this.$.selector.getNextPassage().passage);
-
+
//Need to wait for setCurrentPassage???
this.getNotes();
this.getBookmarks();
@@ -508,17 +511,17 @@ enyo.kind({
this.$.mainView.hide();
this.$.biblezHint.show();
}
-
+
//enyo.log(enyo.json.stringify(this.dbSets["history"]));
this.setHistory();
if (enyo.fetchDeviceInfo().keyboardAvailable) {
- this.$.tbPassage.setCaption(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter());
+ this.$.tbPassage.setCaption(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter());
} else {
this.$.tbPassage.setCaption(this.currentModule.name + " - " + this.$.selector.getBook().name + " " + this.$.selector.getChapter());
}
this.$.spinner.hide();
},
-
+
setHistory: function () {
var history = [];
if(this.dbSets.history) {
@@ -532,17 +535,17 @@ enyo.kind({
}
}
}
-
+
history.unshift({"passage": this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter()});
this.dbSets["history"] = enyo.json.stringify(history);
-
+
var comp = this.getComponents()
for (var j=0;j<comp.length;j++) {
if (comp[j].name.search(/historyItem\d+/) != -1) {
comp[j].destroy();
}
}
-
+
var kindName = "";
for (var i=0;i<history.length;i++) {
kindName = "historyItem" + i;
@@ -550,12 +553,12 @@ enyo.kind({
}
this.$.historyMenu.render();
},
-
+
handleVMax: function(response) {
enyo.log(response)
this.$.selector.createSection("verses", parseInt(response, 10));
},
-
+
untarModules: function (inSender, inEvent) {
this.log("INFO", "Untar Modules...", inSender.allModsPath);
if (this.pluginReady) {
@@ -566,9 +569,9 @@ enyo.kind({
this.log("ERROR", "plugin not ready");
}
},
-
+
handleUntar: function (response) {
- enyo.log(response);
+ enyo.log(response);
if (response == "0") {
this.log("INFO", "Read available confs...");
if (this.pluginReady) {
@@ -584,12 +587,12 @@ enyo.kind({
this.showError("Couldn't untar mods.d.tar. You need to remove the /media/internal/.sword/ directory!");
}
},
-
+
handleReadConfs: function(modules) {
this.log("INFO", modules.length);
biblezTools.prepareModules(enyo.json.parse(modules), enyo.bind(this.$.modManView, this.$.modManView.getLang));
},
-
+
unzipModule: function(inSender, inEvent) {
enyo.log(inSender.modulePath);
if (this.pluginReady) {
@@ -600,7 +603,7 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
handleUnzip: function (response) {
if (response == "true") {
this.log("INFO", "Unzipped Module!");
@@ -608,7 +611,7 @@ enyo.kind({
this.getModules();
}
},
-
+
removeModule: function (inSender, inEvent) {
enyo.log(inSender.moduleToRemove.dataPath + "," + inSender.moduleToRemove.name.toLowerCase());
if (this.pluginReady) {
@@ -619,13 +622,13 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
handleRemove: function (response) {
enyo.log("REMOVE: " + response);
enyo.windows.addBannerMessage($L("Uninstalled Module!"), enyo.json.stringify({}));
this.getModules();
},
-
+
getDetails: function (inSender, inEvent) {
if (this.pluginReady) {
try { var status = this.$.plugin.callPluginMethod("getModuleDetails", inSender.currentModule); }
@@ -635,12 +638,12 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
handleGetDetails: function (details) {
//enyo.log("DETAILS", details);
this.$.modManView.showDetails(enyo.json.parse(details));
},
-
+
handleSearch: function (inSender, inValue) {
if (this.pluginReady) {
enyo.log(inSender.getSearchType());
@@ -651,7 +654,7 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
handleSearchResults: function (results) {
//enyo.log("RESULTS:", results);
if (!enyo.fetchDeviceInfo().keyboardAvailable)
@@ -659,11 +662,11 @@ enyo.kind({
else
this.$.sidebarView.setSearchResults(enyo.json.parse(results));
},
-
+
handleSearchProcess: function (process) {
enyo.log("PROCESS: ", process);
},
-
+
getModules:function(inSender, inEvent) {
//this.log(inSender, inEvent);
if (this.pluginReady) {
@@ -674,11 +677,11 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
getPassage: function (inSender, inEvent) {
this.getVerses(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter());
},
-
+
getVerses:function(passage, module) {
if(!module) {module = this.currentModule.name;}
if (this.pluginReady) {
@@ -689,7 +692,7 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
getBooknames:function(modName) {
if (this.pluginReady) {
try {var status = this.$.plugin.callPluginMethod("getBooknames", modName);}
@@ -699,7 +702,7 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
getVMax:function() {
var passage = this.$.selector.getBook().name + " " + this.$.selector.getChapter();
enyo.log(passage);
@@ -711,14 +714,14 @@ enyo.kind({
this.showError("plugin not ready");
}
},
-
+
//OTHER STUFF
-
+
handleSelectHistory: function (inSender, inEvent) {
this.$.selector.setVerse(1);
this.getVerses(inSender.passage.passage);
},
-
+
changeChapter: function (inSender, inEvent) {
//enyo.log("CHANGE CHAPTER... " + inSender.index, inSender.numberOfSnappers);
if (inSender.index === 0) {
@@ -732,7 +735,7 @@ enyo.kind({
this.$.selector.setChapter(prev.prevChapter);
this.$.selector.setBnumber(prev.prevBnumber);
this.$.selector.setVerse(1);
- }
+ }
} else if (inSender.index == inSender.numberOfSnappers + 2) {
var next = this.$.selector.getNextPassage();
if (next.nextBook !== "" && next.nextChapter !== 0) {
@@ -744,18 +747,18 @@ enyo.kind({
} else {
this.$.mainView.setIndex(this.$.mainView.getIndex()-1);
}
-
+
}
},
-
+
openModuleMgr: function (inSender, inEvent) {
this.$.mainPane.selectViewByName("modManView");
},
-
+
openPrefs: function (inSender, inEvent) {
this.$.mainPane.selectViewByName("prefs");
},
-
+
openHelp: function () {
this.$.palmService.call({
id: 'com.palm.app.browser',
@@ -768,11 +771,11 @@ enyo.kind({
openReview: function () {
window.location = "http://developer.palm.com/appredirect/?packageid=de.zefanjas.biblez.enyo";
},
-
+
showToaster: function() {
this.$.selector.openSelector();
},
-
+
goToMainView: function (inSender, inEvent) {
//enyo.log(this.$.mainPane.getViewName(), inSender.name);
if (this.$.mainPane.getViewName() != "verseView" && enyo.application.modManViewLeft) {
@@ -783,9 +786,9 @@ enyo.kind({
} else {
//enyo.log("CARD VIEW");
}
-
+
},
-
+
viewSelected: function(inSender, inView, inPreviousView) {
//enyo.log(inView.name);
if (inView.name == "modManView") {
@@ -795,26 +798,26 @@ enyo.kind({
if(this.$.modManView.installedModules.length !== 0) {
this.getVerses(this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter(), this.currentModule.name);
}
-
+
}
},
-
+
windowRotated: function(inSender) {
//enyo.log(enyo.fetchAppInfo().title);
if (!enyo.fetchDeviceInfo().keyboardAvailable && this.$.sidebarView)
this.$.sidebarView.destroy();
},
-
+
openAppMenuHandler: function() {
this.$.appMenu.open();
},
-
+
closeAppMenuHandler: function() {
this.$.appMenu.close();
},
-
+
//SAVE CURRENT PASSAGE
-
+
savePassage: function () {
var lastRead = {
"passage" : this.$.selector.getBook().abbrev + " " + this.$.selector.getChapter(),
@@ -828,7 +831,8 @@ enyo.kind({
"background" : this.$.prefs.getBackground(),
"linebreak": this.$.prefs.getLinebreak(),
"greekFont": enyo.application.greekFont,
- "hebrewFont": enyo.application.hebrewFont
+ "hebrewFont": enyo.application.hebrewFont,
+ "customFont": enyo.application.customFont
};
//enyo.log(enyo.json.stringify(lastRead));
if(this.currentModule) {
View
4 frontend/biblez.application/source/biblezModuleManager.js
@@ -32,7 +32,7 @@ enyo.kind({
},
components: [
{kind: enyo.ApplicationEvents, onBack: "goBack"},
- {kind: enyo.PalmService,
+ {kind: enyo.PalmService,
name: "DownloadMgr",
service: "palm://com.palm.downloadmanager/",
method: "download",
@@ -128,7 +128,7 @@ enyo.kind({
inEvent.stopPropagation();
if (this.$.slidingPane.getViewName() == "left")
enyo.application.modManViewLeft = true;
- }
+ }
},
refreshModules: function (inSender, inEvent) {
View
116 frontend/biblez.application/source/biblezPopup.js
@@ -1,15 +1,15 @@
/*### BEGIN LICENSE
# Copyright (C) 2011 Stephan Tetzel <info@zefanjas.de>
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
+#
+# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
### END LICENSE*/
@@ -18,8 +18,8 @@ enyo.kind({
scrim: false,
kind: "Popup",
lazy: false,
- /*showHideMode: "transition",
- openClassName: "fadeIn",
+ /*showHideMode: "transition",
+ openClassName: "fadeIn",
className: "fadedOut", */
events: {
onNote: "",
@@ -63,21 +63,21 @@ enyo.kind({
{kind: "Button", caption: $L("eMail"), flex: 1, onclick: "sendEmail"},
{kind: "Button", caption: $L("SMS"), flex: 1, onclick: "sendSMS"}
]}
- ]}
+ ]}
],
-
+
setBmCaption: function (caption) {
this.$.bmCaption.setContent(caption);
},
-
+
setNoteCaption: function (caption) {
this.$.noteCaption.setContent(caption);
},
-
+
setHlCaption: function (caption) {
this.$.hlCaption.setContent(caption);
},
-
+
open: function () {
this.inherited(arguments);
this.$.colorSelector.hide();
@@ -90,12 +90,12 @@ enyo.kind({
this.$.colorSelector.show();
this.$.csSelector.hide();
},
-
+
openColors: function (inSender, inEvent) {
this.$.colorSelector.show();
this.$.csSelector.hide();
},
-
+
highlightVerse: function (inSender, inEvent) {
//enyo.log(inSender.color);
this.color = inSender.color;
@@ -126,12 +126,12 @@ enyo.kind({
sendSMS: function (inSender, inEvent) {
this.$.palmService.call({
id: 'com.palm.app.messaging',
- params: {
+ params: {
messageText: this.verse
}
- });
+ });
},
-
+
closePopup: function() {
this.close();
}
@@ -148,26 +148,26 @@ enyo.kind({
published: {
edit: false
},
- caption: $L("Add A Note"),
- components:[
- //{kind: "Scroller", style: "max-height: 300px; min-height: 50px;", components: [
- {name: "noteInput", kind: "RichText", className: "note-input", hint: $L("Add your note here."), changeOnInput: true, onfocus: "openCenter", onchange: "toggleButton"},
- //]},
- {layoutKind: "HFlexLayout", style: "margin-top: 10px;", components: [
+ caption: $L("Add A Note"),
+ components:[
+ {kind: "BasicScroller", autoVertical: true, style: "height: auto;", flex: 1, components: [
+ {name: "noteInput", kind: "RichText", className: "note-input", hint: $L("Add your note here."), changeOnInput: true, onfocus: "openCenter", onchange: "toggleButton"}
+ ]},
+ {layoutKind: "HFlexLayout", style: "margin-top: 10px;", components: [
{name: "btCancel", kind: "Button", caption: $L("Cancel"), flex: 1, onclick: "closePopup"},
{name: "btAdd", kind: "Button", caption: $L("Add"), flex: 1, onclick: "addNote", className: "enyo-button-affirmative"}
]}
-
+
],
-
+
getNote: function () {
return this.$.noteInput.getHtml();
},
-
+
setFocus: function () {
this.$.noteInput.forceFocusEnableKeyboard();
},
-
+
toggleButton: function (inSender, inEvent) {
//enyo.log("INPUT:", inSender.getValue());
if (inSender.getValue() === "") {
@@ -176,7 +176,7 @@ enyo.kind({
this.$.btAdd.setDisabled(false);
}
},
-
+
clearInput: function () {
this.dismissWithClick = false;
this.$.noteInput.setValue("");
@@ -186,33 +186,33 @@ enyo.kind({
this.edit = false;
this.setFocus();
},
-
+
setNote: function(noteText) {
this.$.btAdd.hide();
this.$.noteInput.setValue(noteText.replace(/"/g,""));
},
-
+
addNote: function (inSender, inEvent) {
console.log(this.$.noteInput.getValue());
this.doAddNote();
this.closePopup();
},
-
+
setEditMode: function () {
this.edit = true;
},
-
+
showEditBt: function () {
if (this.edit === true) {
this.$.btAdd.setCaption($L("Edit"));
- this.$.btAdd.show();
- }
+ this.$.btAdd.show();
+ }
},
-
+
hideCancel: function () {
this.$.btCancel.hide();
},
-
+
openCenter: function() {
this.dismissWithClick = false;
this.$.btCancel.show();
@@ -220,7 +220,7 @@ enyo.kind({
//this.openAtCenter();
this.showEditBt();
},
-
+
closePopup: function () {
this.close();
}
@@ -232,14 +232,16 @@ enyo.kind({
//caption: "",
lazy: false,
components:[
- {name: "noteContent", allowHtml: true, content: "", className: "popup-note"}
+ {kind: "BasicScroller", autoVertical: true, style: "height: auto;", flex: 1, components: [
+ {name: "noteContent", allowHtml: true, content: "", className: "popup-note"}
+ ]}
//{kind: "Button", caption: $L("OK"), onclick: "closePopup", style: "margin-top:10px"}
],
-
+
setNote: function (note) {
this.$.noteContent.setContent(note.replace(/"/g,""));
},
-
+
closePopup: function() {
this.close();
}
@@ -273,41 +275,43 @@ enyo.kind({
{caption: "Times", value: "Times"},
{caption: $L("Greek"), value: "greek"},
{caption: $L("Hebrew"), value: "hebrew"},
- {caption: "Dyslexic", value: "open-dyslexic"}
-
+ {caption: $L("Custom"), value: "custom"}
+
]}
]}
- ]}
+ ]}
],
-
+
sliderChange: function (inSender, inEvent) {
//enyo.log(inSender.position);
this.fontSize = inSender.position;
this.doFontSize();
},
-
+
setFontSize: function (size) {
if (size) {
this.$.fontSlider.setPosition(size);
} else {
this.$.fontSlider.setPosition(20);
- }
+ }
},
-
+
setFont: function (font) {
if (font) {
if (font == enyo.application.hebrewFont) {
this.$.fontSelector.setValue("hebrew");
} else if (font == enyo.application.greekFont) {
this.$.fontSelector.setValue("greek");
+ } else if (font == enyo.application.customFont) {
+ this.$.fontSelector.setValue("custom");
} else {
this.$.fontSelector.setValue(font);
- }
+ }
} else {
this.$.fontSelector.setValue("Prelude");
- }
+ }
},
-
+
fontChanged: function(inSender, inValue, inOldValue) {
this.font = inValue;
this.doFont();
@@ -329,13 +333,13 @@ enyo.kind({
{kind: "Button", flex: 1, caption: $L("Send eMail"), onclick: "sendMail"},
{kind: "Button", flex: 1, caption: $L("Close"), onclick: "doCancel"}
]}
-
+
],
-
+
doCancel: function () {
this.close();
},
-
+
sendMail: function () {
this.$.palmService.call({
id: 'com.palm.app.email',
View
43 frontend/biblez.application/source/biblezPrefs.js
@@ -1,15 +1,15 @@
/*### BEGIN LICENSE
# Copyright (C) 2011 Stephan Tetzel <info@zefanjas.de>
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
+#
+# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
### END LICENSE*/
@@ -48,7 +48,7 @@ enyo.kind({
{flex: 1, name: "linebreak", content: $L("Enable Linebreaks")},
{name: "toggleLB", kind: "ToggleButton", state: this.linebreak, onChange: "changeLinebreak"}
]}
-
+
]},
{kind: "Group", caption: $L("Custom Fonts"), defaultKind: "HFlexBox", style: "margin-left: auto; margin-right: auto;", className: "prefs-container", components: [
{kind: "VFlexBox", components: [
@@ -61,6 +61,11 @@ enyo.kind({
{name: "greekInput", kind: "Input", hint: "", onblur: "handleGreekFont", components: [
{content: $L("Greek Font"), className: "popup-label"}
]}
+ ]},
+ {kind: "VFlexBox", components: [
+ {name: "customInput", kind: "Input", hint: "", onblur: "handleCustomFont", components: [
+ {content: $L("Custom Font"), className: "popup-label"}
+ ]}
]}
]},
{kind: "RowGroup", caption: $L("Backup & Restore"), defaultKind: "HFlexBox", style: "margin-left: auto; margin-right: auto;", className: "prefs-container", components: [
@@ -83,23 +88,23 @@ enyo.kind({
this.$.btBack.hide();
}
},
-
+
itemChanged: function(inSender, inValue, inOldValue) {
this.background = inValue;
this.doBgChange();
},
-
+
setBgItem: function (value) {
this.background = value;
this.$.generalSelector.setValue(value);
},
-
+
changeLinebreak: function (inSender, inState) {
//enyo.log(inState);
this.linebreak = inState;
this.doLbChange();
},
-
+
linebreakChanged: function (inSender, inEvent) {
this.$.toggleLB.setState(this.linebreak);
},
@@ -114,9 +119,15 @@ enyo.kind({
enyo.application.greekFont = "'" + inSender.getValue() + "'";
},
- setCustomFonts: function (hebrew, greek) {
+ handleCustomFont: function (inSender, inEvent) {
+ //enyo.log(inSender.getValue());
+ enyo.application.customFont = "'" + inSender.getValue() + "'";
+ },
+
+ setCustomFonts: function (hebrew, greek, custom) {
this.$.hebrewInput.setValue(hebrew.replace(/'/g, ""));
this.$.greekInput.setValue(greek.replace(/'/g, ""));
+ this.$.customInput.setValue(custom.replace(/'/g, ""));
},
handleBackup: function (inSender, inEvent) {
@@ -146,7 +157,7 @@ enyo.kind({
//enyo.log("RESPONSE:", inResponse);
if (inResponse.returnValue) {
enyo.windows.addBannerMessage($L("Backuped") + " " + inType, enyo.json.stringify({}));
- }
+ }
},
openFilePicker: function (inSender, inEvent) {
@@ -179,7 +190,7 @@ enyo.kind({
biblezTools.restoreHighlights(enyo.json.parse(inResponse.content), enyo.bind(this, this.callbackRestore, $L("Highlights")));
break;
}
- }
+ }
},
callbackRestore: function (inType) {
View
2  frontend/biblez.package/packageinfo.json
@@ -2,7 +2,7 @@
"id": "de.zefanjas.biblez.enyo",
"package_format_version": 2,
"loc_name": "BibleZ HD",
- "version": "0.5.1",
+ "version": "0.5.2",
"vendor": "zefanjas",
"vendorurl": "zefanjas.de",
"app": "de.zefanjas.biblez.enyo",
Please sign in to comment.
Something went wrong with that request. Please try again.