Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from chriskyfung/glitch
Browse files Browse the repository at this point in the history
🐚🔥 Updated with Glitch
  • Loading branch information
Chris K.Y. FUNG authored Oct 27, 2018
2 parents 3d6f180 + f03b5c9 commit 9a9206b
Show file tree
Hide file tree
Showing 8 changed files with 463 additions and 542 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"//2": "https://docs.npmjs.com/files/package.json",
"//3": "updating this file will download and update your packages",
"name": "ezSFbMaster",
"version": "2.1.0",
"version": "2.1.3",
"description": "A web-application for 達人圈子 members to streamline facebook-slack like clicking workflow.",
"main": "server.js",
"scripts": {
Expand All @@ -20,10 +20,11 @@
"body-parser": "^1.18.3",
"cookie-parser": "^1.4.3",
"passport-slack-oauth2": "^1.0.0",
"@slack/client": "^4.3.1",
"jwt-simple": "^0.5.1",
"@slack/client": "^4.6.0",
"jwt-simple": "^0.5.5",
"sqlite3": "^4.0.2",
"sqlite-sync": "^0.3.6"
"sqlite-sync": "^0.3.6",
"slack-events-listener": "^1.1.0"
},
"engines": {
"node": "8.x"
Expand Down
18 changes: 13 additions & 5 deletions public/foo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ $(document).ready(function() {
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
FB.XFBML.parse();
showHideBtn();
} else {
$container.html('<h2>There is a problem</h2><p>' + response.error);
}
Expand Down Expand Up @@ -87,7 +88,7 @@ function embedFB_ui(i, url, ts, isliked) {
// Display URL as caption
htmltxt += '<br><a href="' + url + '" target="_blank">在Facebook開啟</a>&nbsp;&nbsp;&nbsp;';
// Display a correspending button
htmltxt += '<button class="marks" id="markbtn' + i + '" type="submit" value="' + ts + '">標記到Slack</button>';
htmltxt += '<button class="marks" id="markbtn' + i + '" type="submit" value="' + ts + '">標記到<i class="fa fa-slack"></i>slack</button>';
if (isliked){ htmltxt += ' <i class="fa fa-check-circle" style="color:green"></i>'; }
htmltxt += '</div>';
return htmltxt;
Expand Down Expand Up @@ -129,10 +130,17 @@ $(document).on("click", "#hide", function(e){
$('.liked-post').hide();
$(this).val('true');
$(this).html('顯示Liked');
$(this).after(' <i class="fa fa-eye-slash"></i>');
}
else {
$('.liked-post').show();
$(this).val('false');
$(this).html('隱藏Liked');
showHideBtn();
}
});
});

function showHideBtn() {
$('.liked-post').show();
var x = $('#hide');
x.val('false');
x.html('隱藏Liked');
x.next('i').remove();
};
4 changes: 2 additions & 2 deletions public/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function sortAdjacency(b, a) {

function getFetch(action, data) {
var $container = $('#container');
$container.html('<h2>正在從伺服器下載數據記錄,可能需要一分鐘處理,請稍候。</h2>');
$container.html('<h2>正在從伺服器下載數據記錄,可能需要一分鐘處理,請稍候。 <i class="fa fa-spinner fa-spin" style="font-size:24px"></i></h2>');
$.ajax({
url: action,
type: 'get',
Expand All @@ -37,7 +37,7 @@ function getFetch(action, data) {
success: function (response) {
if(response.success) {
$container.html('');
$container.append('<table id="HistoryTable" class="tablesorter"><col id="col1" width="150"><col id="col2" width="75"><col id="col3"><col id="col4" width="75"><col id="col5" width="75"><thead><tr><th class="header">達人用戶</th><th class="header">發佈<br>帖數</th><th class="header">粉絲反應數目</th><th class="header">返回<br>數目</th><th class="header">GTR</th></tr></thead><tbody></tbody>');
$container.append('<table id="HistoryTable" class="tablesorter"><col id="col1" width="150"><col id="col2" width="75"><col id="col3"><col id="col4" width="75"><col id="col5" width="75"><thead><tr><th class="header">達人用戶</th><th class="header">發佈<br>帖數</th><th class="header">粉絲反應數目</th><th class="header">回讚<br>數目</th><th class="header">GTR</th></tr></thead><tbody></tbody>');
for (var i= 0; i < response.users.length; i++) {
var user = response.users[i];
var adjacency = Object.values(user.adjacency);
Expand Down
Loading

0 comments on commit 9a9206b

Please # to comment.