Advertisement
Guest User

fix bitbucket ui

a guest
Aug 29th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     if ($("#dashboard-header").length > 0) {
  3.         // Check for our header and don't re-run.
  4.         if ($("#fu-styles").length > 0)
  5.             return;
  6.  
  7.         // The o'l switcheroo
  8.         var commits = $(".activity");
  9.         var repos = $("#repositories-container");
  10.  
  11.         var commitsParent = commits.parent();
  12.         var reposParent = repos.parent();
  13.  
  14.         reposParent.prepend(commits.detach());
  15.         commitsParent.prepend(repos.detach());
  16.        
  17.         // Fix the styles.
  18.         $("<style id=\"fu-styles\">" +
  19.             "body .repository-list .repo-name { font-size: 14px; white-space: nowrap; overflow: hidden; }" +
  20.             "body .repository-list .last-updated { float: none; }" +
  21.             "</style>")
  22.             .appendTo(document.head);
  23.            
  24.         function fixRepoLinks() {
  25.             // Lets make all the links point to the source, not the read-me.
  26.             var repoLinks = $(".repo-name a.execute");
  27.             for (var i = 0; i < repoLinks.length; i++) {
  28.                 var link = repoLinks[i];
  29.                 if (link.href.indexOf("/src") == -1)
  30.                     link.href = link.href + "/src";
  31.             }
  32.         }
  33.        
  34.         fixRepoLinks();
  35.        
  36.         $("#repositories-pjax").ajaxSuccess(function() {
  37.             fixRepoLinks();
  38.         });
  39.     }
  40. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement