Skip to content

Commit 445ff99

Browse files
committed
Merge branch 't/12739-postfixes'
2 parents 4b039c3 + db0d95b commit 445ff99

File tree

1 file changed

+58
-71
lines changed

1 file changed

+58
-71
lines changed

tests/plugins/link/utils.js

Lines changed: 58 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,58 @@
126126
] );
127127
},
128128

129+
'test link attributes - complex (partial)': function() {
130+
var html = '<a accesskey="b" charset="i" class="h" dir="rtl" href="http://x" id="a" name="c" rel="j" style="margin-right: 0px;" target="a" title="f" type="g">foo</a>';
131+
132+
assertLink( this.editorBot, html,
133+
{
134+
type: 'url',
135+
url: {
136+
protocol: 'http://',
137+
url: 'x'
138+
},
139+
target: {
140+
type: 'frame',
141+
name: 'a'
142+
},
143+
advanced: {
144+
advId: 'a',
145+
advLangDir: 'rtl',
146+
advAccessKey: 'b',
147+
advName: 'c',
148+
advTitle: 'f',
149+
advContentType: 'g',
150+
advCSSClasses: 'h',
151+
advCharset: 'i',
152+
advStyles: 'margin-right:0px',
153+
advRel: 'j'
154+
}
155+
}, {
156+
'data-cke-saved-href': 'http://x',
157+
target: 'a',
158+
id: 'a',
159+
dir: 'rtl',
160+
accessKey: 'b',
161+
name: 'c',
162+
title: 'f',
163+
type: 'g',
164+
'class': 'h',
165+
charset: 'i',
166+
style: 'margin-right:0px',
167+
rel: 'j',
168+
'data-cke-saved-name': 'c',
169+
href: 'http://x'
170+
},
171+
[
172+
'data-cke-pa-onclick',
173+
'onclick',
174+
'lang',
175+
'tabindex'
176+
] );
177+
},
178+
129179
'test link attributes - mailto': function() {
130-
var html = '<a href="mailto:foo?subject=bar&amp;body=bam" style="text-decoration: none;" id="some_link">foo</a>';
180+
var html = '<a href="mailto:foo?subject=bar&amp;body=bam">foo</a>';
131181

132182
assertLink( this.editorBot, html,
133183
{
@@ -136,70 +186,38 @@
136186
address: 'foo',
137187
subject: 'bar',
138188
body: 'bam'
139-
},
140-
advanced: {
141-
advId: 'some_link',
142-
advStyles: 'text-decoration:none'
143189
}
144190
}, {
145191
'data-cke-saved-href': 'mailto:foo?subject=bar&body=bam',
146-
id: 'some_link',
147-
style: 'text-decoration:none',
148192
href: 'mailto:foo?subject=bar&body=bam'
149193
},
150194
[
151-
'accessKey',
152-
'charset',
153-
'class',
154195
'data-cke-pa-onclick',
155196
'data-cke-saved-name',
156-
'dir',
157-
'lang',
158-
'name',
159197
'onclick',
160-
'rel',
161-
'tabindex',
162-
'target',
163-
'title',
164-
'type'
198+
'target'
165199
] );
166200
},
167201

168202
'test link attributes - simple': function() {
169-
var html = '<a href="http://x" style="text-decoration: none;" id="some_link">foo</a>';
203+
var html = '<a href="http://x">foo</a>';
170204

171205
assertLink( this.editorBot, html,
172206
{
173207
type: 'url',
174208
url: {
175209
protocol: 'http://',
176210
url: 'x'
177-
},
178-
advanced: {
179-
advId: 'some_link',
180-
advStyles: 'text-decoration:none'
181211
}
182212
}, {
183213
'data-cke-saved-href': 'http://x',
184-
id: 'some_link',
185-
style: 'text-decoration:none',
186214
href: 'http://x'
187215
},
188216
[
189-
'accessKey',
190-
'charset',
191-
'class',
192217
'data-cke-pa-onclick',
193218
'data-cke-saved-name',
194-
'dir',
195-
'lang',
196-
'name',
197219
'onclick',
198-
'rel',
199-
'tabindex',
200-
'target',
201-
'title',
202-
'type'
220+
'target'
203221
] );
204222
},
205223

@@ -226,7 +244,7 @@
226244
},
227245

228246
'test link attributes - target popup': function() {
229-
var html = '<a href="http://foo" style="text-decoration: none;" id="some_link" onclick="window.open(this.href, \'pop\', \'resizable=yes,status=yes,location=yes,toolbar=yes,menubar=yes,' +
247+
var html = '<a href="http://foo" onclick="window.open(this.href, \'pop\', \'resizable=yes,status=yes,location=yes,toolbar=yes,menubar=yes,' +
230248
'fullscreen=yes,scrollbars=yes,dependent=yes,width=10,left=20,height=30,top=40\'); return false;">foo</a>';
231249

232250
assertLink( this.editorBot, html,
@@ -251,37 +269,22 @@
251269
left: '20',
252270
height: '30',
253271
top: '40'
254-
},
255-
advanced: {
256-
advId: 'some_link',
257-
advStyles: 'text-decoration:none'
258272
}
259273
}, {
260274
'data-cke-saved-href': 'http://foo',
261275
'data-cke-pa-onclick': 'window.open(this.href, \'pop\', \'resizable=yes,status=yes,location=yes,toolbar=yes,menubar=yes,fullscreen=yes,' +
262276
'scrollbars=yes,dependent=yes,width=10,left=20,height=30,top=40\'); return false;',
263-
id: 'some_link',
264-
style: 'text-decoration:none',
265277
href: 'http://foo'
266278
},
267279
[
268-
'accessKey',
269-
'charset',
270-
'class',
271280
'data-cke-saved-name',
272-
'dir',
273-
'lang',
274-
'name',
275281
'onclick',
276-
'rel',
277-
'tabindex',
278-
'target',
279-
'title,type'
282+
'target'
280283
] );
281284
},
282285

283286
'test link attributes - target _top': function() {
284-
var html = '<a href="http://x" target="_top" style="text-decoration: none;" id="some_link">foo</a>';
287+
var html = '<a href="http://x" target="_top">foo</a>';
285288

286289
assertLink( this.editorBot, html,
287290
{
@@ -293,32 +296,16 @@
293296
target: {
294297
type: '_top',
295298
name: '_top'
296-
},
297-
advanced: {
298-
advId: 'some_link',
299-
advStyles: 'text-decoration:none'
300299
}
301300
}, {
302301
'data-cke-saved-href': 'http://x',
303302
target: '_top',
304-
id: 'some_link',
305-
style: 'text-decoration:none',
306303
href: 'http://x'
307304
},
308305
[
309-
'accessKey',
310-
'charset',
311-
'class',
312306
'data-cke-pa-onclick',
313307
'data-cke-saved-name',
314-
'dir',
315-
'lang',
316-
'name',
317-
'onclick',
318-
'rel',
319-
'tabindex',
320-
'title',
321-
'type'
308+
'onclick'
322309
] );
323310
}
324311
} );

0 commit comments

Comments
 (0)