Created
December 12, 2016 17:58
-
-
Save anonymous/cecfac32737d6bdb6bcd3ff8a0fecb33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(afterEl, descriptionUrl){ | |
var fn = function() { | |
console.log('ready') | |
var html = '<a href="#" class="oic-button" data-mode="url" data-source="swagger" data-url="' + descriptionUrl + '"><img src="https://console.rest/github.io/assets/buttons/run_with_blue.svg" style="border: none;" /></a>' | |
var containerTag = document.createElement('div') | |
containerTag.innerHTML = html | |
afterEl.parentNode.insertBefore(containerTag, afterEl.nextSibling) | |
ConsoleRest.bindModalToButtons() | |
} | |
var scriptTag = document.createElement('script') | |
scriptTag.src = 'https://console.rest/github.io/libs/console-rest.js' | |
scriptTag.onload = function() { | |
console.log('loaded script') | |
ConsoleRest.ready.then(fn) | |
loadVisuals() | |
} | |
document.body.appendChild(scriptTag) | |
})( | |
document.getElementById('api-endpoints'), | |
'https://api.apis.guru/v2/specs/instagram.com/1.0.0/swagger.json' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment