Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from lindsayevans/android-support

Adding plain HTML/CSS fallback for devices not supported by Raphael
  • Loading branch information...
commit c16e40056cf9733476c2d9f4ce072337dc14a6d5 2 parents fad72c4 + 12f780c
@gilmoreorless gilmoreorless authored
Showing with 19 additions and 5 deletions.
  1. +13 −3 index.html
  2. +6 −2 syd.js
View
16 index.html
@@ -6,15 +6,25 @@
<style type="text/css" media="screen">
body {
background: #2c53b0 url(blueprintbg.png);
+ font-family: "Helvetica Neue",Arial,sans-serif;
+ color: #fff;
+ }
+ a:link, a:visited {
+ color: #fff;
}
.js #content {
position: absolute;
left: -9999em;
top: -9999em;
}
+ .no-raphael #content {
+ position: initial;
+ left: initial;
+ top: initial;
+ }
</style>
</head>
- <body>
+ <body class="no-raphael no-js">
<div id="content" class="vevent">
<h1 class="summary">Sydney JavaScript Group</h1>
<h2 id="next">Next Meeting:</h2>
@@ -50,9 +60,9 @@ <h2 id="group">The Group</h2>
</dd>
</dl>
</div>
- <script>document.body.className = "js";</script>
+ <script>document.body.className = document.body.className.replace(/\bno-js\b/,'js');</script>
<script src="raphael.js"></script>
<script src="museo.js"></script>
<script src="syd.js"></script>
</body>
-</html>
+</html>
View
8 syd.js
@@ -23,7 +23,11 @@ window.onload = function () {
join = "M28.516,7.167H3.482l12.517,7.108L28.516,7.167zM16.74,17.303C16.51,17.434,16.255,17.5,16,17.5s-0.51-0.066-0.741-0.197L2.5,10.06v14.773h27V10.06L16.74,17.303z",
archive = "M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z",
d = r.path();
-
+
+ if(Raphael.type !== ''){
+ document.body.className = document.body.className.replace(/\bno-raphael\b/,'raphael');
+ }
+
function getAnchors(p1x, p1y, p2x, p2y, p3x, p3y, value) {
value = value || 4;
var l = Math.min(Math.sqrt(Math.pow(p1x - p2x, 2) + Math.pow(p1y - p2y, 2)) / value, Math.sqrt(Math.pow(p3x - p2x, 2) + Math.pow(p3y - p2y, 2)) / value),
@@ -150,4 +154,4 @@ window.onload = function () {
r.path(archive).attr({fill: "#fff", stroke: "none", translation: [367, y + 173]});
r.print(406, y + 194, $("archive").innerHTML, museo, 18).attr({fill: "#fff"});
r.rect(360, y + 180, 190, 26).attr({href: $("archive").href, fill: "#000", opacity: 0});
-};
+};
Please sign in to comment.
Something went wrong with that request. Please try again.