3b44bdfce3cf058c95b91b44fa84df8a4c4d8ae2
[friendica.git/.git] / view / templates / msg-header.tpl
1 <script language="javascript" type="text/javascript">
2         $("#prvmail-text").editor_autocomplete(baseurl + '/search/acl');
3 </script>
4 <script type="text/javascript" src="view/js/ajaxupload.js?v={{$VERSION}}"></script>
5 <script>
6         $(document).ready(function() {
7                 var uploader = new window.AjaxUpload(
8                         'prvmail-upload',
9                         { action: 'profile/{{$nickname}}/photos/upload',
10                                 name: 'userfile',
11                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
12                                 onComplete: function(file,response) {
13                                         addeditortext(response);
14                                         $('#profile-rotator').hide();
15                                 }
16                         }
17                 );
18
19                 $("#prvmail-text").bbco_autocomplete('bbcode');
20         });
21
22         function jotGetLink() {
23                 reply = prompt("{{$linkurl}}");
24                 if(reply && reply.length) {
25                         $('#profile-rotator').show();
26                         $.get('parseurl?url=' + reply, function(data) {
27                                 addeditortext(data);
28                                 $('#profile-rotator').hide();
29                         });
30                 }
31         }
32
33         function linkdropper(event) {
34                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
35                 if(linkFound)
36                         event.preventDefault();
37         }
38
39         function linkdrop(event) {
40                 var reply = event.dataTransfer.getData("text/uri-list");
41                 event.target.textContent = reply;
42                 event.preventDefault();
43                 if(reply && reply.length) {
44                         $('#profile-rotator').show();
45                         $.get('parseurl?url=' + reply, function(data) {
46                                 addeditortext(data);
47                                 $('#profile-rotator').hide();
48                         });
49                 }
50         }
51
52         function addeditortext(data) {
53                 var currentText = $("#prvmail-text").val();
54                 $("#prvmail-text").val(currentText + data);
55         }
56
57 </script>
58