Skip to content

Commit 007a8c8

Browse files
committed
Merge pull request matplotlib#5825 from tacaswell/badges
Badges
2 parents ac8cfb3 + 5e28a9b commit 007a8c8

File tree

5 files changed

+204
-21
lines changed

5 files changed

+204
-21
lines changed

Diff for: doc/_static/mpl.css

+32
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ div.sphinxsidebar {
223223
text-align: left;
224224
/* margin-left: -100%; */
225225
}
226+
div.sphinxsidebarwrapper {
227+
padding-top: 28px
228+
}
226229

227230
div.sphinxsidebar h4, div.sphinxsidebar h3 {
228231
margin: 1em 0 0.5em 0;
@@ -650,3 +653,32 @@ figcaption {
650653
}
651654

652655

656+
.donate_button {
657+
background:#11557C;
658+
font-weight:normal;
659+
border:solid 1px #fff;
660+
outline: solid 1px #11557C;
661+
clear: both;
662+
display: block;
663+
width:200px;
664+
line-height:2.8;
665+
font-size: 16px;
666+
text-align: center;
667+
cursor:pointer;
668+
color:#fff;
669+
text-decoration: none;
670+
margin: 30px auto 0;
671+
z-index:1;
672+
transition: background .25s ease;
673+
}
674+
675+
.donate_button:last-of-type {
676+
margin: 15px auto 30px;
677+
678+
679+
}
680+
681+
.donate_button:hover, .donate_button:active, .donate_button:focus {
682+
background: #003c63;
683+
outline-color: #003c63;
684+
}

Diff for: doc/_templates/badgesidebar.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
<a href="http://depsy.org/package/python/matplotlib">
3+
<img src="http://depsy.org/api/package/pypi/matplotlib/badge.svg">
4+
</a>
5+
6+
<br/>
7+
8+
Travis-CI: <a href="https://travis-ci.org/matplotlib/matplotlib">
9+
<img src="https://travis-ci.org/matplotlib/matplotlib.svg?branch=master"/>
10+
</a>
11+
<br/>

Diff for: doc/_templates/donate_sidebar.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
<div>
3+
<div onclick="open_window('MjI1OA==')" class="donate_button">Support matplotlib</div>
4+
<div onclick="open_window('MjM2OA==')" class="donate_button">Support NumFOCUS</div>
5+
</div>

Diff for: doc/_templates/layout.html

+150-18
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,6 @@ <h3>{{ _('Navigation') }}</h3>
6969
{%- for sidebartemplate in sidebars %}
7070
{%- include sidebartemplate %}
7171
{%- endfor %}
72-
{%- else %}
73-
{#- old style sidebars: using blocks -- should be deprecated #}
74-
{%- block sidebartoc %}
75-
{%- include "localtoc.html" %}
76-
{%- endblock %}
77-
{%- block sidebarrel %}
78-
{%- include "relations.html" %}
79-
{%- endblock %}
80-
{%- block sidebarsourcelink %}
81-
{%- include "sourcelink.html" %}
82-
{%- endblock %}
83-
{%- if customsidebar %}
84-
{%- include customsidebar %}
85-
{%- endif %}
86-
{%- block sidebarsearch %}
87-
{%- include "searchbox.html" %}
88-
{%- endblock %}
8972
{%- endif %}
9073
</div>
9174
</div>
@@ -170,7 +153,7 @@ <h3>{{ _('Navigation') }}</h3>
170153
{%- endif %}
171154
{%- endblock %}
172155
{%- block extrahead %} {% endblock %}
173-
<link href="http://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">
156+
174157

175158
</head>
176159
<body>
@@ -266,4 +249,153 @@ <h3>We're updating the default styles for Matplotlib 2.0</h3>
266249

267250
</script>
268251
</body>
252+
<footer>
253+
<!--Flipcause Integration v3.0// Flipcause Integration Instructions:
254+
Install the following code block once in the website Header (after <head> tag) -->
255+
256+
<style>
257+
258+
.fc-black_overlay{
259+
display:none; position: fixed; z-index:1000001; top: 0%;left: 0%;width: 100%;height: 100%;
260+
background-color: black; filter: alpha(opacity=50); cursor:pointer; opacity:0.5;
261+
}
262+
263+
.fc-white_content {
264+
opacity:1; display:none; margin-top: -320px; margin-left: -485px; width:970px; height:640px;
265+
position:fixed; top:50%; left:50%; border: none;z-index:1000002;overflow: auto;
266+
}
267+
268+
.fc-main-box{
269+
opacity:1; display:none; margin:15px auto 0 auto; width:930px; position:relative; z-index:1000003;
270+
}
271+
272+
.fc-widget_close{
273+
opacity:1; content:url(http://i1338.photobucket.com/albums/o691/WeCause/X_zpse4a7e538.png);
274+
position:absolute; z-index=1000004; right:-16px; top:-16px; display:block; cursor:pointer;
275+
}
276+
277+
.floating_button{
278+
display: block; margin-top: 0px; margin-left: 0px; width:auto ; height: auto;
279+
position:fixed; z-index:999999; overflow: auto;
280+
}
281+
282+
@keyframes backfadesin {
283+
from { opacity:0; }
284+
to {opacity:.5;}
285+
}
286+
287+
@-moz-keyframes backfadesin {
288+
from { opacity:0; }
289+
to {opacity:.5;}
290+
}
291+
292+
@-webkit-keyframes backfadesin {
293+
from { opacity:0; }
294+
to {opacity:.5;}
295+
}
296+
297+
@-o-keyframes backfadesin {
298+
from { opacity:0; }
299+
to {opacity:.5;}
300+
}
301+
302+
303+
@-ms-keyframes backfadesin {
304+
from { opacity:0; }
305+
to {opacity:.5;}
306+
}
307+
308+
@keyframes fadesin {
309+
0%{ opacity:0; }
310+
50%{ opacity:0; }
311+
75% {opacity: 0; transform: translateY(20px);}
312+
100% {opacity: 1; transform: translateY(0);}
313+
}
314+
315+
@-moz-keyframes fadesin {
316+
0%{ opacity:0; }
317+
50%{ opacity:0; }
318+
75% {opacity: 0; -moz-transform: translateY(20px);}
319+
100% {opacity: 1; -moz-transform: translateY(0);}
320+
}
321+
322+
@-webkit-keyframes fadesin {
323+
0%{ opacity:0; }
324+
50%{ opacity:0; }
325+
75% {opacity: 0; -webkit-transform: translateY(20px);}
326+
100% {opacity: 1; -webkit-transform: translateY(0);}
327+
}
328+
329+
@-o-keyframes fadesin {
330+
0%{ opacity:0; }
331+
50%{ opacity:0; }
332+
75% {opacity: 0; -o-transform: translateY(20px);}
333+
100% {opacity: 1; -o-transform: translateY(0);}
334+
}
335+
336+
@-ms-keyframes fadesin {
337+
0%{ opacity:0; }
338+
50%{ opacity:0; }
339+
75% {opacity: 0; -ms-transform: translateY(20px);}
340+
100% {opacity: 1; -ms-transform: translateY(0);}
341+
}
342+
343+
</style>
344+
345+
<script>
346+
347+
function open_window(cause_id) {
348+
var protocol=String(document.location.protocol);
349+
var new_url;
350+
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
351+
new_url="https://www.flipcause.com/widget/"+cause_id
352+
window.open(new_url);
353+
}
354+
355+
else {
356+
document.getElementById("fc-fade").style.display = "block";
357+
document.getElementById("fc-fade").style.webkitAnimation = "backfadesin 1s";
358+
document.getElementById("fc-fade").style.animation = "backfadesin 1s";
359+
document.getElementById("fc-fade").style.mozAnimation = "backfadesin 1s";
360+
document.getElementById("fc-light").style.display = "block";
361+
document.getElementById("fc-light").style.webkitAnimation = "fadesin 1.5s";
362+
document.getElementById("fc-light").style.animation = "fadesin 1.5s";
363+
document.getElementById("fc-light").style.mozAnimation = "fadesin 1.5s";
364+
document.getElementById("fc-main").style.display = "block";
365+
document.getElementById("fc-main").style.webkitAnimation = "fadesin 1.5s";
366+
document.getElementById("fc-main").style.animation = "fadesin 1.5s";
367+
document.getElementById("fc-main").style.mozAnimation = "fadesin 1.5s";
368+
document.getElementById("fc-close").style.display = "block";
369+
document.getElementById("fc-close").style.webkitAnimation = "fadesin 1.5s";
370+
document.getElementById("fc-close").style.animation = "fadesin 1.5s";
371+
document.getElementById("fc-close").style.mozAnimation = "fadesin 1.5s";
372+
document.getElementById("fc-myFrame").style.display = "block";
373+
document.getElementById("fc-myFrame").style.webkitAnimation = "fadesin 1.5s";
374+
document.getElementById("fc-myFrame").style.animation = "fadesin 1.5s";
375+
document.getElementById("fc-myFrame").style.mozAnimation = "fadesin 1.5s";
376+
document.getElementById("fc-myFrame").src="https://www.flipcause.com/widget/"+cause_id;
377+
}
378+
}
379+
380+
381+
function close_window() {
382+
document.getElementById("fc-fade").style.display="none";
383+
document.getElementById("fc-light").style.display="none";
384+
document.getElementById("fc-main").style.display="none";
385+
document.getElementById("fc-close").style.display="none";
386+
document.getElementById("fc-myFrame").style.display="none";
387+
}
388+
389+
</script>
390+
391+
<div id="fc-fade" class="fc-black_overlay" onclick="close_window()"></div>
392+
<div id="fc-light" class="fc-white_content">
393+
<div id="fc-main" class="fc-main-box">
394+
<div id="fc-close" class="fc-widget_close" onclick="close_window()">
395+
</div><iframe id="fc-myFrame" iframe height="580" width="925" style="border: 0;
396+
border-radius:5px 5px 5px 5px; box-shadow:0 0 8px rgba(0, 0, 0, 0.5);" scrolling="no" src=""></iframe></div>
397+
</div>
398+
399+
<!--END Flipcause Main Integration Code-->
400+
</footer>
269401
</html>

Diff for: doc/conf.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,12 @@
186186
#html_sidebars = {}
187187

188188
# Custom sidebar templates, maps page names to templates.
189-
html_sidebars = {'index': 'indexsidebar.html',
190-
}
191-
189+
html_sidebars = {
190+
'index': ['badgesidebar.html','donate_sidebar.html',
191+
'indexsidebar.html', 'searchbox.html'],
192+
'**': ['badgesidebar.html', 'localtoc.html',
193+
'relations.html', 'sourcelink.html', 'searchbox.html']
194+
}
192195

193196
# Additional templates that should be rendered to pages, maps page names to
194197
# template names.

0 commit comments

Comments
 (0)