Skip to content

Commit

Permalink
Extend API to allow disable or enable of any tool.
Browse files Browse the repository at this point in the history
Remove code for creating json boolean false from lisp.
  • Loading branch information
bvds committed May 25, 2010
1 parent bbfda8e commit 0d1c0f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
8 changes: 1 addition & 7 deletions Base/web-server.cl
Expand Up @@ -194,13 +194,7 @@
(let ((reply-json
;; By default, cl-json turns dashes into camel-case:
;; Instead, we convert to lower case, preserving dashes.
(let ((*lisp-identifier-name-to-json* #'string-downcase)
;; The cl-json package has no built-in method for generating
;; a json boolean false. The following allows us to
;; use lisp keyword :false for this purpose.
(json::+json-lisp-symbol-tokens+ '(("true" . t)
("null" . nil)
("false" . :false))))
(let ((*lisp-identifier-name-to-json* #'string-downcase))
(encode-json-alist-to-string reply))))

(when *log-function*
Expand Down
5 changes: 2 additions & 3 deletions Help/sessions.cl
Expand Up @@ -506,9 +506,8 @@
(unless (intersection '(circular rotkin angmom torque mag gauss)
(problem-features *cp*))
(push '((:action . "set-styles")
;; :false generates a json boolean false.
;; See comments in Base/web-server.cl
(:z-axis-enable . :false)) replies))
(:tool . "vectorSecondary")
(:style . "disabled")) replies))

;; set-stats (if there was an old score) (to do)
;; Should this be wrapped in execute-andes-command?
Expand Down
8 changes: 6 additions & 2 deletions web-UI/andes/andes3.smd
Expand Up @@ -35,6 +35,11 @@
"optional": true,
"description": "Identifier for each drawn item, set by the creator of the object. Required for new-object"
},
"tool": {
"type": "string",
"optional": true,
"description": "Identifier for drawing tools. Should match the short names of tools in toolType."
},
"type": {
"type": "string",
"enum": ["statement", "graphics", "equation", "ellipse", "circle",
Expand All @@ -51,7 +56,7 @@
"style":{
"type": "string",
"optional": true,
"description": "subset of type, specify visual presentation (not used yet)"
"description": "Specify visual presentation or user interface action."
},
"x": {"type": "number", "optional": true},
"y": {"type": "number", "optional": true},
Expand All @@ -69,7 +74,6 @@
"description": "in degrees"},
"cosphi": {"type": "number", "optional": true,
"description": "cos(phi), default is zero"},
"z-axis-enable" : {"type": "boolean", "optional": true},
"href": {"type": "string", "optional": true},
"checked": {"type": "array", "items": "string", "optional": true,
"description": "for buttons"},
Expand Down

0 comments on commit 0d1c0f4

Please sign in to comment.