Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit ff94212

Browse files
committed
Add a reminder to share the news about OpenBazaar, with social sharing buttons.
1 parent 75e5ce6 commit ff94212

File tree

4 files changed

+124
-2
lines changed

4 files changed

+124
-2
lines changed

css/obBase.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4871,6 +4871,60 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
48714871
word-wrap: break-word;
48724872
}
48734873

4874+
.socialReminder {
4875+
position: fixed;
4876+
bottom: -150px;
4877+
right: 0;
4878+
z-index: 1;
4879+
padding: 20px;
4880+
opacity: 0;
4881+
background: #086A9E;
4882+
color: #fff;
4883+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.70);
4884+
transition: bottom 1s, opacity 1s;
4885+
}
4886+
4887+
.socialReminder.show {
4888+
bottom: 0;
4889+
opacity: 1;
4890+
}
4891+
4892+
.socialReminder .socialTitle {
4893+
margin-right: 40px;
4894+
}
4895+
4896+
.socialReminder .closeBtn {
4897+
position: absolute;
4898+
top: 0;
4899+
right: 0;
4900+
padding: 14px;
4901+
cursor: pointer;
4902+
font-size: 12px;
4903+
}
4904+
4905+
.socialReminder .socialLinkWrapper {
4906+
display: flex;
4907+
justify-content: space-between;
4908+
}
4909+
4910+
.socialReminder .socialLink {
4911+
background: #08324A;
4912+
display: block;
4913+
padding: 10px;
4914+
border-radius: 50%;
4915+
width: 44px;
4916+
height: 44px;
4917+
text-align: center;
4918+
}
4919+
4920+
.socialReminder .socialIcon {
4921+
font-size: 28px;
4922+
}
4923+
4924+
.socialReminder .socialIcon:before {
4925+
line-height: 44px;
4926+
}
4927+
48744928
/*========== utility classes ==========*/
48754929

48764930
/* the #ov1 id is on the HTML tag. It is used to force specificity

js/languages/en-US.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,16 @@
731731
"newConfigTitle": "New Configuration",
732732
"new": "New"
733733
},
734+
"socialSharing": {
735+
"title": "OpenBazaar",
736+
"blurb": "OpenBazaar%20is%20a%20decentralized%2C%20P2P%20Bitcoin%20Marketplace.",
737+
"shareTwitter": "Share on Twitter",
738+
"shareFacebook": "Share on Facebook",
739+
"sharePinterest": "Share on Pinterest",
740+
"shareLinkedIn": "Share on LinkedIn",
741+
"shareTumblr": "Share on Tumblr",
742+
"reminder": "Help Spread the Word About OpenBazaar"
743+
},
734744
"langChangeRestartTitle": "Restart needed for language change",
735745
"langChangeRestartMessage": "In order for your language change to fully take effect, you must restart the app.",
736746
"restartNow": "Restart Now",

js/templates/pageNav.html

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,28 @@
7070
<span class="ion-android-favorite fontSize11 marginRight2 textOpacity1"></span>
7171
<%= polyglot.t('nav.support') %>
7272
</a>
73+
<hr/>
74+
<% var shareURL = "https%3A%2F%2Fopenbazaar.org" %>
75+
<a href="https://twitter.com/intent/tweet/?text=<%= polyglot.t('socialSharing.blurb') %>&url=<%= shareURL %>&hashtags=OpenBazaar&related=openbazaar%3AOpenBazaar,News%20about%20OpenBazaar">
76+
<span class="ion-social-twitter fontSize11 marginRight2 textOpacity1"></span>
77+
Twitter
78+
</a>
79+
<a href="https://www.facebook.com/sharer/sharer.php?u=<%= shareURL %>">
80+
<span class="ion-social-facebook fontSize11 marginRight2 textOpacity1"></span>
81+
Facebook
82+
</a>
83+
<a href=http://pinterest.com/pin/create/button/?url=<%= shareURL %>&description=<%= polyglot.t('socialSharing.blurb') %>">
84+
<span class="ion-social-pinterest fontSize11 marginRight2 textOpacity1"></span>
85+
Pinterest
86+
</a>
87+
<a href="https://www.linkedin.com/shareArticle?mini=true&url=<%= shareURL %>&title=<%= polyglot.t('socialSharing.title') %>&summary=<%= polyglot.t('socialSharing.blurb') %>&source=OpenBazaar">
88+
<span class="ion-social-linkedin fontSize11 marginRight2 textOpacity1"></span>
89+
LinkedIn
90+
</a>
91+
<a href="http://www.tumblr.com/share/link?url=<%= shareURL %>&name=OpenBazaar&description=<%= polyglot.t('socialSharing.blurb') %>">
92+
<span class="ion-social-tumblr fontSize11 marginRight2 textOpacity1"></span>
93+
Tumblr
94+
</a>
7395
</div>
7496

7597
<div class="js-serverSubmenu popMenu-navBarSubMenu popMenu-navBarSubMenu-servers"></div>
@@ -96,7 +118,7 @@
96118
<%= polyglot.t('nav.testMode') %>
97119
</div>
98120
<% } %>
99-
121+
100122
</div>
101123
</div>
102124
<div class="ctrlGroup">
@@ -147,3 +169,26 @@ <h3 class="margin0 marginTop25"><%= polyglot.t('Discover') %></h3>
147169
<div class="fontSize11 textOpacity75 marginTop8 marginLeft7 floatLeft js-navDismisslUpdate clickable"><%= polyglot.t('softwareUpdate.dismiss') %></div>
148170
</div>
149171
</div>
172+
173+
<div class="socialReminder js-socialReminder">
174+
<% var shareURL = "https%3A%2F%2Fopenbazaar.org" %>
175+
<h3 class="socialTitle"><%= polyglot.t('socialSharing.reminder') %></h3>
176+
<div class="closeBtn js-socialCloseBtn"><i class="ion-close"></i></div>
177+
<div class="socialLinkWrapper">
178+
<a class="socialLink" href="https://twitter.com/intent/tweet/?text=<%= polyglot.t('socialSharing.blurb') %>&url=<%= shareURL %>&hashtags=OpenBazaar&related=openbazaar%3AOpenBazaar,News%20about%20OpenBazaar">
179+
<span class="ion-social-twitter socialIcon"></span>
180+
</a>
181+
<a class="socialLink" href="https://www.facebook.com/sharer/sharer.php?u=<%= shareURL %>">
182+
<span class="ion-social-facebook socialIcon"></span>
183+
</a>
184+
<a class="socialLink" href=http://pinterest.com/pin/create/button/?url=<%= shareURL %>&description=<%= polyglot.t('socialSharing.blurb') %>">
185+
<span class="ion-social-pinterest socialIcon"></span>
186+
</a>
187+
<a class="socialLink" href="https://www.linkedin.com/shareArticle?mini=true&url=<%= shareURL %>&title=<%= polyglot.t('socialSharing.title') %>&summary=<%= polyglot.t('socialSharing.blurb') %>&source=OpenBazaar">
188+
<span class="ion-social-linkedin socialIcon"></span>
189+
</a>
190+
<a class="socialLink" href="http://www.tumblr.com/share/link?url=<%= shareURL %>&name=OpenBazaar&description=<%= polyglot.t('socialSharing.blurb') %>">
191+
<span class="ion-social-tumblr socialIcon"></span>
192+
</a>
193+
</div>
194+
</div>

js/views/pageNavVw.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ module.exports = baseVw.extend({
4343
'mouseenter .js-serverSubmenuTrigger': 'mouseenterServerSubmenuTrigger',
4444
'mouseleave .js-serverSubmenuTrigger': 'mouseleaveServerSubmenuTrigger',
4545
'mouseenter .js-serverSubmenu': 'mouseenterServerSubmenu',
46-
'mouseleave .js-serverSubmenu': 'mouseleaveServerSubmenu'
46+
'mouseleave .js-serverSubmenu': 'mouseleaveServerSubmenu',
47+
'click .js-socialCloseBtn': 'clickSocialCloseBtn',
4748
},
4849

4950
initialize: function(options){
@@ -377,6 +378,7 @@ module.exports = baseVw.extend({
377378
self.suggestionsVw = new SuggestionsVw({
378379
$input: self.$addressInput
379380
});
381+
self.$socialReminder = self.$('.js-socialReminder');
380382

381383
self.$('.js-mainSearchWrapper').append(self.suggestionsVw.render().el);
382384

@@ -400,11 +402,22 @@ module.exports = baseVw.extend({
400402
self.aboutModal.render();
401403
self.registerChild(self.aboutModal);
402404
}
405+
406+
if (localStorage.getItem('showSocial') !== 'hide') {
407+
setTimeout(function() {
408+
self.$socialReminder.addClass('show');
409+
}, 10000);
410+
}
403411
});
404412

405413
return this;
406414
},
407415

416+
clickSocialCloseBtn: function() {
417+
this.$socialReminder.removeClass('show');
418+
localStorage.setItem('showSocial', 'hide');
419+
},
420+
408421
showAboutModal: function(){
409422
this.cleanNav();
410423
this.aboutModal.setTab('about')

0 commit comments

Comments
 (0)