forked from MrGreensWorkshop/MrGreen-JekyllTheme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
321bf17
commit 53e15a1
Showing
21 changed files
with
228 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{%-comment-%} | ||
Mr. Green Jekyll Theme - v1.1.0 (https://github.com/MrGreensWorkshop/MrGreen-JekyllTheme) | ||
Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com | ||
Licensed under MIT | ||
{%-endcomment-%} | ||
|
||
{% if site.data.owner[lng].google_forms_contact_form_url != empty -%} | ||
{%- assign contact_form_url_split = site.data.owner[lng].google_forms_contact_form_url | split: '/viewform' -%} | ||
{%- capture contact_form_url -%} {{ contact_form_url_split[0] }}/viewform?embedded=true&hl={{ lng }} {%- endcapture -%} | ||
{%- else %} | ||
{%- capture contact_form_url -%} | ||
javascript:\' | ||
<!DOCTYPE html> | ||
<style>h3{text-align: center;}</style> | ||
<body> | ||
<h3>google_forms_contact_form_url is not set in _data/lang/[language].yml</h3> | ||
</body> | ||
</html> | ||
\' | ||
{%- endcapture -%} | ||
{%- endif %} | ||
|
||
<script> | ||
ContactForm.formURL = '{{ contact_form_url | split: " " | join: " " }}'; | ||
ContactForm.formLoadingText = '{{ site.data.lang[lng].contact_form.formLoadingText }}'; | ||
ContactForm.slideType = '{{ site.data.conf.main.contact_form.slideType }}'; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Mr. Green Jekyll Theme - v1.1.0 (https://github.com/MrGreensWorkshop/MrGreen-JekyllTheme) | ||
* Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com | ||
* Licensed under MIT | ||
*/ | ||
|
||
.contact-form-wrapper { | ||
width: 70vw; | ||
height: 82vh; | ||
max-width: 650px; | ||
} | ||
|
||
.contact-form-wrapper > iframe { | ||
display: block; | ||
width: calc(100% + calc(2 * var(--main-container-margin))); | ||
height: 100%; | ||
border: 0; | ||
margin-left: calc(-1 * var(--main-container-margin)); | ||
} | ||
|
||
@media (max-width: 500px) { | ||
.contact-form-wrapper { | ||
min-width: unset; | ||
max-width: 360px; | ||
width: 86vw; | ||
} | ||
} | ||
|
||
@media (max-width: 350px) { | ||
.contact-form-wrapper { | ||
width: 90vw; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/*! Mr. Green Jekyll Theme - v1.1.0 (https://github.com/MrGreensWorkshop/MrGreen-JekyllTheme) | ||
* Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com | ||
* Licensed under MIT | ||
*/ | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
var globals = { | ||
slidingBoxId: "contact-form-id" | ||
, slideType: "" | ||
, formURL: "" | ||
, formLoadingText: "" | ||
, show: show | ||
, hide: hide | ||
, formLoaded: formLoaded | ||
}; | ||
|
||
/* default properties */ | ||
const properties = {}; | ||
properties.matchPattern = /\{(.*?)\}/g; | ||
properties.formEmbedHTMLformat = '<div class="contact-form-wrapper"><h5>{formloadingtext}</h5><iframe src="{formurl}" onload="ContactForm.formLoaded();"></iframe></div>'; | ||
|
||
var initialized = false; | ||
var contactFormHtml = ''; | ||
|
||
function hide() { | ||
SlidingMsgBox.hide(globals.slidingBoxId); | ||
} | ||
|
||
function show() { | ||
/* initialize once */ | ||
if (initialized == false) { | ||
let property_obj = { | ||
'formurl': globals.formURL | ||
, 'formloadingtext': globals.formLoadingText | ||
}; | ||
contactFormHtml = htmlFormatter(property_obj, properties.formEmbedHTMLformat); | ||
SlidingMsgBox.init(globals.slidingBoxId, contactFormHtml, hide, globals.slideType); | ||
initialized = true; | ||
} | ||
SlidingMsgBox.show(globals.slidingBoxId); | ||
} | ||
|
||
function htmlFormatter(property_obj, layout) { | ||
return layout.replace(properties.matchPattern, function (matchStr, property) { | ||
/* if no property to match, to prevent adding {text} etc. */ | ||
if (isEmpty(property_obj[property])) return ""; | ||
return property_obj[property] || matchStr; | ||
}); | ||
} | ||
|
||
function formLoaded() { | ||
/* fade out the loading message */ | ||
$('#' + globals.slidingBoxId + ' h5').fadeTo("slow", 0, function() { | ||
/* slide up */ | ||
$(this).slideUp("slow", function() { | ||
/* remove the loading message */ | ||
$(this).remove(); | ||
}); | ||
}); | ||
} | ||
|
||
(function (window) { | ||
window.ContactForm = globals; | ||
})(window); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.