summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/layout.php5
-rw-r--r--views/new-post.php25
2 files changed, 21 insertions, 9 deletions
diff --git a/views/layout.php b/views/layout.php
index da97687..03929b1 100644
--- a/views/layout.php
+++ b/views/layout.php
@@ -26,6 +26,11 @@
<link rel="apple-touch-icon" sizes="144x144" href="/images/quill-icon-144.png">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
+ <link rel="icon" sizes="196x196" href="/images/quill-icon-196.png">
+
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="mobile-web-app-capable" content="yes">
+ <meta name="theme-color" content="#428bca">
<script src="/js/jquery-1.7.1.min.js"></script>
<script src="/js/script.js"></script>
diff --git a/views/new-post.php b/views/new-post.php
index a059ea0..8e9c692 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -26,9 +26,12 @@
<div class="form-group">
<label for="note_photo"><code>photo</code></label>
- <input type="file" name="note_photo" id="note_photo" accept="image/*" onchange="previewPhoto(event)">
+ <input type="file" name="note_photo" id="note_photo" accept="image/*">
<br>
- <img src="" id="photo_preview" style="max-width: 300px; max-height: 300px;">
+ <div id="photo_preview_container">
+ <img src="" id="photo_preview" style="max-width: 300px; max-height: 300px;">
+ <button type="button" class="btn btn-danger btn-sm" id="remove_photo"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Remove image</button>
+ </div>
</div>
<div class="form-group">
@@ -132,16 +135,20 @@
</style>
<script>
-function previewPhoto(event) {
- $("#photo_preview")
- .show()
- .attr("src", URL.createObjectURL(event.target.files[0]) );
-}
-
$(function(){
var userHasSetCategory = false;
- $("#photo_preview").hide();
+
+ $("#photo_preview_container").hide();
+ $("#note_photo").on("change", function(e){
+ $("#photo_preview_container").show();
+ $("#photo_preview").attr("src", URL.createObjectURL(e.target.files[0]) );
+ });
+ $("#remove_photo").on("click", function(){
+ $("#note_photo").val("");
+ $("#photo_preview").attr("src", "" );
+ $("#photo_preview_container").hide();
+ });
$("#note_content").on('change keyup', function(e){
var text = $("#note_content").val();