Added custom emojis and other stuff

This commit is contained in:
nipos 2018-04-01 19:30:47 +02:00
parent 81c5a00ecf
commit 3ff46bb96e
10 changed files with 113 additions and 81 deletions

View File

@ -5,7 +5,11 @@ A Mastodon web client that looks like Twitter
<img src="https://halcyon.cybre.space/login/assets/images/preview0.png"> <img src="https://halcyon.cybre.space/login/assets/images/preview0.png">
## Stay tuned
Follow or Mastodon account and never miss an important update: [@halcyon@social.csswg.org](https://social.csswg.org/@halcyon)
## Blog ## Blog
- [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
- Release of Version 1.0.2 - Fixed a Firefox-only bug and some wrong links, added version info and an annoying cookie notice (sorry, but that's EU law) - Release of Version 1.0.2 - Fixed a Firefox-only bug and some wrong links, added version info and an annoying cookie notice (sorry, but that's EU law)
- Release of Version 1.0.1 - Two bugfixes - Release of Version 1.0.1 - Two bugfixes
@ -13,8 +17,8 @@ A Mastodon web client that looks like Twitter
## Instances ## Instances
These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use. These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use.
- https://halcyon.toromino.de - 1.0.3 - https://halcyon.toromino.de - 1.1.0
- https://social.dev-wiki.de - 1.0.1 - https://social.dev-wiki.de - 1.1.0
- https://halcyon.cybre.space - Outdated - 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. 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.

View File

@ -128,6 +128,24 @@ $(".current_following_count_link").attr('href', current_following_count_link);
$(".current_followers_count_link").attr('href', current_followers_count_link); $(".current_followers_count_link").attr('href', current_followers_count_link);
replace_emoji(); replace_emoji();
}); });
api.get("accounts/"+current_id+"/following",function(data) {
followings = new Array();
for(i=0;i<data.length;i++) {
followings.push(data[i].id);
}
localStorage.setItem("current_following_ids",JSON.stringify(followings));
current_following_ids = followings;
});
api.get("instance",function(data) {
if(data.max_toot_chars) {
localStorage.setItem("current_instance_charlimit",data.max_toot_chars);
current_instance_charlimit = data.max_toot_chars;
}
else {
localStorage.setItem("current_instance_charlimit",500);
current_instance_charlimit = 500;
}
});
$.cookie("session","true",{path:'/'}); $.cookie("session","true",{path:'/'});
} }
function refreshApp() { function refreshApp() {
@ -150,20 +168,8 @@ current_statuses_count_link= localStorage.getItem("current_statuses_count_link")
current_following_count_link = localStorage.getItem("current_following_count_link"); current_following_count_link = localStorage.getItem("current_following_count_link");
current_followers_count_link = localStorage.getItem("current_followers_count_link"); current_followers_count_link = localStorage.getItem("current_followers_count_link");
current_favourites_link = localStorage.getItem("current_favourites_link"); current_favourites_link = localStorage.getItem("current_favourites_link");
if(!localStorage.getItem("current_following_ids")) { current_following_ids = localStorage.getItem("current_following_ids");
current_following_ids = new Array(); current_instance_charlimit = localStorage.getItem("current_instance_charlimit");
api.get("accounts/"+current_id+"/following",function(data) {
followings = new Array();
for(i=0;i<data.length;i++) {
followings.push(data[i].id);
}
localStorage.setItem("current_following_ids",JSON.stringify(followings));
current_following_ids = followings;
});
}
else {
current_following_ids = JSON.parse(localStorage.getItem("current_following_ids"));
}
} }
function setCurrentProfile() { function setCurrentProfile() {
$(".js_current_profile_displayname").text(current_display_name); $(".js_current_profile_displayname").text(current_display_name);

View File

@ -220,6 +220,9 @@ current_following_ids.indexOf(status.account.id) === -1
) { ) {
localStorage.setItem("what_to_follow_"+String(Math.floor(Math.random()*3)), JSON.stringify(status.account) ); localStorage.setItem("what_to_follow_"+String(Math.floor(Math.random()*3)), JSON.stringify(status.account) );
} }
for(i=0;i<status.emojis.length;i++) {
status.content = status.content.replace(new RegExp(":"+status.emojis[i].shortcode+":","g"),"<img src='"+status.emojis[i].static_url+"' class='emoji'>");
}
const status_account_link= getRelativeURL(status.account.url, status.account.id), const status_account_link= getRelativeURL(status.account.url, status.account.id),
status_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, status.created_at)), status_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, status.created_at)),
status_attr_datetime = getConversionedDate(null, status.created_at); status_attr_datetime = getConversionedDate(null, status.created_at);
@ -320,6 +323,9 @@ current_following_ids.indexOf(status.reblog.account.id) === -1
) { ) {
localStorage.setItem("what_to_follow_" + String(Math.floor(Math.random()*3)), JSON.stringify(status.reblog.account)); localStorage.setItem("what_to_follow_" + String(Math.floor(Math.random()*3)), JSON.stringify(status.reblog.account));
} }
for(i=0;i<status.reblog.emojis.length;i++) {
status.reblog.content = status.reblog.content.replace(new RegExp(":"+status.reblog.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.emojis[i].static_url+"' class='emoji'>");
}
const status_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, status.reblog.created_at)), const status_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, status.reblog.created_at)),
status_attr_datetime = getConversionedDate(null, status.reblog.created_at), status_attr_datetime = getConversionedDate(null, status.reblog.created_at),
status_reblog_account_link = getRelativeURL(status.reblog.account.url, status.reblog.account.id), status_reblog_account_link = getRelativeURL(status.reblog.account.url, status.reblog.account.id),
@ -425,6 +431,9 @@ const toot_author_link = getRelativeURL(NotificationObj.status.account.url, Noti
toot_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, NotificationObj.status.created_at)), toot_datetime= getRelativeDatetime(Date.now(), getConversionedDate(null, NotificationObj.status.created_at)),
toot_attr_datetime = getConversionedDate(null, NotificationObj.status.created_at); toot_attr_datetime = getConversionedDate(null, NotificationObj.status.created_at);
if( NotificationObj.type=='favourite' ){ if( NotificationObj.type=='favourite' ){
for(i=0;i<NotificationObj.status.emojis.length;i++) {
NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp(":"+NotificationObj.status.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.emojis[i].static_url+"' class='emoji'>");
}
const html = (` const html = (`
<li sid="${NotificationObj.status.id}" class="notice_entry fav favourite toot_entry"> <li sid="${NotificationObj.status.id}" class="notice_entry fav favourite toot_entry">
<div class="notice_author_box"> <div class="notice_author_box">
@ -461,6 +470,9 @@ ${NotificationObj.status.account.display_name}
</li>`); </li>`);
return $(html); return $(html);
} else if ( NotificationObj.type === 'reblog' ) { } else if ( NotificationObj.type === 'reblog' ) {
for(i=0;i<NotificationObj.status.emojis.length;i++) {
NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp(":"+NotificationObj.status.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.emojis[i].static_url+"' class='emoji'>");
}
const sid= NotificationObj.status.id, const sid= NotificationObj.status.id,
html = (` html = (`
<li sid="${NotificationObj.status.id}" class="notice_entry bos boost toot_entry"> <li sid="${NotificationObj.status.id}" class="notice_entry bos boost toot_entry">
@ -507,6 +519,9 @@ article_option= "",
toot_reblogs_count= "", toot_reblogs_count= "",
toot_favourites_count = "", toot_favourites_count = "",
media_views = ""; media_views = "";
for(i=0;i<NotificationObj.status.emojis.length;i++) {
NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp(":"+NotificationObj.status.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.emojis[i].static_url+"' class='emoji'>");
}
if (NotificationObj.status.spoiler_text) { if (NotificationObj.status.spoiler_text) {
alart_text = '<span>'+NotificationObj.status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>', alart_text = '<span>'+NotificationObj.status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>',
article_option = 'content_warning'; article_option = 'content_warning';
@ -650,6 +665,9 @@ article_option= "",
toot_reblogs_count= "", toot_reblogs_count= "",
toot_favourites_count = "", toot_favourites_count = "",
media_views = ""; media_views = "";
for(i=0;i<status.emojis.length;i++) {
status.content = status.content.replace(new RegExp(":"+status.emojis[i].shortcode+":","g"),"<img src='"+status.emojis[i].static_url+"' class='emoji'>");
}
if (status.spoiler_text) { if (status.spoiler_text) {
alart_text = '<span>'+status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>', alart_text = '<span>'+status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>',
article_option = 'content_warning'; article_option = 'content_warning';
@ -784,7 +802,7 @@ ${media_views}
<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">
500 ${current_instance_charlimit}
</span> </span>
<!-- Submit --> <!-- Submit -->
<label for="reply_status_form_submit" class="submit_status_label"> <label for="reply_status_form_submit" class="submit_status_label">
@ -809,6 +827,9 @@ article_option= "",
toot_reblogs_count= "", toot_reblogs_count= "",
toot_favourites_count = "", toot_favourites_count = "",
media_views = ""; media_views = "";
for(i=0;i<status.reblog.emojis.length;i++) {
status.reblog.content = status.reblog.content.replace(new RegExp(":"+status.reblog.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.emojis[i].static_url+"' class='emoji'>");
}
if (status.spoiler_text) { if (status.spoiler_text) {
alart_text = '<span>'+status.reblog.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>', alart_text = '<span>'+status.reblog.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>',
article_option = 'content_warning'; article_option = 'content_warning';
@ -943,7 +964,7 @@ ${media_views}
<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">
500 ${current_instance_charlimit}
</span> </span>
<!-- Submit --> <!-- Submit -->
<label for="reply_status_form_submit" class="submit_status_label"> <label for="reply_status_form_submit" class="submit_status_label">
@ -994,6 +1015,9 @@ article_option= "",
toot_reblogs_count= "", toot_reblogs_count= "",
toot_favourites_count = "", toot_favourites_count = "",
media_views = ""; media_views = "";
for(i=0;i<status.emojis.length;i++) {
status.content = status.content.replace(new RegExp(":"+status.emojis[i].shortcode+":","g"),"<img src='"+status.emojis[i].static_url+"' class='emoji'>");
}
if ( status.spoiler_text ) { if ( status.spoiler_text ) {
alart_text = '<span>'+status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>', alart_text = '<span>'+status.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>',
article_option = 'content_warning'; article_option = 'content_warning';
@ -1082,6 +1106,9 @@ article_option= "",
toot_reblogs_count= "", toot_reblogs_count= "",
toot_favourites_count = "", toot_favourites_count = "",
media_views = ""; media_views = "";
for(i=0;i<status.reblog.emojis.length;i++) {
status.reblog.content = status.reblog.content.replace(new RegExp(":"+status.reblog.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.emojis[i].static_url+"' class='emoji'>");
}
if ( status.spoiler_text ) { if ( status.spoiler_text ) {
alart_text = '<span>'+status.reblog.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>', alart_text = '<span>'+status.reblog.spoiler_text+'</span><button class="cw_button">SHOW MORE</button>',
article_option = 'content_warning'; article_option = 'content_warning';
@ -1653,6 +1680,7 @@ $('.overlay_status .submit_status_label').addClass('active_submit_button');
$('#overlay_status_form .status_textarea textarea').focus() $('#overlay_status_form .status_textarea textarea').focus()
$('#overlay_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]); $('#overlay_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]);
$('#overlay_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon); $('#overlay_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon);
$('#overlay_status_form .character_count').html(current_instance_charlimit);
}); });
$(document).on('change keyup','#overlay_status_form textarea, #overlay_status_form .status_spoiler', function(e) { $(document).on('change keyup','#overlay_status_form textarea, #overlay_status_form .status_spoiler', function(e) {
if ( if (
@ -1661,11 +1689,11 @@ e.keyCode !== 17&
e.keyCode !== undefined e.keyCode !== undefined
) { ) {
const textCount = $('#overlay_status_form textarea').val().length + $('#overlay_status_form .status_spoiler').val().length; const textCount = $('#overlay_status_form textarea').val().length + $('#overlay_status_form .status_spoiler').val().length;
let textLen = ( 500 - textCount ); let textLen = ( current_instance_charlimit - textCount );
if ( textLen <= -1 ) { if ( textLen <= -1 ) {
$('#overlay_status_form .character_count').addClass('red'); $('#overlay_status_form .character_count').addClass('red');
$('#overlay_status_form').addClass('ready'); $('#overlay_status_form').addClass('ready');
} else if ( textLen === 500 ) { } else if ( textLen === current_instance_charlimit ) {
$('#overlay_status_form').addClass('ready'); $('#overlay_status_form').addClass('ready');
} else { } else {
$('#overlay_status_form .character_count').removeClass('red'); $('#overlay_status_form .character_count').removeClass('red');
@ -1724,7 +1752,7 @@ $('#overlay_status_form .status_textarea .media_attachments_preview_area').addCl
form.reset(); form.reset();
$('#overlay_status_form').removeClass('ready'); $('#overlay_status_form').removeClass('ready');
$('#overlay_status_form .status_textarea').removeClass('disallow_select'); $('#overlay_status_form .status_textarea').removeClass('disallow_select');
$('#overlay_status_form .character_count').html('500'); $('#overlay_status_form .character_count').html(current_instance_charlimit);
$('.overlay_status .submit_status_label').removeClass('active_submit_button'); $('.overlay_status .submit_status_label').removeClass('active_submit_button');
$('.overlay_status').addClass('invisible'); $('.overlay_status').addClass('invisible');
$('#js-overlay_content_wrap').removeClass('view'); $('#js-overlay_content_wrap').removeClass('view');
@ -1757,7 +1785,7 @@ $('#overlay_status_form .status_textarea .media_attachments_preview_area').addCl
form.reset(); form.reset();
$('#overlay_status_form').removeClass('ready'); $('#overlay_status_form').removeClass('ready');
$('#overlay_status_form .status_textarea').removeClass('disallow_select'); $('#overlay_status_form .status_textarea').removeClass('disallow_select');
$('#overlay_status_form .character_count').html('500'); $('#overlay_status_form .character_count').html(current_instance_charlimit);
$('.overlay_status .submit_status_label').removeClass('active_submit_button'); $('.overlay_status .submit_status_label').removeClass('active_submit_button');
$('.overlay_status').addClass('invisible'); $('.overlay_status').addClass('invisible');
$('#js-overlay_content_wrap').removeClass('view'); $('#js-overlay_content_wrap').removeClass('view');
@ -1791,11 +1819,11 @@ e.keyCode !== 17&
e.keyCode !== undefined e.keyCode !== undefined
) { ) {
const textCount = $('#header_status_form textarea').val().length + $('#header_status_form .status_spoiler').val().length; const textCount = $('#header_status_form textarea').val().length + $('#header_status_form .status_spoiler').val().length;
let textLen = ( 500 - textCount ); let textLen = ( current_instance_charlimit - textCount );
if ( textLen <= -1 ) { if ( textLen <= -1 ) {
$('#header_status_form .character_count').addClass('red'); $('#header_status_form .character_count').addClass('red');
$('#header_status_form').addClass('ready'); $('#header_status_form').addClass('ready');
} else if ( textLen === 500 ) { } else if ( textLen === current_instance_charlimit ) {
$('#header_status_form').addClass('ready'); $('#header_status_form').addClass('ready');
} else { } else {
$('#header_status_form .character_count').removeClass('red'); $('#header_status_form .character_count').removeClass('red');
@ -1829,6 +1857,7 @@ $('#header_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-"
$('#header_status_form .status_textarea textarea').addClass('focus'); $('#header_status_form .status_textarea textarea').addClass('focus');
$('#header_status_form .status_bottom').removeClass('invisible'); $('#header_status_form .status_bottom').removeClass('invisible');
$('#header_status_form .submit_status_label').addClass('active_submit_button'); $('#header_status_form .submit_status_label').addClass('active_submit_button');
$('#header_status_form .character_count').html(current_instance_charlimit);
} }
}); });
$(document).on('change','#header_status_media_atta', function(e) { $(document).on('change','#header_status_media_atta', function(e) {
@ -1869,7 +1898,7 @@ $('#header_status_form .status_textarea .media_attachments_preview_area').addCla
form.reset(); form.reset();
$('#header_status_form').removeClass('ready'); $('#header_status_form').removeClass('ready');
$('#header_status_form .status_textarea').removeClass('disallow_select'); $('#header_status_form .status_textarea').removeClass('disallow_select');
$('#header_status_form .character_count').html('500'); $('#header_status_form .character_count').html(current_instance_charlimit);
}); });
} else { } else {
const dummy_form = $('<form></form>').append($('#header_status_media_atta')), const dummy_form = $('<form></form>').append($('#header_status_media_atta')),
@ -1897,7 +1926,7 @@ $('#header_status_form .status_textarea .media_attachments_preview_area').addCla
form.reset(); form.reset();
$('#header_status_form').removeClass('ready'); $('#header_status_form').removeClass('ready');
$('#header_status_form .status_textarea').removeClass('disallow_select'); $('#header_status_form .status_textarea').removeClass('disallow_select');
$('#header_status_form .character_count').html('500'); $('#header_status_form .character_count').html(current_instance_charlimit);
}); });
}); });
break; break;
@ -1934,6 +1963,7 @@ $('#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 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 .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon);
$('#reply_status_form .character_count').html(current_instance_charlimit);
} }
}); });
$(document).on('change keyup','#reply_status_form textarea, #reply_status_form .status_spoiler', function(e) { $(document).on('change keyup','#reply_status_form textarea, #reply_status_form .status_spoiler', function(e) {
@ -1943,11 +1973,11 @@ e.keyCode !== 17&
e.keyCode !== undefined e.keyCode !== undefined
) { ) {
const textCount = $('#reply_status_form textarea').val().length + $('#reply_status_form .status_spoiler').val().length; const textCount = $('#reply_status_form textarea').val().length + $('#reply_status_form .status_spoiler').val().length;
let textLen = ( 500 - textCount ); let textLen = ( current_instance_charlimit - textCount );
if ( textLen <= -1 ) { if ( textLen <= -1 ) {
$('#reply_status_form .character_count').addClass('red'); $('#reply_status_form .character_count').addClass('red');
$('#reply_status_form').addClass('ready'); $('#reply_status_form').addClass('ready');
} else if ( textLen === 500 ) { } else if ( textLen === current_instance_charlimit ) {
$('#reply_status_form').addClass('ready'); $('#reply_status_form').addClass('ready');
} else { } else {
$('#reply_status_form .character_count').removeClass('red'); $('#reply_status_form .character_count').removeClass('red');
@ -2007,7 +2037,7 @@ $('#reply_status_form .status_textarea .media_attachments_preview_area').addClas
form.reset(); form.reset();
$('#reply_status_form').removeClass('ready'); $('#reply_status_form').removeClass('ready');
$('#reply_status_form .status_textarea').removeClass('disallow_select'); $('#reply_status_form .status_textarea').removeClass('disallow_select');
$('#reply_status_form .character_count').html('500'); $('#reply_status_form .character_count').html(current_instance_charlimit);
$('.reply_status .submit_status_label').removeClass('active_submit_button'); $('.reply_status .submit_status_label').removeClass('active_submit_button');
context_template(data, 'descendants_status').appendTo("#js-overlay_content .temporary_object .toot_detail_wrap"); context_template(data, 'descendants_status').appendTo("#js-overlay_content .temporary_object .toot_detail_wrap");
replace_emoji(); replace_emoji();
@ -2040,7 +2070,7 @@ $('#reply_status_form .status_textarea .media_attachments_preview_area').addClas
form.reset(); form.reset();
$('#reply_status_form').removeClass('ready'); $('#reply_status_form').removeClass('ready');
$('#reply_status_form .status_textarea').removeClass('disallow_select'); $('#reply_status_form .status_textarea').removeClass('disallow_select');
$('#reply_status_form .character_count').html('500'); $('#reply_status_form .character_count').html(current_instance_charlimit);
$('.reply_status .submit_status_label').removeClass('active_submit_button'); $('.reply_status .submit_status_label').removeClass('active_submit_button');
context_template(data, 'descendants_status').appendTo("#js-overlay_content .temporary_object .toot_detail_wrap"); context_template(data, 'descendants_status').appendTo("#js-overlay_content .temporary_object .toot_detail_wrap");
replace_emoji(); replace_emoji();
@ -2085,6 +2115,7 @@ $('#single_reply_status_form .expand_privacy_menu_button > i').attr('class', "fa
$('#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);
$('#single_reply_status_form textarea').val(acct+" "); $('#single_reply_status_form textarea').val(acct+" ");
$('#single_reply_status_form .character_count').html(current_instance_charlimit);
api.get('statuses/'+sid+'/', function(status) { api.get('statuses/'+sid+'/', function(status) {
timeline_template(status).appendTo(".single_reply_status .status_preview"); timeline_template(status).appendTo(".single_reply_status .status_preview");
replace_emoji(); replace_emoji();
@ -2098,11 +2129,11 @@ e.keyCode !== 17&
e.keyCode !== undefined e.keyCode !== undefined
) { ) {
const textCount = $('#single_reply_status_form textarea').val().length + $('#single_reply_status_form .status_spoiler').val().length; const textCount = $('#single_reply_status_form textarea').val().length + $('#single_reply_status_form .status_spoiler').val().length;
let textLen = ( 500 - textCount ); let textLen = ( current_instance_charlimit - textCount );
if ( textLen <= -1 ) { if ( textLen <= -1 ) {
$('#single_reply_status_form .character_count').addClass('red'); $('#single_reply_status_form .character_count').addClass('red');
$('#single_reply_status_form').addClass('ready'); $('#single_reply_status_form').addClass('ready');
} else if ( textLen === 500 ) { } else if ( textLen === current_instance_charlimit ) {
$('#single_reply_status_form').addClass('ready'); $('#single_reply_status_form').addClass('ready');
} else { } else {
$('#single_reply_status_form .character_count').removeClass('red'); $('#single_reply_status_form .character_count').removeClass('red');
@ -2162,7 +2193,7 @@ $('#single_reply_status_form .status_textarea .media_attachments_preview_area').
form.reset(); form.reset();
$('#single_reply_status_form').removeClass('ready'); $('#single_reply_status_form').removeClass('ready');
$('#single_reply_status_form .status_textarea').removeClass('disallow_select'); $('#single_reply_status_form .status_textarea').removeClass('disallow_select');
$('#single_reply_status_form .character_count').html('500'); $('#single_reply_status_form .character_count').html(current_instance_charlimit);
$('.single_reply_status .submit_status_label').removeClass('active_submit_button'); $('.single_reply_status .submit_status_label').removeClass('active_submit_button');
$('.single_reply_status').addClass('invisible'); $('.single_reply_status').addClass('invisible');
$('#js-overlay_content_wrap').removeClass('view'); $('#js-overlay_content_wrap').removeClass('view');
@ -2197,7 +2228,7 @@ $('#single_reply_status_form .status_textarea .media_attachments_preview_area').
form.reset(); form.reset();
$('#single_reply_status_form').removeClass('ready'); $('#single_reply_status_form').removeClass('ready');
$('#single_reply_status_form .status_textarea').removeClass('disallow_select'); $('#single_reply_status_form .status_textarea').removeClass('disallow_select');
$('#single_reply_status_form .character_count').html('500'); $('#single_reply_status_form .character_count').html(current_instance_charlimit);
$('.single_reply_status .submit_status_label').removeClass('active_submit_button'); $('.single_reply_status .submit_status_label').removeClass('active_submit_button');
$('.single_reply_status').addClass('invisible'); $('.single_reply_status').addClass('invisible');
$('#js-overlay_content_wrap').removeClass('view'); $('#js-overlay_content_wrap').removeClass('view');

View File

@ -3458,10 +3458,10 @@ $(this).html($(this).html().replace(emoji[i], emoji_dict[emoji[i]]));
$(this).removeClass('emoji_poss'); $(this).removeClass('emoji_poss');
} }
} }
$(this).html($(this).html().replace("✅", "<img class='emoji' src='/assets/images/self_auth_min.png' />")); $(this).html($(this).html().replace("✅", "<img class='emoji' src='/assets/images/self_auth_min.png'>"));
}); });
twemoji.parse(document.body,{base:(location.protocol==="https:"?"https:":"http:")+"//cdn.staticfile.org/twemoji/2.2.5/"}); twemoji.parse(document.body,{base:(location.protocol==="https:"?"https:":"http:")+"//cdn.staticfile.org/twemoji/2.2.5/"});
}; }
function replaced_emoji_return(original) { function replaced_emoji_return(original) {
const emoji = original.match(/(:.+?:)/g); const emoji = original.match(/(:.+?:)/g);
for(let i in emoji) { for(let i in emoji) {
@ -3469,5 +3469,5 @@ if(emoji_dict[emoji[i]]) {
original = original.replace(emoji[i], emoji_dict[emoji[i]]); original = original.replace(emoji[i], emoji_dict[emoji[i]]);
} }
} }
return original return original;
}; }

View File

@ -60,36 +60,9 @@
<?php $config = parse_ini_file('../config.ini',true) ?> <?php $config = parse_ini_file('../config.ini',true) ?>
<main id="main"> <main id="main">
<article id="article"> <article id="article">
<h1>Halcyon Terms of Use</h1> <h2>Halcyon Terms of Use</h2>
<p class="description">This terms of use agreement is for the users of web service Halcyon for Mastodon (Halcyon for short) hosted at <a href="<?php echo $config["App"]["api_client_website"] ?>"><?php echo $config["App"]["api_client_website"] ?></a>.</p> <p class="description">This terms of use agreement is for the users of web service Halcyon for Mastodon (Halcyon for short) hosted at <a href="<?php echo $config["App"]["api_client_website"] ?>"><?php echo $config["App"]["api_client_website"] ?></a>.</p><br/>
<br/> <?php echo file_get_contents("../terms.txt") ?>
<h2>1. Agreement</h2>
<p>By logging into Halcyon you agree to this terms of use agreement. Do not use this service if you do not agree to these terms.</p>
<br/>
<h2>2. Change</h2>
<p>We reserve the right to modify these terms of use at any time if deemed necessary.</p>
<br/>
<h2>3. Account</h2>
<p>Users can connect to various Mastodon accounts from Halcyon, and Halcyon will not interfere with those connection.</p>
<br/>
<h2>4. Content</h2>
<p>Halcyon does not own the right to or hold responsibility for any text, image, animation, audio content accessible from Halcyon. The right and responsibility belong to the owners of instances that host those content.</p>
<br/>
<h2>5. Guideline</h2>
<p>Halcyon reserves the right to terminate service for</p>
<ul>
<li>actions violating the laws of countries</li>
<li>actions contrary to public order and standards of decency</li>
<li>violation of third party’s right to intellectual property, brand, privacy, etc.</li>
<li>acts of violence, sexual nature, of discrimination</li>
<li>phishing or spamming</li>
<li>actions causing problem to the network infrastructure of Halcyon</li>
</ul>
<br/>
<h2>6. Disclaimer</h2>
<p>Halcyon is not responsible for any damage caused by using this service.</p>
<br/>
<p>Last updated 2017/5/12</p>
</article> </article>
</main> </main>
<footer id="footer"> <footer id="footer">

21
terms.txt Normal file
View File

@ -0,0 +1,21 @@
<h2>1. Agreement</h2>
<p>By logging into Halcyon you agree to this terms of use agreement. Do not use this service if you do not agree to these terms.</p>
<h2>2. Change</h2>
<p>We reserve the right to modify these terms of use at any time if deemed necessary.</p>
<h2>3. Account</h2>
<p>Users can connect to various Mastodon accounts from Halcyon, and Halcyon will not interfere with those connection.</p>
<h2>4. Content</h2>
<p>Halcyon does not own the right to or hold responsibility for any text, image, animation, audio content accessible from Halcyon. The right and responsibility belong to the owners of instances that host those content.</p>
<h2>5. Guideline</h2>
<p>Halcyon reserves the right to terminate service for</p>
<ul>
<li>actions violating the laws of countries</li>
<li>actions contrary to public order and standards of decency</li>
<li>violation of third partys right to intellectual property, brand, privacy, etc.</li>
<li>acts of violence, sexual nature, of discrimination</li>
<li>phishing or spamming</li>
<li>actions causing problem to the network infrastructure of Halcyon</li>
</ul>
<h2>6. Disclaimer</h2>
<p>Halcyon is not responsible for any damage caused by using this service.</p>
<p>Last updated 2017/5/12</p>

View File

@ -1 +1 @@
1.0.3 1.1.0

View File

@ -47,7 +47,6 @@
<input id="header_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"> <input id="header_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">
500
</span> </span>
<label for="header_status_form_submit" class="submit_status_label"> <label for="header_status_form_submit" class="submit_status_label">
<div class="toot_button_label disallow_select" > <div class="toot_button_label disallow_select" >

View File

@ -48,7 +48,6 @@
<input id="overlay_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"> <input id="overlay_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">
500
</span> </span>
<label for="overlay_status_form_submit" class="submit_status_label"> <label for="overlay_status_form_submit" class="submit_status_label">
<div class="toot_button_label disallow_select"> <div class="toot_button_label disallow_select">

View File

@ -49,7 +49,6 @@
<input id="single_reply_status_direct" name='privacy_option' value="direct" class="invisible" type="radio"> <input id="single_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">
500
</span> </span>
<label for="single_reply_status_form_submit" class="submit_status_label"> <label for="single_reply_status_form_submit" class="submit_status_label">
<div class="toot_button_label disallow_select"> <div class="toot_button_label disallow_select">