Replace fieldset elements with div.form-group

Move Staticman v2 comment logic above v1 as it will be deprecated soon.
This commit is contained in:
Michael Rose 2017-10-05 09:56:54 -04:00
parent 838c9b4788
commit 9af1e8d548
4 changed files with 698 additions and 678 deletions

View file

@ -1,169 +1,169 @@
<div class="page__comments"> <div class="page__comments">
{% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %} {% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %}
{% case site.comments.provider %} {% case site.comments.provider %}
{% when "discourse" %} {% when "discourse" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="discourse-comments"></section> <section id="discourse-comments"></section>
{% when "disqus" %} {% when "disqus" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="disqus_thread"></section> <section id="disqus_thread"></section>
{% when "facebook" %} {% when "facebook" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section class="fb-comments" data-href="{{ page.url | absolute_url }}" data-mobile="true" data-num-posts="{{ site.comments.facebook.num_posts | default: 5 }}" data-width="100%" data-colorscheme="{{ site.comments.facebook.colorscheme | default: 'light' }}"></section> <section class="fb-comments" data-href="{{ page.url | absolute_url }}" data-mobile="true" data-num-posts="{{ site.comments.facebook.num_posts | default: 5 }}" data-width="100%" data-colorscheme="{{ site.comments.facebook.colorscheme | default: 'light' }}"></section>
{% when "google-plus" %} {% when "google-plus" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="g-comments" class="g-comments">Loading Google+ Comments ...</section> <section id="g-comments" class="g-comments">Loading Google+ Comments ...</section>
<script> <script>
function initComment() { function initComment() {
gapi.comments.render("g-comments", { gapi.comments.render("g-comments", {
href: "{{ page.url | absolute_url }}", href: "{{ page.url | absolute_url }}",
width: "624", width: "624",
first_party_property: "BLOGGER", first_party_property: "BLOGGER",
view_type: "FILTERED_POSTMOD" view_type: "FILTERED_POSTMOD"
}) })
} }
</script> </script>
<script async type="text/javascript" src="https://apis.google.com/js/plusone.js" onload="initComment()" /> <script async type="text/javascript" src="https://apis.google.com/js/plusone.js" onload="initComment()" />
<noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>--> <noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>-->
{% when "staticman" %} {% when "staticman_v2" %}
<section id="static-comments"> <section id="static-comments">
{% if site.repository and site.staticman.branch %} {% if site.repository and site.staticman.branch %}
<!-- Start static comments --> <!-- Start static comments -->
<div class="js-comments"> <div class="js-comments">
{% if site.data.comments[page.slug] %} {% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] | sort %} {% assign comments = site.data.comments[page.slug] | sort %}
{% for comment in comments %} {% for comment in comments %}
{% assign email = comment[1].email %} {% assign email = comment[1].email %}
{% assign name = comment[1].name %} {% assign name = comment[1].name %}
{% assign url = comment[1].url %} {% assign url = comment[1].url %}
{% assign date = comment[1].date %} {% assign date = comment[1].date %}
{% assign message = comment[1].message %} {% assign message = comment[1].message %}
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
<!-- End static comments --> <!-- End static comments -->
<!-- Start new comment form --> <!-- Start new comment form -->
<div class="page__comments-form"> <div class="page__comments-form">
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p> <p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}"> <form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v2/entry/{{ site.repository }}/{{ site.staticman.branch }}/comments">
<div class="form__spinner"> <div class="form__spinner">
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i> <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span> <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
</div> </div>
<fieldset> <div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label> <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea> <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div> <div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label> <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" /> <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label> <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" /> <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label> <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/> <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</fieldset> </div>
<fieldset class="hidden" style="display: none;"> <div class="form-group hidden" style="display: none;">
<input type="hidden" name="options[slug]" value="{{ page.slug }}"> <input type="hidden" name="options[slug]" value="{{ page.slug }}">
<label for="comment-form-location">Not used. Leave blank if you are a human.</label> <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/> <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
</fieldset> <input type="hidden" name="options[reCaptcha][siteKey]" value="{{ site.reCaptcha.siteKey }}">
<!-- Start comment form alert messaging --> <input type="hidden" name="options[reCaptcha][secret]" value="{{ site.reCaptcha.secret }}">
<p class="hidden js-notice"> </div>
<strong class="js-notice-text"></strong> <!-- Start comment form alert messaging -->
</p> <p class="hidden js-notice">
<!-- End comment form alert messaging --> <strong class="js-notice-text"></strong>
<fieldset> </p>
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button> <!-- End comment form alert messaging -->
</fieldset> <div class="form-group">
</form> <div class="g-recaptcha" data-sitekey="{{ site.reCaptcha.siteKey }}"></div>
</div> </div>
<!-- End new comment form --> <div class="form-group">
{% endif %} <button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
</section> </div>
{% when "staticman_v2" %} </form>
<section id="static-comments"> </div>
{% if site.repository and site.staticman.branch %} <!-- End new comment form -->
<!-- Start static comments --> {% if site.reCaptcha.siteKey %}<script async src="https://www.google.com/recaptcha/api.js"></script>{% endif %}
<div class="js-comments"> {% endif %}
{% if site.data.comments[page.slug] %} </section>
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4> {% when "staticman" %}
{% assign comments = site.data.comments[page.slug] | sort %} <section id="static-comments">
{% if site.repository and site.staticman.branch %}
<!-- Start static comments -->
<div class="js-comments">
{% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] | sort %}
{% for comment in comments %} {% for comment in comments %}
{% assign email = comment[1].email %} {% assign email = comment[1].email %}
{% assign name = comment[1].name %} {% assign name = comment[1].name %}
{% assign url = comment[1].url %} {% assign url = comment[1].url %}
{% assign date = comment[1].date %} {% assign date = comment[1].date %}
{% assign message = comment[1].message %} {% assign message = comment[1].message %}
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
<!-- End static comments --> <!-- End static comments -->
<!-- Start new comment form --> <!-- Start new comment form -->
<div class="page__comments-form"> <div class="page__comments-form">
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p> <p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v2/entry/{{ site.repository }}/{{ site.staticman.branch }}/comments"> <form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}">
<div class="form__spinner"> <div class="form__spinner">
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i> <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span> <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
</div> </div>
<fieldset> <div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label> <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea> <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div> <div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label> <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" /> <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label> <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" /> <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label> <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/> <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</fieldset> </div>
<fieldset class="hidden" style="display: none;"> <div class="form-group hidden" style="display: none;">
<input type="hidden" name="options[slug]" value="{{ page.slug }}"> <input type="hidden" name="options[slug]" value="{{ page.slug }}">
<label for="comment-form-location">Not used. Leave blank if you are a human.</label> <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/> <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
<input type="hidden" name="options[reCaptcha][siteKey]" value="{{ site.reCaptcha.siteKey }}"> </div>
<input type="hidden" name="options[reCaptcha][secret]" value="{{ site.reCaptcha.secret }}"> <!-- Start comment form alert messaging -->
</fieldset> <p class="hidden js-notice">
<!-- Start comment form alert messaging --> <strong class="js-notice-text"></strong>
<p class="hidden js-notice"> </p>
<strong class="js-notice-text"></strong> <!-- End comment form alert messaging -->
</p> <div class="form-group">
<!-- End comment form alert messaging --> <button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
<fieldset> </div>
<div class="g-recaptcha" data-sitekey="{{ site.reCaptcha.siteKey }}"></div> </form>
</fieldset> </div>
<fieldset> <!-- End new comment form -->
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button> {% endif %}
</fieldset> </section>
</form> {% when "custom" %}
</div> <section id="custom-comments"></section>
<!-- End new comment form -->
{% if site.reCaptcha.siteKey %}<script async src="https://www.google.com/recaptcha/api.js"></script>{% endif %}
{% endif %}
</section>
{% when "custom" %}
<section id="custom-comments"></section>
{% endcase %} {% endcase %}
</div> </div>

View file

@ -2,388 +2,398 @@
Forms Forms
========================================================================== */ ========================================================================== */
form { form {
margin: 0 0 5px 0;
padding: 1em;
background-color: $form-background-color;
fieldset {
margin-bottom: 5px;
padding: 0;
border-width: 0;
}
legend {
display: block;
width: 100%;
margin-bottom: 5px * 2;
*margin-left: -7px;
padding: 0;
color: $text-color;
border: 0;
white-space: normal;
}
p {
margin-bottom: 5px / 2;
}
ul {
list-style-type: none;
margin: 0 0 5px 0; margin: 0 0 5px 0;
padding: 0; padding: 1em;
background-color: $form-background-color;
fieldset {
margin-bottom: 5px;
padding: 0;
border-width: 0;
}
legend {
display: block;
width: 100%;
margin-bottom: 5px * 2;
*margin-left: -7px;
padding: 0;
color: $text-color;
border: 0;
white-space: normal;
}
p {
margin-bottom: 5px / 2;
}
ul {
list-style-type: none;
margin: 0 0 5px 0;
padding: 0;
}
br {
display: none;
}
} }
br { label,
display: none; input,
button,
select,
textarea {
vertical-align: baseline;
*vertical-align: middle;
} }
}
label, input,
input, button,
button, select,
select, textarea {
textarea { box-sizing: border-box;
vertical-align: baseline; font-family: $sans-serif;
*vertical-align: middle; }
}
input, label {
button, display: block;
select, margin-bottom: 0.25em;
textarea { color: $text-color;
box-sizing: border-box; cursor: pointer;
font-family: $sans-serif;
}
label { small {
display: block; font-size: $type-size-6;
margin-bottom: 0.25em; }
color: $text-color;
cursor: pointer;
small { input,
font-size: $type-size-6; textarea,
select {
display: block;
}
} }
input, input,
textarea, textarea,
select { select {
display: inline-block;
width: 100%;
padding: 0.25em;
margin-bottom: 0.5em;
color: $text-color;
background-color: $background-color;
border: $border-color;
border-radius: $border-radius;
box-shadow: $box-shadow;
}
.input-mini {
width: 60px;
}
.input-small {
width: 90px;
}
input[type="image"],
input[type="checkbox"],
input[type="radio"] {
width: auto;
height: auto;
padding: 0;
margin: 3px 0;
*margin-top: 0;
line-height: normal;
cursor: pointer;
border-radius: 0;
border: 0 \9;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*width: 13px;
*height: 13px;
}
input[type="image"] {
border: 0;
box-shadow: none;
}
input[type="file"] {
width: auto;
padding: initial;
line-height: initial;
border: initial;
background-color: transparent;
background-color: initial;
box-shadow: none;
}
input[type="button"],
input[type="reset"],
input[type="submit"] {
width: auto;
height: auto;
cursor: pointer;
*overflow: visible;
}
select,
input[type="file"] {
*margin-top: 4px;
}
select {
width: auto;
background-color: #fff;
}
select[multiple],
select[size] {
height: auto;
}
textarea {
resize: vertical;
height: auto;
overflow: auto;
vertical-align: top;
}
input[type="hidden"] {
display: none;
}
.form {
position: relative;
}
.radio,
.checkbox {
padding-left: 18px;
font-weight: normal;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: left;
margin-left: -18px;
}
.radio.inline,
.checkbox.inline {
display: inline-block;
padding-top: 5px;
margin-bottom: 0;
vertical-align: middle;
}
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
margin-left: 10px;
}
/*
Disabled state
========================================================================== */
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
opacity: 0.5;
cursor: not-allowed;
}
/*
Focus & active state
========================================================================== */
input:focus,
textarea:focus {
border-color: $primary-color;
outline: 0;
outline: thin dotted \9;
box-shadow: inset 0 1px 3px rgba($text-color, 0.06), 0 0 5px rgba($primary-color, 0.7);
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus,
select:focus {
box-shadow: none;
}
/*
Help text
========================================================================== */
.help-block,
.help-inline {
color: $muted-text-color;
}
.help-block {
display: block;
margin-bottom: 1em;
line-height: 1em;
}
.help-inline {
display: inline-block;
vertical-align: middle;
padding-left: 5px;
}
/*
.form-group
========================================================================== */
.form-group {
margin-bottom: 5px;
padding: 0;
border-width: 0;
}
/*
.form-inline
========================================================================== */
.form-inline input,
.form-inline textarea,
.form-inline select {
display: inline-block;
margin-bottom: 0;
}
.form-inline label {
display: inline-block;
}
.form-inline .radio,
.form-inline .checkbox,
.form-inline .radio {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: left;
margin-left: 0;
margin-right: 3px; }
/*
.form-search
========================================================================== */
.form-search input,
.form-search textarea,
.form-search select {
display: inline-block;
margin-bottom: 0;
}
.form-search .search-query {
padding-left: 14px;
padding-right: 14px;
margin-bottom: 0;
border-radius: 14px;
}
.form-search label {
display: inline-block;
}
.form-search .radio,
.form-search .checkbox,
.form-inline .radio {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"] {
float: left;
margin-left: 0;
margin-right: 3px;
}
/*
.form--loading
========================================================================== */
.form--loading:before {
content: '';
}
.form--loading .form__spinner {
display: block; display: block;
} }
}
input, .form:before {
textarea, position: absolute;
select { top: 0;
display: inline-block; left: 0;
width: 100%; width: 100%;
padding: 0.25em; height: 100%;
margin-bottom: 0.5em; background-color: rgba(255, 255, 255, 0.7);
color: $text-color; z-index: 10;
background-color: $background-color; }
border: $border-color;
border-radius: $border-radius;
box-shadow: $box-shadow;
}
.input-mini { .form__spinner {
width: 60px; display: none;
} position: absolute;
top: 50%;
.input-small { left: 50%;
width: 90px; z-index: 11;
} }
input[type="image"],
input[type="checkbox"],
input[type="radio"] {
width: auto;
height: auto;
padding: 0;
margin: 3px 0;
*margin-top: 0;
line-height: normal;
cursor: pointer;
border-radius: 0;
border: 0 \9;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*width: 13px;
*height: 13px;
}
input[type="image"] {
border: 0;
box-shadow: none;
}
input[type="file"] {
width: auto;
padding: initial;
line-height: initial;
border: initial;
background-color: transparent;
background-color: initial;
box-shadow: none;
}
input[type="button"],
input[type="reset"],
input[type="submit"] {
width: auto;
height: auto;
cursor: pointer;
*overflow: visible;
}
select,
input[type="file"] {
*margin-top: 4px;
}
select {
width: auto;
background-color: #fff;
}
select[multiple],
select[size] {
height: auto;
}
textarea {
resize: vertical;
height: auto;
overflow: auto;
vertical-align: top;
}
input[type="hidden"] {
display: none;
}
.form {
position: relative;
}
.radio,
.checkbox {
padding-left: 18px;
font-weight: normal;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: left;
margin-left: -18px;
}
.radio.inline,
.checkbox.inline {
display: inline-block;
padding-top: 5px;
margin-bottom: 0;
vertical-align: middle;
}
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
margin-left: 10px;
}
/*
Disabled state
========================================================================== */
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
opacity: 0.5;
cursor: not-allowed;
}
/*
Focus & active state
========================================================================== */
input:focus,
textarea:focus {
border-color: $primary-color;
outline: 0;
outline: thin dotted \9;
box-shadow: inset 0 1px 3px rgba($text-color, 0.06), 0 0 5px rgba($primary-color, 0.7);
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus,
select:focus {
box-shadow: none;
}
/*
Help text
========================================================================== */
.help-block,
.help-inline {
color: $muted-text-color;
}
.help-block {
display: block;
margin-bottom: 1em;
line-height: 1em;
}
.help-inline {
display: inline-block;
vertical-align: middle;
padding-left: 5px;
}
/*
.form-inline
========================================================================== */
.form-inline input,
.form-inline textarea,
.form-inline select {
display: inline-block;
margin-bottom: 0;
}
.form-inline label {
display: inline-block;
}
.form-inline .radio,
.form-inline .checkbox,
.form-inline .radio {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: left;
margin-left: 0;
margin-right: 3px; }
/*
.form-search
========================================================================== */
.form-search input,
.form-search textarea,
.form-search select {
display: inline-block;
margin-bottom: 0;
}
.form-search .search-query {
padding-left: 14px;
padding-right: 14px;
margin-bottom: 0;
border-radius: 14px;
}
.form-search label {
display: inline-block;
}
.form-search .radio,
.form-search .checkbox,
.form-inline .radio {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"] {
float: left;
margin-left: 0;
margin-right: 3px;
}
/*
.form--loading
========================================================================== */
.form--loading:before {
content: '';
}
.form--loading .form__spinner {
display: block;
}
.form:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
z-index: 10;
}
.form__spinner {
display: none;
position: absolute;
top: 50%;
left: 50%;
z-index: 11;
}
/* /*
Google search form Google search form
========================================================================== */ ========================================================================== */
#goog-fixurl { #goog-fixurl {
ul { ul {
list-style: none; list-style: none;
margin-left: 0; margin-left: 0;
padding-left: 0; padding-left: 0;
li { li {
list-style-type: none; list-style-type: none;
}
} }
} }
}
#goog-wm-qt { #goog-wm-qt {
width: auto; width: auto;
margin-right: 10px; margin-right: 10px;
margin-bottom: 20px; margin-bottom: 20px;
padding: 8px 20px; padding: 8px 20px;
display: inline-block; display: inline-block;
font-size: $type-size-6; font-size: $type-size-6;
background-color: #fff; background-color: #fff;
color: #000; color: #000;
border-width: 2px !important; border-width: 2px !important;
border-style: solid !important; border-style: solid !important;
border-color: $border-color; border-color: $border-color;
border-radius: $border-radius; border-radius: $border-radius;
} }
#goog-wm-sb { #goog-wm-sb {
@extend .btn; @extend .btn;
} }

View file

@ -1,169 +1,169 @@
<div class="page__comments"> <div class="page__comments">
{% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %} {% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %}
{% case site.comments.provider %} {% case site.comments.provider %}
{% when "discourse" %} {% when "discourse" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="discourse-comments"></section> <section id="discourse-comments"></section>
{% when "disqus" %} {% when "disqus" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="disqus_thread"></section> <section id="disqus_thread"></section>
{% when "facebook" %} {% when "facebook" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section class="fb-comments" data-href="{{ page.url | absolute_url }}" data-mobile="true" data-num-posts="{{ site.comments.facebook.num_posts | default: 5 }}" data-width="100%" data-colorscheme="{{ site.comments.facebook.colorscheme | default: 'light' }}"></section> <section class="fb-comments" data-href="{{ page.url | absolute_url }}" data-mobile="true" data-num-posts="{{ site.comments.facebook.num_posts | default: 5 }}" data-width="100%" data-colorscheme="{{ site.comments.facebook.colorscheme | default: 'light' }}"></section>
{% when "google-plus" %} {% when "google-plus" %}
<h4 class="page__comments-title">{{ comments_label }}</h4> <h4 class="page__comments-title">{{ comments_label }}</h4>
<section id="g-comments" class="g-comments">Loading Google+ Comments ...</section> <section id="g-comments" class="g-comments">Loading Google+ Comments ...</section>
<script> <script>
function initComment() { function initComment() {
gapi.comments.render("g-comments", { gapi.comments.render("g-comments", {
href: "{{ page.url | absolute_url }}", href: "{{ page.url | absolute_url }}",
width: "624", width: "624",
first_party_property: "BLOGGER", first_party_property: "BLOGGER",
view_type: "FILTERED_POSTMOD" view_type: "FILTERED_POSTMOD"
}) })
} }
</script> </script>
<script async type="text/javascript" src="https://apis.google.com/js/plusone.js" onload="initComment()" /> <script async type="text/javascript" src="https://apis.google.com/js/plusone.js" onload="initComment()" />
<noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>--> <noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>-->
{% when "staticman" %} {% when "staticman_v2" %}
<section id="static-comments"> <section id="static-comments">
{% if site.repository and site.staticman.branch %} {% if site.repository and site.staticman.branch %}
<!-- Start static comments --> <!-- Start static comments -->
<div class="js-comments"> <div class="js-comments">
{% if site.data.comments[page.slug] %} {% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] | sort %} {% assign comments = site.data.comments[page.slug] | sort %}
{% for comment in comments %} {% for comment in comments %}
{% assign email = comment[1].email %} {% assign email = comment[1].email %}
{% assign name = comment[1].name %} {% assign name = comment[1].name %}
{% assign url = comment[1].url %} {% assign url = comment[1].url %}
{% assign date = comment[1].date %} {% assign date = comment[1].date %}
{% assign message = comment[1].message %} {% assign message = comment[1].message %}
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
<!-- End static comments --> <!-- End static comments -->
<!-- Start new comment form --> <!-- Start new comment form -->
<div class="page__comments-form"> <div class="page__comments-form">
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p> <p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}"> <form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v2/entry/{{ site.repository }}/{{ site.staticman.branch }}/comments">
<div class="form__spinner"> <div class="form__spinner">
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i> <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span> <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
</div> </div>
<fieldset> <div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label> <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea> <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div> <div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label> <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" /> <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label> <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" /> <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label> <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/> <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</fieldset> </div>
<fieldset class="hidden" style="display: none;"> <div class="form-group hidden" style="display: none;">
<input type="hidden" name="options[slug]" value="{{ page.slug }}"> <input type="hidden" name="options[slug]" value="{{ page.slug }}">
<label for="comment-form-location">Not used. Leave blank if you are a human.</label> <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/> <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
</fieldset> <input type="hidden" name="options[reCaptcha][siteKey]" value="{{ site.reCaptcha.siteKey }}">
<!-- Start comment form alert messaging --> <input type="hidden" name="options[reCaptcha][secret]" value="{{ site.reCaptcha.secret }}">
<p class="hidden js-notice"> </div>
<strong class="js-notice-text"></strong> <!-- Start comment form alert messaging -->
</p> <p class="hidden js-notice">
<!-- End comment form alert messaging --> <strong class="js-notice-text"></strong>
<fieldset> </p>
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button> <!-- End comment form alert messaging -->
</fieldset> <div class="form-group">
</form> <div class="g-recaptcha" data-sitekey="{{ site.reCaptcha.siteKey }}"></div>
</div> </div>
<!-- End new comment form --> <div class="form-group">
{% endif %} <button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
</section> </div>
{% when "staticman_v2" %} </form>
<section id="static-comments"> </div>
{% if site.repository and site.staticman.branch %} <!-- End new comment form -->
<!-- Start static comments --> {% if site.reCaptcha.siteKey %}<script async src="https://www.google.com/recaptcha/api.js"></script>{% endif %}
<div class="js-comments"> {% endif %}
{% if site.data.comments[page.slug] %} </section>
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4> {% when "staticman" %}
{% assign comments = site.data.comments[page.slug] | sort %} <section id="static-comments">
{% if site.repository and site.staticman.branch %}
<!-- Start static comments -->
<div class="js-comments">
{% if site.data.comments[page.slug] %}
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}</h4>
{% assign comments = site.data.comments[page.slug] | sort %}
{% for comment in comments %} {% for comment in comments %}
{% assign email = comment[1].email %} {% assign email = comment[1].email %}
{% assign name = comment[1].name %} {% assign name = comment[1].name %}
{% assign url = comment[1].url %} {% assign url = comment[1].url %}
{% assign date = comment[1].date %} {% assign date = comment[1].date %}
{% assign message = comment[1].message %} {% assign message = comment[1].message %}
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
<!-- End static comments --> <!-- End static comments -->
<!-- Start new comment form --> <!-- Start new comment form -->
<div class="page__comments-form"> <div class="page__comments-form">
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p> <p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v2/entry/{{ site.repository }}/{{ site.staticman.branch }}/comments"> <form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}">
<div class="form__spinner"> <div class="form__spinner">
<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i> <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span> <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>
</div> </div>
<fieldset> <div class="form-group">
<label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label> <label for="comment-form-message">{{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} <small class="required">*</small></label>
<textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea> <textarea type="text" rows="3" id="comment-form-message" name="fields[message]" tabindex="1"></textarea>
<div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div> <div class="small help-block"><a href="https://daringfireball.net/projects/markdown/">{{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}</a></div>
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label> <label for="comment-form-name">{{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} <small class="required">*</small></label>
<input type="text" id="comment-form-name" name="fields[name]" tabindex="2" /> <input type="text" id="comment-form-name" name="fields[name]" tabindex="2" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label> <label for="comment-form-email">{{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} <small class="required">*</small></label>
<input type="email" id="comment-form-email" name="fields[email]" tabindex="3" /> <input type="email" id="comment-form-email" name="fields[email]" tabindex="3" />
</fieldset> </div>
<fieldset> <div class="form-group">
<label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label> <label for="comment-form-url">{{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}</label>
<input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/> <input type="url" id="comment-form-url" name="fields[url]" tabindex="4"/>
</fieldset> </div>
<fieldset class="hidden" style="display: none;"> <div class="form-group hidden" style="display: none;">
<input type="hidden" name="options[slug]" value="{{ page.slug }}"> <input type="hidden" name="options[slug]" value="{{ page.slug }}">
<label for="comment-form-location">Not used. Leave blank if you are a human.</label> <label for="comment-form-location">Not used. Leave blank if you are a human.</label>
<input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/> <input type="text" id="comment-form-location" name="fields[hidden]" autocomplete="off"/>
<input type="hidden" name="options[reCaptcha][siteKey]" value="{{ site.reCaptcha.siteKey }}"> </div>
<input type="hidden" name="options[reCaptcha][secret]" value="{{ site.reCaptcha.secret }}"> <!-- Start comment form alert messaging -->
</fieldset> <p class="hidden js-notice">
<!-- Start comment form alert messaging --> <strong class="js-notice-text"></strong>
<p class="hidden js-notice"> </p>
<strong class="js-notice-text"></strong> <!-- End comment form alert messaging -->
</p> <div class="form-group">
<!-- End comment form alert messaging --> <button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button>
<fieldset> </div>
<div class="g-recaptcha" data-sitekey="{{ site.reCaptcha.siteKey }}"></div> </form>
</fieldset> </div>
<fieldset> <!-- End new comment form -->
<button type="submit" id="comment-form-submit" tabindex="5" class="btn btn--primary btn--large">{{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}</button> {% endif %}
</fieldset> </section>
</form> {% when "custom" %}
</div> <section id="custom-comments"></section>
<!-- End new comment form -->
{% if site.reCaptcha.siteKey %}<script async src="https://www.google.com/recaptcha/api.js"></script>{% endif %}
{% endif %}
</section>
{% when "custom" %}
<section id="custom-comments"></section>
{% endcase %} {% endcase %}
</div> </div>

View file

@ -253,6 +253,16 @@ select:focus {
padding-left: 5px; padding-left: 5px;
} }
/*
.form-group
========================================================================== */
.form-group {
margin-bottom: 5px;
padding: 0;
border-width: 0;
}
/* /*
.form-inline .form-inline