summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2018-05-27 08:48:37 -0700
committerAaron Parecki <aaron@parecki.com>2018-05-27 08:48:37 -0700
commit1c3b6f50df9c1106bd44dbb201f265f144c1fb3c (patch)
treefc3a6c917a29e5b6d91c23185a0475f4b701a067 /public/js
parent4a0cb5a5b3f3a8e1e4dfd8665c8982a48e92f90a (diff)
split tags using tokenfield instead of comma-separated
this allows tag values to contain spaces, which is up to your own micropub server to handle appropriately. closes #95 and replaces #96
Diffstat (limited to 'public/js')
-rw-r--r--public/js/script.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/public/js/script.js b/public/js/script.js
index f6f3a48..57990ee 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -14,15 +14,10 @@
return num;
}
- function csv_to_array(val) {
- if(val.length > 0) {
- return val.split(/[, ]+/);
- } else {
- return [];
- }
+ function tokenfieldToArray(sel) {
+ return $(sel).tokenfield("getTokens").map(function(t){ return t.value});
}
-
$(function(){
// Set the date from JS