Skip to content

Commit

Permalink
+ Google plus UI
Browse files Browse the repository at this point in the history
  • Loading branch information
timdream committed Sep 17, 2011
1 parent 3c6e20e commit fc33677
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
5 changes: 5 additions & 0 deletions en/index.html
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down
29 changes: 28 additions & 1 deletion wordcloud.js
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions zh/index.html
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit fc33677

Please sign in to comment.