-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aabfbce
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plugin_manifest> | ||
<field key="author" value="ColdTrick IT Solutions" /> | ||
<field key="version" value="1.0.3" /> | ||
<field key="description" value="Opens all external links in a new window." /> | ||
<field key="website" value="http://www.coldtrick.com/" /> | ||
<field key="copyright" value="(C) ColdTrick 2010" /> | ||
<field key="licence" value="GNU Public License version 2" /> | ||
<field key="elgg_version" value="2010040201" /> | ||
</plugin_manifest> | ||
<!-- | ||
Todo: | ||
- Add optional forwarding window (with "you are being redirected" info) | ||
- Add Preview functionality | ||
- Add new window indicator ("underline" or image) | ||
================== | ||
Version history | ||
================== | ||
1.0.3 (2011-04-22): | ||
- changed: using jquery live function to register target blank on external links | ||
1.0.2 (2011-04-21): | ||
- changed: extend view functions updated for 1.7.x | ||
- changed: moved code to js instead of metatags view | ||
- fixed: target should not override target if it is already present | ||
- fixed: support for https in external link | ||
1.0.1 (2010-07-02): | ||
- fixed: issue with href='#' (thx elggfan) | ||
- fixed: widget content will now be handled | ||
1.0 (2010-07-02): | ||
- initial version | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
function target_blank_init(){ | ||
// extend js | ||
elgg_extend_view("js/initialise_elgg", "target_blank/js"); | ||
} | ||
|
||
register_elgg_event_handler('init', 'system', 'target_blank_init'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php'); | ||
|
||
admin_gatekeeper(); | ||
|
||
$body .= "<a href='http://www.google.nl'>1</a><br/>"; | ||
$body .= "<a href='http://www.google.nl' style='display: none;'>1</a><br/>"; | ||
$body .= "<a href='https://www.google.nl'>1</a><br/>"; | ||
$body .= "<a href='http://www.google.nl' target='_self'>1</a><br/>"; | ||
$body .= "<a href='/pg/news'>1</a><br/>"; | ||
$body .= "<a href='#'>1</a><br/>"; | ||
$body .= "<a href='javascript:void(0);'>1</a><br/>"; | ||
|
||
|
||
|
||
page_draw("", $body); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
/*$external_links = $('a[href^="http://"],a[href^="https://"]').not('[target], [href^="<?php echo $vars["url"];?>"]');*/ | ||
?> | ||
$(document).ready(function(){ | ||
$external_links = $('a[href^="http://"]:not([target], [href^="<?php echo $vars["url"];?>"]), a[href^="https://"]:not([target], [href^="<?php echo $vars["url"];?>"])'); | ||
|
||
$external_links.live("click", function(){ | ||
$(this).attr("target", "_blank"); | ||
}); | ||
}); |