mirror of
https://github.com/rabbibotton/clog.git
synced 2026-02-03 14:22:11 -08:00
improved load-script
This commit is contained in:
parent
11a8511f71
commit
35ec8e0259
1 changed files with 12 additions and 9 deletions
|
|
@ -195,18 +195,21 @@ If LOAD-ONLY-ONCE is t first checks if previously loaded with load-script."))
|
|||
;; custom on-load-script event in the next line of
|
||||
;; script after the load as scripts are loaded
|
||||
;; synchronously.
|
||||
(jquery-execute (head-element obj)
|
||||
(format nil "append('<script src=\"~A\"></script>~
|
||||
<script>$(clog[\\'document\\']).trigger(\\'on-load-script\\',~
|
||||
\\'~A\\')</script>')"
|
||||
(escape-string script-url)
|
||||
(escape-string script-url)))
|
||||
(js-execute obj
|
||||
(format nil "$.getScript('~A', function() {~
|
||||
$(clog['document']).trigger('on-load-script',~
|
||||
'~A')})"
|
||||
(escape-string script-url)
|
||||
(escape-string script-url)))
|
||||
(cond (load-only-once
|
||||
(when (bordeaux-threads:wait-on-semaphore sem :timeout wait-timeout)
|
||||
(setf (connection-data-item obj (format nil "clog-~A" script-url)) t)
|
||||
(when (bordeaux-threads:wait-on-semaphore
|
||||
sem :timeout wait-timeout)
|
||||
(setf (connection-data-item obj (format nil "clog-~A"
|
||||
script-url)) t)
|
||||
script-url))
|
||||
(t
|
||||
(setf (connection-data-item obj (format nil "clog-~A" script-url)) t)
|
||||
(setf (connection-data-item obj (format nil "clog-~A"
|
||||
script-url)) t)
|
||||
script-url)))))
|
||||
(t
|
||||
t))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue