f



Seeking input for an idea

I have an HTML page that has a considerable number of elements (at least 50=
) and is divided into sections, which means each section has about a doze o=
r so elements.  In the meantime, all these elements may not covered every b=
usiness aspects as we wish, hence, there's a need to allow insertion of a t=
ext node at any location of the page.  Here's a thought on such a function =
process / flow.

(1) Have the function button floats at the top right corner
When cursor move down to the middle of the page, it automatically floats to=
 the mid right of the page.  When the cursor is close to the bottom of the =
page it floats to the bottom of the page.

(2) This function button is draggable
Once dragged to a certain position of the page, upon right click, insert a =
new text node there.

(3) The new text node's position is inferred from its sibling

Doable?

Thanks.
0
justaguy
12/6/2016 8:10:35 PM
comp.lang.javascript 38370 articles. 0 followers. javascript4 (1315) is leader. Post Follow

8 Replies
154 Views

Similar Articles

[PageSpeed] 8

On 06-12-16 21:10, justaguy wrote:
>
> I have an HTML page that has a considerable number of elements (at least 50) and is divided into sections, which means each section has about a doze or so elements.  In the meantime, all these elements may not covered every business aspects as we wish, hence, there's a need to allow insertion of a text node at any location of the page.  Here's a thought on such a function process / flow.
>
> (1) Have the function button floats at the top right corner
> When cursor move down to the middle of the page, it automatically floats to the mid right of the page.  When the cursor is close to the bottom of the page it floats to the bottom of the page.
>
> (2) This function button is draggable
> Once dragged to a certain position of the page, upon right click, insert a new text node there.
>
> (3) The new text node's position is inferred from its sibling
>
> Doable?
>
> Thanks.
>

You say that it's divided into sections.

So, someone must havte had some ideas on how this sections exist.
What makes some fields part of the first section, and other fields part 
of the secons section, .....

But they did not think long enough, because of you statement:
"there's a need to allow insertion of a text node at any location of the 
page"

I would create HTML pages for every section, and create a 'back one 
section' and a 'forward one section' button on these pages.
(possibly with validation per section)




0
Luuk
12/6/2016 8:21:05 PM
On Tuesday, December 6, 2016 at 3:21:11 PM UTC-5, Luuk wrote:
> On 06-12-16 21:10, justaguy wrote:
> >
> > I have an HTML page that has a considerable number of elements (at leas=
t 50) and is divided into sections, which means each section has about a do=
ze or so elements.  In the meantime, all these elements may not covered eve=
ry business aspects as we wish, hence, there's a need to allow insertion of=
 a text node at any location of the page.  Here's a thought on such a funct=
ion process / flow.
> >
> > (1) Have the function button floats at the top right corner
> > When cursor move down to the middle of the page, it automatically float=
s to the mid right of the page.  When the cursor is close to the bottom of =
the page it floats to the bottom of the page.
> >
> > (2) This function button is draggable
> > Once dragged to a certain position of the page, upon right click, inser=
t a new text node there.
> >
> > (3) The new text node's position is inferred from its sibling
> >
> > Doable?
> >
> > Thanks.
> >
>=20
> You say that it's divided into sections.
>=20
> So, someone must havte had some ideas on how this sections exist.
> What makes some fields part of the first section, and other fields part=
=20
> of the secons section, .....
>=20
> But they did not think long enough, because of you statement:
> "there's a need to allow insertion of a text node at any location of the=
=20
> page"
>=20
> I would create HTML pages for every section, and create a 'back one=20
> section' and a 'forward one section' button on these pages.
> (possibly with validation per section)

Interesting thought on sections, thanks, but not forward or backward.
0
justaguy
12/7/2016 1:36:11 AM
justaguy <lichunshen84@gmail.com> wrote on 07 Dec 2016 in 
comp.lang.javascript:

>> I would create HTML pages for every section, and create a 'back one 
>> section' and a 'forward one section' button on these pages.
>> (possibly with validation per section)
> 
> Interesting thought on sections, thanks, but not forward or backward.

Don't start with thinking in sections, 
but think what comes natural to the viewer/user
and what he or she is accustomed to the html-web world.

Pages with forward, backward and a menu is what comes natural, imho, 
to the user and to the html-programmer.

Texts magically appearing and disappearing at the most unexpected places
only pleases the ultra-religious mind.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
Evertjan
12/7/2016 10:10:54 AM
justaguy <lichunshen84@gmail.com> writes:
>                           there's a need to allow insertion
>of a text node at any location of the page. 

  You want an HTML editor in JavaScript?

  You can just license such a beast from
  someone I guess.

  If you want to write one yourself, you
  can study the source code of existing
  editors.

  A simple, yet not elegant, approach might 
  be to convert an element containing the 
  position to HTML source code, modify this,
  converted it back to an element and then
  replace the old element with the new one,

0
ram
12/7/2016 2:36:42 PM
Stefan Ram wrote:

> justaguy <lichunshen84@gmail.com> writes:
>>                           there's a need to allow insertion
>>of a text node at any location of the page.
> 
>   You want an HTML editor in JavaScript?
> 
>   You can just license such a beast from
>   someone I guess.
> 
>   If you want to write one yourself, you
>   can study the source code of existing
>   editors.
> 
>   A simple, yet not elegant, approach might
>   be to convert an element containing the
>   position to HTML source code, modify this,
>   converted it back to an element and then
>   replace the old element with the new one,

  document.body.contentEditable = true;

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
0
Thomas
12/7/2016 3:14:22 PM
On Wednesday, December 7, 2016 at 5:10:49 AM UTC-5, Evertjan. wrote:
> justaguy <> wrote on 07 Dec 2016 in 
> comp.lang.javascript:
> 
> >> I would create HTML pages for every section, and create a 'back one 
> >> section' and a 'forward one section' button on these pages.
> >> (possibly with validation per section)
> > 
> > Interesting thought on sections, thanks, but not forward or backward.
> 
> Don't start with thinking in sections, 
> but think what comes natural to the viewer/user
> and what he or she is accustomed to the html-web world.
> 
> Pages with forward, backward and a menu is what comes natural, imho, 
> to the user and to the html-programmer.
> 
> Texts magically appearing and disappearing at the most unexpected places
> only pleases the ultra-religious mind.
> 

Thanks for your input.  The HTML page in question is in essence an HTML FORM of many elements and because of its complexity, the "sections" help with clarity.  It's for certain users in the real estate industry, who understand all its elements.  

And since nothing is cut in the stone, the need to accommodate additional elements when the user wants arises.  I've solved the problem and am waiting for my client's feedback.

0
justaguy
12/7/2016 6:52:39 PM
On Wednesday, December 7, 2016 at 10:14:30 AM UTC-5, Thomas 'PointedEars' Lahn wrote:
> Stefan Ram wrote:
> 
> > justaguy <> writes:
> >>                           there's a need to allow insertion
> >>of a text node at any location of the page.
> > 
> >   You want an HTML editor in JavaScript?
> > 
> >   You can just license such a beast from
> >   someone I guess.
> > 
> >   If you want to write one yourself, you
> >   can study the source code of existing
> >   editors.
> > 
> >   A simple, yet not elegant, approach might
> >   be to convert an element containing the
> >   position to HTML source code, modify this,
> >   converted it back to an element and then
> >   replace the old element with the new one,
> 
>   document.body.contentEditable = true;
> 

I've created a text editor myself.  In this case I don't need one.  Interesting technique tho.


0
justaguy
12/7/2016 6:54:13 PM
On Wednesday, December 7, 2016 at 10:14:30 AM UTC-5, Thomas 'PointedEars' L=
ahn wrote:
> Stefan Ram wrote:
>=20
> > justaguy <> writes:
> >>                           there's a need to allow insertion
> >>of a text node at any location of the page.
> >=20
> >   You want an HTML editor in JavaScript?
> >=20
> >   You can just license such a beast from
> >   someone I guess.
> >=20
> >   If you want to write one yourself, you
> >   can study the source code of existing
> >   editors.
> >=20
> >   A simple, yet not elegant, approach might
> >   be to convert an element containing the
> >   position to HTML source code, modify this,
> >   converted it back to an element and then
> >   replace the old element with the new one,
>=20
>   document.body.contentEditable =3D true;
>=20

Interesting concept.  Chrome version 54 is able to let a user to remove any=
 text on the page but not FORM elements like INPUT box or I don't know how =
to at the quick glance; with Firefox verison 50, it considers an element as=
 an object, easier to remove.  Good to know, thanks.

0
justaguy
12/7/2016 7:06:00 PM
Reply: