text size setting can be set by API calls now

This commit is contained in:
Christian Mueller
2014-10-01 16:45:06 +02:00
parent 63b065663d
commit aaee1b8025
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -6,7 +6,7 @@
- **V1.4**: Bugfix: no whitespace elimination from the note text is needed now for the signature compuation.
- **V1.3**: New note ID format.
- **V1.2**: Theme & fonts can be specified during the publishing.
- **V1.2**: Theme & font settings can be specified during the publishing.
- **V1.1**: fields `publisher` and `title` in the response to the note retrieval.
- **V1.0**: initial release.
@@ -77,6 +77,7 @@ Parameter | Explanation | Type
`password` | Secret token (plain or hashed) | *optional*
`version` | Used API version | **required**
`theme` | Theme name | *optional*
`text-size` | Text size | *optional*
`text-font` | Text font name | *optional*
`header-font`| Header font name | *optional*
+1 -1
View File
@@ -91,7 +91,7 @@
(when (blank? note) "note is empty")])]
(if (empty? errors)
(let [[year month day] (map str (get-date))
params (select-keys params [:text-font :header-font :theme])
params (select-keys params [:text-size :text-font :header-font :theme])
raw-title (filter #(or (= \- %) (Character/isLetterOrDigit %))
(-> note derive-title trim (sreplace " " "-") lower-case))
max-length (get-setting :max-title-length #(Integer/parseInt %) 80)
+4 -2
View File
@@ -147,6 +147,7 @@
:signature (storage/sign pid psk note)
:version "1.4"
:theme "dark"
:text-size 1.1
:text-font "Helvetica"})
body (parse-string (:body response))
noteID (body "noteID")]
@@ -156,8 +157,9 @@
(last (clojure.string/split
((parse-string (:body response)) "shortURL") #"/"))))) "Location")]
(= url ((parse-string (:body response)) "longURL"))
(substring? "theme=dark" url)
(substring? "text-font=Felvetica" url))
(is (substring? "theme=dark" url))
(is (substring? "text-size=1.1" url))
(is (substring? "text-font=Helvetica" url)))
(is (do
(storage/delete-note noteID)
(not (storage/note-exists? noteID)))))))