-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#151 - adding twitter demo support and show how to share a url
- Loading branch information
1 parent
1180223
commit 95891c1
Showing
11 changed files
with
449 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
======= | ||
|
||
A Bridge for Twitter Web Intents and Web Intents | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{% block title %}{% endblock %}</title> | ||
<link rel="stylesheet" href="styles/bootstrap.min.css"> | ||
<link rel="stylesheet" href="styles/application.css"> | ||
<script src='//webintents.org/webintents.min.js'></script> | ||
{% block scripts %}{% endblock %} | ||
</head> | ||
<body> | ||
<section> | ||
{% block content %}{% endblock %} | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% extends "demos/twitter/layouts/application.html" %} | ||
{% block title %}Web Intents: Twitter Demo{% endblock %} | ||
{% block headline %}Web Intents: Twitter Demos{% endblock %} | ||
{% block scripts %} | ||
<script src="//webintents.org/webintents.min.js"></script> | ||
<intent action="http://webintents.org/share" | ||
type="text/uri-list" | ||
href="/twitter/twitter_inline.html" | ||
disposition="inline" | ||
title="Twitter Demo" | ||
icon="http://twitter.com/favicon.ico" /> | ||
{% endblock %} | ||
{% block content %} | ||
<section> | ||
<h2>Try it out</h2> | ||
<p>This is a simple demo. Share this page to Twitter</p> | ||
<input id="linkToShare" type="text" value="http://paul.kinlan.me" /> | ||
<input id="shareButton" type="button" value="Share" class="btn primary" /> | ||
|
||
<h2>Registration</h2> | ||
<p> | ||
It is simple to set up an app to be able to handle incoming data. | ||
This Twitter bridge was written to let you share your url's directly to Twitter. | ||
</p> | ||
<pre><intent action="http://webintents.org/share" | ||
type="text/uri-list" | ||
href="twitter_inline.html" | ||
disposition="inline" /> | ||
</pre> | ||
<p> | ||
The above tag just needs to be placed on your page, with a "href" of the page you want to be opened and now | ||
your page will be able to be launched via the Web Intent system when a user invokes the "<a href="http://webintents.org/share">share</a>" intent. | ||
</p> | ||
<script> | ||
var link = document.getElementById("linkToShare"); | ||
var share = document.getElementById("shareButton"); | ||
share.addEventListener("click", function() { | ||
var url = link.value; | ||
var intent = new Intent("http://webintents.org/share", "text/uri-list", url); | ||
window.navigator.startActivity(intent, function(data) {}); | ||
}, false); | ||
</script> | ||
<h2>How to share the link</h2> | ||
<p>The code for invoking the "share" intent is below.</p> | ||
<pre> | ||
var link = document.getElementById("linkToShare"); | ||
var share = document.getElementById("shareButton"); | ||
share.addEventListener("click", function() { | ||
var url = link.value; | ||
var intent = new Intent("http://webintents.org/share", "text/uri-list", url); | ||
window.navigator.startActivity(intent, function(data) {}); | ||
}, false); | ||
</pre> | ||
{ | ||
</section> | ||
{% endblock %} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file | ||
# | ||
# To ban all spiders from the entire site uncomment the next two lines: | ||
# User-Agent: * | ||
# Disallow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2011 Google Inc. All Rights Reserved. | ||
function loadImage(img, url) { | ||
if(url.substring(0,4) == "data") { | ||
img.attr('src', url); | ||
} | ||
else { | ||
img.attr('src', 'proxy?url=' + encodeURIComponent(url)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
html { | ||
background-color: #ddd; | ||
} | ||
|
||
body { | ||
margin: 30px 50px 30px 50px; | ||
box-shadow: 0 0 10px #666; | ||
padding: 20px; | ||
border-bottom-left-radius: 20px; | ||
border-top-right-radius: 20px; | ||
background-color: #eee; | ||
} | ||
|
||
#result { | ||
height: 600px; | ||
width: 800px; | ||
box-shadow: inset 0 0 10px #666; | ||
} | ||
|
||
#steps { | ||
margin: 0 10px; | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
} | ||
|
||
#steps input { | ||
display: block; | ||
margin: 0 5px 5px 5px; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.