Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

subscribe.html is also using the frontend.js

  • Loading branch information...
commit 592b2b411be6420fcbd04b3e621dc2c0a9b2d949 1 parent 08d291b
Julien Genestoux julien51 authored
2  Rakefile
View
@@ -87,7 +87,7 @@ def manifest(destination = "")
end
end
-build_tasks = [:frontend, :background, :subscribe, :tests]
+build_tasks = [:frontend, :background, :tests]
task :build => build_tasks.map() { |t| :"build:#{t}" } + [:'build:run_plugins']
namespace :build do
100 splash.html
View
@@ -1,100 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en-US">
-<head>
- <meta charset="UTF-8">
- <title>Msgboy</title>
- <meta name="application-name" content="Msgboy"/>
- <link rel="stylesheet" href="./views/css/bootstrap.min.css" />
- <link rel="stylesheet" href="./views/css/full.css" />
- <link rel="stylesheet" href="./views/css/splash.css" />
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script type="text/javascript" src="./src/bootstrap-modal.js"></script>
- <script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-22746593-1']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
-</head>
-<body class="splash">
- <div class="social-share-btns">
- <!-- TWITTER -->
- <a href="https://twitter.com/themsgboy" class="twitter-follow-button" data-show-count="false" data-dnt="true">Follow @themsgboy</a>
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-
-
- <!-- GOOGLE +-->
- <!-- Place this tag where you want the +1 button to render -->
- <g:plusone size="medium" href="http://msgboy.com"></g:plusone>
-
- <!-- Place this render call where appropriate -->
- <script type="text/javascript">
- (function() {
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
- })();
- </script>
- </div>
-
- <div class="container">
- <h1><a href="http://msgboy.com">msgboy</a></h1>
- <div id="download">
- <h2>A live stream of the stories you want</h2>
- <script>
- if( navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
- $('<a id="install" data-toggle="modal" href="#installMsgboy">install msgboy for Google Chrome</a>').appendTo($('#download'))
- }
- else {
- $('<a id="no-install" target="_blank" href="https://www.google.com/chrome">use Google Chrome to install</a>').appendTo($('#download'))
- }
- </script>
- </div>
- <img id="screenshot" src="./views/images/splash/splash-screenshot.png" />
- <img id="signal" src="./views/images/mb-signal.png" />
- </div>
- <div class="footer">
- <div class="container">
- <div class="row">
- <div class="span4">
- <h3>Smart + Customizable</h3>
- <p>Msgboy delivers a custom feed of stories in realtime, all based on websites you've bookmarked and visited most often. You can customize your feed so you see more of what you want and less of what you don't.</p>
- </div>
- <div class="span4">
- <h3>Private + Secure</h3>
- <p>Preserving privacy while delivering a powerful, custom experience is msgboy's strong suit. The Chrome application runs locally and all data stays on your machine—nothing comes back to us. Your data stays with you and is never sent to any server.</p>
- </div>
- <div class="span4">
- <h3>Open Source</h3>
- <p><a href="http://superfeedr.com/">We</a> are strong believers in the <em>open source</em> movement, and Msgboy's code is made publicly available on <a href="https://github.com/superfeedr/msgboy">GitHub</a>. You can help make it better by improving its code, by <a href="https://github.com/superfeedr/msgboy/issues">reporting errors</a> and asking questions.</p>
- <div id="chrome-store">
- <a href="https://chrome.google.com/webstore">Available in the chrome web store</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal hide" id="installMsgboy">
- <div class="modal-header">
- <button class="close" data-dismiss="modal">×</button>
- <h3>A quick note</h3>
- </div>
- <div class="modal-body">
- <img src="./views/images/splash/splash-warning.jpg" />
- <p>When you install Msgboy, Google Chrome&trade; will ask if Msgboy can access some of your user data.</p>
- <p>Msgboy stores your data locally, on your own machine. So while the app uses this information, <strong>it never sends it to anyone else.</strong></p>
- <p><strong>Rest easy. Your information is secure.</strong></p>
- </div>
- <div class="modal-footer">
- <a id="install-lg" href="http://msg.by/install-it">install msgboy</a>
- <p>Install Msgboy using Google Chrome&trade;</p>
- </div>
- </div>
-</body>
-</html>
1  src/frontend.js
View
@@ -3,3 +3,4 @@ require('./options.js');
require('./signup.js');
require('./subscriptions.js');
require('./notification.js');
+require('./subscribe.js');
68 src/subscribe.js
View
@@ -3,38 +3,50 @@ var Feediscovery = require('./feediscovery.js').Feediscovery;
var $ = require('jquery');
require('./bootstrap-button.js');
-Msgboy.bind("loaded", function () {
+Msgboy.bind("loaded:subscribe", function () {
// console.log(window.webkitIntent.action); // We need to check that and differentiate between "subscribe" and "view". Do we?
var feedUrl = window.webkitIntent.data; // That is the url... We need to put it in feediscovery!
-
+ console.log(feedUrl);
Feediscovery.get(feedUrl, function (links) {
- for(var i = 0; i < links.length; i++) {
- var link = links[i];
- if(link.rel == "self") {
- var inner = '<h2>' + link.title + '</h2> \
- <p>Once subscribed, new messages from <em>' + link.title + '</em> will be added to your dashboard. </p>\
- <p style="text-align:center; width:80%">\
- <button class="btn large" id="cancelBtn">Close</button>&nbsp;\
- <button class="btn primary large" id="subscribeBtn" data-loading-text="Subscribing...">Subscribe</button>\
- </p>';
- $("#subscribe").html(inner);
- $('.btn').button();
- $("#cancelBtn").click(function() {
- window.close();
- });
- $("#subscribeBtn").click(function() {
- $("#subscribeBtn").button('loading');
- chrome.extension.sendRequest({
- signature: "subscribe",
- params: {
- title: link.title,
- url: feedUrl
- }
- }, function (response) {
- $("#subscribeBtn").html('Subscribed');
- $("#subscribeBtn").addClass("icon-ok");
+ if(links.length == 0) {
+ var inner = '<h2>No feed</h2> \
+ <p>We couldn\'t find any feed to which the msgboy could subscribe. Sorry about that.</p>\
+ <p style="text-align:center; width:80%">\
+ <button class="btn btn-large" id="cancelBtn">Close</button>&nbsp;\
+ </p>';
+ $("#subscribe").html(inner);
+ $("#cancelBtn").click(function() {
+ window.close();
+ });
+ }
+ else {
+ for(var i = 0; i < links.length; i++) {
+ var link = links[i];
+ if(link.rel == "self") {
+ var inner = '<h2>' + link.title + '</h2> \
+ <p>Once subscribed, new messages from <em>' + link.title + '</em> will be added to your dashboard. </p>\
+ <p style="text-align:center; width:80%">\
+ <button class="btn btn-large" id="cancelBtn">Close</button>&nbsp;\
+ <button class="btn btn-primary btn-large" id="subscribeBtn" data-loading-text="Subscribing...">Subscribe</button>\
+ </p>';
+ $("#subscribe").html(inner);
+ $('.btn').button();
+ $("#cancelBtn").click(function() {
+ window.close();
+ });
+ $("#subscribeBtn").click(function() {
+ $("#subscribeBtn").button('loading');
+ chrome.extension.sendRequest({
+ signature: "subscribe",
+ params: {
+ title: link.title,
+ url: feedUrl
+ }
+ }, function (response) {
+ $("#subscribeBtn").html('<i class="icon-ok icon-white"></i> Subscribed');
+ });
});
- });
+ }
}
}
});
4 views/html/subscribe.html
View
@@ -8,10 +8,10 @@
<link rel="stylesheet" href="../css/header.css" />
<link rel="stylesheet" href="../css/full.css" />
- <script src="../js/subscribe.js" type="text/javascript"></script>
+ <script src="../js/frontend.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function () {
- Msgboy.run();
+ Msgboy.run('subscribe');
};
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.