Topic Closed
juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Hi Josh,

could you provide us with a possibility to hook into
/include/js/inline_edit/manage_sections.js

Sth. to modify html inside the SectionOptions AdminBoxC.

Thx

5 years ago#7647

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins
Not sure I'm understanding why you'd like a hook for the section options? Do you want to modify the attributes that are displayed? Do you want to add additional options?
5 years ago#7650

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Do you want to modify the attributes that are displayed? Do you want to add additional options?

Both.
One goal was to provide sth. like a help link/help docker with descriptions of useful theme-related classes.
Another one was to hook in sth. like a "background-builder" with the possibility to select background-images via a finder pop-up and put together some background properties.

A hook like InlineEdit_Scripts could do the job. Or calling to a plugin/theme extendible JS function. Even some sort of loaded event when the Admin Box is rendered would suffice.

/edit:
Example of a custom event:
$(document).trigger("section_options:loaded");
right after $gp.AdminBoxC(html); in line 352 of the non-minified manage_sections.js

We cound easily capture this event from out of a plugin or theme with sth. like
$(document).on("section_options:loaded", function(e) {
  /* do some jQuery DOM manipulation of the AdminBox html */
});

I'd consider custom events as a very non-obtrusive way in this case as long as no additional server-side processing is required.

 

Edited: 5 years ago#7651

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Quite a bit more than a proof-of-concept plugin: SectionHelper_0_1a.zip
Allows to build background styles with gpFinder file browsing and color picker.

Needs the custom event
$(document).trigger("section_options:loaded");
to be inserted right after $gp.AdminBoxC(html); in manage_sections.js

5 years ago#7665

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins
The section_options:loaded trigger has also been added to 4.5 beta 3. I didn't have a whole lot of time to play around with the SectionHelper, but what I saw was slick!
5 years ago#7680

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

The section_options:loaded trigger has also been added to 4.5 beta 3

Thx. I hope that the cutom event concept is sustainable. It's really convenient to use but also has a drawback. If several plugins catch the same event and (try to) do DOM manipulations on the same objects, strange things will happen.
 

I didn't have a whole lot of time to play around with the SectionHelper, but what I saw was slick!

Don't waste too much time on it - it's still a pile of bugs ;)

edit:/ ... but check out how I hijacked finder's callback to "CKEDITOR" (I had to smile myself while coding it)

Edited: 5 years ago#7682

feniweb
298 Posts

Hello J├╝rgen

I installed the plugin SectionHelper_0_1a.zip. but where you can adjust what?

5 years ago#7692

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Hi feniweb,

I installed the plugin SectionHelper_0_1a.zip. but where you can adjust what?

Currently there is not much to adjust (The Admin area is not yet active).
But when you open Section Options, there is a "Use Background Composer" button below the attributes list.
Clicking it will give you some tools for changing the background properties of that section.

But beware, it is buggy, not meant for production. Just a test case. I myself wouldn't use it yet.

Edited: 5 years ago#7694

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register