Skip to content

Commit

Permalink
admin: fixed how comments are added to markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Quin Kennedy authored and Quin Kennedy committed Oct 5, 2012
1 parent b27db73 commit 4c1196b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 2 additions & 3 deletions examples/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@
<div class='clientrow' id="{{Safetify name}}_{{Safetify remoteAddress}}">
<div class="clientanchor"></div>
<div class="clientcol clientdata">
<div class="clientnickname" title="{{config.description}}">
<div class="clientnickname" title="(no description)">
<span>{{name}}</span>
</div>
<div class="clientname">
<div class="clientname" title="(no description)">
<span>{{name}}</span><span class="infobutton" id="button_info_{{Safetify name}}_{{Safetify remoteAddress}}">?</span>
</div>
<div class="clientinfo" id="info_{{Safetify name}}_{{Safetify remoteAddress}}">
<span>
{{config.description}}
</span>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions examples/admin/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ body{
font-size:9pt;
width:10px;
margin-left:2px;
cursor:pointer;
display:none;
}
.clientinfo span{
background-color:yellow;
margin-right:10px;
}
10 changes: 9 additions & 1 deletion examples/admin/js/wsevents.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,16 @@ var handleConfigMsg = function(msg){
var itemsMarkup = $(pubsubTemplate(clients[j]));
itemsMarkup.find(".itemwrapper").click(clickItem).hover(overItem, outItem);
//itemsMarkup.find(".deletebutton").click(clickDelete);
$("#"+msg.config.name.Safetify()+"_"+msg.config.remoteAddress.Safetify()).append(itemsMarkup);
var client = $("#"+msg.config.name.Safetify()+"_"+msg.config.remoteAddress.Safetify());
client.append(itemsMarkup);
addEndpoints(msg);
//update the description
if (msg.config.description){
var idPart ="info_"+msg.config.name.Safetify()+"_"+msg.config.remoteAddress.Safetify();
$("#button_"+idPart).css("display","inline-block");
$("#"+idPart+" span").html(msg.config.description);
client.find(".clientnickname, .clientname").attr("title",msg.config.description);
}
break;
}
}
Expand Down

0 comments on commit 4c1196b

Please sign in to comment.