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
|
||||||
|
@ -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 || {};
|
||||||
@ -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: {
|
||||||
|
@ -5,18 +5,14 @@ window.onload = function () {
|
|||||||
|
|
||||||
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();
|
||||||
|
|
||||||
@ -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