Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Evernote function #974

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Evernote function
  • Loading branch information
kokufu committed Apr 25, 2016
commit facbfa575fce096948855350531f21a87f64021c
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"flowchart": "https://github.com/adrai/flowchart.js.git#751717d3db6437def9a5f8b1cb73e8bb81b5833a",
"monetizejs": "~0.2.0",
"MathJax": "2.6.1",
"alertify.js": "https://github.com/fabien-d/alertify.js.git#fc2e06fa39873363dda199204b8544119ab060bf"
"alertify.js": "https://github.com/fabien-d/alertify.js.git#fc2e06fa39873363dda199204b8544119ab060bf",
"js-md5": "md5#^0.4.1"
},
"main": [
"/public/res/main.js",
Expand Down
27 changes: 27 additions & 0 deletions public/html/evernote-oauth.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
function getParameter(name) {
var regex = new RegExp(name + "=(.+?)(&|$)");
try {
return decodeURIComponent(regex.exec(location.search)[1]);
} catch (e) {
return undefined;
}
}
// It's better to use constants.EVERNOTE_PROXY_URL
// TODO Resarch
var proxyServerAddr = "https://serene-forest-38715.herokuapp.com";

var oauthAccessToken = getParameter("oauthAccessToken");
if (!oauthAccessToken) {
var selfAddr = window.location.href.replace(/window.location.search/, "");
window.location.href = proxyServerAddr + "/oauth?callbackurl=" + selfAddr;
} else {
localStorage["evernoteAccessToken"] = oauthAccessToken;
window.close();
}
</script>
</head>
</html>
1,381 changes: 1,381 additions & 0 deletions public/libs/evernote-sdk-minified.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/res/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ define([], function() {
constants.TUMBLR_PROXY_URL = "https://stackedit-tumblr-proxy-local.herokuapp.com/";
constants.WORDPRESS_CLIENT_ID = '23361';
constants.WORDPRESS_PROXY_URL = "https://stackedit-io-wordpress-proxy.herokuapp.com/";
// TODO Change this and the url in "public/html/evernote-oauth.html"
constants.EVERNOTE_PROXY_URL = "https://serene-forest-38715.herokuapp.com";

if(location.hostname.indexOf("stackedit.io") === 0) {
constants.BASE_URL = constants.MAIN_URL;
Expand Down
Loading