Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

readme

  • Loading branch information...
commit 53668a8649683ff471c0e63a59ad8f2c490aa60f 1 parent ae2670c
Rasmus authored
Showing with 608 additions and 24 deletions.
  1. +19 −0 LICENSE.txt
  2. +7 −24 README.md
  3. +169 −0 etc/style.css
  4. +413 −0 index.html
19 LICENSE.txt
View
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Rasmus Andersson <http://rsms.me/>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
31 README.md
View
@@ -1,8 +1,8 @@
# peertalk
-An iOS and OS X Cocoa library for communicating over USB and TCP.
+PeerTalk is a iOS and OS X Cocoa library for communicating over USB and TCP.
-Highlights:
+#### Highlights
1. Provides you with USB device attach/detach events and attached device's info
@@ -14,6 +14,8 @@ Highlights:
4. Tested and designed for libdispatch (aka Grand Central Dispatch).
+Grab the goods from [https://github.com/rsms/peertalk](https://github.com/rsms/peertalk)
+
## Getting started
@@ -27,27 +29,8 @@ Suck down the code and open *peertalk.xcodeproj* in Xcode 4.3 or later on OS X 1
3. Connect your iOS device (iPhone, iPod or iPad) and kill the iPhone simulator and go back to Xcode. Select the "Peertalk iOS Example" target for your connected iOS device. Hit Cmd+R (Product → Run) to build and run the sample app on your device.
-It _should_ work. Video demo: [http://www.youtube.com/watch?v=kQPWy8N0mBg](http://www.youtube.com/watch?v=kQPWy8N0mBg)
-
-
-## License (MIT)
-
-Copyright (c) 2012 Rasmus Andersson <http://rsms.me/>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+It _should_ work.
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+Demo video: [http://www.youtube.com/watch?v=kQPWy8N0mBg](http://www.youtube.com/watch?v=kQPWy8N0mBg)
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+<iframe width="880" height="530" src="http://www.youtube.com/embed/kQPWy8N0mBg?hd=1&amp;rel=0" frameborder="0" allowfullscreen></iframe>
169 etc/style.css
View
@@ -0,0 +1,169 @@
+html {
+ background: white;
+ color: black;
+ font: 16px/1.4 helvetica, arial, sans-serif;
+}
+body {
+ display:block;
+ margin: 0 auto;
+ width: 800px;
+}
+
+h1,h2, h4,h5 {
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizelegibility;
+}
+h1,h2,h3,h4,h5 {
+ margin-top:1.618em;
+}
+
+h1 { color: #333; }
+h2 { color: #222; }
+h3 { color: #333; }
+h4 { color: #666; }
+
+a:link, a:active, a:visited { color: #0D2681; text-decoration:none; }
+a { text-decoration:none; }
+a:link, a:active { color:#316d96; }
+a:visited { color:#7e5494; }
+a:link:hover, a:active:hover, a:visited:hover { text-decoration:underline; }
+a:link:hover, a:active:hover { color:#006be4; }
+a:visited:hover { color:#af00cf; }
+a > img { margin-bottom:-1px; }
+a.img { border:none; background:transparent !important; }
+
+h1 a,h2 a,h3 a,h4 a,h5 a {
+ color:inherit !important;
+}
+
+blockquote {
+ border-left: 4px solid #E68E88;
+ padding-left: 1em;
+ margin-right: 1em;
+ margin:0 1em 0 0;
+ color: #664E4A;
+ font-style: italic;
+}
+
+code, pre, tt, samp { font-family: 'Droid Sans Mono', 'Menlo', monospace; }
+code, pre { background-color: #f0f0f0; }
+code { color: inherit; }
+pre {
+ color: #555;
+ border-left: 2px solid #ddd;
+ font-weight: lighter;
+ padding: 1em;
+ line-height:1.4;
+ overflow-x: hidden;
+ text-wrap: avoid;
+ white-space: pre-wrap;
+}
+pre code {
+}
+
+:target {
+ background-color:#FFFCB9;
+ border-top-color:#F1E485;
+}
+
+span.str { color: #080; }
+span.kwd { color: #295AA4; }
+span.com { color: #999; }
+span.typ { color: #808; }
+span.lit { color: #066; }
+span.pun, span.opn, span.clo { color: #660; }
+span.pln { color: inherit; }
+span.tag { color: #008; }
+span.atn { color: #606; }
+span.atv { color: #080; }
+span.dec { color: #606; }
+/* Use higher contrast and font-styling for printable form. */
+@media print {
+ span.str { color: #060; }
+ span.kwd { color: #006; font-weight: bold; }
+ span.com { color: #999; font-style: italic; }
+ span.typ { color: #404; font-weight: bold; }
+ span.lit { color: #044; }
+ span.pun, span.opn, span.clo { color: #440; }
+ span.pln { color: #000; }
+ span.tag { color: #006; font-weight: bold; }
+ span.atn { color: #404; }
+ span.atv { color: #060; }
+}
+
+#content h1 {
+ text-align:center;
+ padding-top:1em;
+ margin-top:1em;
+}
+#content h1 a {
+ display:block;
+}
+
+h2 {
+ border-top: 2px solid #ddd;
+ padding-top:0.5em;
+ margin-top: 3em;
+}
+
+h3 {
+ font-family: 'Droid Sans Mono', 'Menlo', monospace;
+ font-weight: normal;
+ color: black;
+ line-height:1.5;
+ padding:0;
+ display:inline-block;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ margin-bottom:0;
+}
+h3 a {
+ display: block;
+ text-indent:-2em;
+ padding:0.2em 0.4em;
+ padding-left:2.4em;
+ border-left: 0.2em solid #7B77E3;
+ margin-left:-0.6em;
+}
+h3 .dimmed {
+ color:#5260A1;
+}
+h3 a:hover {
+ text-decoration: none !important;
+ background: #F0F6FD;
+}
+
+.footnote { color: #525151; }
+.footnote:before { color: #525151; }
+.footnote:after { color: #525151; }
+div.footnotes { background: #F0F0F0; }
+
+footer {
+ display:block;
+ color: #999;
+ padding:1em 0;
+ margin-top:5em;
+ border-top:1px solid #ddd;
+}
+
+#logo {
+ cursor: default;
+}
+#logo div {
+ font: bold 50px/70px helvetica, arial, sans-serif;
+ text-align:center;
+ /*-webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.2);*/
+}
+
+#github-banner img {
+ position: absolute; top: 0; right: 0; border: 0;
+}
+
+/* iPhone */
+@media only screen and (max-device-width: 480px) {
+ html { font-size: 22px; }
+ code { font-size:16px; font-weight:normal; color:#222; }
+ #github-banner img { width:220px; height:220px; }
+ #logo { zoom:1.5; }
+}
413 index.html
View
@@ -0,0 +1,413 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>PeerTalk</title>
+ <meta name="viewport" content="width=880">
+ <meta property="fb:admins" content="728642302">
+ <meta name="description" content="iOS and OS X Cocoa library for communicating over USB and TCP.">
+ <meta property="og:image" content="http://rsms.me/uilayer/examples/icon.png">
+ <meta property="og:site_name" content="rsms.me">
+ <script>
+window.gFetchTS = new Date;
+gFetchTS = gFetchTS.getFullYear()+'-'+gFetchTS.getMonth()+'-'+gFetchTS.getDate()+'-'+gFetchTS.getHours();
+
+var Showdown = {converter:function() {
+ function n(a, b) {
+ var b = o(b), c = "<h" + a;
+ if(typeof p.anchorPrefix === "string") {
+ var d = p.anchorPrefix + b.toLowerCase().replace(D, "-").replace(/\-+/g, "-");
+ c += ' id="' + d + '">';
+ c += p.anchorLinks ? '<a href="#' + d + '">' + b + "</a>" : b
+ }else {
+ c += ">" + b
+ }
+ c += "</h" + a + ">";
+ return l(c)
+ }
+ var i, j, m, q = 0, p = this;
+ this.anchorPrefix = "";
+ this.anchorLinks = true;
+ this.makeHtml = function(a) {
+ i = [];
+ j = [];
+ m = [];
+ a = a.replace(/~/g, "~T");
+ a = a.replace(/\$/g, "~D");
+ a = a.replace(/\r\n/g, "\n");
+ a = a.replace(/\r/g, "\n");
+ a = w("\n\n" + a + "\n\n");
+ a = a.replace(/^[ \t]+$/mg, "");
+ a = x(a);
+ a = E(a);
+ a = r(a);
+ a = y(a);
+ a = a.replace(/~D/g, "$$");
+ a = a.replace(/~T/g, "~");
+ a = a.replace(/--/g, "&mdash;");
+ return a = a.replace(/[a-z0-9_\-+=.]+@[a-z0-9\-]+(\.[a-z0-9-]+)+/ig, function(a) {
+ return"<a href='mailto:" + a + "'>" + a + "</a>"
+ })
+ };
+ var E = function(a) {
+ return a = a.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm, function(a, c, d, e, g) {
+ c = c.toLowerCase();
+ i[c] = z(d);
+ if(e) {
+ return e + g
+ }else {
+ g && (j[c] = g.replace(/"/g, "&quot;"))
+ }
+ return""
+ })
+ }, x = function(a) {
+ a = a.replace(/\n/g, "\n\n");
+ a = a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm, h);
+ a = a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, h);
+ a = a.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, h);
+ a = a.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g, h);
+ a = a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, h);
+ return a.replace(/\n\n/g, "\n")
+ }, h = function(a, b) {
+ var c;
+ c = b.replace(/\n\n/g, "\n");
+ c = c.replace(/^\n/, "");
+ c = c.replace(/\n+$/g, "");
+ return"\n\n~K" + (m.push(c) - 1) + "K\n\n"
+ }, r = function(a) {
+ for(var a = F(a), b = l("<hr />"), a = a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, b), a = a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, b), a = a.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm, b), a = A(a), a = G(a), a = H(a), a = a = x(a), a = a.replace(/^\n+/g, ""), a = a.replace(/\n+$/g, ""), c = a.split(/\n{2,}/g), a = [], b = c.length, d = 0;d < b;d++) {
+ var e = c[d];
+ e.search(/~K(\d+)K/g) >= 0 ? a.push(e) : e.search(/\S/) >= 0 && (e = o(e), e = e.replace(/^([ \t]*)/g, "<p>"), e += "</p>", a.push(e))
+ }
+ b = a.length;
+ for(d = 0;d < b;d++) {
+ for(;a[d].search(/~K(\d+)K/) >= 0;) {
+ c = m[RegExp.$1], c = c.replace(/\$/g, "$$$$"), a[d] = a[d].replace(/~K\d+K/, c)
+ }
+ }
+ return a.join("\n\n")
+ }, o = function(a) {
+ var e;
+ var d;
+ var c;
+ var b;
+ a = I(a);
+ a = a = J(a);
+ a = a.replace(/\\(\\)/g, s);
+ a = (b = a = a.replace(/\\([`*_{}\[\]()>#+-.!])/g, s), a = b);
+ a = a.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, B);
+ a = (c = a = a.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, B), a = c);
+ a = a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, t);
+ a = a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, t);
+ d = a = a.replace(/(\[([^\[\]]+)\])()()()()()/g, t), a = d;
+ a = K(a);
+ a = a = z(a);
+ a = a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "<strong>$2</strong>");
+ a = a.replace(/(\w)_(\w)/g, "$1~E95E$2");
+ e = a = a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>"), a = e;
+ return a.replace(/ +\n/g, " <br />\n")
+ }, J = function(a) {
+ return a = a.replace(/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi, function(a) {
+ a = a.replace(/(.)<\/?code>(?=.)/g, "$1`");
+ return k(a, "\\`*_")
+ })
+ }, t = function(a, b, c, d, e, g, h, f) {
+ f == void 0 && (f = "");
+ a = d.toLowerCase();
+ if(e == "") {
+ if(a == "" && (a = c.toLowerCase().replace(/ ?\n/g, " ")), i[a] != void 0) {
+ e = i[a], j[a] != void 0 && (f = j[a])
+ }else {
+ if(b.search(/\(\s*\)$/m) > -1) {
+ e = ""
+ }else {
+ return b
+ }
+ }
+ }
+ e = k(e, "*_");
+ b = '<a href="' + e + '"';
+ f != "" && (f = f.replace(/"/g, "&quot;"), f = k(f, "*_"), b += ' title="' + f + '"');
+ b += ">" + c + "</a>";
+ return b
+ }, B = function(a, b, c, d, e, g, h, f) {
+ a = c;
+ d = d.toLowerCase();
+ f || (f = "");
+ if(e == "") {
+ if(d == "" && (d = a.toLowerCase().replace(/ ?\n/g, " ")), i[d] != void 0) {
+ e = i[d], j[d] != void 0 && (f = j[d])
+ }else {
+ return b
+ }
+ }
+ a = a.replace(/"/g, "&quot;");
+ e = k(e, "*_");
+ b = '<img src="' + e + '" alt="' + a + '"';
+ f = f.replace(/"/g, "&quot;");
+ f = k(f, "*_");
+ b += ' title="' + f + '"';
+ b += " />";
+ return b
+ }, D = /[^a-zA-Z0-9_\.-]+/g, F = function(a) {
+ a = a.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm, function(a, c) {
+ return n(1, c)
+ });
+ a = a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm, function(a, c) {
+ return n(2, c)
+ });
+ return a = a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm, function(a, c, d) {
+ return n(c.length, d)
+ })
+ }, u, A = function(a) {
+ a += "~0";
+ var b = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
+ q ? a = a.replace(b, function(a, b, e) {
+ a = b;
+ e = e.search(/[*+-]/g) > -1 ? "ul" : "ol";
+ a = a.replace(/\n{2,}/g, "\n\n\n");
+ a = u(a);
+ a = a.replace(/\s+$/, "");
+ return"<" + e + ">" + a + "</" + e + ">\n"
+ }) : (b = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g, a = a.replace(b, function(a, b, e, g) {
+ a = e;
+ g = g.search(/[*+-]/g) > -1 ? "ul" : "ol";
+ a = a.replace(/\n{2,}/g, "\n\n\n");
+ a = u(a);
+ return b + "<" + g + ">\n" + a + "</" + g + ">\n"
+ }));
+ return a = a.replace(/~0/, "")
+ };
+ u = function(a) {
+ q++;
+ a = a.replace(/\n{2,}$/, "\n");
+ a += "~0";
+ a = a.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, function(a, c, d, e, g) {
+ a = g;
+ c || a.search(/\n{2,}/) > -1 ? a = r(v(a)) : (a = A(v(a)), a = a.replace(/\n$/, ""), a = o(a));
+ return"<li>" + a + "</li>\n"
+ });
+ a = a.replace(/~0/g, "");
+ q--;
+ return a
+ };
+ var G = function(a) {
+ a += "~0";
+ a = a.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g, function(a, c, d) {
+ a = C(v(c));
+ a = w(a);
+ a = a.replace(/^\n+/g, "");
+ a = a.replace(/\n+$/g, "");
+ return l("<pre><code>" + a + "\n</code></pre>") + d
+ });
+ return a = a.replace(/~0/, "")
+ }, l = function(a) {
+ a = a.replace(/(^\n+|\n+$)/g, "");
+ return"\n\n~K" + (m.push(a) - 1) + "K\n\n"
+ }, I = function(a) {
+ return a = a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(a, c, d, e) {
+ a = e.replace(/^([ \t]*)/g, "");
+ a = a.replace(/[ \t]*$/g, "");
+ a = C(a);
+ return c + "<code>" + a + "</code>"
+ })
+ }, C = function(a) {
+ a = a.replace(/&/g, "&amp;");
+ a = a.replace(/</g, "&lt;");
+ a = a.replace(/>/g, "&gt;");
+ return k(a, "*_{}[]\\", false)
+ }, H = function(a) {
+ return a = a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(a, c) {
+ var d;
+ d = c.replace(/^[ \t]*>[ \t]?/gm, "~0");
+ d = d.replace(/~0/g, "");
+ d = d.replace(/^[ \t]+$/gm, "");
+ d = r(d);
+ d = d.replace(/(^|\n)/g, "$1 ");
+ d = d.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(a, c) {
+ var b;
+ b = c.replace(/^ /mg, "~0");
+ return b.replace(/~0/g, "")
+ });
+ return l("<blockquote>\n" + d + "\n</blockquote>")
+ })
+ }, z = function(a) {
+ a = a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;");
+ return a.replace(/<(?![a-z\/?\$!])/gi, "&lt;")
+ }, K = function(a) {
+ a = a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi, '<a href="$1">$1</a>');
+ return a = a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, function(a, c) {
+ return L(y(c))
+ })
+ }, L = function(a) {
+ var b = [function(a) {
+ return"&#" + a.charCodeAt(0) + ";"
+ }, function(a) {
+ a = a.charCodeAt(0);
+ return"&#x" + ("0123456789ABCDEF".charAt(a >> 4) + "0123456789ABCDEF".charAt(a & 15)) + ";"
+ }, function(a) {
+ return a
+ }], a = ("mailto:" + a).replace(/./g, function(a) {
+ if(a == "@") {
+ a = b[Math.floor(Math.random() * 2)](a)
+ }else {
+ if(a != ":") {
+ var d = Math.random(), a = d > 0.9 ? b[2](a) : d > 0.45 ? b[1](a) : b[0](a)
+ }
+ }
+ return a
+ });
+ return a = ('<a href="' + a + '">' + a + "</a>").replace(/">.+:/g, '">')
+ }, y = function(a) {
+ return a = a.replace(/~E(\d+)E/g, function(a, c) {
+ var d = parseInt(c);
+ return String.fromCharCode(d)
+ })
+ }, v = function(a) {
+ a = a.replace(/^(\t|[ ]{1,4})/gm, "~0");
+ return a.replace(/~0/g, "")
+ }, w = function(a) {
+ a = a.replace(/\t(?=\t)/g, " ");
+ a = a.replace(/\t/g, "~A~B");
+ a = a.replace(/~B(.+?)~A/g, function(a, c) {
+ for(var d = c, e = 4 - d.length % 4, g = 0;g < e;g++) {
+ d += " "
+ }
+ return d
+ });
+ a = a.replace(/~A/g, " ");
+ return a = a.replace(/~B/g, "")
+ }, k = function(a, b, c) {
+ b = "([" + b.replace(/([\[\]\\])/g, "\\$1") + "])";
+ c && (b = "\\\\" + b);
+ return a.replace(RegExp(b, "g"), s)
+ }, s = function(a, b) {
+ return"~E" + b.charCodeAt(0) + "E"
+ }
+}};
+ </script>
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono:normal" type="text/css">
+ <link rel="stylesheet" href="etc/style.css" type="text/css">
+ </head>
+ <body>
+ <h1>PeerTalk</h1>
+ <div id="content">
+ </div>
+ <a href="http://github.com/rsms/peertalk" id="github-banner"><img src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
+ <footer>PeerTalk is free software and <a href="https://github.com/rsms/uilayer">open source</a>
+under a <a href="LICENSE.txt" title="MIT license">permissive license</a>, created by <a href="http://rsms.me/">Rasmus Andersson</a>.
+ </footer>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
+ <script>
+var content = document.getElementById('content');
+// Synchronous request so that back/fwd in browsers retain scroll position, etc
+$.ajax({
+ async: false,
+ url: 'README.md?'+gFetchTS,
+ error: function (a,b,c) {
+ console.error('Failed to load content:', a,b,c);
+ },
+ success: function (body) {
+ body = body.replace(/> Note: UILayer only works in WebKit-based environments.+/, 'NOTE_WEBKIT_COMPAT');
+ var html = (new Showdown.converter()).makeHtml(body);
+ html = html.replace(/<h1[^>]+>.+<\/h1>/, '');
+ html = html.replace(/<p>[\r\n.]*NOTE_WEBKIT_COMPAT[\r\n.]*<\/p>/m, '<blockquote id="webkit-compat-note"></blockquote>');
+ content.innerHTML = html;
+
+ if (typeof content.querySelectorAll === 'function') {
+ Array.prototype.slice.call(content.querySelectorAll('h3 > a')).forEach(function (el) {
+ if (el.innerHTML === el.innerText)
+ el.innerHTML = el.innerText.replace(/^layer\./, '<span class="dimmed">layer.</span>');
+ });
+ }
+ }
+});
+</script>
+<script src="http://movelang.org/move-0.4.4.js"></script>
+<script type="text/move">
+
+# Code pretty printer
+v = document.getElementsByTagName 'pre'
+for (i=0,L=v.length; i < L; ++i) {
+ n = v.item i
+ a = n.getAttribute('class') || ''
+ if (a.indexOf('plain-text') != -1)
+ continue
+ if (n.firstChild && n.firstChild.nodeName == 'CODE')
+ n.setAttribute 'class', a+' prettyprint lang-mv'
+}
+script = document.createElement 'script'
+script.async = true
+script.src = "examples/prettify.js"
+document.getElementsByTagName('head')[0].appendChild script
+
+import UILayer
+
+webkitCompatNote = document.getElementById 'webkit-compat-note'
+if (!UILayer) {
+ webkitCompatNote.innerHTML = "<p>You are viewing through an incompatible browser. UILayer works with WebKit-based environments, such as web views on Apple iOS, OS X and Android or in web browsers like Google Chrome and Safari. The demos and examples presented on this site will not work in this browser.</p>"
+ return
+} else {
+ webkitCompatNote.parentNode.removeChild webkitCompatNote
+}
+
+# A fun little Logotype for visitors with WebKit browsers
+
+UILayer.debug = true
+rootLayer = UILayer { x:20, y:20, width:2, height:70, tag:'logo', backgroundColor:'transparent',
+ perspective:1000, doubleSided:true, preserve3d:true }
+document.body.appendChild rootLayer.element
+rootLayer.perspective = 400
+didInitiateRandomly = false
+
+initiateRandomly = ^(layer, isSublayer) {
+ layer.moveBy 0, 0, (Math.random()*60)-30
+ if (isSublayer)
+ layer.matrix = layer.matrix.rotate((Math.random()*20)-10, (Math.random()*20)-10, (Math.random()*20)-10)
+ layer.sublayers.forEach ^(sublayer) { initiateRandomly sublayer, true }
+}
+
+addLetter = ^(letter, width, previousLayer) {
+ layer = (previousLayer || rootLayer).addSublayer UILayer {
+ x: 0, y: 0,
+ width: width || 60,
+ element: <div>{letter}</div>,
+ animated: 'geometry',
+ preserve3d: true,
+ style: {'-webkit-user-select':'none'}
+ }
+
+ if (previousLayer) {
+ layer.animationTimingFunction = 'ease-out'
+ after {delay:1} ^{
+ layer.frame.x = previousLayer.frame.width - 10
+ after {delay:layer.animationDuration} ^{
+ layer.animationTimingFunction = 'ease'
+ layer.animationDuration = 200
+ }
+ }
+ } else {
+ layer.animationTimingFunction = 'ease'
+ layer.animationDuration = 200
+ }
+
+ layer.on 'touchstart', ^(ev) {
+ if (!didInitiateRandomly) {
+ initiateRandomly rootLayer
+ didInitiateRandomly = true
+ }
+ layer.matrix = layer.matrix.rotate((Math.random()*20)-10, (Math.random()*20)-10, (Math.random()*20)-10)
+ @moveBy((Math.random()*10)-5, (Math.random()*10)-5, (Math.random()*10)-5)
+ #@scale *= (0.9 + (Math.random()*0.2))
+ ev.stopPropagation()
+ }
+
+ ^(letter, width) { addLetter letter, width, layer }
+}
+
+addLetter('U', 45)('I', 35)('L', 40)('A', 48)('Y', 40)('E')('R', 40)
+document.getElementById('title-h1').style.visibility = 'hidden'
+
+</script>
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.