mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 00:37:02 +02:00
Fix issue processwire/processwire-issues#1735
This commit is contained in:
@@ -258,35 +258,39 @@ $(document).ready(function() {
|
|||||||
var extLinkIcon = 'fa-external-link';
|
var extLinkIcon = 'fa-external-link';
|
||||||
var emailIcon = 'fa-envelope-o';
|
var emailIcon = 'fa-envelope-o';
|
||||||
var anchorIcon = 'fa-flag-o';
|
var anchorIcon = 'fa-flag-o';
|
||||||
var allIcons = primaryIcon + ' ' + extLinkIcon + ' ' + emailIcon + ' ' + anchorIcon;
|
var allIcons = primaryIcon + ' ' + extLinkIcon + ' ' + emailIcon + ' ' + anchorIcon;
|
||||||
|
var extLinkClass = cfg.extLinkClass;
|
||||||
|
var extLinkClassAll = extLinkClass.replace(' ', '_');
|
||||||
|
var extLinkClasses = extLinkClass.indexOf(' ') > -1 ? extLinkClass.split(' ') : [ extLinkClass ];
|
||||||
|
var extLinkRel = cfg.extLinkRel;
|
||||||
|
var extLinkTarget = cfg.extLinkTarget;
|
||||||
|
|
||||||
if(external) {
|
if(external) {
|
||||||
if (!$this.hasClass('external-link')) {
|
if(!$this.hasClass('external-link')) {
|
||||||
icon().removeClass(allIcons).addClass(extLinkIcon);
|
icon().removeClass(allIcons).addClass(extLinkIcon);
|
||||||
$this.addClass('external-link');
|
$this.addClass('external-link');
|
||||||
var extLinkTarget = cfg.extLinkTarget;
|
if(extLinkTarget.length > 0) $("#link_target").val(extLinkTarget);
|
||||||
if(extLinkTarget.length > 0) {
|
if(extLinkRel.length > 0) $("#link_rel").val(extLinkRel);
|
||||||
$("#link_target").val(extLinkTarget);
|
if(extLinkClasses.length > 0) {
|
||||||
}
|
if(extLinkClasses.length > 1) {
|
||||||
var extLinkRel = cfg.extLinkRel;
|
|
||||||
if(extLinkRel.length > 0) {
|
|
||||||
$("#link_rel").val(extLinkRel);
|
|
||||||
}
|
|
||||||
var extLinkClass = cfg.extLinkClass;
|
|
||||||
if(extLinkClass.length > 0) {
|
|
||||||
if(extLinkClass.indexOf(' ') > -1) {
|
|
||||||
var extLinkClassAll = extLinkClass.replace(' ', '_');
|
|
||||||
$("#link_class_" + extLinkClassAll).prop('checked', true); // all classes in 1 option
|
$("#link_class_" + extLinkClassAll).prop('checked', true); // all classes in 1 option
|
||||||
extLinkClass = extLinkClass.split(' ');
|
|
||||||
}
|
}
|
||||||
for(n = 0; n < extLinkClass.length; n++) {
|
for(n = 0; n < extLinkClasses.length; n++) {
|
||||||
// $("#link_class_" + extLinkClass[n]).attr('checked', 'checked'); // JQM
|
$("#link_class_" + extLinkClasses[n]).prop('checked', true);
|
||||||
$("#link_class_" + extLinkClass[n]).prop('checked', true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this.removeClass('external-link');
|
if($this.hasClass('external-link')) {
|
||||||
|
// was previously an external link but no longer is
|
||||||
|
$this.removeClass('external-link');
|
||||||
|
if(extLinkRel.length) $('#link_rel').val('');
|
||||||
|
if(extLinkTarget.length) $('#link_target').val('');
|
||||||
|
$("#link_class_" + extLinkClassAll).prop('checked', false); // all classes in 1 option
|
||||||
|
for(n = 0; n < extLinkClasses.length; n++) {
|
||||||
|
$("#link_class_" + extLinkClasses[n]).prop('checked', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
var $icon = icon();
|
var $icon = icon();
|
||||||
if($this.hasClass('email')) {
|
if($this.hasClass('email')) {
|
||||||
if(!$icon.hasClass(emailIcon)) $icon.removeClass(allIcons).addClass(emailIcon);
|
if(!$icon.hasClass(emailIcon)) $icon.removeClass(allIcons).addClass(emailIcon);
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@ class ProcessPageEditLink extends Process implements ConfigurableModule {
|
|||||||
return array(
|
return array(
|
||||||
'title' => 'Page Edit Link',
|
'title' => 'Page Edit Link',
|
||||||
'summary' => 'Provides a link capability as used by some Fieldtype modules (like rich text editors).',
|
'summary' => 'Provides a link capability as used by some Fieldtype modules (like rich text editors).',
|
||||||
'version' => 111,
|
'version' => 112,
|
||||||
'permanent' => true,
|
'permanent' => true,
|
||||||
'permission' => 'page-edit',
|
'permission' => 'page-edit',
|
||||||
'icon' => 'link',
|
'icon' => 'link',
|
||||||
@@ -662,7 +662,7 @@ class ProcessPageEditLink extends Process implements ConfigurableModule {
|
|||||||
/** @var InputfieldFieldset $fieldset */
|
/** @var InputfieldFieldset $fieldset */
|
||||||
$fieldset = $modules->get('InputfieldFieldset');
|
$fieldset = $modules->get('InputfieldFieldset');
|
||||||
$fieldset->label = $this->_('External link attributes');
|
$fieldset->label = $this->_('External link attributes');
|
||||||
$fieldset->description = $this->_('Specify the default selected attributed that will be automatically populated when an external link is detected.');
|
$fieldset->description = $this->_('Specify the default selected attributes that will be automatically populated when an external link is detected.');
|
||||||
$fieldset->description .= ' ' . $this->_('If used, the value must be one you have predefined above.');
|
$fieldset->description .= ' ' . $this->_('If used, the value must be one you have predefined above.');
|
||||||
$fieldset->icon = 'external-link';
|
$fieldset->icon = 'external-link';
|
||||||
$fieldset->collapsed = Inputfield::collapsedBlank;
|
$fieldset->collapsed = Inputfield::collapsedBlank;
|
||||||
|
Reference in New Issue
Block a user