Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Conflicts:
	composer.json
  • Loading branch information
dmolsen committed Jul 4, 2016
2 parents a7c1fe6 + b7b56ef commit 7b38bfe
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 186 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8
indent_style = space
trim_trailing_whitespace = false
end_of_line = lf
insert_final_newline = true
56 changes: 27 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
{
"name": "pattern-lab/styleguidekit-twig-default",
"description": "The default Twig-based StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.",
"keywords": ["twig", "pattern lab", "styleguide"],
"homepage": "http://patternlab.io",
"license": "MIT",
"type": "patternlab-styleguidekit",
"authors": [
{
"name": "Dave Olsen",
"email": "dmolsen@gmail.com",
"homepage": "http://dmolsen.com",
"role": "Lead Developer"
},
{
"name": "Brad Frost",
"homepage": "http://bradfrostweb.com",
"role": "Creator"
}
],
"support": {
"issues": "https://github.com/pattern-lab/styleguidekit-twig-default/issues",
"wiki": "http://patternlab.io/docs/",
"source": "https://github.com/pattern-lab/styleguidekit-twig-default/releases"
},
"require": {
"pattern-lab/core": "^2.0.0",
"pattern-lab/patternengine-twig": "^2.0.0",
"pattern-lab/styleguidekit-assets-default": "^2.0.0"
}
"name": "pattern-lab/styleguidekit-twig-default",
"description": "The default Twig-based StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.",
"keywords": ["twig", "pattern lab", "styleguide"],
"homepage": "http://patternlab.io",
"license": "MIT",
"type": "patternlab-styleguidekit",
"authors": [
{
"name": "Dave Olsen",
"email": "dmolsen@gmail.com",
"homepage": "http://dmolsen.com",
"role": "Lead Developer"
},
{
"name": "Brad Frost",
"homepage": "http://bradfrostweb.com",
"role": "Creator"
}
],
"support": {
"issues": "https://github.com/pattern-lab/styleguidekit-twig-default/issues",
"wiki": "http://patternlab.io/docs/",
"source": "https://github.com/pattern-lab/styleguidekit-twig-default/releases"
},
"require": {
"pattern-lab/styleguidekit-assets-default": "^3.0.0"
}
}
98 changes: 48 additions & 50 deletions views/partials/general-footer.twig
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
<script>
var patternData = {{ patternData | raw }};
<script type="text/json" id="sg-pattern-data-footer" class="sg-pattern-data">
{{ patternData | raw }}
</script>

<script>
/*!
* scriptLoader - v0.1
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
*/
var scriptLoader = {
run: function(js,cb,target) {
var s = document.getElementById(target+'-'+cb);
for (var i = 0; i < js.length; i++) {
var src = (typeof js[i] != "string") ? js[i].src : js[i];
var c = document.createElement('script');
c.src = '../../'+src+'?'+cb;
if (typeof js[i] != "string") {
if (js[i].dep !== undefined) {
c.onload = function(dep,cb,target) {
return function() {
scriptLoader.run(dep,cb,target);
}
}(js[i].dep,cb,target);
}
}
s.parentNode.insertBefore(c,s);
}
}
}
/*!
* scriptLoader - v0.1
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
*/
var scriptLoader = {
run: function(js,cb,target) {
var s = document.getElementById(target+'-'+cb);
for (var i = 0; i < js.length; i++) {
var src = (typeof js[i] != 'string') ? js[i].src : js[i];
var c = document.createElement('script');
c.src = '../../'+src+'?'+cb;
if (typeof js[i] != 'string') {
if (js[i].dep !== undefined) {
c.onload = function(dep,cb,target) {
return function() {
scriptLoader.run(dep,cb,target);
}
}(js[i].dep,cb,target);
}
}
s.parentNode.insertBefore(c,s);
}
}
}
</script>

<script id="pl-js-polyfill-insert-{{ cacheBuster }}">
(function() {
if (self != top) {
var cb = '{{ cacheBuster}}';
var js = [];
if (typeof document !== "undefined" && !("classList" in document.documentElement)) {
js.push("styleguide/bower_components/classList.min.js");
}
scriptLoader.run(js,cb,'pl-js-polyfill-insert');
}
})();
(function() {
if (self != top) {
var cb = '{{ cacheBuster}}';
var js = [];
if (typeof document !== 'undefined' && !('classList' in document.documentElement)) {
js.push('styleguide/bower_components/classList.min.js');
}
scriptLoader.run(js,cb,'pl-js-polyfill-insert');
}
})();
</script>

<script id="pl-js-insert-{{ cacheBuster }}">
(function() {
if (self != top) {
var cb = '{{ cacheBuster}}';
var js = [ { "src": "styleguide/bower_components/jwerty.min.js", "dep": [ { "src": "annotations/annotations.js", "dep": [ "styleguide/js/patternlab-pattern.min.js" ] } ] } ];
scriptLoader.run(js,cb,'pl-js-insert');
}
})();
</script>
(function() {
if (self != top) {
var cb = '{{ cacheBuster}}';
var js = [ { 'src': 'styleguide/bower_components/jwerty.min.js', 'dep': [ 'styleguide/js/patternlab-pattern.min.js' ] } ];
scriptLoader.run(js,cb,'pl-js-insert');
}
})();
</script>
5 changes: 2 additions & 3 deletions views/partials/general-header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

<link rel="stylesheet" href="../../styleguide/css/styleguide.css?{{ cacheBuster }}" media="all">
<link rel="stylesheet" href="../../styleguide/css/styleguide-specific.css?{{ cacheBuster }}" media="all" />

<link rel="stylesheet" href="../../styleguide/css/styleguide.min.css?{{ cacheBuster }}" media="all">
<link rel="stylesheet" href="../../styleguide/css/prism-typeahead.min.css?{{ cacheBuster }}" media="all" />
111 changes: 32 additions & 79 deletions views/partials/patternSection.twig
Original file line number Diff line number Diff line change
@@ -1,80 +1,33 @@
<div id="{{ partial.patternPartial }}" class="sg-pattern">
<div class="sg-pattern-head">
<h3><a href="../../patterns/{{ partial.patternLink }}" class="patternLink" data-patternpartial="{{ partial.patternPartial }}">{{ partial.patternName }}</a></h3>
<div class="sg-pattern-head-actions">
<!--Pattern header options-->
</div>
</div>
{% if partial.patternDescExists %}
<div class="sg-pattern-desc">
<p>{{ partial.patternDesc | raw }}</p>
{% for patternDescAddition in partial.patternDescAdditions %}
{{ patternDescAddition | raw }}
{% endfor %}
</div>
{% endif %}
<div class="sg-pattern-example">
{{ partial.patternPartialCode | raw }}
</div>
{% for patternExampleAddition in partial.patternExampleAdditions %}
{{ patternExampleAddition | raw }}
{% endfor %}
<div class="sg-pattern-extra">
<div class="sg-pattern-extra-annotations" style="display: none">
<span class="sg-pattern-extra-name">Annotations</span>
<div id="sg-pattern-extra-annotations-container">
</div>
</div>
<div class="sg-pattern-extra-html" style="display: none">
<span class="sg-pattern-extra-name">HTML</span>
<pre>
<code id="sg-pattern-extra-html-container">
{{ partial.patternPartialCodeE | raw }}
</code>
</pre>
</div>
<div class="sg-pattern-extra-engine" style="display: none">
<span class="sg-pattern-extra-name">{{ partial.patternEngineName }}</span>
<pre>
<code id="sg-pattern-extra-engine-container">
</code>
</pre>
</div>
<div class="sg-pattern-extra-lineage" style="display: none">
<span class="sg-pattern-extra-name">Lineages</span>
{% if partial.patternLineageExists %}
<div class="sg-pattern-extra-lineage">
The <span class="sg-pattern-extra-lineage-name">{{ partial.patternPartial }}</span> pattern contains the following pattern(s):
<ul>
{% for patternLineage in partial.patternLineages %}
<li> <a href="{{ patternLineage.lineagePath }}" class="{% if patternLineage.lineageState %}sg-pattern-state {{ patternLineage.lineageState }} {% endif %}" data-patternpartial="{{ patternLineage.lineagePattern }}">{{ patternLineage.lineagePattern }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if partial.patternLineageRExists %}
<div class="sg-pattern-extra-lineage">
The <span class="sg-pattern-extra-lineage-name">{{ partial.patternPartial }}</span> pattern is included in the following pattern(s):
<ul>
{% for patternLineageR in partial.patternLineagesR %}
<li> <a href="{{ patternLineageR.lineagePath }}" class="{% if patternLineageR.lineageState %}sg-pattern-state {{ patternLineageR.lineageState }} {% endif %}" data-patternpartial="{{ patternLineageR.lineagePattern }}">{{ patternLineageR.lineagePattern }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if not partial.patternLineageEExists %}
The <span class="sg-pattern-extra-lineage-name">{{ partial.patternPartial }}</span> pattern doesn't have any lineage information.
{% endif %}
</div>
{% if partial.patternCSSExists %}
<div class="sg-pattern-extra-css" style="display: none">
<span class="sg-pattern-extra-name">{{ partial.patternEngineName }}</span>
<pre>
<code id="sg-pattern-extra-engine-container">
{{ partial.patternCSS }}
</code>
</pre>
</div>
{% endif %}
</div>
</div>
<div class="sg-pattern-head">
<h3 class="sg-pattern-title">
<a href="../../patterns/{{ partial.patternLink }}" class="patternLink" data-patternpartial="{{ partial.patternPartial }}" title="Link to Pattern">
{{ partial.patternName }}

{% if partial.patternState %}
<span class="sg-pattern-state {{ partial.patternState }}">
{{ partial.patternState }}
</span>
{% endif %}
</a>
</h3>

<div class="sg-pattern-breadcrumb">
{{ partial.patternBreadcrumb }}
</div>

<a href="#" data-patternpartial="{{ partial.patternPartial }}" title="View Pattern Info" id="sg-pattern-extra-toggle-{{partial.patternPartial}}" class="sg-pattern-extra-toggle">
<span>&#9660;</span>
</a>
</div>

<div class="sg-pattern-extra" id="sg-pattern-extra-{{ partial.patternPartial }}"></div>

<div class="sg-pattern-example">
{{ partial.patternPartialCode | raw }}
</div>

<script type="text/json" id="sg-pattern-data-{{partial.patternPartial}}" class="sg-pattern-data">
{{ partial.patternData | raw }}
</script>
</div><!--end .sg-pattern-->
13 changes: 9 additions & 4 deletions views/partials/patternSectionSubtype.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<div id="{{ partial.patternPartial }}" class="sg-subtype">
<h2><a href="../../patterns/{{ partial.patternLink }}" class="patternLink" data-patternpartial="{{ partial.patternPartial }}">{{ partial.patternName }}</a></h2>
<div class="sg-pattern-body">
{{ partial.patternDesc | raw }}
</div>
<h2>
<a href="../../patterns/{{ partial.patternLink }}" class="patternLink" data-patternpartial="{{ partial.patternPartial }}">
{{ partial.patternName }}
</a>
</h2>

<div class="sg-pattern-body">
{{ partial.patternDesc | raw }}
</div>
</div>
32 changes: 11 additions & 21 deletions views/viewall.twig
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@

<!-- View All Patterns in a Pattern Sub-Type -->
<div class="sg-main" role="main">

<!-- Patterns -->
<div id="sg-patterns">
{% for partial in partials %}
{% if partial.patternSectionSubtype %}
{% include "patternSectionSubtype.twig" %}
{% else %}
{% include "patternSection.twig" %}
{% endif %}
{% endfor %}
</div> <!--end #sg-patterns-->

</div><!--end .sg-main-->

<!-- JS to hook everything together and do annotations -->
<script>
// handle injection of items from builder
var patternPartial = "{{ patternPartial }}";
var lineage = "";
</script>
<!-- Patterns -->
<div id="sg-patterns">
{% for partial in partials %}
{% if partial.patternSectionSubtype %}
{% include "patternSectionSubtype.twig" %}
{% else %}
{% include "patternSection.twig" %}
{% endif %}
{% endfor %}
</div> <!--end #sg-patterns-->
</div><!--end .sg-main-->

0 comments on commit 7b38bfe

Please sign in to comment.