summaryrefslogtreecommitdiff
path: root/views/new-favorite.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/new-favorite.php')
-rw-r--r--views/new-favorite.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/views/new-favorite.php b/views/new-favorite.php
index 9f191e8..524bb79 100644
--- a/views/new-favorite.php
+++ b/views/new-favorite.php
@@ -2,21 +2,22 @@
<?= partial('partials/header') ?>
<div style="clear: both;" class="notice-pad">
- <div class="alert alert-success hidden" id="test_success"><strong>Success! We found a Location header in the response!</strong><br>Your post should be on your website now!<br><a href="" id="post_href">View your post</a></div>
+ <div class="alert alert-success hidden" id="test_success"><strong>Success!</strong><br>Your post should be on your website now!<br><a href="" id="post_href">View your post</a></div>
<div class="alert alert-danger hidden" id="test_error"><strong>Your endpoint did not return a Location header.</strong><br>See <a href="/creating-a-micropub-endpoint">Creating a Micropub Endpoint</a> for more information.</div>
</div>
<form role="form" style="margin-top: 20px;" id="note_form">
<div class="form-group">
- <label for="note_url">URL to Favorite (<code>like-of</code>)</label>
- <input type="text" id="note_url" value="<?= $this->url ?>" class="form-control">
+ <label for="like_of">URL to Favorite (<code>like-of</code>)</label>
+ <input type="text" id="like_of" value="<?= $this->like_of ?>" class="form-control">
</div>
<div style="float: right; margin-top: 6px;">
- <button class="btn btn-success" id="btn_post">Post</button>
+ <button class="btn btn-success" id="btn_post"><?= $this->url ? 'Save' : 'Post' ?></button>
</div>
+ <input type="hidden" id="edit_url" value="<?= $this->url ?>">
</form>
<div style="clear: both;"></div>
@@ -27,7 +28,6 @@
</div>
</div>
-
<script>
$(function(){
@@ -40,7 +40,8 @@ $(function(){
});
$.post("/favorite", {
- url: $("#note_url").val()
+ like_of: $("#like_of").val(),
+ edit: $("#edit_url").val()
}, function(response){
if(response.location != false) {