Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

кнопка постила с postila.ru #191

Closed
MilaFabio opened this issue Sep 8, 2020 · 2 comments
Closed

кнопка постила с postila.ru #191

MilaFabio opened this issue Sep 8, 2020 · 2 comments

Comments

@MilaFabio
Copy link

Может, кто подскажет, как добавить кнопку для репоста в postila.ru, чтоб было гармонично с likely?

на сайте у них (https://postila.ru/page/button) такой код:

< a href="javascript:void((function(){if(document.pnctLoadStarted)return;var%20d=document.createElement('div');d.setAttribute('id','pnctPreloader');d.setAttribute('style','position:fixed;top:0;bottom:0;left:0;right:0;z-index:100501;background-color:rgba(255,255,255,.9);padding:20px;text-align:center;font-family:helvetica;font-size:20px;font-weight:bold;');d.innerHTML='%3C%3F%3DYii%3A%3At%28%22uniprogy%22%2C+%22Loading%22%29%3F%3E...<a%20id=&quot;pnctCancelBtn&quot;%20href=&quot;#&quot;%20style=&quot;float:right;width:24px;height:24px;text-decoration:none;border:1px%20solid%20#ccc;border-radius:5px&quot;>< img src=&quot;//postila.ru/images/window_close.png&quot; alt=&quot;x&quot;/></a>';document.body.appendChild(d);document.pnctLoadStarted=(new%20Date()).getTime();document.pnctCnclLoad=function(){document.pnctLoadStarted=0;pl=document.getElementById('pnctPreloader');if(pl)pl.parentNode.removeChild(pl)};document.getElementById('pnctCancelBtn').addEventListener('click',function(e){e.preventDefault();document.pnctCnclLoad()});setTimeout(function(){var%20st=document.pnctLoadStarted;if(st>0&amp;&amp;((new%20Date()).getTime()-st>=14000)){document.pnctCnclLoad();alert('%3C%3F%3DYii%3A%3At%28%22uniprogy%22%2C+%22Unfortunately%2C+the+image+search+is+not+available.%22%29%3F%3E')}},15000);var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//postila.ru/post.js?ver=1&m=b&rnd='+Math.random()*99999999);document.body.appendChild(e)})());">< img alt="" border="0" src="http://postila.ru/images/buttons/32x32.png" /></a>

@NikolayRys
Copy link
Owner

NikolayRys commented Sep 9, 2020

Hello, we plan to add support for custom buttons and a proper guide on how to do it a button in version 3.0, which will be released sometime later this year.

Here's a quick and dirty way. Place it inside the top likely block:

<div class="likely__widget" >
    <a class="likely__button" style="color:black" href="javascript:void((function(){if(document.pnctLoadStarted)return;var%20d=document.createElement('div');d.setAttribute('id','pnctPreloader');d.setAttribute('style','position:fixed;top:0;bottom:0;left:0;right:0;z-index:100501;background-color:rgba(255,255,255,.9);padding:20px;text-align:center;font-family:helvetica;font-size:20px;font-weight:bold;');d.innerHTML='%3C%3F%3DYii%3A%3At%28%22uniprogy%22%2C+%22Loading%22%29%3F%3E...<a%20id=&quot;pnctCancelBtn&quot;%20href=&quot;#&quot;%20style=&quot;float:right;width:24px;height:24px;text-decoration:none;border:1px%20solid%20#ccc;border-radius:5px&quot;><img src=&quot;//postila.ru/images/window_close.png&quot; alt=&quot;x&quot;/></a>';document.body.appendChild(d);document.pnctLoadStarted=(new%20Date()).getTime();document.pnctCnclLoad=function(){document.pnctLoadStarted=0;pl=document.getElementById('pnctPreloader');if(pl)pl.parentNode.removeChild(pl)};document.getElementById('pnctCancelBtn').addEventListener('click',function(e){e.preventDefault();document.pnctCnclLoad()});setTimeout(function(){var%20st=document.pnctLoadStarted;if(st>0&amp;&amp;((new%20Date()).getTime()-st>=14000)){document.pnctCnclLoad();alert('%3C%3F%3DYii%3A%3At%28%22uniprogy%22%2C+%22Unfortunately%2C+the+image+search+is+not+available.%22%29%3F%3E')}},15000);var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//postila.ru/post.js?ver=1&amp;m=b&amp;rnd='+Math.random()*99999999);document.body.appendChild(e)})());"><img class="likely__icon" alt="" border="0" src="http://postila.ru/images/buttons/16x16.png"> Post
</a>
</div>

Here's what I get:
image

@NikolayRys
Copy link
Owner

Closing because of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@NikolayRys @MilaFabio and others