Permalink
Browse files

Replace the Start button with Facebook brand for Facebook panel

  • Loading branch information...
1 parent 34290a4 commit 43151033816e89fdaa9ae790cda0243e9104a96a @timdream committed Nov 2, 2014
Showing with 19 additions and 2 deletions.
  1. +13 −0 assets/source-dialog-view.js
  2. +2 −0 index.html
  3. +2 −1 locales/wordcloud.en-US.properties
  4. +2 −1 locales/wordcloud.zh-TW.properties
@@ -9,6 +9,7 @@ var SourceDialogView = function SourceDialogView(opts) {
menuElement: 'wc-source-menu',
selectionElement: 'wc-source-selection',
startBtnElement: 'wc-source-start-btn',
+ loginFacebookBtnElement: 'wc-source-login-facebook-btn',
panelContainerElement: 'wc-source-panels',
aboutBtnElement: 'wc-source-about-btn'
});
@@ -29,6 +30,7 @@ var SourceDialogView = function SourceDialogView(opts) {
this.menuElement.addEventListener('click', this);
this.selectionElement.addEventListener('change', this);
this.startBtnElement.addEventListener('click', this);
+ this.loginFacebookBtnElement.addEventListener('click', this);
this.panelContainerElement.addEventListener('submit', this);
this.aboutBtnElement.addEventListener('click', this);
};
@@ -71,6 +73,7 @@ SourceDialogView.prototype.handleEvent = function sd_handleEvent(evt) {
break;
case this.startBtnElement:
+ case this.loginFacebookBtnElement:
this.currentPanel.submit();
break;
}
@@ -83,6 +86,16 @@ SourceDialogView.prototype.showPanel = function sd_showPanel(panel) {
this.currentPanel.hide();
}
+ // XXX special handling for Facebook.
+ // TODO: Update the button rendering when the permission status changes
+ if (panel.name === 'facebook' && !panel.hasPermission) {
+ this.startBtnElement.hidden = true;
+ this.loginFacebookBtnElement.hidden = false;
+ } else {
+ this.startBtnElement.hidden = false;
+ this.loginFacebookBtnElement.hidden = true;
+ }
+
panel.show();
this.currentPanel = panel;
if (this.app) {
View
@@ -309,6 +309,8 @@ <h4 data-l10n-id="browser-partial-support-title"></h4>
<button data-l10n-id="source-dialog-start-btn" id="wc-source-start-btn" class="btn btn-primary"></button>
+ <button id="wc-source-login-facebook-btn" class="btn btn-primary" hidden><i class="favicons-facebook"></i> <span data-l10n-id="source-dialog-login-facebook-btn"></span></button>
+
</div>
</div>
@@ -4,6 +4,7 @@ app-title=HTML5 Word Cloud
source-dialog-title=HTML5 Word Cloud
source-dialog-about-btn=About
source-dialog-start-btn=Start
+source-dialog-login-facebook-btn=Login with Facebook
source-blogger=Blogger
source-cp=Copy & Paste
@@ -140,7 +141,7 @@ need-facebook-login=You need to log into Facebook first.
share-to-tumblr=Share to Tumblr
facebook-ready=Logged in to Facebook. Press "Start" to load your News Feed.
-facebook-start-to-login=Press "Start" to log into Facebook.
+facebook-start-to-login=You need to login with Facebook first. Word Cloud would need to access your news feed to analyze your stories.
google-ready=Logged in to Google. Press "Start" to load the profile.
google-start-to-login=Press "Start" to log into Google.
@@ -4,6 +4,7 @@ app-title=HTML5 文字雲
source-dialog-title=HTML5 文字雲
source-dialog-about-btn=關於
source-dialog-start-btn=開始
+source-dialog-login-facebook-btn=登入 Facebook
source-blogger=Blogger
source-cp=複製/貼上文字
@@ -140,7 +141,7 @@ need-facebook-login=您需要先登入 Facebook。
share-to-tumblr=分享至 Tumblr
facebook-ready=已登入 Facebook,按「開始」載入個人動態時報。
-facebook-start-to-login=按「開始」,登入 Facebook。
+facebook-start-to-login=您需要登入 Facebook。文字雲需要您的動態時報權限才能產生您的專屬文字雲
google-ready=已登入 Google,按「開始」載入頁面內容。
google-start-to-login=按「開始」,登入 Google。

0 comments on commit 4315103

Please sign in to comment.