Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better editor plugins

  • Loading branch information...
commit a2d6692ab7c7d09d3aae4b685fc5bf2d10e9813e 1 parent cd4231c
Hauke Schade cnlpete authored
29 Bbcode/Bbcode.controller.php
View
@@ -62,8 +62,8 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
$this->_aSession = & $aSession;
# now register some events with the pluginmanager
- #$oPlugins->registerSimplePlugin($this);
- $oPlugins->registerContentDisplayPlugin($this);
+ #$oPlugins->registerContentDisplayPlugin($this);
+ $oPlugins->registerEditorPlugin($this);
}
/**
@@ -215,4 +215,29 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
public final function prepareContent($sStr) {
return self::_setFormatedText($sStr);
}
+
+ /**
+ * Show nothing, since this plugin does not need to output additional javascript.
+ *
+ * @final
+ * @access public
+ * @return string HTML
+ *
+ */
+ public final function show() {
+ return '';
+ }
+
+ /**
+ * Generate an Info Array ('url' => '', 'iconurl' => '', 'description' => '')
+ *
+ * @final
+ * @access public
+ * @return array|boolean infor array or false
+ * @todo return array with bbcode logo and link to github info page
+ *
+ */
+ public final function getInfo() {
+ return false;
+ }
}
30 Markdown/Markdown.controller.php
View
@@ -55,7 +55,8 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
# now register some events with the pluginmanager
#$oPlugins->registerSimplePlugin($this);
- $oPlugins->registerContentDisplayPlugin($this);
+ #$oPlugins->registerContentDisplayPlugin($this);
+ $oPlugins->registerEditorPlugin($this);
}
/**
@@ -73,4 +74,31 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
$oMarkdown = new \dflydev\markdown\MarkdownParser();
return $oMarkdown->transformMarkdown($sStr);
}
+
+ /**
+ * Show nothing, since this plugin does not need to output additional javascript.
+ *
+ * @final
+ * @access public
+ * @return string HTML
+ * @todo add markdowneditor: https://github.com/samwillis/pagedown-bootstrap ??
+ *
+ */
+ public final function show() {
+ return '';
+ }
+
+ /**
+ * Generate an Info Array ('url' => '', 'iconurl' => '', 'description' => '')
+ *
+ * @final
+ * @access public
+ * @return array|boolean infor array or false
+ * @todo return array with markdown logo and link to some markup info page
+ * @todo markdown logo: https://github.com/dcurtis/markdown-mark
+ *
+ */
+ public final function getInfo() {
+ return false;
+ }
}
33 TinyMCE/TinyMCE.controller.php
View
@@ -53,7 +53,8 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
$this->_aSession = & $aSession;
# now register some events with the pluginmanager
- $oPlugins->registerSimplePlugin($this);
+ #$oPlugins->registerSimplePlugin($this);
+ $oPlugins->registerEditorPlugin($this);
}
/**
@@ -61,8 +62,6 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
*
* @final
* @access public
- * @param array $aRequest
- * @param array $aSession
* @return string HTML
*
*/
@@ -78,4 +77,32 @@ public function __construct(&$aRequest, &$aSession, &$oPlugins) {
return $oSmarty->fetch($sTemplateFile, $sCacheId);
}
+
+ /**
+ * Return the formatted code.
+ *
+ * @final
+ * @static
+ * @access public
+ * @param string $sStr
+ * @return string HTML with formated code
+ * @todo maybe do some code cleanup here?
+ *
+ */
+ public final function prepareContent(&$sStr) {
+ return $sStr;
+ }
+
+ /**
+ * Generate an Info Array ('url' => '', 'iconurl' => '', 'description' => '')
+ *
+ * @final
+ * @access public
+ * @return array|boolean infor array or false
+ *
+ */
+ public final function getInfo() {
+ # we do not have an icon and/or info to display
+ return false;
+ }
}
4 TinyMCE/views/show.tpl
View
@@ -2,7 +2,7 @@
<script type='text/javascript' src='/vendor/tiny_mce/jquery.tinymce.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
- $('textarea.js-tinymce').tinymce({
+ $('textarea.js-editor').tinymce({
script_url : '/vendor/tiny_mce/tiny_mce.js',
theme : 'advanced',
plugins : 'autosave,safari,style,advimage,advlink,inlinepopups,insertdatetime,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
@@ -18,4 +18,4 @@
height : '300px'
});
});
-</script>
+</script>
Please sign in to comment.
Something went wrong with that request. Please try again.