[Plugin] Light box Article

Post plugins and custom CSS snippets here
blackdragon1
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 24 Oct 2013, 12:30

[Plugin] Light box Article

Postby blackdragon1 » 28 May 2016, 15:06

Hello, I'm trying to create a plugin that adds a button to the article and after you press it opens a light box with the rss article and/or iframe. Also this plugin will strip all text from the article leaving only images and such, hence the light box to see the full article.

I have some (probably) dumb questions:
1. Of all the hooks available isn't there one the can place the button next to the article title?
Only found HOOK_ARTICLE_BUTTON and HOOK_ARTICLE_LEFT_BUTTON.

2. How can I inside the plugin, do a get_js and get_css for more than one file?
I have my custom js and I wanted to include this as well:
http://sorgalla.com/lity/

Any help is appreciated, thanks.

blackdragon1
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 24 Oct 2013, 12:30

Re: [Plugin] Light box Article

Postby blackdragon1 » 31 May 2016, 15:26

Silly me. I keeped getting an error when using file_get_contents for my JS and that lightbox JS, because I forgot about Jquery.
So yeah, importing more than one JS and CSS was a dumb question.

Still If anyone knows if it's possible to place a button next to the article title, please do tell.

Also I need to run a JS function on every article, either by an article render or for every database fetch (hoping for this one HOOK_FEED_FETCHED). And what is the difference bettween HOOK_RENDER_ARTICLE and HOOK_RENDER_ARTICLE_CDM?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [Plugin] Light box Article

Postby fox » 31 May 2016, 15:33

CDM hook is run when the UI is in combined mode (as opposed to three panels). you should be able to manipulate the DOM hierarchy there, i think, adding buttons and stuff.

blackdragon1
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 24 Oct 2013, 12:30

Re: [Plugin] Light box Article

Postby blackdragon1 » 31 May 2016, 18:47

Turns out I don't really want a lightbox, I want to click on the article titles and not focus on the new tab. I'm gonna try some JS to that end on a new plugin.

So even if I don't want this, some people might. It's fully working, except on youtbe articles, you can find it attached.
It's based on Fox "embbed original" plugin, if you wanna compare.
Attachments
me_lightbox.rar
(3.45 KiB) Downloaded 195 times


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 1 guest