Permalink
Browse files

+ Google plus UI

  • Loading branch information...
1 parent 3c6e20e commit fc336777e8af3673653f2767fde9b04561e2e938 @timdream timdream committed Sep 17, 2011
Showing with 38 additions and 1 deletion.
  1. +5 −0 en/index.html
  2. +28 −1 wordcloud.js
  3. +5 −0 zh/index.html
View
@@ -73,6 +73,7 @@ <h2>Text Source for Word Clouds</h2>
<label><input type="radio" name="source" value="blog:blogger" /> Blogger</label>
<label><input type="radio" name="source" value="blog:twitter"/> Twitter</label>
<label><input type="radio" name="source" value="fbok"/> Facebook</label>
+ <label><input type="radio" name="source" value="goog"/> Google+</label>
</p>
<hr />
<div id="demo_entry" class="entry">
@@ -109,6 +110,10 @@ <h2>Text Source for Word Clouds</h2>
</div>
<div id="fbok_entry" class="entry">
<p>Loading...</p>
+ </div>
+ <div id="goog_entry" class="entry">
+ <p><label><input type="radio" name="goog_type" id="goog_type_me" checked="checked" /> My Posts</label></p>
+ <p><input type="radio" name="goog_type" id="goog_type_userid" /> <label>Profile URL:<input type="url" size="30" id="goog_url" /></label></p>
</div>
<button type="submit" id="source_panel_finish">Start</button>
</form>
View
@@ -374,7 +374,14 @@ jQuery(function ($) {
'click',
changeSource
);
-
+
+ $('#goog_url').bind(
+ 'click',
+ function () {
+ $('#goog_type_userid').attr('checked', true);
+ }
+ );
+
// Do this manually for Mobile Safari as a workaround
$s.parent('label').bind(
'click',
@@ -439,6 +446,26 @@ jQuery(function ($) {
window.location.hash = '#facebook:me';
//window.location.hash = '#facebook:' + fbUser.id; // hide the feature for now
break;
+ case 'goog':
+ if ($('#goog_type_me')[0].checked) {
+ if (GO2.isLoggedIn()) {
+ window.location.hash = '#googleplus:me';
+ } else {
+ GO2.getToken(
+ function (token) {
+ window.location.hash = '#googleplus:me';
+ }
+ );
+ }
+ } else if (
+ $('#goog_type_userid')[0].checked
+ && /^https?:\/\/plus\.google\.com\/\d+/i.test($('#goog_url').val())
+ ) {
+ window.location.hash = '#googleplus:'
+ + $.trim($('#goog_url').val()).replace(/^https?:\/\/plus\.google\.com\/(\d+).*$/i, '$1');
+ }
+ return false;
+ break;
}
return false;
}
View
@@ -76,6 +76,7 @@ <h2>詞彙分析文字來源</h2>
<label><input type="radio" name="source" value="blog:plurk"/> 噗浪</label>
<label><input type="radio" name="source" value="blog:twitter"/> Twitter</label>
<label><input type="radio" name="source" value="fbok"/> Facebook</label>
+ <label><input type="radio" name="source" value="goog"/> Google+</label>
</p>
<hr />
<div id="demo_entry" class="entry">
@@ -113,6 +114,10 @@ <h2>詞彙分析文字來源</h2>
</div>
<div id="fbok_entry" class="entry">
<p>讀取中…</p>
+ </div>
+ <div id="goog_entry" class="entry">
+ <p><label><input type="radio" name="goog_type" id="goog_type_me" checked="checked" /> 我的文章</label></p>
+ <p><input type="radio" name="goog_type" id="goog_type_userid" /> <label>個人頁面網址:<input type="url" size="30" id="goog_url" /></label></p>
</div>
<button type="submit" id="source_panel_finish">開始</button>
</form>

0 comments on commit fc33677

Please sign in to comment.