Added image upload and display
This commit is contained in:
parent
f277e8494e
commit
a3c580aae0
3 changed files with 13 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
"create-build-dirs": "mkdir -p www/js www/css www/img",
|
||||
"test": "npm run lint",
|
||||
"build": "npm run create-build-dirs && npm run build-fonts && npm run build-images && npm run build-html && npm run build-js && npm run build-less",
|
||||
"build-html": "cp src/index.html www/",
|
||||
"build-html": "cp src/*.html www/",
|
||||
"build-fonts": "cp -R node_modules/bootstrap/dist/fonts www && cp -R node_modules/ionicons/fonts www ",
|
||||
"build-less": "lessc --silent src/less/style.less www/css/style.css && cleancss -d --s0 -o www/css/style.css www/css/style.css",
|
||||
"build-js": "./scripts/build-js.sh",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
</div>
|
||||
<footer>
|
||||
<a class="btn btn-success btn-lg animated pulse infinite">Open Document / Images</a>
|
||||
<input type="file" style="display: none" />
|
||||
</footer>
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
<script type="text/javascript" src="js/libs.js"></script>
|
||||
|
|
|
@ -17,3 +17,14 @@ document.addEventListener("deviceready", function () {
|
|||
var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
|
||||
|
||||
}, false);
|
||||
|
||||
$('footer .btn').click(function(e) {
|
||||
$('footer input').trigger('click');
|
||||
});
|
||||
|
||||
$('footer input').on('change', function () {
|
||||
const file = $(this)[0].files[0];
|
||||
let reader = new FileReader();
|
||||
reader.onload = function(e) { $('#compass').attr('src', e.target.result); };
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
|
|
Reference in a new issue