This commit is contained in:
Ben Harris 2017-02-16 11:29:19 -05:00
commit 7efc245a3b
11 changed files with 1245 additions and 0 deletions

BIN
favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

24
footer.php Executable file
View File

@ -0,0 +1,24 @@
</div>
<br>
<footer class="footer">
<div class="container">
<p class="text-muted"><a href="<?=$dir?>">CS326 Pattern Book</a> - <a href="http://euclid.nmu.edu/~benharri">Ben Harris</a></p>
</div>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../inc/js/bootstrap.min.js"></script>
<script src="../inc/js/bs3typeahead.js"></script>
<script>
$(document).ready(function(){
$("#searchbox").typeahead({
source: [<?php foreach($menu as $grp) foreach($grp as $name => $h) echo '{name:"'.$name.'",href:"'.$h.'"},';?>],
updater: function(item){window.location = item.href;}
});
});
</script>
</body>
</html>

98
header.php Executable file
View File

@ -0,0 +1,98 @@
<?php
include "../inc/php_scripts/common_fns.php";
$dir = "http://euclid.nmu.edu/~benharri/patternbook";
$menu = array(
"Creational" => array(
"Factory" => "$dir/?factory",
"Double Dispatch" => "$dir/?doubledispatch",
"Prototype" => "$dir/?prototype",
"Abstract Factory" => "$dir/?abstractfactory",
"Lazy Initialization" => "$dir/?lazyinitialization",
"Builder" => "$dir/?builder",
"Singleton" => "$dir/?singleton",
"Null Object" => "$dir/?nullobject"
),
"Behavioral" => array(
"Command" => "$dir/?command",
"Observer" => "$dir/?observer",
"Mediator" => "$dir/?mediator",
"Visitor" => "$dir/?visitor",
"Interpreter" => "$dir/?interpreter",
"Iterator" => "$dir/?iterator",
"Memento" => "$dir/?memento",
"Chain of Responsibility" => "$dir/?chainofresponsibility",
"Template Method" => "$dir/?template",
"State" => "$dir/?state",
"Strategy" => "$dir/?strategy"
),
"Structural" => array(
"Facade" => "$dir/?facade",
"Composite" => "$dir/?composite",
"Decorator" => "$dir/?decorator",
"Future" => "$dir/?future",
"Bridge" => "$dir/?bridge",
"Adapter" => "$dir/?adapter",
"Flyweight" => "$dir/?flyweight",
"Proxy" => "$dir/?proxy"
)
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pattern Book</title>
<link rel="stylesheet" href="../inc/css/bootstrap.min.css">
<link rel="stylesheet" href="../inc/css/theme-cosmo.min.css">
<link rel="stylesheet" href="../inc/css/sticky-footer-navbar.css">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?=$dir?>/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="<?=$dir?>/img/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="<?=$dir?>/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="<?=$dir?>/img/favicon-16x16.png" sizes="16x16" />
<meta name="application-name" content="Pattern Book - Ben Harris"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="<?=$dir?>/img/mstile-144x144.png" />
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?=$dir?>"><img src="img/apple-touch-icon-152x152.png" alt="brand"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<?=b_menu($menu)?>
</ul>
<form class="navbar-form navbar-right" action="<?=$dir?>" method="GET" role="search">
<div class="input-group">
<input type="text" name="q" id="searchbox" class="form-control" autocomplete="off" data-provide="typeahead" placeholder="Search">
<!-- <div class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</div> -->
</div>
</form>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container" role="main">

BIN
img/apple-touch-icon-144x144.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
img/apple-touch-icon-152x152.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
img/favicon-16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

BIN
img/favicon-32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

7
img/favicon_inc_code.txt Executable file
View File

@ -0,0 +1,7 @@
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://euclid.nmu.edu/~benharri/patternbook/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://euclid.nmu.edu/~benharri/patternbook/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="http://euclid.nmu.edu/~benharri/patternbook/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="http://euclid.nmu.edu/~benharri/patternbook/favicon-16x16.png" sizes="16x16" />
<meta name="application-name" content="Pattern Book - Ben Harris"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="http://euclid.nmu.edu/~benharri/patternbook/mstile-144x144.png" />

BIN
img/mstile-144x144.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

50
index.php Executable file
View File

@ -0,0 +1,50 @@
<?php
if(isset($_GET["q"])){
$pattern = strtolower(str_replace(" ", "", $_GET["q"])); include "pattern.php"; die();
}
if(isset($_GET["notfound"])){
$pattern = $_GET["notfound"];
$msg = '<div class="alert alert-warning">Unable to find "'.$pattern.'".</div>';
}
if(count($_GET) == 1){ $pattern = array_keys($_GET)[0]; include "pattern.php"; die();}
include_once "header.php";
?>
<br>
<?php if(isset($msg)){
echo $msg;
}?>
<div class="jumbotron">
<div class="page-header">
<h1>Software Engineering Patterns</h1>
</div>
</div>
<div class="page-header">
<h3>Ben Harris' Pattern Book</h3>
</div>
<p>This is collection of experiences I have noticed in my experiences with software development so far.</p>
<p>Patterns are:</p>
<ul>
<li>element of grammar</li>
<li>in programming languages: production</li>
<li>describe and think about our designs using patterns</li>
</ul>
<p>Anatomy of a pattern:</p>
<ul>
<li>name</li>
<li>common issue to be solved</li>
<li>(re)solution</li>
<li>examples (if applicable)</li>
<li>related patterns</li>
</ul>
<div class="page-header"><h2><strong>Allow, don't force.</strong></h2></div>
<?php include_once "footer.php";

1066
pattern.php Executable file

File diff suppressed because it is too large Load Diff