mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-25 01:18:17 -05:00
Initial gulp build system
This commit is contained in:
parent
aa29caebb3
commit
bd77dcc3a7
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@
|
||||
.DS_Store
|
||||
/build
|
||||
*.iml
|
||||
/node_modules
|
||||
npm-debug.log
|
||||
|
@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
<div id="content" />
|
||||
<div id="content"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function set_content(content) {
|
||||
|
4
app/src/main/assets/dist/book-bundle.js
vendored
Executable file
4
app/src/main/assets/dist/book-bundle.js
vendored
Executable file
File diff suppressed because one or more lines are too long
4
app/src/main/assets/dist/bundle.js
vendored
Executable file
4
app/src/main/assets/dist/bundle.js
vendored
Executable file
File diff suppressed because one or more lines are too long
30
app/src/main/assets/gulpfile.js
Normal file
30
app/src/main/assets/gulpfile.js
Normal file
@ -0,0 +1,30 @@
|
||||
var gulp = require('gulp');
|
||||
var gutil = require('gulp-util');
|
||||
var source = require('vinyl-source-stream');
|
||||
var watchify = require('watchify');
|
||||
var browserify = require('browserify');
|
||||
var uglify = require('gulp-uglify');
|
||||
var buffer = require('gulp-buffer');
|
||||
|
||||
gulp.task('watch', function() {
|
||||
var bundler = watchify(browserify('./src/book.coffee', watchify.args));
|
||||
|
||||
// Optionally, you can apply transforms
|
||||
// and other configuration options on the
|
||||
// bundler just as you would with browserify
|
||||
bundler.transform('coffeeify');
|
||||
|
||||
bundler.on('update', rebundle);
|
||||
|
||||
function rebundle() {
|
||||
return bundler.bundle()
|
||||
// log errors if they happen
|
||||
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
|
||||
.pipe(source('book-bundle.js'))
|
||||
.pipe(buffer())
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('./dist'));
|
||||
}
|
||||
|
||||
return rebundle();
|
||||
});
|
1
app/src/main/assets/src/book.coffee
Normal file
1
app/src/main/assets/src/book.coffee
Normal file
@ -0,0 +1 @@
|
||||
require 'angular'
|
@ -114,6 +114,13 @@ public class BookFragment extends BaseFragment {
|
||||
super.onPageFinished(view, url);
|
||||
invokeJavascript("set_content", lookupService.getHTMLVerse(initial));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||
super.onReceivedError(view, errorCode, description, failingUrl);
|
||||
Log.e(this.getClass().getSimpleName(), "Code: " + errorCode + " " +
|
||||
description);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -105,24 +105,9 @@ public class OsisToHtmlSaxHandler extends OsisSaxHandler {
|
||||
|
||||
@Override
|
||||
public void startDocument() {
|
||||
String jsTag = "\n<script type='text/javascript' src='file:///android_asset/web/script.js'></script>\n";
|
||||
String styleSheetTag = "<link href='file:///android_asset/web/style.css' rel='stylesheet' type='text/css'/>";
|
||||
String extraStyleSheetTag = "";
|
||||
if (parameters.getExtraStylesheet() != null) {
|
||||
extraStyleSheetTag = "<link href='file:///android_asset/web/"
|
||||
+ parameters.getExtraStylesheet()
|
||||
+ "' rel='stylesheet' type='text/css'/>";
|
||||
}
|
||||
write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> "
|
||||
+ "<html xmlns='http://www.w3.org/1999/xhtml' dir='" + getDirection() + "'><head>"
|
||||
+ styleSheetTag + extraStyleSheetTag + "\n"
|
||||
+ jsTag
|
||||
+ "<meta charset='utf-8'/>"
|
||||
+ "</head>"
|
||||
+ "<body onscroll='jsonscroll()' onload='jsonload()' >");
|
||||
|
||||
// force rtl for rtl languages - rtl support on Android is poor but
|
||||
// forcing it seems to help occasionally
|
||||
write("<p>");
|
||||
if (!parameters.isLeftToRight()) {
|
||||
write("<span dir='rtl'>");
|
||||
}
|
||||
@ -150,9 +135,7 @@ public class OsisToHtmlSaxHandler extends OsisSaxHandler {
|
||||
if (!parameters.isLeftToRight()) {
|
||||
write("</span>");
|
||||
}
|
||||
// add padding at bottom to allow last verse to scroll to top of page
|
||||
// and become current verse
|
||||
write("</body></html>");
|
||||
write("</p>");
|
||||
}
|
||||
|
||||
/*
|
||||
|
BIN
app/src/main/res/drawable-xxxhdpi/ic_launcher.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
Loading…
Reference in New Issue
Block a user