Page 1 of 1

[Plugin] Light box Article

Posted: 28 May 2016, 15:06
by blackdragon1
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?

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:

Any help is appreciated, thanks.

Re: [Plugin] Light box Article

Posted: 31 May 2016, 15:26
by blackdragon1
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?

Re: [Plugin] Light box Article

Posted: 31 May 2016, 15:33
by fox
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.

Re: [Plugin] Light box Article

Posted: 31 May 2016, 18:47
by blackdragon1
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.