Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed ability to specify the badge's label for the “website” service #965

Merged
merged 1 commit into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5908,22 +5908,21 @@ cache(function(data, match, sendBadge, request) {
}));

// Test if a webpage is online
camp.route(/^\/website(-(([^-/]|--|\/\/)+)-(([^-/]|--|\/\/)+)(-(([^-/]|--|\/\/)+)-(([^-/]|--|\/\/)+))?)?(-(([^-/]|--|\/\/)+))?\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/website(-(([^-/]|--|\/\/)+)-(([^-/]|--|\/\/)+)(-(([^-/]|--|\/\/)+)-(([^-/]|--|\/\/)+))?)?\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var onlineMessage = escapeFormatSlashes(match[2] != null ? match[2] : "online");
var offlineMessage = escapeFormatSlashes(match[4] != null ? match[4] : "offline");
var onlineColor = escapeFormatSlashes(match[7] != null ? match[7] : "brightgreen");
var offlineColor = escapeFormatSlashes(match[9] != null ? match[9] : "red");
var label = escapeFormatSlashes(match[12] != null ? match[12] : "website");
var userProtocol = match[14];
var userURI = match[15];
var format = match[16];
var userProtocol = match[11];
var userURI = match[12];
var format = match[13];
var withProtocolURI = userProtocol + "://" + userURI;
var options = {
method: 'HEAD',
uri: withProtocolURI,
};
var badgeData = getBadgeData(label, data);
var badgeData = getBadgeData("website", data);
badgeData.colorscheme = undefined;
request(options, function(err, res) {
// We consider all HTTP status codes below 310 as success.
Expand Down
10 changes: 2 additions & 8 deletions try.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ <h3 id="downloads"> Downloads </h3>
<td><code>https://img.shields.io/chrome-web-store/d/nimelepbpejjlbmoobocpfnjhihnpked.svg</code></td>
</tr>
<tr><th data-keywords='website' data-doc='websiteDoc'> Website: </th>
<td><img src='/website-up-down-green-red-my--website/http/shields.io.svg' alt=''/></td>
<td><code>https://img.shields.io/website-up-down-green-red-my--website/http/shields.io.svg</code></td>
<td><img src='/website-up-down-green-red/http/shields.io.svg?label=my-website' alt=''/></td>
<td><code>https://img.shields.io/website-up-down-green-red/http/shields.io.svg?label=my-website</code></td>
</tr>
<tr><th data-keywords='cocoapods'> CocoaPods: </th>
<td><img src='/cocoapods/dt/AFNetworking.svg' alt='' /></td>
Expand Down Expand Up @@ -1229,16 +1229,10 @@ <h2 id="like-this"> Like This? </h2>
<ul>
<li>Nothing:
<code>…/website/…</code></li>
<li>Badge label (displayed in the left part of the badge):
<code>…/website-label/…</code></li>
<li>Online and offline text:
<code>…/website-up-down/…</code></li>
<li>Online and offline text, then badge label:
<code>…/website-up-down-label/…</code></li>
<li>Online and offline text, then online and offline colors:
<code>…/website-up-down-green-orange/…</code></li>
<li>Online and offline text, then online and offline colors, then badge label:
<code>…/website-up-down-green-orange-label/…</code></li>
</ul>
<table class=centered><tbody>
<tr><td> Dashes <code>--</code>
Expand Down