Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Version 0.9.13 #710

Merged
merged 13 commits into from

3 participants

@dansilivestru

No description provided.

dansilivestru and others added some commits
@dansilivestru dansilivestru Update doc/CHANGELOG.md
Fixed spelling mistake :(
b525ceb
@brentlintner brentlintner The cross origin XHR proxy does not entirely handle errors (gracefully).
When it was initially created (i.e. re-written) this was an oversight
that was made (as it seemed quite solid). This is not true. Stuff can go
bad (especially if server errors out continually)... so, let's fix it!

There are two ways errors can happen.

1. Synchronously thrown errors when initializing a client request.

Example: passing an invalid URI (i.e. a local '/foo/bar' url) will
cause an exception to be thrown (which could possibly crash the app).

2. Errors during the (async) request itself (notified via error event).

Example: Passing in a URL that fails during DNS lookup will raise an
`error` on the client request object (ex: http://googleeee.com).

Note: Since errors were already captured by `request` and passed
into the callback (as you can see), the XHR proxy already gracefully
handled errors, but that was never taken advantage of when using
`request.pipe`. This cleans that up so it always look for an error
object and responds with a 500 (and error message), if so.
175e93c
@dansilivestru dansilivestru Removed call to widgetConfig.initialize
This was a duplicate call and not needed.
bc8906e
@dansilivestru dansilivestru Added call to console.clear after boot
This was done to remove any console logs that show up
before Ripple is fully booted and can be confusing to the
developer.
f801049
@dansilivestru dansilivestru Merge branch 'console.cleanup' into next cf425a4
@brentlintner brentlintner There is lack of CORS (XHR proxy) support for certain HTTP verbs.
This (presumably) adds support for the rest of the verbs, which were
left out when the proxy was re-written :-( (there definitely could have
been more testing in place for this, alas, resources..).

This fixes GitHub issue:

https://github.com/blackberry/Ripple-UI/issues/693
8462f02
@brentlintner brentlintner The OPTIONS verb was left out in the previous (XHR proxy fix) commit.
It is also an HTTP verb that should be supported by CORS (in the xhr
proxy).

I hastily pushed commit 8462f02
and missed this.
ecd637d
@brentlintner brentlintner Cross origin (JSON based) XHR proxy requests are not forwarded properly.
The bodyParser middleware would parse the JSON properly, however the
`form` option in `request` was being used, and it was sent as a
'application/x-www-form-urlencoded' request. Instead it should be
stringified and set to the `request`'s `body` option.

This fixes another issue pointed out in:

https://github.com/blackberry/Ripple-UI/issues/693
cd8a231
@dansilivestru dansilivestru Added new BB10 device, update manufacturer
Added the Q10 device
Update the Colt (DevAlpha) to the Z10
Removed Cold images
Update manufacturer to BlackBerry from Research In Motion on all
BlackBerry devices
7f0ae22
@dansilivestru dansilivestru Updated to v0.9.13 and changelog 806b702
@dansilivestru dansilivestru Merge branch 'master' into next c2a7d65
@dansilivestru dansilivestru Merged deprecated blobWriter fix and fixed tests
Merged pull request from @maxme
Fixed failing tests for changes made
update the creation of a new Blob to include type setting
ab19cc4
@dansilivestru

And by BlobWriter... I mean BlobBuilder

@brentlintner

Looks good to me. +1. :-)

Yay, new device skins!

@dansilivestru dansilivestru merged commit e238dd5 into master
@brentlintner brentlintner referenced this pull request
Closed

Device.proxy #711

@szuzul

Hi, when can we expect to upload ripple extension to 0.9.13 directly from chrome://extensions/, currently there is only 0.9.12 available ?..

@dansilivestru
@szuzul

That's cool, thanks... I'm also having xhr_proxy error in options and get request in my backbone app.

@dansilivestru
@szuzul

It isn't xhr_proxy error as i can see now. it is something in relation with time out response in case of ripple and require.js... I'll open new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 14, 2013
  1. @dansilivestru

    Update doc/CHANGELOG.md

    dansilivestru authored
    Fixed spelling mistake :(
  2. @brentlintner

    The cross origin XHR proxy does not entirely handle errors (gracefully).

    brentlintner authored
    When it was initially created (i.e. re-written) this was an oversight
    that was made (as it seemed quite solid). This is not true. Stuff can go
    bad (especially if server errors out continually)... so, let's fix it!
    
    There are two ways errors can happen.
    
    1. Synchronously thrown errors when initializing a client request.
    
    Example: passing an invalid URI (i.e. a local '/foo/bar' url) will
    cause an exception to be thrown (which could possibly crash the app).
    
    2. Errors during the (async) request itself (notified via error event).
    
    Example: Passing in a URL that fails during DNS lookup will raise an
    `error` on the client request object (ex: http://googleeee.com).
    
    Note: Since errors were already captured by `request` and passed
    into the callback (as you can see), the XHR proxy already gracefully
    handled errors, but that was never taken advantage of when using
    `request.pipe`. This cleans that up so it always look for an error
    object and responds with a 500 (and error message), if so.
Commits on Jan 17, 2013
  1. @dansilivestru

    Removed call to widgetConfig.initialize

    dansilivestru authored
    This was a duplicate call and not needed.
  2. @dansilivestru

    Added call to console.clear after boot

    dansilivestru authored
    This was done to remove any console logs that show up
    before Ripple is fully booted and can be confusing to the
    developer.
  3. @dansilivestru
  4. @brentlintner

    There is lack of CORS (XHR proxy) support for certain HTTP verbs.

    brentlintner authored
    This (presumably) adds support for the rest of the verbs, which were
    left out when the proxy was re-written :-( (there definitely could have
    been more testing in place for this, alas, resources..).
    
    This fixes GitHub issue:
    
    https://github.com/blackberry/Ripple-UI/issues/693
  5. @brentlintner

    The OPTIONS verb was left out in the previous (XHR proxy fix) commit.

    brentlintner authored
    It is also an HTTP verb that should be supported by CORS (in the xhr
    proxy).
    
    I hastily pushed commit 8462f02
    and missed this.
Commits on Jan 18, 2013
  1. @brentlintner

    Cross origin (JSON based) XHR proxy requests are not forwarded properly.

    brentlintner authored
    The bodyParser middleware would parse the JSON properly, however the
    `form` option in `request` was being used, and it was sent as a
    'application/x-www-form-urlencoded' request. Instead it should be
    stringified and set to the `request`'s `body` option.
    
    This fixes another issue pointed out in:
    
    https://github.com/blackberry/Ripple-UI/issues/693
Commits on Jan 31, 2013
  1. @dansilivestru

    Added new BB10 device, update manufacturer

    dansilivestru authored
    Added the Q10 device
    Update the Colt (DevAlpha) to the Z10
    Removed Cold images
    Update manufacturer to BlackBerry from Research In Motion on all
    BlackBerry devices
  2. @dansilivestru
  3. @dansilivestru
  4. @dansilivestru

    Merged deprecated blobWriter fix and fixed tests

    dansilivestru authored
    Merged pull request from @maxme
    Fixed failing tests for changes made
    update the creation of a new Blob to include type setting
  5. @dansilivestru
This page is out of date. Refresh to see the latest.
Showing with 179 additions and 49 deletions.
  1. BIN  assets/client/images/Colt-Landscape.png
  2. BIN  assets/client/images/Colt.png
  3. BIN  assets/client/images/Q10.png
  4. BIN  assets/client/images/Z10-Landscape.png
  5. BIN  assets/client/images/Z10.png
  6. +11 −1 doc/CHANGELOG.md
  7. +4 −3 lib/client/bootstrap.js
  8. +2 −1  lib/client/devices.js
  9. +1 −1  lib/client/devices/Bold9700.js
  10. +1 −1  lib/client/devices/Bold9900.js
  11. +1 −1  lib/client/devices/Curve9300.js
  12. +1 −1  lib/client/devices/Curve9350-9360-9370.js
  13. +1 −1  lib/client/devices/Playbook.js
  14. +60 −0 lib/client/devices/Q10.js
  15. +46 −0 lib/client/devices/Q10/skin.css
  16. +1 −1  lib/client/devices/Style9670.js
  17. +1 −1  lib/client/devices/Torch9800.js
  18. +1 −1  lib/client/devices/Torch9810.js
  19. +1 −1  lib/client/devices/Torch9860-9850.js
  20. +8 −8 lib/client/devices/{Colt.js → Z10.js}
  21. +11 −11 lib/client/devices/{Colt → Z10}/skin.css
  22. +0 −2  lib/client/emulatorBridge.js
  23. +1 −1  lib/client/platform/cordova/2.0.0/bridge/file.js
  24. +3 −2 lib/client/platform/cordova/2.0.0/spec.js
  25. +21 −10 lib/server/proxy.js
  26. +1 −1  package.json
  27. +2 −0  test/unit/client/cordova/file.js
View
BIN  assets/client/images/Colt-Landscape.png
Deleted file not rendered
View
BIN  assets/client/images/Colt.png
Deleted file not rendered
View
BIN  assets/client/images/Q10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/client/images/Z10-Landscape.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/client/images/Z10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
12 doc/CHANGELOG.md
@@ -1,8 +1,18 @@
+## v0.9.13 - February 05, 2013
+
+Pull Request (for release commits): https://github.com/blackberry/Ripple-UI/pull/710
+
+* Added support for BlackBerry Z10 device
+* Added support for Blackberry Q10 device
+* Added support for OPTIONS verb for Cross Origin Proxy
+* Added JavaScript console clearing prior to bootup (Chrome v23+ only)
+* Fixed blobBuilder being depricated (community contribution by @maxme)
+
## v0.9.12 - January 14, 2013
Pull Request (for release commits): https://github.com/blackberry/Ripple-UI/pull/683
-* Fixed corss origin proxy bug. Updated to new URL.
+* Fixed cross origin proxy bug. Updated to new URL.
## v0.9.11 - January 12, 2013
View
7 lib/client/bootstrap.js
@@ -110,9 +110,10 @@ function _post(src) {
}
function _bootstrap() {
- // TODO: figure this out for web and ext
- //_console.log("-----------------------------------------------------------");
- //_console.log("There be dragons above here!");
+ if (console.clear) {
+ console.clear();
+ }
+
_console.log("Ripple :: Environment Warming Up (Tea. Earl Gray. Hot.)");
window.tinyHippos = ripple('index');
View
3  lib/client/devices.js
@@ -32,7 +32,8 @@ _self = module.exports = {
"AcerA500",
"Bold9700",
"Bold9900",
- "Colt",
+ "Q10",
+ "Z10",
"Curve9300",
"Curve9350-9360-9370",
"FWVGA",
View
2  lib/client/devices/Bold9700.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "6",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Bold9700",
View
2  lib/client/devices/Bold9900.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "7",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Bold9900",
View
2  lib/client/devices/Curve9300.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "6",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Curve9300",
View
2  lib/client/devices/Curve9350-9360-9370.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "7",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Curve9350-9360-9370",
View
2  lib/client/devices/Playbook.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry PlayBook OS",
"uuid": "42",
"osVersion": "BlackBerry PlayBook OS",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Playbook",
View
60 lib/client/devices/Q10.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+module.exports = {
+
+ "id": "Q10",
+ "name": "BlackBerry Q10",
+ "model": "Q10",
+ "osName": "BlackBerry",
+ "uuid": "42",
+ "osVersion": "10.1",
+ "manufacturer": "BlackBerry",
+ "hardwareId": "0x8400270a",
+
+ "skin": "Q10",
+
+ "capabilities": [
+ "input.touch",
+ "location.gps",
+ "media.audio.capture",
+ "media.video.capture",
+ "media.recording",
+ "network.bluetooth",
+ "network.wlan"
+ ],
+
+ "screen": {
+ "width": 720,
+ "height": 720
+ },
+ "viewPort": {
+ "portrait": {
+ "width": 720,
+ "height": 720,
+ "paddingTop": 0,
+ "paddingLeft": 0
+ }
+ },
+
+ "defaultOrientation": "portrait",
+
+ "ppi": 330,
+ "userAgent": "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.42 Mobile Safari/537.10+",
+ "platforms": ["web", "webworks.bb10", "cordova"],
+ "mediaQueryEmulation": {
+ "-webkit-device-pixel-ratio": 2.08
+ }
+};
View
46 lib/client/devices/Q10/skin.css
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* ------------------------------>
+ Q10 (848x1552) offset (268x84)*/
+
+.viewport-wrapper-Q10 {
+ width: 720px;
+ height: 720px;
+ border: none;
+}
+
+.device-wrapper-Q10 {
+ position: relative;
+ padding: 258px 0 0 86px;
+ width: 792px;
+ height: 1285px;
+ margin: 0 auto;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ background: url('images/Q10.png') no-repeat;
+ background-size: 886px;
+}
+
+.viewport-wrapper-landscape-Q10 {
+ width: 720px;
+ height: 720px;
+ border: none;
+}
+
+#document {
+ border-radius: 7px;
+}
View
2  lib/client/devices/Style9670.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "6",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Style9670",
View
2  lib/client/devices/Torch9800.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "6",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Torch9800",
View
2  lib/client/devices/Torch9810.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "7",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Torch9810",
View
2  lib/client/devices/Torch9860-9850.js
@@ -21,7 +21,7 @@ module.exports = {
"osName": "BlackBerry OS",
"uuid": "42",
"osVersion": "7",
- "manufacturer": "Research In Motion",
+ "manufacturer": "BlackBerry",
"skin": "Torch9860-9850",
View
16 lib/client/devices/Colt.js → lib/client/devices/Z10.js
@@ -15,16 +15,16 @@
*/
module.exports = {
- "id": "Colt",
- "name": "BlackBerry 10 Dev Alpha",
- "model": "Colt",
+ "id": "Z10",
+ "name": "BlackBerry Z10",
+ "model": "Z10",
"osName": "BlackBerry",
"uuid": "42",
- "osVersion": "10.0.6.99",
- "manufacturer": "Research In Motion",
- "hardwareId": "0x8500240a",
+ "osVersion": "10.0.10",
+ "manufacturer": "BlackBerry",
+ "hardwareId": "0x04002607",
- "skin": "Colt",
+ "skin": "Z10",
"capabilities": [
"input.touch",
@@ -58,7 +58,7 @@ module.exports = {
"defaultOrientation": "portrait",
"ppi": 356,
- "userAgent": "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+",
+ "userAgent": "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.10.261 Mobile Safari/537.10+",
"platforms": ["web", "webworks.bb10", "cordova"],
"mediaQueryEmulation": {
"-webkit-device-pixel-ratio": 2.24
View
22 lib/client/devices/Colt/skin.css → lib/client/devices/Z10/skin.css
@@ -14,44 +14,44 @@
* limitations under the License.
*/
/* ------------------------------>
- Colt (848x1552) offset (268x84)*/
+ Z10 (848x1552) offset (268x84)*/
-.viewport-wrapper-Colt {
+.viewport-wrapper-Z10 {
width: 768px;
height: 1280px;
border: none;
}
-.device-wrapper-Colt {
+.device-wrapper-Z10 {
position: relative;
- padding: 268px 0 0 84px;
+ padding: 283px 0 0 99px;
width: 848px;
height: 1552px;
margin: 0 auto;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
- background: url('images/Colt.png') no-repeat;
- background-size: 940px;
+ background: url('images/Z10.png') no-repeat;
+ background-size: 973px;
}
-.viewport-wrapper-landscape-Colt {
+.viewport-wrapper-landscape-Z10 {
width: 1280px;
height: 768px;
border: none;
}
-.device-wrapper-landscape-Colt {
+.device-wrapper-landscape-Z10 {
position: relative;
- padding: 88px 0 0 270px;
+ padding: 106px 0 0 284px;
width: 1552px;
height: 848px;
margin: 0 auto;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
- background: url('images/Colt-Landscape.png') no-repeat;
- background-size: 1821px;
+ background: url('images/Z10-Landscape.png') no-repeat;
+ background-size: 1867px;
}
#document {
View
2  lib/client/emulatorBridge.js
@@ -71,8 +71,6 @@ module.exports = {
_doc = doc;
_xhr = win.XMLHttpRequest;
- ripple('widgetConfig').initialize();
-
var marshal = function (obj, key) {
window[key] = win[key] = obj;
},
View
2  lib/client/platform/cordova/2.0.0/bridge/file.js
@@ -247,7 +247,7 @@ module.exports = {
sourcepath = cleanPath(sourcepath);
// Create a blob for the text to be written
- blob = new Blob([text]);
+ blob = new Blob([text], {type: "text/plain"});
// Get the FileEntry, create if necessary
fs.root.getFile(sourcepath, {create: true}, function (entry) {
View
5 lib/client/platform/cordova/2.0.0/spec.js
@@ -7,7 +7,8 @@ function loadWebworks(win, device) {
case "Playbook":
platform = "tablet/2.0.0";
break;
- case "Colt":
+ case "Z10":
+ case "Q10":
platform = "bb10/1.0.0";
break;
default:
@@ -93,7 +94,7 @@ module.exports = {
topCordova.nativeMethods.FileReader = window.FileReader;
}
- if (device.manufacturer === "Research In Motion") {
+ if (device.manufacturer === "BlackBerry") {
loadWebworks(win, device);
}
View
31 lib/server/proxy.js
@@ -50,7 +50,8 @@ function getUserAgent(req, proxyReqHeaders) {
function proxy(req, res, callback) {
var parsedURL = url.parse(unescape(req.query.tinyhippos_rurl)),
proxyReqData,
- proxyReqHeaders;
+ proxyReqHeaders,
+ proxyReq;
if (authenticated(req.query.tinyhippos_apikey)) {
console.log("INFO:".green + " Proxying cross origin XMLHttpRequest - " + parsedURL.href);
@@ -76,21 +77,31 @@ function proxy(req, res, callback) {
};
if (Object.keys(req.body).length > 0) {
- proxyReqData.form = req.body;
+ if (req.get("content-type") === "application/json") {
+ proxyReqData.body = JSON.stringify(req.body);
+ } else {
+ proxyReqData.form = req.body;
+ }
}
- if (callback) {
- request(proxyReqData, function (error, response, body) {
+ // Attempt to catch any sync errors
+ try {
+ proxyReq = request(proxyReqData, function (error, response, body) {
if (error) {
- console.log("ERROR:".red + " Proxying failed with:");
- console.log(error);
+ console.log("ERROR:".red + " Proxying failed with:", error);
res.send(500, error);
- } else {
+ } else if (callback) {
callback(response, body);
}
});
- } else {
- request(proxyReqData).pipe(res);
+
+ // If no callback, use pipe (which means body & response objects are not needed post-request)
+ // The callback in request(... function (error) {}) (above) is still called when node http client hits unrecoverable error
+ if (!callback) {
+ proxyReq.pipe(res);
+ }
+ } catch (e) {
+ res.send(500, e.toString());
}
} else {
res.send(200, "You shall not pass!");
@@ -125,7 +136,7 @@ function jsonpXHRProxyHandler(req, res/*, next*/) {
function start(options, app) {
var corsOptions = {
origins: ["*"],
- methods: ['HEAD', 'GET', 'POST'],
+ methods: ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'CONNECT'],
credentials: true,
headers: []
};
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "ripple",
- "version": "0.9.12",
+ "version": "0.9.13",
"description": "A browser based html5 mobile application development and testing tool",
"homepage": "http://github.com/blackberry/Ripple-UI",
"author": {
View
2  test/unit/client/cordova/file.js
@@ -138,6 +138,8 @@ describe("Cordova file bridge", function () {
});
window.webkitResolveLocalFileSystemURL = webkitResolveLocalFileSystemURLSpy;
+ global.Blob = Blob;
+
window.WebKitBlobBuilder = function () {
return {
_blobBuffer: "",
Something went wrong with that request. Please try again.