summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorckonstanski <carlos.konstanski@olo.com>2025-07-07 07:48:07 -0600
committerckonstanski <carlos.konstanski@olo.com>2025-07-07 07:48:07 -0600
commit1a48c096daf3a4e0ddc0e8b48331cfe872490b90 (patch)
tree866aaf5db295d130c35db48efac32a61a159f06d /src
parent956332367df366f37dac41958de31c4dbbe03b43 (diff)
add hiccups require, remove ckeditor
Diffstat (limited to 'src')
-rw-r--r--src/org_ckons_cljs/form/core.cljs109
1 files changed, 2 insertions, 107 deletions
diff --git a/src/org_ckons_cljs/form/core.cljs b/src/org_ckons_cljs/form/core.cljs
index 441c947..6119ca5 100644
--- a/src/org_ckons_cljs/form/core.cljs
+++ b/src/org_ckons_cljs/form/core.cljs
@@ -1,115 +1,10 @@
(ns org-ckons-cljs.form.core
(:require-macros [hiccups.core :as hiccups :refer [html]]
- [clojure.string :as str]))
+ [clojure.string :as str])
+ (:require [hiccups.runtime :as hiccupsrt]))
-(declare editor-init)
(declare template-generic-form)
-(def ckeditor-config (js->clj (js/JSON.parse "{
- \"toolbar\": {
- \"items\": [
- \"exportPDF\", \"exportWord\", \"|\",
- \"findAndReplace\", \"selectAll\", \"|\",
- \"heading\", \"|\",
- \"bold\", \"italic\", \"strikethrough\", \"underline\", \"code\", \"subscript\", \"superscript\", \"removeFormat\", \"|\",
- \"bulletedList\", \"numberedList\", \"todoList\", \"|\",
- \"outdent\", \"indent\", \"|\",
- \"undo\", \"redo\",
- \"-\",
- \"fontSize\", \"fontFamily\", \"fontColor\", \"fontBackgroundColor\", \"highlight\", \"|\",
- \"alignment\", \"|\",
- \"link\", \"insertImage\", \"blockQuote\", \"insertTable\", \"mediaEmbed\", \"codeBlock\", \"htmlEmbed\", \"|\",
- \"specialCharacters\", \"horizontalLine\", \"pageBreak\", \"|\",
- \"textPartLanguage\", \"|\",
- \"sourceEditing\"
- ],
- \"shouldNotGroupWhenFull\": true
- },
- \"list\": {
- \"properties\": {
- \"styles\": true,
- \"startIndex\": true,
- \"reversed\": true
- }
- },
- \"heading\": {
- \"options\": [
- { \"model\": \"paragraph\", \"title\": \"Paragraph\", \"class\": \"ck-heading_paragraph\" },
- { \"model\": \"heading1\", \"view\": \"h1\", \"title\": \"Heading 1\", \"class\": \"ck-heading_heading1\" },
- { \"model\": \"heading2\", \"view\": \"h2\", \"title\": \"Heading 2\", \"class\": \"ck-heading_heading2\" },
- { \"model\": \"heading3\", \"view\": \"h3\", \"title\": \"Heading 3\", \"class\": \"ck-heading_heading3\" },
- { \"model\": \"heading4\", \"view\": \"h4\", \"title\": \"Heading 4\", \"class\": \"ck-heading_heading4\" },
- { \"model\": \"heading5\", \"view\": \"h5\", \"title\": \"Heading 5\", \"class\": \"ck-heading_heading5\" },
- { \"model\": \"heading6\", \"view\": \"h6\", \"title\": \"Heading 6\", \"class\": \"ck-heading_heading6\" }
- ]
- },
- \"fontFamily\": {
- \"options\": [
- \"default\",
- \"Arial, Helvetica, sans-serif\",
- \"Courier New, Courier, monospace\",
- \"Georgia, serif\",
- \"Lucida Sans Unicode, Lucida Grande, sans-serif\",
- \"Tahoma, Geneva, sans-serif\",
- \"Times New Roman, Times, serif\",
- \"Trebuchet MS, Helvetica, sans-serif\",
- \"Verdana, Geneva, sans-serif\"
- ],
- \"supportAllValues\": true
- },
- \"fontSize\": {
- \"options\": [10, 12, 14, \"default\", 18, 20, 22],
- \"supportAllValues\": true
- },
- \"htmlSupport\": {
- \"allow\": [
- {
- \"name\": \"/.*/\",
- \"attributes\": true,
- \"classes\": true,
- \"styles\": true
- }
- ]
- },
- \"htmlEmbed\": {
- \"showPreviews\": true
- },
- \"link\": {
- \"decorators\": {
- \"addTargetToExternalLinks\": true,
- \"defaultProtocol\": \"https://\",
- \"toggleDownloadable\": {
- \"mode\": \"manual\",
- \"label\": \"Downloadable\",
- \"attributes\": {
- \"download\": \"file\"
- }
- }
- }
- },
- \"removePlugins\": [
- \"CKBox\",
- \"CKFinder\",
- \"EasyImage\",
- \"RealTimeCollaborativeComments\",
- \"RealTimeCollaborativeTrackChanges\",
- \"RealTimeCollaborativeRevisionHistory\",
- \"PresenceList\",
- \"Comments\",
- \"TrackChanges\",
- \"TrackChangesData\",
- \"RevisionHistory\",
- \"Pagination\",
- \"WProofreader\",
- \"MathType\"
- ]
-}")))
-
-(defn editor-init [elem]
- (-> js/ClassicEditor
- (.create elem ckeditor-config)
- (.catch (fn [err] (js/console (.error err))))))
-
(hiccups/defhtml template-generic-form [jsonobj namespace]
[:div {:id "form-errormsg"}]
[:form {:name (get jsonobj "name")