lang/js

tinyMCE INIT

C/H 2014. 7. 18. 08:30

URL 


tinyMCEtinyMCE



<!DOCTYPE html>
<html>
<head>
<script src="//tinymce.cachefly.net/4.1/tinymce.min.js">
<script>
        tinymce.init({selector:'textarea'});
</script>
</head>
<body>
        <textarea>Your content here.</textarea>
</body>
</html>
var config = {
	selector: ".editor_holder",
	relative_urls : false,
	remove_linebreaks : true,
	remove_trailing_nbsp : true,
	remove_script_host : true,
	forced_root_block : false, // IE 한글문제
    entity_encoding : "raw",
    fix_nesting: true,
	theme_advanced_fonts : "굴림=굴림;굴림체=굴림체;궁서=궁서;궁서체=궁서체;돋움=돋움;돋움체=돋움체;바탕=바탕;바탕체=바탕체;나눔고딕=나눔고딕;맑은고딕='맑은 고딕';"
		+"Arial=Arial; Comic Sans MS='Comic Sans MS';Courier New='Courier New';Tahoma=Tahoma;Times New Roman='Times New Roman';Verdana=Verdana",
	content_css: "//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css,//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css,/s1/skin/layout/common.css",
	formats: { custom_format: { block: 'img', styles: { 'max-width': '100%' } } },
	valid_elements : '*[class|style|href|src|name|align|alt|title|width|height|target]',
	extended_valid_elements : "*[class|style|href|src|name|align|alt|title|width|height|target]",
	invalid_elements : 'script',
	inline_styles : true,
	theme: "modern",
	plugins: [
		"advlist autolink lists link image charmap print preview hr anchor pagebreak",
		"searchreplace wordcount visualblocks visualchars code fullscreen",
		"insertdatetime media nonbreaking save table contextmenu directionality",
		"emoticons template paste textcolor "
	],
	toolbar1: "code | newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect | code",
	toolbar2: "undo redo | cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | link unlink anchor image media | insertdatetime preview | forecolor backcolor",
	toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
	menubar: false, 
    toolbar_items_size: 'small',
    style_formats: [
		{title: 'Bold text', inline: 'b'},
		{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
		{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
		{title: 'Example 1', inline: 'span', classes: 'example1'},
		{title: 'Example 2', inline: 'span', classes: 'example2'},
		{title: 'Table styles'},
		{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
	]
 };
// 에디터 초기화
try{ tinyMCE.init(config); }catch(e){};




반응형

'lang > js' 카테고리의 다른 글

자바 스크립트 무료 전자 책 30  (2) 2014.09.30
모바일 Javascript API  (0) 2014.07.29
javascript 실시간 웹  (0) 2013.06.24
javascript 파일 작업  (0) 2013.06.21
javascript loader  (0) 2013.06.19