Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
make 'value' attribute, add metadata, update landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Dec 13, 2013
1 parent 289e14e commit 1fea71c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 221 deletions.
7 changes: 5 additions & 2 deletions code-mirror.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script src="codemirror-3.14/mode/vbscript/vbscript.js"></script>
<script src="codemirror-3.14/mode/htmlmixed/htmlmixed.js"></script>

<polymer-element name="code-mirror">
<polymer-element name="code-mirror" attributes="value">
<template>
<link rel="stylesheet" href="codemirror-3.14/lib/codemirror.css">
<link href="codemirror-3.14/theme/ambiance.css" rel="stylesheet" />
Expand All @@ -32,7 +32,7 @@
skin: '',
ready: function() {
this.mirror = CodeMirror(this.shadowRoot, {
value: "<polymer-element name=\"my-element\">\n\t<template></template>\n\t<script>\n\t\tPolymer('my-element', {\n\t\t});\n\t</scr" + 'ipt>\n</polymer-element>',
value: this.textContent,
mode: 'htmlmixed',
//theme: "solarized light",
theme: 'ambiance',
Expand All @@ -42,6 +42,9 @@
},
refresh: function() {
this.mirror.refresh();
},
valueChanged: function() {
this.mirror.setValue(this.value);
}
});
</script>
Expand Down
134 changes: 35 additions & 99 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>polymer api</title>
Expand All @@ -8,121 +8,57 @@
white-space: nowrap;
overflow: hidden;
}
[nobowager] [ifnobowager], [noviewer] [ifnoviewer] {
[noviewer] [ifnoviewer] {
display: block;
}
[detector], [ifnobowager], [ifnoviewer], [nobowager] [ifbowager], [noviewer] [ifviewer] {
[detector], [ifnoviewer], [noviewer] [ifviewer] {
display: none;
}
img {
vertical-align: middle;
height: 22px;
padding: 0 4px 2px 0;
}
div {
display: inline-block;
}
h2 {
display: inline-block;
margin: 0px 6px;
vertical-align: middle;
}
.choiceB, .choiceC {
font-size: 0.8em;
display: inline-block;
white-space: nowrap;
padding: 0px 16px;
text-align: center;
text-transform: uppercase;
color: #eee;
border-radius: 23px;
}
.choiceB {
background-color: #BF8A30;
}
.choiceC {
background-color: #284B7E;
}
.choiceB:hover {
background-color: #C7F83E;
color: #222;
}
.choiceC:hover {
background-color: #C7F83E;
color: #222;
[ifviewer], [ifnoviewer] {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
a {
text-decoration: none;
iframe {
border: none;
margin: 0;
width: 100%;
height: 100%;
}
polymer-doc-viewer {
display: block;
#remote {
position: absolute;
top: 56px;
top: 0;
right: 0;
bottom: 0px;
left: 0;
border: 1px solid silver;
}
</style>
<script src="../platform/platform.js"></script>
<link rel="import" href="../polymer-doc-viewer/polymer-doc-viewer.html">
<link rel="import" href="../polymer-home-page/polymer-home-page.html">
</head>
<body>
<!-- detection-->
<img detector src="../Bowager/static/bowager-logo.png" onerror="nobowager()">
<img detector src="../polymer-doc-viewer/bowager-logo.png" onerror="noviewer()">
<img detector src="../polymer-home-page/bowager-logo.png" onerror="noviewer()">
<polymer-home-page ifviewer></polymer-home-page>
<div ifnoviewer>
<span id="remote">[remote]</span>
<iframe></iframe>
</div>
<!-- -->
<script>
function nobowager() {
document.body.setAttribute('nobowager', '');
}
var remoteDocs = 'http://turbogadgetry.com/bowertopia/components/';
// if no local info viewer, load it remotely
function noviewer() {
document.body.setAttribute('noviewer', '');
var path = location.pathname.split('/');
var module = path.pop() || path.pop();
document.querySelector('iframe').src = remoteDocs + module;
document.querySelector('title').textContent = module;
}
// for testing only
window.addEventListener('load', function() {
var opts = window.location.search;
if (opts.indexOf('viewer') >= 0) {
document.body.removeAttribute('noviewer');
}
if (opts.indexOf('bowager') >= 0) {
document.body.removeAttribute('nobowager');
}
if (opts.indexOf('noviewer') >= 0) {
document.body.setAttribute('noviewer', '');
}
if (opts.indexOf('nobowager') >= 0) {
document.body.setAttribute('nobowager', '');
}
});
</script>
<!-- -->
<h2>polymer api</h2>
<div ifnoviewer>
<p>See the <a target="_blank" href="http://itch.selfip.net/bowertopia/components/polymer-ajax/doc.html">remote docs.</a></p>
<p>Play with this element in the <a href="http://itch.selfip.net/bowertopia/designer/?element=polymer-ajax">remote sandbox.</a></p>
<p>See the <a target="_blank" href="smoke.html">smoke test.</a></p>
<hr>
<p>To access these tools locally, install the <code>polymer-catalog-tools</code> package.</p>
<code>bower install Polymer/polymer-catalog-tools</code>
<br>
<p ifbowager>
Or use <a ifbowager target="_blank" href="foo">one-click install <img src="../Bowager/static/bowager-logo.png" title="install via bowager"></a>
</p>
<p ifnobowager>
Pro tip: consider using Bowager for web-enabled installs.
</p>
</div>
<h2 ifviewer>
<a class="choiceB" target="_blank" id="sandbox">sandbox</a>
<a class="choiceC" target="_blank" href="smoke.html">smoke test</a>
<polymer-doc-viewer url="docs.json"></polymer-doc-viewer>
</h2>
<script>
var pathName = location.pathname.split('/');
moduleName = pathName.pop() || pathName.pop();
document.querySelector('title').textContent = moduleName;
document.querySelector('h2').textContent = moduleName;
document.querySelector('#sandbox').href = '../../designer/?element=' + moduleName;
var opts = window.location.search;
if (opts.indexOf('noviewer') >= 0) {
noviewer();
}
</script>
</body>
</html>
</html>
13 changes: 13 additions & 0 deletions metadata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<x-meta id="code-mirror" label="code-mirror">
<template>
<code-mirror style="width: 400px;height: 300px;">&lt;polymer-element name='my-element'>
&lt;template>&lt;/template>
&lt;script>
Polymer('my-element', {});
&lt;/script>
&lt;/polymer-element></code-mirror>
</template>
<template id="imports">
<link rel="import" href="code-mirror.html">
</template>
</x-meta>
136 changes: 16 additions & 120 deletions smoke.html
Original file line number Diff line number Diff line change
@@ -1,130 +1,26 @@
<!DOCTYPE html>
<!doctype html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
<title>polymer-flex-layout</title>
<script src="../../polymer/polymer.js"></script>
<link rel="import" href="polymer-flex-layout.html">
<link rel="import" href="polymer-flex-panel.html">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../platform/platform.js"></script>
<link rel="import" href="code-mirror.html">
<style>
body {
font-size: 20px;
}

flex-css, flex-container, flex-nonvisual {
height: 300px;
position: relative;
height: 500px;
width: 500px;
}
</style>
</head>
<body>
<polymer-element name="flex-css">
<template>
<link rel="stylesheet" href="polymer-flex-layout.css">
<style>
div {
box-sizing: border-box;
-moz-box-sizing: border-box;
border: 2px solid #ccc;
}
</style>
<div class="flexbox" flex>
<div>Hi I'm some content</div>
<div class="flexbox column" flex>
<div class="flexbox align-center">
<h3>Title</h3>
<button>hello</button>
</div>
<div class="flexbox" flex>
<div flex>Main content</div>
<div>Sidebar content</div>
</div>
<div>Some more stuffs...</div>
<div class="flexbox justify-end">
<b>Footer</b>
</div>
</div>
<div>A last bit, like a panel</div>
</div>
</template>
<script>
Polymer('flex-css', {
ready: function() {
this.classList.add('flexbox');
}
});
</script>
</polymer-element>

<polymer-element name="flex-container" noscript extends="polymer-flex-panel">
<template>
<style>
div, polymer-flex-panel {
box-sizing: border-box;
-moz-box-sizing: border-box;
border: 2px solid #ccc;
}
</style>
<div>Hi I'm some content</div>
<polymer-flex-panel vertical flex>
<polymer-flex-panel align="center">
<h3>Title</h3>
<button>hello</button>
</polymer-flex-panel>
<polymer-flex-panel flex>
<div flex>Main content</div>
<div>Sidebar content</div>
</polymer-flex-panel>
<div>Some more stuffs...</div>
<polymer-flex-panel justify="end">
<b>Footer</b>
</polymer-flex-panel>
</polymer-flex-panel>
<div>A last bit, like a panel</div>
</template>
</polymer-element>

<polymer-element name="flex-nonvisual" noscript>
<template>
<style>
div {
box-sizing: border-box;
-moz-box-sizing: border-box;
border: 2px solid #ccc;
}
</style>
<polymer-flex-layout></polymer-flex-layout>
<div flex>
<polymer-flex-layout></polymer-flex-layout>
<div>Hi I'm some content</div>
<div flex>
<polymer-flex-layout vertical></polymer-flex-layout>
<div>
<polymer-flex-layout align="center"></polymer-flex-layout>
<h3>Title</h3>
<button>hello</button>
</div>
<div flex>
<polymer-flex-layout></polymer-flex-layout>
<div flex>Main content</div>
<div>Sidebar content</div>
</div>
<div>Some more stuffs...</div>
<div>
<polymer-flex-layout justify="end"></polymer-flex-layout>
<b>Footer</b>
</div>
</div>
<div>A last bit, like a panel</div>
</div>
</template>
</polymer-element>

<h3>polymer-flex-layout.css</h3>
<flex-css></flex-css>
<br>
<h3>polymer-flex-panel element</h3>
<flex-container></flex-container>
<br>
<h3>polymer-flex-layout element</h3>
<flex-nonvisual></flex-nonvisual>
<code-mirror>function test() {
var x = true;
}</code-mirror>
</body>
</html>

0 comments on commit 1fea71c

Please sign in to comment.