Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: sky/examples/file-browser.sky

Issue 951673003: Remove outdated examples and framework pieces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/examples/dart-library.sky ('k') | sky/examples/radio.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!mojo mojo:sky_viewer
2 <!--
3 // Copyright 2014 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file.
6 -->
7 <import src="../framework/sky-element/sky-element.sky" as="SkyElement" />
8 <import src="../framework/xmlhttprequest.sky" as="XMLHttpRequest" />
9
10 <sky-element name="file-browser">
11 <template>
12 <style>
13 heading {
14 font-size: 16px;
15 }
16 </style>
17 <heading>File browser for {{ url }}</heading>
18 <template repeat="{{ directories }}">
19 <a href="{{}}">{{}}</a>
20 </template>
21 <template repeat="{{ files }}">
22 <a href="{{}}">{{}}</a>
23 </template>
24 </template>
25 <script>
26 module.exports = class extends SkyElement {
27 created() {
28 this.url = '';
29 this.files = [];
30 this.directories = [];
31 }
32 attached() {
33 this.url = this.ownerDocument.URL;
34 var xhr = new XMLHttpRequest();
35 xhr.open('GET', this.url + '?format=json');
36 xhr.onload = (function() {
37 var listing = JSON.parse(xhr.responseText);
38 this.files = listing.files;
39 this.directories = listing.directories;
40 }).bind(this);
41 xhr.send();
42 }
43 }.register();
44 </script>
45 </sky-element>
OLDNEW
« no previous file with comments | « sky/examples/dart-library.sky ('k') | sky/examples/radio.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698