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

Side by Side Diff: polymer_0.5.0/bower_components/core-ajax/demo-progress.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../webcomponentsjs/webcomponents.js" debug></script>
5 <meta charset="utf-8">
6 <title>Race condition</title>
7 </head>
8 <body>
9 <link rel="import" href="core-ajax.html">
10 <link rel="import" href="../paper-progress/paper-progress.html">
11 <polymer-element name="progress-test">
12 <template>
13 <core-ajax
14 id="ajax" auto
15 url="http://httpbin.org/drip"
16 params="{{ {numbytes: numbytes, duration:5} }}"
17 response="{{response}}"
18 progress="{{progress}}"
19 loading="{{loading}}"
20 ></core-ajax>
21
22 <!--
23 Ordinarily you'd gate on progress.lengthComputable, but we know the
24 length in this case (and httpbin sadly doesn't return a
25 Content-Length header for this requesthere).
26
27 https://github.com/kennethreitz/httpbin/pull/160
28 -->
29 <div>
30 <button on-click="{{restart}}">Restart</button>
31 <template if="{{loading}}">
32 Loading...
33 </template>
34 <template if="{{!loading}}">
35 Loaded!
36 </template>
37 </div>
38 <template if="{{loading && progress.loaded}}">
39 <paper-progress
40 value="{{progress.loaded}}"
41 min="0"
42 max="{{numbytes}}">
43 </paper-progress><br>
44 </template>
45 </template>
46 <script>
47 Polymer('progress-test', {
48 loading: true,
49 i: 0,
50 numbytes: 1000,
51 pretty: function(i) {
52 return JSON.stringify(i, null, 2);
53 },
54 restart: function() {
55 this.$.ajax.abort();
56 this.$.ajax.go();
57 }
58 });
59 </script>
60
61 </polymer-element>
62
63 <progress-test></progress-test>
64 </body>
65 </html>
OLDNEW
« no previous file with comments | « polymer_0.5.0/bower_components/core-ajax/demo.html ('k') | polymer_0.5.0/bower_components/core-ajax/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698