Skip to content

Commit 658b07c

Browse files
committed
Merge pull request #1 from php/master
Upstream
2 parents 698dddb + d43d88e commit 658b07c

File tree

10 files changed

+168
-33
lines changed

10 files changed

+168
-33
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ backend/mirror.png
33
backend/mirror.jpg
44
backend/mirror.jpg
55
backend/GeoIP.dat
6+
.idea

archive/entries/2014-05-29-4.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<entry xmlns="http://www.w3.org/2005/Atom">
3-
<title>PHP 5.5.13 is available</title>
3+
<title>PHP 5.5.13 Released</title>
44
<id>http://php.net/archive/2014.php#id2014-05-29-3</id>
55
<published>2014-05-29T09:18:44+00:00</published>
66
<updated>2014-05-29T09:18:44+00:00</updated>

git-php.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
// $Id$
32
$_SERVER['BASE_PAGE'] = 'git-php.php';
43
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
54
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/email-validation.inc';
@@ -107,7 +106,7 @@
107106

108107
// Some error was found, while checking or submitting the data
109108
if ($error) {
110-
echo "<p class=\"formerror\">$error</p>";
109+
echo "<div class=\"warning\"><p>$error</p></div>";
111110
}
112111
else {
113112
?>

images/search-sprites.png

1.62 KB
Loading

include/header.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ if ($config["cache"]) {
3131
}
3232
header("Last-Modified: " . $tsstring);
3333
}
34+
if (!isset($config["languages"])) {
35+
$config["languages"] = array();
36+
}
3437

3538
?>
3639
<!DOCTYPE html>
@@ -51,13 +54,18 @@ if ($config["cache"]) {
5154
<link rel="canonical" href="http://php.net/<?php echo $_SERVER['BASE_PAGE']?>">
5255
<?php if ($shortname): ?>
5356
<link rel="shorturl" href="<?php echo $shorturl ?>">
57+
<link rel="alternate" href="<?php echo $shorturl ?>" hreflang="x-default">
5458
<?php endif ?>
5559
<?php endif ?>
5660

5761
<?php foreach($config["meta-navigation"] as $rel => $page): ?>
5862
<link rel="<?php echo $rel ?>" href="<?php echo $MYSITE ?><?php echo $page ?>">
5963
<?php endforeach ?>
6064

65+
<?php foreach($config["languages"] as $code): ?>
66+
<link rel="alternate" href="<?php echo $MYSITE ?>/manual/<?php echo $code?>/<?php echo $config["thispage"] ?>" hreflang="<?php echo $code?>">
67+
<?php endforeach ?>
68+
6169
<?php foreach($CSS as $filename => $modified): ?>
6270
<link rel="stylesheet" type="text/css" href="<?php echo $MYSITE ?>cached.php?t=<?php echo $modified?>&amp;f=<?php echo $filename?>" media="screen">
6371
<?php endforeach ?>

include/shared-manual.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ function manual_navigation_related(array $setup) {
368368
// including HTTP header information
369369
function manual_setup($setup) {
370370
global $PGI, $MYSITE, $USERNOTES;
371+
global $ACTIVE_ONLINE_LANGUAGES;
371372

372373
//TODO: get rid of this hack to get the related items into manual_footer
373374
global $__RELATED;
@@ -404,6 +405,7 @@ function manual_setup($setup) {
404405
$config = array(
405406
"current" => "docs",
406407
"breadcrumbs" => $breadcrumbs,
408+
"languages" => array_keys($ACTIVE_ONLINE_LANGUAGES),
407409
"meta-navigation" => array(
408410
"contents" => $base . $setup["home"][0],
409411
"index" => $base . $setup["up"][0],

index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
$intro .= "<ul>\n";
9999
foreach ($RELEASES[5] as $version => $release) {
100100
$intro .= "
101-
<li><a class='download-link' href='/downloads.php#v$version'>$version</a> &middot; <a class='notes' href='/ChangeLog-5.php#$version'>Release Notes</a></li>\n";
101+
<li><a class='download-link' href='/downloads.php#v$version'>$version</a><span class='dot'>&middot;</span><a class='notes' href='/ChangeLog-5.php#$version'>Release Notes</a></li>\n";
102102
}
103103
$intro .= "</ul>\n";
104104
}
@@ -145,17 +145,17 @@
145145
if (is_array($CONF_TEASER)) {
146146
$conftype = array(
147147
'conference' => 'Upcoming conferences',
148-
'cfp' => 'Conferences Calling for papers',
148+
'cfp' => 'Conferences calling for papers',
149149
);
150150
$announcements = "";
151151
foreach($CONF_TEASER as $category => $entries) {
152152
if ($entries) {
153153
$announcements .= '<div class="panel">';
154-
$announcements .= ' <a href="/conferences" class="headline">' . $conftype[$category] .'</a>';
154+
$announcements .= ' <a href="/conferences" class="headline" title="' . $conftype[$category] . '">' . $conftype[$category] .'</a>';
155155
$announcements .= '<div class="body"><ul>';
156156
foreach (array_slice($entries, 0, 4) as $url => $title) {
157157
$title = preg_replace("'([A-Za-z0-9])([\s\:\-\,]*?)call for(.*?)$'i", "$1", $title);
158-
$announcements .= "<li><a href='$url'>$title</a></li>";
158+
$announcements .= "<li><a href='$url' title='$title'>$title</a></li>";
159159
}
160160
$announcements .= '</ul></div>';
161161
$announcements .= '</div>';
@@ -167,7 +167,7 @@
167167

168168
$SIDEBAR = <<< SIDEBAR_DATA
169169
170-
<p class='panel'><a href='/migration55'>Upgrading to PHP5.5</a></p>
170+
<p class='panel'><a href='/migration55' title='Upgrading to PHP5.5' class='headline'>Upgrading to PHP5.5</a></p>
171171
$announcements
172172
<p class='panel'><a href='/cal.php'>User Group Events</a></p>
173173
<p class='panel'><a href='/thanks.php'>Special Thanks</a></p>

js/search.js

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
return {
281281
name: name,
282282
local: backend.toTypeaheadArray(),
283-
header: "<h3>" + backend.label + "</h3>",
283+
header: '<h3 class="result-heading"><span class="collapsible"></span>' + backend.label + '</h3>',
284284
limit: options.limit,
285285
valueKey: "name",
286286
engine: Hogan,
@@ -293,11 +293,28 @@
293293
var results = {};
294294

295295
// Set up the typeahead and the various listeners we need.
296-
$(element).typeahead(typeaheadOptions).on("typeahead:selected", function (_, item) {
297-
/* If the user has selected an autocomplete item and hits
298-
* enter, we should take them straight to the page. */
296+
var searchTypeahead = $(element).typeahead(typeaheadOptions);
297+
298+
// Delegate click events to result-heading collapsible icons, and trigger the accordion action
299+
$('.tt-dropdown-menu').delegate('.result-heading .collapsible', 'click', function() {
300+
var el = $(this), suggestions = el.parent().parent().find('.tt-suggestions');
301+
suggestions.stop();
302+
if(!el.hasClass('closed')) {
303+
suggestions.slideUp();
304+
el.addClass('closed');
305+
} else {
306+
suggestions.slideDown();
307+
el.removeClass('closed');
308+
}
309+
310+
});
311+
312+
// If the user has selected an autocomplete item and hits enter, we should take them straight to the page.
313+
searchTypeahead.on("typeahead:selected", function (_, item) {
299314
window.location = "/manual/" + options.language + "/" + item.id;
300-
}).on("keyup", (function () {
315+
});
316+
317+
searchTypeahead.on("keyup", (function () {
301318
/* typeahead.js doesn't give us a reliable event for the
302319
* dropdown entries having been updated, so we'll hook into the
303320
* input element's keyup instead. The aim here is to put in
@@ -313,18 +330,26 @@
313330
* when the user has typed something into the search box after
314331
* typeahead.js has done its thing. */
315332
return function () {
316-
// Grab what the user entered.
317-
var pattern = $(element).val();
318-
319333
// Add result totals to each section heading.
320334
$.each(results, function (name, numResults) {
321-
var container = $(".tt-dataset-" + name, $(element).parent());
322-
var results = $("<span class='result-count' />").text(numResults);
335+
var container = $(".tt-dataset-" + name, $(element).parent()),
336+
resultHeading = container.find('.result-heading'),
337+
resultCount = container.find('.result-count');
338+
339+
// Does a result count already exist in this resultHeading?
340+
if(resultCount.length == 0) {
341+
var results = $("<span class='result-count' />").text(numResults);
342+
resultHeading.append(results);
343+
} else {
344+
resultCount.text(numResults);
345+
}
346+
323347

324-
$("h3 .result-count", container).remove();
325-
$("h3", container).append(results);
326348
});
327349

350+
// Grab what the user entered.
351+
var pattern = $(element).val();
352+
328353
/* Add a global search option. Note that, as above, the
329354
* link is only displayed if more than 2 characters have
330355
* been entered: this is due to our search functionality

styles/home.css

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
text-shadow:0 1px 2px rgba(0,0,0,.5);
1010
font-size:1.125rem;
1111
}
12+
13+
#intro ul a {
14+
word-spacing: 0;
15+
}
16+
1217
#intro .row .blurb p:first-child {
1318
margin-top:1.5rem;
1419
}
1520
#intro .row .blurb,
1621
#intro .row .download {
1722
display:table-cell;
1823
float:none;
19-
vertical-align: middle;
2024
padding:0 1.5rem;
2125
}
2226

@@ -38,8 +42,14 @@
3842
word-spacing:.25rem;
3943
margin-left:0;
4044
}
45+
46+
#intro .dot {
47+
display: inline-block;
48+
width: 5px;
49+
padding: 0 5px;
50+
}
51+
4152
#intro .download {
42-
text-align:center;
4353
}
4454
#intro .download a.notes {
4555
font-size:.75em;
@@ -56,6 +66,8 @@
5666

5767
#intro .download a.download-link {
5868
color:#fff;
69+
width: 50px;
70+
display: inline-block;
5971
}
6072

6173
#layout-content {
@@ -69,3 +81,43 @@
6981
p.archive {
7082
text-align: right;
7183
}
84+
85+
@media (min-width: 480px) and (max-width: 768px) {
86+
#intro .download {
87+
width: 35%;
88+
}
89+
90+
#intro .blurb {
91+
width: 65%;
92+
}
93+
}
94+
95+
@media (min-width: 768px) {
96+
.navbar-search,
97+
#intro .download,
98+
#intro .background,
99+
aside.tips,
100+
.layout-menu {
101+
width: 25%;
102+
}
103+
104+
#intro .blurb, #layout-content {
105+
width: 75%;
106+
}
107+
}
108+
109+
@media (min-width: 480px) and (max-width: 590px) {
110+
#intro .dot {
111+
display: none;
112+
}
113+
}
114+
115+
@media (min-width: 768px) and (max-width: 784px) {
116+
#intro .download, aside.tips, .navbar-search {
117+
width: 30%;
118+
}
119+
120+
#intro .blurb, #layout-content {
121+
width:70%;
122+
}
123+
}

0 commit comments

Comments
 (0)