|
|
@ -3,28 +3,30 @@ |
|
|
|
(in-package #:cl-bible.clog) |
|
|
|
(in-package #:cl-bible.clog) |
|
|
|
|
|
|
|
|
|
|
|
(defun lift-search-window (body search) |
|
|
|
(defun lift-search-window (body search) |
|
|
|
(lambda (obj) |
|
|
|
(let ((result (mapcar #'car (l:lift-search search))) |
|
|
|
(declare (ignore obj)) |
|
|
|
(win (create-gui-window body))) |
|
|
|
(let ((result (mapcar #'car (l:lift-search search))) |
|
|
|
(create-p (window-content win) |
|
|
|
(win (create-gui-window body))) |
|
|
|
:content (str:join ", " (if result |
|
|
|
(create-p (window-content win) |
|
|
|
result |
|
|
|
:content (str:join ", " result))))) |
|
|
|
'("No results")))))) |
|
|
|
|
|
|
|
|
|
|
|
(defun ergebnis/se (n) |
|
|
|
(defun ergebnis/se (n) |
|
|
|
(format nil "~A Ergebnis~A" n (if (= n 1) "" "se"))) |
|
|
|
(format nil "~A Ergebnis~A" n (if (= n 1) "" "se"))) |
|
|
|
|
|
|
|
|
|
|
|
(defun search-in-bible (phrase bible canvas) |
|
|
|
(defun search-in-bible (phrase bible canvas) |
|
|
|
(let* ((win (window-content |
|
|
|
(let* ((win (window-content |
|
|
|
(create-gui-window canvas :title |
|
|
|
(create-gui-window canvas |
|
|
|
(format nil "~A: ~A" |
|
|
|
:title (format nil "~A: ~A" |
|
|
|
d:*translation* |
|
|
|
d:*translation* |
|
|
|
phrase) |
|
|
|
phrase) |
|
|
|
:height 400 |
|
|
|
:height 400 |
|
|
|
:width 650))) |
|
|
|
:width 650))) |
|
|
|
(lift-search (create-button win :content "Lift Search")) |
|
|
|
(lift-search (create-button win :content "Lift Search")) |
|
|
|
(div (create-div win)) |
|
|
|
(div (create-div win)) |
|
|
|
(results (s:find-in-bible bible phrase))) |
|
|
|
(results (s:find-in-bible bible phrase))) |
|
|
|
(set-on-click lift-search (lift-search-window canvas results)) |
|
|
|
(set-on-click lift-search (lambda (obj) |
|
|
|
|
|
|
|
(declare (ignore obj)) |
|
|
|
|
|
|
|
(lift-search-window canvas results))) |
|
|
|
(create-p div :content (ergebnis/se |
|
|
|
(create-p div :content (ergebnis/se |
|
|
|
(length results))) |
|
|
|
(length results))) |
|
|
|
(mapc (lambda (verse) |
|
|
|
(mapc (lambda (verse) |
|
|
@ -39,14 +41,13 @@ |
|
|
|
book |
|
|
|
book |
|
|
|
(s:find-chapter book chapter))))) |
|
|
|
(s:find-chapter book chapter))))) |
|
|
|
|
|
|
|
|
|
|
|
(defun search-with-chapter (window) |
|
|
|
(defun search-with-chapter (window data) |
|
|
|
(lambda (data) |
|
|
|
(let ((book (cadr (assoc "book" data :test #'string=))) |
|
|
|
(let ((book (cadr (assoc "book" data :test #'string=))) |
|
|
|
(chapter (cadr (assoc "chapter" data :test #'string=))) |
|
|
|
(chapter (cadr (assoc "chapter" data :test #'string=))) |
|
|
|
(phrase (cadr (assoc "phrase" data :test #'string=)))) |
|
|
|
(phrase (cadr (assoc "phrase" data :test #'string=)))) |
|
|
|
(search-in-bible phrase |
|
|
|
(search-in-bible phrase |
|
|
|
(%bible-book-or-chapter d:*bible* book chapter) |
|
|
|
(%bible-book-or-chapter d:*bible* book chapter) |
|
|
|
window))) |
|
|
|
window)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun searcher (window) |
|
|
|
(defun searcher (window) |
|
|
|
(lambda (obj) |
|
|
|
(lambda (obj) |
|
|
@ -55,7 +56,8 @@ |
|
|
|
'(("Phrase" "phrase" :text) |
|
|
|
'(("Phrase" "phrase" :text) |
|
|
|
("Book" "book" :text) |
|
|
|
("Book" "book" :text) |
|
|
|
("Chapter" "chapter" :text)) |
|
|
|
("Chapter" "chapter" :text)) |
|
|
|
(search-with-chapter window) |
|
|
|
(lambda (data) |
|
|
|
|
|
|
|
(search-with-chapter window data)) |
|
|
|
:title "Search a phrase"))) |
|
|
|
:title "Search a phrase"))) |
|
|
|
|
|
|
|
|
|
|
|
(defun reload (window) |
|
|
|
(defun reload (window) |
|
|
@ -84,28 +86,29 @@ |
|
|
|
(load-book canvas book) |
|
|
|
(load-book canvas book) |
|
|
|
(load-chapter canvas book chapter))))) |
|
|
|
(load-chapter canvas book chapter))))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun book/chapter-window (canvas title) |
|
|
|
|
|
|
|
(create-div |
|
|
|
|
|
|
|
(window-content |
|
|
|
|
|
|
|
(create-gui-window canvas |
|
|
|
|
|
|
|
:title title |
|
|
|
|
|
|
|
:height 400 |
|
|
|
|
|
|
|
:width 650)))) |
|
|
|
|
|
|
|
|
|
|
|
(defun load-book (canvas book) |
|
|
|
(defun load-book (canvas book) |
|
|
|
(let* ((win (window-content |
|
|
|
(let ((div (book/chapter-window canvas |
|
|
|
(create-gui-window canvas :title (format nil "~A: ~A" |
|
|
|
(format nil "~A: ~A" |
|
|
|
d:*translation* |
|
|
|
d:*translation* |
|
|
|
book) |
|
|
|
book)))) |
|
|
|
:height 400 |
|
|
|
|
|
|
|
:width 650))) |
|
|
|
|
|
|
|
(div (create-div win))) |
|
|
|
|
|
|
|
(mapc (lambda (verse) |
|
|
|
(mapc (lambda (verse) |
|
|
|
(v:verse-to-clog verse div :translation d:*translation*)) |
|
|
|
(v:verse-to-clog verse div :translation d:*translation*)) |
|
|
|
(s:find-book d:*bible* book)))) |
|
|
|
(s:find-book d:*bible* book)))) |
|
|
|
|
|
|
|
|
|
|
|
(defun load-chapter (canvas book chapter) |
|
|
|
(defun load-chapter (canvas book chapter) |
|
|
|
(let* ((win (window-content |
|
|
|
(let ((div (book/chapter-window canvas |
|
|
|
(create-gui-window canvas :title (format nil "~A: ~A ~A" |
|
|
|
(format nil "~A: ~A ~A" |
|
|
|
d:*translation* |
|
|
|
d:*translation* |
|
|
|
book |
|
|
|
book |
|
|
|
chapter) |
|
|
|
chapter)))) |
|
|
|
:height 400 |
|
|
|
|
|
|
|
:width 650))) |
|
|
|
|
|
|
|
(div (create-div win))) |
|
|
|
|
|
|
|
(mapc (lambda (verse) |
|
|
|
(mapc (lambda (verse) |
|
|
|
(v:verse-to-clog verse div :translation d:*translation*)) |
|
|
|
(v:verse-to-clog verse div :translation d:*translation*)) |
|
|
|
(s:find-chapter (s:find-book d:*bible* book) chapter)))) |
|
|
|
(s:find-chapter (s:find-book d:*bible* book) chapter)))) |
|
|
@ -158,7 +161,6 @@ |
|
|
|
(declare (ignore obj)) |
|
|
|
(declare (ignore obj)) |
|
|
|
(d:load-bibles))))) |
|
|
|
(d:load-bibles))))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun on-new-window (body) |
|
|
|
(defun on-new-window (body) |
|
|
|
(setf (title (html-document body)) "Bible") |
|
|
|
(setf (title (html-document body)) "Bible") |
|
|
|
(clog-gui-initialize body) |
|
|
|
(clog-gui-initialize body) |
|
|
|