PageSourceSearch

https://www.elementsofmathematics.com/scripts/emf/js/emf-chat.js?v=20261005

js elementsofmathematics.com collected 2026-10-08 12:52:17 UTC 53,070 bytes, 80 lines download raw bytes

1'use strict';function setupCurlyBracket(b){if("off"!==$.cookie("emf-chat-room")&&emf.permissions.curlybracket){var F=$("div.chatroomannouncements div.for-the-curly-bracket");F.append("\x3cdiv class\x3d'scroll2'\x3e\x3cspan class\x3d'pubsign'\x3eThe Curly Bracket\x3c/span\x3e\x3cimg src\x3d'/scripts/emf/css/images/wizard-door-01.png' /\x3e\x3cdiv class\x3d'message'\x3e\x3c/div\x3e\x3c/div\x3e");var B=F.find(".scroll2"),G=B.find("div.message");F.append("\x3caudio preload\x3d'auto' volume\x3d'1.0' class\x3d'chatroomdiv bell-0'\x3e\x3csource src\x3d'/scripts/audio/bell-00.mp3' type\x3d'audio/mpeg' /\x3e\x3csource src\x3d'/scripts/audio/bell-00.ogg' type\x3d'audio/ogg' /\x3e\x3csource src\x3d'/scripts/audio/bell-00.aac' type\x3d'audio/aac' /\x3e\x3c/audio\x3e\x3caudio preload\x3d'auto' volume\x3d'1.0' class\x3d'chatroomdiv bell-1'\x3e\x3csource src\x3d'/scripts/audio/bell-01.mp3' type\x3d'audio/mpeg' /\x3e\x3csource src\x3d'/scripts/audio/bell-01.ogg' type\x3d'audio/ogg' /\x3e\x3csource src\x3d'/scripts/audio/bell-01.aac' type\x3d'audio/aac' /\x3e\x3c/audio\x3e\x3caudio preload\x3d'auto' volume\x3d'1.0' class\x3d'chatroomdiv bell-2'\x3e\x3csource src\x3d'/scripts/audio/bell-02.mp3' type\x3d'audio/mpeg' /\x3e\x3csource src\x3d'/scripts/audio/bell-02.ogg' type\x3d'audio/ogg' /\x3e\x3csource src\x3d'/scripts/audio/bell-02.aac' type\x3d'audio/aac' /\x3e\x3c/audio\x3e\x3caudio preload\x3d'auto' volume\x3d'1.0' class\x3d'chatroomdiv bell-3'\x3e\x3csource src\x3d'/scripts/audio/bell-03.mp3' type\x3d'audio/mpeg' /\x3e\x3csource src\x3d'/scripts/audio/bell-03.ogg' type\x3d'audio/ogg' /\x3e\x3csource src\x3d'/scripts/audio/bell-03.aac' type\x3d'audio/aac' /\x3e\x3c/audio\x3e\x3caudio preload\x3d'auto' volume\x3d'1.0' class\x3d'chatroomdiv bell-5'\x3e\x3csource src\x3d'/scripts/audio/bell-05.mp3' type\x3d'audio/mpeg' /\x3e\x3csource src\x3d'/scripts/audio/bell-05.ogg' type\x3d'audio/ogg' /\x3e\x3csource src\x3d'/scripts/audio/bell-05.aac' type\x3d'audio/aac' /\x3e\x3c/audio\x3e");
2Ajax("chat-emf","emf-chatroom",{skin:2},function(H){function R(){S&&Ajax("chat-emf","count",{roomid:T},function(x){x=parseInt($(x).find("reply").attr("count"));isNaN(x)&&(x=0);G.text(0>=x?"No one available right now.":x+" wizard"+(1<x?"s":"")+".");S&&(ja=setTimeout(R,9E4))})}var U=[],T="",S=!0,ja;$(H).find("reply \x3e rooms \x3e room").each(function(){var x=$(this),K=parseInt(x.attr("flags"));x={id:parseInt(x.attr("id")),name:x.attr("name"),buttonname:x.attr("bn"),bell:!0};0==(K&16)&&(U.push(x),T+=
3(""==T?"":",")+x.id)});if(0<U.length){if(qtip(B),R(),B.on("click",function(){S=!1;clearTimeout(ja);delay(function(){showChatroomWindow({title:"The Curly Bracket",rooms:U,divid:"emf-chat",withwarning:!0,withentrytest:!0})});return!1}),H=window.sessionStorage.getItem("chatdivdata-emf-chat"))try{JSON.parse(H).visible&&delay(function(){B.trigger("click")})}catch(x){}}else F.addClass("no-rooms-available"),F.hide();delay(b)})}else delay(b)}
4function showChatroomWindow(b){function F(c){c=$("audio.bell-"+c);if(0<c.length){c.get(0).volume=.25;try{c.get(0).play()}catch(k){console.log(k)}}}function B(c,k){var l=parseInt($.cookie("emf-chat-room-bell-value"));$(".chatroomannouncements").fadeOut(function(){$(this).fadeIn()});if(0>l){if(ka&&0<ka.length){delay(function(){var n=new SpeechSynthesisUtterance(c),p="Google UK English "+(k?"Male":"Female");n.default=!1;n.voice=speechSynthesis.getVoices().filter(function(C){return C.name==p})[0];n.lang=
5"en-GB";n.rate=.95;window.speechSynthesis.speak(n)});return}l=0}delay(function(){F(l)})}function G(c,k){$("\x3cdiv\x3e"+c+"\x3cdiv class\x3d'buttondiv'\x3e\x3cbutton class\x3d'closebutton'\x3eClose\x3c/button\x3e\x3c/div\x3e\x3c/div\x3e").dialog({title:b.title,close:function(){$(this).dialog("destroy")},modal:!0,width:"auto",dialogClass:"chat-room-alert"+(k&&k.class?" "+k.class:""),open:function(){var l=$(this);l.find("button").button().on("click",function(){l.dialog("close");return!1});k&&k.open&&
6k.open.call(l)}})}function H(c){c=c||"A";var k=qa[c];if(k)return k;k=(c.charCodeAt(0)+c.charCodeAt(c.length-1))%23;return qa[c]=k}function R(){var c=$("#"+b.divid+" #transcript");0<c.length&&c.animate({scrollTop:c.get(0).scrollHeight},250)}function U(){var c=a.data("onclose");a.hasClass("minimized")&&a.data("minimized-div").trigger("click");a.hasClass("disabled")||(a.addClass("disabled"),a.find("div.buttonbar div.closebutton").show(),a.find("#transcript").append("\x3cdiv\x3e
6(A transcript of this conversation is available in the Help Forum.)\x3c/div\x3e"),
7c&&(a.removeData("onclose"),setTimeout(c,1E3)))}function T(){var c=tinyMCE.get(b.divid+"-messagebody");a.css({visibility:"hidden"});setTimeout(function(){c&&c.destroy();a&&(a.remove(),a=null)},5E3)}function S(c){null==c&&(c=b.rooms[0]);c.elements.transcript.remove();c.elements.button.remove();c.elements.closebutton&&c.elements.closebutton.remove();a&&0==a.find("#transcript").find(".room-transcript").length&&(c=a.data("onclose"),T(),K(),T(),c&&setTimeout(c,1E3))}function ja(c){var k=a.find("#transcript"),
8l=a.find(".roombuttons");V+=(""==V?"":",")+c.id;c.elements={transcript:$("\x3cdiv id\x3d'room-"+c.id+"' class\x3d'room-transcript' data-roomid\x3d'"+c.id+"'\x3e\x3c/div\x3e"),button:$("\x3cbutton class\x3d'roombutton roombutton-"+c.id+"' title\x3d'Enter the "+c.name+" Room' data-roomid\x3d'"+c.id+"'\x3e"+c.buttonname+"\x3c/button\x3e")};k.append(c.elements.transcript);l.append(c.elements.button);qtip(c.elements.button);b.istutor&&(c.elements.closebutton=$("\x3cdiv class\x3d'roomclosebutton roomclosebutton-"+
9c.id+"' title\x3d'Close this conversation with "+c.buttonname+"'\x3e\x3cspan class\x3d'ui-icon ui-icon-close'\x3e\x3c/span\x3e\x3c/div\x3e"),l.append(c.elements.closebutton),qtip(c.elements.closebutton),c.elements.closebutton.button().on("click",function(){confirmDialog("Close the conversation with "+c.buttonname+"?",function(){Ajax("chat-emf","close-tutor-conversation",{roomid:c.id},function(){U(c)})});return!1}),Ajax("chat-emf","tutor-student-info",{roomid:c.id,seuid:c.seuid},function(n){n=$(n).find("reply \x3e recent");
10if(0<n.length){var p=n.attr("ssa"),C="./mainpage?cid\x3d"+n.attr("cid")+"\x26epid\x3d"+n.attr("epid")+"\x26ssa\x3d"+p,L=n.attr("euid"),v=n.attr("clid");c.info="\x3cdiv\x3eStudent "+("1"==n.find("sub")?"just submitted":"is working on")+" \x3ca href\x3d'"+C+"'\x3e"+n.attr("abbr")+"\x3c/a\x3e ("+n.attr("long")+", "+n.attr("wu")+")\x3c/div\x3e"+(L?"\x3cdiv style\x3d'color:dimgray;'\x3eSysAdmin: "+L+" "+v+"\x3c/div\x3e":"");a.find("div.chat-information").empty().append(c.info).show();b.ssa=p}}));c.elements.button.button().on("click",
11function(){var n=$(this),p=n.data("roomid"),C=k.find("div.room-transcript");k.find(".post,.threadcontainer").removeClass("selected");l.find("button").removeClass("ui-state-highlight");n.addClass("ui-state-highlight").removeClass("ui-message-new");C.removeClass("selected").hide();C.filter("#room-"+p).addClass("selected").slideDown(function(){R()});a.hasClass("events-done")&&O(!0);return!1})}function x(){$(document).off(".emfchatdiv");O(!1);a.hide()}function K(){clearTimeout(aa);aa=0}function W(){return parseInt(a.find(".room-transcript.selected").data("roomid"))}
12function O(c){var k=window.sessionStorage;c={pos:a.position(),width:a.width(),height:a.height(),visible:c,autoscroll:a.find("input[name\x3dautoscroll]").is(":checked"),ignoring:"",currentroomid:W(),rooms:[]};for(var l=0;l<M.length;l++)c.rooms[l]={id:M[l].id,bell:M[l].bell};for(var n in X)c.ignoring+=(""==c.ignoring?"":",")+n;k.setItem("chatdivdata-"+b.divid,JSON.stringify(c))}var M=b.rooms,a=$("#"+b.divid),qa={},ka=null,aa,X={},V="",ba={};emf.execute([function(c){"undefined"===typeof InitTinyMCE?
13Ajax("data","tinymcefiles",{},function(k){function l(p){p<n.length?$.getScript("/filedata/commonscripts/"+n[p],function(){l(p+1)}):delay(c)}var n=$(k).find("reply").attr("tinymcefiles").split(",");l(0)}):delay(c)},function(c){window.speechSynthesis&&(ka=window.speechSynthesis.getVoices(),window.speechSynthesis.onvoiceschanged=function(){ka=window.speechSynthesis.getVoices()});for(var k=0;k<M.length;k++)ba[M[k].id]=M[k];0<$("div.tutor-info").length&&(b.iamthetutor=!0);if(0==a.length){a=$("\x3cdiv id\x3d'"+
14b.divid+"' class\x3d'emf-chat-window' tabindex\x3d'1'\x3e\x3c/div\x3e");$("body").append(a);a.append("\x3cdiv id\x3d'status'\x3e\x3c/div\x3e\x3cdiv class\x3d'titlebar'\x3e"+b.title+"\x3cdiv class\x3d'buttonbar'\x3e\x3cdiv class\x3d'minimize-button' title\x3d'Minimize this window'\x3e\x3cspan class\x3d'ui-icon ui-icon-minus'\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv class\x3d'closebutton' title\x3d'Close'\x3e\x3cspan class\x3d'ui-icon ui-icon-close'\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'opensans chat-information'\x3e\x3c/div\x3e\x3cdiv id\x3d'transcript'\x3e\x3c/div\x3e\x3cdiv id\x3d'message'\x3e\x3ctextarea id\x3d'"+
15b.divid+"-messagebody'\x3e\x3c/textarea\x3e\x3c/div\x3e\x3cdiv class\x3d'buttondiv'\x3e\x3cdiv\x3e\x3cbutton class\x3d'sendbutton'\x3eSend\x3c/button\x3e\x3cbutton class\x3d'whobutton'\x3eRoster\x3c/button\x3e\x3cbutton class\x3d'emoji'\x3eEmojis\x3c/button\x3e "+(b.
15iamthetutor?"\x3cbutton title\x3d'Send a message to tech support, professors, or this student' class\x3d'messagebutton'\x3eMessage\x3c/button\x3e":"")+"\x3c/div\x3e\x3cdiv class\x3d'flex-space'\x3e\x3c/div\x3e\x3cdiv class\x3d'roombuttons'\x3e\x3c/div\x3e\x3cdiv class\x3d'flex-space'\x3e\x3c/div\x3e\x3cdiv class\x3d'other-controls'\x3e\x3cspan\x3e\x3cinput type\x3d'checkbox' name\x3d'autoscroll' title\x3d'Automatically scroll the transcript' checked\x3d'true' /\x3e\x3c!--\x3cspan style\x3d'color:#fff;'\x3eScroll\x3c/span\x3e--\x3e\x3c/span\x3e\x3cbutton class\x3d'optionsbutton'\x3eOptions\x3c/button\x3e"+
16(b.withentrytest?"\x3cbutton class\x3d'helpbutton'\x3eHelp\x3c/button\x3e":"")+"\x3c/div\x3e\x3c/div\x3e");var l=a.find(".roombuttons");qtip(a.find("input[name\x3dautoscroll]"));for(k=0;k<M.length;k++)ja(M[k]);l.find("button:eq(0)").trigger("click");a.resizable({stop:function(){O(!0)}});a.draggable({handle:a.find(".titlebar"),stop:function(){O(!0)}});$("#"+b.divid+"-messagebody").tinymce({script_url:tinymceroot+"js/tinymce/tinymce.min.js",setup:function(n){n.on("keyDown",function(p){switch(p.keyCode){case 13:return p.preventDefault(),
17p.stopPropagation(),delay(function(){a.find("button.sendbutton").trigger("click")}),!1;case 27:return b.istutor||(p.preventDefault(),p.stopPropagation(),delay(function(){x()})),!1}return!0});n.on("init",function(){emf.debug&&console.log("tinymce has initialized");delay(c)})},entity_encoding:"numeric",auto_focus:!0,removed_menuitems:"newdocument",elementpath:!1,statusbar:!1,toolbar:!1,width:"100%",height:"0.5in",plugins:["paste textcolor"],external_plugins:{},menubar:!1,content_css:"/scripts/emf/css/content-emf-chat.01.css",
18style_formats:[{title:"Code block",block:"pre"},{title:"Code inline",inline:"span",classes:"mono"},{title:"Technical symbols",inline:"span",classes:"math"},{title:"Script",inline:"span",classes:"meta"},{title:"SPECIAL SETS",inline:"span",classes:"mathspecial"}],valid_elements:"@[id|class|style|title],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,-sub,-sup,-blockquote,-table[border\x3d0|cellspacing|cellpadding|width|height|align|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],dd,dl,dt,abbr,acronym,col[align|span|valign|width],colgroup[align|span|valign|width],img[src]"});
19"undefined"!==typeof tinyMCE&&tinyMCE.get(b.divid+"-messagebody").initialized&&delay(c)}else delay(c)},function(c){a.show();$(document).off().on("keydown.emfchatdiv",function(v){if(!b.istutor&&27==v.keyCode)return v.preventDefault(),v.stopPropagation(),delay(x),!1});if(!a.hasClass("positioned")){var k=window.sessionStorage.getItem("chatdivdata-"+b.divid),l=($(window).height()-a.height())/2+$(window).scrollTop(),n=($(window).width()-a.width())/2+$(window).scrollLeft();a.addClass("positioned");if(k)try{var p=
20JSON.parse(k),C;l=p.pos.top;n=p.pos.left;a.width(p.width);a.height(p.height);a.find("input[name\x3dautoscroll]").prop("checked",p.autoscroll);if(p.rooms)for(C=0;C<p.rooms.length;C++)ba[p.rooms[C].id]&&(ba[p.rooms[C].id].bell=p.rooms[C].bell);
20if(""!=p.ignoring){var L=p.ignoring.split(",").map(function(v){return parseInt(v)});for(C=0;C<L.length;C++)X[L[C]]=!0}p.currentroomid&&a.find(".roombutton-"+p.currentroomid).trigger("click")}catch(v){emf.debug&&console.log(v)}k=$(window).height();p=$(window).width();
21l>k-64&&(l=k-a.height());n>p-64&&(n=p-a.width());32>l&&(l=32);64>n+p&&(n=32);a.css({top:l+"px",left:n+"px"});O(!0)}delay(function(){tinymce.execCommand("mceFocus",!1,b.divid+"-messagebody")});delay(c)},function(c){function k(q){q=$(q);var w="",A=!1;q.find("reply \x3e who \x3e p").each(function(){var y=$(this),r=y.attr("n"),d=y.attr("o"),g=parseInt(y.attr("u")),h=parseInt(y.attr("s")),u=parseInt(y.attr("sm")),z=H(d);ra[g]={uid:g,avatarname:d,euid:y.attr("euid"),name:r,status:h,divcount:z,silentseconds:u};
22w=ca?w+(", \x3cspan class\x3d'onewho' title\x3d'"+r+"'\x3e\x3ca class\x3d'whooptions' href\x3d'#' data-uid\x3d'"+g+"'\x3e"+d+"\x3c/a\x3e\x3c/span\x3e"):w+(", \x3cspan class\x3d'onewho'\x3e"+d+"\x3c/span\x3e");X[g]&&(A=!0)});w="{"+w.substring(1)+"}";A&&(w+="\x3cdiv style\x3d'margin:0.25em;text-align:center;'\x3e\x3ca href\x3d'#' style\x3d'font-size:smaller;' class\x3d'stopignoring'\x3eStop ignoring people\x3c/a\x3e\x3c/div\x3e");G("\x3ch3\x3eRoster Name\x3ch3\x3e\x3cdiv id\x3d'who'\x3e"+w+"\x3c/div\x3e",
23{class:"roster-name-dialog",open:function(){$("#who a.stopignoring").on("click",function(){$(this).remove();X={};O();return!1});$("#who a.whooptions").on("click",function(){var y=$(this).data("uid"),r=ra[y],d=$("\x3cdiv id\x3d'"+b.divid+"-options'\x3e\x3c/div\x3e");d.append("\x3cul class\x3d'options'\x3e\x3cli\x3e\x3cdiv\x3eAward \x3cinput type\x3d'text' style\x3d'text-align:center;' size\x3d'2' name\x3d'bonuspoints' value\x3d'' /\x3e wizard points \x3ca href\x3d'#' class\x3d'award'\x3eGo\x3c/a\x3e\x3c/div\x3e\x3c/li\x3e\x3cli\x3e\x3cdiv\x3e\x3ca href\x3d'#' class\x3d'remove'\x3eExpel immediately\x3c/a\x3e (re-admit via Admin|Chatrooms)\x3c/span\x3e\x3c/div\x3e\x3c/li\x3e\x3c/ul\x3e");
24d.dialog({modal:!0,title:r.avatarname+" ("+r.name+")",open:function(){$(this).find("a.award").on("click",function(){var g=$(this);Ajax("chat-emf","award",{roomid:W(),uid:y,points:parseInt(g.parent().find("input[name\x3dbonuspoints]").val()),emf:!0},function(h){alertDialog($(h).find("reply result").text(),function(){d.dialog("close")})});return!1})},buttons:{Close:function(){$(this).dialog("close")}},close:function(){$(this).dialog("destroy")}});d.find("a.remove").click(function(){d.hide();Ajax("chat-emf",
25"remove",{roomid:W(),uid:y},function(){})});return!1})}});L(q)}function l(){emf.execute([function(q){(function(w,A){$("\x3clink\x3e",{rel:"stylesheet",type:"text/css",href:w}).on("load",function(){"function"==typeof A&&A()}).appendTo("head")})("/scripts/js/rateyo/jquery.rateyo.css",q)},function(q){$.getScript("/scripts/js/rateyo/jquery.rateyo.js",q)},function(q){var w=b.rooms[0].buttonname;console.log(b);$("\x3cdiv\x3ePlease rate your conversation with Tutor "+w+":\x3cdiv class\x3d'rateyo'\x3e\x3c/div\x3e\x3cdiv\x3eOptional comment:\x3cdiv\x3e\x3ctextarea class\x3d'neucha rateyo-comment'\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e").dialog({modal:!0,
26title:"Rate My Tutor",width:"auto",buttons:{Ok:function(){function A(){Ajax("chat-emf","tutor-rating",{roomid:b.rooms[0].id,rating:2*r,comment:d});y.dialog("close")}var y=$(this),r=y.find("div.rateyo").rateYo("option","rating"),d=y.find("textarea").val();0==r?confirmDialog("\x3cp\x3eYou have awarded \x3ci\x3ezero stars\x3c/i\x3e to EMF Wizard Tutor "+w+".\x3c/p\x3e\x3cp\x3eIs this what you intended?\x3c/p\x3e",A):A()}},close:function(){$(this).dialog("destroy")},open:function(){$(this).find("div.rateyo").rateYo({rating:0,
27starWidth:"40px",halfStar:!0})}});delay(q)}])}function n(q){var w=!1,A=!1;if("expired"==q.attr("loginstatus"))return location.href="/eimacs/signin",!0;if(q.attr("dropped")){var y=parseInt(q.attr("droppedreason"));K();O(!1);T();G("\x3cp\x3eYou have been temporarily uninvited to this room "+(7==y?"because you are taking a test":99==y||5==y?"because your teacher has made the room invisible to you":1==y?"because you have been expelled":"while the room is cleaned")+".\x3c/p\x3e");return!0}q.find("rooms \x3e room").each(function(){var r=
28$(this),d=parseInt(r.attr("roomid")),g="1"==r.attr("expelled"),h="1"==r.attr("closed");g?(r=r.attr("until"),w=!0,K(),O(!1),G("\x3cp\x3eYou have been expelled"+(r?" until \x3cspan class\x3d'tzc'\x3e"+r+"\x3c/span\x3e":"")+".\x3c/p\x3e"),S(ba[d])):h?(console.log("room#"+d+" has been closed"),w=!0,U(ba[d]),"1"==q.attr("issysadmin")||b.iamatutor||l()):A=!0;return!0});return w&&!A}function p(){K();if(0==$("#"+b.divid).length)console.log("unexpected call to chatCheckMessages");else{var q=$.trim(tinyMCE.get(b.divid+
29"-messagebody").getContent()),w=""!=q&&q!=sa;sa=q;Ajax("chat-emf","messages",{roomid:V,lastmessageid:Y,action:w?"typing":"resting"},L,function(){0<fa&&(clearTimeout(aa),aa=setTimeout(p,fa))})}}function C(){v.find(".post").each(function(){var q=$(this),w=q.data("d").uid;X[w]&&q.remove()})}function L(q,w){var A=$(q).find("reply"),y="1"==A.attr("issysadmin"),r=1E3*parseInt(A.attr("nexttimeout")),d=A.attr("deleted"),g=!1,h=!1,u,z,E=new Date;3E3<=r&&(fa=r);if(!n(A)){if(null!=d)for(d=d.split(","),r=0;r<
30d.length;r++)$("div.m"+d[r]).remove();wa&&($("#status").empty().append("The administrator has placed you in \x3cem\x3eListening-only mode\x3c/em\x3e.").show("slow"),$("#"+b.divid+" button.sendbutton").css({visibility:"hidden"}),$("#message").hide("slow"),$("span.yourstatus").hide());A.find("messages \x3e m").each(function(){function e(I){I=I.replace(/(http[s]*:\/\/[^\s<]*)/gi,"\x3ca href\x3d'$1'\x3e$1\x3c/a\x3e");return I=I.replace(/([\s>]+)(www\.[^\s<]*)/gi,"$1\x3ca href\x3d'http://$2'\x3e$2\x3c/a\x3e")}
31var f=$(this),m=f.attr("c"),t=f.attr("i"),D=f.attr("n"),P=f.attr("a"),N=f.attr("l"),da=parseInt(f.attr("s")),Z=parseInt(f.attr("u")),J=0<da||xa?void 0:f.attr("w").split(",").map(function(I){return parseInt(I)}),la=f.find("t").text(),ma=2==Z||3==Z,na=function(){var I=D;P&&(I=P);if(y||J&&7==J[1]&&5==J[2])I="Professor "+I;return I}(),ha=parseInt(f.attr("rid")),ea=f.attr("euid"),ta=f.attr("wi");Y=t;if(0==v.find(".m"+t).length&&!X[Z]&&!v.find("#room-"+ha).hasClass("noentry"))if(1==da)-1==Z?setTimeout(function(){announcement(la)},
320):ma&&function(){var I=v.find("#room-"+ha);I.find(".statusmessage.typing-message").remove();I.append("\x3cdiv class\x3d'statusmessage m"+t+" "+(ca?"hoverc ":"")+"c"+(ma?" typing-message":"")+"'\x3e\x3cinput type\x3d'hidden' value\x3d'"+t+"' /\x3e\x3cspan class\x3d'time'\x3e"+m+":\x3c/span\x3e "+(ca?" \x3ca href\x3d'#' class\x3d'toremove'\x3eRemove\x3c/a\x3e ":"")+"\x3cspan class\x3d'sysmessage newmessage message' style\x3d'visibility:hidden;'\x3e"+la+"\x3c/span\x3e\x3c/div\x3e");g=!0}();else{da=
33H(na);var ia=J?emf.thewizardthemerolenames[J[0]][J[1]]:"",oa=f.attr("t");J&&0<J[2]&&(ia+=" Level "+J[2]);N&&(ia+=" from "+N);N=$("\x3cdiv class\x3d'post newpost m"+t+" hoverc c"+da+(oa?" threaded":"")+"' \x3e\x3cinput type\x3d'hidden' name\x3d'mid' value\x3d'"+t+"' /\x3e"+(oa?"\x3cinput type\x3d'hidden' name\x3d'threadid' value\x3d'"+oa+"' /\x3e":"")+(J?"\x3cimg title\x3d'"+ia+"' src\x3d'wizardimage?i\x3d"
33+ta+"' class\x3d'whichwizard' /\x3e":"")+"\x3cspan class\x3d'time'\x3e"+m+"\x3c/span\x3e "+(ma?
34"":"\x3cspan\x3e"+na+":\x3c/span\x3e ")+(7>J[1]||5>J[2]?"\x3ca href\x3d'#' class\x3d'toflag'\x3eFlag message\x3c/a\x3e \x3ca href\x3d'#' class\x3d'toignore'\x3eIgnore wizard\x3c/a\x3e":"")+(y?" \x3ca href\x3d'userprofile?uid\x3d"+ea+"' class\x3d'userprofile'\x3e\x3cinput type\x3d'hidden' name\x3d'uid' value\x3d'"+Z+"' /\x3e\x3cinput type\x3d'hidden' name\x3d'euid' value\x3d'"+ea+"' /\x3e\x3cinput type\x3d'hidden' name\x3d'username' value\x3d'"+D+"' /\x3e["+Z+": "+D+"]\x3c/a\x3e \x3ca title\x3d'Remove this message' href\x3d'#' class\x3d'toremove'\x3eRemove\x3c/a\x3e"+
35(7>J[1]||5>J[2]?" \x3ca title\x3d'Temporarily expel "+D+"' href\x3d'#' class\x3d'toexpel'\x3eExpel\x3c/a\x3e":""):"")+"\x3cdiv class\x3d'newmessage message' style\x3d'visibility:hidden;'\x3e"+e($.fn.emoji.encode(la))+"\x3c/div\x3e\x3c/div\x3e");b.ssa&&N.find("a.ssalink").each(function(){$(this).attr("href",$(this).attr("href")+"\x26ssa\x3d"+b.ssa)});N.find("img").on("mouseenter",function(){var I=$(this),ua=$("\x3cdiv class\x3d'wizpopup'\x3e\x3cimg src\x3d'wizardimage?i\x3d"+ta+"'/\x3e\x3cdiv class\x3d'wiztitle'\x3e"+
36na+", "+(0<="AE".indexOf(ia.charAt(0))?"an":"a")+" "+ia+"\x3c/div\x3e\x3c/div\x3e");a.find(".wizpopup").remove();a.append(ua);ua.position({my:"center bottom",at:"center top",of:I,collision:"none"})}).on("mouseleave",function(){a.find(".wizpopup").remove()});ea=v.find("#room-"+ha);ea.append(N);ea.hasClass("selected")||a.find(".roombuttons button").filter("room-"+ea.data("roomid")).addClass("ui-message-new");N.data("d",{uid:Z,name:D,roomid:ha});h=g=!0;ba[ha].bell&&(u=$(la).text(),z="1"==f.attr("m"))}});
37v.find(".statusmessage").each(function(){var e=$(this),f=e.find("span.time").data("time");2<(E-f)/1E3/60&&e.remove()});if(g){d=v.find(".newpost");d.filter(".threaded").each(function(){var e=$(this),f=parseInt(e.find("input[name\x3dthreadid]").val()),m=v.find(".m"+f),t=m.parent(".threadcontainer");0==t.length&&(m.wrap("\x3cdiv class\x3d'threadcontainer t-"+f+"'\x3e\x3c/div\x3e"),t=m.parent(".threadcontainer"),m.hasClass("selected")&&(v.find(".threadcontainer.selected,.post.selected").removeClass("selected"),
38t.addClass("selected")));t.append(e);e=t.find(".post:gt(0)").not(t.find(".post:last"));1<e.length&&(f=t.find(".threadopener"),0==f.length&&(f=$("\x3cdiv class\x3d'threadopener'\x3e\x3ca href\x3d'#'\x3eView more ...\x3c/a\x3e\x3c/div\x3e"),t.append(f),f.find("a").on("click",function(){var D=$(this),P=t.find(".post:gt(0)").not(t.find(".post:last"));t.hasClass("opened")?(P.hide(),D.text("View more ...")):(P.show(),D.text("View less ..."));t.toggleClass("opened");return!1})),t.find(".post:last").before(f),
39t.hasClass("opened")||e.hide());t.parent().append(t)});d.removeClass("newpost");
39v.find("div.room-transcript").each(function(){var e=$(this),f=e.find("div.post");if(!b.istutor&&12<e.find("div.post").length){for(var m=0;m<f.length-10;m++){var t=f.eq(m),D=t.find("span.time").data("time");if(5<(E-D)/1E3/60)t.remove();else break}e.find("\x3e div.threadcontainer").each(function(){var P=$(this),N=P.find("div.post:last"),da=N.find("span.time").data("time");(0==N.length||7<(E-da)/1E3/60)&&P.remove()})}});
40a.find("input[name\x3dautoscroll]").is(":checked")&&R();d.unbind().hover(function(){$(this).find("a.userprofile,a.toremove,a.toexpel,a.toflag,a.toignore").fadeIn()},function(){$(this).find("a.userprofile,a.toremove,a.toexpel,a.toflag,a.toignore").fadeOut()}).find("a.toexpel").off(".msgevent").on("click.msgevent",function(){var e=$(this).parents(".hoverc").data("d"),f=e.uid;e=e.name;$("\x3cdiv\x3eExpel\x3cdiv style\x3d'margin-left:2em;'\x3e\x3cdiv style\x3d'margin-top:0.5em;'\x3e\x3cinput type\x3d'radio' name\x3d'expeluntil' value\x3d'0' checked\x3d'true' /\x3e for \x3cinput type\x3d'text' name\x3d'minutes' value\x3d'1' size\x3d'1' style\x3d'text-align:center;'/\x3e minutes\x3c/div\x3e\x3cdiv style\x3d'margin-top:0.5em;'\x3e\x3cinput type\x3d'radio' name\x3d'expeluntil' value\x3d'2' /\x3e until \x3cspan class\x3d'tzc dtp' title\x3d'expeluntildate'\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv style\x3d'margin-top:0.5em;'\x3e\x3cinput type\x3d'radio' name\x3d'expeluntil' value\x3d'1' /\x3e until manually reinstated\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e").dialog({title:"Expel "+
41e,width:"auto",modal:!0,open:function(){var m=$(this);tz.process();m.find(".datepicker").on("click",function(){m.find("input[type\x3dradio]:eq(1)").prop("checked",!0)});m.find("input[name\x3dminutes]").on("click",function(){m.find("input[type\x3dradio]:eq(0)").prop("checked",!0)})},buttons:{OK:function(){var m=$(this);Ajax("chat-emf","expel",{uid:f,roomid:V,permanent:"1"==m.find("input[name\x3dexpeluntil]:checked").val(),minutes:m.find("input[name\x3dminutes]").val(),until:"2"==m.find("input[type\x3dradio]:checked").val()?
42m.find("input[name\x3dexpeluntildate]").val():null});m.dialog("close")},Cancel:function(){$(this).dialog("close")}},close:function(){$(this).dialog("destroy")}});return!1}).end().find("a.toremove").off(".msgevent").on("click.msgevent",function(){var e=$
42(this).parent().find("input").val(),f=$(this).parents(".hoverc").data("d").roomid;K();$(this).parents(".hoverc").remove();Ajax("chat-emf","removemessage",{roomid:f,lastmessageid:Y,mid:e},L);return!1}).end().find("a.toflag").off(".msgevent").on("click.msgevent",
43function(){var e=$(this).parent().find("input").val(),f=$(this).parents(".hoverc"),m=f.data("d").roomid;K();$("\x3cdiv id\x3d'toflagdlg'\x3e\x3cp\x3eClick the OK button to flag this post as needing review by a professor.\x3c/p\x3e\x3cp\x3e(Please do NOT flag messages unless you are fairly certain that a professor will want to take immediate action to redress the issue.)\x3c/p\x3e\x3c/div\x3e").dialog({title:"Flag this post",buttons:{OK:function(){f.remove();alertDialog("The message has been temporarily removed and flagged for review. Thank you for your help.");
44$(this).dialog("close");Ajax("chat-emf","flag",{roomid:m,lastmessageid:Y,mid:e},L)},Cancel:function(){$(this).dialog("close")}},modal:!0,close:function(){$(this).dialog("destroy")}});return!1}).end().find("a.toignore").off(".msgevent").on("click.msgevent",function(){var e=$
44(this).parents(".hoverc").data("d").uid;confirmDialog("\x3cp\x3eIgnore this wizard ... are you sure?\x3c/p\x3e\x3cp\x3e(To stop ignoring fellow wizards, use the \x3ci\x3eRoster\x3c/i\x3e button.)\x3c/p\x3e",function(){X[e]=!0;K();
45O(!0);C()});return!1}).end().filter(".post").on("click",function(e){if("A"===e.target.nodeName)return!0;e=$(this);var f=e.parent(".threadcontainer"),m=e.hasClass("selected")||f.hasClass("selected")||0<f.find(".post.selected").length;v.find(".threadcontainer.selected,.post.selected").removeClass("selected");0<f.length?(f.find(".post").removeClass("selected"),m?f.removeClass("selected"):f.addClass("selected")):m?e.removeClass("selected"):e.addClass("selected");return!1});v.find(".threadcontainer").off("click.emfchat").on("click.emfchat",
46function(e){if("A"===e.target.nodeName)return!0;e=$(this);var f=e.hasClass("selected");v.find(".threadcontainer.selected,.post.selected").removeClass("selected");f?e.removeClass("selected"):e.addClass("selected");return!1});v.off("click.emfchat").on("click.emfchat",function(e){if("A"===e.target.nodeName)return!0;v.find(".threadcontainer.selected,.post.selected").removeClass("selected");return!1});var Q=v.find(".newmessage");
46processMathJax(Q,function(){Q.each(function(){var e=$(this).parent().find("span.time:not(.done)"),
47f=e.text();if(f){f=new Date(f);var m=f.getHours();var t="am",D=""+f.getMinutes();12<=m?(t="pm",12<m&&(m-=12)):0==m&&(m+=12);1==D.length&&(D="0"+D);m=m+":"+D+t;e.data("time",f);e.addClass("done").text(m)}});Q.removeClass("newmessage").css("visibility","inherit")});q=parseInt($(q).find("reply").attr("count"));isNaN(q)||$("div.chatroomannouncements .scroll2 .message").text(0==q?"No one available right now.":q+" wizard"+(1<q?"s":"")+".");h&&!0!==w&&"on"===$.cookie("emf-chat-room-bell")&&u&&B(u,z);"1"==
48A.attr("issysadmin")&&A.find("rooms \x3e room").each(function(e){switch($(this).attr("hasstudent")){case "0":a.find(".roombuttons button:eq("+e+")").hide();break;case "1":a.find(".roombuttons button:eq("+e+")").show()}});w||!a.hasClass("minimized")||a.hasClass("initializing")||a.data("minimized-div").trigger("click")}0<fa&&(clearTimeout(aa),aa=setTimeout(p,fa))}}var v=$("#transcript"),Y=0,fa=1E4,va=0,ra=[],wa=!1,sa="",ca=!1,pa=!1,ya="undefined"!=typeof emf&&8==emf.skin,xa=!("undefined"!=typeof emf&&
492==emf.skin)&&!ya;a.hasClass("events-done")?(delay(p),delay(c)):(a.find(".sendbutton,.clearbutton,.whobutton,.closebutton,.minimize-button,.messagebutton").button(),a.find("button.helpbutton").button({showLabel:!1,icon:"ui-icon-help"}),a.find("button.optionsbutton").button({showLabel:!1,icon:"ui-icon-gear"}),a.find("button.emoji").button({showLabel:!1,icon:"ui-icon-emoji"}),a.find("input[name\x3dautoscroll]").on("change",function(){O(!0)}),a.addClass("events-done initializing").css({visibility:"hidden"}),
50Ajax("chat-emf","join",{roomid:V,emf:!0},function(q){var w=$(q).find("reply");n(w)||function(){function A(d){a.find("a.mathjaxhelp").on("click",function(){Ajax("data","file",{file:"/scripts/htm/mathjaxhelp.htm"},function(g){var h=$($(g).find("reply \x3e file").text());h.append("\x3cdiv style\x3d'text-align:center;'\x3e\x3cbutton\x3eClose\x3c/button\x3e\x3c/div\x3e");processMathJax(h,function(){h.find("button").button().on("click",function(){a.find("#mathjaxhelpdiv").remove();delay(d);return!1});a.find("#curveybracket-help").hide();
51a.append(h)})});return!1})}function y(){a.css({width:"",height:""});a.find("#transcript,#message,.buttondiv,.emojipopup").hide();Ajax("data","file",{file:"/scripts/htm/curlybracket-onequestion.htm"},function(d){function g(){var E=u.eq(0|Math.random()*u.length).text().split("|"),Q=E[0];h.find(".mustbemathjax").hide();h.find(".theexpression").css({visibility:"hidden"}).text("\\("+E[0]+"\\)");processMathJax(h,function(){a.append(h);h.find(".theanswer").show();h.find(".theexpression").css({visibility:"inherit"});
52h.find("input").focus();A(function(){a.find("#curveybracket-help").show();h.find("input").focus()});z.off("click.onequestion").button().on("click.onequestion",function(){var e=$.trim(h.find("input").val()),f=!1,m=!1;try{if(4>e.length||0!=e.indexOf("\\(")||"\\)"!=e.substring(e.length-2))throw"Your expression must start with \x3cspan class\x3d'nomj'\x3e\\\x3cspan\x3e(\x3c/span\x3e\x3c/span\x3e and end with \x3cspan class\x3d'nomj'\x3e\\\x3cspan\x3e)\x3c/span\x3e\x3c/span\x3e.";for(var t=e.replace(/\s+/g,
53""),D=0;D<E.length;D++)t=="\\("+E[D].replace(/\s+/g,"")+"\\)"&&(f=!0);if(!f){var P="Your answer produced "+e+". The correct answer is \x3cspan class\x3d'correctanswer'\x3e\\\x3cspan\x3e(\x3c/span\x3e"+Q+"\\\x3cspan\x3e)\x3cspan\x3e\x3c/span\x3e.";h.find(".theanswer").slideUp(function(){h.find(".theanswer").find("input").val("")});m=!0;throw P;}h.find(".mustbemathjax").empty().append("Correct!").slideDown();$.cookie("emf-chat-room-one-question-asked","yes");setTimeout(function(){$("#curveybracket-help").remove();
54a.find("#transcript,#message,.buttondiv").show()},1E3)}catch(N){h.find(".mustbemathjax").empty().append(N),processMathJax(h.find(".mustbemathjax"),function(){h.find(".mustbemathjax").slideDown();h.find("input").focus();m&&setTimeout(g,5E3)})}return!1})})}var h=$($(d).find("reply \x3e file").text()),u=h.find(".expressions \x3e div"),z=h.find("button.gobutton");h.find("input").on("keypress",function(E){13==E.which&&delay(function(){z.trigger("click")});return!0});g()})}ca=pa=1==w.attr("issysadmin");
55$(q).find("rooms \x3e room").each(function(){var d=$(this),g=parseInt(d.attr("cannotjoinreason"));"1"==d.attr("isadmin")&&(ca=!0);"1"==d.attr("issysadmin")&&(pa=!0);if(4<=g){d=parseInt(d.attr("roomid"));var h=a.find("button.roombutton-"+d);h.addClass("cannotenter");a.find("#room-"+d).addClass("noentry");7==g?(x(),alertDialog("You cannot enter this room because you are currently taking a test.",function(){delay(function(){x();K();$.cookie("emf-chat-room","off");a.add("div.chatroomannouncements").remove()})})):
566==g?qtip(h,"You cannot enter this room because you have skipped at least one exercise."):5==g?qtip(h,"You cannot enter this room because you are less than one week ahead of schedule."):4==g&&qtip(h,"You cannot enter this room because your grade is less than 90%.")}});parseInt(w.attr("skin"));var r=$("#"+b.divid);ca&&r.find("button.admin").show();if(b.istutor)tinyMCE.get(b.divid+"-messagebody").on("keypress",function(d){13!=d.which&&(d=(new Date).getTime(),d>va&&(va=d+1E4,setTimeout(function(){var g=
57$.fn.emoji.decode(tinyMCE.get(b.divid+"-messagebody").getContent());emf.debug&&console.log("Reporting typing "+g);Ajax("chat-emf","tutee-is-typing",{roomid:W(),message:g,threadid:0,lastmessageid:Y,ob:$
57("input[name\x3donbehalf]").val(),iamatutor:b.iamatutor},function(){})},1E3)));return!0});r.find("button.sendbutton").click(function(){var d=tinyMCE.get(b.divid+"-messagebody"),g=$.fn.emoji.decode(d.getContent()),h=$("#transcript div.post.selected input[name\x3dmid]").val();h||=$("#transcript div.threadcontainer.selected div.post:eq(0) input[name\x3dmid]").val();
58if(""!=g){var u=W();a.find("#room-"+u).hasClass("noentry")?G("You do not currently have access to this room."):(K(),d.setContent(""),Ajax("chat-emf","send",{roomid:u,message:g,threadid:b.istutor?0:h,lastmessageid:Y,ob:$("input[name\x3donbehalf]").val()},function(z){L(z,!0)}))}return!1});r.find("button.clearbutton").click(function(){v.empty();return!1});r.find("button.helpbutton").on("click",function(){var d="yes"!==$.cookie("emf-chat-room-one-question-asked");Ajax("data","file",{file:"/scripts/htm/curlybracket-help.htm"},
59function(g){$.cookie("emf-chat-room-help-shown","yes");a.css({width:"",height:""});a.find("#transcript,#message,.buttondiv,.emojipopup").hide();a.append($(g).find("reply \x3e file").text());a.find("button.helpclose").button().on("click",function(){a.find("#curveybracket-help").remove();d?y():a.find("#transcript,#message,.buttondiv").show();return!1});A(function(){a.find("#transcript,#message,.buttondiv").show()});a.find("a.linkshelp").on("click",function(){Ajax("data","file",{file:"/scripts/htm/chatroom-linkshelp.htm"},
60function(h){var u=$($(h).find("reply \x3e file").text());u.append("\x3cdiv style\x3d'text-align:center;'\x3e\x3cbutton\x3eClose\x3c/button\x3e\x3c/div\x3e");processMathJax(u,function(){u.find("button").button().on("click",function(){a.find("#mathjaxhelpdiv").remove();a.find("#transcript,#message,.buttondiv").show();"yes"!==$.cookie("emf-chat-room-one-question-asked")&&delay(y);return!1});a.find("#curveybracket-help").remove();a.append(u)})});return!1})});return!1});r.find("button.optionsbutton").on("click",
61function(){var d=$("\x3cul class\x3d'emf-chat-menu'\x3e\x3cli\x3eSettings ...\x3c/li\x3e"+(b.istutor?"":"\x3cli\x3eHide\x3c/li\x3e")+(b.istutor?"":"\x3cli\x3eLeave\x3c/li\x3e")+"\x3c/ul\x3e"),g=$(this);$("body").find(".emf-chat-menu").remove().end().append(d);d.menu({create:function(h){d.position({my:"center",at:"center",of:g})},select:function(h,u){switch(u.item.text()){case "Leave":$("\x3cdiv\x3e\x3cp\x3eThis room will be made invisible until you restart your browser.\x3c/p\x3e\x3c/div\x3e").dialog({modal:!0,
62buttons:{OK:function(){x();K();$.cookie("emf-chat-room","off");a.add("div.chatroomannouncements").remove();$(this).dialog("close");Ajax("chat-emf","exit",{roomid:V,emf:!0})},Cancel:function(){$(this).dialog("close")}},title:b.title,close:function(){$(this).dialog("destroy")}});break;case "Hide":x();break;case "Settings ...":h="";for(u=0;u<M.length;u++)h+=" \x3cinput type\x3d'checkbox' name\x3d'forroom' "+(M[u].bell?" checked\x3d'true'":"")+" value\x3d'"+u+"' /\x3e"+M[u].buttonname;$("\x3cdiv\x3e\x3cp\x3e\x3cinput type\x3d'checkbox' name\x3d'bell' value\x3d'1'"+
63("on"===$.cookie("emf-chat-room-bell")?" checked\x3d'true'":"")+" /\x3e Ring bell for new postings:\x3c/p\x3e\x3cdiv style\x3d'margin:1em;2em;'\x3e\x3cdiv\x3e\x3cinput type\x3d'radio' name\x3d'bellchoice' value\x3d'0'\x3e Bell\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d'radio' name\x3d'bellchoice' value\x3d'1'\x3e Students talking\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d'radio' name\x3d'bellchoice' value\x3d'2'\x3e Bonk\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d'radio' name\x3d'bellchoice' value\x3d'3'\x3e Harp\x3c/div\x3e"+
64(window.speechSynthesis?"\x3cdiv\x3e\x3cinput type\x3d'radio' name\x3d'bellchoice' value\x3d'-1'\x3e Read me the last message\x3c/div\x3e":"")+"\x3cdiv style\x3d'margin-top:0.5em;'\x3e for rooms "+h+"\x3c/div\x3e\x3c/div\x3e"+(pa&&!b.istutor?"\x3cdiv class\x3d'ui-widget ui-widget-content ui-corner-all' style\x3d'padding: 0.25em;'\x3eSysAdmin:\x3cdiv\x3eExpel UID \x3cinput type\x3d'text' name\x3d'expeluid' value\x3d'' size\x3d'5' /\x3e until \x3cspan class\x3d'tzc dp' title\x3d'expeluntildate'\x3e\x3c/span\x3e \x3cbutton class\x3d'expeluntilgo'\x3eGo\x3c/button\x3e\x3c/div\x3e\x3c/div\x3e":
65"")+"\x3c/div\x3e").dialog({modal:!0,width:"auto",open:function(){var z=$(this),E=parseInt($.cookie("emf-chat-room-bell-value"));z.find("input[type\x3dradio][name\x3dbellchoice]").on("click",function(){z.find("input[name\x3dbell]").prop("checked",!0);return!0});isNaN(E)&&(E=0);z.find("input[name\x3dbellchoice][value\x3d"+E+"]").prop("checked",!0);z.find("button.expeluntilgo").button().on("click",function(){Ajax("chat-emf","expel",{uid:z.find("input[name\x3dexpeluid]").val(),roomid:V,permanent:!1,
66minutes:0,until:z.find("input[name\x3dexpeluntildate]").val()});z.dialog("close");return!1});tz.process()},buttons:{OK:function(){var z=$(this);z.find("input[name\x3dforroom]").each(function(E){var Q=$(this).is(":checked");M[E].bell=Q});$.cookie("emf-chat-room-bell",z.find("input[name\x3dbell]:checked").val()?"on":"off");$.cookie("emf-chat-room-bell-value",z.find("input[name\x3dbellchoice]:checked").val());$(this).dialog("close");"on"===$.cookie("emf-chat-room-bell")&&0>parseInt($.cookie("emf-chat-room-bell-value"))&&
67B("We will read messages as they arrive",.5>Math.random());O(!0)},Cancel:function(){$(this).dialog("close")}},title:b.title,close:function(){$(this).dialog("destroy")}})}return!0}});d.on("mouseleave",function(){d.remove()});return!1});r.find("button.emoji").on("click",function(){var d=a.find(".emojipopup");if(0<d.length)d[d.is(":visible")?"hide":"show"]();else{$.fn.emoji.init();var g=$("\x3cdiv class\x3d'emojipopup'\x3e\x3c/div\x3e");d=$("\x3cdiv class\x3d'contains'\x3e\x3c/div\x3e");for(var h=$.emojikeys.split("|"),
68u=0;
68u<h.length;u++)d.append("\x3cimg src\x3d'/scripts/emf/css/images/emojis/"+h[u]+".png' /\x3e");g.append(d);a.find(".buttondiv").before(g);g.find("img").on("click",function(){var z=tinyMCE.get(b.divid+"-messagebody"),E=$(this).prevAll().length,Q=z.selection.getRng(),e=$(z.getDoc().createElement("img")),f=e.get(0);e.attr({src:"/scripts/emf/css/images/emojis/"+h[E]+".png"});e.addClass("emoji");Q.insertNode(f);try{z.selection.select(f,!0),z.selection.collapse(!1),tinymce.execCommand("mceFocus",!1,
69b.divid+"-messagebody")}catch(m){}g.hide();return!1})}return!1});r.find("button.whobutton").click(function(){0==$(".roster-name-dialog").length&&(K(),Ajax("chat-emf","who",{roomid:W(),lastmessageid:Y,ob:$("input[name\x3donbehalf]").val()},k));return!1});r.find("div.closebutton").on("click",function(){if(b.istutor){var d=b.rooms[0];r.hasClass("disabled")?S(d):confirmDialog("Close the conversation with "+d.buttonname+"?",function(){Ajax("chat-emf","close-tutor-conversation",{roomid:d.id},function(){U(d)})})}else delay(x);
70return!1});r.find("button.messagebutton").on("click",function(){$("\x3cdiv\x3e\x3cdiv class\x3d'ui-widget ui-corner-all ui-widget-content' style\x3d'padding:0.25em;margin:0.25em;'\x3e\x3cdiv class\x3d'flex' style\x3d'align-items:flex-start;justify-content:center;'\x3e\x3cdiv\x3eSend to\x3c/div\x3e\x3cdiv style\x3d'margin-left:1em;'\x3e\x3cdiv\x3e\x3cinput type\x3d'checkbox' value\x3d'0' checked\x3d'true' /\x3e Tech support via Help Forum\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d'checkbox' value\x3d'1' /\x3e Professors via email alert\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d'checkbox' value\x3d'2' /\x3e "+
71b.rooms[0].buttonname+" via internal mail\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'ui-widget ui-corner-all ui-widget-content' style\x3d'padding:0.5em;margin:0.25em;'\x3e\x3cdiv\x3eSubject: \x3cinput type\x3d'text' name\x3d'subject' style\x3d'width:4.3in;' value\x3d'Tutor conversation with "+function(d){return null==d?"":d.replace(/"/g,"\x26quot;'").replace(/'/g,"\x26#39;")}(b.rooms[0].buttonname)+"'\x3e\x3c/div\x3e\x3cdiv\x3e\x3ctextarea style\x3d'width:5in;height:2in;margin:0.25em;'\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e").dialog({buttons:{Send:function(){var d=
72$(this),g=b.rooms[0];g={roomid:W(),ts:d.find("input[type\x3dcheckbox][value\x3d0]").prop("checked"),ps:d.find("input[type\x3dcheckbox][value\x3d1]").prop("checked"),is:d.find("input[type\x3dcheckbox][value\x3d2]").prop("checked"),subject:$.trim(d.find("input[name\x3dsubject]").val()),message:$.trim(d.find("textarea").val()),seuid:g.seuid};if(!g.ts&&!g.ps&&!g.is)return alertDialog("Please choose one or more recipients."),!1;if(""==g.subject||""==g.message)return alertDialog("Please provide a subject and a message."),
73!1;Ajax("chat-emf","tutor-message",g,function(){d.dialog("close");alertDialog("Your message has been sent.")})},Cancel:function(){$(this).dialog("close")}},close:function(){$(this).dialog("destroy")},title:"Send a Message",width:"auto",modal:!0});return!1});r.find("div.minimize-button").on("click",function(){var d=$("\x3cdiv class\x3d'emf-chat-restore-icon "+(b.divid+"-restore'\x3e")+(b.istutor?b.rooms[0].buttonname:"The Curly Bracket")+"\x3c/div\x3e"),g=$("body").find("div.emf-chat-restore-icons");
74delay(x);a.addClass("minimized");$.cookie("emf-chat-minimized-"+b.divid,"yes");0==g.length&&(g=$("\x3cdiv class\x3d'emf-chat-restore-icons'\x3e\x3c/div\x3e"),$("body").append(g));g.append(d);a.data("minimized-div",d);d.on("click",function(){$.cookie("emf-chat-minimized-"+b.divid,"no");a.removeData("minimized-div");a.removeClass("minimized");d.remove();showChatroomWindow(b)});return!1});a.css({visibility:"inherit"});"yes"==$.cookie("emf-chat-minimized-"+b.divid)&&($("#"+b.divid+" div.minimize-button").trigger("click"),
75x());L(q,!0,0);!1!==b.withwarning&&"yes"!==$.cookie("emf-chat-room-help-shown")?delay(function(){$("#"+b.divid+" button.helpbutton").button().trigger("click")}):!1!==b.withentrytest&&"yes"!==$.cookie("emf-chat-room-one-question-asked")&&delay(y);a.removeClass("initializing");b.onopen&&delay(b.onopen);delay(c)}()}))},function(c){a.data("d",{closeRoom:S});delay(c)},function(c){if(b.istutor){var k=window.sessionStorage,l=k.getItem("tutorinfo");l?l=JSON.parse(l):(l={activeroomids:{}},k.setItem("tutorinfo",
76JSON.stringify(l)));l.activeroomids[b.rooms[0].id]||(F(5),l.activeroomids[b.rooms[0].id]=!0,k.setItem("tutorinfo",JSON.stringify(l)))}delay(c)}])}
77function openTutor(b){Ajax("helpforum","request-tutor-chat",{euid:b.euid,skin:2},function(F){var B=[];"1"==$(F).find("reply").attr("isbusy")?alertDialog("Currently, "+b.tutor+" is busy with another student. Please try again in a few minutes."):($(F).find("reply \x3e rooms \x3e room").each(function(){var G=$(this);G={id:parseInt(G.attr("id")),buttonname:G.attr("bn"),bell:!0};B.push(G)}),showChatroomWindow({title:"EMF Tutor Service",rooms:B,divid:"emf-tutor",istutor:!0,withwarning:!1,withentrytest:!1}))})}
78function lookForTutorRooms(b,F,B){var G=[];$(b).find("reply \x3e rooms \x3e room").each(function(){var H=$(this),R=parseInt(H.attr("flags"));H={seuid:H.attr("seuid"),id:parseInt(H.attr("id")),buttonname:H.attr(F?"name":"bn"),bell:!0};0!=(R&16)&&G.push(H)});0<G.length&&(b=$("#emf-tutor"),b.hasClass("disabled")&&(b.data("d").closeRoom(),b=$()),0==b.length&&showChatroomWindow({rooms:G,title:"My Tutor Room",divid:"emf-tutor",istutor:!0,withwarning:!1,withentrytest:!1,iamatutor:!0,onopen:B}))}
79(function(b){function F(){if(!b.emojikeys){var B=[0,1,2,14,17,19,20,22,43,47,52,55,58,59,63,64,65,68,69,72,74,80,88,91,94,95,98,99,104,112,119,122,126,132,138,142,148,152,187,191,192,211,212,232,234,236,242,271,280,300,312,335,336,337,350,385,390,395,406,427,503,516,545,566,579,610,626,627,658,664,686,687,693,695,698,706,709,722,736,751,769,785,790,795,815,842,854,861,863,869],G="thumbsup1 -1 100 109 1234 8ball a ab abc abcd accept aerial_tramway airplane alarm_clock alien ambulance anch
79or angel anger angry anguished ant apple aquarius aries arrow_backward arrow_double_down arrow_double_up arrow_down arrow_down_small arrow_forward arrow_heading_down arrow_heading_up arrow_left arrow_lower_left arrow_lower_right arrow_right arrow_right_hook arrow_up arrow_up_down arrow_up_small arrow_upper_left arrow_upper_right arrows_clockwise arrows_counterclockwise art articulated_lorry astonished atm b baby baby_bottle baby_chick baby_symbol baggage_claim balloon ballot_box_with_check bamboo banana bangbang bank bar_chart barber baseball basketball bath bathtub battery bear bee beer beers beetle beginner bell bento bicyclist bike bikini bird birthday black_circle black_joker black_nib black_square black_square_button blossom blowfish blue_book blue_car blue_heart blush boar boat bomb book bookmark bookmark_tabs books boom boot bouquet bow bowling bowtie boy bread bride_with_veil bridge_at_night briefcase broken_heart bug bulb bullettrain_front bullettrain_side bus busstop bust_in_silhouette busts_in_silhouette cactus cake calendar calling camel camera cancer candy capital_abcd capricorn car card_index carousel_horse cat cat2 cd chart chart_with_downwards_trend chart_with_upwards_trend checkered_flag cherries cherry_blossom chestnut chicken children_crossing chocolate_bar christmas_tree church cinema circus_tent city_sunrise city_sunset cl clap clapper clipboard clock1 clock10 clock1030 clock11 clock1130 clock12 clock1230 clock130 clock2 clock230 clock3 clock330 clock4 clock430 clock5 clock530 clock6 clock630 clock7 clock730 clock8 clock830 clock9 clock930 closed_book closed_lock_with_key closed_umbrella cloud clubs cn cocktail coffee cold_sweat collision computer confetti_ball confounded confused congratulations construction construction_worker convenience_store cookie cool cop copyright corn couple couple_with_heart couplekiss cow cow2 credit_card crocodile crossed_flags crown cry crying_cat_face crystal_ball cupid curly_loop currency_exchange curry custard customs cyclone dancer dancers dango dart dash date de deciduous_tree department_store diamond_shape_with_a_dot_inside diamonds disappointed dizzy dizzy_face do_not_litter dog dog2 dollar dolls dolphin door doughnut dragon dragon_face dress dromedary_camel droplet dvd e-mail ear ear_of_rice earth_africa earth_americas earth_asia egg eggplant eight eight_pointed_black_star eight_spoked_asterisk electric_plug elephant email end envelope es euro european_castle european_post_office evergreen_tree exclamation expressionless eyeglasses eyes facepunch factory fallen_leaf family fast_forward fax fearful feelsgood feet ferris_wheel file_folder finnadie fire fire_engine fireworks first_quarter_moon first_quarter_moon_with_face fish fish_cake fishing_pole_and_fish fist five flags flashlight floppy_disk flower_playing_cards flushed foggy football fork_and_knife fountain four four_leaf_clover fr free fried_shrimp fries frog frowning fuelpump full_moon full_moon_with_face game_die gb gem gemini ghost gift gift_heart girl globe_with_meridians goat goberserk godmode golf grapes green_apple green_book green_heart grey_exclamation grey_question grimacing grin grinning guardsman guitar gun haircut hamburger hammer hamster hand handbag hankey hash hatched_chick hatching_chick headphones hear_no_evil heart heart_decoration heart_eyes heart_eyes_cat heartbeat heartpulse hearts heavy_check_mark heavy_division_sign heavy_dollar_sign heavy_exclamation_mark heavy_minus_sign heavy_multiplication_x heavy_plus_sign helicopter herb hibiscus high_brightness high_heel hocho honey_pot honeybee horse horse_racing hospital hotel hotsprings hourglass hourglass_flowing_sand house house_with_garden hurtrealbad hushed ice_cream icecream id ideograph_advantage imp inbox_tray incoming_envelope information_desk_person information_source innocent interrobang iphone it izakaya_lantern jack_o_lantern japan japanese_castle japanese_goblin japanese_ogre jeans joy joy_cat jp key keycap_ten kimono kiss kissing kissing_cat kissing_closed_eyes kissing_face kissing_heart kissing_smiling_eyes koala koko kr large_blue_circle large_blue_diamond large_orange_diamond last_quarter_moon last_quarter_moon_with_face laughing leaves ledger left_luggage left_right_arrow leftwards_arrow_with_hook lemon leo leopard libra light_rail link lips lipstick lock lock_with_ink_pen lollipop loop loudspeaker love_hotel love_letter low_brightness m mag mag_right mahjong mailbox mailbox_closed mailbox_with_mail mailbox_with_no_mail man man_with_gua_pi_mao man_with_turban mans_shoe maple_leaf mask massage meat_on_bone mega melon memo mens metal metro microphone microscope milky_way minibus minidisc mobile_phone_off money_with_wings moneybag monkey monkey_face monorail moon mortar_board mount_fuji mountain_bicyclist mountain_cableway mountain_railway mouse mouse2 movie_camera moyai muscle mushroom musical_keyboard musical_note musical_score mute nail_care name_badge neckbeard necktie negative_squared_cross_mark neutral_face new new_moon new_moon_
79with_face newspaper ng nine no_bell no_bicycles no_entry no_entry_sign no_good no_mobile_phones no_mouth no_pedestrians no_smoking non-potable_water nose notebook notebook_with_decorative_cover notes nut_and_bolt o o2 ocean octocat octopus oden office ok ok_hand ok_woman older_man older_woman on oncoming_automobile oncoming_bus oncoming_police_car oncoming_taxi one open_file_folder open_hands open_mouth ophiuchus orange_book outbox_tray ox page_facing_up page_with_curl pager palm_tree panda_face paperclip parking part_alternation_mark partly_sunny passport_control paw_prints peach pear pencil pencil2 penguin pensive performing_arts persevere person_frowning person_with_blond_hair person_with_pouting_face phone pig pig2 pig_nose pill pineapple pisces pizza plus1 point_down point_left point_right point_up point_up_2 police_car poodle poop post_office postal_horn postbox potable_water pouch poultry_leg pound pouting_cat pray princess punch purple_heart purse pushpin put_litter_in_its_place question rabbit rabbit2 racehorse radio radio_button rage rage1 rage2 rage3 rage4 railway_car rainbow raised_hand raised_hands ram ramen rat recycle red_car red_circle registered relaxed relieved repeat repeat_one restroom revolving_hearts rewind ribbon rice rice_ball rice_cracker rice_scene ring rocket roller_coaster rooster rose rotating_light round_pushpin rowboat ru rugby_football runner running running_shirt_with_sash sa sagittarius sailboat sake sandal santa satellite satisfied saxophone school school_satchel scissors scorpius scream scream_cat scroll seat secret see_no_evil seedling seven shaved_ice sheep shell ship shipit shirt shit shoe shower signal_strength six six_pointed_star ski skull sleeping sleepy slot_machine small_blue_diamond small_orange_diamond small_red_triangle small_red_triangle_down smile smile_cat smiley smiley_cat smiling_imp smirk smirk_cat smoking snail snake snowboarder snowflake snowman sob soccer soon sos sound space_invader spades spaghetti sparkler sparkles sparkling_heart speak_no_evil speaker speech_balloon speedboat squirrel star star2 stars station statue_of_liberty steam_locomotive stew straight_ruler strawberry stuck_out_tongue stuck_out_tongue_closed_eyes stuck_out_tongue_winking_eye sun_with_face sunflower sunglasses sunny sunrise sunrise_over_mountains surfer sushi suspect suspension_railway sweat sweat_drops sweat_smile sweet_potato swimmer symbols syringe tada tanabata_tree tangerine taurus taxi tea telephone telephone_receiver telescope tennis tent thought_balloon three thumbsdown thumbsup ticket tiger tiger2 tired_face tm toilet tokyo_tower tomato tongue top tophat tractor traffic_light train train2 tram triangular_flag_on_post triangular_ruler trident triumph trolleybus trollface trophy tropical_drink tropical_fish truck trumpet tshirt tulip turtle tv twisted_rightwards_arrows two two_hearts two_men_holding_hands two_women_holding_hands u5272 u5408 u55b6 u6307 u6708 u6709 u6e80 u7121 u7533 u7981 u7a7a uk umbrella unamused underage unlock up us v vertical_traffic_light vhs vibration_mode video_camera video_game violin virgo volcano vs walking waning_crescent_moon waning_gibbous_moon warning watch water_buffalo watermelon wave wavy_dash waxing_crescent_moon waxing_gibbous_moon wc weary wedding whale whale2 wheelchair white_check_mark white_circle white_flower white_square white_square_button wind_chime wine_glass wink wink2 wolf woman womans_clothes womans_hat womens worried wrench x yellow_heart yen yum zap zero zzz".split(" ");
80b.emojikeys="";for(var H=0;H<B.length;H++)b.emojikeys+="|"+G[B[H]];b.emojikeys=b.emojikeys.substring(1);b.emojikeysregex=new RegExp(":("+b.emojikeys+"):","g")}}b.fn.emoji={init:F,encode:function(B){F();return B.replace(b.emojikeysregex,"\x3cimg class\x3d'emoji' src\x3d'/scripts/emf/css/images/emojis/$1.png' /\x3e")},decode:function(B){F();return B.replace(/<img.*?src=['"][^'"]*\/(.*?).png["']\s*[\/]*>/g,":$1:")}}})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.