Datenstand V1.0

This commit is contained in:
2016-07-05 20:38:34 +00:00
parent 5a75f609e5
commit 5ea463a308
1027 changed files with 141480 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function()
{
CKEDITOR.dialog.add( 'pastetext', function( editor )
{
return {
title : editor.lang.pasteText.title,
minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 368 : 350,
minHeight : 240,
onShow : function()
{
// Reset the textarea value.
this.getContentElement( 'general', 'content' ).getInputElement().setValue( '' );
},
onOk : function()
{
// Get the textarea value.
var text = this.getContentElement( 'general', 'content' ).getInputElement().getValue(),
editor = this.getParentEditor();
setTimeout( function()
{
editor.fire( 'paste', { 'text' : text } );
}, 0 );
},
contents :
[
{
label : editor.lang.common.generalTab,
id : 'general',
elements :
[
{
type : 'html',
id : 'pasteMsg',
html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>'
},
{
type : 'textarea',
id : 'content',
className : 'cke_pastetext',
onLoad : function()
{
var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(),
input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 );
input.setAttribute( 'aria-labelledby', label.$.id );
input.setStyle( 'direction', editor.config.contentsLangDirection );
},
focus : function()
{
this.getElement().focus();
}
}
]
}
]
};
});
})();

View File

@@ -0,0 +1,145 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @file Paste as plain text plugin
*/
(function()
{
// The pastetext command definition.
var pasteTextCmd =
{
exec : function( editor )
{
var clipboardText = CKEDITOR.tools.tryThese(
function()
{
var clipboardText = window.clipboardData.getData( 'Text' );
if ( !clipboardText )
throw 0;
return clipboardText;
}
// Any other approach that's working...
);
if ( !clipboardText ) // Clipboard access privilege is not granted.
{
editor.openDialog( 'pastetext' );
return false;
}
else
editor.fire( 'paste', { 'text' : clipboardText } );
return true;
}
};
function doInsertText( doc, text )
{
// Native text insertion.
if ( CKEDITOR.env.ie )
{
var selection = doc.selection;
if ( selection.type == 'Control' )
selection.clear();
selection.createRange().pasteHTML( text );
}
else
doc.execCommand( 'inserthtml', false, text );
}
// Register the plugin.
CKEDITOR.plugins.add( 'pastetext',
{
init : function( editor )
{
var commandName = 'pastetext',
command = editor.addCommand( commandName, pasteTextCmd );
editor.ui.addButton( 'PasteText',
{
label : editor.lang.pasteText.button,
command : commandName
});
CKEDITOR.dialog.add( commandName, CKEDITOR.getUrl( this.path + 'dialogs/pastetext.js' ) );
if ( editor.config.forcePasteAsPlainText )
{
// Intercept the default pasting process.
editor.on( 'beforeCommandExec', function ( evt )
{
if ( evt.data.name == 'paste' )
{
editor.execCommand( 'pastetext' );
evt.cancel();
}
}, null, null, 0 );
}
},
requires : [ 'clipboard' ]
});
function doEnter( editor, mode, times, forceMode )
{
while ( times-- )
{
CKEDITOR.plugins.enterkey[ mode == CKEDITOR.ENTER_BR ? 'enterBr' : 'enterBlock' ]
( editor, mode, null, forceMode );
}
}
CKEDITOR.editor.prototype.insertText = function( text )
{
this.focus();
this.fire( 'saveSnapshot' );
var mode = this.getSelection().getStartElement().hasAscendant( 'pre', true ) ? CKEDITOR.ENTER_BR : this.config.enterMode,
isEnterBrMode = mode == CKEDITOR.ENTER_BR,
doc = this.document.$,
self = this,
line;
text = CKEDITOR.tools.htmlEncode( text.replace( /\r\n|\r/g, '\n' ) );
var startIndex = 0;
text.replace( /\n+/g, function( match, lastIndex )
{
line = text.substring( startIndex, lastIndex );
startIndex = lastIndex + match.length;
line.length && doInsertText( doc, line );
var lineBreakNums = match.length,
// Duo consequence line-break as a enter block.
enterBlockTimes = isEnterBrMode ? 0 : Math.floor( lineBreakNums / 2 ),
// Per link-break as a enter br.
enterBrTimes = isEnterBrMode ? lineBreakNums : lineBreakNums % 2;
// Line-breaks are converted to editor enter key strokes.
doEnter( self, mode, enterBlockTimes );
doEnter( self, CKEDITOR.ENTER_BR, enterBrTimes, isEnterBrMode ? false : true );
});
// Insert the last text line of text.
line = text.substring( startIndex, text.length );
line.length && doInsertText( doc, line );
this.fire( 'saveSnapshot' );
};
})();
/**
* Whether to force all pasting operations to insert on plain text into the
* editor, loosing any formatting information possibly available in the source
* text.
* @name CKEDITOR.config.forcePasteAsPlainText
* @type Boolean
* @default false
* @example
* config.forcePasteAsPlainText = true;
*/