2016-03-28 16:29:05 +02:00
|
|
|
|
|
|
|
{{if $threaded}}
|
2023-03-13 03:32:28 +01:00
|
|
|
<div class="comment-wwedit-wrapper threaded dropzone" id="comment-edit-wrapper-{{$id}}">
|
2016-03-28 16:29:05 +02:00
|
|
|
{{else}}
|
2023-03-13 03:32:28 +01:00
|
|
|
<div class="comment-wwedit-wrapper dropzone" id="comment-edit-wrapper-{{$id}}">
|
2016-03-28 16:29:05 +02:00
|
|
|
{{/if}}
|
2020-02-12 05:45:47 +01:00
|
|
|
<form class="comment-edit-form" data-item-id="{{$id}}" id="comment-edit-form-{{$id}}" action="item" method="post">
|
2016-03-28 16:29:05 +02:00
|
|
|
<input type="hidden" name="profile_uid" value="{{$profile_uid}}" />
|
|
|
|
<input type="hidden" name="parent" value="{{$parent}}" />
|
|
|
|
{{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
|
|
|
|
<input type="hidden" name="jsreload" value="{{$jsreload}}" />
|
|
|
|
<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
|
|
|
|
|
2019-02-15 04:28:38 +01:00
|
|
|
<p class="comment-edit-bb-{{$id}} comment-icon-list">
|
|
|
|
<span>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon bb-img" style="cursor: pointer;" aria-label="{{$edimg}}" title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-picture-o"></i>
|
|
|
|
</button>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon bb-attach" style="cursor: pointer;" aria-label="{{$edattach}}" title="{{$edattach}}" ondragenter="return commentLinkDrop(event, {{$id}});" ondragover="return commentLinkDrop(event, {{$id}});" ondrop="commentLinkDropper(event);" onclick="commentGetLink({{$id}}, '{{$prompttext}}');">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-paperclip"></i>
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
<span>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon bb-url" style="cursor: pointer;" aria-label="{{$edurl}}" title="{{$edurl}}" onclick="insertFormatting('url',{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-link"></i>
|
|
|
|
</button>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon underline" style="cursor: pointer;" aria-label="{{$eduline}}" title="{{$eduline}}" onclick="insertFormatting('u',{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-underline"></i>
|
|
|
|
</button>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon italic" style="cursor: pointer;" aria-label="{{$editalic}}" title="{{$editalic}}" onclick="insertFormatting('i',{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-italic"></i>
|
|
|
|
</button>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon bold" style="cursor: pointer;" aria-label="{{$edbold}}" title="{{$edbold}}" onclick="insertFormatting('b',{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-bold"></i>
|
|
|
|
</button>
|
2022-12-08 21:47:52 +01:00
|
|
|
<button type="button" class="btn btn-sm template-icon quote" style="cursor: pointer;" aria-label="{{$edquote}}" title="{{$edquote}}" onclick="insertFormatting('quote',{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<i class="fa fa-quote-left"></i>
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<p>
|
2021-05-20 14:37:45 +02:00
|
|
|
<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty form-control text-autosize" name="body" placeholder="{{$comment}}" rows="3" data-default="{{$default}}" dir="auto">{{$default}}</textarea>
|
2019-02-15 04:28:38 +01:00
|
|
|
</p>
|
|
|
|
{{if $qcomment}}
|
|
|
|
<p>
|
2017-01-07 15:49:13 +01:00
|
|
|
<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
|
2019-02-15 04:28:38 +01:00
|
|
|
<option value=""></option>
|
|
|
|
{{foreach $qcomment as $qc}}
|
|
|
|
<option value="{{$qc}}">{{$qc}}</option>
|
|
|
|
{{/foreach}}
|
2016-03-28 16:29:05 +02:00
|
|
|
</select>
|
2019-02-15 04:28:38 +01:00
|
|
|
</p>
|
|
|
|
{{/if}}
|
2016-03-28 16:29:05 +02:00
|
|
|
|
2019-02-16 23:58:00 +01:00
|
|
|
<p class="comment-edit-submit-wrapper">
|
2019-02-15 04:28:38 +01:00
|
|
|
{{if $preview}}
|
2023-03-08 05:48:34 +01:00
|
|
|
<button type="button" class="btn btn-default comment-edit-preview" onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}"><i class="fa fa-eye"></i> {{$preview}}</button>
|
2019-02-15 04:28:38 +01:00
|
|
|
{{/if}}
|
2023-01-17 20:25:20 +01:00
|
|
|
<button type="submit" class="btn btn-primary comment-edit-submit" id="comment-edit-submit-{{$id}}" name="submit" data-loading-text="{{$loading}}"><i class="fa fa-envelope"></i> {{$submit}}</button>
|
2019-02-16 23:58:00 +01:00
|
|
|
</p>
|
2016-03-28 16:29:05 +02:00
|
|
|
|
2016-11-16 14:19:09 +01:00
|
|
|
<div class="comment-edit-end clear"></div>
|
2016-03-28 16:29:05 +02:00
|
|
|
</form>
|
2023-03-13 10:37:12 +01:00
|
|
|
<div id="dz-preview-{{$id}}" class="dropzone-preview"></div>
|
2017-03-15 04:47:02 +01:00
|
|
|
<div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
|
2016-03-28 16:29:05 +02:00
|
|
|
</div>
|
2019-02-15 04:28:38 +01:00
|
|
|
|
2023-03-13 03:32:28 +01:00
|
|
|
<script>
|
2023-03-13 10:37:12 +01:00
|
|
|
Dropzone.autoDiscover = false;
|
2023-03-13 22:50:59 +01:00
|
|
|
var maxis = {{$max_imagesize}} / 10^6;
|
2023-03-13 10:37:12 +01:00
|
|
|
var dropzone{{$id}} = new Dropzone( '#comment-edit-wrapper-{{$id}}', {
|
|
|
|
paramName: "userfile", // The name that will be used to transfer the file
|
2023-03-13 13:47:09 +01:00
|
|
|
maxFilesize: maxis, // MB
|
2023-03-13 10:37:12 +01:00
|
|
|
previewsContainer: '#dz-preview-{{$id}}',
|
|
|
|
preventDuplicates: true,
|
|
|
|
clickable: true,
|
|
|
|
url: "/media/photo/upload?response=url&album=",
|
|
|
|
accept: function(file, done) {
|
|
|
|
done();
|
|
|
|
},
|
|
|
|
init: function() {
|
|
|
|
this.on("success", function(file, serverResponse) {
|
|
|
|
var target = $('#comment-edit-text-{{$id}}')
|
|
|
|
var resp = $(serverResponse).find('div#content').text()
|
|
|
|
if (target.setRangeText) {
|
|
|
|
//if setRangeText function is supported by current browser
|
|
|
|
target.setRangeText(" " + $.trim(resp) + " ")
|
|
|
|
} else {
|
|
|
|
target.focus()
|
|
|
|
document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#comment-edit-wrapper-{{$id}}').on('paste', function(event){
|
|
|
|
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
|
|
|
items.forEach((item) => {
|
|
|
|
if (item.kind === 'file') {
|
|
|
|
// adds the file to your dropzone instance
|
|
|
|
dropzone{{$id}}.addFile(item.getAsFile())
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2023-03-13 03:32:28 +01:00
|
|
|
</script>
|