api-console-assets
Version:
This repo only exists to publish api console components to npm
74 lines (70 loc) • 2.54 kB
HTML
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<title>raml-docs-resource-viewer demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../arc-demo-helpers/raml-demo-page.html">
<link rel="import" href="../../paper-toast/paper-toast.html">
<link rel="import" href="../raml-docs-resource-viewer.html">
<link rel="import" href="api-console-styles.html">
<style>
html,
body {
margin: 0;
padding: 0;
font-family: 'Roboto', 'Noto', sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-size: 14px;
font-weight: 400;
line-height: 20px;
}
raml-docs-resource-viewer {
max-width: 900px;
}
</style>
</head>
<body unresolved>
<template is="dom-bind" id="app">
<raml-demo-page selected-object="{{selected}}" is-resource="{{isRestource}}" path="{{path}}">
<h1>The raml-docs-response-panel element</h1>
<div main>
<template is="dom-if" if="[[isRestource]]" restamp="true">
<raml-docs-resource-viewer on-raml-path-changed="_ramlPathChanged" current-path="[[path]]" raml="[[selected]]"></raml-docs-resource-viewer>
</template>
<p hidden$="[[isRestource]]">Select a resource</p>
</div>
</raml-demo-page>
<paper-toast text="Methods are not supported in this demo." id="noMethods"></paper-toast>
</template>
<script>
var $ = function(selector) {
return document.querySelector(selector);
};
(function(app) {
app._ramlPathChanged = function(e) {
var path = e.detail.path;
var _t = path.split('.');
if (_t[_t.length - 2] === 'methods') {
app.$.noMethods.opened = true;
return;
}
app.path = path;
// app.$.view.scrollIntoView();
};
})($('#app'));
</script>
</body>
</html>