Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search_widget and introduction #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoeyStk
Copy link
Collaborator

@JoeyStk JoeyStk commented Sep 19, 2022

This PR adds the search widget as a javascript file, based on the Integreat Search Widget Wordpress Plugin.

@JoeyStk JoeyStk self-assigned this Sep 19, 2022
Copy link
Member

@maxammann maxammann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a little bit lost because of the documentation/file structure which seems to be copy&paste. Comments are in the documentation directory mostly.

Looks good to me!

@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="en">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be "de"

Comment on lines +21 to +22
<textarea id="integreat_textarea_html" class="integreat_class_input">
<div id="integreat-search-widget">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting is slightly off here. I usually use prettier in HTML/JS projects: https://prettier.io/

<textarea id="integreat_textarea_html" class="integreat_class_input">
<div id="integreat-search-widget">
<img src="./assets/integreat-app-logo.png">
<p>Mehrsprachige Informationen in <!-- Region --> finden!</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a placeholder inserted at <!-- Region -->?

<p>Mehrsprachige Informationen in <!-- Region --> finden!</p>
<form method="get">
<input class="integreat_search" id="integreat_search" name="query" placeholder="z.B. Sprachkurse">
<input class="integreat_submit" id="integreat_submit" type="submit" value="SUCHEN">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use text-transform to make something uppercase: https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform

CSS einbetten
</h3>
<textarea id="integreat_textarea_css" class="integreat_class_input">
<style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those styles can be moved to the .css file.

</div>
<div><h3>Javascript einbetten</h3>
<textarea id="integreat_textarea_js" class="integreat_class_input">
<script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved to the .js file.

function add_to_clipboard(id) {
let input_search_widget = document.getElementById(id)
input_search_widget.select();
document.execCommand("Copy");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never used any copy API of the browser. But this API seems to be removed: https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants