Initial commit

This commit is contained in:
2020-10-07 10:37:15 +02:00
commit ce5f440392
28157 changed files with 4429172 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
var Guzzle = Guzzle || {};
Guzzle.addClass = function(el, cssClass) { el.classList.add(cssClass); };
Guzzle.hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
Guzzle.removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
Guzzle.createTabs = function() {
var tabGroups = document.querySelectorAll('.sf-tabs');
/* create the tab navigation for each group of tabs */
for (var i = 0; i < tabGroups.length; i++) {
var tabs = tabGroups[i].querySelectorAll('.tab');
var tabNavigation = document.createElement('ul');
tabNavigation.className = 'tab-navigation';
for (var j = 0; j < tabs.length; j++) {
var tabId = 'tab-' + i + '-' + j;
var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
var tabNavigationItem = document.createElement('li');
tabNavigationItem.setAttribute('data-tab-id', tabId);
if (j == 0) {
Guzzle.addClass(tabNavigationItem, 'active');
}
if (Guzzle.hasClass(tabs[j], 'disabled')) {
Guzzle.addClass(tabNavigationItem, 'disabled');
}
tabNavigationItem.innerHTML = tabTitle;
tabNavigation.appendChild(tabNavigationItem);
var tabContent = tabs[j].querySelector('.tab-content');
tabContent.parentElement.setAttribute('id', tabId);
}
tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
}
/* display the active tab and add the 'click' event listeners */
for (i = 0; i < tabGroups.length; i++) {
tabNavigation = tabGroups[i].querySelectorAll('.tab-navigation li');
for (j = 0; j < tabNavigation.length; j++) {
tabId = tabNavigation[j].getAttribute('data-tab-id');
document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
if (Guzzle.hasClass(tabNavigation[j], 'active')) {
document.getElementById(tabId).className = 'block';
} else {
document.getElementById(tabId).className = 'hidden';
}
tabNavigation[j].addEventListener('click', function (e) {
var activeTab = e.target || e.srcElement;
/* needed because when the tab contains HTML contents, user can click */
/* on any of those elements instead of their parent '<li>' element */
while (activeTab.tagName.toLowerCase() !== 'li') {
activeTab = activeTab.parentNode;
}
/* get the full list of tabs through the parent of the active tab element */
var tabNavigation = activeTab.parentNode.children;
for (var k = 0; k < tabNavigation.length; k++) {
var tabId = tabNavigation[k].getAttribute('data-tab-id');
document.getElementById(tabId).className = 'hidden';
Guzzle.removeClass(tabNavigation[k], 'active');
}
Guzzle.addClass(activeTab, 'active');
var activeTabId = activeTab.getAttribute('data-tab-id');
document.getElementById(activeTabId).className = 'block';
});
}
}
};

View File

@@ -0,0 +1,26 @@
var Guzzle = Guzzle || {};
Guzzle.accordion = function () {
var elements = document.querySelectorAll('.accordion .accordion-header');
for (var i = 0, l = elements.length, element; i < l, element = elements[i]; i++) {
element.addEventListener('click', function () {
this
.parentNode
.getElementsByClassName('accordion-content')[0]
.classList
.toggle('expanded')
;
});
var links = element.getElementsByTagName('a');
for (var j = 0, k = links.length, link; j < k, link = links[j]; j++) {
link.addEventListener('click', function (e) {
e.stopPropagation();
});
}
}
};
document.addEventListener('DOMContentLoaded', Guzzle.accordion, false);

View File

@@ -0,0 +1,6 @@
Prism.languages.json = {
'delimiter': /(\{|\}|\[|\])/g,
'boolean': /(true|false)/g,
'string': /("[^"]*")/g,
'number': /(-?\d+(\.\d+)?)/g
}

View File

@@ -0,0 +1 @@
Prism.languages.xml = Prism.languages.extend('markup');

View File

@@ -0,0 +1,36 @@
.tab-navigation
margin: 0 0 1em 0
padding: 0
li
background: #FFF
border: 1px solid #DDD
color: #444
cursor: pointer
display: inline-block
font-size: 16px
margin: 0 0 0 -1px
padding: .5em .75em
z-index: 1
&:hover
background: #EEE
&.disabled
background: #F5F5F5
color: #999
&.active
background: #666
border-color: #666
color: #FAFAFA
z-index: 1100
& > *:first-child
margin-top: 0
.block
display: block
.hidden
display: none

View File

@@ -0,0 +1,6 @@
@import "modules/variables"
@import "modules/mixins"
@import "modules/progressbar"
@import "modules/accordion"
@import "modules/badge"
@import "modules/screen"

View File

@@ -0,0 +1,10 @@
.accordion
.accordion-header
cursor: pointer
.accordion-content
display: none
transition: all 1s ease
&.expanded
display: block

View File

@@ -0,0 +1,20 @@
.badge
padding: 2px 9px
font-size: 0.75rem
font-weight: bold
white-space: nowrap
color: #ffffff
background-color: #999999
-webkit-border-radius: 9px
-moz-border-radius: 9px
border-radius: 9px
&.cache
&.hit
background-color: map-get($status-colors, success)
&.miss
background-color: map-get($status-colors, informational)
@each $status in server-error, client-error, redirection, success, informational, unknown
&.status-code.#{$status}
background-color: map-get($status-colors, $status)

View File

@@ -0,0 +1,2 @@
=make-stripes($color, $angle: 120deg, $width: 10px, $darken: 10%)
background: repeating-linear-gradient($angle, $color, $color 10px, darken($color, $darken) $width, darken($color, $darken) 2 * $width)

View File

@@ -0,0 +1,17 @@
.progress
background-color: $border-color
padding: 1px
height: 20px
.progress-bar
height: 20px
float: left
text-align: center
color: white
@each $level, $color in (warning: $warning, success: $success)
.progress-bar-#{$level}
background: $color
&.progress-bar-striped
@include make-stripes($color)

View File

@@ -0,0 +1,18 @@
.call
border-style: solid
border-color: $border-color
border-width: 1px 1px 1px 1px
margin: 5px
@each $i, $color in $method-colors
.#{$i}
background-color: $color
color: #fff
a
color: #fff
&:hover
background: lighten($color, 10%)
&>*
padding: 5px

View File

@@ -0,0 +1,12 @@
// Method colors
$error: #d9534f
$warning: #f0ad4e
$success: #5cb85c
$redirect: darken(#428bca, 6.5%)
$info: #5bc0de
$border-color: rgb(224, 224, 224)
//$border-color: #888
$method-colors: (get: #0f6ab4, post: #10a54a, put: #c5862b, delete: #a41e22, patch: #a41ee2, link: #C3D448, unlink: #FF8438, other: #000000)
$status-colors: (server-error: $error, client-error: $warning, redirection: $redirect, success: $success, informational: $info, unknown: $error)