-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from KazuAlex/v2.0.0-beta1
V2.0.0 beta1
- Loading branch information
Showing
13 changed files
with
1,388 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
config/default.json | ||
config/open_poll.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
{ | ||
"port": 5000, | ||
"command": "openpoll", | ||
"help_link": "https://github.com/kazualex/openpollslack.git", | ||
"client_id": "", | ||
"client_secret": "" | ||
"client_secret": "", | ||
"signing_secret": "", | ||
"state_secret": "CHANGE ME", | ||
"oauth_success": "https://openpoll.slack.alcor.space/?oauth=success", | ||
"oauth_failure": "https://openpoll.slack.alcor.space/?oauth=error" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="slack-app-id" content="ANL7B2FDK" /> | ||
<meta name="slack-app-id" content="A0162QE8600" /> | ||
<link rel="icon" type="image/png" href="/assets/logo.png" /> | ||
<title>Open source poll for slack</title> | ||
<!-- STYLES --> | ||
|
@@ -13,6 +13,14 @@ | |
<script type="text/javascript" src="/assets/js/bootstrap.bundle.min.js"></script> | ||
</head> | ||
<body> | ||
<div class="navigation"> | ||
<div class="up" onclick="goUp()"> | ||
🡅 | ||
</div> | ||
<div class="down" onclick="goDown()"> | ||
🡇 | ||
</div> | ||
</div> | ||
<div id="main"> | ||
<h1> | ||
Open source poll for <img alt="slack" height="180" src="/assets/slack_logo_white.svg" /> | ||
|
@@ -30,7 +38,9 @@ <h1> | |
</div> | ||
</div> | ||
<div> | ||
<a target="_blank" href="https://slack.com/oauth/authorize?scope=commands&client_id=768246087712.768249083461"><img alt="Add to slack" src="https://platform.slack-edge.com/img/[email protected]" srcset="https://platform.slack-edge.com/img/add_to_slack.png 2x, https://platform.slack-edge.com/img/[email protected] 4x" height="80"></a> | ||
<a target="_blank" href="https://slack.com/oauth/v2/authorize?client_id=768246087712.1206830278000&scope=commands,chat:write,chat:write.public&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnN0YWxsT3B0aW9ucyI6eyJzY29wZXMiOlsiY29tbWFuZHMiLCJjaGF0OndyaXRlLnB1YmxpYyIsImNoYXQ6d3JpdGUiXX0sIm5vdyI6IjIwMjAtMDYtMTdUMjA6NTc6MjYuMzI1WiIsImlhdCI6MTU5MjQyNzQ0Nn0.ZmnhLDbqxYGf0SBjqb7PzBXIe0Ud_NQ2RrURg-4va_E"> | ||
<img alt="Add to Slack" src="https://platform.slack-edge.com/img/[email protected]" srcset="https://platform.slack-edge.com/img/add_to_slack.png 2x, https://platform.slack-edge.com/img/[email protected] 4x" height="80" /> | ||
</a> | ||
</div> | ||
</div> | ||
<div id="usage"> | ||
|
@@ -44,7 +54,12 @@ <h2>Simple poll</h2> | |
</div> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<code>/openpoll "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
<div class="command"> | ||
<code>/poll "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
</div> | ||
<div class="image"> | ||
<img src="/assets/poll-simple.png" alt="Simple poll" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -56,7 +71,12 @@ <h2>Anonymous poll</h2> | |
</div> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<code>/openpoll anonymous "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
<div class="command"> | ||
<code>/poll anonymous "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
</div> | ||
<div class="image"> | ||
<img src="/assets/poll-anonymous.png" alt="Anonymous poll" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -68,7 +88,12 @@ <h2>Limited choice poll</h2> | |
</div> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<code>/openpoll limit 2 "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
<div class="command"> | ||
<code>/poll limit 2 "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
</div> | ||
<div class="image"> | ||
<img src="/assets/poll-limited.png" alt="Limited poll" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -80,7 +105,12 @@ <h2>Anonymous limited choice poll</h2> | |
</div> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<code>/openpoll anonymous limit 2 "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
<div class="command"> | ||
<code>/poll anonymous limit 2 "What's you favourite color ?" "Red" "Green" "Blue" "Yellow"</code> | ||
</div> | ||
<div class="image"> | ||
<img src="/assets/poll-both.png" alt="Anonymous limited poll" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -111,6 +141,7 @@ <h2>Need help ?</h2> | |
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const oauth = urlParams.get('oauth'); | ||
|
@@ -121,6 +152,47 @@ <h2>Need help ?</h2> | |
const oauthDiv = document.getElementById('oauth-success'); | ||
oauthDiv.className = 'show'; | ||
} | ||
|
||
function goUp() { | ||
const screenHeight = window.innerHeight; | ||
|
||
let currentY = window.scrollY - (window.scrollY % screenHeight); | ||
let nextY = currentY; | ||
if (0 === (window.scrollY % screenHeight)) { | ||
nextY = currentY - screenHeight; | ||
} | ||
window.scrollTo(window.scrollX, nextY); | ||
} | ||
|
||
function goDown() { | ||
const screenHeight = window.innerHeight; | ||
|
||
let currentY = window.scrollY - (window.scrollY % screenHeight); | ||
let nextY = currentY + screenHeight; | ||
window.scrollTo(window.scrollX, nextY); | ||
} | ||
|
||
const ARROW_LEFT = 37; | ||
const ARROW_UP = 38; | ||
const ARROW_RIGHT = 39; | ||
const ARROW_DOWN = 40; | ||
document.addEventListener('keyup', function(event) { | ||
if ( | ||
ARROW_UP === event.which | ||
|| ARROW_LEFT === event.which | ||
) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
goUp(); | ||
} else if ( | ||
ARROW_DOWN === event.which | ||
|| ARROW_RIGHT === event.which | ||
) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
goDown(); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.