social tag - add UI

This commit is contained in:
Friendika 2011-10-24 15:47:17 -07:00
parent f48fd5aa16
commit 3b6b0eaa8b
9 changed files with 37 additions and 8 deletions

View File

@ -8,7 +8,7 @@ require_once("include/pgettext.php");
require_once('include/nav.php'); require_once('include/nav.php');
define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); define ( 'FRIENDIKA_PLATFORM', 'Free Friendika');
define ( 'FRIENDIKA_VERSION', '2.3.1143' ); define ( 'FRIENDIKA_VERSION', '2.3.1144' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1098 ); define ( 'DB_UPDATE_VERSION', 1098 );

View File

@ -466,6 +466,8 @@ function conversation(&$a, $items, $mode, $update) {
'classdo' => (($item['starred']) ? "hidden" : ""), 'classdo' => (($item['starred']) ? "hidden" : ""),
'classundo' => (($item['starred']) ? "" : "hidden"), 'classundo' => (($item['starred']) ? "" : "hidden"),
'starred' => t('starred'), 'starred' => t('starred'),
'tagger' => t("add tag"),
'classtagger' => "",
); );
} }
@ -747,6 +749,7 @@ function status_editor($a,$x, $notes_cid = 0) {
'$linkurl' => t('Please enter a link URL:'), '$linkurl' => t('Please enter a link URL:'),
'$vidurl' => t("Please enter a video link/URL:"), '$vidurl' => t("Please enter a video link/URL:"),
'$audurl' => t("Please enter an audio link/URL:"), '$audurl' => t("Please enter an audio link/URL:"),
'$term' => t('Tag term:'),
'$whereareu' => t('Where are you right now?'), '$whereareu' => t('Where are you right now?'),
'$title' => t('Enter a title for this item') '$title' => t('Enter a title for this item')
)); ));

View File

@ -751,7 +751,9 @@ function prepare_body($item,$attach = false) {
$s = prepare_text($item['body']); $s = prepare_text($item['body']);
call_hooks('prepare_body', $s); $prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
if(! $attach) if(! $attach)
return $s; return $s;
@ -784,8 +786,10 @@ function prepare_body($item,$attach = false) {
} }
$s .= '<div class="clear"></div></div>'; $s .= '<div class="clear"></div></div>';
} }
call_hooks('prepare_body_final', $s);
return $s; $prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
}} }}

View File

@ -197,5 +197,6 @@ EOT;
proc_run('php',"include/notifier.php","like","$post_id"); proc_run('php',"include/notifier.php","like","$post_id");
return; // NOTREACHED killme();
// return; // NOTREACHED
} }

View File

@ -22,7 +22,6 @@ function tagger_content(&$a) {
$r = q("SELECT * FROM `item` WHERE `id` = '%s' LIMIT 1", $r = q("SELECT * FROM `item` WHERE `id` = '%s' LIMIT 1",
dbesc($item_id),
dbesc($item_id) dbesc($item_id)
); );
@ -43,8 +42,8 @@ function tagger_content(&$a) {
$blocktags = $r[0]['blocktags']; $blocktags = $r[0]['blocktags'];
} }
// if(local_user() != $owner_uid) if(local_user() != $owner_uid)
// return; return;
if(remote_user()) { if(remote_user()) {
$r = q("select * from contact where id = %d AND `uid` = %d limit 1", $r = q("select * from contact where id = %d AND `uid` = %d limit 1",
@ -189,6 +188,8 @@ EOT;
proc_run('php',"include/notifier.php","tag","$post_id"); proc_run('php',"include/notifier.php","tag","$post_id");
killme();
return; // NOTREACHED return; // NOTREACHED

View File

@ -214,6 +214,19 @@ function initEditor(cb){
} }
} }
function itemTag(id) {
$('#like-rotator-' + id).show();
reply = prompt("$term");
if(reply && reply.length) {
reply.replace('#','');
if(reply.length) {
$.get('tagger/' + id + '?term=' + reply, function(data) {
$('#like-rotator-' + id).hide();
});
}
}
}
function jotClearLocation() { function jotClearLocation() {
$('#jot-coord').val(''); $('#jot-coord').val('');
$('#profile-nolocation-wrapper').hide(); $('#profile-nolocation-wrapper').hide();

View File

@ -958,6 +958,11 @@ input#dfrn-url {
margin-left: 10px; margin-left: 10px;
float: left; float: left;
} }
.tag-item {
margin-left: 10px;
float: left;
}
.wall-item-links-wrapper { .wall-item-links-wrapper {
float: left; float: left;

View File

@ -49,6 +49,7 @@
{{ if $star }} {{ if $star }}
<a href="#" id="starred-$id" onclick="dostar($id); return false;" class="star-item icon $isstarred" title="$star.toggle"></a> <a href="#" id="starred-$id" onclick="dostar($id); return false;" class="star-item icon $isstarred" title="$star.toggle"></a>
<a href="#" id="tagger-$id" onclick="itemTag($id); return false;" class="tag-item icon tagged" title="$star.tagger"></a>
{{ endif }} {{ endif }}
<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$id" > <div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$id" >

View File

@ -40,6 +40,7 @@
{{ if $star }} {{ if $star }}
<a href="#" id="star-$id" onclick="dostar($id); return false;" class="$star.classdo" title="$star.do">$star.do</a> <a href="#" id="star-$id" onclick="dostar($id); return false;" class="$star.classdo" title="$star.do">$star.do</a>
<a href="#" id="unstar-$id" onclick="dostar($id); return false;" class="$star.classundo" title="$star.undo">$star.undo</a> <a href="#" id="unstar-$id" onclick="dostar($id); return false;" class="$star.classundo" title="$star.undo">$star.undo</a>
<a href="#" id="tagger-$id" onclick="itemTag($id); return false;" class="$star.classtagger" title="$star.tagger">$star.tagger</a>
{{ endif }} {{ endif }}
{{ if $vote }} {{ if $vote }}