This commit is contained in:
parent
5302e6ca99
commit
b0f7f04ba6
14
.drone.yml
14
.drone.yml
@ -6,8 +6,20 @@ steps:
|
||||
image: composer
|
||||
commands:
|
||||
- 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
|
||||
image: php:8.1
|
||||
commands:
|
||||
- vendor/bin/phpunit --configuration config.xml
|
||||
- vendor/bin/phpunit
|
||||
|
@ -17,8 +17,7 @@ exports.FetchStream = FetchStream;
|
||||
exports.CookieJar = CookieJar;
|
||||
exports.fetchUrl = fetchUrl;
|
||||
|
||||
function FetchStream(url, options)
|
||||
{
|
||||
function FetchStream(url, options) {
|
||||
Stream.call(this);
|
||||
|
||||
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') {
|
||||
callback = options;
|
||||
options = undefined;
|
||||
@ -455,8 +453,7 @@ function fetchUrl(url, options, callback)
|
||||
});
|
||||
}
|
||||
|
||||
function _parseContentType(str)
|
||||
{
|
||||
function _parseContentType(str) {
|
||||
if (!str) {
|
||||
return {};
|
||||
}
|
||||
@ -479,8 +476,7 @@ function _parseContentType(str)
|
||||
};
|
||||
}
|
||||
|
||||
function _findHTMLCharset(htmlbuffer)
|
||||
{
|
||||
function _findHTMLCharset(htmlbuffer) {
|
||||
|
||||
var body = htmlbuffer.toString('ascii'),
|
||||
input, meta, charset;
|
||||
|
@ -1,26 +1,22 @@
|
||||
var initParameters = {};
|
||||
var entrypoint = null;
|
||||
|
||||
function onEditQuery(newQuery)
|
||||
{
|
||||
function onEditQuery(newQuery) {
|
||||
initParameters.query = newQuery;
|
||||
updateURL();
|
||||
}
|
||||
|
||||
function onEditVariables(newVariables)
|
||||
{
|
||||
function onEditVariables(newVariables) {
|
||||
initParameters.variables = newVariables;
|
||||
updateURL();
|
||||
}
|
||||
|
||||
function onEditOperationName(newOperationName)
|
||||
{
|
||||
function onEditOperationName(newOperationName) {
|
||||
initParameters.operationName = newOperationName;
|
||||
updateURL();
|
||||
}
|
||||
|
||||
function updateURL()
|
||||
{
|
||||
function updateURL() {
|
||||
var newSearch = '?' + Object.keys(initParameters).filter(function (key) {
|
||||
return Boolean(initParameters[key]);
|
||||
}).map(function (key) {
|
||||
@ -29,8 +25,7 @@ function updateURL()
|
||||
history.replaceState(null, null, newSearch);
|
||||
}
|
||||
|
||||
function graphQLFetcher(graphQLParams)
|
||||
{
|
||||
function graphQLFetcher(graphQLParams) {
|
||||
return fetch(entrypoint, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
|
@ -5,18 +5,14 @@ window.onload = function () {
|
||||
|
||||
new MutationObserver(function (mutations, self) {
|
||||
const op = document.getElementById(`operations-${data.shortName}-${data.operationId}`);
|
||||
if (!op) {
|
||||
return;
|
||||
}
|
||||
if (!op) return;
|
||||
|
||||
self.disconnect();
|
||||
|
||||
op.querySelector('.opblock-summary').click();
|
||||
const tryOutObserver = new MutationObserver(function (mutations, self) {
|
||||
const tryOut = op.querySelector('.try-out__btn');
|
||||
if (!tryOut) {
|
||||
return;
|
||||
}
|
||||
if (!tryOut) return;
|
||||
|
||||
self.disconnect();
|
||||
|
||||
@ -75,12 +71,10 @@ window.onload = function () {
|
||||
// Adapted from https://github.com/vitalyq/react-trigger-change/blob/master/lib/change.js
|
||||
// Copyright (c) 2017 Vitaly Kuznetsov
|
||||
// MIT License
|
||||
function reactTriggerChange(node)
|
||||
{
|
||||
function reactTriggerChange(node) {
|
||||
// Do not try to delete non-configurable properties.
|
||||
// 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);
|
||||
if (desc && desc.configurable) {
|
||||
delete elem[prop];
|
||||
@ -135,12 +129,9 @@ window.onload = function () {
|
||||
}
|
||||
}
|
||||
|
||||
function manageWebbyDisplay()
|
||||
{
|
||||
function manageWebbyDisplay() {
|
||||
const webby = document.getElementsByClassName('webby')[0];
|
||||
if (!webby) {
|
||||
return;
|
||||
}
|
||||
if (!webby) return;
|
||||
|
||||
const web = document.getElementsByClassName('web')[0];
|
||||
webby.classList.add('calm');
|
||||
|
Loading…
Reference in New Issue
Block a user