Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add CSS file for react-simple-wysiwyg.css

Roland Geider3ee122ec4655
diff --git a/extras/docker/development/Dockerfile b/extras/docker/development/Dockerfile
index 0428dd66e..5bb1adb65 100644
--- a/extras/docker/development/Dockerfile
+++ b/extras/docker/development/Dockerfile
@@ -6,8 +6,7 @@
# Note: you MUST build this image from the project's root!
# docker build -f extras/docker/development/Dockerfile --tag wger/server .
#
-# Run the container:
-# docker run -ti -v /path/to/this/checkout:/home/wger/src --name wger.dev --publish 8000:8000 wger/server
+# To run the container consult https://github.com/wger-project/docker
##########
# Builder
diff --git a/wger/core/static/css/react-simple-wysiwyg.css b/wger/core/static/css/react-simple-wysiwyg.css
new file mode 100644
index 000000000..5579898ed
--- /dev/null
+++ b/wger/core/static/css/react-simple-wysiwyg.css
@@ -0,0 +1,89 @@
+/*
+ This file is part of Workout Manager
+
+ Workout Manager is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Workout Manager is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*
+ * Hack: this is the copied CSS from https://github.com/megahertz/react-simple-wysiwyg
+ * so that the styles are loaded when loading this in a shadow dom in the django
+ * application.
+ */
+.rsw-editor {
+ border: 1px solid #ddd;
+ border-radius: 0.375rem;
+ display: flex;
+ flex-direction: column;
+ min-height: 100px;
+ overflow: hidden;
+}
+
+.rsw-ce {
+ flex: 1 0 auto;
+ padding: 0.5rem;
+}
+
+.rsw-ce:focus {
+ outline: 1px solid #668;
+}
+
+.rsw-ce[contentEditable='true']:empty:not(:focus):before {
+ content: attr(placeholder);
+ color: grey;
+}
+
+.rsw-html {
+ background: transparent;
+ border: none;
+ font-family: monospace, 'Courier New';
+}
+
+.rsw-separator {
+ align-self: stretch;
+ border-right: 1px solid #ddd;
+ display: flex;
+ margin: 0 3px;
+}
+
+.rsw-dd {
+ box-sizing: border-box;
+ outline: none;
+}
+
+.rsw-btn {
+ background: transparent;
+ border: 0;
+ cursor: pointer;
+ color: #222;
+ font-size: 1em;
+ height: 2em;
+ outline: none;
+ padding: 0;
+ width: 2em;
+}
+
+.rsw-btn:hover {
+ background: #eaeaea;
+}
+
+.rsw-btn[data-active='true'] {
+ background: #e0e0e0;
+}
+
+.rsw-toolbar {
+ align-items: center;
+ background-color: #f5f5f5;
+ border-bottom: 1px solid #ddd;
+ display: flex;
+}
diff --git a/wger/core/templates/template.html b/wger/core/templates/template.html
index 02653d320..23410e6ee 100644
--- a/wger/core/templates/template.html
+++ b/wger/core/templates/template.html
@@ -49,11 +49,13 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'yarn/bootstrap-compiled.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-custom.css' %}">
- <link rel="stylesheet" type="text/css"
- href="{% static 'fontawesomefree/css/all.min.css' %}">
+ <link rel="stylesheet" type="text/css" href="{% static 'fontawesomefree/css/all.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'react/main.css' %}" id="react-css">
{% endcompress %}
+ {# this needs to be outside of the compress block! #}
+ <link rel="stylesheet" type="text/css" href="{% static 'css/react-simple-wysiwyg.css' %}" id="react-css">
+
<link rel="icon" href="{% static 'images/favicon.png' %}" type="image/png">
{% compress js %}