dynamic delete icons for saved-search on network page

This commit is contained in:
friendica 2011-12-01 18:27:45 -08:00
parent ac3df5fece
commit 513c1c0d68
5 changed files with 27 additions and 7 deletions

View File

@ -1924,7 +1924,7 @@ function local_delivery($importer,$data) {
if($deleted) { if($deleted) {
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id` $r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id`
WHERE `uri` = '%s' AND `uid` = %d AND `contact-id` = %d LIMIT 1", WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
dbesc($uri), dbesc($uri),
intval($importer['importer_uid']), intval($importer['importer_uid']),
intval($importer['id']) intval($importer['id'])

View File

@ -68,17 +68,16 @@ function saved_searches($search) {
$o = ''; $o = '';
$r = q("select `term` from `search` WHERE `uid` = %d", $r = q("select `id`,`term` from `search` WHERE `uid` = %d",
intval(local_user()) intval(local_user())
); );
$saved = array(); $saved = array();
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
$saved[] = array( $saved[] = array(
'id' => $rr['id'],
'term' => $rr['term'], 'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']), 'encodedterm' => urlencode($rr['term']),
'delete' => t('Remove term'), 'delete' => t('Remove term'),

View File

@ -4,7 +4,7 @@ function search_saved_searches() {
$o = ''; $o = '';
$r = q("select `term` from `search` WHERE `uid` = %d", $r = q("select `id`,`term` from `search` WHERE `uid` = %d",
intval(local_user()) intval(local_user())
); );

View File

@ -5,8 +5,8 @@
<ul id="saved-search-ul"> <ul id="saved-search-ul">
{{ for $saved as $search }} {{ for $saved as $search }}
<li class="saved-search-li clear"> <li class="saved-search-li clear">
<a onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" class="icon savedsearchdrop drophide" href="network/?f=&amp;remove=1&amp;search=$search.encodedterm"></a> <a title="$search.delete" onclick="return confirmDelete();" id="drop-saved-search-term-$search.id" class="iconspacer savedsearchdrop " href="network/?f=&amp;remove=1&amp;search=$search.encodedterm"></a>
<a class="savedsearchterm" href="network/?f=&amp;search=$search.encodedterm">$search.term</a> <a id="saved-search-term-$search.id" class="savedsearchterm" href="network/?f=&amp;search=$search.encodedterm">$search.term</a>
</li> </li>
{{ endfor }} {{ endfor }}
</ul> </ul>

View File

@ -21,6 +21,27 @@ $('.sidebar-group-element').hover(
id = $(this).attr('id'); id = $(this).attr('id');
$('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');} $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
); );
$('.savedsearchdrop').hover(
function() {
$(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.savedsearchterm').hover(
function() {
id = $(this).attr('id');
$('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
);
}); });
</script> </script>
EOT; EOT;