summaryrefslogtreecommitdiff
path: root/post.js
diff options
context:
space:
mode:
authorPaul Kocialkowski2014-01-17 20:25:11 +0100
committerPaul Kocialkowski2014-01-17 20:25:11 +0100
commit47210a692288db805dc30f2940663efec074b339 (patch)
tree8f9898df8dd0c9ca5f13bde84afcc9656f5a3a6b /post.js
Initial commitHEADmaster
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'post.js')
-rwxr-xr-xpost.js37
1 files changed, 37 insertions, 0 deletions
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 "<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);
+};