diff options
-rw-r--r-- | playlist.lisp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/playlist.lisp b/playlist.lisp index 82f6f49..b71e4d7 100644 --- a/playlist.lisp +++ b/playlist.lisp @@ -70,6 +70,10 @@ (with-transaction () (make-instance 'playlist :title title :user user))) +(defun update-playlist-title (playlist title) + (with-transaction () + (setf (playlist-title playlist) title))) + ;;; CLIENT STATE (defclass/std playlist-ctl () @@ -372,9 +376,32 @@ (install-new-playlist-ctl pl body))) (with-clog-create body (div () - (section (:h2 :content (playlist-title-content pl) :bind title-elem)) + (section (:h2 :content (playlist-title pl) :bind title-elem)) + (form () + (form-element (:text :bind input))) (now-playing-display (ctl)) (track-listing (pl)) (new-track-form (pl))) - (setf (pl-title ctl) title-elem) + (setf (pl-title ctl) title-elem + (display input) "none") + + (set-on-blur + input + (alambda + (when (plusp (length (value input))) + (update-playlist-title pl (value input)) + (setf (text title-elem) (value input))) + (setf (display input) "none" + (display title-elem) "block"))) + + (set-on-click + title-elem + (alambda + (setf (value input) (text title-elem) + (display input) "inline" + (display title-elem) "none") + (focus input))) + (initialize-now-playing body))))) + +(create-form-element ) |