# HG changeset patch # User Jaroslav Tulach # Date 1365405899 -7200 # Node ID 35f4f8af296c1d9a989740bb37ef27716e113c1d # Parent 26f7eeb81aecd09c8c08e8af0ee08f22a8f45277 Able to display tweets (if --disable-web-security used). Needed to patch knockout to survive/ignore properties with dollar sign in them. diff -r 26f7eeb81aec -r 35f4f8af296c javaquery/api/src/main/resources/org/apidesign/bck2brwsr/htmlpage/knockout-2.2.1.js --- a/javaquery/api/src/main/resources/org/apidesign/bck2brwsr/htmlpage/knockout-2.2.1.js Sun Apr 07 22:32:41 2013 +0200 +++ b/javaquery/api/src/main/resources/org/apidesign/bck2brwsr/htmlpage/knockout-2.2.1.js Mon Apr 08 09:24:59 2013 +0200 @@ -2193,7 +2193,14 @@ else element[attrName] = attrValue; } else if (!toRemove) { - element.setAttribute(attrName, attrValue.toString()); + try { + element.setAttribute(attrName, attrValue.toString()); + } catch (err) { + // ignore for now + if (console) { + console.log("Can't set attribute " + attrName + " to " + attrValue + " error: " + err); + } + } } // Treat "name" specially - although you can think of it as an attribute, it also needs diff -r 26f7eeb81aec -r 35f4f8af296c javaquery/demo-twitter/src/main/java/org/apidesign/bck2brwsr/demo/twitter/TwitterClient.java --- a/javaquery/demo-twitter/src/main/java/org/apidesign/bck2brwsr/demo/twitter/TwitterClient.java Sun Apr 07 22:32:41 2013 +0200 +++ b/javaquery/demo-twitter/src/main/java/org/apidesign/bck2brwsr/demo/twitter/TwitterClient.java Mon Apr 08 09:24:59 2013 +0200 @@ -47,7 +47,7 @@ @Property(name = "from_user_id", type = int.class), @Property(name = "profile_image_url", type = String.class), @Property(name = "text", type = String.class), - + @Property(name = "created_at", type = String.class), }) static final class Twt { } diff -r 26f7eeb81aec -r 35f4f8af296c javaquery/demo-twitter/src/main/resources/org/apidesign/bck2brwsr/demo/twitter/index.html --- a/javaquery/demo-twitter/src/main/resources/org/apidesign/bck2brwsr/demo/twitter/index.html Sun Apr 07 22:32:41 2013 +0200 +++ b/javaquery/demo-twitter/src/main/resources/org/apidesign/bck2brwsr/demo/twitter/index.html Mon Apr 08 09:24:59 2013 +0200 @@ -52,6 +52,7 @@
+ diff -r 26f7eeb81aec -r 35f4f8af296c javaquery/demo-twitter/src/test/java/org/apidesign/bck2brwsr/demo/twitter/TwitterProtocolTest.java --- a/javaquery/demo-twitter/src/test/java/org/apidesign/bck2brwsr/demo/twitter/TwitterProtocolTest.java Sun Apr 07 22:32:41 2013 +0200 +++ b/javaquery/demo-twitter/src/test/java/org/apidesign/bck2brwsr/demo/twitter/TwitterProtocolTest.java Mon Apr 08 09:24:59 2013 +0200 @@ -82,6 +82,9 @@ } assert 4 == page.getCurrentTweets().size() : "Four tweets: " + page.getCurrentTweets(); + + String firstDate = page.getCurrentTweets().get(0).getCreated_at(); + assert "Fri, 05 Apr 2013 06:10:01 +0000".equals(firstDate) : "Date is OK: " + firstDate; } @Factory public static Object[] create() {