summaryrefslogtreecommitdiffstats
path: root/templates/widgets
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2022-06-26 18:29:20 +0100
committerMartin Green <martin.speleo@gmail.com>2022-06-26 18:29:20 +0100
commit4e5d8d1d7612354204d4f1fbbc078482dcdae2b4 (patch)
tree98ea1d959c08e7ca2f484a3aa08704d1ac6fa529 /templates/widgets
parentf1fcef2a6f9c78ceaf7a831ee07ad355d728cf69 (diff)
downloadtroggle-4e5d8d1d7612354204d4f1fbbc078482dcdae2b4.tar.gz
troggle-4e5d8d1d7612354204d4f1fbbc078482dcdae2b4.tar.bz2
troggle-4e5d8d1d7612354204d4f1fbbc078482dcdae2b4.zip
Refactored code, with an aim of allowing more than one HTMLarea on a page
Diffstat (limited to 'templates/widgets')
-rw-r--r--templates/widgets/HTMLarea.html43
1 files changed, 13 insertions, 30 deletions
diff --git a/templates/widgets/HTMLarea.html b/templates/widgets/HTMLarea.html
index 9837327..1f1c99a 100644
--- a/templates/widgets/HTMLarea.html
+++ b/templates/widgets/HTMLarea.html
@@ -1,32 +1,15 @@
-<!--Creates the add image popup-->
-<div><div class="add-image-popup popup-overlay">
- <div class="add-image-popup popup-content">
- <h2>Select Image</h2>
- <p id="image_popup_content"> Loading ...</p>
- <button onclick="new_image_popup()">Upload Image</button>
- <button class="close" onclick="$('.add-image-popup').removeClass('active');">Close</button>
- </div>
-</div>
-
-<!--Creates the new image popup-->
-<div class="new-image-popup popup-overlay">
- <div class="new-image-popup popup-content">
- <h2>New Image</h2>
- <p id="new_image_popup_content"> Loading ...</p>
- <button class="close" onclick="$('.new-image-popup').removeClass('active');">Close</button>
- </div>
-</div>
+<div class="HTMLarea">
{% include "django/forms/widgets/textarea.html" %}
-<iframe id=preview></iframe>
-<button type="button" onclick="addTag('i', '')">italic</button>
-<button type="button" onclick="addTag('b', '')">bold</button>
-<button type="button" onclick="addTag('h2', 'id=&quot;tophead&quot;')">top heading</button>
-<button type="button" onclick="addTag('h1', '')">heading 1</button>
-<button type="button" onclick="addTag('h2', '')">heading 2</button>
-<button type="button" onclick="addTag('h3', '')">heading 3</button>
-<button type="button" onclick="addTag('h4', '')">heading 4</button>
-<button type="button" onclick="addTag('a', 'href=&quot;&quot;')">hyperlink</button>
-<button type="button" onclick="addTag('p', '')">paragraph</button>
-<button type="button" onclick="add_image_popup()">image</button>
-<button type="button" onclick="addStr('<hr/>')">horizontal line</button>
+<iframe id=preview class="HTMLpreview" {% include "django/forms/widgets/attrs.html" with widget=iframe %}></iframe>
+<button type="button" class="addTag" data-tag="i">italic</button>
+<button type="button" class="addTag" data-tag="b">bold</button>
+<button type="button" class="addTag" data-tag="h2" data-attr="id=&quot;tophead&quot;">top heading</button>
+<button type="button" class="addTag" data-tag="h1">heading 1</button>
+<button type="button" class="addTag" data-tag="h2">heading 2</button>
+<button type="button" class="addTag" data-tag="h3">heading 3</button>
+<button type="button" class="addTag" data-tag="h4">heading 4</button>
+<button type="button" class="addTag" data-tag="a" data-attr='href=&quot;&quot;'>hyperlink</button>
+<button type="button" class="addTag" data-tag="p">paragraph</button>
+<button type="button" class="addImage">image</button>
+<button type="button" class="addStr" data-str="</hr>">horizontal line</button>
</div>