Search:
Template:MindTouch > ToBeDeveloped > Template:SendMessage

Template:SendMessage

    Table of contents
    No headers
    // includes
    dekiapi();
    jquery.ui('smoothness');
    
    // input form
    var recipients = (site.users);
    <form>
        "What: "; <textarea id="msgwhat" type="text" />
        <br />
        <br />
        <div id="whospan">
        " Who: ";
        <select id="msgwho">
            foreach(var uname in recipients) {
                var u = uname.name;
                <option value=(u) selected=((uname.id == user.id) ? 'selected' : nil)>u</option>
            }
        </select>" ";
        <input id="msgsend" type="button" value="Send" ctor="
            when($this.click) {
                @msgsend({ entry: { what: #msgwhat.val(), who: #msgwho.val()}});
                #msgwhat.val('');
                #msgsend.blur();
            }
            when(@msgsend) {
                Deki.Api.PostMessage(null, 'activity/poke', 
                    '@'+ @msgsend.entry.who+': '+ @msgsend.entry.what );
            }
        " />
        </div>
    </form>
    
    
    <style type="text/css">"
    #msgwhat {    
        width: 85%;
        height: 3em;
        float: right;
        margin-right: 20px;
    }
    
    #whospan {
        margin-top: 5px;
    }
    
    #msgwho {
        margin-left: 7px;
    }
    
    "</style>
    
    

    Files (0)

     

    Comments (0)

    You must login to post a comment.