This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5439 from chrisvargauk/twitter_share_-_franciscos…
…_push Bug 804072 - [Twitter share] - First edition
- Loading branch information
Showing
26 changed files
with
1,865 additions
and
0 deletions.
There are no files selected for viewing
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,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="pragma" content="no-cache" /> | ||
<title>Image Uploader</title> | ||
|
||
<link rel="stylesheet" type="text/css" href="style/twittershare.css"/> | ||
<link rel="stylesheet" type="text/css" href="style/custom_dialog.css"/> | ||
|
||
<script type="text/javascript" src="shared/js/custom_dialog.js"></script> | ||
<script defer type="application/javascript" src="js/activities.js"></script> | ||
<script defer type="application/javascript" src="js/ext/sha1.js"></script> | ||
<script defer type="application/javascript" src="js/ext/oauth.js"></script> | ||
<script defer type="application/javascript" src="js/twittershare.js"></script> | ||
</head> | ||
<body role="application"> | ||
<section role="region"> | ||
<header aria-level="1"> | ||
<button id="closeActivity"><span class="icon icon-close">close</span></button> | ||
<menu type="toolbar"> | ||
<button id="btnSend">Tweet</button> | ||
<button id="btnSigninOut">Login</button> | ||
</menu> | ||
<h1>Twitter</h1> | ||
</header> | ||
</section> | ||
|
||
<section role="region" class="body"> | ||
<div class="user_details"> | ||
<img id="user_detail_img" src="style/images/default_profile_2_normal.png"/> | ||
<div id="user_detail_full_name">Full Name</div> | ||
<div id="user_detail_screenName">@ScreenName</div> | ||
</div> | ||
|
||
<div class="msg_area"> | ||
<div id="img_container"> | ||
<img src=""/> | ||
</div> | ||
<div id="counter">140</div> | ||
<textarea id="msg_input" placeholder="Type your tweet here.."></textarea> | ||
</div> | ||
|
||
<div id="notification"> | ||
<div id="title">Title</div> | ||
<div id="msg">msg</div> | ||
<progress></progress> | ||
</div> | ||
</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,49 @@ | ||
'use strict'; | ||
|
||
var ActivityHandler = (function Handler() { | ||
var _currentActivity = null; | ||
var _image = null; | ||
|
||
var handleActivity = function handleActivity(activity) { | ||
this._currentActivity = activity; | ||
|
||
if (!activity.source.data.urls || | ||
activity.source.data.urls.length == 0) { | ||
this.postCancel(); | ||
return; | ||
} | ||
|
||
this._image = activity.source.data.urls[0]; | ||
var event = new CustomEvent('onImageReceived', { | ||
detail: { | ||
data: this._image | ||
} | ||
}); | ||
|
||
document.dispatchEvent(event); | ||
}; | ||
|
||
var postCancel = function postCancel() { | ||
this._currentActivity.postError('canceled'); | ||
this._currentActivity = null; | ||
}; | ||
|
||
var postSuccess = function postSuccess() { | ||
this._currentActivity.postResult({result: 'ok'}); | ||
this._currentActivity = null; | ||
}; | ||
|
||
var getImage = function getImage() { | ||
return this._image; | ||
}; | ||
|
||
return { | ||
'handleActivity': handleActivity, | ||
'getImage': getImage, | ||
'postCancel': postCancel, | ||
'postSuccess': postSuccess | ||
}; | ||
})(); | ||
|
||
window.navigator.mozSetMessageHandler('activity', | ||
ActivityHandler.handleActivity.bind(ActivityHandler)); |
Oops, something went wrong.