rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.49k stars 102 forks source link

CLOG-TOOLS:CLOG-BUILDER `New Bootstrap Page` and `Custom Html` #179

Closed johndebord closed 2 years ago

johndebord commented 2 years ago

When selecting a control that's been dropped-in via Custom Html, it appears that the right-side-panel contents field is not rendered in utf-8. Also, I'm not entirely sure on how to go about editing the html of the new control once it's been dropped-in (the right-side-panel contents field text-box is difficult to resize).

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
    Dropdown button
  </button>
  <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
    <li><a class="dropdown-item" href="#">Action</a></li>
    <li><a class="dropdown-item" href="#">Another action</a></li>
    <li><a class="dropdown-item" href="#">Something else here</a></li>
  </ul>
</div>

sc2

rabbibotton commented 2 years ago

I will look in to why is not handling utf-8.

Generally, you would not actually edit the html (in fact doing so is likely to run in to issues). You would adjust it visually and also use the bottom left panel to click on the individual control that were generated by the HTML you dropped. (btw you could have just pasted the HTML also for the same results ctrl-v or the paste button).

I never thought of it, but I could easily add a way to drop the custom html like you just did but to maintain it as a group with no controls generated. Then you would be able to edit the html and the entire group floats around like a single control. In some ways this would sort of defeats the idea of using the builder visually but for some or some projects useful. I'll see about adding it.

johndebord commented 2 years ago

I think that would be a neat feature. It'd' allow a user to test out/experiment with an html snippet quickly with minimal friction

johndebord commented 2 years ago

Also I think using the builder both visually and non-visually equally would be the most interesting and powerful combination (like exposing the end-result generated LISP/HTML/CSS/JS in another window (or windows), so that everything going on under the hood could be seen). But that just might be my own personal opinion/preference, though

rabbibotton commented 2 years ago

Interesting idea, the builder takes snap shots of the underlying html with every change to allow for undo, so it would not be a big deal to add an optional display window. The issue is formatting the generated html to be something worth looking out.

Saving the panel gives you the html (the .clog format) that can even be pulled up in a browser. Your code for events is stored in data- along with some other meta so can even be edited in a text editor and loaded back in to the builder or copy and pasted in. (No data- ever goes over the wire that is all local and the rendered lisp does not contain them)

rabbibotton commented 2 years ago

Ok, I added now Custom HTML block. It is actually very very useful indeed for pasting in tons of text with formatting etc. Fantastic idea, thanks!

aykaramba commented 2 years ago

Oh, this is VERY useful, especially when dealing with complicated layouts. thanks!

rabbibotton commented 2 years ago

The UTF-8 issue was a bug in creating html entities, corrected and all good now.