more work on reactions

This commit is contained in:
zotlabs 2019-05-02 19:39:08 -07:00
parent f7971c8a57
commit 33ba42ba79
13 changed files with 167 additions and 17 deletions

View file

@ -1835,7 +1835,7 @@ class Activity {
}
if(in_array($act->type, [ 'Like', 'Dislike', 'Flag', 'Block', 'Announce', 'Accept', 'Reject', 'TentativeAccept' ])) {
if(in_array($act->type, [ 'Like', 'Dislike', 'Flag', 'Block', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'emojiReaction' ])) {
$response_activity = true;
@ -1900,8 +1900,6 @@ class Activity {
$s['obj']['actor'] = $s['obj']['actor']['id'];
}
// @todo add target if present
$instrument = $act->get_property_obj('instrument');

View file

@ -28,6 +28,9 @@ class System {
}
static public function get_project_icon() {
return z_root() . '/images/bolt-64.png';
if(defined('NOMADIC')) {
return '⚡';
}

View file

@ -444,7 +444,7 @@ class ThreadItem {
'has_tags' => $has_tags,
'reactions' => $this->reactions,
// Item toolbar buttons
'emojis' => '', // (($this->is_toplevel() && $this->is_commentable() && $observer && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''),
'emojis' => '', // (($this->is_toplevel() && $this->is_commentable() && $observer /* && feature_enabled($conv->get_profile_owner(),'emojis') */ ) ? '1' : ''),
'like' => $like,
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
'share' => $share,

View file

@ -21,6 +21,7 @@ class Apschema extends \Zotlabs\Web\Controller {
'commentPolicy' => 'zot:commentPolicy',
'topicalCollection' => 'zot:topicalCollection',
'eventRepeat' => 'zot:eventRepeat',
'emojiReaction' => 'zot:emojiReaction',
]
];

View file

@ -49,21 +49,25 @@ class React extends Controller {
return;
}
$item = array_shift($i);
$n = [] ;
$n['aid'] = $channel['channel_account_id'];
$n['uid'] = $channel['channel_id'];
$n['item_origin'] = true;
$n['item_type'] = $i[0]['item_type'];
$n['item_type'] = $item['item_type'];
$n['parent'] = $postid;
$n['parent_mid'] = $i[0]['mid'];
$n['parent_mid'] = $item['mid'];
$n['uuid'] = new_uuid();
$n['mid'] = z_root() . '/item/' . $n['uuid'];
$n['verb'] = ACTIVITY_REACT . '#' . $emoji;
$n['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n";
$n['verb'] = 'emojiReaction';
$n['body'] = "\n\n[size=48]" . '&#x' . $emoji . ';[/size]' . "\n\n";
$n['author_xchan'] = $channel['channel_hash'];
$object = json_encode(Activity::fetch_item( [ 'id' => $item['mid'] ] ));
$n['obj'] = Activity::fetch_item( [ 'id' => $item['mid'] ] );
$n['obj_type'] = ((array_path_exists('obj/type',$n)) ? $n['obj']['type'] : EMPTY_STR);
// This needs more work to provide an ActivityPub compatible object, if that is ever desired
$n['target'] = [ 'name' => $emoji ];
$x = item_store($n);

View file

@ -462,7 +462,7 @@ define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
define ( 'ACTIVITYSTREAMS_JSONLD_REV', 'https://www.w3.org/ns/activitystreams' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.6' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.7' );
/**
* activity stream defines
*/

BIN
images/bolt-64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

135
images/bolt.svg Normal file
View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="zap.svg"
inkscape:version="1.0alpha (e25c9f7d36, 2019-01-13)"
id="svg8"
version="1.1"
viewBox="0 0 142 142"
height="142mm"
width="142mm">
<defs
id="defs2">
<linearGradient
id="linearGradient873"
inkscape:collect="always">
<stop
id="stop869"
offset="0"
style="stop-color:#fefcfc;stop-opacity:1" />
<stop
id="stop871"
offset="1"
style="stop-color:#ffffff;stop-opacity:0" />
</linearGradient>
<linearGradient
id="linearGradient839"
inkscape:collect="always">
<stop
id="stop835"
offset="0"
style="stop-color:#ffe98f;stop-opacity:1" />
<stop
id="stop837"
offset="1"
style="stop-color:#ffcc00;stop-opacity:1" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,1.4703355,19.269741,-56.464916)"
r="41.730259"
fy="106.70422"
fx="99.867393"
cy="106.70422"
cx="99.867393"
id="radialGradient845"
xlink:href="#linearGradient839"
inkscape:collect="always" />
<linearGradient
gradientTransform="translate(19.269741,-0.35748096)"
gradientUnits="userSpaceOnUse"
y2="132.76001"
x2="94.514153"
y1="70.563179"
x1="73.255867"
id="linearGradient875"
xlink:href="#linearGradient873"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="141.43167"
x2="102.37699"
y1="179.32219"
x1="140.80229"
id="linearGradient887"
xlink:href="#linearGradient873"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
inkscape:window-maximized="1"
inkscape:window-y="27"
inkscape:window-x="0"
inkscape:window-height="1016"
inkscape:window-width="1920"
fit-margin-bottom="10"
fit-margin-right="10"
fit-margin-left="10"
fit-margin-top="10"
lock-margins="true"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="layer1"
inkscape:document-units="mm"
inkscape:cy="239.78911"
inkscape:cx="483.73669"
inkscape:zoom="1.4142136"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-41.766579,-47.934887)"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Livello 1">
<path
sodipodi:nodetypes="ccccccc"
inkscape:connector-curvature="0"
id="path833"
d="m 79.283233,58.609722 66.834537,39.223777 -38.24845,31.900981 45.59534,49.5256 -81.395911,-38.21821 34.264331,-35.71182 z"
style="fill:url(#radialGradient845);fill-opacity:1;stroke:#000000;stroke-width:2.065;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc"
inkscape:connector-curvature="0"
id="path855"
d="m 108.6174,104.0019 0.0195,0.0332 0.0371,0.0762 0.0176,0.043 0.0606,0.1582 0.0156,0.0449 0.0234,0.082 0.008,0.0371 0.0684,0.32813 0.006,0.0352 0.0117,0.084 0.006,0.0488 0.008,0.16992 v 0.0469 l -0.004,0.0859 -0.004,0.0391 -0.0762,0.63281 -0.006,0.0371 -0.0156,0.082 -0.01,0.0449 -0.0469,0.16406 -0.0156,0.043 -0.0312,0.082 -0.0156,0.0391 -0.14453,0.30468 -0.0215,0.041 -0.041,0.0703 -0.0195,0.0293 -0.0957,0.14062 -0.0195,0.0273 -0.0547,0.0703 -0.0352,0.043 -15.855473,16.52539 c 17.700573,-2.85476 22.428973,-7.00841 30.522483,-12.02433 L 141.31271,98.087831 86.597866,65.972597 Z"
style="fill:url(#linearGradient875);fill-opacity:1;stroke:none;stroke-width:2.065;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:url(#linearGradient887);fill-opacity:1;stroke:none;stroke-width:2.065;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 104.7834,131.00914 c -9.382315,1.05955 -13.872782,6.80466 -16.526693,14.30887 L 146.4868,174.2793 Z"
id="path877"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5 KiB

BIN
images/bolt.xcf Normal file

Binary file not shown.

View file

@ -18,6 +18,11 @@ html {
margin-right: 0.5rem;
}
.project-banner img {
height: 1.5rem;
width: 1.5rem;
}
.project-banner a {
color: $banner_colour;
}
@ -475,6 +480,7 @@ footer {
margin-bottom: 15px;
}
.app-name {
overflow: none;
}
@ -696,10 +702,14 @@ nav .acpopup {
font-weight: bold;
}
.suggest-connect-btn {
margin-top: 1em;
}
.profile-match-wrapper {
float: left;
width: 120px;
height: 150px;
height: 110px;
padding: 10px;
margin: 8px 10px 0 0;
border-top: 1px solid #eee;
@ -1602,7 +1612,6 @@ dl.bb-dl > dd > li {
display: inline-block;
border-radius: $radius;
cursor: text;
padding: 0px 10px;
width: 100%;
}

View file

@ -7,13 +7,13 @@
<body>
<table style="border:1px solid #ccc; background-color: #FFFFFF; color: #000000;">
<tbody>
<tr><td colspan="2" style="background:#43488A; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><span style="font-size:32px; float:left;">{{$notify_icon}}</span><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div><div style="clear: both;"></div></td></tr>
<tr><td colspan="2" style="background:#43488A; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><span style="font-size:32px; float:left;"><img src="{{$notify_icon}}" style="height:32px;width:32px;border:0;" alt="logo"></span><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div><div style="clear: both;"></div></td></tr>
<tr><td style="padding-top:22px;" colspan="2">{{$preamble}}</td></tr>
<tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="{{$source_link}}"><img style="border:0px;width:48px;height:48px;" src="{{$source_photo}}"></a></td>
<tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="{{$source_link}}"><img style="border:0px;width:48px;height:48px;" src="{{$source_photo}}" alt="photo"></a></td>
<td style="padding-top:22px;"><a href="{{$source_link}}">{{$source_name}}</a></td></tr>
<tr><td style="font-weight:bold;padding-bottom:5px;">{{$title}}</td></tr>
<tr><td style="padding-right:22px;">{{$htmlversion}}</td></tr>

View file

@ -1,4 +1,4 @@
<div class="project-banner" title="{{$project_title}}"><a href="{{$baseurl}}">{{$project_icon}}</a></div>
<div class="project-banner" title="{{$project_title}}"><a href="{{$baseurl}}"><img src="{{$project_icon}}" alt="{{$project_title}}"></a></div>
{{if $nav.login && !$userinfo}}
<div class="d-lg-none pt-1 pb-1">
{{if $nav.loginmenu.1.4}}

View file

@ -11,6 +11,6 @@
</div>
<div class="profile-match-end"></div>
{{if $entry.connlnk}}
<div class="profile-match-connect btn btn-outline-secondary"><a href="{{$entry.connlnk}}" title="{{$entry.conntxt}}"><i class="fa fa-plus connect-icon"></i> {{$entry.conntxt}}</a></div>
<div class="suggest-connect-btn"><a class="btn btn-sm btn-success" href="{{$entry.connlnk}}" title="{{$entry.conntxt}}"><i class="fa fa-plus connect-icon"></i> {{$entry.conntxt}}</a></div>
{{/if}}
</div>