X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Flink%2Fdialogs%2Flink.js;h=eac5500cc6f76bde63c959403b7c22a0576c5da2;hp=204d8639913794a98ea05cd6a5c1955a93179301;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7
diff --git a/_source/plugins/link/dialogs/link.js b/_source/plugins/link/dialogs/link.js
index 204d863..eac5500 100644
--- a/_source/plugins/link/dialogs/link.js
+++ b/_source/plugins/link/dialogs/link.js
@@ -243,9 +243,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
var item = elements.getItem( i );
if ( item.getAttribute( '_cke_realelement' ) && item.getAttribute( '_cke_real_element_type' ) == 'anchor' )
- {
anchors.push( editor.restoreRealElement( item ) );
- }
}
for ( i = 0 ; i < realAnchors.count() ; i++ )
@@ -363,27 +361,30 @@ CKEDITOR.dialog.add( 'link', function( editor )
return 'String.fromCharCode(' + encodedChars.join( ',' ) + ')';
}
+ var commonLang = editor.lang.common,
+ linkLang = editor.lang.link;
+
return {
- title : editor.lang.link.title,
+ title : linkLang.title,
minWidth : 350,
minHeight : 230,
contents : [
{
id : 'info',
- label : editor.lang.link.info,
- title : editor.lang.link.info,
+ label : linkLang.info,
+ title : linkLang.info,
elements :
[
{
id : 'linkType',
type : 'select',
- label : editor.lang.link.type,
+ label : linkLang.type,
'default' : 'url',
items :
[
- [ editor.lang.link.toUrl, 'url' ],
- [ editor.lang.link.toAnchor, 'anchor' ],
- [ editor.lang.link.toEmail, 'email' ]
+ [ linkLang.toUrl, 'url' ],
+ [ linkLang.toAnchor, 'anchor' ],
+ [ linkLang.toEmail, 'email' ]
],
onChange : linkTypeChanged,
setup : function( data )
@@ -409,7 +410,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
id : 'protocol',
type : 'select',
- label : editor.lang.common.protocol,
+ label : commonLang.protocol,
'default' : 'http://',
items :
[
@@ -418,7 +419,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[ 'https://\u200E', 'https://' ],
[ 'ftp://\u200E', 'ftp://' ],
[ 'news://\u200E', 'news://' ],
- [ editor.lang.link.other , '' ]
+ [ linkLang.other , '' ]
],
setup : function( data )
{
@@ -436,7 +437,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
id : 'url',
- label : editor.lang.common.url,
+ label : commonLang.url,
required: true,
onLoad : function ()
{
@@ -477,7 +478,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
if ( this.getDialog().fakeObj ) // Edit Anchor.
return true;
- var func = CKEDITOR.dialog.validate.notEmpty( editor.lang.link.noUrl );
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noUrl );
return func.apply( this );
},
setup : function( data )
@@ -513,7 +514,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
id : 'browse',
hidden : 'true',
filebrowser : 'info:url',
- label : editor.lang.common.browseServer
+ label : commonLang.browseServer
}
]
},
@@ -528,7 +529,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'fieldset',
id : 'selectAnchorText',
- label : editor.lang.link.selectAnchor,
+ label : linkLang.selectAnchor,
setup : function( data )
{
if ( data.anchors.length > 0 )
@@ -547,7 +548,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'select',
id : 'anchorName',
'default' : '',
- label : editor.lang.link.anchorName,
+ label : linkLang.anchorName,
style : 'width: 100%;',
items :
[
@@ -582,7 +583,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'select',
id : 'anchorId',
'default' : '',
- label : editor.lang.link.anchorId,
+ label : linkLang.anchorId,
style : 'width: 100%;',
items :
[
@@ -624,7 +625,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'html',
id : 'noAnchors',
style : 'text-align: center;',
- html : '
' + CKEDITOR.tools.htmlEncode( editor.lang.link.noAnchors ) + '
',
+ html : '' + CKEDITOR.tools.htmlEncode( linkLang.noAnchors ) + '
',
// Focus the first element defined in above html.
focus : true,
setup : function( data )
@@ -651,7 +652,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
id : 'emailAddress',
- label : editor.lang.link.emailAddress,
+ label : linkLang.emailAddress,
required : true,
validate : function()
{
@@ -661,7 +662,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
dialog.getValueOf( 'info', 'linkType' ) != 'email' )
return true;
- var func = CKEDITOR.dialog.validate.notEmpty( editor.lang.link.noEmail );
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noEmail );
return func.apply( this );
},
setup : function( data )
@@ -684,7 +685,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
id : 'emailSubject',
- label : editor.lang.link.emailSubject,
+ label : linkLang.emailSubject,
setup : function( data )
{
if ( data.email )
@@ -701,7 +702,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'textarea',
id : 'emailBody',
- label : editor.lang.link.emailBody,
+ label : linkLang.emailBody,
rows : 3,
'default' : '',
setup : function( data )
@@ -728,8 +729,8 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
id : 'target',
- label : editor.lang.link.target,
- title : editor.lang.link.target,
+ label : linkLang.target,
+ title : linkLang.target,
elements :
[
{
@@ -740,18 +741,18 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'select',
id : 'linkTargetType',
- label : editor.lang.common.target,
+ label : commonLang.target,
'default' : 'notSet',
style : 'width : 100%;',
'items' :
[
- [ editor.lang.common.notSet, 'notSet' ],
- [ editor.lang.link.targetFrame, 'frame' ],
- [ editor.lang.link.targetPopup, 'popup' ],
- [ editor.lang.common.targetNew, '_blank' ],
- [ editor.lang.common.targetTop, '_top' ],
- [ editor.lang.common.targetSelf, '_self' ],
- [ editor.lang.common.targetParent, '_parent' ]
+ [ commonLang.notSet, 'notSet' ],
+ [ linkLang.targetFrame, 'frame' ],
+ [ linkLang.targetPopup, 'popup' ],
+ [ commonLang.targetNew, '_blank' ],
+ [ commonLang.targetTop, '_top' ],
+ [ commonLang.targetSelf, '_self' ],
+ [ commonLang.targetParent, '_parent' ]
],
onChange : targetChanged,
setup : function( data )
@@ -771,7 +772,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
id : 'linkTargetName',
- label : editor.lang.link.targetFrameName,
+ label : linkLang.targetFrameName,
'default' : '',
setup : function( data )
{
@@ -798,7 +799,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[
{
type : 'fieldset',
- label : editor.lang.link.popupFeatures,
+ label : linkLang.popupFeatures,
children :
[
{
@@ -808,14 +809,14 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'resizable',
- label : editor.lang.link.popupResizable,
+ label : linkLang.popupResizable,
setup : setupPopupParams,
commit : commitPopupParams
},
{
type : 'checkbox',
id : 'status',
- label : editor.lang.link.popupStatusBar,
+ label : linkLang.popupStatusBar,
setup : setupPopupParams,
commit : commitPopupParams
@@ -829,7 +830,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'location',
- label : editor.lang.link.popupLocationBar,
+ label : linkLang.popupLocationBar,
setup : setupPopupParams,
commit : commitPopupParams
@@ -837,7 +838,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'toolbar',
- label : editor.lang.link.popupToolbar,
+ label : linkLang.popupToolbar,
setup : setupPopupParams,
commit : commitPopupParams
@@ -851,7 +852,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'menubar',
- label : editor.lang.link.popupMenuBar,
+ label : linkLang.popupMenuBar,
setup : setupPopupParams,
commit : commitPopupParams
@@ -859,7 +860,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'fullscreen',
- label : editor.lang.link.popupFullScreen,
+ label : linkLang.popupFullScreen,
setup : setupPopupParams,
commit : commitPopupParams
@@ -873,7 +874,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'scrollbars',
- label : editor.lang.link.popupScrollBars,
+ label : linkLang.popupScrollBars,
setup : setupPopupParams,
commit : commitPopupParams
@@ -881,7 +882,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'checkbox',
id : 'dependent',
- label : editor.lang.link.popupDependent,
+ label : linkLang.popupDependent,
setup : setupPopupParams,
commit : commitPopupParams
@@ -896,7 +897,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'text',
widths : [ '30%', '70%' ],
labelLayout : 'horizontal',
- label : editor.lang.link.popupWidth,
+ label : linkLang.popupWidth,
id : 'width',
setup : setupPopupParams,
commit : commitPopupParams
@@ -906,7 +907,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'text',
labelLayout : 'horizontal',
widths : [ '55%', '45%' ],
- label : editor.lang.link.popupLeft,
+ label : linkLang.popupLeft,
id : 'left',
setup : setupPopupParams,
commit : commitPopupParams
@@ -922,7 +923,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'text',
labelLayout : 'horizontal',
widths : [ '30%', '70%' ],
- label : editor.lang.link.popupHeight,
+ label : linkLang.popupHeight,
id : 'height',
setup : setupPopupParams,
commit : commitPopupParams
@@ -931,7 +932,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
labelLayout : 'horizontal',
- label : editor.lang.link.popupTop,
+ label : linkLang.popupTop,
widths : [ '55%', '45%' ],
id : 'top',
setup : setupPopupParams,
@@ -948,8 +949,8 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
id : 'upload',
- label : editor.lang.link.upload,
- title : editor.lang.link.upload,
+ label : linkLang.upload,
+ title : linkLang.upload,
hidden : true,
filebrowser : 'uploadButton',
elements :
@@ -957,14 +958,14 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'file',
id : 'upload',
- label : editor.lang.common.upload,
+ label : commonLang.upload,
style: 'height:40px',
size : 29
},
{
type : 'fileButton',
id : 'uploadButton',
- label : editor.lang.common.uploadSubmit,
+ label : commonLang.uploadSubmit,
filebrowser : 'info:url',
'for' : [ 'upload', 'upload' ]
}
@@ -972,8 +973,8 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
id : 'advanced',
- label : editor.lang.link.advanced,
- title : editor.lang.link.advanced,
+ label : linkLang.advanced,
+ title : linkLang.advanced,
elements :
[
{
@@ -989,21 +990,21 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
type : 'text',
id : 'advId',
- label : editor.lang.link.id,
+ label : linkLang.id,
setup : setupAdvParams,
commit : commitAdvParams
},
{
type : 'select',
id : 'advLangDir',
- label : editor.lang.link.langDir,
+ label : linkLang.langDir,
'default' : '',
style : 'width:110px',
items :
[
- [ editor.lang.common.notSet, '' ],
- [ editor.lang.link.langDirLTR, 'ltr' ],
- [ editor.lang.link.langDirRTL, 'rtl' ]
+ [ commonLang.notSet, '' ],
+ [ linkLang.langDirLTR, 'ltr' ],
+ [ linkLang.langDirRTL, 'rtl' ]
],
setup : setupAdvParams,
commit : commitAdvParams
@@ -1012,7 +1013,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
type : 'text',
id : 'advAccessKey',
width : '80px',
- label : editor.lang.link.acccessKey,
+ label : linkLang.acccessKey,
maxLength : 1,
setup : setupAdvParams,
commit : commitAdvParams
@@ -1027,7 +1028,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[
{
type : 'text',
- label : editor.lang.link.name,
+ label : linkLang.name,
id : 'advName',
setup : setupAdvParams,
commit : commitAdvParams
@@ -1035,7 +1036,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
type : 'text',
- label : editor.lang.link.langCode,
+ label : linkLang.langCode,
id : 'advLangCode',
width : '110px',
'default' : '',
@@ -1045,7 +1046,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
type : 'text',
- label : editor.lang.link.tabIndex,
+ label : linkLang.tabIndex,
id : 'advTabIndex',
width : '80px',
maxLength : 5,
@@ -1069,7 +1070,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[
{
type : 'text',
- label : editor.lang.link.advisoryTitle,
+ label : linkLang.advisoryTitle,
'default' : '',
id : 'advTitle',
setup : setupAdvParams,
@@ -1078,7 +1079,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
type : 'text',
- label : editor.lang.link.advisoryContentType,
+ label : linkLang.advisoryContentType,
'default' : '',
id : 'advContentType',
setup : setupAdvParams,
@@ -1094,7 +1095,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[
{
type : 'text',
- label : editor.lang.link.cssClasses,
+ label : linkLang.cssClasses,
'default' : '',
id : 'advCSSClasses',
setup : setupAdvParams,
@@ -1103,7 +1104,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
},
{
type : 'text',
- label : editor.lang.link.charset,
+ label : linkLang.charset,
'default' : '',
id : 'advCharset',
setup : setupAdvParams,
@@ -1118,7 +1119,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
[
{
type : 'text',
- label : editor.lang.link.styles,
+ label : linkLang.styles,
'default' : '',
id : 'advStyles',
setup : setupAdvParams,
@@ -1253,6 +1254,9 @@ CKEDITOR.dialog.add( 'link', function( editor )
onclickList.push( featureList.join( ',' ), '\'); return false;' );
attributes[ '_cke_pa_onclick' ] = onclickList.join( '' );
+
+ // Add the "target" attribute. (#5074)
+ removeAttributes.push( 'target' );
}
else
{
@@ -1384,7 +1388,7 @@ CKEDITOR.dialog.add( 'link', function( editor )
{
var linkType = this.getContentElement( 'info', 'linkType' ),
urlField;
- if ( linkType && linkType.getValue( ) == 'url' )
+ if ( linkType && linkType.getValue() == 'url' )
{
urlField = this.getContentElement( 'info', 'url' );
urlField.select();