-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatchwork.php
90 lines (69 loc) · 2.87 KB
/
patchwork.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
include_once('_inc/functions.php');
// Build out URI to reload from form dropdown
$pageURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
if (isset($_POST['uri']) && isset($_POST['section'])) {
$pageURL .= $_POST[uri].$_POST[section];
header("Location: $pageURL");
}
?>
<!DOCTYPE html>
<html lang="en-gb">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Code for America Website Style Guide</title>
<link rel="stylesheet" href="/_style/css/documentation.css">
<link href="_style/css/prism.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/6304652/777902/css/fonts.css" />
<link rel="stylesheet" href="/_style/css/layout.css" media="all and (min-width: 40em)">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>
// Adds class of js to the html tag if JS is enabled
document.getElementsByTagName('html')[0].className += ' js';
// Adds class of svg to the html tag if svg is enabled
(function flagSVG() {
var ns = {'svg': 'http://www.w3.org/2000/svg'};
if(document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")) {document.getElementsByTagName('html')[0].className += ' svg';}
})();
</script>
</head>
<body class="xx xx-patchwork">
<?php if(isset($_GET["url"])) : ?>
<?php include($patternsPath.$_GET["url"]) ?>
<?php else : ?>
<?php include("patterns/_header.html") ?>
<div class="layout-semibreve">
<form action="" method="post" id="pattern">
<select name="section" id="pattern-select" class="nav-section-select">
<option value="">Jump to…</option>
<?php displayOptions($patternsPath); ?>
</select>
<input type="hidden" name="uri" value="<?php echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; ?>">
<button type="submit" id="pattern-submit">Go</button>
</form>
<main role="main">
<?php displayPatchwork($patternsPath); ?>
</main><!--@main-->
<?php endif; ?>
</div>
<script src="_script/prism.js"></script>
</body>
<script>
(function (document, undefined) {
// Add js class to body
document.getElementsByTagName('body')[0].className += ' js';
// Pattern selector
document.getElementById('pattern-submit').style.display = 'none';
document.getElementById('pattern-select').onchange = function() {
//document.location=this.options[this.selectedIndex].value;
var val = this.value;
if (val !== "") {
window.location = val;
}
}
})(document);
</script>
</html>