From 47210a692288db805dc30f2940663efec074b339 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 17 Jan 2014 20:25:11 +0100 Subject: Initial commit Signed-off-by: Paul Kocialkowski --- _admin.php | 29 +++++++++++++++++++++++++++++ _define.php | 22 ++++++++++++++++++++++ comment_answer.png | Bin 0 -> 456 bytes post.js | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100755 _admin.php create mode 100755 _define.php create mode 100755 comment_answer.png create mode 100755 post.js diff --git a/_admin.php b/_admin.php new file mode 100755 index 0000000..43f23c4 --- /dev/null +++ b/_admin.php @@ -0,0 +1,29 @@ +addBehavior('adminCommentHeaders',array('comment_answerBehaviors','jsLoad')); + +class comment_answerBehaviors +{ + public static function jsLoad() + { + return + ''. + '\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 @@ +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 new file mode 100755 index 0000000..dd7acad Binary files /dev/null and b/comment_answer.png differ diff --git a/post.js b/post.js new file mode 100755 index 0000000..7f1d1c8 --- /dev/null +++ b/post.js @@ -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 "

Réponse : "+str+"

"; + }); +}; + +/* +jsToolBar.prototype.elements.comment_answer.fn.wiki=function(){ + this.encloseSelection('','',function(str){ + alert(str); + return "

Réponse : "+str+"

"; + }); +}; +*/ + +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); +}; -- cgit v1.2.3