+ ns.init_text_editor = function(element) {
+ var layouts = {
+ all: [ [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript' ], [ 'BulletedList', 'NumberedList' ], [ 'RemoveFormat' ] ],
+ default: [ [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript' ], [ 'BulletedList', 'NumberedList' ], [ 'RemoveFormat' ] ]
+ };
+
+ var $e = $(element);
+ var buttons = layouts[ $e.data('texteditor-layout') || 'default' ] || layouts['default'];
+ var config = {
+ entities: false,
+ language: 'de',
+ removePlugins: 'resize',
+ toolbar: buttons
+ }
+
+ var style = $e.prop('style');
+ $(['width', 'height']).each(function(idx, prop) {
+ var matches = (style[prop] || '').match(/(\d+)px/);
+ if (matches && (matches.length > 1))
+ config[prop] = matches[1];
+ });
+
+ $e.ckeditor(config);
+
+ if ($e.hasClass('texteditor-autofocus'))
+ $e.ckeditor(function() { ns.focus_ckeditor($e); });
+ };
+