Skip to content

Commit 3c192b1

Browse files
committed
Update to html-doc-framework 0.2.1.
1 parent 546c16f commit 3c192b1

34 files changed

+1141
-2369
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "core-action-icons",
33
"homepage": "https://github.com/Polymer/core-action-icons",
4-
"version": "0.2.3",
5-
"_release": "0.2.3",
4+
"version": "0.2.4",
5+
"_release": "0.2.4",
66
"_resolution": {
77
"type": "version",
8-
"tag": "0.2.3",
9-
"commit": "2dbce5513e3332498bd8b7838ba5f26b8579db92"
8+
"tag": "0.2.4",
9+
"commit": "ad77cdb093594f1b5a8e62fedd0885f531b48859"
1010
},
1111
"_source": "git://github.com/Polymer/core-action-icons.git",
12-
"_target": "0.2.3",
12+
"_target": "0.2.4",
1313
"_originalSource": "Polymer/core-action-icons"
1414
}

bower_components/core-action-icons/action-icons.svg

-1,352
This file was deleted.

bower_components/core-ajax/.bower.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"name": "core-ajax",
33
"private": true,
44
"dependencies": {
5-
"polymer": "Polymer/polymer#0.2.3"
5+
"polymer": "Polymer/polymer#0.2.4"
66
},
7-
"version": "0.2.3",
7+
"version": "0.2.4",
88
"homepage": "https://github.com/Polymer/core-ajax",
9-
"_release": "0.2.3",
9+
"_release": "0.2.4",
1010
"_resolution": {
1111
"type": "version",
12-
"tag": "0.2.3",
13-
"commit": "86ec30d097037ed3699556567bae6b09b553ce51"
12+
"tag": "0.2.4",
13+
"commit": "5718fcbbc4e9770de93e676ea57f40afac0d8c82"
1414
},
1515
"_source": "git://github.com/Polymer/core-ajax.git",
16-
"_target": "0.2.3",
16+
"_target": "0.2.4",
1717
"_originalSource": "Polymer/core-ajax"
1818
}

bower_components/core-ajax/bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "core-ajax",
33
"private": true,
44
"dependencies": {
5-
"polymer": "Polymer/polymer#0.2.3"
5+
"polymer": "Polymer/polymer#0.2.4"
66
},
7-
"version": "0.2.3"
7+
"version": "0.2.4"
88
}

bower_components/core-ajax/core-ajax.html

+24-9
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@
3131
@status beta
3232
@homepage github.io
3333
-->
34-
3534
<link rel="import" href="core-xhr.html">
36-
3735
<polymer-element name="core-ajax" attributes="url handleAs auto params response method headers body contentType withCredentials">
38-
3936
<script>
4037

4138
Polymer('core-ajax', {
@@ -77,6 +74,12 @@
7774
* `xml`: uses `XHR.responseXML`.
7875
*
7976
* `json`: uses `XHR.responseText` parsed as JSON.
77+
*
78+
* `arraybuffer`: uses `XHR.response`.
79+
*
80+
* `blob`: uses `XHR.response`.
81+
*
82+
* `document`: uses `XHR.response`.
8083
*
8184
* @attribute handleAs
8285
* @type string
@@ -226,6 +229,18 @@
226229
}
227230
},
228231

232+
documentHandler: function(xhr) {
233+
return xhr.response;
234+
},
235+
236+
blobHandler: function(xhr) {
237+
return xhr.response;
238+
},
239+
240+
arraybufferHandler: function(xhr) {
241+
return xhr.response;
242+
},
243+
229244
urlChanged: function() {
230245
if (!this.handleAs) {
231246
var ext = String(this.url).split('.').pop();
@@ -262,10 +277,8 @@
262277
*/
263278
go: function() {
264279
var args = this.xhrArgs || {};
265-
// TODO(sjmiles): alternatively, we could force POST if body is set
266-
if (this.method === 'POST') {
267-
args.body = this.body || args.body;
268-
}
280+
// TODO(sjmiles): we may want XHR to default to POST if body is set
281+
args.body = this.body || args.body;
269282
args.params = this.params || args.params;
270283
if (args.params && typeof(args.params) == 'string') {
271284
args.params = JSON.parse(args.params);
@@ -277,7 +290,10 @@
277290
if (this.contentType) {
278291
args.headers['content-type'] = this.contentType;
279292
}
280-
293+
if (this.handleAs === 'arraybuffer' || this.handleAs === 'blob' ||
294+
this.handleAs === 'document') {
295+
args.responseType = this.handleAs;
296+
}
281297
args.withCredentials = this.withCredentials;
282298
args.callback = this.receive.bind(this);
283299
args.url = this.url;
@@ -288,5 +304,4 @@
288304
});
289305

290306
</script>
291-
292307
</polymer-element>

bower_components/core-ajax/core-xhr.html

+40-27
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,6 @@
3838

3939
Polymer('core-xhr', {
4040

41-
makeReadyStateHandler: function(xhr, callback) {
42-
xhr.onreadystatechange = function() {
43-
if (xhr.readyState == 4) {
44-
callback && callback.call(null, xhr.response, xhr);
45-
}
46-
};
47-
},
48-
49-
setRequestHeaders: function(xhr, headers) {
50-
if (headers) {
51-
for (var name in headers) {
52-
xhr.setRequestHeader(name, headers[name]);
53-
}
54-
}
55-
},
56-
57-
toQueryString: function(params) {
58-
var r = [];
59-
for (var n in params) {
60-
var v = params[n];
61-
n = encodeURIComponent(n);
62-
r.push(v == null ? n : (n + '=' + encodeURIComponent(v)));
63-
}
64-
return r.join('&');
65-
},
66-
6741
/**
6842
* Sends a HTTP request to the server and returns the XHR object.
6943
*
@@ -85,10 +59,13 @@
8559
var url = options.url;
8660
var method = options.method || 'GET';
8761
var async = !options.sync;
62+
//
8863
var params = this.toQueryString(options.params);
8964
if (params && method == 'GET') {
9065
url += (url.indexOf('?') > 0 ? '&' : '?') + params;
9166
}
67+
var xhrParams = this.isBodyMethod(method) ? (options.body || params) : null;
68+
//
9269
xhr.open(method, url, async);
9370
if (options.responseType) {
9471
xhr.responseType = options.responseType;
@@ -98,11 +75,47 @@
9875
}
9976
this.makeReadyStateHandler(xhr, options.callback);
10077
this.setRequestHeaders(xhr, options.headers);
101-
xhr.send(method == 'POST' ? (options.body || params) : null);
78+
xhr.send(xhrParams);
10279
if (!async) {
10380
xhr.onreadystatechange(xhr);
10481
}
10582
return xhr;
83+
},
84+
85+
toQueryString: function(params) {
86+
var r = [];
87+
for (var n in params) {
88+
var v = params[n];
89+
n = encodeURIComponent(n);
90+
r.push(v == null ? n : (n + '=' + encodeURIComponent(v)));
91+
}
92+
return r.join('&');
93+
},
94+
95+
isBodyMethod: function(method) {
96+
return this.bodyMethods[(method || '').toUpperCase()];
97+
},
98+
99+
bodyMethods: {
100+
POST: 1,
101+
PUT: 1,
102+
DELETE: 1
103+
},
104+
105+
makeReadyStateHandler: function(xhr, callback) {
106+
xhr.onreadystatechange = function() {
107+
if (xhr.readyState == 4) {
108+
callback && callback.call(null, xhr.response, xhr);
109+
}
110+
};
111+
},
112+
113+
setRequestHeaders: function(xhr, headers) {
114+
if (headers) {
115+
for (var name in headers) {
116+
xhr.setRequestHeader(name, headers[name]);
117+
}
118+
}
106119
}
107120

108121
});

bower_components/core-component-page/.bower.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"name": "core-component-page",
33
"private": true,
44
"dependencies": {
5-
"platform": "Polymer/platform#0.2.3",
6-
"core-action-icons": "Polymer/core-action-icons#0.2.3"
5+
"platform": "Polymer/platform#0.2.4",
6+
"core-action-icons": "Polymer/core-action-icons#0.2.4"
77
},
8-
"version": "0.2.3",
8+
"version": "0.2.4",
99
"homepage": "https://github.com/Polymer/core-component-page",
10-
"_release": "0.2.3",
10+
"_release": "0.2.4",
1111
"_resolution": {
1212
"type": "version",
13-
"tag": "0.2.3",
14-
"commit": "37d68bb980da41a03aa08c2a59ad3ccf0f42cf10"
13+
"tag": "0.2.4",
14+
"commit": "c91ca328673cf1d1a89a0c614ca22a04e4b644b8"
1515
},
1616
"_source": "git://github.com/Polymer/core-component-page.git",
17-
"_target": "0.2.3",
17+
"_target": "0.2.4",
1818
"_originalSource": "Polymer/core-component-page"
1919
}

bower_components/core-component-page/bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "core-component-page",
33
"private": true,
44
"dependencies": {
5-
"platform": "Polymer/platform#0.2.3",
6-
"core-action-icons": "Polymer/core-action-icons#0.2.3"
5+
"platform": "Polymer/platform#0.2.4",
6+
"core-action-icons": "Polymer/core-action-icons#0.2.4"
77
},
8-
"version": "0.2.3"
8+
"version": "0.2.4"
99
}

0 commit comments

Comments
 (0)