summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2016-02-10 18:48:57 -0800
committerAaron Parecki <aaron@parecki.com>2016-02-10 18:48:57 -0800
commitbcfb8731ca342bf3d5b8da0024c273c7adb7c1cb (patch)
tree91c2657bdfab2121dac5874bafc5175ac13511f9
parent76aa9c2bc9d31549e44bc0b10817eb6e252dbe11 (diff)
fix sending category as array
-rw-r--r--public/js/script.js5
-rw-r--r--views/layout.php12
-rw-r--r--views/new-bookmark.php8
-rw-r--r--views/new-itinerary.php3
-rw-r--r--views/new-post.php10
5 files changed, 20 insertions, 18 deletions
diff --git a/public/js/script.js b/public/js/script.js
index 399af05..ea86931 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -5,6 +5,7 @@
var minutes = zero_pad(Math.floor(seconds / 60) % 60);
return (seconds < 0 ? '-' : '+') + hours + ":" + minutes;
}
+
function zero_pad(num) {
num = "" + num;
if(num.length == 1) {
@@ -13,6 +14,10 @@
return num;
}
+ function csv_to_array(val) {
+ return val.split(/[, ]+/);
+ }
+
$(function(){
diff --git a/views/layout.php b/views/layout.php
index 10bf9a2..a791a69 100644
--- a/views/layout.php
+++ b/views/layout.php
@@ -4,8 +4,8 @@
<title><?= $this->title ?></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <link rel="pingback" href="http://webmention.io/aaronpk/xmlrpc" />
- <link rel="webmention" href="http://webmention.io/aaronpk/webmention" />
+ <link rel="pingback" href="https://webmention.io/aaronpk/xmlrpc" />
+ <link rel="webmention" href="https://webmention.io/aaronpk/webmention" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- standard viewport tag to set the viewport to the device's width
@@ -28,10 +28,11 @@
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<script src="/js/jquery-1.7.1.min.js"></script>
+ <script src="/js/script.js"></script>
</head>
<body role="document">
-<?php
+<?php
if(property_exists($this, 'include_facebook')) {
# echo partial('partials/fb-script');
}
@@ -67,7 +68,6 @@ if(property_exists($this, 'include_facebook')) {
<li><a href="/bookmark">Bookmark</a></li>
<li><a href="/favorite">Favorite</a></li>
<li><a href="/photo">Photo</a></li>
- <li><a href="/email">Email</a></li>
<?php } ?>
<li><a href="/docs">Docs</a></li>
@@ -90,10 +90,10 @@ if(property_exists($this, 'include_facebook')) {
</div>
<p class="credits">&copy; <?=date('Y')?> by <a href="http://aaronparecki.com">Aaron Parecki</a>.
- This code is <a href="https://github.com/aaronpk/Quill">open source</a>.
+ This code is <a href="https://github.com/aaronpk/Quill">open source</a>.
Feel free to send a pull request, or <a href="https://github.com/aaronpk/Quill/issues">file an issue</a>.</p>
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/new-bookmark.php b/views/new-bookmark.php
index 5590608..00befcc 100644
--- a/views/new-bookmark.php
+++ b/views/new-bookmark.php
@@ -43,7 +43,7 @@
}
echo '</ul>';
} else {
- ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
+ ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
You can provide a <a href="/docs#syndication">list of supported syndication targets</a> that will appear as checkboxes here.</div><?php
}
?>
@@ -63,10 +63,10 @@
$(function(){
// ctrl-s to save
- $(window).on('keydown', function(e){
+ $(window).on('keydown', function(e){
if(e.keyCode == 83 && e.ctrlKey){
$("#btn_post").click();
- }
+ }
});
$("#btn_post").click(function(){
@@ -81,7 +81,7 @@ $(function(){
name: $("#note_name").val(),
content: $("#note_content").val(),
category: $("#note_category").val(),
- 'syndicate-to': syndications.join(',')
+ 'syndicate-to': syndications
}, function(data){
var response = JSON.parse(data);
diff --git a/views/new-itinerary.php b/views/new-itinerary.php
index 8d8811c..266e339 100644
--- a/views/new-itinerary.php
+++ b/views/new-itinerary.php
@@ -105,7 +105,6 @@
}
</style>
-<script src="/js/script.js"></script>
<script>
$(function(){
@@ -176,7 +175,7 @@ $(function(){
});
});
- var category = $("#note_category").val().split(/[, ]+/)
+ var category = csv_to_array($("#note_category").val());
$.post("/itinerary", {
data: JSON.stringify({
diff --git a/views/new-post.php b/views/new-post.php
index 86d15c9..4453e15 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -34,7 +34,7 @@
}
echo '</ul>';
} else {
- ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
+ ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
You can provide a <a href="/docs#syndication">list of supported syndication targets</a> that will appear as checkboxes here.</div><?php
}
?>
@@ -107,10 +107,10 @@
$(function(){
// ctrl-s to save
- $(window).on('keydown', function(e){
+ $(window).on('keydown', function(e){
if(e.keyCode == 83 && e.ctrlKey){
$("#btn_post").click();
- }
+ }
});
$("#btn_post").click(function(){
@@ -124,7 +124,7 @@ $(function(){
content: $("#note_content").val(),
'in-reply-to': $("#note_in_reply_to").val(),
location: $("#note_location").val(),
- category: $("#note_category").val(),
+ category: csv_to_array($("#note_category").val()),
slug: $("#note_slug").val(),
'syndicate-to': syndications
}, function(data){
@@ -226,5 +226,3 @@ $(function(){
<?= partial('partials/syndication-js') ?>
</script>
-
-