Commit 879443d0 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1792246: generic open in new window JS"

parents dbcbef56 e129f687
......@@ -1069,28 +1069,13 @@ Number.isInteger = Number.isInteger || function(value) {
};
/**
* Wire up the 'help' footer link so it opens help in a new window/tab
* Replace target=_blank with JS opener for security reasons
*/
jQuery(function($) {
if ($('#footerhelp').length > 0) {
var link = $('#footerhelp');
link.off('click');
link.on('click', function(e) {
e.stopPropagation();
e.preventDefault();
var newWnd = window;
newWnd.opener = null;
newWnd.open(link.prop('href'), '_blank');
});
}
});
$("a[target='_blank']").each(function() {
var link = $(this);
link.removeAttr('target');
/**
* Wire up the 'help' in blocks edit page so it opens help in a new window/tab
*/
jQuery(function($) {
if ($('#blockshelp').length > 0) {
var link = $('#blockshelp');
link.off('click');
link.on('click', function(e) {
e.stopPropagation();
......@@ -1099,7 +1084,7 @@ jQuery(function($) {
newWnd.opener = null;
newWnd.open(link.prop('href'), '_blank');
});
}
});
});
/**
......@@ -1111,4 +1096,4 @@ jQuery(function($) {
e.preventDefault();
$(this).next().trigger('click');
});
});
});
\ No newline at end of file
......@@ -22,7 +22,7 @@ defined('INTERNAL') || die();
function get_manual_help_link($keys) {
$data = get_manual_help_link_array($keys);
$manuallink = sprintf('<a id="footerhelp" href="%s/%s/%s/%s">' . get_string('Help') . '</a>',
$manuallink = sprintf('<a id="footerhelp" target="_blank" href="%s/%s/%s/%s">' . get_string('Help') . '</a>',
$data['prefix'],
$data['language'],
$data['version'],
......
......@@ -18,7 +18,7 @@
</div>
{/if}
{/foreach}
<a id="blockshelp" class="text-left blocktypelink btn btn-help hide-title-collapsed btn-default btn-accordion" href="{$manualhelpblock}">
<a id="blockshelp" class="text-left blocktypelink btn btn-help hide-title-collapsed btn-default btn-accordion" href="{$manualhelpblock}" target="_blank">
<span class="icon icon-question-circle-o block-icon" role="presentation" aria-hidden="true"></span>
<span class="title">{str tag=blockhelp section=view}</span>
</a>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment