File app/src/main/assets/index.html changed (mode: 100644) (index 69ea054..a7c165e) |
28 |
28 |
<script src="js/rucker/mithril.js"></script>
|
<script src="js/rucker/mithril.js"></script>
|
29 |
29 |
<script src="js/rucker/webfont.js"></script>
|
<script src="js/rucker/webfont.js"></script>
|
30 |
30 |
<script src="js/rucker/rkr.js"></script>
|
<script src="js/rucker/rkr.js"></script>
|
31 |
|
<script type='text/javascript'>
|
|
32 |
|
var require = {"baseUrl":"js/","deps":["js/index.js"]};
|
|
33 |
|
|
|
34 |
|
document.addEventListener('DOMContentLoaded', function() {
|
|
35 |
|
});
|
|
36 |
|
</script>
|
|
|
31 |
|
<script type='text/javascript'>var require = {"baseUrl":"js/","deps":["js/index.js"]};</script>
|
37 |
32 |
<script src="js/rucker/require.js"></script>
|
<script src="js/rucker/require.js"></script>
|
38 |
33 |
|
|
39 |
34 |
</body>
|
</body>
|
File app/src/main/assets/js/com/mobile/books.rkr.js changed (mode: 100644) (index ec6b95c..a810001) |
... |
... |
define([], function() { |
22 |
22 |
comBooks.vm.init();
|
comBooks.vm.init();
|
23 |
23 |
comBooks.vm.set(args);
|
comBooks.vm.set(args);
|
24 |
24 |
|
|
25 |
|
this.author = args.author;
|
|
26 |
|
this.books = args.books;
|
|
27 |
25 |
this.webApp = args.webApp;
|
this.webApp = args.webApp;
|
28 |
26 |
|
|
29 |
27 |
this.onSelection = function (book) {
|
this.onSelection = function (book) {
|
30 |
28 |
m.startComputation();
|
m.startComputation();
|
31 |
|
setTimeout(function () {
|
|
32 |
|
var author = comBooks.vm.author();
|
|
33 |
|
var contentPath = "js/data/authors/" + author.id + "/book_" + book.id + ".html";
|
|
|
29 |
|
var author = comBooks.vm.author();
|
|
30 |
|
var contentPath = "js/data/authors/" + author.id + "/book_" + book.id + ".html";
|
34 |
31 |
|
|
35 |
|
log.debug("contentPath:" + contentPath);
|
|
|
32 |
|
log.debug("contentPath:" + contentPath);
|
36 |
33 |
|
|
37 |
|
rkr.promise(contentPath, self.onContentLoaded, rkr.errorHandler);
|
|
|
34 |
|
rkr.promise(contentPath, function (data) {
|
|
35 |
|
self.onContentLoaded(data, book);
|
|
36 |
|
}, rkr.errorHandler);
|
38 |
37 |
|
|
39 |
|
}, 200);
|
|
40 |
38 |
};
|
};
|
41 |
39 |
|
|
42 |
|
this.onContentLoaded = function (data) {
|
|
43 |
|
var pageArguments = {
|
|
44 |
|
content: data
|
|
45 |
|
};
|
|
46 |
|
|
|
47 |
|
self.webApp.addPage({type: "content", active: true, arguments: pageArguments});
|
|
|
40 |
|
this.onContentLoaded = function (data, book) {
|
|
41 |
|
self.webApp.addPage({
|
|
42 |
|
type: "content",
|
|
43 |
|
active: true, arguments: {
|
|
44 |
|
content: data,
|
|
45 |
|
book: book,
|
|
46 |
|
author: comBooks.vm.author()
|
|
47 |
|
}
|
|
48 |
|
});
|
48 |
49 |
m.endComputation();
|
m.endComputation();
|
49 |
50 |
};
|
};
|
50 |
51 |
|
|
|
... |
... |
define([], function() { |
61 |
62 |
m('h1', 'Povești'),
|
m('h1', 'Povești'),
|
62 |
63 |
m('small', 'de ' + args.author.name),
|
m('small', 'de ' + args.author.name),
|
63 |
64 |
m('ul.mBooks', [
|
m('ul.mBooks', [
|
64 |
|
ctrl.books.map(function (book, index) {
|
|
|
65 |
|
comBooks.vm.books().map(function (book, index) {
|
65 |
66 |
var bookImage = 'images/books/' + book.id + '.jpg';
|
var bookImage = 'images/books/' + book.id + '.jpg';
|
66 |
67 |
|
|
67 |
68 |
return m('li.mBooks_item.oMedia', {
|
return m('li.mBooks_item.oMedia', {
|
File app/src/main/assets/js/com/mobile/content.rkr.js changed (mode: 100644) (index f7dce8e..7c7f605) |
... |
... |
define([], function() { |
8 |
8 |
|
|
9 |
9 |
var comContent = {};
|
var comContent = {};
|
10 |
10 |
|
|
|
11 |
|
(comContent.vm = function () {
|
|
12 |
|
var vm = {};
|
|
13 |
|
|
|
14 |
|
vm.init = function () {
|
|
15 |
|
vm.author = m.prop(null);
|
|
16 |
|
vm.book = m.prop(null);
|
|
17 |
|
vm.content = m.prop(null);
|
|
18 |
|
|
|
19 |
|
vm.set = function (args) {
|
|
20 |
|
vm.author(args.author);
|
|
21 |
|
vm.book(args.book);
|
|
22 |
|
vm.content(args.content);
|
|
23 |
|
};
|
|
24 |
|
};
|
|
25 |
|
return vm;
|
|
26 |
|
}());
|
|
27 |
|
|
11 |
28 |
comContent.controller = function(args) {
|
comContent.controller = function(args) {
|
12 |
29 |
var self = this;
|
var self = this;
|
13 |
30 |
|
|
14 |
|
this.content = args.content;
|
|
|
31 |
|
comContent.vm.init();
|
|
32 |
|
comContent.vm.set(args);
|
|
33 |
|
|
15 |
34 |
this.webApp = args.webApp;
|
this.webApp = args.webApp;
|
16 |
35 |
|
|
17 |
36 |
this.onBack = function () {
|
this.onBack = function () {
|
|
... |
... |
define([], function() { |
19 |
38 |
};
|
};
|
20 |
39 |
};
|
};
|
21 |
40 |
|
|
22 |
|
comContent.view = function(ctrl) {
|
|
|
41 |
|
comContent.view = function(ctrl, args) {
|
|
42 |
|
comContent.vm.set(args);
|
|
43 |
|
|
|
44 |
|
var mContent = m("section", {config: function(el, isInit) {
|
|
45 |
|
el.innerHTML = comContent.vm.content();
|
|
46 |
|
}});
|
|
47 |
|
|
23 |
48 |
return m('div', [
|
return m('div', [
|
24 |
49 |
m('span', {onclick: ctrl.onBack.bind(this)}, 'Back'),
|
m('span', {onclick: ctrl.onBack.bind(this)}, 'Back'),
|
25 |
|
injectHTML(ctrl.content)
|
|
|
50 |
|
m('h1', comContent.vm.book().title),
|
|
51 |
|
m('small', "de " + comContent.vm.author().name),
|
|
52 |
|
m('p', injectHTML(' ')),
|
|
53 |
|
mContent
|
26 |
54 |
]);
|
]);
|
27 |
55 |
};
|
};
|
28 |
56 |
|
|
File app/src/main/java/ro/bitvice/cufarulcupovestiapk/FullscreenActivity.java changed (mode: 100644) (index 4d97070..a20a4ea) |
... |
... |
public class FullscreenActivity extends Activity { |
90 |
90 |
|
|
91 |
91 |
}
|
}
|
92 |
92 |
|
|
|
93 |
|
@Override
|
|
94 |
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
95 |
|
// Check if the key event was the Back button and if there's history
|
|
96 |
|
if ((keyCode == KeyEvent.KEYCODE_BACK)) {
|
|
97 |
|
mWebView.loadUrl("javascript:prevPage()");
|
|
98 |
|
return true;
|
|
99 |
|
}
|
|
100 |
|
// If it wasn't the Back key or there's no web page history, bubble up to the default
|
|
101 |
|
// system behavior (probably exit the activity)
|
|
102 |
|
return super.onKeyDown(keyCode, event);
|
|
103 |
|
}
|
|
104 |
|
|
|
105 |
|
|
93 |
106 |
@Override
|
@Override
|
94 |
107 |
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
95 |
108 |
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|