This commit is contained in:
parent
5302e6ca99
commit
b0f7f04ba6
14
.drone.yml
14
.drone.yml
@ -6,8 +6,20 @@ steps:
|
|||||||
image: composer
|
image: composer
|
||||||
commands:
|
commands:
|
||||||
- composer install
|
- composer install
|
||||||
|
- name: cleanup
|
||||||
|
image: php:8.1
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y git zip
|
||||||
|
- curl -L https://phar.phpunit.de/phpunit.phar -o /usr/local/bin/phpunit
|
||||||
|
- curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /usr/local/bin/phpcs
|
||||||
|
- curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o /usr/local/bin/phpcbf
|
||||||
|
- chmod +x /usr/local/bin/phpunit
|
||||||
|
- chmod +x /usr/local/bin/phpcs
|
||||||
|
- chmod +x /usr/local/bin/phpcbf
|
||||||
|
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
- phpcs -n --standard=PSR2 .
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: php:8.1
|
image: php:8.1
|
||||||
commands:
|
commands:
|
||||||
- vendor/bin/phpunit --configuration config.xml
|
- vendor/bin/phpunit
|
||||||
|
@ -16,5 +16,5 @@ Installiere Abhängigkeiten
|
|||||||
> make install
|
> make install
|
||||||
|
|
||||||
Starte MySQL-Server:
|
Starte MySQL-Server:
|
||||||
> docker compose up
|
> docker compose up
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@ exports.FetchStream = FetchStream;
|
|||||||
exports.CookieJar = CookieJar;
|
exports.CookieJar = CookieJar;
|
||||||
exports.fetchUrl = fetchUrl;
|
exports.fetchUrl = fetchUrl;
|
||||||
|
|
||||||
function FetchStream(url, options)
|
function FetchStream(url, options) {
|
||||||
{
|
|
||||||
Stream.call(this);
|
Stream.call(this);
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@ -173,7 +172,7 @@ FetchStream.prototype.parseUrl = function (url) {
|
|||||||
path: urlparts.pathname + (urlparts.search || '') || '/',
|
path: urlparts.pathname + (urlparts.search || '') || '/',
|
||||||
method: this.options.method,
|
method: this.options.method,
|
||||||
rejectUnauthorized: this.options.rejectUnauthorized
|
rejectUnauthorized: this.options.rejectUnauthorized
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (urlparts.protocol) {
|
switch (urlparts.protocol) {
|
||||||
case 'https:':
|
case 'https:':
|
||||||
@ -186,17 +185,17 @@ FetchStream.prototype.parseUrl = function (url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (transport === https) {
|
if (transport === https) {
|
||||||
if ('agentHttps' in this.options) {
|
if('agentHttps' in this.options){
|
||||||
urloptions.agent = this.options.agentHttps;
|
urloptions.agent = this.options.agentHttps;
|
||||||
}
|
}
|
||||||
if ('agent' in this.options) {
|
if('agent' in this.options){
|
||||||
urloptions.agent = this.options.agent;
|
urloptions.agent = this.options.agent;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ('agentHttp' in this.options) {
|
if('agentHttp' in this.options){
|
||||||
urloptions.agent = this.options.agentHttp;
|
urloptions.agent = this.options.agentHttp;
|
||||||
}
|
}
|
||||||
if ('agent' in this.options) {
|
if('agent' in this.options){
|
||||||
urloptions.agent = this.options.agent;
|
urloptions.agent = this.options.agent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,8 +382,7 @@ FetchStream.prototype._runStream = function (url_data, url) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function fetchUrl(url, options, callback)
|
function fetchUrl(url, options, callback) {
|
||||||
{
|
|
||||||
if (!callback && typeof options === 'function') {
|
if (!callback && typeof options === 'function') {
|
||||||
callback = options;
|
callback = options;
|
||||||
options = undefined;
|
options = undefined;
|
||||||
@ -455,8 +453,7 @@ function fetchUrl(url, options, callback)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _parseContentType(str)
|
function _parseContentType(str) {
|
||||||
{
|
|
||||||
if (!str) {
|
if (!str) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -479,8 +476,7 @@ function _parseContentType(str)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function _findHTMLCharset(htmlbuffer)
|
function _findHTMLCharset(htmlbuffer) {
|
||||||
{
|
|
||||||
|
|
||||||
var body = htmlbuffer.toString('ascii'),
|
var body = htmlbuffer.toString('ascii'),
|
||||||
input, meta, charset;
|
input, meta, charset;
|
||||||
|
@ -1,26 +1,22 @@
|
|||||||
var initParameters = {};
|
var initParameters = {};
|
||||||
var entrypoint = null;
|
var entrypoint = null;
|
||||||
|
|
||||||
function onEditQuery(newQuery)
|
function onEditQuery(newQuery) {
|
||||||
{
|
|
||||||
initParameters.query = newQuery;
|
initParameters.query = newQuery;
|
||||||
updateURL();
|
updateURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEditVariables(newVariables)
|
function onEditVariables(newVariables) {
|
||||||
{
|
|
||||||
initParameters.variables = newVariables;
|
initParameters.variables = newVariables;
|
||||||
updateURL();
|
updateURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEditOperationName(newOperationName)
|
function onEditOperationName(newOperationName) {
|
||||||
{
|
|
||||||
initParameters.operationName = newOperationName;
|
initParameters.operationName = newOperationName;
|
||||||
updateURL();
|
updateURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateURL()
|
function updateURL() {
|
||||||
{
|
|
||||||
var newSearch = '?' + Object.keys(initParameters).filter(function (key) {
|
var newSearch = '?' + Object.keys(initParameters).filter(function (key) {
|
||||||
return Boolean(initParameters[key]);
|
return Boolean(initParameters[key]);
|
||||||
}).map(function (key) {
|
}).map(function (key) {
|
||||||
@ -29,8 +25,7 @@ function updateURL()
|
|||||||
history.replaceState(null, null, newSearch);
|
history.replaceState(null, null, newSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
function graphQLFetcher(graphQLParams)
|
function graphQLFetcher(graphQLParams) {
|
||||||
{
|
|
||||||
return fetch(entrypoint, {
|
return fetch(entrypoint, {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
@ -50,7 +45,7 @@ function graphQLFetcher(graphQLParams)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function() {
|
||||||
var data = JSON.parse(document.getElementById('graphiql-data').innerText);
|
var data = JSON.parse(document.getElementById('graphiql-data').innerText);
|
||||||
entrypoint = data.entrypoint;
|
entrypoint = data.entrypoint;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
window.addEventListener('load', function (event) {
|
window.addEventListener('load', function(event) {
|
||||||
var loadingWrapper = document.getElementById('loading-wrapper');
|
var loadingWrapper = document.getElementById('loading-wrapper');
|
||||||
loadingWrapper.classList.add('fadeOut');
|
loadingWrapper.classList.add('fadeOut');
|
||||||
|
|
||||||
|
@ -1,22 +1,18 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function() {
|
||||||
manageWebbyDisplay();
|
manageWebbyDisplay();
|
||||||
|
|
||||||
new MutationObserver(function (mutations, self) {
|
new MutationObserver(function (mutations, self) {
|
||||||
const op = document.getElementById(`operations-${data.shortName}-${data.operationId}`);
|
const op = document.getElementById(`operations-${data.shortName}-${data.operationId}`);
|
||||||
if (!op) {
|
if (!op) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.disconnect();
|
self.disconnect();
|
||||||
|
|
||||||
op.querySelector('.opblock-summary').click();
|
op.querySelector('.opblock-summary').click();
|
||||||
const tryOutObserver = new MutationObserver(function (mutations, self) {
|
const tryOutObserver = new MutationObserver(function (mutations, self) {
|
||||||
const tryOut = op.querySelector('.try-out__btn');
|
const tryOut = op.querySelector('.try-out__btn');
|
||||||
if (!tryOut) {
|
if (!tryOut) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.disconnect();
|
self.disconnect();
|
||||||
|
|
||||||
@ -35,7 +31,7 @@ window.onload = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait input values to be populated before executing the query
|
// Wait input values to be populated before executing the query
|
||||||
setTimeout(function () {
|
setTimeout(function(){
|
||||||
op.querySelector('.execute').click();
|
op.querySelector('.execute').click();
|
||||||
op.scrollIntoView();
|
op.scrollIntoView();
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -75,12 +71,10 @@ window.onload = function () {
|
|||||||
// Adapted from https://github.com/vitalyq/react-trigger-change/blob/master/lib/change.js
|
// Adapted from https://github.com/vitalyq/react-trigger-change/blob/master/lib/change.js
|
||||||
// Copyright (c) 2017 Vitaly Kuznetsov
|
// Copyright (c) 2017 Vitaly Kuznetsov
|
||||||
// MIT License
|
// MIT License
|
||||||
function reactTriggerChange(node)
|
function reactTriggerChange(node) {
|
||||||
{
|
|
||||||
// Do not try to delete non-configurable properties.
|
// Do not try to delete non-configurable properties.
|
||||||
// Value and checked properties on DOM elements are non-configurable in PhantomJS.
|
// Value and checked properties on DOM elements are non-configurable in PhantomJS.
|
||||||
function deletePropertySafe(elem, prop)
|
function deletePropertySafe(elem, prop) {
|
||||||
{
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(elem, prop);
|
const desc = Object.getOwnPropertyDescriptor(elem, prop);
|
||||||
if (desc && desc.configurable) {
|
if (desc && desc.configurable) {
|
||||||
delete elem[prop];
|
delete elem[prop];
|
||||||
@ -135,12 +129,9 @@ window.onload = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function manageWebbyDisplay()
|
function manageWebbyDisplay() {
|
||||||
{
|
|
||||||
const webby = document.getElementsByClassName('webby')[0];
|
const webby = document.getElementsByClassName('webby')[0];
|
||||||
if (!webby) {
|
if (!webby) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const web = document.getElementsByClassName('web')[0];
|
const web = document.getElementsByClassName('web')[0];
|
||||||
webby.classList.add('calm');
|
webby.classList.add('calm');
|
||||||
|
Loading…
Reference in New Issue
Block a user