~evanj/cms

b95f32032bdbc2ad0eb77603c5e90656a65ac89d — Evan M Jones 6 months ago 27783e8
Feat(css): Removed most css. Plain HTML for most things.
M internal/s/tmpl/css/main.css => internal/s/tmpl/css/main.css +11 -20
@@ 1,29 1,20 @@
input { 
  box-sizing: content-box;
  display: block;
}

.tox.tox-tinymce {
  min-height: 600px;
}

body { 
  max-width: 1000px;
.aa-dropdown-menu {
  background: #f1f1f1;
  width: calc(100%% - 4px);
  border: 2px solid black;
  padding: 7.5px 0;
}

body.space input { 
  display: initial;
.aa-dropdown-menu p {
  margin: 0;
  padding: 7.5px 15px;
  cursor: pointer;
}

form[action='/contenttype/new'] input,
form[action='/contenttype/update'] input { 
  display: initial;
}

textarea { 
  display: block;
  resize: vertical;
  min-height: 600px;
  width: 100%%;
  box-sizing: content-box;
.aa-dropdown-menu p:hover {
  background: rgba(0, 0, 0, 0.05);
}

M internal/s/tmpl/html/content.html => internal/s/tmpl/html/content.html +40 -24
@@ 1,21 1,16 @@
<!DOCTYPE html>
<html lang=en>

<head>
  {{ template "html/_head.html" }}
  <title>CMS | {{ .Space.Name }} | {{ .ContentType.Name }} | {{ (.Content.MustValueByName "name").Value }}</title>
</head>

<body class=content>
  <style>{{ template "css/main.css" }}</style>

  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      <h1>{{ .Space.Name }}, {{ .ContentType.Name }}, {{ (.Content.MustValueByName "name").Value }}</h1>

      <details>
        <summary>Update Content</summary>
        <form method=POST action='/content/update' enctype='multipart/form-data'>


@@ 23,38 18,46 @@
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=hidden name=content value="{{ .Content.ID }}" />

          <br>
          <fieldset>
          {{ range $index, $item := .ContentType.Fields }}
            {{ $val := $.Content.MustValueByName ( $item.Name ) }}

            {{ if $val }} 
              <label>{{ $val.Name }}</label>
              {{ if eq $index 0 }}
              {{ else }}
              <br>
              {{ end }}

              <label for="value_update_{{ $val.Type }}-{{ $val.ID }}">{{ $val.Name }}</label>
              <br>

              {{ if eq $val.Type "StringSmall" }}
                <input value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
              {{ end }}

              {{ if eq $val.Type "StringBig" }}
                <textarea required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "InputHTML" }}
                <textarea class='input-html' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-html' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "InputMarkdown" }}
                <textarea class='input-markdown' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-markdown' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "File" }}
                <input value="{{ $val.Value }}" type=file name="value_update_{{ $val.Type }}-{{ $val.ID }}" multiple=false />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" type=file name="value_update_{{ $val.Type }}-{{ $val.ID }}" multiple=false />
              {{ end }}

              {{ if eq $val.Type "Date" }}
                <input value="{{ $val.Value }}" required type=date name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" required type=date name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
              {{ end }}

              {{ if eq $val.Type "Reference" }}
                <input class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID}}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID}}" />
                <input class='input-ref' type=button value="{{ if  $val.RefName }}{{ $val.RefName }}{{ else }}Open{{ end}}"/>
                <dialog>
                  <menu>


@@ 70,7 73,7 @@
              {{ end }}

              {{ if eq $val.Type "ReferenceList" }}
                <input class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID }}" />
                <input class='input-ref' type=button value="{{ if  $val.RefListNames }}{{ $val.RefListNames }}{{ else }}Open{{ end}}"/>
                <dialog>
                  <menu>


@@ 88,35 91,41 @@
                  </menu>
                </dialog>
              {{ end }}
              <br>
            {{ else }}
              <label>{{ .Name }}</label>
              {{ if eq $index 0 }}
              {{ else }}
              <br>
              {{ end }}
              <label for="value_update_{{ $val.Type }}-{{ $val.ID }}">{{ .Name }}</label>
              <br>

              {{ if eq .Type "StringSmall" }}
                <input required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              {{ end }}

              {{ if eq .Type "StringBig" }}
                <textarea required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "InputHTML" }}
                <textarea class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "InputMarkdown" }}
                <textarea class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "File" }}
                <input required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
              {{ end }}

              {{ if eq .Type "Date" }}
                <input required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              {{ end }}

              {{ if eq .Type "Reference" }}
                <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input class='input-ref' type=button value=Open />
                <dialog>
                  <menu>


@@ 132,7 141,7 @@
              {{ end }}

              {{ if eq .Type "ReferenceList" }}
                <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input class='input-ref' type=button value=Open />
                <dialog>
                  <menu>


@@ 150,10 159,13 @@
                  </menu>
                </dialog>
              {{ end }}
              <br>
            {{ end }}
          {{ end}}

          <input type=submit value=Update />
          </fieldset>
          <br>
        </form>
      </details>



@@ 163,7 175,11 @@
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=hidden name=content value="{{ .Content.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>


M internal/s/tmpl/html/contenttype.html => internal/s/tmpl/html/contenttype.html +42 -33
@@ 8,67 8,62 @@

<body class=contenttype>
  <style>{{ template "css/main.css" }}</style>

  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      <h1>{{ .Space.Name }}, {{ .ContentType.Name }}</h1>

      <details>
        <summary>Create a {{ .ContentType.Name }} Content</summary>
        <form method=POST action='/content/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <br/>

          <br>
          <fieldset>
          {{ range .ContentType.Fields }}

            <label>{{ .Name }}</label>

            <label for="create-{{ .Type }}-{{ .Name }}">{{ .Name }}</label>
            <br>
            {{ if eq .Type "StringSmall" }}
              <input required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
            {{ end }}

            {{ if eq .Type "StringBig" }}
              <textarea required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "InputHTML" }}
              <textarea class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "InputMarkdown" }}
              <textarea class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "File" }}
              <input required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
            {{ end }}

            {{ if eq .Type "Date" }}
              <input required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
            {{ end }}

            {{ if eq .Type "Reference" }}
              <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input class='input-ref' type=button value=Open />
              <dialog>
                <menu>
                  <div>
                    <center>
                      <p>Search for content to use as reference.</p>
                    </center>
                    <input autofocus class='input-contenttype' type=text placeholder='Search by content type' />
                    <input disabled class='input-content' type=text placeholder='Search by content name' />
                    <p>Search for content to use as reference.</p>
                    <label for='search-ct'>Content type</label>
                    <br>
                    <input id='search-ct' autofocus class='input-contenttype' type=text placeholder='Search by content type' />
                    <br>
                    <br>
                    <label for='search-c'>Content name</label>
                    <br>
                    <input id='search-c' disabled class='input-content' type=text placeholder='Search by content name' />
                  </div>
                </menu>
              </dialog>
            {{ end }}

            {{ if eq .Type "ReferenceList" }}
              <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input class='input-ref' type=button value=Open />
              <dialog>
                <menu>


@@ 86,10 81,12 @@
                </menu>
              </dialog>
            {{ end }}

            <br>
            <br>
          {{ end }}

          <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>



@@ 98,9 95,16 @@
        <form method=POST action='/contenttype/update' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=text name=name placeholder="content type name" value="{{ .ContentType.Name }}" />
          <br>
          <fieldset>
            <legend>Content type name</legend>
            <label for='update-name'>Name</label>
            <br>
            <input id='update-name' autofocus required type=text name=name placeholder="name" value="{{ .ContentType.Name }}" />
          </fieldset>
          <br>
          <fieldset>
          <legend>Fields</legend>

          {{ range $index, $item := .ContentType.Fields }}

            {{ if eq $index 0 }}


@@ 138,11 142,12 @@
                <input type=button value='Remove Field' />
              </div>
            {{ end }}

            <br>
          {{ end }}

          <input type=button id='add-fieldbtn' value='Add Another Field' />
          <input type=submit value=Update />
          </fieldset>
          <br>
        </form>
      </details>



@@ 151,7 156,11 @@
        <form method=POST action='/contenttype/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>


M internal/s/tmpl/html/hook.html => internal/s/tmpl/html/hook.html +6 -4
@@ 6,9 6,7 @@
  <title>CMS | {{ .Space.Name }} | {{ .Hook.URL }}</title>
</head>

<body class=hook>
  <style>{{ template "css/main.css" }}</style>

<body class=hook style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>


@@ 19,7 17,11 @@
        <form method=POST action='/hook/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=hook value="{{ .Hook.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>
    </article>

M internal/s/tmpl/html/index.html => internal/s/tmpl/html/index.html +58 -27
@@ 1,40 1,48 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang=en>

<head>
  {{ template "html/_head.html" }}
  <title>CMS</title>
</head>

<body class=index>
  <style>{{ template "css/main.css" }}</style>

<body class=index style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      {{ if .User }}

        <details>
          <summary>Create a New Space</summary>
          <form method=POST action='/space/new' enctype='multipart/form-data'>
            <input required type=text name=name placeholder=name />
            <input required type=text name=desc placeholder=description />
            <br>
            <fieldset>
              <label for='create-name'>Name</label>
              <br>
              <input id='create-name' autofocus required type=text name=name placeholder=name />
              <br>
              <br>
              <label for='create-desc'>Description</label>
              <br>
              <input id='create-desc' required type=text name=desc placeholder=description />
              <br>
              <br>
            <input type=submit value=Create />
            </fieldset>
            <br>
          </form>
        </details>

        <details>
          <summary>Logout</summary>
          <form method=POST action='/user/logout' enctype='multipart/form-data'>
            <input type=submit value=Logout />
            <br>
            <fieldset>
              <input autofocus type=submit value=Logout />
            </fieldset>
            <br>
          </form>
        </details>

        <br/>

        <h2>Available Spaces</h2>
        <br>
        <h2>Your Spaces</h2>
        {{ if .Spaces }}
          <ul>
            {{ range .Spaces }}


@@ 44,30 52,53 @@
        {{ else }}
          <p>You haven't created any spaces yet.</p>
        {{ end }}

      {{ else }}

        <details>
          <summary>Login</summary>
          <form method=POST action='/user/login' enctype='multipart/form-data'>
            <input autocomplete=on required type=text name=username placeholder=username autofocus />
            <input autocomplete=on required type=password name=password placeholder=password />
            <input type=submit value=Login />
            <br>
            <fieldset>
              <label for='login-username'>Username</label>
              <br>
              <input id='login-username' autocomplete=on required type=text name=username placeholder=username autofocus />
              <br>
              <br>
              <label for='login-password'>Password</label>
              <br>
              <input id='login-password' autocomplete=on required type=password name=password placeholder=password />
              <br>
              <br>
              <input type=submit value=Login />
            </fieldset>
            <br>
          </form>
        </details>

        <details>
          <summary>Signup</summary>
          <form method=POST action='/user/signup' enctype='multipart/form-data'>
            <input autocomplete=on required type=text name=username placeholder=username autofocus />
            <input autocomplete=on required type=password name=password placeholder=password />
            <input autocomplete=on required type=password name=verify placeholder=verify />
            <input type=submit value=Signup />
            <br>
            <fieldset>
              <label for='signup-username'>Username</label>
              <br>
              <input id='signup-username' autocomplete=on required type=text name=username placeholder=username autofocus />
              <br>
              <br>
              <label for='signup-password'>Password</label>
              <br>
              <input id='signup-password' autocomplete=on required type=password name=password placeholder=password />
              <br>
              <br>
              <label for='signup-verify'>Verify</label>
              <br>
              <input id='signup-verify' autocomplete=on required type=password name=verify placeholder=verify />
              <br>
              <br>
              <input type=submit value=Signup />
            </fieldset>
            <br>
          </form>
        </details>

      {{ end }}

    </article>
    <hr/>
    {{ template "html/_footer.html" }}

M internal/s/tmpl/html/space.html => internal/s/tmpl/html/space.html +29 -8
@@ 6,9 6,7 @@
  <title>CMS | {{ .Space.Name }}</title>
</head>

<body class=space>
  <style>{{ template "css/main.css" }}</style>

<body class=space style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>


@@ 20,7 18,15 @@
        <summary>Create Content Type</summary>
        <form method=POST action='/contenttype/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=text name=name placeholder="content type name" />
          <br>
          <fieldset>
            <legend>Content type name</legend>
            <label for='create-name'>Name</label>
            <br>
            <input id='create-name' autofocus required type=text name=name placeholder="name" />
          </fieldset>
          <br>
          <fieldset>
          <legend>Fields</legend>
          <div id='first-fieldset'>
            <input readonly="readonly" required type=text name="field_name_1" value="name" />


@@ 37,8 43,11 @@
            </select>
            <input disabled type=button value='Remove Field' />
          </div>
          <br>
          <input type=button id='add-fieldbtn' value='Add Another Field' />
          <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>



@@ 46,16 55,28 @@
        <summary>Create Webhook</summary>
        <form method=POST action='/hook/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=url name=url placeholder='Must enter full URL of target' />
          <input type=submit value=Create />
          <br>
          <fieldset>
            <label for='webhook-url'>URL</label>
            <br>
            <input id='webhook-url' autofocus required type=url name=url placeholder='Must enter full URL of target' />
            <br>
            <br>
            <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>

      <details>
        <summary>Delete {{ .Space.Name }} Space</summary>
        <form method=POST action='/space/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input required type=hidden name=space value="{{ .Space.ID }}" />
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>


M internal/s/tmpl/js/content.js => internal/s/tmpl/js/content.js +3 -2
@@ 46,8 46,8 @@
  });

  // REFERENCE
  var refs = document.querySelectorAll("form > dialog")
  var menus = document.querySelectorAll("form > dialog > menu")
  var refs = document.querySelectorAll("form dialog")
  var menus = document.querySelectorAll("form dialog menu")
  var refbtns = document.querySelectorAll(".input-ref")
  var tobtns = document.querySelectorAll(".output-ref")
  for (i = 0; i < refs.length; i++) { 


@@ 119,6 119,7 @@
      var content = inputs[1]

      var opts = {
        debug: true,
        autoselect: true,
        autoselectOnBlur: true, 
        tabAutocomplete: true,

M internal/s/tmpl/js/space.js => internal/s/tmpl/js/space.js +1 -0
@@ 23,6 23,7 @@
        </select>
        <input type=button id='remove-fieldbtn_${i}' value='Remove Field' />
      </div>
      <br>
    `
    addFieldBtn.parentNode.insertBefore(el, addFieldBtn)
    var removeFieldBtn = document.getElementById(`remove-fieldbtn_${i}`)

M internal/s/tmpl/tmpls_embed.go => internal/s/tmpl/tmpls_embed.go +191 -119
@@ 7,34 7,25 @@ var tmpls map[string]string
func init() {
	tmpls = make(map[string]string)

	tmpls["css/main.css"] = `input { 
  box-sizing: content-box;
  display: block;
}

.tox.tox-tinymce {
	tmpls["css/main.css"] = `.tox.tox-tinymce {
  min-height: 600px;
}

body { 
  max-width: 1000px;
.aa-dropdown-menu {
  background: #f1f1f1;
  width: calc(100% - 4px);
  border: 2px solid black;
  padding: 7.5px 0;
}

body.space input { 
  display: initial;
.aa-dropdown-menu p {
  margin: 0;
  padding: 7.5px 15px;
  cursor: pointer;
}

form[action='/contenttype/new'] input,
form[action='/contenttype/update'] input { 
  display: initial;
}

textarea { 
  display: block;
  resize: vertical;
  min-height: 600px;
  width: 100%;
  box-sizing: content-box;
.aa-dropdown-menu p:hover {
  background: rgba(0, 0, 0, 0.05);
}
`



@@ 427,22 418,17 @@ blockquote footer {

	tmpls["html/content.html"] = `<!DOCTYPE html>
<html lang=en>

<head>
  {{ template "html/_head.html" }}
  <title>CMS | {{ .Space.Name }} | {{ .ContentType.Name }} | {{ (.Content.MustValueByName "name").Value }}</title>
</head>

<body class=content>
  <style>{{ template "css/main.css" }}</style>

  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      <h1>{{ .Space.Name }}, {{ .ContentType.Name }}, {{ (.Content.MustValueByName "name").Value }}</h1>

      <details>
        <summary>Update Content</summary>
        <form method=POST action='/content/update' enctype='multipart/form-data'>


@@ 450,38 436,46 @@ blockquote footer {
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=hidden name=content value="{{ .Content.ID }}" />

          <br>
          <fieldset>
          {{ range $index, $item := .ContentType.Fields }}
            {{ $val := $.Content.MustValueByName ( $item.Name ) }}

            {{ if $val }} 
              <label>{{ $val.Name }}</label>
              {{ if eq $index 0 }}
              {{ else }}
              <br>
              {{ end }}

              <label for="value_update_{{ $val.Type }}-{{ $val.ID }}">{{ $val.Name }}</label>
              <br>

              {{ if eq $val.Type "StringSmall" }}
                <input value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
              {{ end }}

              {{ if eq $val.Type "StringBig" }}
                <textarea required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "InputHTML" }}
                <textarea class='input-html' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-html' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "InputMarkdown" }}
                <textarea class='input-markdown' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-markdown' value="{{ $val.Value }}" required type=text name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}">{{ $val.Value }}</textarea>
              {{ end }}

              {{ if eq $val.Type "File" }}
                <input value="{{ $val.Value }}" type=file name="value_update_{{ $val.Type }}-{{ $val.ID }}" multiple=false />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" type=file name="value_update_{{ $val.Type }}-{{ $val.ID }}" multiple=false />
              {{ end }}

              {{ if eq $val.Type "Date" }}
                <input value="{{ $val.Value }}" required type=date name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" value="{{ $val.Value }}" required type=date name="value_update_{{ $val.Type }}-{{ $val.ID }}" placeholder="{{ $val.Name }}" />
              {{ end }}

              {{ if eq $val.Type "Reference" }}
                <input class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID}}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID}}" />
                <input class='input-ref' type=button value="{{ if  $val.RefName }}{{ $val.RefName }}{{ else }}Open{{ end}}"/>
                <dialog>
                  <menu>


@@ 497,7 491,7 @@ blockquote footer {
              {{ end }}

              {{ if eq $val.Type "ReferenceList" }}
                <input class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden value="{{ $val.Value }}" name="value_update_{{ $val.Type }}-{{ $val.ID }}" />
                <input class='input-ref' type=button value="{{ if  $val.RefListNames }}{{ $val.RefListNames }}{{ else }}Open{{ end}}"/>
                <dialog>
                  <menu>


@@ 515,35 509,41 @@ blockquote footer {
                  </menu>
                </dialog>
              {{ end }}
              <br>
            {{ else }}
              <label>{{ .Name }}</label>
              {{ if eq $index 0 }}
              {{ else }}
              <br>
              {{ end }}
              <label for="value_update_{{ $val.Type }}-{{ $val.ID }}">{{ .Name }}</label>
              <br>

              {{ if eq .Type "StringSmall" }}
                <input required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              {{ end }}

              {{ if eq .Type "StringBig" }}
                <textarea required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "InputHTML" }}
                <textarea class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "InputMarkdown" }}
                <textarea class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
                <textarea {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              {{ end }}

              {{ if eq .Type "File" }}
                <input required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
              {{ end }}

              {{ if eq .Type "Date" }}
                <input required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              {{ end }}

              {{ if eq .Type "Reference" }}
                <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input class='input-ref' type=button value=Open />
                <dialog>
                  <menu>


@@ 559,7 559,7 @@ blockquote footer {
              {{ end }}

              {{ if eq .Type "ReferenceList" }}
                <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input {{ if eq $index 0 }} autofocus {{ end }} id="value_update_{{ $val.Type }}-{{ $val.ID }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
                <input class='input-ref' type=button value=Open />
                <dialog>
                  <menu>


@@ 577,10 577,13 @@ blockquote footer {
                  </menu>
                </dialog>
              {{ end }}
              <br>
            {{ end }}
          {{ end}}

          <input type=submit value=Update />
          </fieldset>
          <br>
        </form>
      </details>



@@ 590,7 593,11 @@ blockquote footer {
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=hidden name=content value="{{ .Content.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>



@@ 616,67 623,62 @@ blockquote footer {

<body class=contenttype>
  <style>{{ template "css/main.css" }}</style>

  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      <h1>{{ .Space.Name }}, {{ .ContentType.Name }}</h1>

      <details>
        <summary>Create a {{ .ContentType.Name }} Content</summary>
        <form method=POST action='/content/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <br/>

          <br>
          <fieldset>
          {{ range .ContentType.Fields }}

            <label>{{ .Name }}</label>

            <label for="create-{{ .Type }}-{{ .Name }}">{{ .Name }}</label>
            <br>
            {{ if eq .Type "StringSmall" }}
              <input required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
            {{ end }}

            {{ if eq .Type "StringBig" }}
              <textarea required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "InputHTML" }}
              <textarea class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" class='input-html' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "InputMarkdown" }}
              <textarea class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
              <textarea id="create-{{ .Type }}-{{ .Name }}" class='input-markdown' required type=text name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" ></textarea>
            {{ end }}

            {{ if eq .Type "File" }}
              <input required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=file name="{{ .Type }}-{{ .Name }}" multiple=false />
            {{ end }}

            {{ if eq .Type "Date" }}
              <input required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" required type=date name="{{ .Type }}-{{ .Name }}" placeholder="{{ .Name }}" />
            {{ end }}

            {{ if eq .Type "Reference" }}
              <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input class='input-ref' type=button value=Open />
              <dialog>
                <menu>
                  <div>
                    <center>
                      <p>Search for content to use as reference.</p>
                    </center>
                    <input autofocus class='input-contenttype' type=text placeholder='Search by content type' />
                    <input disabled class='input-content' type=text placeholder='Search by content name' />
                    <p>Search for content to use as reference.</p>
                    <label for='search-ct'>Content type</label>
                    <br>
                    <input id='search-ct' autofocus class='input-contenttype' type=text placeholder='Search by content type' />
                    <br>
                    <br>
                    <label for='search-c'>Content name</label>
                    <br>
                    <input id='search-c' disabled class='input-content' type=text placeholder='Search by content name' />
                  </div>
                </menu>
              </dialog>
            {{ end }}

            {{ if eq .Type "ReferenceList" }}
              <input class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input id="create-{{ .Type }}-{{ .Name }}" class='output-ref' required type=hidden name="{{ .Type }}-{{ .Name }}" />
              <input class='input-ref' type=button value=Open />
              <dialog>
                <menu>


@@ 694,10 696,12 @@ blockquote footer {
                </menu>
              </dialog>
            {{ end }}

            <br>
            <br>
          {{ end }}

          <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>



@@ 706,9 710,16 @@ blockquote footer {
        <form method=POST action='/contenttype/update' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input required type=text name=name placeholder="content type name" value="{{ .ContentType.Name }}" />
          <br>
          <fieldset>
            <legend>Content type name</legend>
            <label for='update-name'>Name</label>
            <br>
            <input id='update-name' autofocus required type=text name=name placeholder="name" value="{{ .ContentType.Name }}" />
          </fieldset>
          <br>
          <fieldset>
          <legend>Fields</legend>

          {{ range $index, $item := .ContentType.Fields }}

            {{ if eq $index 0 }}


@@ 746,11 757,12 @@ blockquote footer {
                <input type=button value='Remove Field' />
              </div>
            {{ end }}

            <br>
          {{ end }}

          <input type=button id='add-fieldbtn' value='Add Another Field' />
          <input type=submit value=Update />
          </fieldset>
          <br>
        </form>
      </details>



@@ 759,7 771,11 @@ blockquote footer {
        <form method=POST action='/contenttype/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=contenttype value="{{ .ContentType.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>



@@ 799,9 815,7 @@ blockquote footer {
  <title>CMS | {{ .Space.Name }} | {{ .Hook.URL }}</title>
</head>

<body class=hook>
  <style>{{ template "css/main.css" }}</style>

<body class=hook style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>


@@ 812,7 826,11 @@ blockquote footer {
        <form method=POST action='/hook/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=hidden name=hook value="{{ .Hook.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>
    </article>


@@ 828,42 846,50 @@ blockquote footer {
`

	tmpls["html/index.html"] = `<!DOCTYPE html>
<!DOCTYPE html>
<html lang=en>

<head>
  {{ template "html/_head.html" }}
  <title>CMS</title>
</head>

<body class=index>
  <style>{{ template "css/main.css" }}</style>

<body class=index style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>
    <article>

      {{ if .User }}

        <details>
          <summary>Create a New Space</summary>
          <form method=POST action='/space/new' enctype='multipart/form-data'>
            <input required type=text name=name placeholder=name />
            <input required type=text name=desc placeholder=description />
            <br>
            <fieldset>
              <label for='create-name'>Name</label>
              <br>
              <input id='create-name' autofocus required type=text name=name placeholder=name />
              <br>
              <br>
              <label for='create-desc'>Description</label>
              <br>
              <input id='create-desc' required type=text name=desc placeholder=description />
              <br>
              <br>
            <input type=submit value=Create />
            </fieldset>
            <br>
          </form>
        </details>

        <details>
          <summary>Logout</summary>
          <form method=POST action='/user/logout' enctype='multipart/form-data'>
            <input type=submit value=Logout />
            <br>
            <fieldset>
              <input autofocus type=submit value=Logout />
            </fieldset>
            <br>
          </form>
        </details>

        <br/>

        <h2>Available Spaces</h2>
        <br>
        <h2>Your Spaces</h2>
        {{ if .Spaces }}
          <ul>
            {{ range .Spaces }}


@@ 873,30 899,53 @@ blockquote footer {
        {{ else }}
          <p>You haven't created any spaces yet.</p>
        {{ end }}

      {{ else }}

        <details>
          <summary>Login</summary>
          <form method=POST action='/user/login' enctype='multipart/form-data'>
            <input autocomplete=on required type=text name=username placeholder=username autofocus />
            <input autocomplete=on required type=password name=password placeholder=password />
            <input type=submit value=Login />
            <br>
            <fieldset>
              <label for='login-username'>Username</label>
              <br>
              <input id='login-username' autocomplete=on required type=text name=username placeholder=username autofocus />
              <br>
              <br>
              <label for='login-password'>Password</label>
              <br>
              <input id='login-password' autocomplete=on required type=password name=password placeholder=password />
              <br>
              <br>
              <input type=submit value=Login />
            </fieldset>
            <br>
          </form>
        </details>

        <details>
          <summary>Signup</summary>
          <form method=POST action='/user/signup' enctype='multipart/form-data'>
            <input autocomplete=on required type=text name=username placeholder=username autofocus />
            <input autocomplete=on required type=password name=password placeholder=password />
            <input autocomplete=on required type=password name=verify placeholder=verify />
            <input type=submit value=Signup />
            <br>
            <fieldset>
              <label for='signup-username'>Username</label>
              <br>
              <input id='signup-username' autocomplete=on required type=text name=username placeholder=username autofocus />
              <br>
              <br>
              <label for='signup-password'>Password</label>
              <br>
              <input id='signup-password' autocomplete=on required type=password name=password placeholder=password />
              <br>
              <br>
              <label for='signup-verify'>Verify</label>
              <br>
              <input id='signup-verify' autocomplete=on required type=password name=verify placeholder=verify />
              <br>
              <br>
              <input type=submit value=Signup />
            </fieldset>
            <br>
          </form>
        </details>

      {{ end }}

    </article>
    <hr/>
    {{ template "html/_footer.html" }}


@@ 914,9 963,7 @@ blockquote footer {
  <title>CMS | {{ .Space.Name }}</title>
</head>

<body class=space>
  <style>{{ template "css/main.css" }}</style>

<body class=space style='max-width: 500px;'>
  <main>
    {{ template "html/_header.html" $ }}
    <hr/>


@@ 928,7 975,15 @@ blockquote footer {
        <summary>Create Content Type</summary>
        <form method=POST action='/contenttype/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=text name=name placeholder="content type name" />
          <br>
          <fieldset>
            <legend>Content type name</legend>
            <label for='create-name'>Name</label>
            <br>
            <input id='create-name' autofocus required type=text name=name placeholder="name" />
          </fieldset>
          <br>
          <fieldset>
          <legend>Fields</legend>
          <div id='first-fieldset'>
            <input readonly="readonly" required type=text name="field_name_1" value="name" />


@@ 945,8 1000,11 @@ blockquote footer {
            </select>
            <input disabled type=button value='Remove Field' />
          </div>
          <br>
          <input type=button id='add-fieldbtn' value='Add Another Field' />
          <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>



@@ 954,16 1012,28 @@ blockquote footer {
        <summary>Create Webhook</summary>
        <form method=POST action='/hook/new' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input required type=url name=url placeholder='Must enter full URL of target' />
          <input type=submit value=Create />
          <br>
          <fieldset>
            <label for='webhook-url'>URL</label>
            <br>
            <input id='webhook-url' autofocus required type=url name=url placeholder='Must enter full URL of target' />
            <br>
            <br>
            <input type=submit value=Create />
          </fieldset>
          <br>
        </form>
      </details>

      <details>
        <summary>Delete {{ .Space.Name }} Space</summary>
        <form method=POST action='/space/delete' enctype='multipart/form-data'>
          <input required type=hidden name=space value="{{ .Space.ID }}" />
          <input type=submit value=Delete />
          <br>
          <fieldset>
            <input required type=hidden name=space value="{{ .Space.ID }}" />
            <input type=submit value=Delete />
          </fieldset>
          <br>
        </form>
      </details>



@@ 1047,8 1117,8 @@ blockquote footer {
  });

  // REFERENCE
  var refs = document.querySelectorAll("form > dialog")
  var menus = document.querySelectorAll("form > dialog > menu")
  var refs = document.querySelectorAll("form dialog")
  var menus = document.querySelectorAll("form dialog menu")
  var refbtns = document.querySelectorAll(".input-ref")
  var tobtns = document.querySelectorAll(".output-ref")
  for (i = 0; i < refs.length; i++) { 


@@ 1120,6 1190,7 @@ blockquote footer {
      var content = inputs[1]

      var opts = {
        debug: true,
        autoselect: true,
        autoselectOnBlur: true, 
        tabAutocomplete: true,


@@ 1242,6 1313,7 @@ blockquote footer {
        </select>
        <input type=button id='remove-fieldbtn_${i}' value='Remove Field' />
      </div>
      <br>
    ` + "`" + `
    addFieldBtn.parentNode.insertBefore(el, addFieldBtn)
    var removeFieldBtn = document.getElementById(` + "`" + `remove-fieldbtn_${i}` + "`" + `)