(fedmenu) extract the package name from the url.

This commit is contained in:
Ralph Bean 2015-04-24 17:45:47 +00:00
parent b1d54a9d96
commit f86bafdf03

View file

@ -7,14 +7,20 @@
{% endif %} {% endif %}
<script> <script>
{% if env == 'staging' %} {% if env == 'staging' %}
var base = 'https://apps.stg.fedoraproject.org/'; var base = 'https://apps.stg.fedoraproject.org/';
{% else %} {% else %}
var base = 'https://apps.fedoraproject.org/'; var base = 'https://apps.fedoraproject.org/';
{% endif %} {% endif %}
var tokens = window.location.href.split('/');
var repo = null;
if (tokens.length > 4 && tokens[4] != '') {
repo = tokens[4].split('.')[0];
}
fedmenu({ fedmenu({
'url': base + 'js/data.js', 'url': base + 'js/data.js',
'mimeType': 'application/javascript', 'mimeType': 'application/javascript',
'position': 'bottom-right', 'position': 'bottom-right',
'package': repo,
}); });
</script> </script>