Privacy modes now supported,bugs at search page fixed,now using username when display name unavailabe

This commit is contained in:
nipos 2018-04-21 17:15:13 +02:00
parent 105fdd36bc
commit d826488b7b
6 changed files with 226 additions and 76 deletions

View File

@ -8,7 +8,18 @@ A Mastodon web client that looks like Twitter
## Stay tuned ## Stay tuned
Follow or Mastodon account and never miss an important update: [@halcyon@social.csswg.org](https://social.csswg.org/@halcyon) Follow or Mastodon account and never miss an important update: [@halcyon@social.csswg.org](https://social.csswg.org/@halcyon)
## Instances
These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use.
- https://halcyon.toromino.de - 1.1.2
- https://social.dev-wiki.de - 1.1.1
- https://halcyon.bka.li - 1.1.1
- https://itter.photog.social - 1.1.1
- https://halcyon.cybre.space - Outdated
You have your own Halcyon instance and want it to be listed here? Create an issue with the link and we will add it to the list.
## Blog ## Blog
- Release of Version 1.1.2 - Privacy modes are now correctly displayed and used for replies,use username if display name doesn't exist,bugs on search page fixed
- Release of Version 1.1.1 - Fixed error 404 when viewing profile of own instance,numbers below profile on the left do now change during session,added nginx config - Release of Version 1.1.1 - Fixed error 404 when viewing profile of own instance,numbers below profile on the left do now change during session,added nginx config
- [Release of Version 1.1.0 and upcoming features](http://nikisoft.myblog.de/nikisoft/art/11389499/Halcyon-What-we-did-and-what-we-will-do) - [Release of Version 1.1.0 and upcoming features](http://nikisoft.myblog.de/nikisoft/art/11389499/Halcyon-What-we-did-and-what-we-will-do)
- Release of Version 1.0.3 - "Who to follow" doesn't show people you already follow anymore and design of preferences and search bar is now much better - Release of Version 1.0.3 - "Who to follow" doesn't show people you already follow anymore and design of preferences and search bar is now much better
@ -16,16 +27,6 @@ Follow or Mastodon account and never miss an important update: [@halcyon@social.
- Release of Version 1.0.1 - Two bugfixes - Release of Version 1.0.1 - Two bugfixes
- [Release of Version 1.0.0](http://nikisoft.myblog.de/nikisoft/art/11264555/The-first-new-Halcyon-release-is-on-Github) - [Release of Version 1.0.0](http://nikisoft.myblog.de/nikisoft/art/11264555/The-first-new-Halcyon-release-is-on-Github)
## Instances
These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use.
- https://halcyon.toromino.de - 1.1.1
- https://social.dev-wiki.de - 1.1.1
- https://halcyon.bka.li - 1.1.1
- https://itter.photog.social - 1.1.0
- https://halcyon.cybre.space - Outdated
You have your own Halcyon instance and want it to be listed here? Create an issue with the link and we will add it to the list.
## Features ## Features
- Twitter like UI, familiar interface. - Twitter like UI, familiar interface.
- Able to use on all instances. - Able to use on all instances.

View File

@ -244,6 +244,28 @@ toot_favourites_count = status.favourites_count;
if ( status.media_attachments.length ) { if ( status.media_attachments.length ) {
media_views = mediaattachments_template(status); media_views = mediaattachments_template(status);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
switch(status.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";break;
case "private":toot_privacy_mode="Followers-only";toot_privacy_icon="lock";break;
case "direct":toot_privacy_mode="Direct";toot_privacy_icon="envelope";break;
}
if(toot_privacy_icon == "globe" || toot_privacy_icon == "unlock-alt") {
toot_footer_width = " style='width:320px'";
toot_reblog_button = (`<div class="toot_reaction">
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>`);
}
else {
toot_footer_width = "";
toot_reblog_button = "";
}
const html=(` const html=(`
<li sid="${status.id}" class="toot_entry"> <li sid="${status.id}" class="toot_entry">
<div class="toot_entry_body"> <div class="toot_entry_body">
@ -289,25 +311,25 @@ ${status.content}
</span> </span>
${media_views} ${media_views}
</article> </article>
<footer class="toot_footer"> <footer class="toot_footer"${toot_footer_width}>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.id}" acct="@${status.account.acct}" display_name="${status.account.display_name}"> <button class="reply_button" tid="${status.id}" acct="@${status.account.acct}" display_name="${status.account.display_name}" privacy="${status.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
</div> </div>
<div class="toot_reaction"> ${toot_reblog_button}
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="fav_button" tid="${status.id}" favourited="${status.favourited}"> <button class="fav_button" tid="${status.id}" favourited="${status.favourited}">
<i class="fa fa-fw fa-star"></i> <i class="fa fa-fw fa-star"></i>
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</section> </section>
</div> </div>
@ -348,6 +370,16 @@ toot_favourites_count = status.reblog.favourites_count;
if ( status.reblog.media_attachments.length ) { if ( status.reblog.media_attachments.length ) {
media_views = mediaattachments_template(status.reblog); media_views = mediaattachments_template(status.reblog);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
if(status.reblog.account.display_name.length == 0) {
status.reblog.account.display_name = status.reblog.account.username;
}
switch(status.reblog.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";break;
}
const html = (` const html = (`
<li sid="${status.id}" class="toot_entry"> <li sid="${status.id}" class="toot_entry">
<div class="boost_author_box"> <div class="boost_author_box">
@ -398,9 +430,9 @@ ${status.reblog.content}
</span> </span>
${media_views} ${media_views}
</article> </article>
<footer class="toot_footer"> <footer class="toot_footer" style="width:320px">
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.reblog.id}"acct="@${status.reblog.account.acct}" display_name="${status.reblog.account.display_name}"> <button class="reply_button" tid="${status.reblog.id}"acct="@${status.reblog.account.acct}" display_name="${status.reblog.account.display_name}" privacy="${status.reblog.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
@ -417,6 +449,11 @@ ${media_views}
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</section> </section>
</div> </div>
@ -426,6 +463,9 @@ return $(html)
} }
function notifications_template(NotificationObj) { function notifications_template(NotificationObj) {
const notice_author_link = getRelativeURL(NotificationObj.account.url, NotificationObj.account.id); const notice_author_link = getRelativeURL(NotificationObj.account.url, NotificationObj.account.id);
if(NotificationObj.account.display_name.length == 0) {
NotificationObj.account.display_name = NotificationObj.account.username;
}
if ( NotificationObj.type === 'favourite' | NotificationObj.type === 'reblog' ) { if ( NotificationObj.type === 'favourite' | NotificationObj.type === 'reblog' ) {
const toot_author_link = getRelativeURL(NotificationObj.status.account.url, NotificationObj.status.account.id), const toot_author_link = getRelativeURL(NotificationObj.status.account.url, NotificationObj.status.account.id),
toot_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, NotificationObj.status.created_at)), toot_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, NotificationObj.status.created_at)),
@ -535,6 +575,28 @@ toot_favourites_count = NotificationObj.status.favourites_count;
if (NotificationObj.status.media_attachments.length) { if (NotificationObj.status.media_attachments.length) {
media_views = mediaattachments_template(NotificationObj.status); media_views = mediaattachments_template(NotificationObj.status);
} }
if(NotificationObj.status.account.display_name.length == 0) {
NotificationObj.status.account.display_name = NotificationObj.status.account.username;
}
switch(NotificationObj.status.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";break;
case "private":toot_privacy_mode="Followers-only";toot_privacy_icon="lock";break;
case "direct":toot_privacy_mode="Direct";toot_privacy_icon="envelope";break;
}
if(toot_privacy_icon == "globe" || toot_privacy_icon == "unlock-alt") {
toot_footer_width = " style='width:320px'";
toot_reblog_button = (`<div class="toot_reaction">
<button class="boost_button" tid="${NotificationObj.status.id}" reblogged="${NotificationObj.status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>`);
}
else {
toot_footer_width = "";
toot_reblog_button = "";
}
const html=(` const html=(`
<li sid="${NotificationObj.status.id}" class="toot_entry"> <li sid="${NotificationObj.status.id}" class="toot_entry">
<div class="toot_entry_body"> <div class="toot_entry_body">
@ -580,25 +642,25 @@ ${NotificationObj.status.content}
</span> </span>
${media_views} ${media_views}
</article> </article>
<footer class="toot_footer"> <footer class="toot_footer"${toot_footer_width}>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${NotificationObj.status.id}" acct="@${NotificationObj.account.acct}" display_name="${NotificationObj.account.display_name}"> <button class="reply_button" tid="${NotificationObj.status.id}" acct="@${NotificationObj.account.acct}" display_name="${NotificationObj.account.display_name}" privacy="${NotificationObj.status.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
</div> </div>
<div class="toot_reaction"> ${toot_reblog_button}
<button class="boost_button" tid="${NotificationObj.status.id}" reblogged="${NotificationObj.status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="fav_button" tid="${NotificationObj.status.id}" favourited="${NotificationObj.status.favourited}"> <button class="fav_button" tid="${NotificationObj.status.id}" favourited="${NotificationObj.status.favourited}">
<i class="fa fa-fw fa-star"></i> <i class="fa fa-fw fa-star"></i>
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</section> </section>
</div> </div>
@ -625,6 +687,9 @@ return $(html);
function follows_template(AccountObj) { function follows_template(AccountObj) {
const array = AccountObj.url.split('/'), const array = AccountObj.url.split('/'),
profile_link = '/'+array[array.length-1]+'@'+array[array.length-2]+'?mid='+AccountObj.id+'&'; profile_link = '/'+array[array.length-1]+'@'+array[array.length-2]+'?mid='+AccountObj.id+'&';
if(AccountObj.display_name.length == 0) {
AccountObj.display_name = AccountObj.username;
}
const html = (` const html = (`
<div class="follows_profile_box" mid="${AccountObj.id}"> <div class="follows_profile_box" mid="${AccountObj.id}">
<div class="follows_profile_header"> <div class="follows_profile_header">
@ -681,6 +746,32 @@ toot_favourites_count = status.favourites_count;
if (status.media_attachments.length) { if (status.media_attachments.length) {
media_views = mediaattachments_template(status); media_views = mediaattachments_template(status);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
checked_public = "";
checked_unlisted = "";
checked_private = "";
checked_direct = "";
switch(status.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";checked_public=" checked";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";checked_unlisted=" checked";break;
case "private":toot_privacy_mode="Followers-only";toot_privacy_icon="lock";checked_private=" checked";break;
case "direct":toot_privacy_mode="Direct";toot_privacy_icon="envelope";checked_direct=" checked";break;
}
if(toot_privacy_icon == "globe" || toot_privacy_icon == "unlock-alt") {
toot_footer_width = " style='width:320px'";
toot_reblog_button = (`<div class="toot_reaction">
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>`);
}
else {
toot_footer_width = "";
toot_reblog_button = "";
}
const html=(` const html=(`
<div sid="${status.id}" class="toot_detail ${class_options}"> <div sid="${status.id}" class="toot_detail ${class_options}">
<div class="toot_detail_body"> <div class="toot_detail_body">
@ -723,25 +814,25 @@ ${media_views}
</article> </article>
<time datetime="${status_attr_datetime}">${status_datetime}</time> <time datetime="${status_attr_datetime}">${status_datetime}</time>
</section> </section>
<footer class="toot_footer"> <footer class="toot_footer"${toot_footer_width}>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.id}" acct="@${status.account.acct}" display_name="${status.account.display_name}"> <button class="reply_button" tid="${status.id}" acct="@${status.account.acct}" display_name="${status.account.display_name}" privacy="${status.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
</div> </div>
<div class="toot_reaction"> ${toot_reblog_button}
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="fav_button" tid="${status.id}" favourited="${status.favourited}"> <button class="fav_button" tid="${status.id}" favourited="${status.favourited}">
<i class="fa fa-fw fa-star"></i> <i class="fa fa-fw fa-star"></i>
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</div> </div>
</div> </div>
@ -776,7 +867,7 @@ ${media_views}
<!-- Privacy options --> <!-- Privacy options -->
<div class="status_privacy status_option_button expand_privacy_menu_button"> <div class="status_privacy status_option_button expand_privacy_menu_button">
<!-- Expand menu --> <!-- Expand menu -->
<i class="fa fa-globe" aria-hidden="true"></i> <i class="fa fa-${toot_privacy_icon}" aria-hidden="true"></i>
<!-- Privacy options --> <!-- Privacy options -->
<div class="expand_privacy_menu invisible"> <div class="expand_privacy_menu invisible">
<label for="reply_status_public" class="status_privacy select_privacy disallow_select" privacyicon="fa fa-globe"> <label for="reply_status_public" class="status_privacy select_privacy disallow_select" privacyicon="fa fa-globe">
@ -796,10 +887,10 @@ ${media_views}
<input id="reply_status_media_atta" name="files" type="file" multiple class="invisible"/> <input id="reply_status_media_atta" name="files" type="file" multiple class="invisible"/>
<input id="reply_status_cw" name="status_cw" type="checkbox" class="invisible" /> <input id="reply_status_cw" name="status_cw" type="checkbox" class="invisible" />
<input id="reply_status_nsfw" name="status_nsfw" type="checkbox" class="invisible" /> <input id="reply_status_nsfw" name="status_nsfw" type="checkbox" class="invisible" />
<input id="reply_status_public" name='privacy_option' value="public" class="invisible" type="radio"/> <input id="reply_status_public" name='privacy_option' value="public" class="invisible" type="radio"${checked_public}>
<input id="reply_status_unlisted" name='privacy_option' value="unlisted" class="invisible" type="radio"/> <input id="reply_status_unlisted" name='privacy_option' value="unlisted" class="invisible" type="radio"${checked_unlisted}>
<input id="reply_status_fonly" name='privacy_option' value="private" class="invisible" type="radio"/> <input id="reply_status_fonly" name='privacy_option' value="private" class="invisible" type="radio"${checked_private}>
<input id="reply_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"/> <input id="reply_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"${checked_direct}>
<div class="submit_status_label_wrap"> <div class="submit_status_label_wrap">
<span class="character_count"> <span class="character_count">
${current_instance_charlimit} ${current_instance_charlimit}
@ -843,6 +934,18 @@ toot_favourites_count = status.reblog.favourites_count;
if(status.reblog.media_attachments.length){ if(status.reblog.media_attachments.length){
media_views = mediaattachments_template(status.reblog); media_views = mediaattachments_template(status.reblog);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
if(status.reblog.account.display_name.length == 0) {
status.reblog.account.display_name = status.reblog.account.username;
}
checked_public = "";
checked_unlisted = "";
switch(status.reblog.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";checked_public=" checked";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";checked_unlisted=" checked";break;
}
const html=(` const html=(`
<div sid="${status.reblog.id}" class="toot_detail ${class_options}"> <div sid="${status.reblog.id}" class="toot_detail ${class_options}">
<div class="toot_detail_body"> <div class="toot_detail_body">
@ -885,9 +988,9 @@ ${media_views}
</article> </article>
<time datetime="${status_attr_datetime}">${status_datetime}</time> <time datetime="${status_attr_datetime}">${status_datetime}</time>
</section> </section>
<footer class="toot_footer"> <footer class="toot_footer" style="width:320px">
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.reblog.id}" acct="@${status.reblog.account.acct}" display_name="${status.reblog.account.display_name}"> <button class="reply_button" tid="${status.reblog.id}" acct="@${status.reblog.account.acct}" display_name="${status.reblog.account.display_name}" privacy="${status.reblog.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
@ -904,6 +1007,11 @@ ${media_views}
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</div> </div>
</div> </div>
@ -938,7 +1046,7 @@ ${media_views}
<!-- Privacy options --> <!-- Privacy options -->
<div class="status_privacy status_option_button expand_privacy_menu_button"> <div class="status_privacy status_option_button expand_privacy_menu_button">
<!-- Expand menu --> <!-- Expand menu -->
<i class="fa fa-globe" aria-hidden="true"></i> <i class="fa fa-${toot_privacy_icon}" aria-hidden="true"></i>
<!-- Privacy options --> <!-- Privacy options -->
<div class="expand_privacy_menu invisible"> <div class="expand_privacy_menu invisible">
<label for="reply_status_public" class="status_privacy select_privacy disallow_select" privacyicon="fa fa-globe"> <label for="reply_status_public" class="status_privacy select_privacy disallow_select" privacyicon="fa fa-globe">
@ -958,10 +1066,10 @@ ${media_views}
<input id="reply_status_media_atta" name="files" type="file" multiple class="invisible"/> <input id="reply_status_media_atta" name="files" type="file" multiple class="invisible"/>
<input id="reply_status_cw" name="status_cw" type="checkbox" class="invisible" /> <input id="reply_status_cw" name="status_cw" type="checkbox" class="invisible" />
<input id="reply_status_nsfw" name="status_nsfw" type="checkbox" class="invisible" /> <input id="reply_status_nsfw" name="status_nsfw" type="checkbox" class="invisible" />
<input id="reply_status_public" name='privacy_option' value="public" class="invisible" type="radio"/> <input id="reply_status_public" name='privacy_option' value="public" class="invisible" type="radio"${checked_public}>
<input id="reply_status_unlisted" name='privacy_option' value="unlisted" class="invisible" type="radio"/> <input id="reply_status_unlisted" name='privacy_option' value="unlisted" class="invisible" type="radio"${checked_unlisted}>
<input id="reply_status_fonly" name='privacy_option' value="private" class="invisible" type="radio"/> <input id="reply_status_fonly" name='privacy_option' value="private" class="invisible" type="radio">
<input id="reply_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"/> <input id="reply_status_direct" name='privacy_option' value="direct" class="invisible" type="radio">
<div class="submit_status_label_wrap"> <div class="submit_status_label_wrap">
<span class="character_count"> <span class="character_count">
${current_instance_charlimit} ${current_instance_charlimit}
@ -1031,6 +1139,28 @@ toot_favourites_count = status.favourites_count;
if( status.media_attachments.length) { if( status.media_attachments.length) {
media_views = mediaattachments_template(status); media_views = mediaattachments_template(status);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
switch(status.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";break;
case "private":toot_privacy_mode="Followers-only";toot_privacy_icon="lock";break;
case "direct":toot_privacy_mode="Direct";toot_privacy_icon="envelope";break;
}
if(toot_privacy_icon == "globe" || toot_privacy_icon == "unlock-alt") {
toot_footer_width = " style='width:320px'";
toot_reblog_button = (`<div class="toot_reaction">
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>`);
}
else {
toot_footer_width = "";
toot_reblog_button = "";
}
const html=(` const html=(`
<div sid="${status.id}" class="toot_entry ${class_options}"> <div sid="${status.id}" class="toot_entry ${class_options}">
<div class="toot_entry_body"> <div class="toot_entry_body">
@ -1072,25 +1202,25 @@ ${status.content}
</span> </span>
${media_views} ${media_views}
</article> </article>
<footer class="toot_footer"> <footer class="toot_footer"${toot_footer_width}>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.id}" username="${status.account.username}" display_name="${status.account.display_name}"> <button class="reply_button" tid="${status.id}" username="${status.account.username}" display_name="${status.account.display_name}" privacy="${status.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
</div> </div>
<div class="toot_reaction"> ${toot_reblog_button}
<button class="boost_button" tid="${status.id}" reblogged="${status.reblogged}">
<i class="fa fa-fw fa-retweet"></i>
<span class="reaction_count boost_count">${toot_reblogs_count}</span>
</button>
</div>
<div class="toot_reaction"> <div class="toot_reaction">
<button class="fav_button" tid="${status.id}" favourited="${status.favourited}"> <button class="fav_button" tid="${status.id}" favourited="${status.favourited}">
<i class="fa fa-fw fa-star"></i> <i class="fa fa-fw fa-star"></i>
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</section> </section>
</div> </div>
@ -1122,6 +1252,16 @@ toot_favourites_count = status.reblog.favourites_count;
if (status.reblog.media_attachments.length) { if (status.reblog.media_attachments.length) {
media_views = mediaattachments_template(status.reblog); media_views = mediaattachments_template(status.reblog);
} }
if(status.account.display_name.length == 0) {
status.account.display_name = status.account.username;
}
if(status.reblog.account.display_name.length == 0) {
status.reblog.account.display_name = status.reblog.account.username;
}
switch(status.reblog.visibility) {
case "public":toot_privacy_mode="Public";toot_privacy_icon="globe";break;
case "unlisted":toot_privacy_mode="Unlisted";toot_privacy_icon="unlock-alt";break;
}
const html=(` const html=(`
<div sid="${status.id}" class="toot_entry ${class_options}"> <div sid="${status.id}" class="toot_entry ${class_options}">
<div class="boost_author_box"> <div class="boost_author_box">
@ -1168,9 +1308,9 @@ ${status.reblog.content}
</span> </span>
${media_views} ${media_views}
</article> </article>
<footer class="toot_footer"> <footer class="toot_footer" style="width:320px">
<div class="toot_reaction"> <div class="toot_reaction">
<button class="reply_button" tid="${status.reblog.id}" username="${status.reblog.account.username}" display_name="${status.reblog.account.display_name}"> <button class="reply_button" tid="${status.reblog.id}" username="${status.reblog.account.username}" display_name="${status.reblog.account.display_name}" privacy="${status.reblog.visibility}">
<i class="fa fa-fw fa-reply"></i> <i class="fa fa-fw fa-reply"></i>
<span class="reaction_count reply_count"></span> <span class="reaction_count reply_count"></span>
</button> </button>
@ -1187,6 +1327,11 @@ ${media_views}
<span class="reaction_count fav_count">${toot_favourites_count}</span> <span class="reaction_count fav_count">${toot_favourites_count}</span>
</button> </button>
</div> </div>
<div class="toot_reaction">
<button>
<i class="fa fa-fw fa-${toot_privacy_icon}" title="${toot_privacy_mode}"></i>
</button>
</div>
</footer> </footer>
</section> </section>
</div> </div>
@ -1953,19 +2098,11 @@ $('#reply_status_form .submit_status_label').removeClass('active_submit_button')
} }
}); });
$(document).on('click','#reply_status_form', function(e) { $(document).on('click','#reply_status_form', function(e) {
switch(localStorage.getItem("setting_post_privacy")) {
case "public":picon="globe";break;
case "unlisted":picon="unlock-alt";break;
case "private":picon="lock";break;
case "direct":picon="envelope";break;
}
if(!$('#reply_status_form .status_textarea textarea').hasClass('focus')) { if(!$('#reply_status_form .status_textarea textarea').hasClass('focus')) {
$('#reply_status_form .status_textarea textarea').addClass('focus'); $('#reply_status_form .status_textarea textarea').addClass('focus');
$('#reply_status_form .status_bottom').removeClass('invisible'); $('#reply_status_form .status_bottom').removeClass('invisible');
$('#reply_status_form .submit_status_label').addClass('active_submit_button'); $('#reply_status_form .submit_status_label').addClass('active_submit_button');
$('#reply_status_form textarea').val("@"+$('#reply_status_form').attr('username')+" "); $('#reply_status_form textarea').val("@"+$('#reply_status_form').attr('username')+" ");
$('#reply_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]);
$('#reply_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon);
$('#reply_status_form .character_count').html(current_instance_charlimit); $('#reply_status_form .character_count').html(current_instance_charlimit);
} }
}); });
@ -2099,7 +2236,8 @@ e.stopPropagation();
const sid= $(this).attr('tid'), const sid= $(this).attr('tid'),
acct = $(this).attr('acct'), acct = $(this).attr('acct'),
display_name = $(this).attr('display_name'); display_name = $(this).attr('display_name');
switch(localStorage.getItem("setting_post_privacy")) { privacy_mode = $(this).attr("privacy");
switch(privacy_mode) {
case "public":picon="globe";break; case "public":picon="globe";break;
case "unlisted":picon="unlock-alt";break; case "unlisted":picon="unlock-alt";break;
case "private":picon="lock";break; case "private":picon="lock";break;
@ -2113,7 +2251,7 @@ $('#js-overlay_content_wrap').addClass('black_08');
$('.single_reply_status .submit_status_label').addClass('active_submit_button'); $('.single_reply_status .submit_status_label').addClass('active_submit_button');
$('#single_reply_status_form .status_textarea textarea').addClass('focus'); $('#single_reply_status_form .status_textarea textarea').addClass('focus');
$('#single_reply_status_form .status_textarea textarea').focus() $('#single_reply_status_form .status_textarea textarea').focus()
$('#single_reply_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]); $('#single_reply_status_form input[name="privacy_option"]').val([privacy_mode]);
$('#single_reply_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon); $('#single_reply_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon);
$('#single_reply_status_form').attr('tid',sid); $('#single_reply_status_form').attr('tid',sid);
$('.single_reply_status .single_reply_status_header span').text("Reply to "+display_name); $('.single_reply_status .single_reply_status_header span').text("Reply to "+display_name);

View File

@ -28,6 +28,15 @@ $('.footer_widget_terms').attr('href','https://'+current_instance+'/terms');
const what_to_follow_0 = JSON.parse(localStorage.getItem("what_to_follow_0")); const what_to_follow_0 = JSON.parse(localStorage.getItem("what_to_follow_0"));
const what_to_follow_1 = JSON.parse(localStorage.getItem("what_to_follow_1")); const what_to_follow_1 = JSON.parse(localStorage.getItem("what_to_follow_1"));
const what_to_follow_2 = JSON.parse(localStorage.getItem("what_to_follow_2")); const what_to_follow_2 = JSON.parse(localStorage.getItem("what_to_follow_2"));
if(what_to_follow_0.display_name.length == 0) {
what_to_follow_0.display_name = what_to_follow_0.username;
}
if(what_to_follow_1.display_name.length == 0) {
what_to_follow_1.display_name = what_to_follow_1.username;
}
if(what_to_follow_2.display_name.length == 0) {
what_to_follow_2.display_name = what_to_follow_2.username;
}
$('.what_to_follow_0 > .icon_box img').attr('src', what_to_follow_0.avatar); $('.what_to_follow_0 > .icon_box img').attr('src', what_to_follow_0.avatar);
$('.what_to_follow_0 .label_box > a').attr('href', getRelativeURL(what_to_follow_0.url, what_to_follow_0.id) ); $('.what_to_follow_0 .label_box > a').attr('href', getRelativeURL(what_to_follow_0.url, what_to_follow_0.id) );
$('.what_to_follow_0 .label_box > a > h3 .dn').text(what_to_follow_0.display_name); $('.what_to_follow_0 .label_box > a > h3 .dn').text(what_to_follow_0.display_name);
@ -49,4 +58,4 @@ $('.what_to_follow_0 .label_box > .follow_button').attr('data', what_to_follow_2
replace_emoji(); replace_emoji();
</script> </script>
</body> </body>
</html> </html>

View File

@ -29,8 +29,8 @@ View <span></span> new Toots
</div> </div>
</main> </main>
<script> <script>
current_file = location.pathname; current_file = location.pathname+location.search;
<?php if (isset($_GET['q'])): ?> <?php if(isset($_GET['q'])) { ?>
$(function() { $(function() {
const query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>"; const query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>";
$('#main > .article_wrap > .center_column > .timeline_header > .header_items > .item').text("#"+query); $('#main > .article_wrap > .center_column > .timeline_header > .header_items > .item').text("#"+query);
@ -46,6 +46,8 @@ setTimeline("timelines/tag/"+query, [{name:"local",data:"ture"}]);
} }
replace_emoji(); replace_emoji();
}); });
<?php endif; ?> <?php } else { ?>
window.location.href = "/";
<?php } ?>
</script> </script>
<?php include ('footer.php'); ?> <?php include ('footer.php'); ?>

View File

@ -16,7 +16,7 @@
</div> </div>
</main> </main>
<script> <script>
current_file = location.pathname; current_file = location.pathname+location.search;
<?php if(isset($_GET['q'])): ?> <?php if(isset($_GET['q'])): ?>
const query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>"; const query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>";
$('title').text(query+' - Halcyon Search'); $('title').text(query+' - Halcyon Search');
@ -27,4 +27,4 @@ $('#js-search_nav_peoples a ').attr('href','/search/users'+location.search);
setUserSearch(query); setUserSearch(query);
<?php endif; ?> <?php endif; ?>
</script> </script>
<?php include ('footer.php'); ?> <?php include ('footer.php'); ?>

View File

@ -1 +1 @@
1.1.1 1.1.2