12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class OpenExternalLinkTargetPlugin extends Plugin
- {
- function onEndShowScripts($action)
- {
- $action->inlineScript('$(document).on("click", "a[rel~=external]:not([class~=attachment])", function () { window.open(this.href); return false; });');
- return true;
- }
- function onPluginVersion(array &$versions)
- {
- $versions[] = array('name' => 'OpenExternalLinkTarget',
- 'version' => GNUSOCIAL_VERSION,
- 'author' => 'Sarven Capadisli',
- 'homepage' => 'http://status.net/wiki/Plugin:OpenExternalLinkTarget',
- 'rawdescription' =>
-
- _m('Opens external links (i.e. with rel=external) on a new window or tab.'));
- return true;
- }
- }
|