editor_tag_button

NAML documentation   Watch a video
   Usages of this macro
... in editor_tag_button.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<macro name="editor_tag_button">
    <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
        <script type="text/javascript">
            Nabble.tag = function() {
                var textarea = Nabble.get(textareaID);
                var s = this.getSelection(textarea);
                if( s != "" || (s=prompt("Enter the tag text:","")) != null ) {
                    if (s!="") {
                        s="\n"+s.trim()+"\n"
                        s=s.replace(/[\n;,]+ */gm, "\n");
                        s=s.trim();
                        s=s.replace(/ +/g, "_");
                        var ssplit=s.split("\n");
                        var s3="";
                        var href1='<a href="'+'/template/NamlServlet.jtp?macro=search_page&node=1&sort=date&query=';
                        var href2='&n=1">';
                        var href3="</a>";
                        ssplit.forEach( function(s2) { 
                            if (s2.includes("_")==false) {
                                var spart=href1+s2+"_"+href2+s2+"_"+href3;
                                s3+=spart+"\n";
                            }
                            else {
                                var spart=href1+s2+href2+s2+href3;
                                s3+=spart+"\n";
                            }
                        } );
                        s=s3.trim();
                    }
                    this.setSelection( textarea, s );
                }
                textarea.focus();
            };
        </script>
    </n.put_in_head.>
    <td class="nowrap">
        <button type="button" onclick="Nabble.tag()" class="toolbar bold" style="height:1.65em" title="[t]tag[/t]">
            Tag
        </button>
        <n.tooltip
Macro
Parameters: use_title, delay, contents, position
 use_title="true"/>
    </td>
</macro>
Feedback, Links, Privacy, Rules, Support