Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
879443d0
Commit
879443d0
authored
Sep 13, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
Sep 13, 2018
Browse files
Merge "Bug 1792246: generic open in new window JS"
parents
dbcbef56
e129f687
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/js/mahara.js
View file @
879443d0
...
...
@@ -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
htdocs/lib/manualhelp.php
View file @
879443d0
...
...
@@ -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'
],
...
...
htdocs/theme/raw/templates/view/blocktypecategorylist.tpl
View file @
879443d0
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment