Skip to content

Commit

Permalink
Merge pull request #5184 from gitcoinco/fix/tips-metamask
Browse files Browse the repository at this point in the history
remove _alert already used and fix metamask
  • Loading branch information
thelostone-mc authored Sep 12, 2019
2 parents ebe6f4b + f390b9a commit abdff47
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 53 deletions.
9 changes: 3 additions & 6 deletions app/assets/v2/js/metamask-approval.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function metamaskApproval() {
_alert('Permission to connect to metamask rejected. Allow gitcoin to connect to metamask.', 'warning');
}
}
window.removeEventListener('load', metamaskApproval);
ask_metamask_connection();
}

Expand Down Expand Up @@ -51,15 +52,11 @@ function ask_metamask_connection() {

shown_on = [ '/tip/send/2', '/kudos/send', '/ens' ];
var len = page_url.length - 1;

if (page_url.lastIndexOf('/') === len) {
page_url = page_url.substring(0, len);
}
if ($.inArray(page_url, shown_on) != -1 && !is_metamask_approved) {
_alert('Metamask not connected. <button id="metamask_connect" onclick="approve_metamask()">Click here to connect to metamask</button>', 'error');
$('#metamask_connect').css('background', 'none');
$('#metamask_connect').css('color', 'white');
$('#metamask_connect').css('border', '2px solid white');
$('#metamask_connect').css('border-radius', '10px');
_alert('Metamask not connected. <button id="metamask_connect" onclick="approve_metamask()" style="background: none; color: white; border: 2px solid white; border-radius: 10px;">Click here to connect to metamask</button>', 'error');
}
}
1 change: 0 additions & 1 deletion app/dashboard/templates/onepager/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
</div>
{% include 'shared/rain.html' with class="color" %}
<!-- Scripts -->
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
{% include 'shared/footer_scripts.html' with slim=1 %}

{% block 'scripts' %}{% endblock %}
Expand Down
91 changes: 45 additions & 46 deletions app/dashboard/templates/onepager/send1.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
{% extends 'onepager/base.html' %}
{% comment %}
Copyright (C) 2018 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n static %}
{% block 'scripts' %}
<script src="{% static "v2/js/amounts.js" %}"></script>
<script src="{% static "onepager/js/web3alert.js" %}"></script>
{% endblock %}
<!-- Main -->
{% block 'main' %}
<section id="main">
<header>
<span class="avatar">
<a href="{% url "tip" %}">
<img src="{% static "v2/images/helmet.png" %}" style="background-color: white; max-width: 100px; max-height: 100px;" />
</a>
</span>
<h1>{% trans "Send Tip" %} <span class="emoji"></span></h1>
<h3>{% trans "It's Fast. It's Easy. It's Free.️" %}</h3>
<p>({% trans "Supports any github username or email address" %})</p>
<br>
<select id="batches" style="background:transparent; display: none; margin-bottom: 20px; margin-top: -20px" >
<option value="1">1 {% trans "receipient" %}</option>
<option value="5">5 {% trans "receipients" %}</option>
<option value="10">10 {% trans "receipients" %}</option>
<option value="20">20 {% trans "receipients" %}</option>
<option value="50">50 {% trans "receipients" %}</option>
</select>
</header>
<a href="{% url "send_tip_2" %}" id="neweth" class="button button--primary">{% trans "Send Tip" %} <span class="emoji">💰</span></a>
</section>
{% endblock %}
{% extends 'onepager/base.html' %}
{% comment %}
Copyright (C) 2018 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n static %}
{% block 'scripts' %}
<script src="{% static "v2/js/amounts.js" %}"></script>
{% endblock %}
<!-- Main -->
{% block 'main' %}
<section id="main">
<header>
<span class="avatar">
<a href="{% url "tip" %}">
<img src="{% static "v2/images/helmet.png" %}" style="background-color: white; max-width: 100px; max-height: 100px;" />
</a>
</span>
<h1>{% trans "Send Tip" %} <span class="emoji"></span></h1>
<h3>{% trans "It's Fast. It's Easy. It's Free.️" %}</h3>
<p>({% trans "Supports any github username or email address" %})</p>
<br>
<select id="batches" style="background:transparent; display: none; margin-bottom: 20px; margin-top: -20px" >
<option value="1">1 {% trans "receipient" %}</option>
<option value="5">5 {% trans "receipients" %}</option>
<option value="10">10 {% trans "receipients" %}</option>
<option value="20">20 {% trans "receipients" %}</option>
<option value="50">50 {% trans "receipients" %}</option>
</select>
</header>
<a href="{% url "send_tip_2" %}" id="neweth" class="button button--primary">{% trans "Send Tip" %} <span class="emoji">💰</span></a>
</section>
{% endblock %}

0 comments on commit abdff47

Please sign in to comment.