Introduced lists feature,separate page for direct messages,other optimizations
This commit is contained in:
parent
098e6bb714
commit
b81a0c6109
11
.htaccess
11
.htaccess
|
@ -32,6 +32,16 @@ RewriteRule ^notifications/?$ notifications\.php [NC,L]
|
|||
RewriteBase /whotofollow
|
||||
RewriteRule ^whotofollow/?$ who_to_follow\.php [NC,L]
|
||||
|
||||
# Direct
|
||||
RewriteBase /direct
|
||||
RewriteRule ^direct/?$ direct\.php [NC,L]
|
||||
|
||||
# Lists
|
||||
RewriteBase /lists
|
||||
RewriteRule ^lists/?$ lists\.php [NC,L]
|
||||
RewriteRule ^lists/(\d+)/?$ lists_view\.php?id=$1 [NC,L,QSA]
|
||||
RewriteRule ^lists/(\d+)/add/?$ lists_add\.php?id=$1 [NC,L,QSA]
|
||||
|
||||
# Search
|
||||
RewriteBase /search
|
||||
RewriteRule ^search/?$ search_hash_tag\.php [NC,L,QSA]
|
||||
|
@ -63,4 +73,3 @@ RewriteRule ^404/?$ 404\.php [NC,L,QSA]
|
|||
ErrorDocument 404 /404
|
||||
|
||||
</IfModule>
|
||||
|
||||
|
|
16
Caddyfile
16
Caddyfile
|
@ -59,6 +59,22 @@ r ^/whotofollow/?$
|
|||
to /who_to_follow.php
|
||||
}
|
||||
rewrite {
|
||||
r ^/direct/?$
|
||||
to direct.php
|
||||
}
|
||||
rewrite {
|
||||
r ^/lists/?$
|
||||
to lists.php
|
||||
}
|
||||
rewrite{
|
||||
r ^/lists/(\d+)/?$
|
||||
to lists_view.php?id={1}
|
||||
}
|
||||
rewrite{
|
||||
r ^/lists/(\d+)/add/?$
|
||||
to lists_add.php?id={1}
|
||||
}
|
||||
rewrite {
|
||||
r ^/search/?$
|
||||
to /search_hash_tag.php
|
||||
}
|
||||
|
|
24
README.md
24
README.md
|
@ -14,7 +14,17 @@ We moved our instances list to a wiki page: https://notabug.org/halcyon-suite/ha
|
|||
## Translate
|
||||
[Help us translating Halcyon into many languages](https://translate.zanata.org/project/view/halcyon)
|
||||
|
||||
## Features
|
||||
- Twitter like UI, familiar interface.
|
||||
- Able to use on all instances.
|
||||
- No tracking, No ads.
|
||||
- Supports multiple languages
|
||||
|
||||
## Install
|
||||
Read our new wiki pages: https://notabug.org/halcyon-suite/halcyon/wiki
|
||||
|
||||
## Blog
|
||||
- Release of Version 2.1.0 - [Blog article coming soon]
|
||||
- Release of Version 2.0.2 - Added dark theme,improved Japanese translation,added Galician translation,links to posts open in Halcyon now,smaller screens supported
|
||||
- Release of Version 2.0.1 - Added the languages Polish,Japanese and Korean,fixed many bugs,automatically mention all participants of discussions
|
||||
- [Release of Version 2.0.0 - The biggest changes in detail](https://nikisoft.myblog.de/nikisoft/art/11636651/Halcyon-2-0-0-The-biggest-changes-in-detail)
|
||||
|
@ -39,20 +49,6 @@ We moved our instances list to a wiki page: https://notabug.org/halcyon-suite/ha
|
|||
- Release of Version 1.0.1 - Two bugfixes
|
||||
- [Release of Version 1.0.0](https://nikisoft.myblog.de/nikisoft/art/11264555/The-first-new-Halcyon-release-is-on-Github)
|
||||
|
||||
## Features
|
||||
- Twitter like UI, familiar interface.
|
||||
- Able to use on all instances.
|
||||
- No tracking, No ads.
|
||||
- Supports multiple languages
|
||||
|
||||
## Requirement
|
||||
- Apache/Nginx/Caddy/lighttpd
|
||||
- PHP
|
||||
- No database needed anymore!
|
||||
|
||||
## Setup
|
||||
Upload it, edit config.ini and have fun!
|
||||
|
||||
## Credits
|
||||
- [Kirschn/mastodon.js](https://github.com/Kirschn/mastodon.js)
|
||||
- [yks118/Mastodon-api-php](https://github.com/yks118/Mastodon-api-php)
|
||||
|
|
|
@ -82,17 +82,20 @@ color:#fff;
|
|||
.single_reply_status .status_preview,.report_status .status_preview {
|
||||
border-top:1px solid #000;
|
||||
}
|
||||
.overlay_copy_link_header {
|
||||
background-color:#fff;
|
||||
color:#66757F;
|
||||
border-bottom:1px solid #E6ECF0;
|
||||
.overlay_simple_header {
|
||||
background-color: #1B2836;
|
||||
color: #EEE;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
.overlay_copy_link .overlay_copy_link_form {
|
||||
background-color:#fff;
|
||||
.overlay_simple .overlay_simple_body {
|
||||
background-color: #243447;
|
||||
}
|
||||
.overlay_copy_link .overlay_copy_link_form input {
|
||||
border:1px solid #E6ECF0;
|
||||
background-color:#F5F8FA;
|
||||
.overlay_addlist_item {
|
||||
border-bottom-color:#000000;
|
||||
}
|
||||
.copy_link_input {
|
||||
border: 1px solid #000;
|
||||
background-color: #132030;
|
||||
}
|
||||
.relationship_button {
|
||||
border:1px solid #189EFC;
|
||||
|
@ -214,7 +217,7 @@ background-color:#243447;
|
|||
color:#657786;
|
||||
}
|
||||
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio {
|
||||
color:#66757f;
|
||||
color:#eee;
|
||||
}
|
||||
#js-follows_profile .follow_button {
|
||||
border:1px solid #189EFC;
|
||||
|
@ -413,10 +416,10 @@ color:#fff;
|
|||
#main .article_wrap .left_column .profile_section_wrap > .profile_username {
|
||||
color:#657786;
|
||||
}
|
||||
#js_profile_recent_images a {
|
||||
.profile_with_icon > a {
|
||||
color:#189EFC;
|
||||
}
|
||||
#js_profile_recent_images a i {
|
||||
.profile_with_icon i {
|
||||
color:#eee;
|
||||
}
|
||||
#js-overlay_content_wrap.view {
|
||||
|
@ -439,7 +442,7 @@ color:#999;
|
|||
background-color:#1B2836;
|
||||
}
|
||||
.toot_entry.ancestors_status .toot_entry_body::after,.toot_entry.descendants_status .toot_entry_body::after {
|
||||
border:2px solid #2A7E5C;
|
||||
border:2px solid #76BFEC;
|
||||
}
|
||||
.toot_entry.descendants_status:last-child .toot_entry_body::after {
|
||||
border:0 solid #76BFEC;
|
||||
|
|
|
@ -501,12 +501,12 @@ margin: auto;
|
|||
font-size: 18px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.overlay_copy_link {
|
||||
.overlay_simple {
|
||||
width: 600px;
|
||||
margin: auto;
|
||||
margin-top: 20%;
|
||||
}
|
||||
.overlay_copy_link_header {
|
||||
.overlay_simple_header {
|
||||
width: 600px;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
|
@ -520,7 +520,7 @@ font-size: 18px;
|
|||
font-weight: 300;
|
||||
border-bottom: 1px solid #E6ECF0;
|
||||
}
|
||||
.overlay_copy_link .overlay_copy_link_form {
|
||||
.overlay_simple .overlay_simple_body {
|
||||
width: 600px;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
|
@ -529,7 +529,7 @@ border-bottom-left-radius: 5px;
|
|||
border-bottom-right-radius: 5px;
|
||||
margin: auto;
|
||||
}
|
||||
.overlay_copy_link .overlay_copy_link_form input {
|
||||
.copy_link_input {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 4px 16px;
|
||||
|
@ -539,6 +539,25 @@ box-sizing: border-box;
|
|||
font-size: 14px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.overlay_confirm_controls,.overlay_prompt_controls {
|
||||
height:31px;
|
||||
}
|
||||
.overlay_addlist_item {
|
||||
padding-top:10px;
|
||||
padding-bottom:10px;
|
||||
border-bottom:1px solid #E6ECF0;
|
||||
}
|
||||
.overlay_addlist_item:first-child {
|
||||
padding-top:0;
|
||||
}
|
||||
.overlay_addlist_item:last-child {
|
||||
padding-bottom:0;
|
||||
border-bottom-width:0;
|
||||
}
|
||||
.overlay_addlist_item > .halcyon_button {
|
||||
float:right;
|
||||
margin-top:-3px;
|
||||
}
|
||||
.relationship_button {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
@ -790,7 +809,7 @@ font-size: 14px;
|
|||
line-height: 20px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a {
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article a,.halcyon_link {
|
||||
color: #2588D0;
|
||||
}
|
||||
.toot_entry .toot_entry_body .toot_content .toot_article.content_warning .status_content {
|
||||
|
@ -1101,7 +1120,7 @@ height: auto;
|
|||
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio p a {
|
||||
color: #189EFC
|
||||
}
|
||||
#js-follows_profile .follow_button {
|
||||
#js-follows_profile .halcyon_button {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
|
@ -1114,31 +1133,21 @@ position: absolute;
|
|||
right: 16px;
|
||||
top: -32px;
|
||||
}
|
||||
#js-follows_profile .follow_button i {
|
||||
#js-follows_profile .halcyon_button i {
|
||||
color: #189EFC;
|
||||
margin-right: 4px;
|
||||
}
|
||||
#js-follows_profile .follow_button span {
|
||||
#js-follows_profile .halcyon_button span {
|
||||
font-weight: 600;
|
||||
}
|
||||
#js-follows_profile .follow_button:hover,
|
||||
#js-follows_profile .follow_button:hover i {
|
||||
#js-follows_profile .halcyon_button:hover,
|
||||
#js-follows_profile .halcyon_button:hover i {
|
||||
background-color: #189EFC;
|
||||
color: #fff!important;
|
||||
}
|
||||
#js-follows_profile .following_button {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
font-size: 13px;
|
||||
padding: 6px 18px;
|
||||
margin-top: 4px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #2B94DA;
|
||||
background-color: #189EFC;
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: -32px;
|
||||
}
|
||||
#js-follows_profile .following_button i {
|
||||
color: #fff;
|
||||
|
@ -1681,7 +1690,7 @@ background-color: #189EFC;
|
|||
text-decoration: none;
|
||||
color: #fff;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button {
|
||||
.toot_button {
|
||||
width: 90px;
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
|
@ -1689,25 +1698,25 @@ color: #fff;
|
|||
background-color: #2588D0;
|
||||
transition: 0.15s ease-out;;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button:hover {
|
||||
.toot_button:hover {
|
||||
background-color: #2571D0;
|
||||
transition: 0.15s ease-out;;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button:active {
|
||||
.toot_button:active {
|
||||
background-color: #255ED0;
|
||||
transition: 0.15s ease-out;;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button .toot_button_label {
|
||||
.toot_button .toot_button_label {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button i {
|
||||
.toot_button i {
|
||||
display: inline-block;
|
||||
font-size: 21px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
#header .header_nav_wrap .header_right_box .toot_button span {
|
||||
.toot_button span {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
@ -1978,12 +1987,14 @@ word-wrap: break-word;
|
|||
#main .article_wrap .left_column .profile_section_wrap > .profile_bio a {
|
||||
color: #2588D0;
|
||||
}
|
||||
#js_profile_recent_images a {
|
||||
color: #2588D0;
|
||||
.profile_with_icon > a,.profile_with_icon > span {
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
}
|
||||
#js_profile_recent_images a i {
|
||||
.profile_with_icon > a {
|
||||
color: #2588D0;
|
||||
}
|
||||
.profile_with_icon i {
|
||||
color: #657786;
|
||||
margin-right: 8px;
|
||||
font-size: 16px;
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
current_file = location.pathname;
|
||||
$("#lists_nav").addClass('view');
|
||||
$('title').text('Halcyon / Lists');
|
||||
api.get("lists",function(data) {
|
||||
for(var i=0;i<data.length;i++) {
|
||||
$("#lists_bar").append($("<li>").attr("list-id",data[i].id).addClass("header_nav_item").append($("<a>").attr("href","/lists/"+data[i].id).append($("<h2>").addClass("emoji_poss").text(data[i].title))));
|
||||
}
|
||||
replace_emoji();
|
||||
if(window.location.pathname == "/lists") {
|
||||
listsOverview(data);
|
||||
}
|
||||
else if(window.location.pathname.indexOf("/add") != -1) {
|
||||
loadFollows($global_listid);
|
||||
}
|
||||
else {
|
||||
loadList($global_listid);
|
||||
}
|
||||
});
|
||||
function listsOverview(lists) {
|
||||
$("#js-follows_footer[list-id='load']").remove();
|
||||
for(var i=0;i<lists.length;i++) {
|
||||
$(".center_column").append(
|
||||
$("<header>").attr("list-id",lists[i].id).addClass("timeline_header").css("margin-bottom","10px").append(
|
||||
$("<div>").addClass("header_items").append(
|
||||
$("<a>").attr("href","/lists/"+lists[i].id).addClass("list-title").addClass("item").addClass("emoji_poss").text(lists[i].title)).append(
|
||||
$("<a>").attr("href","/lists/"+lists[i].id+"/add").addClass("list-adduser").addClass("item").css("float","right").append(
|
||||
$("<i>").addClass("fa").addClass("fa-user-plus")
|
||||
)).append(
|
||||
$("<a>").attr("href","javascript:null").addClass("list-edit").addClass("item").css("float","right").append(
|
||||
$("<i>").addClass("fa").addClass("fa-pencil")
|
||||
).click(function() {
|
||||
const list_id = $(this).parent().parent().attr("list-id");
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_prompt').removeClass('invisible');
|
||||
$('.overlay_prompt_text').text(__("Please enter the new name for this list."));
|
||||
$('.overlay_prompt_input').val('');
|
||||
$('.overlay_prompt_yes').click(function() {
|
||||
if($(".overlay_prompt_input").val().length == 0) {
|
||||
$('.overlay_prompt_text').text(__("The name of your list can't be empty!"));
|
||||
}
|
||||
else {
|
||||
api.put("lists/"+list_id,"title="+encodeURIComponent($(".overlay_prompt_input").val()),function(data) {
|
||||
$('.close_button').click();
|
||||
$('.header_nav_item[list-id="'+list_id+'"] h2').addClass("emoji_poss").text(data.title);
|
||||
$('.timeline_header[list-id="'+list_id+'"] .list-title').addClass("emoji_poss").text(data.title);
|
||||
putMessage(__("Your list has been renamed"));
|
||||
replace_emoji();
|
||||
});
|
||||
}
|
||||
});
|
||||
})).append(
|
||||
$("<a>").attr("href","javascript:null").addClass("list-delete").addClass("item").css("float","right").append(
|
||||
$("<i>").addClass("fa").addClass("fa-trash")
|
||||
).click(function() {
|
||||
const list_id = $(this).parent().parent().attr("list-id");
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_confirm').removeClass('invisible');
|
||||
$('.overlay_confirm_text').text(__("Are you sure that you want to delete this list?"));
|
||||
$('.overlay_confirm_yes').click(function() {
|
||||
$('.close_button').click();
|
||||
api.delete("lists/"+list_id,function(data) {
|
||||
$('.header_nav_item[list-id="'+list_id+'"]').remove();
|
||||
$('.timeline_header[list-id="'+list_id+'"]').remove();
|
||||
$('#js-follows_profile[list-id="'+list_id+'"]').remove();
|
||||
putMessage(__("Your list has been deleted"));
|
||||
});
|
||||
});
|
||||
})))).append(
|
||||
$("<footer>").attr("id","js-follows_footer").attr("list-id",lists[i].id).append(
|
||||
$("<i>").addClass("fa").addClass("fa-spin").addClass("fa-circle-o-notch").attr("aria-hidden","true")));
|
||||
listAccounts(lists[i].id);
|
||||
}
|
||||
replace_emoji();
|
||||
}
|
||||
function listAccounts(list_id) {
|
||||
api.get("lists/"+list_id+"/accounts",[{name:'limit',data:0}],function(data) {
|
||||
$("#js-follows_footer[list-id='"+list_id+"']").remove();
|
||||
$(".timeline_header[list-id='"+list_id+"']").after($("<div>").attr("id","js-follows_profile").attr("list-id",list_id));
|
||||
for(var i=0;i<data.length;i++) {
|
||||
follows_template(data[i]).appendTo("#js-follows_profile[list-id='"+list_id+"']");
|
||||
$('#js-follows_profile .follow_button[mid="'+data[i].id+'"]').removeClass("follow_button").addClass("remove_button").children("span").text(__("Remove"));
|
||||
$('#js-follows_profile .remove_button[mid="'+data[i].id+'"]').children("i").removeClass("fa-user-plus").addClass("fa-user-times");
|
||||
$('#js-follows_profile .remove_button[mid="'+data[i].id+'"]').click(function() {
|
||||
var mid = $(this).attr("mid");
|
||||
api.delete("lists/"+list_id+"/accounts?account_ids[]="+mid,function() {
|
||||
$(".follows_profile_box[mid='"+mid+"']").fadeOut();
|
||||
});
|
||||
});
|
||||
}
|
||||
replace_emoji();
|
||||
});
|
||||
}
|
||||
function loadList(list_id) {
|
||||
$("#lists_bar .header_nav_item[list-id='"+list_id+"']").addClass("view");
|
||||
api.get("lists/"+list_id,function(data) {
|
||||
$("#header_listname").text(data.title);
|
||||
});
|
||||
setTimeline("timelines/list/"+list_id);
|
||||
}
|
||||
function loadFollows(list_id) {
|
||||
$("#lists_bar .header_nav_item[list-id='"+list_id+"']").addClass("view");
|
||||
api.get("lists/"+list_id+"/accounts",[{name:'limit',data:0}],function(data) {
|
||||
var listAccounts = new Array();
|
||||
for(var i=0;i<data.length;i++) {
|
||||
listAccounts.push(data[i].id);
|
||||
}
|
||||
var mid = current_id;
|
||||
var param = "following";
|
||||
var load_options = [{name:'limit',data:18}];
|
||||
let isSyncing = true,
|
||||
followsList = [];
|
||||
api.get('accounts/'+mid+'/'+param, load_options, function(follows) {
|
||||
for (let i in follows) {
|
||||
if(listAccounts.indexOf(follows[i].id) == -1) {
|
||||
follows_template(follows[i]).appendTo("#js-follows_profile");
|
||||
$('#js-follows_profile .follow_button[mid="'+follows[i].id+'"]').removeClass("follow_button").addClass("add_button").children("span").text(__("Add"));
|
||||
$('#js-follows_profile .add_button[mid="'+follows[i].id+'"]').click(function() {
|
||||
var mid = $(this).attr("mid");
|
||||
api.post("lists/"+list_id+"/accounts?account_ids[]="+mid,function() {
|
||||
$(".follows_profile_box[mid='"+mid+"']").fadeOut();
|
||||
});
|
||||
});
|
||||
followsList.unshift(follows[i].id);
|
||||
}
|
||||
}
|
||||
links = getLinkFromXHRHeader(responce_headers);
|
||||
replace_emoji();
|
||||
$("#js-follows_footer > i").css({"display":"none"});
|
||||
isSyncing = false;
|
||||
});
|
||||
$(window).scroll(function () {
|
||||
if ($(window).scrollTop() + window.innerHeight >= $(document).height()-700) {
|
||||
if( !isSyncing ){
|
||||
isSyncing = true;
|
||||
load_options.unshift( {name:"max_id",data:links['next'].match(/max_id=(.+)&?/)[1]} );
|
||||
api.get('accounts/'+mid+'/'+param, load_options, function(follows) {
|
||||
let followsList = [];
|
||||
if (follows.length) {
|
||||
for(let i in follows) {
|
||||
if(listAccounts.indexOf(follows[i].id) == -1) {
|
||||
follows_template(follows[i]).appendTo("#js-follows_profile");
|
||||
$('#js-follows_profile .follow_button[mid="'+follows[i].id+'"]').removeClass("follow_button").addClass("add_button").children("span").text(__("Add"));
|
||||
$('#js-follows_profile .add_button[mid="'+follows[i].id+'"]').click(function() {
|
||||
var mid = $(this).attr("mid");
|
||||
api.post("lists/"+list_id+"/accounts?account_ids[]="+mid,function() {
|
||||
$(".follows_profile_box[mid='"+mid+"']").fadeOut();
|
||||
});
|
||||
});
|
||||
followsList.unshift(follows[i].id);
|
||||
}
|
||||
}
|
||||
links = getLinkFromXHRHeader(responce_headers);
|
||||
replace_emoji();
|
||||
isSyncing = false;
|
||||
} else {
|
||||
isSyncing = true;
|
||||
}
|
||||
});
|
||||
load_options.shift();
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
$("#add_list").click(function() {;
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_prompt').removeClass('invisible');
|
||||
$('.overlay_prompt_text').text(__("Please enter the name of your new list."));
|
||||
$('.overlay_prompt_input').val('');
|
||||
$('.overlay_prompt_yes').click(function() {
|
||||
if($(".overlay_prompt_input").val().length == 0) {
|
||||
$('.overlay_prompt_text').text(__("The name of your list can't be empty!"));
|
||||
}
|
||||
else {
|
||||
api.post("lists/","title="+encodeURIComponent($(".overlay_prompt_input").val()),function(data) {
|
||||
$('.close_button').click();
|
||||
putMessage(__("Your list has been created"));
|
||||
window.location.href="/lists/"+data.id+"/add";
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
|
@ -130,6 +130,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.id}">${__('Pin Too
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.account.id}" sid="${status.id}">${__('Mute')} @${status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.account.id}" sid="${status.id}">${__('Block')} @${status.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Add to list')} @${status.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
@ -265,6 +266,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.reblog.id}">${__('
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Mute')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Block')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Add to list')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html = (`
|
||||
|
@ -399,6 +401,7 @@ var own_toot_buttons = (`<li><a class="delete_button" tid="${status.id}">${__('D
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.account.id}" sid="${status.id}">${__('Mute')} @${status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.account.id}" sid="${status.id}">${__('Block')} @${status.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Add to list')} @${status.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html = (`
|
||||
|
@ -651,6 +654,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${NotificationObj.status.id
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${NotificationObj.status.account.id}" sid="${NotificationObj.status.id}">${__('Mute')} @${NotificationObj.status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${NotificationObj.status.account.id}" sid="${NotificationObj.status.id}">${__('Block')} @${NotificationObj.status.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${NotificationObj.status.account.id}" sid="${NotificationObj.status.id}" display_name="${NotificationObj.status.account.display_name}">${__('Add to list')} @${NotificationObj.status.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${NotificationObj.status.account.id}" sid="${NotificationObj.status.id}" display_name="${NotificationObj.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
@ -756,7 +760,7 @@ var html = (`
|
|||
<div class="follows_profile_icon">
|
||||
<img class="js_follows_profile_image" src="${AccountObj.avatar}"/>
|
||||
</div>
|
||||
<button class="follow_button action_button" mid="${AccountObj.id}">
|
||||
<button class="halcyon_button follow_button action_button" mid="${AccountObj.id}">
|
||||
<i class="fa fa-fw fa-user-plus"></i>
|
||||
<span>${__('Follow')}</span>
|
||||
</button>
|
||||
|
@ -856,6 +860,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.id}">${__('Pin Too
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.account.id}" sid="${status.id}">${__('Mute')} @${status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.account.id}" sid="${status.id}">${__('Block')} @${status.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Add to list')} @${status.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
@ -1064,6 +1069,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.reblog.id}">${__('
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Mute')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Block')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Add to list')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
@ -1309,6 +1315,7 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.id}">${__('Pin Too
|
|||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.account.id}" sid="${status.id}">${__('Mute')} @${status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.account.id}" sid="${status.id}">${__('Block')} @${status.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Add to list')} @${status.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.account.id}" sid="${status.id}" display_name="${status.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
@ -1438,8 +1445,9 @@ own_toot_buttons += (`<li><a class="pin_button" tid="${status.reblog.id}">${__('
|
|||
}
|
||||
}
|
||||
else {
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Mute')} @${status.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Block')} @${status.account.username}</a></li>
|
||||
var own_toot_buttons = (`<li><a class="mute_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Mute')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="block_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}">${__('Block')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="addlist_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Add to list')} @${status.reblog.account.username}</a></li>
|
||||
<li><a class="report_button" mid="${status.reblog.account.id}" sid="${status.reblog.id}" display_name="${status.reblog.account.display_name}">${__('Report this Toot')}</a></li>`);
|
||||
}
|
||||
const html=(`
|
||||
|
|
|
@ -46,13 +46,21 @@ $(this).html('<i class="fa fa-fw fa-user-plus"></i><span>'+__('Follow')+'</span>
|
|||
return false;
|
||||
});
|
||||
$(document).on('click','.mute_button', function(e) {
|
||||
if ($(this).attr('mid') !== null) {
|
||||
api.post('accounts/'+$(this).attr('mid')+'/mute', function (data) {
|
||||
});
|
||||
}
|
||||
e.stopPropagation();
|
||||
const mid = $(this).attr('mid');
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_confirm').removeClass('invisible');
|
||||
$('.overlay_confirm_text').text(__("Are you sure that you want to mute this user?"));
|
||||
$('.overlay_confirm_yes').click(function() {
|
||||
$('.close_button').click();
|
||||
api.post('accounts/'+mid+'/mute', function (data) {
|
||||
putMessage(__("You'll no longer receive notifications from this user"));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
$(document).on('click','.muting_button', function(e) {
|
||||
if($(this).attr('mid')!=null) {
|
||||
api.post('accounts/'+$(this).attr('mid')+'/unmute', function (data) {
|
||||
|
@ -65,13 +73,21 @@ putMessage(__("Unmuted this user"));
|
|||
return false;
|
||||
});
|
||||
$(document).on('click','.block_button', function(e) {
|
||||
if ($(this).attr('mid') !== null) {
|
||||
api.post('accounts/'+$(this).attr('mid')+'/block', function (data) {
|
||||
});
|
||||
}
|
||||
e.stopPropagation();
|
||||
const mid = $(this).attr('mid');
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_confirm').removeClass('invisible');
|
||||
$('.overlay_confirm_text').text(__("Are you sure that you want to block this user?"));
|
||||
$('.overlay_confirm_yes').click(function() {
|
||||
$('.close_button').click();
|
||||
api.post('accounts/'+mid+'/block', function (data) {
|
||||
putMessage(__("This user has been blocked"));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
$(document).on('click','.blocking_button', function(e) {
|
||||
e.stopPropagation();
|
||||
if ($(this).attr('mid') !== null) {
|
||||
|
@ -122,11 +138,20 @@ return false;
|
|||
});
|
||||
$(document).on('click','.delete_button', function(e) {
|
||||
const sid = $(this).attr('tid');
|
||||
e.stopPropagation();
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_confirm').removeClass('invisible');
|
||||
$('.overlay_confirm_text').text(__("Are you sure that you want to delete this toot?"));
|
||||
$('.overlay_confirm_yes').click(function() {
|
||||
$('.close_button').click();
|
||||
api.delete("statuses/"+sid, function (data) {
|
||||
$('.toot_entry[sid="'+sid+'"]').remove();
|
||||
putMessage(__("Your Toot has been deleted"));
|
||||
});
|
||||
});
|
||||
});
|
||||
$(document).on('click','.pin_button', function(e) {
|
||||
const sid = $(this).attr('tid');
|
||||
api.post("statuses/"+sid+"/pin", function (data) {
|
||||
|
@ -141,6 +166,75 @@ $('.toot_entry[sid="'+sid+'"] .unpin_button').removeClass("unpin_button").addCla
|
|||
putMessage(__("Your Toot has been unpinned"));
|
||||
});
|
||||
});
|
||||
$(document).on('click','.addlist_button',function(e) {
|
||||
const mid = $(this).attr('mid');
|
||||
e.stopPropagation();
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_addlist').removeClass('invisible');
|
||||
$('.overlay_addlist .overlay_simple_header span').html(__('Add to list')+": "+$(this).attr('display_name'));
|
||||
replace_emoji();
|
||||
api.get("lists",function(data) {
|
||||
api.get("accounts/"+mid+"/lists",function(data2) {
|
||||
var inlists = new Array();
|
||||
if(typeof data2 == "object") {
|
||||
for(var i=0;i<data2.length;i++) {
|
||||
inlists.push(data2[i].id);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<data.length;i++) {
|
||||
var list_id = data[i].id;
|
||||
(function(i,list_id) {
|
||||
if(inlists.indexOf(data[i].id) == -1) {
|
||||
$(".overlay_addlist_body").append(
|
||||
$("<div>").addClass("overlay_addlist_item").append(
|
||||
$("<span>").addClass("emoji_poss").text(data[i].title)).append(
|
||||
$("<button>").addClass("halcyon_button").append(
|
||||
$("<i>").addClass("fa").addClass("fa-fw").addClass("fa-user-plus")).append(
|
||||
$("<span>").text(__('Add'))).click(function(e) {
|
||||
api.post("lists/"+list_id+"/accounts?account_ids[]="+mid,"",function() {
|
||||
putMessage(__('Added this account to the list'));
|
||||
},function(xhr) {
|
||||
if(xhr.status == 422) {
|
||||
$("#js-overlay_content_wrap .temporary_object").empty();
|
||||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_confirm').removeClass('invisible');
|
||||
$('.overlay_confirm_text').text(__("You need to follow this user to add him/her to the list. Do you want to do that now?"));
|
||||
$('.overlay_confirm_yes').click(function() {
|
||||
$('.close_button').click();
|
||||
api.post('accounts/'+mid+'/follow',function(data) {
|
||||
putMessage(__("You successfully followed this user."));
|
||||
api.post("lists/"+list_id+"/accounts?account_ids[]="+mid,"",function() {
|
||||
putMessage(__('Added this account to the list'));
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
$(".close_button").click();
|
||||
})));
|
||||
}
|
||||
else {
|
||||
$(".overlay_addlist_body").append(
|
||||
$("<div>").addClass("overlay_addlist_item").append(
|
||||
$("<span>").addClass("emoji_poss").text(data[i].title)).append(
|
||||
$("<button>").addClass("halcyon_button").append(
|
||||
$("<i>").addClass("fa").addClass("fa-fw").addClass("fa-user-times")).append(
|
||||
$("<span>").text(__('Remove'))).click(function(e) {
|
||||
api.delete("lists/"+list_id+"/accounts?account_ids[]="+mid,function() {
|
||||
putMessage(__('Removed this account from the list'));
|
||||
});
|
||||
$(".close_button").click();
|
||||
})));
|
||||
}
|
||||
})(i,list_id);
|
||||
}
|
||||
replace_emoji();
|
||||
});
|
||||
});
|
||||
});
|
||||
$(document).on('click','.cw_button', function(e) {
|
||||
e.stopPropagation();
|
||||
const article = $(this).parent();
|
||||
|
@ -189,7 +283,7 @@ var load_options = [];
|
|||
api.get(level, load_options, function(statuses) {
|
||||
let reply_sources = {};
|
||||
for(let i in statuses) {
|
||||
if(!(show_replies == "false" && statuses[i].in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && statuses[i].in_reply_to_id) && !(statuses[i].visibility == "direct" && level == "timelines/home")) {
|
||||
timeline_template(statuses[i]).appendTo("#js-timeline");
|
||||
if(statuses[i].in_reply_to_id && level === "timelines/home" | level === "timelines/public") {
|
||||
if(!reply_sources[statuses[i].in_reply_to_id] & !$(".toot_entry[sid='"+statuses[i].in_reply_to_id+"']").length) {
|
||||
|
@ -219,7 +313,7 @@ api.get(level, load_options, function(statuses) {
|
|||
if (statuses.length) {
|
||||
let reply_sources = {};
|
||||
for(let i in statuses) {
|
||||
if(!(show_replies == "false" && statuses[i].in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && statuses[i].in_reply_to_id) && !(statuses[i].visibility == "direct" && level == "timelines/home")) {
|
||||
timeline_template(statuses[i]).appendTo("#js-timeline");
|
||||
if(statuses[i].in_reply_to_id && level === "timelines/home" | level === "timelines/public") {
|
||||
if(!reply_sources[statuses[i].in_reply_to_id] & !$(".toot_entry[sid='"+statuses[i].in_reply_to_id+"']").length) {
|
||||
|
@ -259,9 +353,17 @@ else if(level === "timelines/public" & !load_options.length) {
|
|||
var streamscope = "public",
|
||||
scope = "federated";
|
||||
}
|
||||
else if(level === "timelines/direct") {
|
||||
var streamscope = "direct",
|
||||
scope = "direct";
|
||||
}
|
||||
else if(level.indexOf("timelines/tag/") != -1) {
|
||||
var streamscope = "hashtag&tag="+level.substr(14),
|
||||
scope = "";
|
||||
scope = "hashtag";
|
||||
}
|
||||
else if(level.indexOf("timelines/list/") != -1) {
|
||||
var streamscope = "list&list="+level.substr(15),
|
||||
scope = "lists";
|
||||
}
|
||||
let statuses = [];
|
||||
const original_title = $('title').text();
|
||||
|
@ -271,7 +373,7 @@ const streaming_option = localStorage.getItem("setting_post_stream");
|
|||
if(userstream.event === "update") {
|
||||
if(streaming_option === "manual") {
|
||||
if(!$('.toot_entry[sid="'+userstream.payload.id+'"]').length) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id) && !(userstream.payload.visibility == "direct" && scope == "home")) {
|
||||
$('#js-stream_update').css({'display':'block','height':'auto','padding':'10px'});
|
||||
statuses.unshift(userstream.payload);
|
||||
$('#js-stream_update > button > span').text(statuses.length);
|
||||
|
@ -282,7 +384,7 @@ $('#header .header_nav_list .'+scope+'_badge').removeClass('invisible');
|
|||
}
|
||||
else if (streaming_option === "auto") {
|
||||
if(!$('.toot_entry[sid="'+userstream.payload.id+'"]').length) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id) && !(userstream.payload.visibility == "direct" && scope == "home")) {
|
||||
timeline_template(userstream.payload).prependTo("#js-timeline");
|
||||
replaceInternalLink();
|
||||
replace_emoji();
|
||||
|
@ -303,7 +405,7 @@ else if(streaming_option == "ontop") {
|
|||
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
if(scrollTop == 0) {
|
||||
if(!$('.toot_entry[sid="'+userstream.payload.id+'"]').length) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id) && !(userstream.payload.visibility == "direct" && scope == "home")) {
|
||||
timeline_template(userstream.payload).prependTo("#js-timeline");
|
||||
replaceInternalLink();
|
||||
replace_emoji();
|
||||
|
@ -322,7 +424,7 @@ replace_emoji();
|
|||
}
|
||||
else {
|
||||
if(!$('.toot_entry[sid="'+userstream.payload.id+'"]').length) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id)) {
|
||||
if(!(show_replies == "false" && userstream.payload.in_reply_to_id) && !(userstream.payload.visibility == "direct" && scope == "home")) {
|
||||
statuses.unshift(userstream.payload);
|
||||
$('title').text("("+statuses.length+") "+original_title);
|
||||
}
|
||||
|
@ -547,7 +649,8 @@ if ( RelationshipsObj[i].following ) {
|
|||
const button = $('#js-follows_profile .follow_button[mid="'+RelationshipsObj[i].id+'"]');
|
||||
button.removeClass("follow_button");
|
||||
button.addClass("following_button");
|
||||
button.text(__('Following'));
|
||||
button.children("span").text(__('Following'));
|
||||
button.children("i").removeClass("fa-user-plus").addClass("fa-user-times");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -574,7 +677,8 @@ if ( RelationshipsObj[i].following ) {
|
|||
const button = $('#js-follows_profile .follow_button[mid="'+RelationshipsObj[i].id+'"]');
|
||||
button.removeClass("follow_button");
|
||||
button.addClass("following_button");
|
||||
button.text(__('Following'));
|
||||
button.children("span").text(__('Following'));
|
||||
button.children("i").removeClass("fa-user-plus").addClass("fa-user-times");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -607,6 +711,9 @@ AccountObj.display_name = htmlEscape(AccountObj.display_name);
|
|||
for(i=0;i<AccountObj.emojis.length;i++) {
|
||||
AccountObj.display_name = AccountObj.display_name.replace(new RegExp(":"+AccountObj.emojis[i].shortcode+":","g"),"<img src='"+AccountObj.emojis[i].url+"' class='emoji'>");
|
||||
}
|
||||
const calendar = [__("Jan"),__("Feb"),__("Mar"),__("Apr"),__("May"),__("Jun"),__("Jul"),__("Aug"),__("Sep"),__("Oct"),__("Nov"),__("Dec")];
|
||||
var creation_date = new Date(AccountObj.created_at);
|
||||
creation_date = calendar[creation_date.getUTCMonth()]+" "+creation_date.getUTCFullYear();
|
||||
$("#js_header_image").attr('src', AccountObj.header);
|
||||
$("#js_profile_image").attr('src', AccountObj.avatar);
|
||||
$("#js_toots_count").text(AccountObj.statuses_count);
|
||||
|
@ -616,8 +723,13 @@ $("#js_profile_displayname").addClass("emoji_poss").html(AccountObj.display_name
|
|||
$("#js_profile_username").text(AccountObj.acct);
|
||||
$("#js_profile_bio").addClass("emoji_poss").html(AccountObj.note);
|
||||
$("#js_profile_bio .emojione").removeClass("emojione").addClass("emoji");
|
||||
$('#js_profile_public_link a').attr('href',AccountObj.url);
|
||||
$('#js_profile_joined_date span span').text(__("Joined at ")+creation_date);
|
||||
console.log(AccountObj.id);
|
||||
console.log(current_id);
|
||||
if(AccountObj.acct.indexOf("@") != -1) {
|
||||
$('#js_profile_public_link').removeClass("invisible");
|
||||
}
|
||||
if( AccountObj.id == current_id ) {
|
||||
$(`<a href="/settings/profile">
|
||||
<button class="profile_edit_button relationship_button">
|
||||
|
@ -1533,7 +1645,7 @@ $("#js-overlay_content_wrap .temporary_object").empty();
|
|||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_copy_link').removeClass('invisible');
|
||||
$('.overlay_copy_link_form input').val($(this).attr('url'));
|
||||
$('.overlay_copy_link input').val($(this).attr('url'));
|
||||
return false;
|
||||
});
|
||||
cbelem.click();
|
||||
|
@ -1544,7 +1656,7 @@ $("#js-overlay_content_wrap .temporary_object").empty();
|
|||
$('#js-overlay_content_wrap').addClass('view');
|
||||
$('#js-overlay_content_wrap').addClass('black_08');
|
||||
$('.overlay_copy_link').removeClass('invisible');
|
||||
$('.overlay_copy_link_form input').val($(this).attr('url'));
|
||||
$('.overlay_copy_link input').val($(this).attr('url'));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -1559,7 +1671,11 @@ $("#js-overlay_content_wrap .temporary_object").empty();
|
|||
$("#js-overlay_content_wrap .single_reply_status .status_preview").empty();
|
||||
$('#js-overlay_content_wrap .overlay_status').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .single_reply_status').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .report_status').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .overlay_copy_link').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .overlay_confirm').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .overlay_prompt').addClass('invisible');
|
||||
$('#js-overlay_content_wrap .overlay_addlist').addClass('invisible');
|
||||
$('#js-overlay_content .temporary_object, #js-overlay_content .parmanent_object').removeClass('visible');
|
||||
$('#js-overlay_content_wrap .overlay_status.submit_status_label').removeClass('active_submit_button');
|
||||
$('#js-overlay_content_wrap .single_reply_status .submit_status_label').removeClass('active_submit_button');
|
||||
|
@ -1567,6 +1683,10 @@ $('#js-overlay_content_wrap #reply_status_form .submit_status_label').removeClas
|
|||
$('#js-overlay_content_wrap #header_status_form.submit_status_label').removeClass('active_submit_button');
|
||||
$('#js-overlay_content_wrap').removeClass('black_05');
|
||||
$('#js-overlay_content_wrap').removeClass('black_08');
|
||||
$('#js-overlay_content_wrap .overlay_confirm_yes').off('click');
|
||||
$('#js-overlay_content_wrap .overlay_prompt_ok').off('click');
|
||||
$('#js-overlay_content_wrap .overlay_prompt_text').val("");
|
||||
$('#js-overlay_content_wrap .overlay_addlist_body').empty();
|
||||
if ( current_file === "/user" ) {
|
||||
history.pushState(null, null, "/"+location.pathname.split("/")[1]+location.search);
|
||||
} else {
|
||||
|
|
|
@ -160,6 +160,11 @@ var idempotencykey = getRandom();
|
|||
}
|
||||
requestHeaders["Idempotency-Key"] = idempotencykey;
|
||||
}
|
||||
else {
|
||||
if(arguments.length == 4) {
|
||||
var errorback = arguments[3];
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url: apiBase + endpoint,
|
||||
type: "POST",
|
||||
|
@ -183,10 +188,17 @@ if(xhr.readyState == 0) {
|
|||
api.post(endpoint,postData,callback,idempotencykey);
|
||||
}
|
||||
else {
|
||||
putMessage(`[${xhr.status}] ${xhr.responseJSON['error']}`);
|
||||
if(xhr.status === 401) {
|
||||
location.href = "/logout";
|
||||
}
|
||||
else {
|
||||
if(errorback) {
|
||||
errorback(xhr,textStatus,errorThrown);
|
||||
}
|
||||
else {
|
||||
putMessage(`[${xhr.status}] ${xhr.responseJSON['error']}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -283,6 +295,38 @@ location.href = "/logout";
|
|||
}
|
||||
});
|
||||
},
|
||||
put: function (endpoint) {
|
||||
var postData, callback;
|
||||
if (typeof arguments[1] === "function") {
|
||||
postData = {};
|
||||
callback = arguments[1];
|
||||
} else {
|
||||
postData = arguments[1];
|
||||
callback = arguments[2];
|
||||
}
|
||||
var requestHeaders = {"Authorization":"Bearer "+config.api_user_token};
|
||||
$.ajax({
|
||||
url: apiBase + endpoint,
|
||||
type: "PUT",
|
||||
data: postData,
|
||||
headers: requestHeaders,
|
||||
success: function(data, textStatus) {
|
||||
console.log("Successful PUT API request to " +apiBase+endpoint);
|
||||
callback(data,textStatus)
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
if(xhr.readyState == 0) {
|
||||
api.put(endpoint,postData,callback);
|
||||
}
|
||||
else {
|
||||
putMessage(`[${xhr.status}] ${xhr.responseJSON['error']}`);
|
||||
if ( xhr.status === 401 ) {
|
||||
location.href = "/logout";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
stream: function (streamType, onData) {
|
||||
var es = new WebSocket("wss://" + apiBase.substr(8) + "streaming?access_token=" + config.api_user_token + "&stream=" + streamType);
|
||||
var listener = function (event) {
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php include ('header.php'); ?>
|
||||
<main id="main" class="home">
|
||||
<div class="article_wrap">
|
||||
<aside class="left_column">
|
||||
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
|
||||
</aside>
|
||||
<article class="center_column">
|
||||
<header class="timeline_header">
|
||||
<ul class="header_items">
|
||||
<li class="item toots view">
|
||||
<a href="#">
|
||||
<?=_('Direct messages')?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<div id="js-stream_update">
|
||||
<button>
|
||||
View <span></span> new Toots
|
||||
</button>
|
||||
</div>
|
||||
<ul id="js-timeline" class="timeline">
|
||||
</ul>
|
||||
<footer id="js-timeline_footer" class="timeline_footer">
|
||||
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
|
||||
</footer>
|
||||
</article>
|
||||
<aside class="right_column">
|
||||
<section class="side_widgets_wrap">
|
||||
<?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
|
||||
</section>
|
||||
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
|
||||
</aside>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
current_file = location.pathname;
|
||||
setTimeline("timelines/direct",[],"true");
|
||||
$('title').text('Halcyon / Direct');
|
||||
</script>
|
||||
<?php include ('footer.php'); ?>
|
|
@ -10,6 +10,9 @@
|
|||
<?php include dirname(__FILE__).('/widgets/overlay_single_reply.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/overlay_report_status.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/overlay_copy_link.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/overlay_confirm.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/overlay_prompt.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/overlay_addlist.php'); ?>
|
||||
</div>
|
||||
<button class="close_button"><i class="fa fa-times" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
|
|
10
header.php
10
header.php
|
@ -96,6 +96,13 @@ resetApp();
|
|||
</a>
|
||||
<div class="notification_badge nav_badge invisible"></div>
|
||||
</li>
|
||||
<li id="header_nav_item_lists" class="header_nav_item lists_nav">
|
||||
<a href="/lists" id="lists_nav">
|
||||
<i class="fa fa-fw fa-list"></i>
|
||||
<span><?=_('Lists')?></span>
|
||||
</a>
|
||||
<div class="lists_badge nav_badge invisible"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="header_right_box">
|
||||
|
@ -127,6 +134,9 @@ resetApp();
|
|||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/direct"><?=_('Direct')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/settings"><?=_('Settings')?></a>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?php include ('header.php'); ?>
|
||||
<style>
|
||||
.timeline_header .header_items {
|
||||
display:block;
|
||||
}
|
||||
</style>
|
||||
<main id="main">
|
||||
<?php include dirname(__FILE__).('/widgets/lists_header.php'); ?>
|
||||
<div class="article_wrap">
|
||||
<aside class="left_column">
|
||||
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
|
||||
</aside>
|
||||
<article class="center_column">
|
||||
<footer id="js-follows_footer" list-id="load">
|
||||
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
</main>
|
||||
<script src="/assets/js/halcyon/halcyonLists.js"></script>
|
||||
<?php include ('footer.php'); ?>
|
|
@ -0,0 +1,22 @@
|
|||
<?php include ('header.php'); ?>
|
||||
<main id="main" class="home">
|
||||
<?php include dirname(__FILE__).('/widgets/lists_header.php'); ?>
|
||||
<div class="article_wrap">
|
||||
<aside class="left_column">
|
||||
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
|
||||
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
|
||||
</aside>
|
||||
<article class="center_column">
|
||||
<div id="js-follows_profile">
|
||||
</div>
|
||||
<footer id="js-follows_footer">
|
||||
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
$global_listid = "<?php echo $_GET['id'] ?>";
|
||||
</script>
|
||||
<script src="/assets/js/halcyon/halcyonLists.js"></script>
|
||||
<?php include ('footer.php'); ?>
|
|
@ -0,0 +1,32 @@
|
|||
<?php include ('header.php'); ?>
|
||||
<main id="main" class="home">
|
||||
<?php include dirname(__FILE__).('/widgets/lists_header.php'); ?>
|
||||
<div class="article_wrap">
|
||||
<aside class="left_column">
|
||||
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
|
||||
</aside>
|
||||
<article class="center_column">
|
||||
<div id="js-stream_update">
|
||||
<button>
|
||||
View <span></span> new Toots
|
||||
</button>
|
||||
</div>
|
||||
<ul id="js-timeline" class="timeline">
|
||||
</ul>
|
||||
<footer id="js-timeline_footer" class="timeline_footer">
|
||||
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
|
||||
</footer>
|
||||
</article>
|
||||
<aside class="right_column">
|
||||
<section class="side_widgets_wrap">
|
||||
<?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
|
||||
</section>
|
||||
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
|
||||
</aside>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
$global_listid = "<?php echo $_GET['id'] ?>";
|
||||
</script>
|
||||
<script src="/assets/js/halcyon/halcyonLists.js"></script>
|
||||
<?php include ('footer.php'); ?>
|
|
@ -51,6 +51,14 @@ rewrite ^/notifications/?$ /notifications.php break;
|
|||
# Who to follow
|
||||
rewrite ^/whotofollow/?$ /who_to_follow.php break;
|
||||
|
||||
# Direct
|
||||
rewrite ^/direct/?$ direct.php break;
|
||||
|
||||
# Lists
|
||||
rewrite ^/lists/?$ lists.php break;
|
||||
rewrite ^/lists/(\d+)/?$ lists_view.php?id=$1 break;
|
||||
rewrite ^/lists/(\d+)/add/?$ lists_add.php?id=$1 break;
|
||||
|
||||
# Search
|
||||
rewrite ^/search/?$ /search_hash_tag.php break;
|
||||
rewrite ^/search/users/?$ /search_user.php break;
|
||||
|
|
6
user.php
6
user.php
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a><span class="profile_followed_by invisible"><?=_('FOLLOWS YOU')?></span>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
</aside>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
</aside>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
<?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
<?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
</aside>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
@<a id="js_profile_username" href="#"></a>
|
||||
</h2>
|
||||
<p id="js_profile_bio" class="profile_bio"></p>
|
||||
<div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
|
||||
<a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span>Open public profile</span></a>
|
||||
</div>
|
||||
<div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
|
||||
<span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
|
||||
</div>
|
||||
<?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
|
||||
</section>
|
||||
</aside>
|
||||
|
|
|
@ -1 +1 @@
|
|||
2.0.2
|
||||
2.1.0
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<div id="js-header_title_box">
|
||||
<h1<? if(isset($_GET['id'])) {echo " id='header_listname'>";} else {echo ">"._('My Lists');} ?></h1>
|
||||
</div>
|
||||
<div class="header_nav_wrap">
|
||||
<div class="header_nav">
|
||||
<div class="header_nav_left">
|
||||
<ul class="header_nav_list" id="lists_bar">
|
||||
<li class="header_nav_item">
|
||||
<a href="javascript:null" id="add_list"><h2><i class="fa fa-2x fa-plus-circle"></i></h2></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,6 @@
|
|||
<div class="overlay_simple overlay_addlist invisible">
|
||||
<header class="overlay_simple_header">
|
||||
<span class="emoji_poss"><?=_('Add to list')?></span>
|
||||
</header>
|
||||
<div class="overlay_simple_body overlay_addlist_body"></div>
|
||||
</div>
|
|
@ -0,0 +1,12 @@
|
|||
<div class="overlay_simple overlay_confirm invisible">
|
||||
<header class="overlay_simple_header">
|
||||
<span class="emoji_poss"><?=_('Confirmation')?></span>
|
||||
</header>
|
||||
<div class="overlay_simple_body">
|
||||
<div class="overlay_confirm_text" style="margin-bottom:10px"></div>
|
||||
<div class="overlay_confirm_controls">
|
||||
<button class="overlay_confirm_yes toot_button" style="float:right"><div class="toot_button_label"><i class="fa fa-fw fa-check"></i><span><?=_('Yes')?></span></div></button>
|
||||
<a href="javascript:$('.close_button').click()" class="overlay_confirm_cancel halcyon_link" style="float:right;margin-top:5px;margin-right:10px"><i class="fa fa-times"></i> <?=_('Cancel')?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,8 +1,8 @@
|
|||
<div class="overlay_copy_link invisible">
|
||||
<header class="overlay_copy_link_header">
|
||||
<div class="overlay_simple overlay_copy_link invisible">
|
||||
<header class="overlay_simple_header">
|
||||
<span class="emoji_poss"><?=_('Copy link to Toot')?></span>
|
||||
</header>
|
||||
<div class="overlay_copy_link_form">
|
||||
<input type="text" value="" readonly>
|
||||
<div class="overlay_simple_body">
|
||||
<input class="copy_link_input" type="text" value="" readonly>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,15 @@
|
|||
<div class="overlay_simple overlay_prompt invisible">
|
||||
<header class="overlay_simple_header">
|
||||
<span class="emoji_poss"><?=_('Prompt')?></span>
|
||||
</header>
|
||||
<div class="overlay_simple_body">
|
||||
<div class="overlay_prompt_text" style="margin-bottom:10px"></div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input type="text" class="overlay_prompt_input textfield" style="margin:0;width:100%">
|
||||
</div>
|
||||
<div class="overlay_prompt_controls">
|
||||
<button class="overlay_prompt_yes toot_button" style="float:right"><div class="toot_button_label"><i class="fa fa-fw fa-check"></i><span><?=_('Ok')?></span></div></button>
|
||||
<a href="javascript:$('.close_button').click()" class="overlay_prompt_cancel halcyon_link" style="float:right;margin-top:5px;margin-right:10px"><i class="fa fa-times"></i> <?=_('Cancel')?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -23,4 +23,3 @@ echo "<li><a href='".$footerlinks[$i]->link."'>".$footerlinks[$i]->title."</a></
|
|||
</ul>
|
||||
</footer>
|
||||
<img style="display:block;margin:16px auto;width: 30%;opacity: .3;" src="/assets/images/halcyon.png">
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="js_profile_recent_images">
|
||||
<a><i class="fa fa-camera" aria-hidden="true"></i><span></span></a>
|
||||
<div id="js_profile_recent_images" class="profile_with_icon">
|
||||
<a><i class="fa fa-fw fa-camera" aria-hidden="true"></i><span></span></a>
|
||||
<div id="js_profile_recent_images_box">
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue