diff options
-rwxr-xr-x | _admin.php | 29 | ||||
-rwxr-xr-x | _define.php | 22 | ||||
-rwxr-xr-x | comment_answer.png | bin | 0 -> 456 bytes | |||
-rwxr-xr-x | post.js | 37 |
4 files changed, 88 insertions, 0 deletions
diff --git a/_admin.php b/_admin.php new file mode 100755 index 0000000..43f23c4 --- /dev/null +++ b/_admin.php @@ -0,0 +1,29 @@ +<?php +# -- BEGIN LICENSE BLOCK --------------------------------------- +# +# This file is part of Dotclear 2. +# +# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear +# Licensed under the GPL version 2.0 license. +# See LICENSE file or +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# +# -- END LICENSE BLOCK ----------------------------------------- +if (!defined('DC_CONTEXT_ADMIN')) { return; } + +$core->addBehavior('adminCommentHeaders',array('comment_answerBehaviors','jsLoad')); + +class comment_answerBehaviors +{ + public static function jsLoad() + { + return + '<script type="text/javascript" src="index.php?pf=comment_answer/post.js"></script>'. + '<script type="text/javascript">'."\n". + "//<![CDATA[\n". + dcPage::jsVar('jsToolBar.prototype.elements.comment_answer.title',__('Comment answer')). + "\n//]]>\n". + "</script>\n"; + } +} +?> diff --git a/_define.php b/_define.php new file mode 100755 index 0000000..1333b7b --- /dev/null +++ b/_define.php @@ -0,0 +1,22 @@ +<?php +# -- BEGIN LICENSE BLOCK --------------------------------------- +# +# This file is part of Dotclear 2. +# +# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear +# Licensed under the GPL version 2.0 license. +# See LICENSE file or +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# +# -- END LICENSE BLOCK ----------------------------------------- +if (!defined('DC_RC_PATH')) { return; } + +$this->registerModule( + /* Name */ "comment_answer", + /* Description*/ "Preset to answer comments", + /* Author */ "Paul Kocialkowski, Olivier Meunier", + /* Version */ '0.1', + /* Permissions */ 'usage,contentadmin', + /* Priority */ 50 +); +?> diff --git a/comment_answer.png b/comment_answer.png Binary files differnew file mode 100755 index 0000000..dd7acad --- /dev/null +++ b/comment_answer.png @@ -0,0 +1,37 @@ +jsToolBar.prototype.elements.comment_answer={ + type:'button', + title:'comment_answer', + icon:'index.php?pf=comment_answer/comment_answer.png', + fn:{}, + prompt:{} +}; + +jsToolBar.prototype.elements.comment_answer.fn.xhtml=function(){ + this.encloseSelection('','',function(str){ + if(str == "") + str="Texte"; + return "<p><span style=\"color: rgb(145, 111, 138);\">Réponse : "+str+"</span></p>"; + }); +}; + +/* +jsToolBar.prototype.elements.comment_answer.fn.wiki=function(){ + this.encloseSelection('','',function(str){ + alert(str); + return "<p style=\"color: rgb(145, 111, 138);\">Réponse : "+str+"</p>"; + }); +}; +*/ + +jsToolBar.prototype.elements.comment_answer.fn.wysiwyg=function(){ + var text_fragment = this.getSelectedNode(); + + var span_new = this.iwin.document.createElement("span"); + span_new.style.color="rgb(145, 111, 138)"; + if(text_fragment.textContent == "") + span_new.innerHTML="Réponse : Texte"; + else + span_new.innerHTML="Réponse : "; + span_new.appendChild(text_fragment); + this.insertNode(span_new); +}; |