Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
<!doctype html>
2
<title>CodeMirror: Tcl mode</title>
3
<meta charset="utf-8" />
4
<link rel=stylesheet href="../../doc/docs.css">
5
<link rel="stylesheet" href="../../lib/codemirror.css">
6
<link rel="stylesheet" href="../../theme/night.css">
7
<script src="../../lib/codemirror.js"></script>
8
<script src="tcl.js"></script>
9
<script src="../../addon/scroll/scrollpastend.js"></script>
10
<div id=nav>
11
    <a href="http://codemirror.net">
12
        <h1>CodeMirror</h1>
13
        <img id=logo src="../../doc/logo.png">
14
    </a>
15
    <ul>
16
        <li>
17
            <a href="../../index.html">Home</a>
18
            <li>
19
                <a href="../../doc/manual.html">Manual</a>
20
                <li>
21
                    <a href="https://github.com/codemirror/codemirror">Code</a>
22
    </ul>
23
    <ul>
24
        <li>
25
            <a href="../index.html">Language modes</a>
26
            <li>
27
                <a class=active href="#">Tcl</a>
28
    </ul>
29
</div>
30
<article>
31
    <h2>Tcl mode</h2>
32
    <form>
33
        <textarea id="code" name="code"> ############################################################################################## ## ## whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help ## ## ##############################################################################################
34
            ## To use this script you must set channel flag +whois (ie .chanset #chan +whois) ## ############################################################################################## ## ____ __ ########################################### ## ##
35
            / __/___ _ ___ _ ___/ /____ ___ ___ ########################################### ## ## / _/ / _ `// _ `// _ // __// _ \ / _ \ ########################################### ## ## /___/ \_, / \_, / \_,_//_/ \___// .__/ ###########################################
36
            ## ## /___/ /___/ /_/ ########################################### ## ## ########################################### ## ############################################################################################## ## ## Start Setup. ## ##
37
            ############################################################################################## namespace eval whois { ## change cmdchar to the trigger you want to use ## ## variable cmdchar "!" ## change command to the word trigger you would
38
            like to use. ## ## ## Keep in mind, This will also change the .chanset +/-command ## ## variable command "whois" ## change textf to the colors you want for the text. ## ## variable textf "\017\00304" ## change tagf to the colors you want for
39
            tags: ## ## variable tagf "\017\002" ## Change logo to the logo you want at the start of the line. ## ## variable logo "\017\00304\002\[\00306W\003hois\00304\]\017" ## Change lineout to the results you want. Valid results are channel users
40
            modes topic ## ## variable lineout "channel users modes topic" ############################################################################################## ## ## End Setup. ## ## ##############################################################################################
41
            variable channel "" setudef flag $whois::command bind pub -|- [string trimleft $whois::cmdchar]${whois::command} whois::list bind raw -|- "311" whois::311 bind raw -|- "312" whois::312 bind raw -|- "319" whois::319 bind raw -|- "317" whois::317
42
            bind raw -|- "313" whois::multi bind raw -|- "310" whois::multi bind raw -|- "335" whois::multi bind raw -|- "301" whois::301 bind raw -|- "671" whois::multi bind raw -|- "320" whois::multi bind raw -|- "401" whois::multi bind raw -|- "318"
43
            whois::318 bind raw -|- "307" whois::307 } proc whois::311 {from key text} { if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Host:${whois::textf}
44
            \ $nick \(${ident}@${host}\) ${whois::tagf}Realname:${whois::textf} $realname" } } proc whois::multi {from key text} { if {[regexp {\:(.*)$} $text match $key]} { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Note:${whois::textf}
45
            [subst $$key]" return 1 } } proc whois::312 {from key text} { regexp {([^\s]+)\s\:} $text match server putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Server:${whois::textf} $server" } proc whois::319 {from key text} { if {[regexp
46
            {.+\:(.+)$} $text match channels]} { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Channels:${whois::textf} $channels" } } proc whois::317 {from key text} { if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]}
47
            { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Connected:${whois::textf} \ [ctime $signon] ${whois::tagf}Idle:${whois::textf} [duration $idle]" } } proc whois::301 {from key text} { if {[regexp {^.+\s[^\s]+\s\:(.*)$} $text
48
            match awaymsg]} { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Away:${whois::textf} $awaymsg" } } proc whois::318 {from key text} { namespace eval whois { variable channel "" } variable whois::channel "" } proc whois::307
49
            {from key text} { putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Services:${whois::textf} Registered Nick" } proc whois::list {nick host hand chan text} { if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1}
50
            { namespace eval whois { variable channel "" } variable whois::channel $chan putserv "WHOIS $text" } } putlog "\002*Loaded* \017\00304\002\[\00306W\003hois\00304\]\017 \002by \ Ford_Lawnmower irc.GeekShed.net #Script-Help" </textarea>
51
    </form>
52
    <script>
53
        var editor = CodeMirror.fromTextArea(document.getElementById("code"),
54
        {
55
            theme: "night",
56
            lineNumbers: true,
57
            indentUnit: 2,
58
            scrollPastEnd: true,
59
            mode: "text/x-tcl"
60
        });
61
    </script>
62
    <p>
63
        <strong>MIME types defined:</strong> <code>text/x-tcl</code>.</p>
64
</article>