Skip to content

Commit

Permalink
Work around innerHtml sanitization in sunflower demo.
Browse files Browse the repository at this point in the history
R=kasperl@google.com

Review URL: https://codereview.chromium.org//132283004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31745 260f80e4-7a28-3924-810f-c04153c831b5
  • Loading branch information
peter-ahe-google committed Jan 13, 2014
1 parent 2e3f7b6 commit d7623ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions site/try/leap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,8 @@ observer.observe(
})();
''';

// Test that math.png is displayed correctly (centered without 3d border).
// Test that slider works and changes size of sunflower.
const String EXAMPLE_SUNFLOWER = '''
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
Expand Down Expand Up @@ -1221,6 +1223,8 @@ final CanvasRenderingContext2D context =
void main() {
document.head.append(new StyleElement()..appendText(STYLE));
document.body.innerHtml = BODY;
ImageElement img = document.querySelector("#math_png");
img.src = MATH_PNG;
slider.onChange.listen((e) => draw());
draw();
}
Expand Down Expand Up @@ -1262,7 +1266,7 @@ const String BODY = """
<input id="slider" type="range" max="1000" value="500"/>
</form>
<br/>
<img src="\$MATH_PNG" width="350px" height="42px" class="center">
<img id="math_png" width="350px" height="42px" class="center">
</div>
<footer>
Expand All @@ -1274,7 +1278,7 @@ const String BODY = """
const String STYLE = r"""
body {
background-color: #F8F8F8;
font-family: 'Open Sans', sans-serif;
font-family: \'Open Sans\', sans-serif;
font-size: 14px;
font-weight: normal;
line-height: 1.2em;
Expand Down Expand Up @@ -1319,5 +1323,4 @@ img {
text-align: center;
}
""";
''';
2 changes: 1 addition & 1 deletion site/try/nossl.appcache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CACHE MANIFEST
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Version 5-sdk1-0.2 <-- CHANGE THIS when you have a new version
# Version 5-sdk1-0.3 <-- CHANGE THIS when you have a new version

CACHE:
index.html
Expand Down

0 comments on commit d7623ae

Please sign in to comment.