Skip to content

Commit

Permalink
refs #1698 : merged - tinyMCE with codemirror plugin
Browse files Browse the repository at this point in the history
 -
  • Loading branch information
inureyes committed Nov 7, 2014
1 parent 6a9e3c4 commit 085676e
Show file tree
Hide file tree
Showing 416 changed files with 69,396 additions and 361 deletions.
47 changes: 40 additions & 7 deletions plugins/ED_tinyMCE/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/***
TinyMCE Editor for Textcube
Needlworks / Jeongkyu Shin (https://github.com/inureyes)
CodeMirror plugin by zvuc (https://github.com/zvuc)
*/
function tinyMCE_handleconfig($configVal) {
$config = Setting::fetchConfigVal($configVal);
if (isset($config['editormode']) && $config['editormode'] != 'simple' && $config['editormode'] != 'advanced') return false;
Expand All @@ -11,7 +17,8 @@ function tinyMCE_editorinit($editor) {
$blogid = getBlogId();
$config = Setting::fetchConfigVal($configVal);
if(empty($config['editormode'])) $config['editormode'] = 'simple';
if(empty($config['width'])) $config['width'] = 'full';
if(empty($config['width'])) $config['width'] = 'skin';
if(empty($config['srctheme'])) $config['srctheme'] = 'default';
ob_start();
?>
var editor = new tinymce.Editor('editWindow', {
Expand Down Expand Up @@ -40,27 +47,53 @@ function tinyMCE_editorinit($editor) {
if($config['editormode'] == 'simple') {
?>
plugins: [
"TTMLsupport advlist autolink link image lists print hr anchor autoresize",
"code fullscreen media visualblocks",

"codemirror",
"TTMLsupport advlist link image lists print hr anchor autoresize",
"fullscreen media visualblocks",
"table contextmenu directionality charmap textcolor"

],
toolbar1: "tcsave print | bold italic underline strikethrough | styleselect formatselect fontselect fontsizeselect forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote hr tcmoreless",
toolbar2: "undo redo | tcattach image media charmap | hr link unlink anchor | table | removeformat | code fullscreen visualblocks",
toolbar2: "undo redo | tcattach image media charmap | hr link unlink anchor | table | removeformat | code fullscreen visualblocks",
<?php
} else {
?>
plugins: [
"TTMLsupport advlist autolink link image lists charmap print hr anchor pagebreak table",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons textcolor paste textcolor autoresize"
"TTMLsupport advlist link image lists charmap print hr anchor pagebreak table",
"searchreplace wordcount visualblocks visualchars fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons textcolor paste textcolor autoresize",
"codemirror",

],

toolbar1: "tcsave print | bold italic underline strikethrough | styleselect formatselect fontselect fontsizeselect forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote hr tcmoreless",
toolbar2: "undo redo | searchreplace | tcattach image media charmap insertdatetime | subscript superscript ltr rtl cite abbr acronym del ins | hr link unlink anchor | table | cut copy paste pastetext| removeformat code fullscreen visualblocks",


<?php
}
?>
// codemirror settings
codemirror: {
indentOnInit: true, // Whether or not to indent code on init.
path: 'CodeMirror', // Path to CodeMirror distribution
config: { // CodeMirror config object
mode: 'application/x-httpd-php',
lineNumbers: true,
tabSize: 4,
indentWithTabs: true,
theme: '<?php echo $config['srctheme'] ?>'

},
jsFiles: [ // Additional JS files to load
'mode/clike/clike.js',
'mode/php/php.js'
],
cssFiles: [
'theme/<?php echo $config['srctheme'] ?>.css'
]
},
// content CSS
content_css : "<?php echo (file_exists(__TEXTCUBE_SKIN_DIR__.'/'.$context->getProperty('skin.skin').'/wysiwyg.css') ? $context->getProperty('uri.service').'/skin/blog/'.$context->getProperty('skin.skin').'/wysiwyg.css' : $context->getProperty('uri.service').'/resources/style/default-wysiwyg.css');?>",

Expand Down
78 changes: 73 additions & 5 deletions plugins/ED_tinyMCE/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
<title xml:lang="en">tinyMCE Editor</title>
<title xml:lang="ko">tinyMCE 편집기</title>
<link>http://needlworks.org/</link>
<version>1.9</version>
<version>1.10</version>
<description xml:lang="en">Provides an easy-to-use WYSIWYG editor interface.</description>
<description xml:lang="ko">사용하기 쉬운 편집기 환경을 제공합니다.</description>
<description xml:lang="ja">tinyMCE WYSIWYGに編集環境を転換</description>
<license>GPLv2</license>
<author xml:lang="en" link="http://forest.nubimaru.com/">inureyes</author>
<author xml:lang="ko" link="http://forest.nubimaru.com/"><![CDATA[inureyes]]></author>
<author xml:lang="en" link="https://github.com/zvuc">zvuc</author>
<author xml:lang="ko" link="https://github.com/zvuc"><![CDATA[zvuc]]></author>
<safety changeData="yes" exposeData="no" accessLocal="yes" accessRemote="no" accessRaw="yes" />
<requirements>
<textcube>1.9</textcube>
<textcube>1.10</textcube>
</requirements>
<binding>
<listener event="ShowAdminHeader">tinyMCE_adminheader</listener>
Expand All @@ -36,7 +38,7 @@
<usedFor formatter="textile" />-->
</editor>
<config xml:lang="ko" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="360" />
<window width="500" height="450" />
<fieldset legend="기본 설정">
<field title="에디터 편집 모드" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[간단]]></op>
Expand All @@ -49,9 +51,31 @@
<op value="full" checked="checked"><![CDATA[화면 폭]]></op>
</field>
</fieldset>
<fieldset legend="소스코드 에디터 테마">
<field title="테마" type="select" name="srctheme">
<op value="default" checked="checked"><![CDATA[Default]]></op>
<op value="ambiance"><![CDATA[Ambiance]]></op>
<op value="base16-dark"><![CDATA[base16 Dark]]></op>
<op value="base16-light"><![CDATA[base16 Light]]></op>
<op value="cobalt"><![CDATA[Cobalt]]></op>
<op value="eclipse"><![CDATA[Eclipse]]></op>
<op value="elegant"><![CDATA[Elegant]]></op>
<op value="mdn-like"><![CDATA[MDN-Like]]></op>
<op value="monokai"><![CDATA[Monokai]]></op>
<op value="neat"><![CDATA[Neat]]></op>
<op value="neo"><![CDATA[Neo]]></op>
<op value="paraiso-light"><![CDATA[paraiso-light]]></op>
<op value="paraiso-dark"><![CDATA[paraiso-dark]]></op>
<op value="rubyblue"><![CDATA[rubyblue]]></op>
<op value="tomorrow-night"><![CDATA[Tomorrow Night]]></op>
<op value="tomorrow-night-bright"><![CDATA[Tomorrow Night Bright]]></op>
<op value="tomorrow-night-eighties"><![CDATA[Tomorrow Night Eighties]]></op>
<op value="twilight"><![CDATA[Twilight]]></op>
</field>
</fieldset>
</config>
<config xml:lang="en" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="360" />
<window width="500" height="450" />
<fieldset legend="Settings">
<field title="Editing mode" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[Simple]]></op>
Expand All @@ -64,9 +88,31 @@
<op value="full" checked="checked"><![CDATA[Full-screen width]]></op>
</field>
</fieldset>
<fieldset legend="Source code editor theme">
<field title="Theme" type="select" name="srctheme">
<op value="default" checked="checked"><![CDATA[Default]]></op>
<op value="ambiance"><![CDATA[Ambiance]]></op>
<op value="base16-dark"><![CDATA[base16 Dark]]></op>
<op value="base16-light"><![CDATA[base16 Light]]></op>
<op value="cobalt"><![CDATA[Cobalt]]></op>
<op value="eclipse"><![CDATA[Eclipse]]></op>
<op value="elegant"><![CDATA[Elegant]]></op>
<op value="mdn-like"><![CDATA[MDN-Like]]></op>
<op value="monokai"><![CDATA[Monokai]]></op>
<op value="neat"><![CDATA[Neat]]></op>
<op value="neo"><![CDATA[Neo]]></op>
<op value="paraiso-light"><![CDATA[paraiso-light]]></op>
<op value="paraiso-dark"><![CDATA[paraiso-dark]]></op>
<op value="rubyblue"><![CDATA[rubyblue]]></op>
<op value="tomorrow-night"><![CDATA[Tomorrow Night]]></op>
<op value="tomorrow-night-bright"><![CDATA[Tomorrow Night Bright]]></op>
<op value="tomorrow-night-eighties"><![CDATA[Tomorrow Night Eighties]]></op>
<op value="twilight"><![CDATA[Twilight]]></op>
</field>
</fieldset>
</config>
<config xml:lang="ja" dataValHandler="tinyMCE_handleconfig">
<window width="500" height="360" />
<window width="500" height="450" />
<fieldset legend="Settings">
<field title="Editing mode" type="select" name="editormode">
<op value="simple" checked="checked"><![CDATA[Simple]]></op>
Expand All @@ -79,6 +125,28 @@
<op value="full" checked="checked"><![CDATA[Full-screen width]]></op>
</field>
</fieldset>
<fieldset legend="Source code editor theme">
<field title="Theme" type="select" name="srctheme">
<op value="default" checked="checked"><![CDATA[Default]]></op>
<op value="ambiance"><![CDATA[Ambiance]]></op>
<op value="base16-dark"><![CDATA[base16 Dark]]></op>
<op value="base16-light"><![CDATA[base16 Light]]></op>
<op value="cobalt"><![CDATA[Cobalt]]></op>
<op value="eclipse"><![CDATA[Eclipse]]></op>
<op value="elegant"><![CDATA[Elegant]]></op>
<op value="mdn-like"><![CDATA[MDN-Like]]></op>
<op value="monokai"><![CDATA[Monokai]]></op>
<op value="neat"><![CDATA[Neat]]></op>
<op value="neo"><![CDATA[Neo]]></op>
<op value="paraiso-light"><![CDATA[paraiso-light]]></op>
<op value="paraiso-dark"><![CDATA[paraiso-dark]]></op>
<op value="rubyblue"><![CDATA[rubyblue]]></op>
<op value="tomorrow-night"><![CDATA[Tomorrow Night]]></op>
<op value="tomorrow-night-bright"><![CDATA[Tomorrow Night Bright]]></op>
<op value="tomorrow-night-eighties"><![CDATA[Tomorrow Night Eighties]]></op>
<op value="twilight"><![CDATA[Twilight]]></op>
</field>
</fieldset>
</config>
</binding>
</plugin>
2 changes: 1 addition & 1 deletion plugins/ED_tinyMCE/tinymce/plugins/advlist/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/ED_tinyMCE/tinymce/plugins/anchor/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/ED_tinyMCE/tinymce/plugins/autolink/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 085676e

Please # to comment.