Skip to content

Commit f9ddbb2

Browse files
committed
Merge branch 'feature/payment'
2 parents 5390162 + c6aece3 commit f9ddbb2

File tree

7 files changed

+189
-15
lines changed

7 files changed

+189
-15
lines changed

api/vendor/vendor.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"comment": "",
3+
"ignore": "test",
4+
"package": [
5+
{
6+
"checksumSHA1": "ig3+2HkqNyrrYidhi5yBAzN3A6g=",
7+
"path": "github.com/julsemaan/rest-layer-file",
8+
"revision": "3fd936157a3b00e04a056f2ca90ec4c4c7a53ee9",
9+
"revisionTime": "2016-07-21T01:36:23Z"
10+
},
11+
{
12+
"checksumSHA1": "L/h+D9Uny+GKss3wnHRfKtL1aho=",
13+
"path": "github.com/rs/rest-layer/resource",
14+
"revision": "5f71d116613af91f2d436beadc77d3500f9149d7",
15+
"revisionTime": "2016-09-24T17:02:01Z"
16+
},
17+
{
18+
"checksumSHA1": "XxFWE7lmIxoA99U1FcdVDSZem9U=",
19+
"path": "github.com/rs/rest-layer/rest",
20+
"revision": "5f71d116613af91f2d436beadc77d3500f9149d7",
21+
"revisionTime": "2016-09-24T17:02:01Z"
22+
},
23+
{
24+
"checksumSHA1": "PcKAF3ACz7YJTy541PSZ01MdVpE=",
25+
"path": "github.com/rs/rest-layer/schema",
26+
"revision": "5f71d116613af91f2d436beadc77d3500f9149d7",
27+
"revisionTime": "2016-09-24T17:02:01Z"
28+
},
29+
{
30+
"checksumSHA1": "F6eWi/7Yl/rcMg9h3PWsgYQQkf0=",
31+
"path": "github.com/rs/xid",
32+
"revision": "057f3c928c207d1e7e318929eeac93bb46e319e3",
33+
"revisionTime": "2016-03-15T14:06:58Z"
34+
},
35+
{
36+
"checksumSHA1": "UWjVYmoHlIfHzVIskELHiJQtMOI=",
37+
"path": "golang.org/x/crypto/bcrypt",
38+
"revision": "687d4b818545e443c8ba223cbef20b1721afd4db",
39+
"revisionTime": "2017-11-05T15:18:38Z"
40+
},
41+
{
42+
"checksumSHA1": "oVPHWesOmZ02vLq2fglGvf+AMgk=",
43+
"path": "golang.org/x/crypto/blowfish",
44+
"revision": "687d4b818545e443c8ba223cbef20b1721afd4db",
45+
"revisionTime": "2017-11-05T15:18:38Z"
46+
},
47+
{
48+
"checksumSHA1": "GtamqiJoL7PGHsN454AoffBFMa8=",
49+
"path": "golang.org/x/net/context",
50+
"revision": "01c190206fbdffa42f334f4b2bf2220f50e64920",
51+
"revisionTime": "2017-11-02T18:53:09Z"
52+
},
53+
{
54+
"checksumSHA1": "o5Skl9YjZqmvEEqWie3f3oY0Kow=",
55+
"path": "gopkg.in/alexcesaro/statsd.v2",
56+
"revision": "7fea3f0d2fab1ad973e641e51dba45443a311a90",
57+
"revisionTime": "2016-03-20T18:21:10Z"
58+
}
59+
],
60+
"rootPath": "github.com/julsemaan/anyfile-notepad/api"
61+
}

client/_upgrade.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script id="upgrade" class="template-partial" type="text/x-handlebars-template">
2-
<p>
2+
<p>
33
Anyfile Notepad++ offer an ad-free experience of this application. Paid yearly and costing less than a latte at Starbucks, its a good way to improve your experience with the app as well as encouraging the project.
44
</p>
55

6-
<p>
6+
<p>
77
<h5>This subscription will only be valid for the following Google user account:</h5>
8-
<pre>{{ global_context.application.controllers.google_oauth.current_user.email }}</pre>
9-
</p>
8+
<pre>{{ global_context.application.controllers.google_oauth.current_user.email }}</pre>
9+
</p>
1010

1111
<p>
1212
If you want to upgrade another account, you need to connect it in the app before proceeding.
@@ -18,19 +18,19 @@ <h5>This subscription will only be valid for the following Google user account:<
1818

1919
<hr>
2020

21-
<form action="/api/billing/subscription" method="POST" style="text-align:center">
22-
<input name="user_id" type="hidden" value="{{ global_context.application.controllers.google_oauth.current_user.user_id }}">
23-
<input name="user_email" type="hidden" value="{{ global_context.application.controllers.google_oauth.current_user.email }}">
21+
<form action="/api/billing/subscription" method="POST" style="text-align:center">
22+
<input name="user_id" type="hidden" value="{{ global_context.application.controllers.google_oauth.current_user.user_id }}">
23+
<input name="user_email" type="hidden" value="{{ global_context.application.controllers.google_oauth.current_user.email }}">
2424
<input name="success_url" type="hidden" value="{{ global_context.window.location.protocol }}//{{ global_context.window.location.host }}/site/payment-success.html">
2525
<input name="failure_url" type="hidden" value="{{ global_context.window.location.protocol }}//{{ global_context.window.location.host }}/site/payment-failure.html">
2626
{{{ concat "<scr" "ipt" }}}
27-
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
28-
data-key="pk_test_wd5GkbaroYrTdesoqUZUS3Hc"
29-
data-name="Anyfile Notepad ++"
27+
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
28+
data-key="{{ global_context.window.AFN_VARS.stripe_key }}"
29+
data-name="Anyfile Notepad ++"
3030
data-description="Subscription for {{ global_context.application.controllers.google_oauth.current_user.email }}"
31-
data-amount="399"
32-
data-label="Pay with Stripe">
31+
data-amount="399"
32+
data-label="Pay with Stripe">
3333
{{{ concat "</scr" "ipt>" }}}
34-
</form>
34+
</form>
3535
</script>
3636

client/assets/js/Controller/Application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ ApplicationController.prototype.display_desktop_ads = function() {
101101
else $('.desktop-ads').show();
102102
}, 100);
103103
}
104+
105+
ApplicationController.prototype.popup_upgrade = function() {
106+
new Popup({title : i18n('Upgrade to Anyfile Notepad ++'), hb_partial : '#upgrade', popup_name: 'upgrade',confirm_btn: 'Cancel'});
107+
}

client/assets/js/VARS.js.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ window.AFN_VARS = {
33
google_client_id:"",
44
drive_app_id:"",
55
dropbox_key:"",
6+
stripe_key:"",
67
};
78

client/assets/js/app-main.js.tt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ application.controllers.google_oauth.add_to_queue(function(){
9696
application.setupDevMode();
9797
application.setupLocaleFlash();
9898

99-
var msg = "<a target='_blank' href='/news'>Click here to read our short blog post about the release of version 6</a>";
99+
var msg;
100+
101+
msg = "<a href='javascript:void(0)' onclick='javascript:application.popup_upgrade()'>A paid ad-free version of the app is not available for 3.99$ per year! Click here to signup!</a>"
102+
editor_controller.flash.sticky_success(msg);
103+
104+
msg = "<a target='_blank' href='/news'>Click here to read our short blog post about the release of version 6</a>";
100105
editor_controller.flash.sticky_success(msg, {msg_uid:msg});
101106

102107
msg = "<a target='_blank' href='https://goo.gl/forms/cVpC2svZQqV2Fqbd2'>Click here to answer a short survey and have your word on the app's future!</a>";

client/menu-parts/_help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h5 class="menu_header">{{ i18n "Help" }}</h5>
1515
<li><a href="/site/privacy_policy.html">{{ i18n "Privacy Policy" }}</a></li>
1616

1717
[% IF WITH_ADS %]
18-
<li><a href="{{noaction}}" {{{ m-action-n-close "new Popup({title : i18n('Upgrade to Anyfile Notepad ++'), hb_partial : '#upgrade', popup_name: 'upgrade',confirm_btn: 'Cancel'})" }}}>{{ i18n "Upgrade to ad-free version" }}</a></li>
18+
<li><a href="{{noaction}}" {{{ m-action-n-close "application.popup_upgrade()" }}}>{{ i18n "Upgrade to ad-free version" }}</a></li>
1919
[% ELSE %]
2020
<li><a href="{{noaction}}" {{{ m-action-n-close "new Popup({hb_partial : '#subscription-status', popup_name: 'subscription-status', confirm_btn: 'Close' })" }}}>{{ i18n "Anyfile Notepad++ subscription" }}</a></li>
2121
<li><a href="mailto:[email protected]">E-mail support</a></li>

webserver/vendor/vendor.json

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"comment": "",
3+
"ignore": "test",
4+
"package": [
5+
{
6+
"checksumSHA1": "5rPfda8jFccr3A6heL+JAmi9K9g=",
7+
"path": "github.com/davecgh/go-spew/spew",
8+
"revision": "5215b55f46b2b919f50a1df0eaa5886afe4e3b3d",
9+
"revisionTime": "2015-11-05T21:09:06Z"
10+
},
11+
{
12+
"checksumSHA1": "QeKwBtN2df+j+4stw3bQJ6yO4EY=",
13+
"path": "github.com/gin-contrib/sse",
14+
"revision": "22d885f9ecc78bf4ee5d72b937e4bbcdc58e8cae",
15+
"revisionTime": "2017-01-09T09:34:21Z"
16+
},
17+
{
18+
"checksumSHA1": "cpELhz30Sco7IBwvI6FyuShnjnQ=",
19+
"path": "github.com/gin-gonic/gin",
20+
"revision": "d459835d2b077e44f7c9b453505ee29881d5d12d",
21+
"revisionTime": "2017-07-02T09:28:26Z"
22+
},
23+
{
24+
"checksumSHA1": "YVt5lqmGq95m5tFdiz5pr2BF1Jo=",
25+
"path": "github.com/gin-gonic/gin/binding",
26+
"revision": "d459835d2b077e44f7c9b453505ee29881d5d12d",
27+
"revisionTime": "2017-07-02T09:28:26Z"
28+
},
29+
{
30+
"checksumSHA1": "M3FwiqpVbXwo9t2FyI5/gKxCDKY=",
31+
"path": "github.com/gin-gonic/gin/render",
32+
"revision": "d459835d2b077e44f7c9b453505ee29881d5d12d",
33+
"revisionTime": "2017-07-02T09:28:26Z"
34+
},
35+
{
36+
"checksumSHA1": "yqF125xVSkmfLpIVGrLlfE05IUk=",
37+
"path": "github.com/golang/protobuf/proto",
38+
"revision": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9",
39+
"revisionTime": "2017-10-21T04:39:52Z"
40+
},
41+
{
42+
"checksumSHA1": "y/A5iuvwjytQE2CqVuphQRXR2nI=",
43+
"path": "github.com/mattn/go-isatty",
44+
"revision": "a5cdd64afdee435007ee3e9f6ed4684af949d568",
45+
"revisionTime": "2017-09-25T05:49:04Z"
46+
},
47+
{
48+
"checksumSHA1": "mWDXRM0FGe9BGtsY10vzrgrX2uk=",
49+
"path": "github.com/stripe/stripe-go",
50+
"revision": "a705fb222df92bba0cbc4c190bcbebf7dfe0b0cc",
51+
"revisionTime": "2017-11-02T19:49:50Z"
52+
},
53+
{
54+
"checksumSHA1": "UPcP5J+yPlRtj93LLxJ/fYsU0t4=",
55+
"path": "github.com/stripe/stripe-go/customer",
56+
"revision": "a705fb222df92bba0cbc4c190bcbebf7dfe0b0cc",
57+
"revisionTime": "2017-11-02T19:49:50Z"
58+
},
59+
{
60+
"checksumSHA1": "f3w9bgOzBZozw9qEuPLcQb94EEc=",
61+
"path": "github.com/stripe/stripe-go/form",
62+
"revision": "a705fb222df92bba0cbc4c190bcbebf7dfe0b0cc",
63+
"revisionTime": "2017-11-02T19:49:50Z"
64+
},
65+
{
66+
"checksumSHA1": "y5AD80EvDutFqGuAYsBtcya6ntM=",
67+
"path": "github.com/stripe/stripe-go/orderitem",
68+
"revision": "a705fb222df92bba0cbc4c190bcbebf7dfe0b0cc",
69+
"revisionTime": "2017-11-02T19:49:50Z"
70+
},
71+
{
72+
"checksumSHA1": "PILusX5jFHunLGO9R1i8H2btld0=",
73+
"path": "github.com/stripe/stripe-go/sub",
74+
"revision": "a705fb222df92bba0cbc4c190bcbebf7dfe0b0cc",
75+
"revisionTime": "2017-11-02T19:49:50Z"
76+
},
77+
{
78+
"checksumSHA1": "OSE4/fridCa9z4tallvcUbTHqTI=",
79+
"path": "github.com/ugorji/go/codec",
80+
"revision": "3c86213f839c6a21d88c21b290e7601cff44dbca",
81+
"revisionTime": "2017-11-06T19:04:04Z"
82+
},
83+
{
84+
"checksumSHA1": "uTQtOqR0ePMMcvuvAIksiIZxhqU=",
85+
"path": "golang.org/x/sys/unix",
86+
"revision": "d75a52659825e75fff6158388dddc6a5b04f9ba5",
87+
"revisionTime": "2016-12-14T18:38:57Z"
88+
},
89+
{
90+
"checksumSHA1": "P/k5ZGf0lEBgpKgkwy++F7K1PSg=",
91+
"path": "gopkg.in/go-playground/validator.v8",
92+
"revision": "5f1438d3fca68893a817e4a66806cea46a9e4ebf",
93+
"revisionTime": "2017-07-30T05:02:35Z"
94+
},
95+
{
96+
"checksumSHA1": "RDJpJQwkF012L6m/2BJizyOksNw=",
97+
"path": "gopkg.in/yaml.v2",
98+
"revision": "eb3733d160e74a9c7e442f435eb3bea458e1d19f",
99+
"revisionTime": "2017-08-12T16:00:11Z"
100+
}
101+
],
102+
"rootPath": "github.com/julsemaan/anyfile-notepad/webserver"
103+
}

0 commit comments

Comments
 (0)