Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name th23 Duolingo
- // @namespace th23-duolingo
- // @include https://www.duolingo.com/*
- // @include http://www.duolingo.com/*
- // @version 1
- // @grant none
- // ==/UserScript==
- function inject(f) { //Inject the script into the document
- var script;
- script = document.createElement('script');
- script.type = 'text/javascript';
- script.setAttribute('name', 'lesson_review');
- script.textContent = '(' + f.toString() + ')(jQuery)';
- document.head.appendChild(script);
- }
- inject(f);
- function f($) {
- function th23DuolingoProgress() {
- if($('#app').hasClass('home') || $('#app').hasClass('comment better-comment')) {
- if(!$('.sidebar-progress-main').length) {
- var th23LanguageData = window.duo.user.attributes.language_data[window.duo.user.attributes.learning_language];
- $('.inner').before('<div class="box-colored bg-white"><h2>Próximo Nível</h2><div class="sidebar-progress-main"><div title="' + th23LanguageData.level_percent + '% concluído, ' + th23LanguageData.points + 'XP no total' + '" data-toggle="tooltip" class="language-progress-bar-small"><div class="padder"><div style="width: ' + th23LanguageData.level_percent + '%; max-width: 100%;" class="bar"></div></div><span class="level level-current">' + th23LanguageData.level + '</span><span class="level level-next">' + th23LanguageData.next_level + '</span></div><ul class="sidebar-stats" style="font-size: 15px"><li>Faltam <strong>' + th23LanguageData.level_left + 'XP</strong> para o próximo nível</li></ul></div></div>');
- }
- }
- }
- $(document).ready(function() {
- th23DuolingoProgress();
- });
- $(document).ajaxComplete(function() {
- th23DuolingoProgress();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment