diff options
author | Friendika <info@friendika.com> | 2011-07-03 19:41:04 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-03 19:41:04 -0700 |
commit | 5ceeb6752d645036b832077d88b71a8825952322 (patch) | |
tree | 1cf61d116761b52bf53592241a3b7a178d1675e0 /include | |
parent | bef68a8c7fe021bd6effc3e4bad62dbd1d229e87 (diff) | |
download | volse-hubzilla-5ceeb6752d645036b832077d88b71a8825952322.tar.gz volse-hubzilla-5ceeb6752d645036b832077d88b71a8825952322.tar.bz2 volse-hubzilla-5ceeb6752d645036b832077d88b71a8825952322.zip |
starred items
Diffstat (limited to 'include')
-rw-r--r-- | include/conversation.php | 9 | ||||
-rw-r--r-- | include/main.js | 15 |
2 files changed, 22 insertions, 2 deletions
diff --git a/include/conversation.php b/include/conversation.php index ff0a7612b..40981d5f4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -177,6 +177,7 @@ function conversation(&$a, $items, $mode, $update) { $drop = replace_macros($droptpl,array('$id' => $item['id'])); $lock = '<div class="wall-item-lock"></div>'; + $star = ''; $body = prepare_body($item,true); @@ -197,6 +198,7 @@ function conversation(&$a, $items, $mode, $update) { '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, '$owner_name' => $owner_name, + '$star' => $star, '$drop' => $drop, '$conv' => '<a href="' . $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'] . '">' . t('View in context') . '</a>' )); @@ -381,8 +383,8 @@ function conversation(&$a, $items, $mode, $update) { } $edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes')) - ? '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] - . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>' + ? '<a class="editpost icon pencil" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] + . '" title="' . t('Edit') . '"></a>' : ''); @@ -394,6 +396,8 @@ function conversation(&$a, $items, $mode, $update) { $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$select' => t('Select'), '$delete' => t('Delete'))); + $star = (($profile_owner == local_user() && $toplevelpost) ? '<a href="#" id="starred-' . $item['id'] . '" onclick="dostar(' . $item['id'] . '); return false;" class="star-item icon ' . (($item['starred']) ? 'starred' : 'unstarred') . '" title="' . t('toggle star status') . '"></a>' : ''); + $photo = $item['photo']; $thumb = $item['thumb']; @@ -473,6 +477,7 @@ function conversation(&$a, $items, $mode, $update) { '$owner_name' => $owner_name, '$plink' => get_plink($item), '$edpost' => $edpost, + '$star' => $star, '$drop' => $drop, '$vote' => $likebuttons, '$like' => $like, diff --git a/include/main.js b/include/main.js index c2772000d..26c78b277 100644 --- a/include/main.js +++ b/include/main.js @@ -174,6 +174,21 @@ liking = 1; } + function dostar(ident) { + $('#like-rotator-' + ident.toString()).show(); + $.get('starred/' + ident.toString(), function(data) { + if(data.match(/1/)) { + $('#starred-' + ident.toString()).addClass('starred'); + $('#starred-' + ident.toString()).removeClass('unstarred'); + } + else { + $('#starred-' + ident.toString()).addClass('unstarred'); + $('#starred-' + ident.toString()).removeClass('starred'); + } + $('#like-rotator-' + ident.toString()).hide(); + }); + } + function getPosition(e) { var cursor = {x:0, y:0}; if ( e.pageX || e.pageY ) { |