From 1794320dcfdfcd19572fb1676294f9853a6bbc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 4 Dec 2017 18:55:29 +0100 Subject: Update to 4.7.3 --- sources/plugins/div/dialogs/div.js | 34 +++++++++++++++++++++++++++------- sources/plugins/div/lang/es-mx.js | 19 +++++++++++++++++++ sources/plugins/div/lang/ja.js | 4 ++-- sources/plugins/div/lang/pt.js | 4 ++-- sources/plugins/div/plugin.js | 4 ++-- 5 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 sources/plugins/div/lang/es-mx.js (limited to 'sources/plugins/div') diff --git a/sources/plugins/div/dialogs/div.js b/sources/plugins/div/dialogs/div.js index 140424f..73dde56 100644 --- a/sources/plugins/div/dialogs/div.js +++ b/sources/plugins/div/dialogs/div.js @@ -44,7 +44,7 @@ var container = editor.elementPath( element ).blockLimit; // Never consider read-only (i.e. contenteditable=false) element as - // a first div limit (#11083). + // a first div limit (http://dev.ckeditor.com/ticket/11083). if ( container.isReadOnly() ) container = container.getParent(); @@ -131,12 +131,24 @@ var ancestor, divElement; for ( i = 0; i < blockGroups.length; i++ ) { + // Sometimes we could get empty block group if all elements inside it + // don't have parent's nodes (http://dev.ckeditor.com/ticket/13585). + if ( !blockGroups[ i ].length ) { + continue; + } + var currentNode = blockGroups[ i ][ 0 ]; // Calculate the common parent node of all contained elements. ancestor = currentNode.getParent(); - for ( j = 1; j < blockGroups[ i ].length; j++ ) + for ( j = 1; j < blockGroups[ i ].length; j++ ) { ancestor = ancestor.getCommonAncestor( blockGroups[ i ][ j ] ); + } + + // If there is no ancestor, mark editable as one (http://dev.ckeditor.com/ticket/13585). + if ( !ancestor ) { + ancestor = editor.editable(); + } divElement = new CKEDITOR.dom.element( 'div', editor.document ); @@ -144,8 +156,10 @@ for ( j = 0; j < blockGroups[ i ].length; j++ ) { currentNode = blockGroups[ i ][ j ]; - while ( !currentNode.getParent().equals( ancestor ) ) + // Check if the currentNode has a parent before attempting to operate on it (http://dev.ckeditor.com/ticket/13585). + while ( currentNode.getParent() && !currentNode.getParent().equals( ancestor ) ) { currentNode = currentNode.getParent(); + } // This could introduce some duplicated elements in array. blockGroups[ i ][ j ] = currentNode; @@ -160,8 +174,9 @@ currentNode.is && CKEDITOR.dom.element.setMarker( database, currentNode, 'block_processed', true ); // Establish new container, wrapping all elements in this group. - if ( !j ) + if ( !j ) { divElement.insertBefore( currentNode ); + } divElement.append( currentNode ); } @@ -192,8 +207,13 @@ lastDivLimit = limit; groups.push( [] ); } - groups[ groups.length - 1 ].push( block ); + + // Sometimes we got nodes that are not inside the DOM, which causes error (http://dev.ckeditor.com/ticket/13585). + if ( block.getParent() ) { + groups[ groups.length - 1 ].push( block ); + } } + return groups; } @@ -368,7 +388,7 @@ // it if no options are available at all. stylesField[ stylesField.items.length > 1 ? 'enable' : 'disable' ](); - // Now setup the field value manually if dialog was opened on element. (#9689) + // Now setup the field value manually if dialog was opened on element. (http://dev.ckeditor.com/ticket/9689) setTimeout( function() { dialog._element && stylesField.setup( dialog._element ); }, 0 ); @@ -402,7 +422,7 @@ this.hide(); }, onHide: function() { - // Remove style only when editing existing DIV. (#6315) + // Remove style only when editing existing DIV. (http://dev.ckeditor.com/ticket/6315) if ( command == 'editdiv' ) this._element.removeCustomData( 'elementStyle' ); delete this._element; diff --git a/sources/plugins/div/lang/es-mx.js b/sources/plugins/div/lang/es-mx.js new file mode 100644 index 0000000..f3ef630 --- /dev/null +++ b/sources/plugins/div/lang/es-mx.js @@ -0,0 +1,19 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'div', 'es-mx', { + IdInputLabel: 'Id', + advisoryTitleInputLabel: 'Título del anuncio', + cssClassInputLabel: 'Clases de la hoja de estilos', + edit: 'Editar Div', + inlineStyleInputLabel: 'Estilo de línea', + langDirLTRLabel: 'Izquierda a Derecha (LTR)', + langDirLabel: 'Dirección de idiomas', + langDirRTLLabel: 'Derecha a Izquierda (RTL)', + languageCodeInputLabel: 'Código del idioma', + remove: 'Remover Div', + styleSelectLabel: 'Estilo', + title: 'Crear contenedor Div', + toolbar: 'Crear contenedor Div' +} ); diff --git a/sources/plugins/div/lang/ja.js b/sources/plugins/div/lang/ja.js index 50abe05..263326e 100644 --- a/sources/plugins/div/lang/ja.js +++ b/sources/plugins/div/lang/ja.js @@ -14,6 +14,6 @@ CKEDITOR.plugins.setLang( 'div', 'ja', { languageCodeInputLabel: ' 言語コード', remove: 'Divコンテナを削除', styleSelectLabel: 'スタイル', - title: 'Divコンテナ', - toolbar: 'Divコンテナ' + title: 'Divコンテナを作成', + toolbar: 'Divコンテナを作成' } ); diff --git a/sources/plugins/div/lang/pt.js b/sources/plugins/div/lang/pt.js index 5df020c..554e2c4 100644 --- a/sources/plugins/div/lang/pt.js +++ b/sources/plugins/div/lang/pt.js @@ -7,11 +7,11 @@ CKEDITOR.plugins.setLang( 'div', 'pt', { advisoryTitleInputLabel: 'Título', cssClassInputLabel: 'Classes de folhas de estilo', edit: 'Editar Div', - inlineStyleInputLabel: 'Estilho em Linha', + inlineStyleInputLabel: 'Estilo na etiqueta', langDirLTRLabel: 'Esquerda para a direita (EPD)', langDirLabel: 'Orientação de idioma', langDirRTLLabel: 'Direita para a Esquerda (DPE)', - languageCodeInputLabel: 'Codigo do Idioma', + languageCodeInputLabel: 'Código do idioma', remove: 'Remover Div', styleSelectLabel: 'Estilo', title: 'Criar Div', diff --git a/sources/plugins/div/plugin.js b/sources/plugins/div/plugin.js index dbced72..a64d9e9 100644 --- a/sources/plugins/div/plugin.js +++ b/sources/plugins/div/plugin.js @@ -12,7 +12,7 @@ CKEDITOR.plugins.add( 'div', { requires: 'dialog', // jscs:disable maximumLineLength - lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% // jscs:enable maximumLineLength icons: 'creatediv', // %REMOVE_LINE_CORE% hidpi: true, // %REMOVE_LINE_CORE% @@ -126,7 +126,7 @@ getSurroundDiv: function( editor, start ) { var path = editor.elementPath( start ); return editor.elementPath( path.blockLimit ).contains( function( node ) { - // Avoid read-only (i.e. contenteditable="false") divs (#11083). + // Avoid read-only (i.e. contenteditable="false") divs (http://dev.ckeditor.com/ticket/11083). return node.is( 'div' ) && !node.isReadOnly(); }, 1 ); } -- cgit v1.2.3