IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
44 | 44 | if ( ( cell = ( ancestor.getAscendant( 'td', true ) || ancestor.getAscendant( 'th', true ) ) ) ) |
45 | 45 | { |
46 | 46 | var resultRange = new CKEDITOR.dom.range( editor.document ), |
47 | | next = CKEDITOR.tools.tryThese( function() |
48 | | { |
49 | | var row = cell.getParent(), |
50 | | next = row.$.cells[ cell.$.cellIndex + ( backward ? - 1 : 1 ) ]; |
| 47 | cells, |
| 48 | next, |
| 49 | row, |
| 50 | nextRow, |
| 51 | table; |
| 52 | |
| 53 | row = cell.getParent(); |
| 54 | next = row.$.cells[ cell.$.cellIndex + ( backward ? - 1 : 1 ) ]; |
51 | 55 | |
52 | | // Invalid any empty value. |
53 | | next.parentNode.parentNode; |
54 | | return next; |
55 | | }, |
56 | | function() |
57 | | { |
58 | | var row = cell.getParent(), |
59 | | table = row.getAscendant( 'table' ), |
60 | | nextRow = table.$.rows[ row.$.rowIndex + ( backward ? - 1 : 1 ) ]; |
| 56 | if ( !next ) |
| 57 | { |
| 58 | row = cell.getParent(); |
| 59 | table = row.getAscendant( 'table' ); |
| 60 | nextRow = table.$.rows[ row.$.rowIndex + ( backward ? - 1 : 1 ) ]; |
| 61 | next = nextRow && nextRow.cells[ backward? nextRow.cells.length -1 : 0 ]; |
| 62 | } |
61 | 63 | |
62 | | return nextRow.cells[ backward? nextRow.cells.length -1 : 0 ]; |
63 | | }); |
64 | | |
65 | 64 | // Clone one more row at the end of table and select the first newly established cell. |
66 | 65 | if ( ! ( next || backward ) ) |
67 | 66 | { |
68 | | var table = cell.getAscendant( 'table' ).$, |
69 | | cells = cell.getParent().$.cells; |
| 67 | table = cell.getAscendant( 'table' ).$; |
| 68 | cells = cell.getParent().$.cells; |
70 | 69 | |
71 | 70 | var newRow = new CKEDITOR.dom.element( table.insertRow( -1 ), editor.document ); |
72 | 71 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1282 | 1282 | if ( cache.selectedElement !== undefined ) |
1283 | 1283 | return cache.selectedElement; |
1284 | 1284 | |
1285 | | var self = this; |
| 1285 | var selected; |
1286 | 1286 | |
1287 | | var node = CKEDITOR.tools.tryThese( |
1288 | | // Is it native IE control type selection? |
1289 | | function() |
1290 | | { |
1291 | | return self.getNative().createRange().item( 0 ); |
1292 | | }, |
1293 | | // If a table or list is fully selected. |
1294 | | function() |
1295 | | { |
1296 | | var root, |
1297 | | retval, |
1298 | | range = self.getRanges()[ 0 ], |
1299 | | ancestor = range.getCommonAncestor( 1, 1 ), |
1300 | | tags = { table:1,ul:1,ol:1,dl:1 }; |
| 1287 | // 1. is it native IE control type selection? |
| 1288 | if ( CKEDITOR.env.ie ) |
| 1289 | { |
| 1290 | try { selected = CKEDITOR.dom.element.get( this.getNative().createRange().item( 0 ) ) } |
| 1291 | catch ( e ) {} |
| 1292 | } |
| 1293 | |
| 1294 | // 2. if a table or list is fully selected. |
| 1295 | if ( !selected ) |
| 1296 | { |
| 1297 | var range = this.getRanges()[ 0 ]; |
| 1298 | |
| 1299 | var root, |
| 1300 | ancestor = range.getCommonAncestor( 1, 1 ), |
| 1301 | tags = { table:1,ul:1,ol:1,dl:1 }; |
1301 | 1302 | |
1302 | | for ( var t in tags ) |
1303 | | { |
1304 | | if ( ( root = ancestor.getAscendant( t, 1 ) ) ) |
1305 | | break; |
1306 | | } |
| 1303 | for ( var t in tags ) |
| 1304 | { |
| 1305 | if ( ( root = ancestor.getAscendant( t, 1 ) ) ) |
| 1306 | break; |
| 1307 | } |
1307 | 1308 | |
1308 | | if ( root ) |
1309 | | { |
1310 | | // Enlarging the start boundary. |
1311 | | var testRange = new CKEDITOR.dom.range( this.document ); |
1312 | | testRange.setStartAt( root, CKEDITOR.POSITION_AFTER_START ); |
1313 | | testRange.setEnd( range.startContainer, range.startOffset ); |
| 1309 | if ( root ) |
| 1310 | { |
| 1311 | // Enlarging the start boundary. |
| 1312 | var testRange = new CKEDITOR.dom.range( this.document ); |
| 1313 | testRange.setStartAt( root, CKEDITOR.POSITION_AFTER_START ); |
| 1314 | testRange.setEnd( range.startContainer, range.startOffset ); |
1314 | 1315 | |
1315 | | var enlargeables = CKEDITOR.tools.extend( tags, CKEDITOR.dtd.$listItem, CKEDITOR.dtd.$tableContent ), |
1316 | | walker = new CKEDITOR.dom.walker( testRange ), |
1317 | | // Check the range is at the inner boundary of the structural element. |
1318 | | guard = function( walker, isEnd ) |
1319 | | { |
1320 | | return function( node, isWalkOut ) |
1321 | | { |
1322 | | if ( node.type == CKEDITOR.NODE_TEXT && ( !CKEDITOR.tools.trim( node.getText() ) || node.getParent().data( 'cke-bookmark' ) ) ) |
1323 | | return true; |
| 1316 | var enlargeables = CKEDITOR.tools.extend( tags, CKEDITOR.dtd.$listItem, CKEDITOR.dtd.$tableContent ), |
| 1317 | walker = new CKEDITOR.dom.walker( testRange ), |
| 1318 | // Check the range is at the inner boundary of the structural element. |
| 1319 | guard = function( walker, isEnd ) |
| 1320 | { |
| 1321 | return function( node, isWalkOut ) |
| 1322 | { |
| 1323 | if ( node.type == CKEDITOR.NODE_TEXT && ( !CKEDITOR.tools.trim( node.getText() ) || node.getParent().data( 'cke-bookmark' ) ) ) |
| 1324 | return true; |
1324 | 1325 | |
1325 | | var tag; |
1326 | | if ( node.type == CKEDITOR.NODE_ELEMENT ) |
1327 | | { |
1328 | | tag = node.getName(); |
| 1326 | var tag; |
| 1327 | if ( node.type == CKEDITOR.NODE_ELEMENT ) |
| 1328 | { |
| 1329 | tag = node.getName(); |
1329 | 1330 | |
1330 | | // Bypass bogus br at the end of block. |
1331 | | if ( tag == 'br' && isEnd && node.equals( node.getParent().getBogus() ) ) |
1332 | | return true; |
| 1331 | // Bypass bogus br at the end of block. |
| 1332 | if ( tag == 'br' && isEnd && node.equals( node.getParent().getBogus() ) ) |
| 1333 | return true; |
1333 | 1334 | |
1334 | | if ( isWalkOut && tag in enlargeables || tag in CKEDITOR.dtd.$removeEmpty ) |
1335 | | return true; |
1336 | | } |
| 1335 | if ( isWalkOut && tag in enlargeables || tag in CKEDITOR.dtd.$removeEmpty ) |
| 1336 | return true; |
| 1337 | } |
1337 | 1338 | |
1338 | | walker.halted = 1; |
1339 | | return false; |
1340 | | }; |
1341 | | }; |
| 1339 | walker.halted = 1; |
| 1340 | return false; |
| 1341 | }; |
| 1342 | }; |
1342 | 1343 | |
1343 | | walker.guard = guard( walker ); |
| 1344 | walker.guard = guard( walker ); |
1344 | 1345 | |
1345 | | if ( walker.checkBackward() && !walker.halted ) |
1346 | | { |
1347 | | walker = new CKEDITOR.dom.walker( testRange ); |
1348 | | testRange.setStart( range.endContainer, range.endOffset ); |
1349 | | testRange.setEndAt( root, CKEDITOR.POSITION_BEFORE_END ); |
1350 | | walker.guard = guard( walker, 1 ); |
1351 | | if ( walker.checkForward() && !walker.halted ) |
1352 | | retval = root.$; |
1353 | | } |
1354 | | } |
| 1346 | if ( walker.checkBackward() && !walker.halted ) |
| 1347 | { |
| 1348 | walker = new CKEDITOR.dom.walker( testRange ); |
| 1349 | testRange.setStart( range.endContainer, range.endOffset ); |
| 1350 | testRange.setEndAt( root, CKEDITOR.POSITION_BEFORE_END ); |
| 1351 | walker.guard = guard( walker, 1 ); |
| 1352 | if ( walker.checkForward() && !walker.halted ) |
| 1353 | selected = root; |
| 1354 | } |
| 1355 | } |
1355 | 1356 | |
1356 | | if ( !retval ) |
1357 | | throw 0; |
1358 | | |
1359 | | return retval; |
1360 | | }, |
1361 | | // Figure it out by checking if there's a single enclosed |
1362 | | // node of the range. |
1363 | | function() |
| 1357 | // 3. figure it out by checking if there's a single enclosed node of the range. |
| 1358 | if ( !selected ) |
1364 | 1359 | { |
1365 | | var range = self.getRanges()[ 0 ], |
1366 | | enclosed, |
1367 | | selected; |
1368 | | |
| 1360 | var enclosed; |
1369 | 1361 | // Check first any enclosed element, e.g. <ul>[<li><a href="#">item</a></li>]</ul> |
1370 | 1362 | for ( var i = 2; i && !( ( enclosed = range.getEnclosedNode() ) |
1371 | 1363 | && ( enclosed.type == CKEDITOR.NODE_ELEMENT ) |
… |
… |
|
1375 | 1367 | // Then check any deep wrapped element, e.g. [<b><i><img /></i></b>] |
1376 | 1368 | range.shrink( CKEDITOR.SHRINK_ELEMENT ); |
1377 | 1369 | } |
| 1370 | } |
| 1371 | } |
1378 | 1372 | |
1379 | | return selected.$; |
1380 | | }); |
1381 | | |
1382 | | return cache.selectedElement = ( node ? new CKEDITOR.dom.element( node ) : null ); |
| 1373 | return cache.selectedElement = selected; |
1383 | 1374 | }, |
1384 | 1375 | |
1385 | 1376 | /** |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
7 | 7 | { |
8 | 8 | function getListElement( editor, listTag ) |
9 | 9 | { |
10 | | var range; |
11 | | try { range = editor.getSelection().getRanges()[ 0 ]; } |
12 | | catch( e ) { return null; } |
13 | | |
| 10 | var range = editor.getSelection().getRanges()[ 0 ]; |
14 | 11 | range.shrink( CKEDITOR.SHRINK_TEXT ); |
15 | 12 | return range.getCommonAncestor().getAscendant( listTag, 1 ); |
16 | 13 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
370 | 370 | |
371 | 371 | var current = me._.currentFocusIndex; |
372 | 372 | |
373 | | // Trigger the 'blur' event of any input element before anything, |
374 | | // since certain UI updates may depend on it. |
375 | | try |
376 | | { |
377 | | focusList[ current ].getInputElement().$.blur(); |
378 | | } |
379 | | catch( e ){} |
| 373 | if ( focusList[ current ] ) |
| 374 | { |
| 375 | // Trigger the 'blur' event of any input element before anything, |
| 376 | // since certain UI updates may depend on it. |
| 377 | try { focusList[ current ].getInputElement().$.blur(); } |
| 378 | catch( e ){} |
| 379 | } |
380 | 380 | |
381 | 381 | var startIndex = ( current + offset + focusList.length ) % focusList.length, |
382 | 382 | currentIndex = startIndex; |