mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
CRLF to LF
This commit is contained in:
parent
4468d5bd22
commit
6e0d0b3b6e
209 changed files with 23729 additions and 22109 deletions
|
|
@ -1,55 +1,55 @@
|
|||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?89024372');
|
||||
src: url('../font/fontello.eot?89024372#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff?89024372') format('woff'),
|
||||
url('../font/fontello.ttf?89024372') format('truetype'),
|
||||
url('../font/fontello.svg?89024372#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?89024372#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: none;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-trash:before { content: '\e802'; } /* '' */
|
||||
.icon-down-big:before { content: '\e800'; } /* '' */
|
||||
.icon-up-big:before { content: '\e801'; } /* '' */
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?89024372');
|
||||
src: url('../font/fontello.eot?89024372#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff?89024372') format('woff'),
|
||||
url('../font/fontello.ttf?89024372') format('truetype'),
|
||||
url('../font/fontello.svg?89024372#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?89024372#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: none;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-trash:before { content: '\e802'; } /* '' */
|
||||
.icon-down-big:before { content: '\e800'; } /* '' */
|
||||
.icon-up-big:before { content: '\e801'; } /* '' */
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Font license info
|
||||
|
||||
|
||||
## Font Awesome
|
||||
|
||||
Copyright (C) 2012 by Dave Gandy
|
||||
|
||||
Author: Dave Gandy
|
||||
License: SIL ()
|
||||
Homepage: http://fortawesome.github.com/Font-Awesome/
|
||||
Font license info
|
||||
|
||||
|
||||
## Font Awesome
|
||||
|
||||
Copyright (C) 2012 by Dave Gandy
|
||||
|
||||
Author: Dave Gandy
|
||||
License: SIL ()
|
||||
Homepage: http://fortawesome.github.com/Font-Awesome/
|
||||
|
|
|
|||
|
|
@ -1,446 +1,446 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
-->
|
||||
<!--[if IE 8]><html class="ie8"><![endif]-->
|
||||
<!--[if gt IE 8]><html><![endif]-->
|
||||
<!--[if !IE]><!--><html><!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Toolbar Configurator</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<script>
|
||||
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
|
||||
CKEDITOR.tools.enableHtml5Elements( document );
|
||||
</script>
|
||||
<link rel="stylesheet" href="lib/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="lib/codemirror/show-hint.css">
|
||||
<link rel="stylesheet" href="lib/codemirror/neo.css">
|
||||
<link rel="stylesheet" href="css/fontello.css">
|
||||
<link rel="stylesheet" href="../css/samples.css">
|
||||
</head>
|
||||
<body id="toolbar">
|
||||
|
||||
<nav class="navigation-a">
|
||||
<div class="grid-container">
|
||||
<ul class="navigation-a-left grid-width-70">
|
||||
<li><a href="http://ckeditor.com">Project Homepage</a></li>
|
||||
<li><a href="http://dev.ckeditor.com/">I found a bug</a></li>
|
||||
<li><a href="http://github.com/ckeditor/ckeditor-dev" class="icon-pos-right icon-navigation-a-github">Fork CKEditor on GitHub</a></li>
|
||||
</ul>
|
||||
<ul class="navigation-a-right grid-width-30">
|
||||
<li><a href="http://ckeditor.com/blog-list">CKEditor Blog</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header class="header-a">
|
||||
<div class="grid-container">
|
||||
<h1 class="header-a-logo grid-width-30">
|
||||
<a href="../index.html"><img src="../img/logo.png" alt="CKEditor Logo"></a>
|
||||
</h1>
|
||||
<nav class="navigation-b grid-width-70">
|
||||
<ul>
|
||||
<li><a href="../index.html" class="button-a">Start</a></li>
|
||||
<li><a href="index.html" class="button-a button-a-background">Toolbar configurator</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="adjoined-top">
|
||||
<div class="grid-container">
|
||||
<div class="content grid-width-100">
|
||||
<div class="grid-container-nested">
|
||||
<h1 class="grid-width-60">
|
||||
Toolbar Configurator
|
||||
<a href="#help-content" type="button" title="Configurator help" id="help" class="button-a button-a-background button-a-no-text icon-pos-left icon-question-mark">Help</a>
|
||||
</h1>
|
||||
|
||||
<div class="grid-width-40 grid-switch-magic">
|
||||
<div class="switch">
|
||||
<span class="balloon-a balloon-a-se">Select configurator type</span>
|
||||
<input type="radio" name="radio" data-num="1" id="radio-basic" />
|
||||
<input type="radio" name="radio" data-num="2" id="radio-advanced" />
|
||||
<label data-for="1" for="radio-basic">Basic</label>
|
||||
<span class="switch-inner">
|
||||
<span class="handler"></span>
|
||||
</span>
|
||||
<label data-for="2" for="radio-advanced">Advanced</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adjoined-bottom">
|
||||
<div class="grid-container">
|
||||
<div class="grid-width-100">
|
||||
<div class="editors-container">
|
||||
<div id="editor-basic"></div>
|
||||
<div id="editor-advanced"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container configurator">
|
||||
<div class="content grid-width-100">
|
||||
<div class="configurator">
|
||||
<div>
|
||||
<div id="toolbarModifierWrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="help-content">
|
||||
<div class="grid-container">
|
||||
<div class="grid-width-100">
|
||||
<h2>What Am I Doing Here?</h2>
|
||||
|
||||
<div class="grid-container grid-container-nested">
|
||||
<div class="basic">
|
||||
<div class="grid-width-50">
|
||||
<p>Arrange <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbarGroups">toolbar groups</a>, toggle <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-removeButtons">button visibility</a> according to your needs and get your toolbar configuration.</p>
|
||||
<p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
|
||||
</div>
|
||||
<div class="grid-width-50">
|
||||
<p>Read more about different ways of <a href="http://docs.ckeditor.com/#!/guide/dev_configuration">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
|
||||
<p>Arranging toolbar groups is the recommended way of configuring the toolbar, but if you need more freedom you can use the <a href="#advanced">advanced configurator</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="advanced" style="display: none;">
|
||||
<div class="grid-width-50">
|
||||
<p>With this code editor you can edit your <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbar">toolbar configuration</a> live.</p>
|
||||
<p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
|
||||
</div>
|
||||
<div class="grid-width-50">
|
||||
<p>Read more about different ways of <a href="http://docs.ckeditor.com/#!/guide/dev_configuration">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="grid-container grid-container-nested">
|
||||
<button type="button" class="help-content-close grid-width-100 button-a button-a-background">Got it. Let's play!</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer-a grid-container">
|
||||
<p class="grid-width-100">
|
||||
CKEditor – The text editor for the Internet – <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
||||
</p>
|
||||
<p class="grid-width-100" id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="http://cksource.com/">CKSource</a> – Frederico Knabben. All rights reserved.
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
<script src="lib/codemirror/codemirror.js"></script>
|
||||
<script src="lib/codemirror/javascript.js"></script>
|
||||
<script src="lib/codemirror/show-hint.js"></script>
|
||||
|
||||
<script src="js/fulltoolbareditor.js"></script>
|
||||
<script src="js/abstracttoolbarmodifier.js"></script>
|
||||
<script src="js/toolbarmodifier.js"></script>
|
||||
<script src="js/toolbartextmodifier.js"></script>
|
||||
<script src="../js/sf.js"></script>
|
||||
|
||||
<script>
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
var mode = ( window.location.hash.substr( 1 ) === 'advanced' ) ? 'advanced' : 'basic',
|
||||
configuratorSection = CKEDITOR.document.findOne( 'main > .grid-container.configurator' ),
|
||||
basicInstruction = CKEDITOR.document.findOne( '#help-content .basic' ),
|
||||
advancedInstruction = CKEDITOR.document.findOne( '#help-content .advanced' ),
|
||||
|
||||
// Configurator mode switcher.
|
||||
modeSwitchBasic = CKEDITOR.document.getById( 'radio-basic' ),
|
||||
modeSwitchAdvanced = CKEDITOR.document.getById( 'radio-advanced' );
|
||||
|
||||
// Initial setup
|
||||
function updateSwitcher() {
|
||||
if ( mode === 'advanced' ) {
|
||||
modeSwitchAdvanced.$.checked = true;
|
||||
} else {
|
||||
modeSwitchBasic.$.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
updateSwitcher();
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'hashchange', function( e ) {
|
||||
var hash = window.location.hash.substr( 1 );
|
||||
if ( !( hash === 'advanced' || hash === 'basic' ) ) {
|
||||
return;
|
||||
}
|
||||
mode = hash;
|
||||
onToolbarsDone( mode );
|
||||
} );
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'resize', function() {
|
||||
updateToolbar( ( mode === 'basic' ? toolbarModifier : toolbarTextModifier )[ 'editorInstance' ] );
|
||||
} );
|
||||
|
||||
function onRefresh( modifier ) {
|
||||
modifier = modifier || this;
|
||||
|
||||
if ( mode === 'basic' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// CodeMirror container becomes visible, so we need to refresh and to avoid rendering problems.
|
||||
if ( mode === 'advanced' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
|
||||
modifier.codeContainer.refresh();
|
||||
}
|
||||
|
||||
updateToolbar( modifier.editorInstance );
|
||||
}
|
||||
|
||||
function updateToolbar( editor ) {
|
||||
var editorContainer = editor.container;
|
||||
|
||||
// Not always editor is loaded.
|
||||
if ( !editorContainer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var displayStyle = editorContainer.getStyle( 'display' );
|
||||
|
||||
editorContainer.setStyle( 'display', 'block' );
|
||||
|
||||
var newHeight = editorContainer.getSize( 'height' );
|
||||
|
||||
var newMarginTop = parseInt( editorContainer.getComputedStyle( 'margin-top' ), 10 );
|
||||
newMarginTop = ( isNaN( newMarginTop ) ? 0 : Number( newMarginTop ) );
|
||||
|
||||
var newMarginBottom = parseInt( editorContainer.getComputedStyle( 'margin-bottom' ), 10 );
|
||||
newMarginBottom = ( isNaN( newMarginBottom ) ? 0 : Number( newMarginBottom ) );
|
||||
|
||||
var result = newHeight + newMarginTop + newMarginBottom;
|
||||
|
||||
editorContainer.setStyle( 'display', displayStyle );
|
||||
|
||||
editor.container.getAscendant( 'div' ).setStyle( 'height', result + 'px' );
|
||||
}
|
||||
|
||||
var toolbarModifier = new ToolbarConfigurator.ToolbarModifier( 'editor-basic' );
|
||||
|
||||
var done = 0;
|
||||
toolbarModifier.init( onToolbarInit );
|
||||
toolbarModifier.onRefresh = onRefresh;
|
||||
|
||||
CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarModifier.mainContainer );
|
||||
|
||||
var toolbarTextModifier = new ToolbarConfigurator.ToolbarTextModifier( 'editor-advanced' );
|
||||
toolbarTextModifier.init( onToolbarInit );
|
||||
toolbarTextModifier.onRefresh = onRefresh;
|
||||
|
||||
function onToolbarInit() {
|
||||
if ( ++done === 2 ) {
|
||||
onToolbarsDone();
|
||||
|
||||
positionSticky.watch( CKEDITOR.document.findOne( '.toolbar' ), function() {
|
||||
return mode === 'advanced';
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function onToolbarsDone() {
|
||||
if ( mode === 'basic' ) {
|
||||
toggleModeBasic( false );
|
||||
} else {
|
||||
toggleModeAdvanced( false );
|
||||
}
|
||||
|
||||
updateSwitcher();
|
||||
|
||||
setTimeout( function() {
|
||||
CKEDITOR.document.findOne( '.editors-container' ).addClass( 'active' );
|
||||
CKEDITOR.document.findOne( '#toolbarModifierWrapper' ).addClass( 'active' );
|
||||
}, 200 );
|
||||
}
|
||||
|
||||
CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarTextModifier.mainContainer );
|
||||
|
||||
function toogleModeSwitch( onElement, offElement, onModifier, offModifier ) {
|
||||
onElement.addClass( 'fancy-button-active' );
|
||||
offElement.removeClass( 'fancy-button-active' );
|
||||
|
||||
onModifier.showUI();
|
||||
offModifier.hideUI();
|
||||
}
|
||||
|
||||
function toggleModeBasic( callOnRefresh ) {
|
||||
callOnRefresh = ( callOnRefresh !== false );
|
||||
mode = 'basic';
|
||||
window.location.hash = '#basic';
|
||||
toogleModeSwitch( modeSwitchBasic, modeSwitchAdvanced, toolbarModifier, toolbarTextModifier );
|
||||
|
||||
configuratorSection.removeClass( 'freed-width' );
|
||||
basicInstruction.show();
|
||||
advancedInstruction.hide();
|
||||
|
||||
callOnRefresh && onRefresh( toolbarModifier );
|
||||
}
|
||||
|
||||
function toggleModeAdvanced( callOnRefresh ) {
|
||||
callOnRefresh = ( callOnRefresh !== false );
|
||||
mode = 'advanced';
|
||||
window.location.hash = '#advanced';
|
||||
toogleModeSwitch( modeSwitchAdvanced, modeSwitchBasic, toolbarTextModifier, toolbarModifier );
|
||||
|
||||
configuratorSection.addClass( 'freed-width' );
|
||||
advancedInstruction.show();
|
||||
basicInstruction.hide();
|
||||
|
||||
callOnRefresh && onRefresh( toolbarTextModifier );
|
||||
}
|
||||
|
||||
modeSwitchBasic.on( 'click', toggleModeBasic );
|
||||
modeSwitchAdvanced.on( 'click', toggleModeAdvanced );
|
||||
|
||||
//
|
||||
// Position:sticky for the toolbar.
|
||||
//
|
||||
|
||||
// Will make elements behave like they were styled with position:sticky.
|
||||
var positionSticky = {
|
||||
// Store object: {
|
||||
// element: CKEDITOR.dom.element, // Element which will float.
|
||||
// placeholder: CKEDITOR.dom.element, // Placeholder which is place to prevent page bounce.
|
||||
// isFixed: boolean // Whether element float now.
|
||||
// }
|
||||
watched: [],
|
||||
|
||||
active: [],
|
||||
|
||||
staticContainer: null,
|
||||
|
||||
init: function() {
|
||||
var element = CKEDITOR.dom.element.createFromHtml(
|
||||
'<div class="staticContainer">' +
|
||||
'<div class="grid-container" >' +
|
||||
'<div class="grid-width-100">' +
|
||||
'<div class="inner"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' );
|
||||
|
||||
this.staticContainer = element.findOne( '.inner' );
|
||||
|
||||
CKEDITOR.document.getBody().append( element );
|
||||
},
|
||||
|
||||
watch: function( element, preventFunc ) {
|
||||
this.watched.push( {
|
||||
element: element,
|
||||
placeholder: new CKEDITOR.dom.element( 'div' ),
|
||||
isFixed: false,
|
||||
preventFunc: preventFunc
|
||||
} );
|
||||
},
|
||||
|
||||
checkAll: function() {
|
||||
for ( var i = 0; i < this.watched.length; i++ ) {
|
||||
this.check( this.watched[ i ] );
|
||||
}
|
||||
},
|
||||
|
||||
check: function( element ) {
|
||||
var isFixed = element.isFixed;
|
||||
var shouldBeFixed = this.shouldBeFixed( element );
|
||||
|
||||
// Nothing to be done.
|
||||
if ( isFixed === shouldBeFixed ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var placeholder = element.placeholder;
|
||||
|
||||
if ( isFixed ) {
|
||||
// Unfixing.
|
||||
|
||||
element.element.insertBefore( placeholder );
|
||||
placeholder.remove();
|
||||
|
||||
element.element.removeStyle( 'margin' );
|
||||
|
||||
this.active.splice( CKEDITOR.tools.indexOf( this.active, element ), 1 );
|
||||
|
||||
} else {
|
||||
// Fixing.
|
||||
placeholder.setStyle( 'width', element.element.getSize( 'width' ) + 'px' );
|
||||
placeholder.setStyle( 'height', element.element.getSize( 'height' ) + 'px' );
|
||||
placeholder.setStyle( 'margin-bottom', element.element.getComputedStyle( 'margin-bottom' ) );
|
||||
placeholder.setStyle( 'display', element.element.getComputedStyle( 'display' ) );
|
||||
placeholder.insertAfter( element.element );
|
||||
|
||||
this.staticContainer.append( element.element );
|
||||
|
||||
this.active.push( element );
|
||||
}
|
||||
|
||||
element.isFixed = !element.isFixed;
|
||||
},
|
||||
|
||||
shouldBeFixed: function( element ) {
|
||||
if ( element.preventFunc && element.preventFunc() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If element is already fixed we are checking it's placeholder.
|
||||
var related = ( element.isFixed ? element.placeholder : element.element ),
|
||||
clientRect = related.$.getBoundingClientRect(),
|
||||
staticHeight = this.staticContainer.getSize('height' ),
|
||||
elemHeight = element.element.getSize( 'height' );
|
||||
|
||||
if ( element.isFixed ) {
|
||||
return ( clientRect.top + elemHeight < staticHeight );
|
||||
} else {
|
||||
return ( clientRect.top < staticHeight );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
positionSticky.init();
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'scroll',
|
||||
new CKEDITOR.tools.eventsBuffer( 100, positionSticky.checkAll, positionSticky ).input
|
||||
);
|
||||
|
||||
// Make the toolbar sticky.
|
||||
positionSticky.watch( CKEDITOR.document.findOne( '.editors-container' ) );
|
||||
|
||||
// Help button and help-content.
|
||||
( function() {
|
||||
var helpButton = CKEDITOR.document.getById( 'help' ),
|
||||
helpContent = CKEDITOR.document.getById( 'help-content' );
|
||||
|
||||
// Don't show help button on IE8 because it's unsupported by Pico Modal.
|
||||
if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) {
|
||||
helpButton.hide();
|
||||
} else {
|
||||
// Display help modal when the button is clicked.
|
||||
helpButton.on( 'click', function( evt ) {
|
||||
SF.modal( {
|
||||
// Clone modal content from DOM.
|
||||
content: helpContent.getHtml(),
|
||||
|
||||
afterCreate: function( modal ) {
|
||||
// Enable modal content button to close the modal.
|
||||
new CKEDITOR.dom.element( modal.modalElem() ).findOne( '.help-content-close' ).once( 'click', modal.close );
|
||||
}
|
||||
} ).show();
|
||||
} );
|
||||
}
|
||||
} )();
|
||||
} )();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
-->
|
||||
<!--[if IE 8]><html class="ie8"><![endif]-->
|
||||
<!--[if gt IE 8]><html><![endif]-->
|
||||
<!--[if !IE]><!--><html><!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Toolbar Configurator</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<script>
|
||||
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
|
||||
CKEDITOR.tools.enableHtml5Elements( document );
|
||||
</script>
|
||||
<link rel="stylesheet" href="lib/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="lib/codemirror/show-hint.css">
|
||||
<link rel="stylesheet" href="lib/codemirror/neo.css">
|
||||
<link rel="stylesheet" href="css/fontello.css">
|
||||
<link rel="stylesheet" href="../css/samples.css">
|
||||
</head>
|
||||
<body id="toolbar">
|
||||
|
||||
<nav class="navigation-a">
|
||||
<div class="grid-container">
|
||||
<ul class="navigation-a-left grid-width-70">
|
||||
<li><a href="http://ckeditor.com">Project Homepage</a></li>
|
||||
<li><a href="http://dev.ckeditor.com/">I found a bug</a></li>
|
||||
<li><a href="http://github.com/ckeditor/ckeditor-dev" class="icon-pos-right icon-navigation-a-github">Fork CKEditor on GitHub</a></li>
|
||||
</ul>
|
||||
<ul class="navigation-a-right grid-width-30">
|
||||
<li><a href="http://ckeditor.com/blog-list">CKEditor Blog</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header class="header-a">
|
||||
<div class="grid-container">
|
||||
<h1 class="header-a-logo grid-width-30">
|
||||
<a href="../index.html"><img src="../img/logo.png" alt="CKEditor Logo"></a>
|
||||
</h1>
|
||||
<nav class="navigation-b grid-width-70">
|
||||
<ul>
|
||||
<li><a href="../index.html" class="button-a">Start</a></li>
|
||||
<li><a href="index.html" class="button-a button-a-background">Toolbar configurator</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="adjoined-top">
|
||||
<div class="grid-container">
|
||||
<div class="content grid-width-100">
|
||||
<div class="grid-container-nested">
|
||||
<h1 class="grid-width-60">
|
||||
Toolbar Configurator
|
||||
<a href="#help-content" type="button" title="Configurator help" id="help" class="button-a button-a-background button-a-no-text icon-pos-left icon-question-mark">Help</a>
|
||||
</h1>
|
||||
|
||||
<div class="grid-width-40 grid-switch-magic">
|
||||
<div class="switch">
|
||||
<span class="balloon-a balloon-a-se">Select configurator type</span>
|
||||
<input type="radio" name="radio" data-num="1" id="radio-basic" />
|
||||
<input type="radio" name="radio" data-num="2" id="radio-advanced" />
|
||||
<label data-for="1" for="radio-basic">Basic</label>
|
||||
<span class="switch-inner">
|
||||
<span class="handler"></span>
|
||||
</span>
|
||||
<label data-for="2" for="radio-advanced">Advanced</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adjoined-bottom">
|
||||
<div class="grid-container">
|
||||
<div class="grid-width-100">
|
||||
<div class="editors-container">
|
||||
<div id="editor-basic"></div>
|
||||
<div id="editor-advanced"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container configurator">
|
||||
<div class="content grid-width-100">
|
||||
<div class="configurator">
|
||||
<div>
|
||||
<div id="toolbarModifierWrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="help-content">
|
||||
<div class="grid-container">
|
||||
<div class="grid-width-100">
|
||||
<h2>What Am I Doing Here?</h2>
|
||||
|
||||
<div class="grid-container grid-container-nested">
|
||||
<div class="basic">
|
||||
<div class="grid-width-50">
|
||||
<p>Arrange <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbarGroups">toolbar groups</a>, toggle <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-removeButtons">button visibility</a> according to your needs and get your toolbar configuration.</p>
|
||||
<p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
|
||||
</div>
|
||||
<div class="grid-width-50">
|
||||
<p>Read more about different ways of <a href="http://docs.ckeditor.com/#!/guide/dev_configuration">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
|
||||
<p>Arranging toolbar groups is the recommended way of configuring the toolbar, but if you need more freedom you can use the <a href="#advanced">advanced configurator</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="advanced" style="display: none;">
|
||||
<div class="grid-width-50">
|
||||
<p>With this code editor you can edit your <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbar">toolbar configuration</a> live.</p>
|
||||
<p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
|
||||
</div>
|
||||
<div class="grid-width-50">
|
||||
<p>Read more about different ways of <a href="http://docs.ckeditor.com/#!/guide/dev_configuration">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="grid-container grid-container-nested">
|
||||
<button type="button" class="help-content-close grid-width-100 button-a button-a-background">Got it. Let's play!</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer-a grid-container">
|
||||
<p class="grid-width-100">
|
||||
CKEditor – The text editor for the Internet – <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
||||
</p>
|
||||
<p class="grid-width-100" id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="http://cksource.com/">CKSource</a> – Frederico Knabben. All rights reserved.
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
<script src="lib/codemirror/codemirror.js"></script>
|
||||
<script src="lib/codemirror/javascript.js"></script>
|
||||
<script src="lib/codemirror/show-hint.js"></script>
|
||||
|
||||
<script src="js/fulltoolbareditor.js"></script>
|
||||
<script src="js/abstracttoolbarmodifier.js"></script>
|
||||
<script src="js/toolbarmodifier.js"></script>
|
||||
<script src="js/toolbartextmodifier.js"></script>
|
||||
<script src="../js/sf.js"></script>
|
||||
|
||||
<script>
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
var mode = ( window.location.hash.substr( 1 ) === 'advanced' ) ? 'advanced' : 'basic',
|
||||
configuratorSection = CKEDITOR.document.findOne( 'main > .grid-container.configurator' ),
|
||||
basicInstruction = CKEDITOR.document.findOne( '#help-content .basic' ),
|
||||
advancedInstruction = CKEDITOR.document.findOne( '#help-content .advanced' ),
|
||||
|
||||
// Configurator mode switcher.
|
||||
modeSwitchBasic = CKEDITOR.document.getById( 'radio-basic' ),
|
||||
modeSwitchAdvanced = CKEDITOR.document.getById( 'radio-advanced' );
|
||||
|
||||
// Initial setup
|
||||
function updateSwitcher() {
|
||||
if ( mode === 'advanced' ) {
|
||||
modeSwitchAdvanced.$.checked = true;
|
||||
} else {
|
||||
modeSwitchBasic.$.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
updateSwitcher();
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'hashchange', function( e ) {
|
||||
var hash = window.location.hash.substr( 1 );
|
||||
if ( !( hash === 'advanced' || hash === 'basic' ) ) {
|
||||
return;
|
||||
}
|
||||
mode = hash;
|
||||
onToolbarsDone( mode );
|
||||
} );
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'resize', function() {
|
||||
updateToolbar( ( mode === 'basic' ? toolbarModifier : toolbarTextModifier )[ 'editorInstance' ] );
|
||||
} );
|
||||
|
||||
function onRefresh( modifier ) {
|
||||
modifier = modifier || this;
|
||||
|
||||
if ( mode === 'basic' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// CodeMirror container becomes visible, so we need to refresh and to avoid rendering problems.
|
||||
if ( mode === 'advanced' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
|
||||
modifier.codeContainer.refresh();
|
||||
}
|
||||
|
||||
updateToolbar( modifier.editorInstance );
|
||||
}
|
||||
|
||||
function updateToolbar( editor ) {
|
||||
var editorContainer = editor.container;
|
||||
|
||||
// Not always editor is loaded.
|
||||
if ( !editorContainer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var displayStyle = editorContainer.getStyle( 'display' );
|
||||
|
||||
editorContainer.setStyle( 'display', 'block' );
|
||||
|
||||
var newHeight = editorContainer.getSize( 'height' );
|
||||
|
||||
var newMarginTop = parseInt( editorContainer.getComputedStyle( 'margin-top' ), 10 );
|
||||
newMarginTop = ( isNaN( newMarginTop ) ? 0 : Number( newMarginTop ) );
|
||||
|
||||
var newMarginBottom = parseInt( editorContainer.getComputedStyle( 'margin-bottom' ), 10 );
|
||||
newMarginBottom = ( isNaN( newMarginBottom ) ? 0 : Number( newMarginBottom ) );
|
||||
|
||||
var result = newHeight + newMarginTop + newMarginBottom;
|
||||
|
||||
editorContainer.setStyle( 'display', displayStyle );
|
||||
|
||||
editor.container.getAscendant( 'div' ).setStyle( 'height', result + 'px' );
|
||||
}
|
||||
|
||||
var toolbarModifier = new ToolbarConfigurator.ToolbarModifier( 'editor-basic' );
|
||||
|
||||
var done = 0;
|
||||
toolbarModifier.init( onToolbarInit );
|
||||
toolbarModifier.onRefresh = onRefresh;
|
||||
|
||||
CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarModifier.mainContainer );
|
||||
|
||||
var toolbarTextModifier = new ToolbarConfigurator.ToolbarTextModifier( 'editor-advanced' );
|
||||
toolbarTextModifier.init( onToolbarInit );
|
||||
toolbarTextModifier.onRefresh = onRefresh;
|
||||
|
||||
function onToolbarInit() {
|
||||
if ( ++done === 2 ) {
|
||||
onToolbarsDone();
|
||||
|
||||
positionSticky.watch( CKEDITOR.document.findOne( '.toolbar' ), function() {
|
||||
return mode === 'advanced';
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function onToolbarsDone() {
|
||||
if ( mode === 'basic' ) {
|
||||
toggleModeBasic( false );
|
||||
} else {
|
||||
toggleModeAdvanced( false );
|
||||
}
|
||||
|
||||
updateSwitcher();
|
||||
|
||||
setTimeout( function() {
|
||||
CKEDITOR.document.findOne( '.editors-container' ).addClass( 'active' );
|
||||
CKEDITOR.document.findOne( '#toolbarModifierWrapper' ).addClass( 'active' );
|
||||
}, 200 );
|
||||
}
|
||||
|
||||
CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarTextModifier.mainContainer );
|
||||
|
||||
function toogleModeSwitch( onElement, offElement, onModifier, offModifier ) {
|
||||
onElement.addClass( 'fancy-button-active' );
|
||||
offElement.removeClass( 'fancy-button-active' );
|
||||
|
||||
onModifier.showUI();
|
||||
offModifier.hideUI();
|
||||
}
|
||||
|
||||
function toggleModeBasic( callOnRefresh ) {
|
||||
callOnRefresh = ( callOnRefresh !== false );
|
||||
mode = 'basic';
|
||||
window.location.hash = '#basic';
|
||||
toogleModeSwitch( modeSwitchBasic, modeSwitchAdvanced, toolbarModifier, toolbarTextModifier );
|
||||
|
||||
configuratorSection.removeClass( 'freed-width' );
|
||||
basicInstruction.show();
|
||||
advancedInstruction.hide();
|
||||
|
||||
callOnRefresh && onRefresh( toolbarModifier );
|
||||
}
|
||||
|
||||
function toggleModeAdvanced( callOnRefresh ) {
|
||||
callOnRefresh = ( callOnRefresh !== false );
|
||||
mode = 'advanced';
|
||||
window.location.hash = '#advanced';
|
||||
toogleModeSwitch( modeSwitchAdvanced, modeSwitchBasic, toolbarTextModifier, toolbarModifier );
|
||||
|
||||
configuratorSection.addClass( 'freed-width' );
|
||||
advancedInstruction.show();
|
||||
basicInstruction.hide();
|
||||
|
||||
callOnRefresh && onRefresh( toolbarTextModifier );
|
||||
}
|
||||
|
||||
modeSwitchBasic.on( 'click', toggleModeBasic );
|
||||
modeSwitchAdvanced.on( 'click', toggleModeAdvanced );
|
||||
|
||||
//
|
||||
// Position:sticky for the toolbar.
|
||||
//
|
||||
|
||||
// Will make elements behave like they were styled with position:sticky.
|
||||
var positionSticky = {
|
||||
// Store object: {
|
||||
// element: CKEDITOR.dom.element, // Element which will float.
|
||||
// placeholder: CKEDITOR.dom.element, // Placeholder which is place to prevent page bounce.
|
||||
// isFixed: boolean // Whether element float now.
|
||||
// }
|
||||
watched: [],
|
||||
|
||||
active: [],
|
||||
|
||||
staticContainer: null,
|
||||
|
||||
init: function() {
|
||||
var element = CKEDITOR.dom.element.createFromHtml(
|
||||
'<div class="staticContainer">' +
|
||||
'<div class="grid-container" >' +
|
||||
'<div class="grid-width-100">' +
|
||||
'<div class="inner"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' );
|
||||
|
||||
this.staticContainer = element.findOne( '.inner' );
|
||||
|
||||
CKEDITOR.document.getBody().append( element );
|
||||
},
|
||||
|
||||
watch: function( element, preventFunc ) {
|
||||
this.watched.push( {
|
||||
element: element,
|
||||
placeholder: new CKEDITOR.dom.element( 'div' ),
|
||||
isFixed: false,
|
||||
preventFunc: preventFunc
|
||||
} );
|
||||
},
|
||||
|
||||
checkAll: function() {
|
||||
for ( var i = 0; i < this.watched.length; i++ ) {
|
||||
this.check( this.watched[ i ] );
|
||||
}
|
||||
},
|
||||
|
||||
check: function( element ) {
|
||||
var isFixed = element.isFixed;
|
||||
var shouldBeFixed = this.shouldBeFixed( element );
|
||||
|
||||
// Nothing to be done.
|
||||
if ( isFixed === shouldBeFixed ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var placeholder = element.placeholder;
|
||||
|
||||
if ( isFixed ) {
|
||||
// Unfixing.
|
||||
|
||||
element.element.insertBefore( placeholder );
|
||||
placeholder.remove();
|
||||
|
||||
element.element.removeStyle( 'margin' );
|
||||
|
||||
this.active.splice( CKEDITOR.tools.indexOf( this.active, element ), 1 );
|
||||
|
||||
} else {
|
||||
// Fixing.
|
||||
placeholder.setStyle( 'width', element.element.getSize( 'width' ) + 'px' );
|
||||
placeholder.setStyle( 'height', element.element.getSize( 'height' ) + 'px' );
|
||||
placeholder.setStyle( 'margin-bottom', element.element.getComputedStyle( 'margin-bottom' ) );
|
||||
placeholder.setStyle( 'display', element.element.getComputedStyle( 'display' ) );
|
||||
placeholder.insertAfter( element.element );
|
||||
|
||||
this.staticContainer.append( element.element );
|
||||
|
||||
this.active.push( element );
|
||||
}
|
||||
|
||||
element.isFixed = !element.isFixed;
|
||||
},
|
||||
|
||||
shouldBeFixed: function( element ) {
|
||||
if ( element.preventFunc && element.preventFunc() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If element is already fixed we are checking it's placeholder.
|
||||
var related = ( element.isFixed ? element.placeholder : element.element ),
|
||||
clientRect = related.$.getBoundingClientRect(),
|
||||
staticHeight = this.staticContainer.getSize('height' ),
|
||||
elemHeight = element.element.getSize( 'height' );
|
||||
|
||||
if ( element.isFixed ) {
|
||||
return ( clientRect.top + elemHeight < staticHeight );
|
||||
} else {
|
||||
return ( clientRect.top < staticHeight );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
positionSticky.init();
|
||||
|
||||
CKEDITOR.document.getWindow().on( 'scroll',
|
||||
new CKEDITOR.tools.eventsBuffer( 100, positionSticky.checkAll, positionSticky ).input
|
||||
);
|
||||
|
||||
// Make the toolbar sticky.
|
||||
positionSticky.watch( CKEDITOR.document.findOne( '.editors-container' ) );
|
||||
|
||||
// Help button and help-content.
|
||||
( function() {
|
||||
var helpButton = CKEDITOR.document.getById( 'help' ),
|
||||
helpContent = CKEDITOR.document.getById( 'help-content' );
|
||||
|
||||
// Don't show help button on IE8 because it's unsupported by Pico Modal.
|
||||
if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) {
|
||||
helpButton.hide();
|
||||
} else {
|
||||
// Display help modal when the button is clicked.
|
||||
helpButton.on( 'click', function( evt ) {
|
||||
SF.modal( {
|
||||
// Clone modal content from DOM.
|
||||
content: helpContent.getHtml(),
|
||||
|
||||
afterCreate: function( modal ) {
|
||||
// Enable modal content button to close the modal.
|
||||
new CKEDITOR.dom.element( modal.modalElem() ).findOne( '.help-content-close' ).once( 'click', modal.close );
|
||||
}
|
||||
} ).show();
|
||||
} );
|
||||
}
|
||||
} )();
|
||||
} )();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"function"!=typeof Object.create&&function(){var a=function(){};Object.create=function(b){if(1<arguments.length)throw Error("Second argument not supported");if(null===b)throw Error("Cannot set a null [[Prototype]]");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;return new a}}();
|
||||
"function"!=typeof Object.create&&function(){var a=function(){};Object.create=function(b){if(1<arguments.length)throw Error("Second argument not supported");if(null===b)throw Error("Cannot set a null [[Prototype]]");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;return new a}}();
|
||||
CKEDITOR.plugins.add("toolbarconfiguratorarea",{afterInit:function(a){a.addMode("wysiwyg",function(b){var c=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_wysiwyg_div cke_reset" hidefocus\x3d"true"\x3e\x3c/div\x3e');a.ui.space("contents").append(c);c=a.editable(c);c.detach=CKEDITOR.tools.override(c.detach,function(b){return function(){b.apply(this,arguments);this.remove()}});a.setData(a.getData(1),b);a.fire("contentDom")});a.dataProcessor.toHtml=function(b){return b};a.dataProcessor.toDataFormat=
|
||||
function(b){return b}}});Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),e=c.length;return function(d){if("object"!==typeof d&&("function"!==typeof d||null===d))throw new TypeError("Object.keys called on non-object");var g=[],f;for(f in d)a.call(d,f)&&g.push(f);if(b)for(f=0;f<e;f++)a.call(d,c[f])&&g.push(c[f]);return g}}());
|
||||
(function(){function a(b,c){this.cfg=c||{};this.hidden=!1;this.editorId=b;this.fullToolbarEditor=new ToolbarConfigurator.FullToolbarEditor;this.actualConfig=this.originalConfig=this.mainContainer=null;this.isEditableVisible=this.waitForReady=!1;this.toolbarContainer=null;this.toolbarButtons=[]}ToolbarConfigurator.AbstractToolbarModifier=a;a.prototype.setConfig=function(b){this._onInit(void 0,b,!0)};a.prototype.init=function(b){var c=this;this.mainContainer=new CKEDITOR.dom.element("div");if(null!==
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
window.ToolbarConfigurator={};
|
||||
window.ToolbarConfigurator={};
|
||||
(function(){function e(){this.instanceid="fte"+CKEDITOR.tools.getNextId();this.textarea=new CKEDITOR.dom.element("textarea");this.textarea.setAttributes({id:this.instanceid,name:this.instanceid,contentEditable:!0});this.editorInstance=this.buttons=null}ToolbarConfigurator.FullToolbarEditor=e;e.prototype.init=function(b){var a=this;document.body.appendChild(this.textarea.$);CKEDITOR.replace(this.instanceid);this.editorInstance=CKEDITOR.instances[this.instanceid];this.editorInstance.once("configLoaded",function(d){var c=
|
||||
d.editor.config;delete c.removeButtons;delete c.toolbarGroups;delete c.toolbar;ToolbarConfigurator.AbstractToolbarModifier.extendPluginsConfig(c);d.editor.once("loaded",function(){a.buttons=e.toolbarToButtons(a.editorInstance.toolbar);a.buttonsByGroup=e.groupButtons(a.buttons);a.buttonNamesByGroup=a.groupButtonNamesByGroup(a.buttons);d.editor.container.hide();"function"===typeof b&&b(a.buttons)})})};e.prototype.groupButtonNamesByGroup=function(b){var a=this;b=e.groupButtons(b);for(var d in b)b[d]=
|
||||
e.map(b[d],function(b){return a.getCamelCasedButtonName(b.name)});return b};e.prototype.getGroupByName=function(b){for(var a=this.editorInstance.config.toolbarGroups||this.getFullToolbarGroupsConfig(),d=a.length,c=0;c<d;c+=1)if(a[c].name===b)return a[c];return null};e.prototype.getCamelCasedButtonName=function(b){var a=this.editorInstance.ui.items,d;for(d in a)if(a[d].name==b)return d;return null};e.prototype.getFullToolbarGroupsConfig=function(b){b=!0===b?!0:!1;for(var a=[],d=this.editorInstance.toolbar,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(function(){function d(a,b){l.call(this,a,b);this.actualConfig=this.originalConfig=this.removedButtons=null;this.emptyVisible=!1;this.state="edit";this.toolbarButtons=[{text:{active:"Hide empty toolbar groups",inactive:"Show empty toolbar groups"},group:"edit",position:"left",cssClass:"button-a-soft",clickCallback:function(a,b){a[a.hasClass("button-a-background")?"removeClass":"addClass"]("button-a-background");this._toggleVisibilityEmptyElements();this.emptyVisible?a.setText(b.text.active):a.setText(b.text.inactive)}},
|
||||
(function(){function d(a,b){l.call(this,a,b);this.actualConfig=this.originalConfig=this.removedButtons=null;this.emptyVisible=!1;this.state="edit";this.toolbarButtons=[{text:{active:"Hide empty toolbar groups",inactive:"Show empty toolbar groups"},group:"edit",position:"left",cssClass:"button-a-soft",clickCallback:function(a,b){a[a.hasClass("button-a-background")?"removeClass":"addClass"]("button-a-background");this._toggleVisibilityEmptyElements();this.emptyVisible?a.setText(b.text.active):a.setText(b.text.inactive)}},
|
||||
{text:"Add row separator",group:"edit",position:"left",cssClass:"button-a-soft",clickCallback:function(){this._addSeparator()}},{text:"Select config",group:"config",position:"left",cssClass:"button-a-soft",clickCallback:function(){this.configContainer.findOne("textarea").$.select()}},{text:"Back to configurator",group:"config",position:"right",cssClass:"button-a-background",clickCallback:function(){if("paste"===this.state){var a=this.configContainer.findOne("textarea").getValue();(a=d.evaluateToolbarGroupsConfig(a))?
|
||||
this.setConfig(a):alert("Your pasted config is wrong.")}this.state="edit";this._showConfigurationTool();this.showToolbarBtnsByGroupName(this.state)}},{text:'Get toolbar \x3cspan class\x3d"highlight"\x3econfig\x3c/span\x3e',group:"edit",position:"right",cssClass:"button-a-background icon-pos-left icon-download",clickCallback:function(){this.state="config";this._showConfig();this.showToolbarBtnsByGroupName(this.state)}}];this.cachedActiveElement=null}var l=ToolbarConfigurator.AbstractToolbarModifier;
|
||||
ToolbarConfigurator.ToolbarModifier=d;d.prototype=Object.create(ToolbarConfigurator.AbstractToolbarModifier.prototype);d.prototype.getActualConfig=function(){var a=l.prototype.getActualConfig.call(this);if(a.toolbarGroups)for(var b=a.toolbarGroups.length,c=0;c<b;c+=1)a.toolbarGroups[c]=d.parseGroupToConfigValue(a.toolbarGroups[c]);return a};d.prototype._onInit=function(a,b,c){c=!0===c;l.prototype._onInit.call(this,void 0,b);this.removedButtons=[];c?this.removedButtons=this.actualConfig.removeButtons?
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(function(){function e(a){l.call(this,a);this.hintContainer=this.codeContainer=null}var l=ToolbarConfigurator.AbstractToolbarModifier,g=ToolbarConfigurator.FullToolbarEditor;ToolbarConfigurator.ToolbarTextModifier=e;e.prototype=Object.create(l.prototype);e.prototype._onInit=function(a,d){l.prototype._onInit.call(this,void 0,d);this._createModifier(d?this.actualConfig:void 0);"function"===typeof a&&a(this.mainContainer)};e.prototype._createModifier=function(a){function d(a){var b=c(a);if(null!==b.charsBetween){var d=
|
||||
(function(){function e(a){l.call(this,a);this.hintContainer=this.codeContainer=null}var l=ToolbarConfigurator.AbstractToolbarModifier,g=ToolbarConfigurator.FullToolbarEditor;ToolbarConfigurator.ToolbarTextModifier=e;e.prototype=Object.create(l.prototype);e.prototype._onInit=function(a,d){l.prototype._onInit.call(this,void 0,d);this._createModifier(d?this.actualConfig:void 0);"function"===typeof a&&a(this.mainContainer)};e.prototype._createModifier=function(a){function d(a){var b=c(a);if(null!==b.charsBetween){var d=
|
||||
k.getUnusedButtonsArray(k.actualConfig.toolbar,!0,b.charsBetween),e=a.getCursor(),b=CodeMirror.Pos(e.line,e.ch-b.charsBetween.length),h=a.getTokenAt(e);"{"===a.getTokenAt({line:e.line,ch:h.start}).string&&(d=["name"]);if(0!==d.length)return new f(b,e,d)}}function f(a,c,b){this.from=a;this.to=c;this.list=b;this._handlers=[]}function c(a,c){var b={};b.cur=a.getCursor();b.tok=a.getTokenAt(b.cur);b["char"]=c||b.tok.string.charAt(b.tok.string.length-1);var d=a.getRange(CodeMirror.Pos(b.cur.line,0),b.cur).split("").reverse().join(""),
|
||||
d=d.replace(/(['|"]\w*['|"])/g,"");b.charsBetween=d.match(/(^\w*)(['|"])/);b.charsBetween&&(b.endChar=b.charsBetween[2],b.charsBetween=b.charsBetween[1].split("").reverse().join(""));return b}function b(a){setTimeout(function(){a.state.completionActive||CodeMirror.showHint(a,d,{hintsClass:"toolbar-modifier",completeSingle:!1})},100);return CodeMirror.Pass}var k=this;this._createToolbar();this.toolbarContainer&&this.mainContainer.append(this.toolbarContainer);l.prototype._createModifier.call(this);
|
||||
this._setupActualConfig(a);a=this.actualConfig.toolbar;a=CKEDITOR.tools.isArray(a)?"\tconfig.toolbar \x3d "+("[\n\t\t"+g.map(a,function(a){return l.stringifyJSONintoOneLine(a,{addSpaces:!0,noQuotesOnKey:!0,singleQuotes:!0})}).join(",\n\t\t")+"\n\t]")+";":"config.toolbar \x3d [];";a=["CKEDITOR.editorConfig \x3d function( config ) {\n",a,"\n};"].join("");var e=new CKEDITOR.dom.element("div");e.addClass("codemirror-wrapper");this.modifyContainer.append(e);this.codeContainer=CodeMirror(e.$,{mode:{name:"javascript",
|
||||
|
|
|
|||
|
|
@ -1,325 +1,325 @@
|
|||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
}
|
||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
}
|
||||
@-moz-keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
@-webkit-keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
@keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 30px solid transparent;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
margin-bottom: -30px;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
*display:inline;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
height: 100%;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px; /* prevents collapsing before first draw */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Force content-box sizing for the elements where we expect it */
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror ::selection { background: #d7d4f0; }
|
||||
.CodeMirror ::-moz-selection { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
}
|
||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
}
|
||||
@-moz-keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
@-webkit-keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
@keyframes blink {
|
||||
0% { background: #7e7; }
|
||||
50% { background: none; }
|
||||
100% { background: #7e7; }
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 30px solid transparent;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
margin-bottom: -30px;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
*display:inline;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
height: 100%;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px; /* prevents collapsing before first draw */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Force content-box sizing for the elements where we expect it */
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror ::selection { background: #d7d4f0; }
|
||||
.CodeMirror ::-moz-selection { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(function(q){if("object"==typeof exports&&"object"==typeof module)module.exports=q();else{if("function"==typeof define&&define.amd)return define([],q);this.CodeMirror=q()}})(function(){function q(a,b){if(!(this instanceof q))return new q(a,b);this.options=b=b?V(b):{};V(qf,b,!1);wc(b);var c=b.value;"string"==typeof c&&(c=new P(c,b.mode));this.doc=c;var d=new q.inputStyles[b.inputStyle](this),d=this.display=new rf(a,c,d);d.wrapper.CodeMirror=this;Ad(this);Bd(this);b.lineWrapping&&(this.display.wrapper.className+=
|
||||
(function(q){if("object"==typeof exports&&"object"==typeof module)module.exports=q();else{if("function"==typeof define&&define.amd)return define([],q);this.CodeMirror=q()}})(function(){function q(a,b){if(!(this instanceof q))return new q(a,b);this.options=b=b?V(b):{};V(qf,b,!1);wc(b);var c=b.value;"string"==typeof c&&(c=new P(c,b.mode));this.doc=c;var d=new q.inputStyles[b.inputStyle](this),d=this.display=new rf(a,c,d);d.wrapper.CodeMirror=this;Ad(this);Bd(this);b.lineWrapping&&(this.display.wrapper.className+=
|
||||
" CodeMirror-wrap");b.autofocus&&!ab&&d.input.focus();Cd(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new bb,keySeq:null,specialChars:null};var e=this;B&&11>C&&setTimeout(function(){e.display.input.reset(!0)},20);sf(this);Dd||(tf(),Dd=!0);Ja(this);this.curOp.forceUpdate=!0;Ed(this,c);b.autofocus&&!ab||e.hasFocus()?setTimeout(cb(xc,this),20):db(this);for(var f in Ka)if(Ka.hasOwnProperty(f))Ka[f](this,
|
||||
b[f],Fd);Gd(this);b.finishInit&&b.finishInit(this);for(c=0;c<yc.length;++c)yc[c](this);La(this);J&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(d.lineDiv).textRendering&&(d.lineDiv.style.textRendering="auto")}function rf(a,b,c){this.input=c;this.scrollbarFiller=t("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=t("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=
|
||||
t("div",null,"CodeMirror-code");this.selectionDiv=t("div",null,null,"position: relative; z-index: 1");this.cursorDiv=t("div",null,"CodeMirror-cursors");this.measure=t("div",null,"CodeMirror-measure");this.lineMeasure=t("div",null,"CodeMirror-measure");this.lineSpace=t("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");this.mover=t("div",[t("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=t("div",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(function(p){"object"==typeof exports&&"object"==typeof module?p(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],p):p(CodeMirror)})(function(p){p.defineMode("javascript",function(oa,t){function q(a,c,e){E=a;I=e;return c}function w(a,c){var e=a.next();if('"'==e||"'"==e)return c.tokenize=pa(e),c.tokenize(a,c);if("."==e&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return q("number","number");if("."==e&&a.match(".."))return q("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(e))return q(e);
|
||||
(function(p){"object"==typeof exports&&"object"==typeof module?p(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],p):p(CodeMirror)})(function(p){p.defineMode("javascript",function(oa,t){function q(a,c,e){E=a;I=e;return c}function w(a,c){var e=a.next();if('"'==e||"'"==e)return c.tokenize=pa(e),c.tokenize(a,c);if("."==e&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return q("number","number");if("."==e&&a.match(".."))return q("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(e))return q(e);
|
||||
if("\x3d"==e&&a.eat("\x3e"))return q("\x3d\x3e","operator");if("0"==e&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),q("number","number");if(/\d/.test(e))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),q("number","number");if("/"==e){if(a.eat("*"))return c.tokenize=J,J(a,c);if(a.eat("/"))return a.skipToEnd(),q("comment","comment");if("operator"==c.lastType||"keyword c"==c.lastType||"sof"==c.lastType||/^[\[{}\(,;:]$/.test(c.lastType)){a:for(var e=!1,d,b=!1;null!=(d=a.next());){if(!e){if("/"==d&&!b)break a;
|
||||
"["==d?b=!0:b&&"]"==d&&(b=!1)}e=!e&&"\\"==d}a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return q("regexp","string-2")}a.eatWhile(K);return q("operator","operator",a.current())}if("`"==e)return c.tokenize=Q,Q(a,c);if("#"==e)return a.skipToEnd(),q("error","error");if(K.test(e))return a.eatWhile(K),q("operator","operator",a.current());if(R.test(e))return a.eatWhile(R),e=a.current(),(d=ba.propertyIsEnumerable(e)&&ba[e])&&"."!=c.lastType?q(d.type,d.style,e):q("variable","variable",e)}function pa(a){return function(c,
|
||||
e){var d=!1,b;if(L&&"@"==c.peek()&&c.match(qa))return e.tokenize=w,q("jsonld-keyword","meta");for(;null!=(b=c.next())&&(b!=a||d);)d=!d&&"\\"==b;d||(e.tokenize=w);return q("string","string")}}function J(a,c){for(var e=!1,d;d=a.next();){if("/"==d&&e){c.tokenize=w;break}e="*"==d}return q("comment","comment")}function Q(a,c){for(var e=!1,d;null!=(d=a.next());){if(!e&&("`"==d||"$"==d&&a.eat("{"))){c.tokenize=w;break}e=!e&&"\\"==d}return q("quasi","string-2",a.current())}function S(a,c){c.fatArrowAt&&(c.fatArrowAt=
|
||||
|
|
|
|||
|
|
@ -1,36 +1,36 @@
|
|||
/* neo theme for codemirror */
|
||||
|
||||
/* Color scheme */
|
||||
|
||||
.cm-s-neo.CodeMirror {
|
||||
background-color:#ffffff;
|
||||
color:#2e383c;
|
||||
line-height:1.4375;
|
||||
}
|
||||
.cm-s-neo .cm-comment {color:#75787b}
|
||||
.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3}
|
||||
.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a}
|
||||
.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328}
|
||||
.cm-s-neo .cm-string {color:#b35e14}
|
||||
.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65}
|
||||
|
||||
|
||||
/* Editor styling */
|
||||
|
||||
.cm-s-neo pre {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-gutters {
|
||||
border:none;
|
||||
border-right:10px solid transparent;
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-linenumber {
|
||||
padding:0;
|
||||
color:#e0e2e5;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; }
|
||||
.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; }
|
||||
/* neo theme for codemirror */
|
||||
|
||||
/* Color scheme */
|
||||
|
||||
.cm-s-neo.CodeMirror {
|
||||
background-color:#ffffff;
|
||||
color:#2e383c;
|
||||
line-height:1.4375;
|
||||
}
|
||||
.cm-s-neo .cm-comment {color:#75787b}
|
||||
.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3}
|
||||
.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a}
|
||||
.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328}
|
||||
.cm-s-neo .cm-string {color:#b35e14}
|
||||
.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65}
|
||||
|
||||
|
||||
/* Editor styling */
|
||||
|
||||
.cm-s-neo pre {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-gutters {
|
||||
border:none;
|
||||
border-right:10px solid transparent;
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-linenumber {
|
||||
padding:0;
|
||||
color:#e0e2e5;
|
||||
}
|
||||
|
||||
.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; }
|
||||
.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; }
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
.CodeMirror-hints {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
|
||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
border-radius: 3px;
|
||||
border: 1px solid silver;
|
||||
|
||||
background: white;
|
||||
font-size: 90%;
|
||||
font-family: monospace;
|
||||
|
||||
max-height: 20em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-hint {
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
border-radius: 2px;
|
||||
max-width: 19em;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li.CodeMirror-hint-active {
|
||||
background: #08f;
|
||||
color: white;
|
||||
}
|
||||
.CodeMirror-hints {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
|
||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
border-radius: 3px;
|
||||
border: 1px solid silver;
|
||||
|
||||
background: white;
|
||||
font-size: 90%;
|
||||
font-family: monospace;
|
||||
|
||||
max-height: 20em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-hint {
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
border-radius: 2px;
|
||||
max-width: 19em;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li.CodeMirror-hint-active {
|
||||
background: #08f;
|
||||
color: white;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function p(a,b){this.cm=a;this.options=this.buildOptions(b);this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor();this.startLen=this.cm.getLine(this.startPos.line).length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}function w(a,b){function c(a,
|
||||
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function p(a,b){this.cm=a;this.options=this.buildOptions(b);this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor();this.startLen=this.cm.getLine(this.startPos.line).length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}function w(a,b){function c(a,
|
||||
c){var d;d="string"!=typeof c?function(a){return c(a,b)}:e.hasOwnProperty(c)?e[c]:c;f[a]=d}var e={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},d=a.options.customKeys,f=d?{}:e;if(d)for(var g in d)d.hasOwnProperty(g)&&c(g,d[g]);if(d=a.options.extraKeys)for(g in d)d.hasOwnProperty(g)&&
|
||||
c(g,d[g]);return f}function v(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function n(a,b){this.completion=a;this.data=b;this.picked=!1;var c=this,e=a.cm,d=this.hints=document.createElement("ul");d.className="CodeMirror-hints";this.selectedHint=b.selectedHint||0;for(var m=b.list,g=0;g<m.length;++g){var l=d.appendChild(document.createElement("li")),h=m[g],k="CodeMirror-hint"+(g!=this.selectedHint?"":" CodeMirror-hint-active");null!=h.className&&(k=
|
||||
h.className+" "+k);l.className=k;h.render?h.render(l,b,h):l.appendChild(document.createTextNode(h.displayText||("string"==typeof h?h:h.text)));l.hintId=g}var g=e.cursorCoords(a.options.alignWithWord?b.from:null),r=g.left,t=g.bottom,n=!0;d.style.left=r+"px";d.style.top=t+"px";l=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth);k=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.options.container||document.body).appendChild(d);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue