Created
July 16, 2012 05:42
-
-
Save laruence/3120879 to your computer and use it in GitHub Desktop.
web-qa doesn't show the whole pull requests
This file contains 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
diff --git a/pulls/index.php b/pulls/index.php | |
index 314c936..4fff407 100644 | |
--- a/pulls/index.php | |
+++ b/pulls/index.php | |
@@ -57,8 +57,18 @@ common_header(); | |
white-space: pre; | |
} | |
+ #backToRepolist { | |
+ float: left; | |
+ } | |
+ | |
#repoContent { | |
width: 920px; | |
+ clear: both; | |
+ } | |
+ | |
+ #nextRepoPage { | |
+ float: right; | |
+ display: none; | |
} | |
</style> | |
<link href="http://code.jquery.com/ui/1.8.18/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/> | |
@@ -133,6 +143,7 @@ if (!constant('GITHUB_PASS')) { | |
?> | |
<div id="backToRepolist"><a href="#"><<<-- Repos</a></div> | |
+ <div id="nextRepoPage"><a href="#">Next-->>></a></div> | |
<div id="mainContent"> | |
<ul id="repolist"></ul> | |
<p>Even though the PHP project is using <a href="http://git.php.net">git.php.net</a> | |
diff --git a/pulls/pullrequests.js b/pulls/pullrequests.js | |
index 9a88b4c..7bfe377 100644 | |
--- a/pulls/pullrequests.js | |
+++ b/pulls/pullrequests.js | |
@@ -91,6 +91,7 @@ loginHandler.prototype.updateLoginState = function(d) { | |
var repos; | |
var login; | |
var converter; | |
+var firstrun; | |
$(document).ready(function() { | |
login = new loginHandler(); | |
@@ -100,7 +101,11 @@ $(document).ready(function() { | |
$(window).bind( "hashchange", function(e) { | |
if ($.bbq.getState( "repo" )) { | |
- loadRepo($.bbq.getState("repo")); | |
+ if (!firstrun) { | |
+ loadRepo($.bbq.getState("repo")); | |
+ firstrun = 1; | |
+ } | |
+ $("#nextRepoPage").hide(); | |
repos.hideList(); | |
} else { | |
repos.showList(); | |
@@ -110,13 +115,28 @@ $(document).ready(function() { | |
$(window).trigger( "hashchange" ); | |
}); | |
-function loadRepo(repo) { | |
+function loadRepo(repo, url) { | |
+ url = url || GITHUB_BASEURL+'repos/'+GITHUB_ORG+"/"+repo+"/pulls"; | |
$("#loading").show(); | |
$.ajax({ | |
dataType: 'jsonp', | |
- url: GITHUB_BASEURL+'repos/'+GITHUB_ORG+"/"+repo+"/pulls", | |
+ url: url, | |
success: function (data) { | |
$("#loading").hide(); | |
+ if (data.meta && data.meta.Link) { | |
+ for (i=0; i<data.meta.Link.length; i++) { | |
+ var link = data.meta.Link[i]; | |
+ if (link[1].rel == "next") { | |
+ $("#nextRepoPage").show().click(function() { | |
+ $(this).hide(); | |
+ loadRepo(repo, data.meta.Link[0][0]); | |
+ }); | |
+ break; | |
+ } | |
+ } | |
+ } else { | |
+ $("#nextRepoPage").hide(); | |
+ } | |
for (var key in data.data) { | |
data.data[key].body = converter.makeHtml(data.data[key].body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment