[CORE][COMPOSER] Move extlib packages with immediate composer correspondent to composer dependencies

This adds a composer.json for all dependencies that are available
This commit is contained in:
Diogo Cordeiro
2018-03-11 21:23:55 -06:00
parent 0b58465fb9
commit 2a06261f75
2697 changed files with 205282 additions and 42340 deletions

View File

@@ -0,0 +1,153 @@
/* QnA */
.question .answer-count, .qna-full-question .answer-count {
display: block;
clear: left;
}
.question .answer-count:before, .qna-full-question .answer-count:before {
content: '(';
}
.question .answer-count:after, .qna-full-question .answer-count:after {
content: ')';
}
.question .notice-answer {
margin-left: 10px;
padding-bottom: 10px;
}
ul.qna-dummy {
clear: left;
float: left;
list-style-type: none;
width: 458px;
margin-left: 59px;
padding-right: 2px;
border-left: 3px solid #ECECF2;
background: #fafafa;
font-size: 1em;
}
ul.qna-dummy + ul.threaded-replies li.notice:first-child, li.notice-answer + li.notice {
border-top: 2px dotted #eee;
margin-top: -10px;
padding-top: 10px;
}
.qna-dummy-placeholder input {
margin: 10px 0px 10px 10px;
width: 426px;
color: #888;
border: 1px solid #A6A6A6;
padding: 4px 4px 4px 6px;
}
.question fieldset, .qna-full-question fieldset {
margin: 0px;
}
.question fieldset legend, .qna-full-question fieldset legend, .answer fieldset legend {
display: none;
}
.question label[for=qna-answer], .qna-full-question label[for=qna-answer] {
display: none;
}
.question #qna-answer, .qna-full-question #qna-answer {
width: 426px;
height: 54px;
padding: 6px 5px;
font-size: 1.2em;
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #A6A6A6;
}
.qna-full-question textarea {
width: 508px;
}
.question p.best:before, .answer p.best:before {
content: '[Best] ';
}
.question .question-closed {
display: block;
font-style: italic;
}
.question div.question-description {
font-size: 1em;
line-height: 1.36em;
margin-top: 0px;
opacity: 1;
}
.question div.answer-content, .qna-full-question div.answer-content {
font-size: 1em;
opacity: 1;
}
.qna-dummy-placeholder input, .question #qna-answer, .qna-full-question #qna-answer {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2);
}
.question-description input.submit, .answer-content input.submit {
height: auto;
padding: 0px 10px;
margin: 6px 0px 10px 0px;
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%);
}
#qna-answer-submit {
min-width: 100px;
}
.question .question-description input.submit:hover, .question .answer-content 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%);
}
.question .question-description #answer-form input.submit {
margin-top: 0px;
}
.question p.best, .answer p.best {
background: url(../images/rosette.png) no-repeat top left;
padding-left: 20px;
}
.question p.best:before, .answer p.best:before {
content: none !important;
}

View File

@@ -0,0 +1,360 @@
var QnA = {
// @fixme: Should use ID
close: function (form, best) {
var notice = $(form).closest('li.h-entry.notice.question');
notice.find('input#qna-best-answer,#qna-question-close').hide();
notice.find('textarea').hide();
var list = notice.find('ul');
notice.find('ul > li.notice-answer-placeholder').remove();
notice.find('ul > li.notice-answer').remove();
if (best) {
var p = notice.parent().find('div.question-description > form > fieldset > p');
if (p.length != 0) {
p.append($('<span class="question-closed">This question is closed.</span>'));
}
}
},
init: function () {
QnA.NoticeInlineAnswerSetup();
$(document).on('submit', 'form.form_question_show', function () {
QnA.close(this);
});
$(document).on('submit', 'form.form_answer_show', function () {
QnA.close(this, true);
});
},
/**
* Open up a question's inline answer box.
*
* @param {jQuery} notice: jQuery object containing one notice
*/
NoticeInlineAnswerTrigger: function (notice) {
// Find the notice we're replying to...
var id = $($('.notice_id', notice)[0]).text();
var parentNotice = notice;
// Find the threaded replies view we'll be adding to...
var list = notice.closest('.notices');
if (list.hasClass('threaded-replies')) {
// We're replying to a reply; use reply form on the end of this list.
// We'll add our form at the end of this; grab the root notice.
parentNotice = list.closest('.notice');
} else {
// We're replying to a parent notice; pull its threaded list
// and we'll add on the end of it. Will add if needed.
list = $('ul.threaded-replies', notice);
}
// See if the form's already open...
var answerForm = $('.qna_answer_form', list);
var hideReplyPlaceholders = function (notice) {
// Do we still have a dummy answer placeholder? If so get rid of
// reply place holders for this question. If the current user hasn't
// answered the question we want to direct her to providing an
// answer. She can still reply by hitting the reply button if she
// really wants to.
var dummyAnswer = $('ul.qna-dummy', notice);
if (dummyAnswer.length > 0) {
notice.find('li.notice-reply-placeholder').hide();
}
}
var nextStep = function () {
var dummyAnswer = $('ul.qna-dummy', notice);
dummyAnswer.hide();
// Set focus...
var text = answerForm.find('textarea');
if (text.length == 0) {
throw "No textarea";
}
text.focus();
$('body').click(function (e) {
var dummyAnswer = $('ul.qna-dummy', notice);
var style = dummyAnswer.attr('style');
var ans = $(notice).find('li.h-entry.notice.anwer', notice)
if (ans > 0) {
hideReplyPlaceholders(notice);
}
var openAnswers = $('li.notice-answer');
if (openAnswers.length > 0) {
var target = $(e.target);
openAnswers.each(function () {
// Did we click outside this one?
var answerItem = $(this);
var parentNotice = answerItem.closest('li.notice');
if (answerItem.has(e.target).length == 0) {
var textarea = answerItem.find('.notice_data-text:first');
var cur = $.trim(textarea.val());
// Only close if there's been no edit.
if (cur == '' || cur == textarea.data('initialText')) {
answerItem.remove();
dummyAnswer.show();
}
}
});
}
});
};
// See if the form's already open...
if (answerForm.length > 0 ) {
nextStep();
} else {
var placeholder = list.find('li.qna-dummy-placeholder').hide();
// Create the answer form entry at the end
var answerItem = $('li.notice-answer', list);
if (answerItem.length == 0) {
answerItem = $('<li class="notice-answer"></li>');
var intermediateStep = function (formMaster) {
// @todo cache the form if we can (worth it?)
var formEl = document._importNode(formMaster, true);
$(formEl).data('NoticeFormSetup', true);
answerItem.append(formEl);
list.prepend(answerItem); // *before* the placeholder
var form = answerForm = $(formEl);
QnA.AnswerFormSetup(form);
nextStep();
};
if (QnA.AnswerFormMaster) {
// @todo if we had a cached for here's where we'd use it'
intermediateStep(QnA.AnswerFormMaster);
} else {
// Fetch a fresh copy of the answer form over AJAX.
// Warning: this can have a delay, which looks bad.
// @fixme this fallback may or may not work
var url = $('#answer-action').attr('value');
$.get(url, {ajax: 1}, function (data, textStatus, xhr) {
intermediateStep($('form', data)[0]);
});
}
}
}
},
/**
* Setup function -- DOES NOT apply immediately.
*
* Sets up event handlers for inline reply mini-form placeholders.
* Uses 'live' rather than 'bind', so applies to future as well as present items.
*/
NoticeInlineAnswerSetup: function () {
$(document).on('focus',
'li.qna-dummy-placeholder input.placeholder',
function () {
var notice = $(this).closest('li.notice');
QnA.NoticeInlineAnswerTrigger(notice);
return false;
});
},
AnswerFormSetup: function (form) {
form.find('textarea').focus();
if (!form.data('NoticeFormSetup')) {
alert('gargargar');
}
if (!form.data('AnswerFormSetup')) {
//SN.U.NoticeLocationAttach(form);
QnA.FormAnswerXHR(form);
//SN.U.FormNoticeEnhancements(form);
//SN.U.NoticeDataAttach(form);
form.data('NoticeFormSetup', true);
}
},
/**
* Setup function -- DOES NOT trigger actions immediately.
*
* Sets up event handlers for special-cased async submission of the
* answer-posting form, including some pre-post validation.
*
* @fixme geodata
* @fixme refactor and unify with FormNoticeXHR in util.js
*
* @param {jQuery} form: jQuery object whose first element is a form
*
* @access public
*/
FormAnswerXHR: function (form) {
//SN.C.I.NoticeDataGeo = {};
form.append('<input type="hidden" name="ajax" value="1"/>');
// Make sure we don't have a mixed HTTP/HTTPS submission...
form.attr('action', SN.U.RewriteAjaxAction(form.attr('action')));
/**
* Show a response feedback bit under the new-notice dialog.
*
* @param {String} cls: CSS class name to use ('error' or 'success')
* @param {String} text
* @access private
*/
var showFeedback = function (cls, text) {
form.append(
$('<p class="form_response"></p>')
.addClass(cls)
.text(text)
);
};
/**
* Hide the previous response feedback, if any.
*/
var removeFeedback = function () {
form.find('.form_response').remove();
};
form.ajaxForm({
dataType: 'xml',
timeout: '60000',
beforeSend: function (formData) {
if (form.find('.notice_data-text:first').val() == '') {
form.addClass(SN.C.S.Warning);
return false;
}
form
.addClass(SN.C.S.Processing)
.find('.submit')
.addClass(SN.C.S.Disabled)
.attr(SN.C.S.Disabled, SN.C.S.Disabled);
return true;
},
error: function (xhr, textStatus, errorThrown) {
form
.removeClass(SN.C.S.Processing)
.find('.submit')
.removeClass(SN.C.S.Disabled)
.removeAttr(SN.C.S.Disabled, SN.C.S.Disabled);
removeFeedback();
if (textStatus == 'timeout') {
// @fixme i18n
showFeedback('error', 'Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.');
}
else {
var response = SN.U.GetResponseXML(xhr);
if ($('.'+SN.C.S.Error, response).length > 0) {
form.append(document._importNode($('.'+SN.C.S.Error, response)[0], true));
}
else {
if (parseInt(xhr.status) === 0 || jQuery.inArray(parseInt(xhr.status), SN.C.I.HTTP20x30x) >= 0) {
form
.resetForm()
.find('.attach-status').remove();
SN.U.FormNoticeEnhancements(form);
}
else {
// @fixme i18n
showFeedback('error', '(Sorry! We had trouble sending your notice ('+xhr.status+' '+xhr.statusText+'). Please report the problem to the site administrator if this happens again.');
}
}
}
},
success: function (data, textStatus) {
removeFeedback();
var errorResult = $('#'+SN.C.S.Error, data);
if (errorResult.length > 0) {
showFeedback('error', errorResult.text());
}
else {
// New notice post was successful. If on our timeline, show it!
var notice = document._importNode($('li', data)[0], true);
var notices = $('#notices_primary .notices:first');
var answerItem = form.closest('li.notice-answer');
var questionItem = form.closest('li.question');
var dummyAnswer = form.find('ul.qna-dummy', questionItem).remove();
if (answerItem.length > 0) {
// If this is an inline answer, remove the form...
var list = form.closest('.threaded-replies');
// if the inserted notice's parent question needs it give it a placeholder
var ans = questionItem.find('ul > li.h-entry.notice.answer');
if (ans.length == 0) {
SN.U.NoticeInlineReplyPlaceholder(questionItem);
}
var id = $(notice).attr('id');
if ($("#"+id).length == 0) {
$(notice).insertBefore(answerItem);
answerItem.remove();
} else {
// NOP
// Realtime came through before us...
}
} else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
// Not a reply. If on our timeline, show it at the
if ($('#'+notice.id).length === 0) {
var notice_irt_value = form.find('#inreplyto').val();
var notice_irt = '#notices_primary #notice-'+notice_irt_value;
if($('body')[0].id == 'conversation') {
if(notice_irt_value.length > 0 && $(notice_irt+' .notices').length < 1) {
$(notice_irt).append('<ul class="notices"></ul>');
}
$($(notice_irt+' .notices')[0]).append(notice);
}
else {
notices.prepend(notice);
}
$('#'+notice.id)
.css({display:'none'})
.fadeIn(2500);
}
// realtime injected the notice first
} else {
// Not on a timeline that this belongs on?
// Just show a success message.
// @fixme inline
showFeedback('success', $('title', data).text());
}
}
},
complete: function (xhr, textStatus) {
form
.removeClass(SN.C.S.Processing)
.find('.submit')
.removeAttr(SN.C.S.Disabled)
.removeClass(SN.C.S.Disabled);
}
});
}
};
$(document).ready(function () {
QnA.init();
});