]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/templates/jot.tpl
Update wall_thread.tpl
[friendica.git] / view / theme / frio / templates / jot.tpl
index 76359b9dab55f1c3b31756cbff65c4a7e2f3b028..e04b942df45b03e54a0034971d9d191824ff401a 100644 (file)
@@ -99,8 +99,8 @@
                                        {{/if}}
 
                                        {{* The jot text field in which the post text is inserted *}}
-                                       <div id="jot-text-wrap" class="dropzone" style="overflow:scroll">
-                                               <textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" placeholder="{{$share}}" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;" dir="auto">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
+                                       <div id="jot-text-wrap" class="dropzone">
+                                               <textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" placeholder="{{$share}}" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;" dir="auto" onkeydown="sendOnCtrlEnter(event, 'profile-jot-submit')">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
                                        </div>
 
                                        <ul id="profile-jot-submit-wrapper" class="jothidden nav nav-pills">
                                                <li role="presentation"><button type="button" class="hidden-xs btn-link icon italic" style="cursor: pointer;" aria-label="{{$editalic}}" title="{{$editalic}}" onclick="insertFormattingToPost('i');"><i class="fa fa-italic"></i></button></li>
                                                <li role="presentation"><button type="button" class="hidden-xs btn-link icon bold" style="cursor: pointer;" aria-label="{{$edbold}}" title="{{$edbold}}" onclick="insertFormattingToPost('b');"><i class="fa fa-bold"></i></button></li>
                                                <li role="presentation"><button type="button" class="hidden-xs btn-link icon quote" style="cursor: pointer;" aria-label="{{$edquote}}" title="{{$edquote}}" onclick="insertFormattingToPost('quote');"><i class="fa fa-quote-left"></i></button></li>
+                                               <li role="presentation"><button type="button" class="hidden-xs btn-link icon emojis" style="cursor: pointer;" aria-label="{{$edemojis}}" title="{{$edemojis}}"><i class="fa fa-smile-o"></i></button></li>
                                                <li role="presentation"><button type="button" class="btn-link icon" style="cursor: pointer;" aria-label="{{$edurl}}" title="{{$edurl}}" onclick="insertFormattingToPost('url');"><i class="fa fa-link"></i></button></li>
                                                <li role="presentation"><button type="button" class="btn-link" id="profile-attach"  ondragenter="return linkDropper(event);" ondragover="return linkDropper(event);" ondrop="linkDrop(event);" onclick="jotGetLink();" title="{{$edattach}}"><i class="fa fa-paperclip"></i></button></li>
                                                <li role="presentation"><button type="button" class="btn-link" id="profile-location" onclick="jotGetLocation();" title="{{$setloc}}"><i class="fa fa-map-marker" aria-hidden="true"></i></button></li>
+                                               <li role="presentation"><button type="button" class="hidden-xs btn-link icon underline" style="cursor: pointer;" aria-label="{{$contentwarn}}" title="{{$contentwarn}}" onclick="insertFormattingToPost('abstract');"><i class="fa fa-eye"></i></button></li>
                                                <!-- TODO: waiting for a better placement
                                                <li><button type="button" class="btn-link" id="profile-nolocation" onclick="jotClearLocation();" title="{{$noloc}}">{{$shortnoloc}}</button></li>
                                                -->
 
 {{* The jot modal - We use a own modal for the jot and not the standard modal
 from the page template. This is because the special structure of the jot
-(e.g.jot navigation tabs in the modal titel area).
-Then in the frio theme the jot will loaded regulary and is hidden by default.)
+(e.g.jot navigation tabs in the modal title area).
+Then in the frio theme the jot will loaded regularly and is hidden by default.)
 The js function jotShow() loads the jot into the modal. With this structure we
 can load different content into the jot modal (e.g. the item edit jot)
 *}}
@@ -180,46 +182,5 @@ can load different content into the jot modal (e.g. the item edit jot)
 </script>
 
 <script>
-       Dropzone.autoDiscover = false;
-       var dropzoneJot = new Dropzone( '#jot-text-wrap', {
-               paramName: 'userfile', // The name that will be used to transfer the file
-               maxFilesize: {{$max_imagesize}}, // MB
-               url: '/media/photo/upload?response=url&album=',
-               accept: function(file, done) {
-                       done();
-               },
-               init: function() {
-                       this.on('success', function(file, serverResponse) {
-                               var target = $('#profile-jot-text')
-                               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) + ' ');
-                               }
-                       });
-                       this.on('complete', function(file) {
-                               // Remove just uploaded file from dropzone, makes interface more clear.
-                               // Image can be seen in posting-preview
-                               // We need preview to get optical feedback about upload-progress.
-                               // you see success, when the bb-code link for image is inserted
-                               setTimeout(function(){
-                                       dropzoneJot.removeFile(file);
-                               },5000);
-                       });
-               },
-       });
-
-       // Enables Copy&Paste for this dropzone
-       $('#jot-text-wrap').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
-                               dropzoneJot.addFile(item.getAsFile())
-                       }
-               })
-       })
+       dzFactory.setupDropzone('#jot-text-wrap', 'profile-jot-text'); 
 </script>