Skip to content

Commit 52ed5b9

Browse files
committed
basic integration of a static action menu
1 parent 67130b1 commit 52ed5b9

File tree

5 files changed

+63
-6
lines changed

5 files changed

+63
-6
lines changed

client/pfc-core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var phpFreeChat = (function (pfc, $, window, undefined) {
153153
html.find('div.status').addClass('st-op');
154154
}
155155
if (pfc.options.show_avatar) {
156-
html.find('div.avatar').append('<img src="http://www.gravatar.com/avatar/' + pfc.md5(user.email) + '?d=wavatar&amp;s=20" alt="" />');
156+
html.find('div.avatar').append('<img src="http://www.gravatar.com/avatar/' + pfc.md5(user.email) + '?d=wavatar&amp;s=30" alt="" />');
157157
}
158158

159159
// get all userids from the list (could be cached)

client/pfc-init.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ var phpFreeChat = (function (pfc, $, window, undefined) {
3030
// load the interface
3131
pfc.loadHTML();
3232
pfc.loadResponsiveBehavior();
33-
pfc.loadThemeUI();
33+
pfc.loadActionMenu();
34+
pfc.loadThemeUI();
3435

3536
// run quick tests
3637
pfc.checkServerConfig(pfc.startChatLogic);
@@ -469,7 +470,23 @@ var phpFreeChat = (function (pfc, $, window, undefined) {
469470
}
470471

471472
};
472-
473+
474+
/**
475+
* Load action menu used for interactions with users in the list
476+
*/
477+
pfc.loadActionMenu = function () {
478+
$(".avatar").live("mouseenter",function () {
479+
var menu = '<div class="actions-menu"><ul class="menu">';
480+
menu += '<li><a href="#">Give operator rights</a></li>';
481+
menu += '<li><a href="#">Remove operator rights</a></li>';
482+
menu += '<li><a href="#">Kick</a></li>';
483+
menu += '<li><a href="#">Ban</a></li>';
484+
menu += '</ul></div>';
485+
$(this).append(menu);
486+
}).live("mouseleave", function () {
487+
$(".actions-menu").remove();
488+
});
489+
};
473490

474491
/**
475492
* Load specific javascript defined by the theme
1.87 KB
Loading

client/themes/default/pfc-full.less

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,51 @@ div.pfc-content {
375375
overflow: hidden;
376376
}
377377
.avatar {
378-
max-height: @users-avatarlist-size;
379-
max-width: @users-avatarlist-size;
378+
height: @users-avatarlist-size;
379+
width: @users-avatarlist-size;
380380
position: absolute;
381381
right: @users-avatar-position-right;
382382
top: @users-avatar-position-top;
383383
bottom: 0;
384+
img {
385+
height: @users-avatarlist-size;
386+
width: @users-avatarlist-size;
387+
}
388+
.actions-menu {
389+
position: absolute;
390+
display: none;
391+
height: @users-avatarlist-size;
392+
width: @users-avatarlist-size;
393+
top: 0;
394+
left: 0;
395+
background: @users-avatar-url-action-menu center center no-repeat;
396+
.menu {
397+
position: absolute;
398+
top: @users-avatarlist-size;
399+
right: 0;
400+
width: 170px;
401+
padding: 0;
402+
border: 1px solid @footer-donate-bg-color-hover;
403+
background: @dialog-bg-color;
404+
z-index: 500;
405+
li {
406+
height: auto;
407+
border: 0;
408+
a {
409+
display: block;
410+
padding: 5px 10px;
411+
&:hover {
412+
text-decoration: none;
413+
background-color: @footer-donate-bg-color-hover;
414+
}
415+
}
416+
}
417+
}
418+
}
419+
&:hover > .actions-menu {
420+
display: block;
421+
cursor: pointer;
422+
}
384423
}
385424

386425
.status {

client/themes/default/pfc-variables.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@
279279
@users-role-title-border-color: @users-border-color;
280280

281281
@users-avatarlist-size: 30px;
282-
@users-avatar-position-top: 5px;
282+
@users-avatar-position-top: 0;
283283
@users-avatar-position-right: 5px;
284+
@users-avatar-url-action-menu: url(img/bt-actions-menu.png);
284285

285286
@users-icon-width: 16px;
286287
@users-icon-height: 16px;

0 commit comments

Comments
 (0)