com web/qa: Merge remote branch 'schluetersde/master': pulls/index.php pulls/pullrequests.js
| From: | Johannes Schlüter | Date: | Tue, 27 Mar 2012 19:15:04 +0000 |
| Subject: | com web/qa: Merge remote branch 'schluetersde/master': pulls/index.php pulls/pullrequests.js | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66186@lists.php.net to get a copy of this message | ||
Commit: 7346a87a001b33b5056b96bb2bf4779b593db9d5
Author: Johannes Schlüter <johannes@php.net> Tue, 27 Mar 2012 21:15:04 +0200
Parents: 9dbf4afd181f93fdc06e1d8532b3298cf33bfa5e 62af5fea6bf0cfd57ba639ebe0985f90abc41084
Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=7346a87a001b33b5056b96bb2bf4779b593db9d5
Log:
Merge remote branch 'schluetersde/master'
* schluetersde/master:
Add Markdown JavaScript library to format texts.
Changed paths:
MM pulls/index.php
MM pulls/pullrequests.js
Diff:
7346a87a001b33b5056b96bb2bf4779b593db9d5
diff --combined pulls/index.php
index 9117001,ece3e82..1440b80
--- a/pulls/index.php
+++ b/pulls/index.php
@@@ -1,10 -1,4 +1,10 @@@
<?php
+if (empty($_SERVER['HTTPS'])) {
+ $host = preg_replace('/\s/', '', $_SERVER['HTTP_HOST']);
+ header("Location: https://$host/pulls/");
+ exit;
+}
+
include("../include/functions.php");
include("../include/release-qa.php");
@@@ -58,6 -52,8 +58,8 @@@ common_header()
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript" src="jsrender.js"></script>
<script type="text/javascript"
src="jquery.ba-bbq.min..js"></script>
+ <script type="text/javascript"
src="Markdown.Converter.js"></script>
+ <script type="text/javascript"
src="Markdown..Sanitizer.js"></script>
<script id="repoListItemTemplate" type="text/x-jquery-tmpl">
<li repo="{{=name}}"><b><a
href="#">{{=name}}:</a></b> {{=description}} ({{=open_issues}})</li>
</script>
@@@ -66,13 -62,14 +68,13 @@@
<div id="repoPullList">
{{=pullList!}}
</div>
- <!-- iframe style='width:100%; height:300px;border-width:1px;' src=''
id='ghframe' name='ghframe'></iframe -->
</script>
<script id="pullRequestListItem" type="text/x-jquery-tmpl">
<h3><a href='#'>{{=number}}: {{=title}}
({{=state}})</a></h3>
<div class="pullrequest">
<div class="ghuser"><a href="{{=user.url}}"><img
src="{{=user.avatar_url}}"><br>{{=user.login}}</a></div>
<div>Created: {{=created_at}}, LastUpdated: {{=updated_at}}</div>
- <div>{{=body}}</div>
+ <div>{{=body!}}</div>
<div><a href="{{=html_url}}"><img
src="../gfx/github.ico"> On GitHub</a> |
<a href="{{=diff_url}}">Diff</a> |
<a href="#" number="{{=number}}" state="{{=state}}"
title="{{=title}}" class="pullinstructions">Show Pull Instructions</a>
|
@@@ -123,23 -120,7 +125,23 @@@ if (!constant('GITHUB_PASS'))
?>
<div id="backToRepolist"><a href="#"><<<--
Repos</a></div>
- <div id="mainContent"><ul id="repolist"></ul>The PHP
project is using github to mirror its git repostories from <a href="http://git.php.net">git.php.net</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>
+ as master location for Git repositories we provide official <a href="http://github.com/php">mirrors on GitHub</a>,
+ which can be used to create and discuss feature branches. This tool here tries to assist with
the handling of GitHub pull requests.
+ </p>
+ <p>In general discussions about pull requests should be done in the appropriate places
+ (the actual pull request on GitHub, the php.net bug tracker, the PHP internals list, etc.)
+ while this tool helps with tasks which can't be done as we don't make contributors
to
+ PHP actual members of the "PHP Organization" on GitHub. The most important function
might
+ be closing pull requests without applying the changes (if the changes are applied GitHub
+ will close it automatically).
+ </p>
+ <p>Please note that this tool is in constant development and in an early state.
+ For a more detailed overview on the PHP Git process please check the <a href="https://wiki.php.net/vcs/gitworkflow">Git
Workflow page</a> on the Wiki.
+ </p>
+ </div>
<div id="repoContent"></div>
<div id="loginDialog" title="Login">
Username: <br><input id="userField"><br>
diff --combined pulls/pullrequests.js
index 486f14f,65f367f..db82020
--- a/pulls/pullrequests.js
+++ b/pulls/pullrequests.js
@@@ -90,10 -90,12 +90,12 @@@ loginHandler.prototype.updateLoginStat
var repos;
var login;
+ var converter;
$(document).ready(function() {
login = new loginHandler();
repos = new repoList(GITHUB_BASEURL, GITHUB_ORG);
+ converter = new Markdown.getSanitizingConverter();
repos.update();
$(window).bind( "hashchange", function(e) {
@@@ -115,6 -117,9 +117,9 @@@ function loadRepo(repo)
url: GITHUB_BASEURL+'repos/'+GITHUB_ORG+"/"+repo+"/pulls",
success: function (data) {
$("#loading").hide();
+ for (var key in data.data) {
+ data.data[key].body = converter.makeHtml(data.data[key].body);
+ }
$("#repoContent").html(
$("#repoOverviewTemplate").render([{repoName: repo, pullList:
$("#pullRequestListItem").render(data.data)}]));
$(".pullinstructions").click(function(ev) {
$('<div></div>')..html($("#pullInstructionTemplate").render({ repo:
repo, number: $(this).attr("number")}))
@@@ -148,19 -153,7 +153,19 @@@ function updateRepo(reponame, num, dia
id: num,
state: $("select", dia).attr("value"),
comment: $("textarea", dia).attr("value")
- }, success: function(d) { loadRepo(reponame); } });
+ }, success: function(d) {
+ if (d.success) {
+ loadRepo(reponame);
+ } else {
+ /* This might be reported in a nicer way ... */
+ var message = "Failed while updating!";
+ var key;
+ for (key in d.errors) {
+ message += "\n"+d.errors[key];
+ }
+ window.alert(message);
+ }
+ }});
dia.dialog("destroy");
}