##// END OF EJS Templates
MENU
MENU

File last commit:

r30:3c634d0a default
r30:3c634d0a default
Show More
api.ps
456 lines | 13.1 KiB | application/postscript | PostScriptLexer
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (in-package sugar-qsp.api)
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
;;; API deals with DOM manipulation and some bookkeeping for the
;;; intrinsics, namely variables
;;; API is an implementation detail and has no QSP documentation. It
;;; doesn't call intrinsics
Tutorial game works!
r6 ;;; Utils
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun make-act-html (title img)
MENU
r30 (+ "<a class='qsp-act' href='" (inline-call call-act title) "'>"
(if img (+ "<img src='" img "'>") "")
Tutorial game works!
r6 title
"</a>"))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun make-menu-item-html (num title img loc)
MENU
r30 (+ "<a href='" (inline-call finish-menu loc) "'>"
(if img (+ "<img src='" img "'>") "")
Menu, game saving
r11 title
"</a>"))
MENU
r30 (defun make-menu-delimiter ()
"<hr>")
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun report-error (text)
Finishing lib
r20 (alert text))
Working WAIT without busy-wait
r29 (defun start-sleeping ()
MENU
r30 (chain (by-id "qsp") class-list (add "disable")))
Working WAIT without busy-wait
r29
(defun finish-sleeping ()
MENU
r30 (chain (by-id "qsp") class-list (remove "disable")))
Working WAIT without busy-wait
r29
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun sleep (msec)
MENU
r30 (with-sleep (resume)
(set-timeout resume msec)))
WAIT with async
r24
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun init-dom ()
Some DOM stuff, VIEW
r18 ;; Save/load buttons
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let ((btn (by-id "qsp-btn-save")))
(setf (@ btn onclick) savegame)
(setf (@ btn href) "#"))
(let ((btn (by-id "qsp-btn-open")))
(setf (@ btn onclick) opengame)
(setf (@ btn href) "#"))
Some DOM stuff, VIEW
r18 ;; Close image on click
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ (by-id "qsp-image-container") onclick)
(show-image nil))
Some DOM stuff, VIEW
r18 ;; Close the dropdown on any click
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ window onclick)
Some DOM stuff, VIEW
r18 (lambda (event)
MENU
r30 (setf (@ window mouse)
(list (@ event page-x)
(@ event page-y)))
(finish-menu nil))))
Some DOM stuff, VIEW
r18
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun call-serv-loc (var-name &rest args)
(let ((loc-name (get-var var-name 0 :str)))
Finishing lib
r20 (when loc-name
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let ((loc (getprop (root locs) loc-name)))
Finishing lib
r20 (when loc
(funcall loc args))))))
Menu, game saving
r11
A better UI
r9 ;;; Misc
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun newline (key)
(append-id (key-to-id key) "<br>" t))
Bugfixes
r22
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun clear-id (id)
(setf (inner-html (by-id id)) ""))
Bugfixes
r22
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defvar text-escaper (chain document (create-element :textarea)))
Bugfixes
r22
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun prepare-contents (s &optional force-html)
(if (or force-html (get-var "USEHTML" 0 :num))
Bugfixes
r22 s
(progn
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ text-escaper text-content) s)
(inner-html text-escaper))))
A better UI
r9
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-id (id &optional force-html)
(inner-html (by-id id)))
A better UI
r9
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun set-id (id contents &optional force-html)
(setf (inner-html (by-id id)) (prepare-contents contents force-html)))
A better UI
r9
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun append-id (id contents &optional force-html)
Bugfixes
r22 (when contents
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (incf (inner-html (by-id id)) (prepare-contents contents force-html))))
A better UI
r9
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1 ;;; Function calls
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun init-args (args)
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1 (dotimes (i (length args))
Properly handle stringly-indexed arrays
r16 (let ((arg (elt args i)))
(if (numberp arg)
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (set-var args i :num arg)
(set-var args i :str arg)))))
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-result ()
Fixed saves...
r26 (if (not (equal "" (get-var "RESULT" 0 :str)))
(get-var "RESULT" 0 :str)
(get-var "RESULT" 0 :num)))
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun call-loc (name args)
MENU
r30 (setf name (chain name (to-upper-case)))
Remove cl-uglify-js
r23 (with-frame
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (with-call-args args
(funcall (getprop (root locs) name) args))))
Remove cl-uglify-js
r23
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun call-act (title)
MENU
r30 (with-frame
(funcall (getprop (root acts) title 'act))))
The Box bugfixes
r21
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1 ;;; Text windows
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun key-to-id (key)
Tutorial game works!
r6 (case key
(:main "qsp-main")
(:stat "qsp-stat")
Menu, game saving
r11 (:objs "qsp-objs")
(:acts "qsp-acts")
(:input "qsp-input")
MENU
r30 (:image "qsp-image")
Menu, game saving
r11 (:dropdown "qsp-dropdown")
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (t (report-error "Internal error!"))))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-frame (key)
(by-id (key-to-id key)))
Menu, game saving
r11
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun add-text (key text)
(append-id (key-to-id key) text))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-text (key)
(get-id (key-to-id key)))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun clear-text (key)
(clear-id (key-to-id key)))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun enable-frame (key enable)
(let ((obj (get-frame key)))
(setf (@ obj style display) (if enable "block" "none"))
Removing unnecessary returns
r27 (void)))
Menu, game saving
r11
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1 ;;; Actions
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun add-act (title img act)
(setf (getprop (root acts) title)
(create img img act act))
(update-acts))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun del-act (title)
(delete (getprop (root acts) title))
(update-acts))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun clear-act ()
(setf (root acts) (create))
(clear-id "qsp-acts"))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun update-acts ()
(clear-id "qsp-acts")
(let ((elt (by-id "qsp-acts")))
(for-in (title (root acts))
(let ((obj (getprop (root acts) title)))
(incf (inner-html elt) (make-act-html title (getprop obj :img)))))))
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
API call for FOR loop to make the main code less cluttered
r19 ;;; "Syntax"
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun qspfor (name index from to step body)
(for ((i from))
((< i to))
((incf i step))
(set-var name index :num i)
(unless (funcall body)
(return-from qspfor))))
API call for FOR loop to make the main code less cluttered
r19
Properly handle stringly-indexed arrays
r16 ;;; Variable class
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun *var (name)
Properly handle stringly-indexed arrays
r16 ;; From strings to numbers
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ this indexes) (create))
Properly handle stringly-indexed arrays
r16 ;; From numbers to {num: 0, str: ""} objects
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ this values) (list))
Removing unnecessary returns
r27 (void))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun new-value ()
(create :num 0 :str ""))
100% parser, 100% macros, 50% intrinsics, 10% api, 0% misc
r1
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ *var prototype index-num)
(lambda (index)
(let ((num-index
(if (stringp index)
(if (in index (@ this indexes))
(getprop (@ this indexes) index)
(let ((n (length (@ this values))))
(setf (getprop (@ this indexes) index) n)
n))
index)))
(unless (in num-index (@ this values))
(setf (elt (@ this values) num-index) (new-value)))
num-index)))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ *var prototype get)
(lambda (index slot)
(unless (or index (= 0 index))
(setf index (1- (length (@ this values)))))
(getprop (@ this values) (chain this (index-num index)) slot)))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ *var prototype set)
(lambda (index slot value)
(unless (or index (= 0 index))
(setf index (length (@ this values))))
(case slot
(:num (setf value (chain *number (parse-int value))))
(:str (setf value (chain value (to-string)))))
(setf (getprop (@ this values)
(chain this (index-num index))
slot) value)
Removing unnecessary returns
r27 (void)))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ *var prototype kill)
(lambda (index)
(setf (elt (@ this values) (chain this (index-num index)))
(new-value))
(delete (getprop 'this 'indexes index))))
Properly handle stringly-indexed arrays
r16
;;; Variables
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun var-real-name (name)
(if (= (@ name 0) #\$)
(values (chain name (substr 1)) :str)
Properly handle stringly-indexed arrays
r16 (values name :num)))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun ensure-var (name)
MENU
r30 (setf name (chain name (to-upper-case)))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let ((store (var-ref name)))
Locals
r14 (unless store
Removing unnecessary returns
r27 (setf store (new (*var name)))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (getprop (root vars) name) store))
Properly handle stringly-indexed arrays
r16 store))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun var-ref (name)
(let ((local-store (current-local-frame)))
The Box bugfixes
r21 (cond ((and local-store (in name local-store))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (getprop local-store name))
Properly handle stringly-indexed arrays
r16 ((in name (root vars))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (getprop (root vars) name))
Locals
r14 (t nil))))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-var (name index slot)
(chain (ensure-var name) (get index slot)))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun set-var (name index slot value)
(chain (ensure-var name) (set index slot value))
Removing unnecessary returns
r27 (void))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun get-array (name)
MENU
r30 (setf name (chain name (to-upper-case)))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (var-ref name))
Menu, game saving
r11
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun set-array (name value)
MENU
r30 (setf name (chain name (to-upper-case)))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let ((store (var-ref name)))
(setf (@ store values) (@ value values))
(setf (@ store indexes) (@ value indexes)))
Removing unnecessary returns
r27 (void))
Locals
r14
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun kill-var (name &optional index)
MENU
r30 (setf name (chain name (to-upper-case)))
Properly handle stringly-indexed arrays
r16 (if (and index (not (= 0 index)))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (chain (getprop (root vars) name) (kill index))
(delete (getprop (root vars) name)))
Removing unnecessary returns
r27 (void))
Tutorial game works!
r6
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun array-size (name)
MENU
r30 (@ (var-ref name) values length))
Properly handle stringly-indexed arrays
r16
;;; Locals
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun push-local-frame ()
(chain (root locals) (push (create)))
Removing unnecessary returns
r27 (void))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun pop-local-frame ()
(chain (root locals) (pop))
Removing unnecessary returns
r27 (void))
Properly handle stringly-indexed arrays
r16
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun current-local-frame ()
Properly handle stringly-indexed arrays
r16 (elt (root locals) (1- (length (root locals)))))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun new-local (name)
(let ((frame (current-local-frame)))
Properly handle stringly-indexed arrays
r16 (unless (in name frame)
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (getprop frame name) (create)))
Removing unnecessary returns
r27 (void)))
Menu, game saving
r11
Tutorial game works!
r6 ;;; Objects
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun update-objs ()
(let ((elt (by-id "qsp-objs")))
(setf (inner-html elt) "<ul>")
Tutorial game works!
r6 (loop :for obj :in (root objs)
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 :do (incf (inner-html elt) (+ "<li>" obj)))
(incf (inner-html elt) "</ul>")))
Menu, game saving
r11
;;; Menu
MENU
r30 (defun open-menu (menu-data)
(let ((elt (get-frame :dropdown))
Menu, game saving
r11 (i 0))
(loop :for item :in menu-data
:do (incf i)
MENU
r30 :do (incf (inner-html elt)
(if (eq item :delimiter)
(make-menu-delimiter i)
(make-menu-item-html i
(@ item :text)
(@ item :icon)
(@ item :loc)))))
(let ((mouse (@ window mouse)))
(setf (@ elt style left) (+ (elt mouse 0) "px"))
(setf (@ elt style top) (+ (elt mouse 1) "px"))
;; Make sure it's inside the viewport
(when (> (@ document body inner-width)
(+ (elt mouse 0) (@ elt inner-width)))
(incf (@ elt style left) (@ elt inner-width)))
(when (> (@ document body inner-height)
(+ (elt mouse 0) (@ elt inner-height)))
(incf (@ elt style top) (@ elt inner-height))))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ elt style display) "block")))
Sounds, save/load UI buttons
r12
MENU
r30 (defun finish-menu (loc)
(when (root menu-resume)
(let ((elt (get-frame :dropdown)))
(setf (inner-html elt) "")
(setf (@ elt style display) "none")
(funcall (root menu-resume))
(setf (root menu-resume) nil))
(when loc
(call-loc loc)))
(void))
(defun menu (menu-data)
(with-sleep (resume)
(open-menu menu-data)
(setf (root menu-resume) resume))
(void))
Sounds, save/load UI buttons
r12 ;;; Content
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun clean-audio ()
(loop :for k :in (chain *object (keys (root playing)))
:for v := (getprop (root playing) k)
:do (when (@ v ended)
(delete (@ (root playing) k)))))
Locals
r14
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun show-image (path)
MENU
r30 (let ((img (get-frame :image)))
Some DOM stuff, VIEW
r18 (cond (path
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ img src) path)
(setf (@ img style display) "flex"))
Some DOM stuff, VIEW
r18 (t
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (setf (@ img src) "")
(setf (@ img style display) "hidden")))))
Some DOM stuff, VIEW
r18
;;; Saves
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun opengame ()
(let ((element (chain document (create-element :input))))
(chain element (set-attribute :type :file))
(chain element (set-attribute :id :qsp-opengame))
(chain element (set-attribute :tabindex -1))
(chain element (set-attribute "aria-hidden" t))
(setf (@ element style display) :block)
(setf (@ element style visibility) :hidden)
(setf (@ element style position) :fixed)
(setf (@ element onchange)
Some DOM stuff, VIEW
r18 (lambda (event)
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let* ((file (@ event target files 0))
(reader (new (*file-reader))))
(setf (@ reader onload)
Some DOM stuff, VIEW
r18 (lambda (ev)
(block nil
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (let ((target (@ ev current-target)))
(unless (@ target result)
(return))
(base64-to-state (@ target result))
(unstash-state)))))
(chain reader (read-as-text file)))))
(chain document body (append-child element))
(chain element (click))
(chain document body (remove-child element))))
Some DOM stuff, VIEW
r18
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun savegame ()
(let ((element (chain document (create-element :a))))
(chain element (set-attribute :href (+ "data:text/plain;charset=utf-8," (state-to-base64))))
(chain element (set-attribute :download "savegame.sav"))
(setf (@ element style display) :none)
(chain document body (append-child element))
(chain element (click))
(chain document body (remove-child element))))
Finishing lib
r20
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun stash-state (args)
(call-serv-loc "ONGSAVE")
Finishing lib
r20 (setf (root state-stash)
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (chain *j-s-o-n (stringify
Removing unnecessary returns
r27 (create :vars (root vars)
:objs (root objs)
:loc-args args
:msecs (- (chain *date (now)) (root started-at))
:timer-interval (root timer-interval)
:main-html (inner-html
MENU
r30 (get-frame :main))
Removing unnecessary returns
r27 :stat-html (inner-html
MENU
r30 (get-frame :stat))
Removing unnecessary returns
r27 :next-location (root current-location)))))
(void))
Finishing lib
r20
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun unstash-state ()
(let ((data (chain *j-s-o-n (parse (root state-stash)))))
(clear-act)
Removing unnecessary returns
r27 (setf (root vars) (@ data :vars))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (loop :for k :in (chain *object (keys (root vars)))
:do (chain *object (set-prototype-of (getprop (root vars) k)
(@ *var prototype))))
Removing unnecessary returns
r27 (setf (root started-at) (- (chain *date (now)) (@ data :msecs)))
(setf (root objs) (@ data :objs))
(setf (root current-location) (@ data :next-location))
MENU
r30 (setf (inner-html (get-frame :main))
Removing unnecessary returns
r27 (@ data :main-html))
MENU
r30 (setf (inner-html (get-frame :stat))
Removing unnecessary returns
r27 (@ data :stat-html))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (update-objs)
Removing unnecessary returns
r27 (set-timer (@ data :timer-interval))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (call-serv-loc "ONGLOAD")
Removing unnecessary returns
r27 (call-loc (root current-location) (@ data :loc-args))
(void)))
Finishing lib
r20
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun state-to-base64 ()
Finishing lib
r20 (btoa (encode-u-r-i-component (root state-stash))))
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun base64-to-state (data)
Finishing lib
r20 (setf (root state-stash) (decode-u-r-i-component (atob data))))
;;; Timers
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (defun set-timer (interval)
Finishing lib
r20 (setf (root timer-interval) interval)
(clear-interval (root timer-obj))
(setf (root timer-obj)
(set-interval
(lambda ()
Use Parenscript's minifier and obfuscator... and namespaces. SAVES CURRENTLY BROKEN
r25 (call-serv-loc "COUNTER"))
Finishing lib
r20 interval)))