リッチテキストエディタ(GcRichTextEditor)コントロールは、読み取り専用に設定した場合でも一部のツールバー項目が利用できます。
読み取り専用時に使用できるツールバー項目一覧
読み取り専用時に使用できるツールバー項目一覧は以下となります。
値
説明
補足
Copy
コピー
HTMLCode
HTMLコード
表示のみ使用可能
SearchReplace
検索&置換
表示のみ使用可能
FullScreen
フルスクリーン
Preview
プレビュー
Print
印刷
SelectAll
すべて選択
WordCount
文字数のカウント
注意事項
ショートカットキーでの使用できません。
編集時のツールバーを使用できません。
import "@mescius/inputman.richtexteditor/CSS/gc.inputman.richtexteditor.css";
import "./styles.css";
import { InputMan } from "@mescius/inputman.richtexteditor";
InputMan.appearanceStyle = InputMan.AppearanceStyle.Modern;
const gcRichTextEditor = new InputMan.GcRichTextEditor(
document.getElementById("gcRichTextEditor"),
{
watermarkText:
"ただいまリッチテキストエディタが読み取り専用に設定しております。",
baseUrl:
'$IMDEMOROOT$/lib/purejs/node_modules/@mescius/inputman.richtexteditor/JS',
plugins: ["all"],
toolbar: [
InputMan.GcRichTextEditorToolbarItem.Save,
InputMan.GcRichTextEditorToolbarItem.Cancel,
InputMan.GcRichTextEditorToolbarItem.WordCount,
InputMan.GcRichTextEditorToolbarItem.SelectAll,
InputMan.GcRichTextEditorToolbarItem.RestoreDraft,
InputMan.GcRichTextEditorToolbarItem.Align,
InputMan.GcRichTextEditorToolbarItem.AlignCenter,
InputMan.GcRichTextEditorToolbarItem.AlignJustify,
InputMan.GcRichTextEditorToolbarItem.AlignLeft,
InputMan.GcRichTextEditorToolbarItem.AlignNone,
InputMan.GcRichTextEditorToolbarItem.AlignRight,
InputMan.GcRichTextEditorToolbarItem.NewDocument,
InputMan.GcRichTextEditorToolbarItem.PageBreak,
InputMan.GcRichTextEditorToolbarItem.Preview,
InputMan.GcRichTextEditorToolbarItem.Print,
InputMan.GcRichTextEditorToolbarItem.Redo,
InputMan.GcRichTextEditorToolbarItem.Undo,
InputMan.GcRichTextEditorToolbarItem.Blocks,
InputMan.GcRichTextEditorToolbarItem.SearchReplace,
InputMan.GcRichTextEditorToolbarItem.BulList,
InputMan.GcRichTextEditorToolbarItem.NumList,
InputMan.GcRichTextEditorToolbarItem.Styles,
InputMan.GcRichTextEditorToolbarItem.BackColor,
InputMan.GcRichTextEditorToolbarItem.ForeColor,
InputMan.GcRichTextEditorToolbarItem.FontFamily,
InputMan.GcRichTextEditorToolbarItem.FontSize,
InputMan.GcRichTextEditorToolbarItem.LineHeight,
InputMan.GcRichTextEditorToolbarItem.Emoticons,
InputMan.GcRichTextEditorToolbarItem.CharMap,
InputMan.GcRichTextEditorToolbarItem.Remove,
InputMan.GcRichTextEditorToolbarItem.Copy,
InputMan.GcRichTextEditorToolbarItem.Cut,
InputMan.GcRichTextEditorToolbarItem.Paste,
InputMan.GcRichTextEditorToolbarItem.PasteText,
InputMan.GcRichTextEditorToolbarItem.BlockQuote,
InputMan.GcRichTextEditorToolbarItem.Bold,
InputMan.GcRichTextEditorToolbarItem.Italic,
InputMan.GcRichTextEditorToolbarItem.Strikethrough,
InputMan.GcRichTextEditorToolbarItem.Subscript,
InputMan.GcRichTextEditorToolbarItem.Underline,
InputMan.GcRichTextEditorToolbarItem.HTMLCode,
InputMan.GcRichTextEditorToolbarItem.H1,
InputMan.GcRichTextEditorToolbarItem.H2,
InputMan.GcRichTextEditorToolbarItem.H3,
InputMan.GcRichTextEditorToolbarItem.H4,
InputMan.GcRichTextEditorToolbarItem.H5,
InputMan.GcRichTextEditorToolbarItem.H6,
InputMan.GcRichTextEditorToolbarItem.RemoveFormat,
InputMan.GcRichTextEditorToolbarItem.FullScreen,
InputMan.GcRichTextEditorToolbarItem.HorizontalRule,
InputMan.GcRichTextEditorToolbarItem.Image,
InputMan.GcRichTextEditorToolbarItem.Link,
InputMan.GcRichTextEditorToolbarItem.OpenLink,
InputMan.GcRichTextEditorToolbarItem.UnLink,
InputMan.GcRichTextEditorToolbarItem.Media,
InputMan.GcRichTextEditorToolbarItem.Indent,
InputMan.GcRichTextEditorToolbarItem.Outdent,
InputMan.GcRichTextEditorToolbarItem.LeftToRight,
InputMan.GcRichTextEditorToolbarItem.RightToLeft,
InputMan.GcRichTextEditorToolbarItem.Template,
InputMan.GcRichTextEditorToolbarItem.TableAll,
],
fontFamilyList: [
"Serif",
"Sans-serif",
"Monospace",
"Cursive",
"Arial",
"Times New Roman",
],
toolbarMode: InputMan.GcRichTextEditorToolbarMode.Wrap,
readOnly: true,
}
);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>リッチテキストエディタコントロール - ツールバー - 読み取り専用時のツールバー</title>
<!-- SystemJS -->
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
window.onload = function() {
System.import('./src/app');
}
</script>
</head>
<body>
<textarea id="gcRichTextEditor"></textarea>
</body>
</html>
body {
height: 751px!important;
box-sizing: content-box !important;
}
System.config({
transpiler: 'plugin-babel',
babelOptions: {
es2015: true
},
meta: {
'*.css': { loader: 'css' }
},
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
'@mescius/inputman': 'npm:@mescius/inputman/index.js',
'@mescius/inputman/CSS': 'npm:@mescius/inputman/CSS',
'@mescius/inputman.richtexteditor': 'npm:@mescius/inputman.richtexteditor/index.js',
'@mescius/inputman.richtexteditor/CSS': 'npm:@mescius/inputman.richtexteditor/CSS',
'css': 'npm:systemjs-plugin-css/css.js',
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
'systemjs-babel-build': 'npm:systemjs-plugin-babel/systemjs-babel-browser.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
src: {
defaultExtension: 'js'
},
"node_modules": {
defaultExtension: 'js'
},
}
});