Created
May 27, 2011 14:12
-
-
Save bmuller/995321 to your computer and use it in GitHub Desktop.
gresasemonkey script to show all active stories across projects on projects page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Pivtol Tracker Fixes | |
| // @namespace userscripts.org | |
| // @description Show all stories that have been started on the projects page | |
| // @include https://tracker.*.com/projects | |
| // @copyright Brian Muller | |
| // @version 0.0.1 | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js | |
| // ==/UserScript== | |
| $("div.projects_page").append('<div class="clear"></div><div id="active_stories" class="content_section news"><h2>Started Stories</h2></div>'); | |
| $("#active_stories").css("font-size", "1.3em"); | |
| $("a.project_name").each(function(index, element) { | |
| var parts = element.href.split('/'); | |
| var project_id = parts[parts.length - 1]; | |
| $.getJSON("/project/get_json/" + project_id, function(data) { | |
| var story_html = ""; | |
| var have_story = false; | |
| story_html += '<h3><a class="project-name" href="/projects/' + data.id + '">' + data.name + '</a></h3><ul>'; | |
| $.each(data.stories, function(index, story) { | |
| if(story.current_state == "started") { | |
| have_story = true; | |
| story_html += '<li class="story-list-item"><a href="/story/show/' + story.id + '">' | |
| story_html += '<img src="/images/v6/application/stories_view/icons/' + story.story_type + '.png"/> ' + story.name + "</li>"; | |
| } | |
| }); | |
| if(!have_story) return; | |
| $("#active_stories").append(story_html + "</ul>"); | |
| $(".story-list-item").css("margin", "10px"); | |
| $("div.story-list").css("margin", "20px"); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment