[CORE] Move public resources to a /public directory

Advantages:
* Increases security by preventing direct access to file/
* We are careful and have a defined('GNUSOCIAL') || die() to prevent
  direct access to GS files, but we may miss one or a vendor/extlib may
  not be as careful
* Improves directory structure - It's more natural to physically
  separate what is public from what are GNU social resources
This commit is contained in:
Diogo Cordeiro
2018-07-20 23:00:18 -06:00
parent 966b00617e
commit 1049080df5
405 changed files with 45 additions and 60907 deletions

View File

@@ -1,126 +0,0 @@
/* Event specific styles */
.event-tags li { display: inline; }
.event-mentions li { display: inline; }
.event-avatar { float: left; }
.event-notice-count { float: right; }
.event-info { float: left; }
.event-title { margin-left: 0px; }
.ui-autocomplete {
max-height: 100px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}
.attending-list { list-style-type: none; float: left; width: 100%; }
#form_event_rsvp { clear: left; }
li.rsvp-list { float: left; clear: left; }
li.rsvp-list ul.entities {
display:inline;
}
li.rsvp-list .entities li {
list-style-type: none;
margin-right: 3px;
margin-bottom: 8px;
display: inline;
}
li.rsvp-list .entities li .u-photo {
margin: 0 !important;
float: none !important;
}
.notice .h-event div {
margin-bottom: 8px;
}
.event-info {
margin-left: 0px !important;
margin-top: 2px !important;
}
.notice .event-info + .notice-options {
margin-top: 14px;
}
.notice .threaded-replies .event-info + .notice-options {
margin-top: 20px;
}
#form_event_rsvp #new_rsvp_data {
display: inline;
margin: 10px 0px;
}
#form_event_rsvp input.submit {
height: auto;
padding: 0px 10px;
margin-left: 10px;
color:#fff;
font-weight: bold;
text-transform: uppercase;
font-size: 1.1em;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2);
border: 1px solid #d7621c;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
background: #FB6104;
background: -moz-linear-gradient(top, #ff9d63 0%, #fb6104 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff9d63), color-stop(100%,#fb6104));
background: -webkit-linear-gradient(top, #ff9d63 0%,#fb6104 100%);
background: -o-linear-gradient(top, #ff9d63 0%,#fb6104 100%);
background: -ms-linear-gradient(top, #ff9d63 0%,#fb6104 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff9d63', endColorstr='#fb6104',GradientType=0 );
background: linear-gradient(top, #ff9d63 0%,#fb6104 100%);
}
#form_event_rsvp input.submit:hover {
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.6);
background: #ff9d63;
background: -moz-linear-gradient(top, #fb6104 0%, #fc8035 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fb6104), color-stop(100%,#fc8035));
background: -webkit-linear-gradient(top, #fb6104 0%,#fc8035 100%);
background: -o-linear-gradient(top, #fb6104 0%,#fc8035 100%);
background: -ms-linear-gradient(top, #fb6104 0%,#fc8035 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fb6104', endColorstr='#fc8035',GradientType=0 );
background: linear-gradient(top, #fb6104 0%,#fc8035 100%);
}
#wrap .h-event form.processing input.submit {
text-indent: 0;
background: #ff9d63;
}
#input_form_event .form_settings .form_data {
float: left;
}
#input_form_event .form_settings .form_data li {
float: left;
width: auto;
}
#input_form_event .form_settings .form_data label {
width: auto;
}
label[for=event-starttime], label[for=event-endtime] {
display: none !important;
}
#event-starttime, #event-endtime {
margin-top: -1px;
margin-bottom: -1px;
height: 2em;
}
#event-startdate, #event-enddate {
margin-right: 20px;
width: 120px;
}

View File

@@ -1,144 +0,0 @@
$(document).ready(function() {
// get current time from server
var today = new Date($('now').val());
$("#event-startdate").datepicker({
// Don't let the user set a start date < before today
minDate: today,
onClose: onStartDateSelected
});
$("#event-enddate").datepicker({
minDate: today,
onClose: onEndDateSelected
});
$("#event-starttime").change(function(e) {
var tz = $("#tz").val();
var startDate = $("#event-startdate").val();
var startTime = $("#event-starttime option:selected").val().replace(/(pm|am)/, ' $1');
var startStr = startDate + ' ' + startTime + ' ' + tz;
var endDate = $("#event-enddate").val();
var endTime = $("#event-endtime option:selected").val();
var endStr = endDate + ' ' + endTime.replace(/(pm|am)/, ' $1') + ' ' + tz;
// just need to compare hours
var start = new Date(startStr);
var end = new Date(endStr);
updateTimes(startStr, (startDate === endDate), function (data) {
var times = [];
$.each(data, function(key, val) {
times.push('<option value="' + key + '">' + val + '</option>');
});
$("#event-endtime").html(times.join(''));
if (start > end) {
$("#event-endtime").val(startTime).attr("selected", "selected");
} else {
$("#event-endtime").val(endTime).attr("selected", "selected");
}
});
});
$("#event-endtime").change(function(e) {
var HOUR = 60 * 60 * 1000;
var tz = $("#tz").val();
var startDate = $("#event-startdate").val();
var endDate = $("#event-enddate").val();
var starttime = $("#event-starttime option:selected").val();
var endtime = $("#event-endtime option:selected").val();
var endtimeText = $("#event-endtime option:selected").text();
// If the end time is in the next day then update the start date
if (startDate === endDate) {
var startstr = startDate + ' ' + starttime.replace(/(pm|am)/, ' $1') + ' ' + tz;
var start = new Date(startstr);
var matches = endtimeText.match(/\(.*\)/);
var hours;
if (matches) {
hours = matches[0].substr(1).split(' ')[0]; // get x from (x hours)
if (hours) {
if (hours == 30) {
hours = .5; // special case: x == 30 from (30 mins)
}
var end = new Date(start.getTime() + (hours * HOUR));
if (end.getDate() > start.getDate()) {
$("#event-enddate").datepicker('setDate', end);
var endstr = endDate + ' 12:00 am ' + tz;
updateTimes(endstr, false, function(data) {
var times = [];
$.each(data, function(key, val) {
times.push('<option value="' + key + '">' + val + '</option>');
});
$("#event-endtime").html(times.join(''));
if (start > end) {
$("#event-endtime").val(starttime).attr("selected", "selected");
} else {
$("#event-endtime").val(endtime).attr("selected", "selected");
}
});
}
}
}
}
});
function onStartDateSelected(dateText, inst) {
var tz = $("#tz").val();
var startTime = $("#event-starttime option:selected").val();
var startDateTime = new Date(dateText + ' ' + startTime.replace(/(pm|am)/, ' $1') + ' ' + tz);
// When we update the start date and time, we need to update the end date and time
// to make sure they are equal or in the future
$("#event-enddate").datepicker('option', 'minDate', startDateTime);
recalculateTimes();
}
function onEndDateSelected(dateText, inst) {
recalculateTimes();
}
function recalculateTimes(showDuration) {
var tz = $("#tz").val();
var startDate = $("#event-startdate").val();
var startTime = $("#event-starttime option:selected").val();
var startStr = startDate + ' ' + startTime.replace(/(pm|am)/, ' $1') + ' ' + tz;
var startDateTime = new Date(startStr);
var endDate = $("#event-enddate").val();
var endTime = $("#event-endtime option:selected").val();
var endDateTime = new Date(endDate + ' ' + endTime.replace(/(pm|am)/, ' $1') + ' ' + tz);
var showDuration = true;
if (endDateTime.getDate() !== startDateTime.getDate()) {
starStr = endDate + ' 12:00 am ' + tz;
showDuration = false;
}
updateTimes(startStr, showDuration, function(data) {
var times = [];
$.each(data, function(key, val) {
times.push('<option value="' + key + '">' + val + '</option>');
});
$("#event-endtime").html(times.join(''));
if (startDateTime > endDateTime) {
$("#event-endtime").val(startTime).attr("selected", "selected");
} else {
$("#event-endtime").val(endTime).attr("selected", "selected");
}
});
}
function updateTimes(start, duration, onSuccess) {
$.getJSON($('#timelist_action_url').val(), {start: start, ajax: true, duration: duration}, onSuccess);
}
});