PageSourceSearch

https://www.mitaka.ne.jp/_common/js/ckeditor/config.js

js mitaka.ne.jp collected 2026-10-02 04:39:15 UTC 5,840 bytes, 151 lines download raw bytes

1/**
2 * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
4 */
5
6CKEDITOR.editorConfig = function( config ) {
7  // Define changes to default configuration here. For example:
8  // config.language = 'fr';
9  // config.uiColor = '#AADC6E';
10
11  config.skin = 'moono';
12  config.height = 400;
13
14  // ツールバーの設定
15  // http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.toolbar_Full
16  config.toolbar = [
17    { name: 'clipboard',   items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
18    { name: 'styles',      items : [ 'Format','FontSize','Styles' ] },
19    { name: 'insert',      items : [ 'Image','Table','HorizontalRule','Youtube','Audio','Video' ] },
20    { name: 'document',    items : [ 'Source','-','DocProps','-','Templates' ] },
21    { name: 'tools',       items : [ 'Maximize' ] },
22    '/',
23    { name: 'basicstyles', items : [ 'TextColor','BGColor','Bold','Italic','Strike','Subscript','Superscript','-','RemoveFormat' ] },
24    { name: 'paragraph',   items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
25    { name: 'links',       items : [ 'CmsLink','CmsUnlink','CmsAnchor' ] },
26    { name: 'editing',     items : [ 'Find','Replace','-','SelectAll' ] },
27  ];
28
29  // 外部CSSを読み込み
30  var css = config.contentsCss;
31  if (!(css instanceof Array)) { css = [css]; }
32  css.push('/_common/js/ckeditor/file_icons.css');
33  css.push('/_common/js/ckeditor/cms_contents.css');
34
35  config.contentsCss = css;
36
37  // フォントサイズをパーセンテージに変更
38  config.fontSize_sizes = '10px/62.5%;12px/75%;14px/87.5%;16p(標準)/100%;18px/112.5%;20px/125%;24px/150%;28px/175%;32px/200%';
39
40  // フォーマットからh1などを除外
41  config.format_tags = 'p;h2;h3;h4;h5;h6';
42
43  // スタイルセット
44  config.stylesSet = [
45    { name : '黄色マーカー', element : 'span', styles : { 'background-color' : '#ffff99' } },
46    { name : 'オレンジマーカー', element : 'span', styles : { 'background-color' : '#ffcc99' } },
47    { name : 'ピンクマーカー', element : 'span', styles : { 'background-color' : '#ff99cc' } },
48    { name : '水色マーカー', element : 'span', styles : { 'background-color' : '#99ffff' } },
49    { name : '緑マーカー', element : 'span', styles : { 'background-color' : '#99ff99' } },
50  ];
51
52  // 使用するテンプレート
53  config.templates_files = [ '/_themes/js/ckeditor/templates/cms_template.js' ];
54  config.templates = 'cms';
55
56  // インデント
57  config.indentOffset = 1;
58  config.indentUnit = 'em';
59
60  // カラーコード設定
61  config.colorButton_colors = 'ee0000,0000ff,008800,663399,D54300,000099,8F4D00,767676,e60066,0068ff,777c00,93008F,D13D6D,147AA3,000000,ffffff';
62
63  // その他のカラーコード選択を許可
64  config.colorButton_enableMore = true;
65
66  // テンプレート内容の置き換えしない
67  config.templates_replaceContent = false;
68
69  // プラグイン
70  config.extraPlugins = 'font,colorbutton,justify,find,selectall,templates,sharedspace,youtube,audio,video,zomekilink,zomekiwordcount';
71
72  // tagの許可
73  config.allowedContent = {
74    $1: { // Use the ability to specify elements as an object.
75      elements: CKEDITOR.dtd,
76      attributes: true,
77      styles: true,
78      classes: true
79    }
80  };
81
82  // table廃止・非推奨属性入力不可
83  config.disallowedContent = 'font;table[summary,height,cellspacing,cellpadding,align]{height};script;*[on*];*[data-*]';
84
85  // Wordからの貼付で装飾を削除する
86  config.pasteFromWordRemoveFontStyles = true;
87  config.pasteFromWordRemoveStyles = true;
88
89  // zomekiwordcountプラグイン
90  config.zomekiwordcount = {
91    showParagraphs: false,
92    showWordCount: false,
93    showCharCount: true,
94    countBytesAsChars: true,
95    countSpacesAsChars: true,
96    countHTML: true
97  };
98
99  // バージョンチェック
100  config.versionCheck = false;
101};
102
103CKEDITOR.on('instanceReady', function(ev) {
104  var rules = {
105    elements: {
106      a: function(element) {
107        // hrefからjavascriptプロトコルを除去
108        var href = element.attributes.href;
109        if (href && href.match(/^javascript:/i)) {
110          element.attributes['data-cke-saved-href'] = '';
111        }
112      }
113    }
114  };
115  ev.editor.dataProcessor.htmlFilter.addRules(rules);
116  ev.editor.dataProcessor.dataFilter.addRules(rules);
117});
118
119CKEDITOR.on('dialogDefinition', function(ev){
120  var dialogName = ev.data.name;
121  var dialogDefinition = ev.data.definition;
122  if (dialogName == 'table' || dialogName == 'tableProperties') {
123    var infoTab = dialogDefinition.getContents('info');
124    // テーブル幅のデフォルト値を削除
125    txtWidth = infoTab.get('txtWidth');
126    txtWidth['default'] = '';
127    //「枠線の幅」を削除 
128    infoTab.remove('txtBorder');
129  }
130  if (dialogName == 'cellProperties') {
131    var infoTab = dialogDefinition.getContents('info');
132    infoTab.remove('borderColor');
133    infoTab.remove('borderColorChoose');
134  }
135});
136
137// スタイルの設定
138CKEDITOR.stylesSet.add('my_styles', [
139  // Block-level styles
140  { name: '枠線', element: 'p', styles: { 'border': '1px solid #999' , 'padding' : '10px' } },
141
142  // Inline styles
143  { name: '強調(赤文字)', element: 'span', styles: { 'color': '#e00' } }
144]);
145
146CKEDITOR.config.stylesSet = 'my_styles';
147CKEDITOR.config.coreStyles_strike = { element : 'del' };
148CKEDITOR.config.coreStyles_underline = { element : 'ins' };
149
150// インラインエディタ自動生成を無効化
151CKEDITOR.disableAutoInline = true;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.