2
0
Fork 0

link v0.02 - add javascript button

This commit is contained in:
ivan 2020-03-31 20:45:31 +03:00
parent 0745e70ef3
commit f1683ec755
2 changed files with 8 additions and 9 deletions

View File

@ -1,6 +0,0 @@
version: 0.01
url: $baseurl/link
requires: local_channel
name: Link
photo: icon:cog

View File

@ -2,7 +2,7 @@
/**
* Name: Link
* Description: Using short links on whole hub
* Version: 0.01
* Version: 0.02
* Depends: Core
* Recommends: None
* Author: ivan zlax <@zlax@ussr.win>
@ -11,12 +11,15 @@
namespace Zotlabs\Module;
require_once("include/bbcode.php");
require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
require_once('include/items.php');
// Javascript code for "Link on Hub" button insert - it is not good, it is temporarily
\App::$page['htmlhead'] .= "<script language=\"javascript\" type=\"text/javascript\">var windowOnloadAdd = function (event) { if ( window.onload ) { window.onload = window.onload + event; } else { window.onload = event; }; }; windowOnloadAdd(function() { let visibleitems = document.querySelectorAll('.btn-group [aria-labelledby]'); for (currentitem of visibleitems) if (currentitem.getAttribute('aria-labelledby').substr(0,15) == 'wall-item-menu-') currentitem.querySelector('[title=\"Link to Source\"]').outerHTML += '<a class=\"dropdown-item\" href=\"/link/' + currentitem.getAttribute('aria-labelledby').substr(15) + '\" title=\"Link on Hub\"><i class=\"generic-icons-nav fa fa-fw fa-external-link\"></i>Link on Hub</a>'; });</script>\n";
class Link extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
@ -450,4 +453,6 @@ class Link extends \Zotlabs\Web\Controller {
}
}
}
//App::$page['htmlhead'] .= '<script></script>';