usability improvements
This commit is contained in:
parent
9bfff0bca1
commit
67a7d440d9
@ -167,8 +167,10 @@
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(e.keyCode != 13) {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyUp: function(e) {
|
onKeyUp: function(e) {
|
||||||
|
10
mod/acl.php
10
mod/acl.php
@ -139,10 +139,10 @@ function acl_init(&$a){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($type == 'a') {
|
elseif($type == 'a') {
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
|
$r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
WHERE `uid` = %d AND `pending` = 0
|
WHERE abook_channel = %d
|
||||||
$sql_extra2
|
$sql_extra3
|
||||||
ORDER BY `name` ASC ",
|
ORDER BY xchan_name ASC ",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ function acl_init(&$a){
|
|||||||
"id" => intval($g['id']),
|
"id" => intval($g['id']),
|
||||||
"network" => $g['network'],
|
"network" => $g['network'],
|
||||||
"link" => $g['url'],
|
"link" => $g['url'],
|
||||||
"nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
|
"nick" => $g['nick'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ EOT;
|
|||||||
$search_txt = dbesc(protect_sprintf(preg_quote($search)));
|
$search_txt = dbesc(protect_sprintf(preg_quote($search)));
|
||||||
$searching = true;
|
$searching = true;
|
||||||
}
|
}
|
||||||
$sql_extra .= (($searching) ? " AND xchan_name '$search_txt' " : "");
|
$sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : "");
|
||||||
|
|
||||||
if($nets)
|
if($nets)
|
||||||
$sql_extra .= sprintf(" AND xchan_network = '%s' ", dbesc($nets));
|
$sql_extra .= sprintf(" AND xchan_network = '%s' ", dbesc($nets));
|
||||||
@ -573,12 +573,8 @@ EOT;
|
|||||||
|
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
|
|
||||||
$url = "magic/{$rr['abook_id']}";
|
|
||||||
$sparkle = ' class="sparkle" ';
|
|
||||||
|
|
||||||
|
|
||||||
$contacts[] = array(
|
$contacts[] = array(
|
||||||
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['xchan_name'],$rr['xchan_url']),
|
'img_hover' => sprintf( t('%1$s [%2$s]'),$rr['xchan_name'],$rr['xchan_url']),
|
||||||
'edit_hover' => t('Edit contact'),
|
'edit_hover' => t('Edit contact'),
|
||||||
'photo_menu' => contact_photo_menu($rr),
|
'photo_menu' => contact_photo_menu($rr),
|
||||||
'id' => $rr['abook_id'],
|
'id' => $rr['abook_id'],
|
||||||
@ -588,8 +584,8 @@ EOT;
|
|||||||
'name' => $rr['xchan_name'],
|
'name' => $rr['xchan_name'],
|
||||||
'username' => $rr['xchan_name'],
|
'username' => $rr['xchan_name'],
|
||||||
'sparkle' => $sparkle,
|
'sparkle' => $sparkle,
|
||||||
'itemurl' => $rr['xchan_url'],
|
'edit' => z_root() . '/connections/' . $rr['abook_id'],
|
||||||
'url' => $url,
|
'url' => $rr['xchan_url'],
|
||||||
'network' => network_to_name($rr['network']),
|
'network' => network_to_name($rr['network']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,3 +8,14 @@ $(document).ready(function() {
|
|||||||
a.setOptions({ params: { type: 'a' }});
|
a.setOptions({ params: { type: 'a' }});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#contacts-search").keyup(function(event){
|
||||||
|
if(event.keyCode == 13){
|
||||||
|
$("#contacts-search-submit").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".autocomplete-w1 .selected").keyup(function(event){
|
||||||
|
if(event.keyCode == 13){
|
||||||
|
$("#contacts-search-submit").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@ -5,16 +5,8 @@
|
|||||||
onmouseover="if (typeof t$contact.id != 'undefined') clearTimeout(t$contact.id); openMenu('contact-photo-menu-button-$contact.id')"
|
onmouseover="if (typeof t$contact.id != 'undefined') clearTimeout(t$contact.id); openMenu('contact-photo-menu-button-$contact.id')"
|
||||||
onmouseout="t$contact.id=setTimeout('closeMenu(\'contact-photo-menu-button-$contact.id\'); closeMenu(\'contact-photo-menu-$contact.id\');',200)" >
|
onmouseout="t$contact.id=setTimeout('closeMenu(\'contact-photo-menu-button-$contact.id\'); closeMenu(\'contact-photo-menu-$contact.id\');',200)" >
|
||||||
|
|
||||||
<a href="$contact.url" title="$contact.img_hover" /><img src="$contact.thumb" $contact.sparkle alt="$contact.name" /></a>
|
<a href="$contact.edit" title="$contact.img_hover" /><img src="$contact.thumb" $contact.sparkle alt="$contact.name" /></a>
|
||||||
|
|
||||||
{{ if $contact.photo_menu }}
|
|
||||||
<span onclick="openClose('contact-photo-menu-$contact.id');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-$contact.id">menu</span>
|
|
||||||
<div class="contact-photo-menu" id="contact-photo-menu-$contact.id">
|
|
||||||
<ul>
|
|
||||||
$contact.photo_menu
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{{ endif }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user