mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
Change scope of condition for using blankshield 4cbe598a
This commit is contained in:
parent
4cbe598a50
commit
a0f895a02f
1 changed files with 29 additions and 29 deletions
|
|
@ -338,40 +338,40 @@ jQuery(function($) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
})();
|
})();
|
||||||
if (noopenerRequired) {
|
$('a[target]').each(function() {
|
||||||
$('a[target]').each(function() {
|
var $this = $(this);
|
||||||
var $this = $(this);
|
var href = String($this.attr('href')).trim();
|
||||||
var href = String($this.attr('href')).trim();
|
var target = String($this.attr('target')).trim();
|
||||||
var target = String($this.attr('target')).trim();
|
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
return;
|
||||||
return;
|
}
|
||||||
|
if (!window.XE.isSameHost(href)) {
|
||||||
|
var rel = $this.attr('rel');
|
||||||
|
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
||||||
|
if (!rel.match(/\bnoopener\b/)) {
|
||||||
|
$this.attr('rel', $.trim(rel + ' noopener'));
|
||||||
}
|
}
|
||||||
if (!window.XE.isSameHost(href)) {
|
}
|
||||||
var rel = $this.attr('rel');
|
});
|
||||||
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
$('body').on('click', 'a[target]', function(event) {
|
||||||
if (!rel.match(/\bnoopener\b/)) {
|
var $this = $(this);
|
||||||
$this.attr('rel', $.trim(rel + ' noopener'));
|
var href = String($this.attr('href')).trim();
|
||||||
}
|
var target = String($this.attr('target')).trim();
|
||||||
|
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!window.XE.isSameHost(href)) {
|
||||||
|
var rel = $this.attr('rel');
|
||||||
|
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
||||||
|
if (!rel.match(/\bnoopener\b/)) {
|
||||||
|
$this.attr('rel', $.trim(rel + ' noopener'));
|
||||||
}
|
}
|
||||||
});
|
if (noopenerRequired) {
|
||||||
$('body').on('click', 'a[target]', function(event) {
|
|
||||||
var $this = $(this);
|
|
||||||
var href = String($this.attr('href')).trim();
|
|
||||||
var target = String($this.attr('target')).trim();
|
|
||||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!window.XE.isSameHost(href)) {
|
|
||||||
var rel = $this.attr('rel');
|
|
||||||
rel = (typeof rel === 'undefined') ? '' : String(rel);
|
|
||||||
if (!rel.match(/\bnoopener\b/)) {
|
|
||||||
$this.attr('rel', $.trim(rel + ' noopener'));
|
|
||||||
}
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
blankshield.open(href);
|
blankshield.open(href);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
/* Editor preview replacement */
|
/* Editor preview replacement */
|
||||||
$(".editable_preview").addClass("rhymix_content xe_content").attr("tabindex", 0);
|
$(".editable_preview").addClass("rhymix_content xe_content").attr("tabindex", 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue