-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In-page Editing #155
Comments
Why not just allow editing of text in the current Edit Properties dialog box? The text already appears there so if you could just allow editing there you would not need to implement on screen editing. On screen editing is a bonus and should allow only plain text edits. If there is an underlying link in the element it should not be disturbed. A few types of elements to think about for how to edit in the edit properties dialog a. drop down lists (this one could be tricky but you could just allow editing in the edit properties dialog) |
Editing in-page is actually easier to implement and makes much more sense.
There is no way to change an element and not affect links and styling tags (especially if doing it in the properties window) - these would all be overwritten, same as the |
I think you already have a demo of the inpage editing working don't you? I forgot about that. Can we schedule some time to review how this would work in a real world scenario? |
It's important that the new inline editing feature not be less effective than the current approach. In my experience of targeting elements the most accurate approach is as follows
Using a detailed CSS path with large nesting doesn't seem to always work in my experience. |
One approach to take when identifying WHAT can be modified with EZ WildApricot Designer is to isolate only elements of the DOM that have text directly inside them. These HTML tags on WA have text in diretly in them: INPUTs (value attribute and placeholder attribute) But maybe with Javascript you can walk through the DOM and check whether the element has text directly inside it, although in cases like INPUT it's a little more tricky since WA puts stuff in the value and placeholder text. |
Yes, I have code that will look for elements that hold text directly: const hasText = Array.from(target.childNodes).some(
(node) =>
node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== ""
); This will identify every kind of element that holds texts, while ignoring empty text elements like |
Here's what ChatGPT had to say about this: In HTML, many tags can contain text directly. Here is a list of some of the most common tags that can include text: Text-Level Semantic Elements
Block-Level Elements
Form Elements
These tags support containing text directly and are often used to structure and format content in HTML documents. |
I think your code sample will work for every one of those tags other than INPUT... For INPUT you will need to use the
Some sample code
|
Would anyone need to edit a text box? |
This needs to check the leaf nodes of an element only though because a container DIV which holds lots of text elements will also have textContent set to true, and we don't want anything but the leaf nodes. |
if it had placeholder text in it? |
Okay, for inputs I can check |
here's some code chatGPT ran that loops through valid elements that can have text. The problem one I see is DIV which can have other elements inside of it. But maybe you can check to see if the element has other elements in it and then discard it, and continue checking for elements that don't have other elements in them (ie leaf nodes)
|
Another thing you probably have to do is if you're looking for an existing element that was encoded that doesn't exist anymore you could popup a message and ask what to do with those "orpahed" elements. Most likely they need to be remapped or discarded altogether. |
We don't need to loop through each element. I took the looping approach with my previous in-page editing demo. But for the latest one, I do the checks on the fly when you mouse over. const mouseoverHandler = (event) => {
const target = event.target;
const hasText = Array.from(target.childNodes).some(
(node) =>
node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== ""
);
if (hasText) {
} else {
}
}
}; The above code is used for the outlining. When clicked i then get the element type. It does not identify elements that only contain child elements with text as "hasText". |
I've considered this, however the missing element may just not be located on that page. |
But I can add a check for elements that aren't found on the page and give the option to remap them |
What functions and style options should be available? So far there is:
|
Confirming -- will drop downs, checkboxes and radio buttons be changeable with v3? |
Per our last meeting only form buttons will be modifiable, though labels will be editable. |
I realized that dropdowns and options on checkboxes and radio buttons need to be translated as well and that's a common use case. Will that be a problem to add? After all it is text on a page even though it is part of an INPUT field. |
Won't be a problem to add, I had originally included those but removed it. I might have a backup of those functions. |
Oh I'm sorry! I was just reflecting on the pieces of text I needed to modify. Maybe they are in the GitHub repo for v2? |
Allow users to update the CSV by making text changes directly on the webpage.
Hovering over various elements will outline them, red for containers that do not contain text and are not editable, and blue for elements you can edit directly.
Should this only allow for plain-text edits? (ie: no text styling, creating links?)
The text was updated successfully, but these errors were encountered: