Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
- For licensing, see LICENSE.html or http://ckeditor.com/license
- Version 2012-09-20
- Site: http://www.gute-mathe-fragen.de/
- */
- CKEDITOR.editorConfig = function( config ) {
- config.language = 'de';
- config.linkShowAdvancedTab = false;
- config.linkShowTargetTab = false;
- config.height = 350;
- config.width = 680;
- // smaller editor-width for mobile devices
- if (/iPhone|iPod/i.test(navigator.userAgent)) {
- config.width = 300;
- }
- // remove font size, family, bg color from pasted text
- config.pasteFromWordRemoveFontStyles = true;
- // allow browser's spell checker
- config.disableNativeSpellChecker = false;
- // shortcuts for firefox and chrome (editor breaks if assigned in IE9)
- // if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
- if ( !(/MSIE (\d+\.\d+);/.test(navigator.userAgent)) ) {
- config.keystrokes = [
- // [ CKEDITOR.SHIFT + 45, 'pastefromword' ], //INS
- [ CKEDITOR.CTRL + 76, 'link' ], //L
- [ CKEDITOR.CTRL + CKEDITOR.ALT + 66, 'image' ], //B
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 77, 'specialchar' ], //M
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 188, 'subscript' ], //COMMA
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 109, 'subscript' ], //-
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 191, 'subscript' ], //#
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 190, 'superscript' ], //PERIOD
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 107, 'superscript' ], //+
- [ CKEDITOR.CTRL + 66, 'bold' ], //B
- [ CKEDITOR.CTRL + 73, 'italic' ], //I
- [ CKEDITOR.CTRL + 85, 'underline' ], //U
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 70, 'bold' ], //F
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 75, 'italic' ], //K
- [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85, 'underline' ], //U
- ];
- }
- };
- CKEDITOR.on( 'dialogDefinition', function( ev ) {
- // Take the dialog name and its definition from the event data.
- var dialogName = ev.data.name;
- var dialogDefinition = ev.data.definition;
- if(dialogName == 'link') {
- dialogDefinition.onShow = function () {
- var dialog = CKEDITOR.dialog.getCurrent();
- //dialog.hidePage( 'target' ); // via config
- //dialog.hidePage( 'advanced' ); // via config
- elem = dialog.getContentElement('info','anchorOptions');
- elem.getElement().hide();
- elem = dialog.getContentElement('info','emailOptions');
- elem.getElement().hide();
- var elem = dialog.getContentElement('info','linkType');
- elem.getElement().hide();
- elem = dialog.getContentElement('info','protocol');
- elem.disable();
- };
- }
- else if(dialogName == 'image') {
- // Get a reference to the 'Link Info' tab.
- var infoTab = dialogDefinition.getContents('info');
- // Remove unnecessary widgets
- infoTab.remove( 'ratioLock' );
- infoTab.remove( 'txtHeight' );
- infoTab.remove( 'txtWidth' );
- infoTab.remove( 'txtBorder');
- infoTab.remove( 'txtHSpace');
- infoTab.remove( 'txtVSpace');
- infoTab.remove( 'cmbAlign' );
- // memo: dialogDefinition.onShow = ... throws JS error (C.preview not defined)
- dialogDefinition.onLoad = function () {
- var dialog = CKEDITOR.dialog.getCurrent();
- var elem = dialog.getContentElement('info','htmlPreview');
- elem.getElement().hide();
- dialog.hidePage('Link');
- dialog.hidePage('advanced');
- this.selectPage('Upload');
- // hide on start up, prevent user input external image URLs
- // goes in onShow of image.js: dialog.hidePage('info');
- // hide ok button so that upload button can only be used
- // goes in onShow of image.js: document.getElementById(this.getButton('ok').domId).style.display='none';
- // on tab switching or automatic after upload
- this.on('selectPage', function (e) {
- // alert("Tab gewechselt");
- document.getElementById(this.getButton('ok').domId).style.display='inline';
- // after upload the selectPage is fired, show Bild-Info then
- dialog.showPage( 'info' );
- });
- };
- }
- else if(dialogName == 'table') {
- dialogDefinition.removeContents('advanced');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement