Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
+27
-30
@@ -9,7 +9,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
|
||||
(function()
|
||||
{
|
||||
var ipsBbCodeDialog = function( editor, initVal )
|
||||
var ipsBbCodeDialog = function( editor, initVal, fromButton )
|
||||
{
|
||||
var fetchDdContents = function()
|
||||
{
|
||||
@@ -20,10 +20,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
{
|
||||
k = tag.key;
|
||||
v = tag.value;
|
||||
|
||||
arr[ arr.length ] = [ v.title, v.tag ];
|
||||
} );
|
||||
|
||||
if ( v.tag != 'xml' && v.tag != 'code' && v.tag != 'php' && v.tag != 'sql' && v.tag != 'html' )
|
||||
{
|
||||
arr[ arr.length ] = [ v.title, v.tag ];
|
||||
}
|
||||
} );
|
||||
|
||||
return arr;
|
||||
};
|
||||
|
||||
@@ -48,11 +51,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
// Handles the event when the "Type" selection box is changed.
|
||||
var bbCodeChanged = function()
|
||||
{
|
||||
var dialog = this.getDialog(),
|
||||
typeValue = this.getValue();
|
||||
var dialog = this.getDialog();
|
||||
var typeValue = this.getValue();
|
||||
|
||||
editor.config._dialog = dialog;
|
||||
|
||||
doBBCodeChange( dialog, typeValue );
|
||||
};
|
||||
|
||||
var doBBCodeChange = function( dialog, typeValue )
|
||||
{
|
||||
var tagData = fetchTagData( typeValue );
|
||||
var option = dialog.getContentElement( 'info', 'option' ).getElement();
|
||||
var content = dialog.getContentElement( 'info', 'content' ).getElement();
|
||||
@@ -62,7 +70,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
$('bbcode-description').hide();
|
||||
|
||||
if ( typeValue != 'nill' && tagData.tag )
|
||||
{
|
||||
{
|
||||
$('bbcode-description').update( tagData.desc ).show();
|
||||
|
||||
/* Show contents */
|
||||
@@ -84,37 +92,27 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
|
||||
if ( html != '' && ! Object.isUndefined( $(cid).down('textarea') ) )
|
||||
{
|
||||
$(cid).down('textarea').value = html;
|
||||
$(cid).down('textarea').hide();
|
||||
|
||||
if ( ! $('__x_insert') )
|
||||
{
|
||||
$(cid).down('textarea').up('div').insert( new Element( 'div', { id: '__x_insert' } ) );
|
||||
}
|
||||
|
||||
$('__x_insert').update( html );
|
||||
$(cid).down('textarea').value = html;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ( $('__x_insert') )
|
||||
{
|
||||
$('__x_insert').update('');
|
||||
$(cid).down('textarea').value = '';
|
||||
$(cid).down('textarea').show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
title : ipb.lang['ckeditor__bbcode'],
|
||||
minWidth : 350,
|
||||
minHeight : 140,
|
||||
onShow : function()
|
||||
{
|
||||
var element = this.getParentEditor().getSelection().getSelectedElement();
|
||||
if ( fromButton === true )
|
||||
{
|
||||
editor = this.getParentEditor();
|
||||
|
||||
if ( typeof( editor.config._dialog ) != 'undefined' )
|
||||
{
|
||||
doBBCodeChange( editor.config._dialog, initVal );
|
||||
}
|
||||
}
|
||||
},
|
||||
onOk : function()
|
||||
{
|
||||
@@ -143,7 +141,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
|
||||
if ( ourcontent.match( /\n|\r/ ) )
|
||||
{
|
||||
Debug.write('moo');
|
||||
ourcontent = ourcontent.replace( /\n|\r/g, '<br>' );
|
||||
}
|
||||
|
||||
@@ -274,7 +271,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
|
||||
if ( v.image && v.image != '' )
|
||||
{
|
||||
eval( "CKEDITOR.dialog.add( 'ipsbbcode_" + v.tag + "', function( editor ) { return ipsBbCodeDialog( editor, '" + v.tag + "' ); } );" );
|
||||
eval( "CKEDITOR.dialog.add( 'ipsbbcode_" + v.tag + "', function( editor ) { return ipsBbCodeDialog( editor, '" + v.tag + "', true ); } );" );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
Reference in new issue
Block a user