DashboardFE

This commit is contained in:
Daisuke
2020-03-16 16:47:26 -06:00
commit 7385b91b4d
63 changed files with 30676 additions and 0 deletions

490
layout/footer.php Normal file
View File

@ -0,0 +1,490 @@
</div>
</div>
<?php include "layout/sidebar.php"; ?>
</div>
</div>
<?php
$query = http_build_query(array_filter(array(
//'instance' => ($instance == true ? $instance : false) ,
'user' => (isset($tl['user']) == true ? $tl['user'] : false) ,
'mode' => $tl['mode'],
//'explicit' => ($nocookies == true ? $user_settings['explicit'] : false) ,
)));
?>
<script src="vendor/jquery.min.js"></script>
<script src="vendor/jqueryui.js"></script>
<script src="js/scripts.js"></script>
<script type="text/javascript">
window.setInterval(function() {
$( ".post > .replies_container" ).each(function() {
var len = $(this).find('.reply').length;
if(len > 0){
var id = $(this).attr('id');
var last = $(this).find('.reply').last().attr('id');
$.get("action.php?a=true&replies=" + id + "&since="+last, function(data) {
if (data !== ''){
$( ".post > #"+id+".replies_container" ).append(data);
}
});
}
});
}, 15000);
window.setInterval(function() {
var thread = getUrlParameter('thread');
if (typeof thread == 'undefined') {
return false;
}
$.get("action.php?a=true&notes=" + thread, function(data) {
$( ".post_notes" ).html(data);
});
}, 15000);
<?php if ($logedin): ?>
$('body').on('click', '.replyform', function(e) {
e.preventDefault;
var id = $(this).parents().eq(1).attr('id');
var type = $(this).parents().eq(3).attr('class').trim().replace(" ",".");
console.log(type);
$('#replyform').remove();
var data = JSON.parse(document.getElementById('data-' + id).innerHTML);
$.get("templates/replyform.txt", function(result) {
result = result.replace(":content:", data.mentions)
result = result.replace(":id:", data.id)
$('.'+type).find('#' + id+'.replies_container').prepend(result);
$('#replyform #' + data.scope).prop('selected', true);
$('#' + id).fadeIn(400);
});
});
$('body').on('click', '.compose', function(e) {
$('#postform').toggle();
});
$("body").on("keydown", "form", function (e) {
if (e.ctrlKey && e.keyCode === 13) {
$(this).find('input[type="submit"]').click();
}
});
$('.topicon').click(function(){
$('.topicon').each(function(a){
$( this ).removeClass('tiselected')
});
$( this ).addClass('tiselected');
});
$('body').on('click', '#send', function() {
var form = $(this).closest('.form');
$(form).find(".status").html('<span id="loading" class="animate-spin fontello">&#xe838;</span>');
var status = $(form).find('textarea').val()
var sensitive = $(form).find('input[name=sensitive]').prop('checked');
var spoiler = $(form).find('input[name=spoiler]').val();
var scope = $(form).find('select[name=scope]').val();
var thread = $(form).find('input[name=thread]').val();
var IDs = [];
$(form).find(".uploadedImage").each(function(){ IDs.push(this.id); });
var uploaded = IDs.join("|");
$.post("action.php", {
status: status,
scope: scope,
thread: thread,
uploaded: uploaded,
spoiler: spoiler,
sensitive: sensitive
},
function(data) {
if($(form).closest('.element').attr('id') == 'postform'){
$(form).find('textarea').val('');
$(form).find('.uploadBox').remove();
$(form).find('input[name=sensitive]').prop('checked', false);
$(form).find(".status").html('');
$(form).find('input[name=spoiler]').val('');
newPosts();
} else {
var parent = $(form).closest('.element').find('.post').first().attr('id');
$('#replyform').remove();
$('#'+parent+'.replies_container').append(data);
}
});
});
$('body').on('click', '.quickreply', function(e) {
$(".notif.form").remove();
$(this).closest('.notif').after('<div class="notif form"><div class="notifContents"><input type="hidden" name="thread" value="'+$(this).attr('id')+'"><input type="hidden" name="mentions" value="'+$(this).attr('data-mentions')+'"><textarea style="width:100%; height100%; border: 1px solid #ddd;"></textarea><input type="submit" id="quicksend" value="Send"></div></div>');
});
$('body').on('click', '#quicksend', function() {
var form = $('#quicksend').closest('.form');
var thread = $(form).find('input[name=thread]').val();
var mentions = $(form).find('input[name=mentions]').val();
var status = mentions + $(form).find('textarea').val();
$(".notif.form").html('<span id="loading" class="animate-spin fontello">&#xe838;</span>');
$.post("action.php", {
status: status,
thread: thread,
},
function(data) {
$(".notif.form").remove();
notificaton('Reply Sent!');
});
});
$('body').on('click', '.badge', function() {
$('#notifications').toggle();
var notif = $('#hiddenside').children().first().attr('id');
localStorage.setItem("notif", notif);
$('#notifications').find('.container').children().removeClass('new');
$('.alert').css('display','none');
var title = document.title;
document.title = title.replace("(*)", "");
});
$('body').on('click', '.notif .ldr', function(e) {
$('#notifications').find('.container').children().removeClass('new');
$('#notifications').css('display','none');
$('.alert').css('display','none');
var title = document.title;
document.title = title.replace("(*)", "");
});
$('body').on('click', '.nloadmore', function() {
var n = $('#notifications').find('.container').children().last().attr('id');
$('#notifications').find('.container').children().last().after('<span id="loading" class="animate-spin fontello" style="color:black;">&#xe838;</span>');
$.get("action.php?a=true&max=true&notif=" + n, function(data) {
$('#loading').remove();
$('#notifications').find('.container').append(data);
});
});
window.setInterval(function() {
var n = localStorage.getItem("notif");
var f = $("#notifications").find('.container').children().first().attr('id');
var nf;
if (n < f) {
nf = n;
//$("#notifications").html('');
} else {
nf = f;
}
$.get("action.php?a=true&notif=" + f, function(data) {
if (data) {
var title = document.getElementsByTagName("title")[0].innerHTML;
if (title.indexOf("(*)") < 0) {
document.getElementsByTagName("title")[0].innerHTML = "(*) " + title;
}
$('#notifications').find('.container').prepend(data);
var cnt = $('#notifications .container div.new').length;
var notif = $('#hiddenside').children().first().attr('id');
localStorage.setItem("notif", notif);
$.when($('#hiddenside').html('')).then(function() {
$('.alert').css('display','block');
$('#hiddenside').append(data);
$('#hiddenside').children().each(function(index) {
$(this).delay(4000 + (1000 * index)).fadeOut("slow");
});
});
}
});
}, 15000);
function notificaton(message){
var notif = "<div class='notif error' style='border-left:3px solid red; background-color:pink;'> <div class='notifContents'> <div style='flex: 0 0 60px; background-size:cover; border-radius:5px;'></div> <div style='flex: 1; padding-left:5px; padding-right:5px; word-break: break-all; overflow:hidden;'> <span>"+message+"</span> </div> </div> </div>";
$('#hiddenside').append(notif);
$('#hiddenside').children().each(function(index) {
$(this).delay(4000 + (1000 * index)).fadeOut("slow");
});
return false;
};
$('body').on('click', '.fav', function(e) {
e.preventDefault;
var id = $(this).parents().eq(1).attr('id');
$("#"+id+".post_buttons .fav").switchClass("fav","unfav",200);
$.get("action.php?a=true&mode=on&fav=" + id, function(data) {
if (data == 'error') {
$("#"+id+".post_buttons .unfav").switchClass("unfav","fav",200);
} else {
$("#"+id+".post_buttons .unfav").children().html(data);
}
});
});
$('body').on('click', '.unfav', function(e) {
e.preventDefault;
var id = $(this).parents().eq(1).attr('id');
$("#"+id+".post_buttons .unfav").switchClass("unfav","fav",200);
$.get("action.php?a=true&mode=off&fav=" + id, function(data) {
if (data == 'error') {
$("#"+id+".post_buttons .fav").switchClass("fav","unfav",200);
} else {
$("#"+id+".post_buttons .fav").children().html(data);
}
});
});
$('body').on('click', '.reblog', function(e) {
e.preventDefault;
var id = $(this).parents().eq(1).attr('id');
$("#"+id+".post_buttons .reblog").switchClass("reblog","unreblog",200);
$.get("action.php?a=true&mode=on&reblog=" + id, function(data) {
if (data == 'error') {
$("#"+id+".post_buttons .unreblog").switchClass("unreblog","reblog",200);
} else {
$("#"+id+".post_buttons .unreblog").children().html(data);
}
});
});
$('body').on('click', '.unreblog', function(e) {
e.preventDefault;
var id = $(this).parents().eq(1).attr('id');
$("#"+id+".post_buttons .unreblog").switchClass("unreblog","reblog",200);
$.get("action.php?a=true&mode=off&reblog=" + id, function(data) {
if (data == 'error') {
$("#"+id+".post_buttons .reblog").switchClass("reblog","unreblog",200);
} else {
$("#"+id+".post_buttons .reblog").children().html(data);
}
});
});
$('body').on('click', '.mute', function() {
var id = $(this).attr('id');
$.get("action.php?a=true&mode=true&mute=" + id, function(data) {
$('#' + id + '.mute').switchClass("mute","unmute",200);
$('#' + id + '.unmute').html('Unmute');
});
});
$('body').on('click', '.unmute', function() {
var id = $(this).attr('id');
$.get("action.php?a=true&mode=off&mute=" + id, function(data) {
$('#' + id + '.unmute').switchClass("unmute","mute",200);
$('#' + id + '.mute').html('Mute');
});
});
$('body').on('click', '.muteconv', function() {
var id = $(this).attr('id');
$.get("action.php?a=true&mode=true&thread=true&mute=" + id, function(data) {
$('#' + id + '.muteconv').switchClass("muteconv","unmuteconv",200);
$('#' + id + '.unmuteconv').html('Unmute Thread');
console.log(data);
});
});
$('body').on('click', '.unmuteconv', function() {
var id = $(this).attr('id');
$.get("action.php?a=true&mode=off&thread=true&mute=" + id, function(data) {
$('#' + id + '.muteconv').switchClass("unmuteconv","muteconv",200);
$('#' + id + '.muteconv').html('Mute Thread');
console.log(data);
});
});
$('body').on('click', '.menu', function(e) {
$(this).next('span').slideToggle('left');
});
$('body').on('click', '.delete', function(e) {
e.preventDefault;
var id = $(this).attr('id');
var post = $('#'+id+'.post').parent();
var reply = $('#'+id+'.reply');
$.get("action.php?a=true&delete=" + id, function(data) {
if (data == '0') {
post.css('opacity','0.5');
reply.css('opacity','0.5');
} else {
$.when(post.fadeOut('slow')).then(function(){
post.remove();
reply.remove();
});
}
});
});
$('body').on('click', '.delete', function(e) {
e.preventDefault;
var id = $(this).attr('id');
$.get("action.php?a=true&bookmark=" + id, function(data) {
notificaton('Post bookmarked!');
});
});
$('body').on('click', '.quote', function(e) {
e.preventDefault;
var id = $(this).closest('.post').attr('id');
console.log(id);
var url = $("#"+id+".post .original").attr("href");
console.log(url);
$("#postform").find('textarea').val("> "+url+"\n\n");
if ($("#postform").is(':visible')) {
location.hash = "#top";
} else {
$('#postform').toggle();
}
});
$('body').on('click', '.delpic', function(e) {
var count = $(this).closest('#files').children().length;
if (count == 1){
$(this).closest('.uploadBox').remove();
} else {
count = count - 1;
$(this).parent().fadeOut();
$(this).parent().remove();
}
});
document.onpaste = function (event) {
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
/*Make Sure Only One File is Copied*/
if (items.length != 1) {
return;
}
var item = items[0];
/*Verify If The Copied Item is File*/
if (item.kind === 'file') {
var file = item.getAsFile();
var filename = file.name;
/*Get File Extension*/
var ext = filename.split('.').reverse()[0].toLowerCase();
/*Check Image File Extensions*/
if (jQuery.inArray(ext, ['jpg', 'png']) > -1) {
/*Create FormData Instance*/
var data = new FormData();
data.append('file', file);
/*Request Ajax With File*/
request_ajax_file('upload.php', data, file_uploaded);
} else {
alert('Invalid File');
}
}
};
function file_uploaded(data) {
if ($("#postform .uploadBox").length < 1){
$("#postform #status").before('<div class="uploadBox"><ul id="files" style="margin:0px;"></ul></div>');
$( function() {
$( "#files" ).sortable();
$( "#files" ).disableSelection();
} );
}
var files = JSON.parse(data);
$.each(files, function( index, elem ) {
$("#files").append('<li class="uploadedImage" id="'+elem[0]+'" style="position:relative; background-image:url('+elem[1]+')"><div class="fontello delpic">&#xe813;</div></li>');
});
var nfiles = $("#postform .uploadBox").children().length;
$("#postform .status").html('');
}
/*Function to Make AJAX Request With File*/
function request_ajax_file(ajax_url, ajax_data, ajax_callback) {
$("#postform .status").html('<span id="loading" class="animate-spin fontello">&#xe838;</span>');
jQuery.ajax({
url: ajax_url,
data: ajax_data,
type: 'POST',
processData: false,
contentType: false,
success: function (response) {
if (typeof ajax_callback == 'function') {
ajax_callback(response);
} else if (typeof ajax_callback == 'string') {
if (ajax_callback != '') {
eval(ajax_callback + '(response)');
}
}
}
});
}
function upload_files() {
$("#postform .status").html('<span id="loading" class="animate-spin fontello">&#xe838;</span>');
var fileUpload = $("#files_input_field").get(0);
var files = fileUpload.files;
if (files.length == 0) return;
var data = new FormData();
for (var i = 0; i < files.length; i++) {
data.append(files[i].name, files[i]);
}
$.ajax({
type: "POST",
url: "upload.php",
contentType: false, //default: 'application/x-www-form-urlencoded; charset=UTF-8'
processData: false, //default: data, other DOMDocument
data: data, //Type: PlainObject or String or Array
success: function(data) {
if ($("#postform .uploadBox").length < 1){
$("#postform #status").before('<div class="uploadBox"><ul id="files" style="margin:0px;"></ul></div>');
$( function() {
$( "#files" ).sortable();
$( "#files" ).disableSelection();
} );
}
var files = JSON.parse(data);
$.each(files, function( index, elem ) {
$("ul[id=files]").append('<li class="uploadedImage" id="'+elem[0]+'" style="position:relative; background-image:url('+elem[1]+')"><div class="fontello delpic">&#xe813;</div></li>');
});
var nfiles = $("#postform .uploadBox").children().length;
$("#postform .status").html('');
},
error: function(jqXHR,e) {
console.log(jqXHR);
alert("There was error uploading files! "+e);
}
});
}
function upload_files_reply() {
$("#replyform .status").html('<span id="loading" class="animate-spin fontello">&#xe838;</span>');
var fileUpload = $("#replyform #files_input_field").get(0);
var files = fileUpload.files;
if (files.length == 0) return;
var data = new FormData();
for (var i = 0; i < files.length; i++) {
data.append(files[i].name, files[i]);
}
$.ajax({
type: "POST",
url: "upload.php",
contentType: false, //default: 'application/x-www-form-urlencoded; charset=UTF-8'
processData: false, //default: data, other DOMDocument
data: data, //Type: PlainObject or String or Array
success: function(data) {
if ($("#replyform .uploadBox").length < 1){
$("#replyform #status").before('<div class="uploadBox"><ul id="files" style="margin:0px;"></ul></div>');
$( function() {
$( "#files" ).sortable();
$( "#files" ).disableSelection();
} );
}
var files = JSON.parse(data);
$.each(files, function( index, elem ) {
$("#replyform #files").append('<li class="uploadedImage" id="'+elem[0]+'" style="position:relative; background-image:url('+elem[1]+')"><div class="fontello delpic">&#xe813;</div></li>');
});
var nfiles = $("#replyform .uploadBox").children().length;
$("#replyform .status").html('');
},
error: function() {
alert("There was error uploading files!");
}
});
}
<?php endif; ?>
</script>
</body>

223
layout/header.php Normal file
View File

@ -0,0 +1,223 @@
<!DOCTYPE html>
<head>
<title>Dashboard FE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" media='screen and (min-width: 801px)' href='css/style.css?id=<?php echo mt_rand(1000, 2500); ?>' />
<link rel="stylesheet" media='screen and (max-width: 800px)' href='css/mobile.css?id=<?php echo mt_rand(1000, 2500); ?>' />
<link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/" + font.fontname + "-ie7.css"><![endif]-->
<link rel="stylesheet" href="css/animate.css">
<style type="text/css">
@font-face {
font-family: 'fontello';
src: url('./font/fontello.eot?43704775');
src: url('./font/fontello.eot?43704775#iefix') format('embedded-opentype'),
url('./font/fontello.woff?43704775') format('woff'),
url('./font/fontello.ttf?43704775') format('truetype'),
url('./font/fontello.svg?43704775#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'patua';
src: url('./font/patua-one-v10-latin-regular.eot');
src: url('./font/patua-one-v10-latin-regular.woff') format('woff'),
url('./font/patua-one-v10-latin-regular.ttf') format('truetype'),
url('./font/patua-one-v10-latin-regular.svg') format('svg');
font-weight: normal;
font-style: normal;
}
.nte{
width:35px;
height:35px;
float:left;
margin:2px;
background-size:cover;
position:relative;
}
.nte_type{
position:absolute;
right:0px;
bottom:0px;
width:15px;
height:15px;
border-radius:15px;
font-family:fontello;
font-size:8px;
color:white;
}
.nte_type span{
font-family:fontello;
font-size:8px;
color:white;
margin-top:4px;
display:block;
}
</style>
</head>
<body>
<?php
if ($logedin) {
$notif = getnotif();
}
?>
<div id='hiddenside'></div>
<div class='gotop'><a href='#top'>▲</a></div>
<div class="topbar" style='text-align:center; background-color:none;'>
<div class="topbar" style='position:fixed; top:0px; left:0px; height:45px; z-index:99;'>
<span style='float:left; line-height:45px;margin-left:10px;'>
<a href="./<?php echo ($logedin ? "?mode=home" : ""); ?>" style="font-family: 'patua', serif; font-weight:bold; color:white; font-size:20px; text-decoration:none">Dashboard FE</a>
</span>
<?php if ($logedin): ?>
<span class='mid' style='margin:0 auto; height:100%;'>
<span class="topbutton" style='position:relative;'>
<a href='?mode=federated' class='fontello topicon ldr <?php echo ($tl['mode'] == "federated" ? "tiselected" : "");?>'>&#xe83c;</a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?mode=home' class='fontello topicon ldr <?php echo ($tl['mode'] == "home" ? "tiselected" : "");?>'>&#xe816;</a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?mode=local' class='fontello topicon ldr <?php echo ($tl['mode'] == "local" ? "tiselected" : "");?>'>&#xf1e0;</a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?mode=favourites' class='fontello topicon ldr <?php echo ($tl['mode'] == "favourites" ? "tiselected" : "");?>'>&#xe804;</a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?mode=direct' class='fontello topicon ldr <?php echo ($tl['mode'] == "direct" ? "tiselected" : "");?>'>&#xf0e0;</a>
</span>
<?php if (isset($user_settings['pleroma'])): ?>
<span class="topbutton" style='position:relative;'>
<a href='?mode=bookmarks' class='fontello topicon ldr <?php echo ($tl['mode'] == "bookmarks" ? "tiselected" : "");?>'>&#xe81e;</a>
</span>
<?php
endif; ?>
</span>
<?php
endif; ?>
<span style='float:right; margin-right:20px; color:white; height:100%;'>
<?php if ($logedin): ?>
<span class="topbutton mobile compose" style='position:relative;'>
<a href='' onClick='return false;' class='fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xe824;</a>
</span>
<span class="topbutton ntbutton">
<a href='?page=notifications' onClick='return false;' class='badge fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xf0f3; <span class='alert' style=''></span> </a>
<div id='notifications'><div class='container'><?php echo $notif ?></div><span class='nloadmore'>Load More</span></div>
</span>
<span class="topbutton" id="usermenu">
<span class='fontello' style='display:inline; font-size:20px;'>&#xe80b;</span>
<div class='menu postMenu'>
<ul>
<?php if ($logedin): ?>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=federated' onClick='return false'>&#xe83c; Federated</a></li>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=home' onClick='return false'>&#xe816; Home</a></li>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=local' onClick='return false'>&#xf1e0; Local</a></li>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=favourites' onClick='return false'>&#xe804; Favourited</a></li>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=direct' onClick='return false'>&#xf0e0; Direct</a></li>
<?php if (isset($user_settings['pleroma'])): ?>
<li class='mobile' style='background-color:white;'><a class='fontello ldr link' href='?mode=bookmarks' onClick='return false'>&#xe81e; Bookmarks</a></li>
<?php
endif; ?>
<li class='mobile' style='background-color:white;'></li>
<?php
endif; ?>
<li style='background-color:white;'><a class='fontello ldr link' href='?page=settings' onClick='return false'>&#xe82d; Settings</a></li>
<li style='background-color:white;'><a class='fontello link' href='./logout'>&#xe832; Log Out</a></li>
</ul>
</div>
</span>
<?php
else: ?>
<span class="topbutton" style='position:relative;'>
<a href='?page=about' class='fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xe814; </a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?page=fediverse' class='fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xf1e0; </a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?page=privacy' class='fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xe819; </a>
</span>
<span class="topbutton" style='position:relative;'>
<a href='?page=settings' class='fontello' style='color:white; text-decoration:none; display:inline; font-size:20px;'>&#xe82d; </a>
</span>
<span class="topbutton" style='position:relative; width:auto; margin-left:10px;'>
<a href='./login' style='display:inline:block; padding:3px; background-color: #3F71BC; border: 1px solid white; font-weight:bold; border-radius:3px; color:white; text-decoration:none; display:inline; font-size:20px;'><span class='fontello' >&#xe832;</span> Login </a>
</span>
<?php
endif; ?>
<!--
<a href='?page=notifications' onClick='return false;'><span class="badge disabled">&#128276;</span></a>
<a href="./logout" style='color:lightgray; font-weight:bold; font-size:18px;'>Logout</a>
-->
</span>
</div>
</div>
<br>
<div class='wrapper'>
<div class='container'>
<div id='posts'>
<?php
if ($logedin) {
?>
<div class='element' id='postform' style=''>
<div class='avatar' style='background-image:url(<?php echo $user_settings['avatar']; ?>)'></div>
<div class='postform form' style='display:block;'>
<div style='text-align:right; width:95%; margin: 13px auto; display:block;'>
<form action='status.php' method='post' enctype='multipart/form-data'>
<input type='hidden' name='mode' value='<?php echo $tl['mode']; ?>'>
<input type='hidden' name='uploaded' id="uploaded" value=''>
<input type='hidden' name='thread' id="thread" value='null'>
<div style='width:100%; border: 1px solid #ddd; text-align:left;'>
<div style='width:100% height:27px; border-bottom: 1px solid #ddd;'>
<input type='text' name='spoiler' placeholder='Title (optional)' value='' style='border:none; width:97%;'>
</div>
<textarea name='status' id="status" style='width:97%; height:100px; border:none;'></textarea>
</div>
<span style='float:left;'>
<input type='submit' value='Send' id='send' onClick='return false'>
<div class='formbtn fontello' style='position:relative;'>
&#xe818;
<input style='opacity:0; position:absolute; left:0px; top:5px; background-color:yellow;' type='file' id="files_input_field" name='file[]' multiple onchange="upload_files();">
</div>
<div class='formbtn fontello' style='position:relative;'>
<input type='checkbox' name='sensitive' id='sensitive' style='display:none;'>
<label for='sensitive' class='fontello'>&#xe81b;</label>
</div>
</span>
<span style='float:left;' class='status'>
</span>
<span style='float:right;'>
<select name='scope' id='scope'>
<option value="1">&#xe83c; Public</option>
<option value="2">&#xe816; Unlisted</option>
<option value="3">&#xe819; Private</option>
<option value="4">&#xf0e0; Direct</option>
</select>
</span>
</form>
<div style="clear: both;"></div>
</div>
</div>
</div>
<?php
}
?><div id="loader" class='element'></div>
<div id="content">

47
layout/sidebar.php Normal file
View File

@ -0,0 +1,47 @@
<aside>
<?php
$info = api_get("accounts/verify_credentials");
if ($logedin || $tl['mode'] == 'user') {
echo "
<div class='side_element' style='margin:0px; width:100%;'>
<div style='width:100%; height:120px; display:block; background-color:#" . averageColor($info['avatar']) . "; background-size:cover; background-image:url(" . $info['header_static'] . "); '></div>
<div class='avatar' style='background-color:white; background-image:url(" . $info['avatar'] . "); text-align:center; float:none; display:inline-block; border:3px solid white; margin-top:-50px; border-radius:90px;'></div>
<div style='clear:both; margin-top:-15px; padding-bottom:10px;'>" . ($logedin ? "<a href='?mode=account' class='ldr'>" : "") . "<span style='font-weight:bold; font-size:22px;'>
" . $info['display_name'] . "</span>" . ($logedin ? "</a>" : "") . "
<br><span>(@" . $info['acct'] . ")</span>
</div>
</div>
<div class='side_element' style='margin-top:20px; margin-left:0px; width:100%;'>
<ul>
<a href='?mode=federated' class='ldr'><li>&#xe83c; Federated</li></a>
<a href='?mode=home' class='ldr'><li>&#xe816; Home</li></a>
<a href='?mode=local' class='ldr'><li>&#xf1e0; Local</li></a>
<a href='?mode=favourites' class='ldr'><li>&#xe804; Favourites</li></a>
<a href='?mode=direct' class='ldr'><li>&#xf0e0; Direct Messages</li></a>
<a href='?page=settings' class='ldr'><li>&#xe82d; Settings</li></a>
</ul>
</div>
<div class='side_element' style='margin-top:20px; margin-left:0px; width:100%;'>
<ul>";
$lists = api_get("/lists");
foreach ($lists as $list) {
echo "<a href='?list=" . $list['id'] . "' class='ldr'><li>&#xe832; " . $list['title'] . "</li></a>";
}
echo "</ul>
</div>
";
}
if ($logedin) {
echo "";
}
else {
echo "<div class='side_element'>
<span style='font-weight:bold; font-size:20px; clear:both;'>" . $setting['appname'] . "</span><br>
<span>" . $setting['description'] . "</span>
</div>";
}
?>
</aside>