summaryrefslogtreecommitdiff
path: root/design/templates/admin/insert_images.html
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-11-13 09:22:49 -0500
committerluxagraf <sng@luxagraf.net>2016-11-13 09:22:49 -0500
commit0bf00ae0c85821d5ffeb75bc8dd982d1b423d2aa (patch)
tree8f2ba746eee5919f986e6934a40f9cf5c14587f2 /design/templates/admin/insert_images.html
parent879fbe18d39fef0021c133f59523d3e050be5c73 (diff)
fixed some image insert bugs, added image id
Diffstat (limited to 'design/templates/admin/insert_images.html')
-rw-r--r--design/templates/admin/insert_images.html18
1 files changed, 9 insertions, 9 deletions
diff --git a/design/templates/admin/insert_images.html b/design/templates/admin/insert_images.html
index 7602525..70e1965 100644
--- a/design/templates/admin/insert_images.html
+++ b/design/templates/admin/insert_images.html
@@ -33,8 +33,8 @@ figure {
<script>
// execute your scripts when the DOM is ready. this is a good habit
-function buildImage(image_url, c, caption) {
- html = '<img src="'+image_url+'" class="';
+function buildImage(image_url, id, c, caption) {
+ html = '<img src="'+image_url+'" id="image-'+id+'" class="';
if (c) {
html += c;
}
@@ -59,7 +59,7 @@ $(function(){
});
$('.insert').click(function(){
- var code = buildImage($(this).attr('data-src'), $(this).attr('data-class'), $(this).attr('data-caption'));
+ var code = buildImage($(this).attr('data-src'), $(this).attr('data-id'), $(this).attr('data-class'), $(this).attr('data-caption'));
var el = parent.document.getElementById('{{textarea_id}}');
var start = el.selectionStart
var end = el.selectionEnd
@@ -92,14 +92,14 @@ $(function(){
<div class="item-wrapper">
<figure class="item" >
<img src="{% get_image_by_size image 'tn' %}" />
- <figcaption>{{image.title}} {% if image.caption %}&ndash; {{image.caption}}{%endif%}</figcaption>
+ <figcaption>{{image.id}} - {{image.title}} {% if image.caption %}&ndash; {{image.caption}}{%endif%}</figcaption>
</figure>
<ul class="actions">
- <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-class="picwide" class="insert" href="">full width</a></li>
- <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-class="picfull" class="insert" href="">column width</a></li>
- <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-class="picwide" data-caption="true" class="insert" href="">full width cap</a></li>
- <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-class="picfull" data-caption="true" class="insert" href="">column width cap</a></li>
- <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-class="cluster pic" class="insert" href="">cluster</a></li>
+ <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-id="{{image.id}}" data-class="picwide" class="insert" href="">full width</a></li>
+ <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-id="{{image.id}}" data-class="picfull" class="insert" href="">column width</a></li>
+ <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-id="{{image.id}}" data-class="picwide" data-caption="true" class="insert" href="">full width cap</a></li>
+ <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-id="{{image.id}}" data-class="picfull" data-caption="true" class="insert" href="">column width cap</a></li>
+ <li><a data-src="{% get_image_by_size image 'admin_insert' %}" data-id="{{image.id}}" data-class="cluster pic" class="insert" href="">cluster</a></li>
<li><a href="/admin/photos/luximage/{{image.pk}}/change/">Edit Image</a></li>
</ul>
</div>