We are modifying this JS handler along with nocms-admin-pages gem

We are doing this instead of working with this gem's dummy app because it's the best test case for handling nested content blocks.

Right now we can create in front a nested block, although we can't save it properly because of the elements names
Now we fix the names of nested attributes

It works!! We are saving nested blocks in nocms-admin-pages gem!
When changing a block we must keep its names, otherwise they will be not a nested block anymore
We get rid of special cases when creating a new block

If it's not a nested block then we get the name from its own layout field
Not only replacing names but also ids and fors
Bugfixing positions assignment when creating or updating blocks

Positions were calculated using nested blocks, not only siblings, and regexp for getting block names were also wrong
Toggling draft now only affects the block and it's descendants instead of all parents and their descendants
Moving buttons events were assigned wrong
Just as with hiding, delete buttons deleted all parents instead of the block
Merge branch 'features/nested-blocks'