material-design-lite/docs/_templates/snippets.html

57 lines
2.8 KiB
HTML

{% if snippet_group.length === 1 && snippet_group[0].full_width %}
<div class="snippet-group is-full-width">
{% else %}
<div class="snippet-group">
{% endif %}
<div class="snippet-header">
<div class="snippet-demos">
<div class="snippet-demo-padding"></div>
{% for snippet in snippet_group %}
{% if snippet.demo_file %}
{% set snippet_file = "../../src/" + component_name + "/snippets/" + snippet.demo_file %}
{% else %}
{% set snippet_file = "../../src/" + component_name + "/snippets/" + snippet.file %}
{% endif %}
<div class="snippet-demo">
<div class="snippet-demo-container">
{% include snippet_file ignore missing %}
</div>
</div>
{%- endfor %}
<div class="snippet-demo-padding"></div>
</div>
<div class="snippet-captions">
<div class="snippet-caption-padding"></div>
{% for snippet in snippet_group %}
{% set snippet_file = "../../src/" + component_name + "/snippets/" + snippet.file %}
<div class="snippet-caption">
<button class="copy-to-clipboard-button mdl-color-text--grey-600 mdl-button mdl-js-button mdl-js-ripple-effect" href="#{{ component_name }}/{{ snippet.file }}">
<i class="material-icons copy">content_cut</i> {{ snippet.caption }}
<object class="snippet-copy" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param name="movie" value="../assets/clippy.swf"/>
<param name="wmode" value="transparent" />
<param name="quality" value="low" />
<param name="scale" value="exactfit" />
<embed src="../assets/clippy.swf"
scale="exactfit"
quality="low"
wmode="transparent"
FlashVars="text={% filter url_encode %}{% include snippet_file ignore missing %}{% endfilter %}"/>
</object>
</button>
</div>
{%- endfor %}
<div class="snippet-caption-padding"></div>
</div>
</div>
<div class="snippet-code">
<pre class="language-markup codepen-button-enabled">{% for snippet in snippet_group %}{% set snippet_file = "../../src/" + component_name + "/snippets/" + snippet.file %}<code id="{{ component_name }}/{{ snippet.file }}">{% filter e('html') %}{% include snippet_file ignore missing %}{% endfilter %}</code><div class="codepen-extra-css">&lt;style&gt;{% set extra_css_file = "../../src/" + component_name + "/snippets/" + snippet.extra_codepen_css %}{% include extra_css_file ignore missing %}&lt;/style&gt;</div>{%- endfor %}{% if snippet_group.length !== 1 || !snippet_group[0].full_width %}<div class="codepen-extra-css">&lt;style&gt;
body {
padding: 20px;
background: #fafafa;
position: relative;
}
&lt;/style&gt;</div>{% endif %}</pre>
</div>
</div>