Permalink
Browse files

Adding Imgur Extension

  • Loading branch information...
PaulKinlan committed Jun 6, 2012
1 parent d43ffa4 commit a4e0e8f1b5b15ba0c433e3c39a9c6891a6207d24
View
@@ -37,12 +37,18 @@ tools/chrome/apps/hosted/picksomeipsum/manifest.json: tools/chrome/apps/hosted/p
tools/chrome/apps/hosted/picksomeipsum.crx: tools/chrome/apps/hosted/picksomeipsum/manifest.json tools/chrome/apps/hosted/picksomeipsum/128.png
./packcrx.sh tools/chrome/apps/hosted/picksomeipsum tools/chrome/key.pem
-extensions: tools/chrome/extensions/share-services/twitter.crx tools/chrome/extensions/share-services/blogger.crx tools/chrome/extensions/share-services/tumblr.crx tools/chrome/extensions/share-services/digg.crx tools/chrome/extensions/share-services/linkedin.crx tools/chrome/extensions/share-services/delicious.crx tools/chrome/extensions/share-services/reddit.crx tools/chrome/extensions/share-services/gmail.crx tools/chrome/extensions/share-services/hackernews.crx tools/chrome/extensions/shorten-services/bit.ly.crx tools/chrome/extensions/shorten-services/goo.gl.crx tools/chrome/extensions/save-services/box.crx tools/chrome/extensions/save-services/readitlater.crx tools/chrome/extensions/save-services/instapaper.crx tools/chrome/extensions/pick-services/pickhtml.crx tools/chrome/extensions/pick-services/pickbookmark.crx tools/chrome/extensions/pick-services/pickscreenshot.crx
+extensions: tools/chrome/extensions/share-services/imgur.crx tools/chrome/extensions/share-services/twitter.crx tools/chrome/extensions/share-services/blogger.crx tools/chrome/extensions/share-services/tumblr.crx tools/chrome/extensions/share-services/digg.crx tools/chrome/extensions/share-services/linkedin.crx tools/chrome/extensions/share-services/delicious.crx tools/chrome/extensions/share-services/reddit.crx tools/chrome/extensions/share-services/gmail.crx tools/chrome/extensions/share-services/hackernews.crx tools/chrome/extensions/shorten-services/bit.ly.crx tools/chrome/extensions/shorten-services/goo.gl.crx tools/chrome/extensions/save-services/box.crx tools/chrome/extensions/save-services/readitlater.crx tools/chrome/extensions/save-services/instapaper.crx tools/chrome/extensions/pick-services/pickhtml.crx tools/chrome/extensions/pick-services/pickbookmark.crx tools/chrome/extensions/pick-services/pickscreenshot.crx
./packcrx.sh tools/chrome/extensions/share tools/chrome/key.pem
./packcrx.sh tools/chrome/extensions/shorten tools/chrome/key.pem
./packcrx.sh tools/chrome/extensions/desktop tools/chrome/key.pem
./packcrx.sh tools/chrome/extensions/edit tools/chrome/key.pem
+tools/chrome/extensions/share-services/imgur/manifest.json: tools/chrome/extensions/share-services/imgur-manifest.json
+ cat ./tools/chrome/extensions/share-services/imgur-manifest.json | sed 's|"version":.*|"version": "$(NOW)",|' > ./tools/chrome/extensions/share-services/imgur/manifest.json
+
+tools/chrome/extensions/share-services/imgur.crx: tools/chrome/extensions/share-services/imgur/manifest.json tools/chrome/extensions/share-services/imgur/launch.html
+ ./packcrx.sh tools/chrome/extensions/share-services/imgur tools/chrome/key.pem
+
tools/chrome/extensions/save-services/instapaper/manifest.json:
cat ./tools/chrome/extensions/save-services/instapaper-manifest.json | sed 's|"version":.*|"version": "$(NOW)",|' > ./tools/chrome/extensions/save-services/instapaper/manifest.json
@@ -69,6 +69,12 @@ var updateImage = function(data) {
if(data.constructor.name == "Blob" || data instanceof Blob) {
url = webkitURL.createObjectURL(data);
}
+ else if(data.constructor.name == "ArrayBuffer" || data instanceof ArrayBuffer) {
+ var bb = new WebKitBlobBuilder();
+ bb.append(data);
+ var blobData = bb.getBlob();
+ url = webkitURL.createObjectURL(blobData);
+ }
var img = $('#image');
img.load(function() {
No changes.
@@ -0,0 +1,28 @@
+{
+ "name": "To Twitter",
+ "version": "1.0.0.5",
+ "icons" : {
+ "128" : "128.png"
+ },
+ "app" : {
+ "urls" : ["http://demos.webintents.org/twitter/"],
+ "launch" : {
+ "web_url" : "http://demos.webintents.org/twitter/twitter_inline.html"
+ }
+ },
+ "intents": {
+ "http://webintents.org/share" : [{
+ "type" : ["image/jpeg", "image/jpg", "image/png", "image/bmp"],
+ "title" : "Share image with Twitter"
+ },
+ {
+ "type" : ["text/uri-list"],
+ "title" : "Share link with Twitter"
+ },
+ {
+ "type" : ["text/*"],
+ "title" : "Share text with Twitter"
+ }
+ ]
+ }
+}
@@ -1,16 +1,33 @@
<!doctype html>
<html>
<head>
+ <script src="http://platform.twitter.com/anywhere.js?id=aB60A3n7LHJq9AM214Vzw" type="text/javascript"></script>
<script src="//webintents.org/webintents.min.js"></script>
- <script>
- window.intent = window.intent || window.webkitIntent;
- if(window.intent) {
- if(window.intent.type.indexOf("text/") == 0) {
- var href = "https://twitter.com/intent/tweet?url=" +
- encodeURI(window.intent.data);
- window.location = href;
- }
- }
- </script>
+ <script src="//webintents.org/webintents-prefix.js"></script>
</head>
+ <body>
+ <span id="login"></span>
+ <script type="text/javascript">
+ twttr.anywhere(function (T) {
+ T("#login").connectButton();
+ });
+ </script>
+ <div id="tbox"></div>
+ </body>
+ <script>
+ if(window.intent) {
+ if(window.intent.type.indexOf("text/") == 0) {
+ twttr.anywhere(function (T) {
+ T("#tbox").tweetBox({
+ height: 100,
+ width: 400,
+ defaultContent: window.intent.data
+ });
+ });
+ }
+ else if(window.intent.type.indexOf("image/") === 0) {
+
+ }
+ }
+ </script>
</html>
View
@@ -8,6 +8,7 @@
import demos.mememator.handlers
import demos.shortener.handlers
import demos.instapaper.handlers
+import demos.cloudfilepicker.handlers
import demos.imgur.handlers
import demos.inspirationmator.handlers
@@ -67,6 +68,7 @@
Route('/<:.*>', handlers_base.PageHandler, 'demos/binhexdec'),
]),
routes.DomainRoute('www.cloudfilepicker.com', [
+ Route('/proxy', demos.cloudfilepicker.handlers.ProxyHandler, 'demos/cloudfilepicker'),
Route('/<:.*>', handlers_base.PageHandler, 'demos/cloudfilepicker'),
]),
routes.DomainRoute('www.mememator.com', [
@@ -45,17 +45,37 @@ function invoke() {
<h2>Data Formats</h2>
- <p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
+ <p>Clients and services can only interact with each other if they both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
<dl id="dataformats">
<dt>image/*</dt>
- <dd><pre>[ <i>string uri</i> ] || <i>string uri</i></pre></dd>
+ <dd>
+ <p>Client and Service should expect to recieve data in any of the following formats:</p>
+ <ul>
+ <li>Blob
+ <li>DataURI
+ <li>URL
+ </ul>
+ <h3>Managing Blobs</h3>
+ <h4>Client application</h4>
+ <script src="https://gist.github.com/2853817.js?file=gistfile1.js"></script>
+ <h4>Service application</h4>
+ <script src="https://gist.github.com/2853874.js"> </script>
+ <h3>Managing URI's</h3>
+ <h4>Client application</h4>
+ <script src="https://gist.github.com/2853982.js"> </script>
+ </dd>
<dt>audio/*</dt>
<dd><pre>[ <i>string uri</i> ] || <i>string uri</i></pre></dd>
<dt>video/*</dt>
<dd><pre>[ <i>string uri</i> ] || <i>string uri</i></pre></dd>
- <dt>text/uri-list</dt>
+ <dt>text/*</dt>
<dd><pre>[ <i>string uri</i> ] || <i>string uri</i></pre></dd>
+ <dt>text/uri-list</dt>
+ <dd>
+ <p>Client and Service should expect to recieve data in the form of a string containing a fully formed URI</p>
+ <h3>Saving a URI</h3>
+ <script src="https://gist.github.com/2854138.js"> </script>
</dl>
</section>
{% endblock %}
Binary file not shown.
@@ -0,0 +1,15 @@
+{
+ "name": "Pick file from computer",
+ "version": "0.0.0.3",
+ "icons" : {
+ "16" : "favicon.ico",
+ "128" : "128.png"
+ },
+ "intents" : {
+ "http://webintents.org/pick" : [{
+ "type" : ["*"],
+ "href" : "/pick.html",
+ "disposition": "inline"
+ }]
+ }
+}
Binary file not shown.
Oops, something went wrong.

0 comments on commit a4e0e8f

Please sign in to comment.