]> git.mxchange.org Git - friendica.git/blob - view/jot-header.tpl
fixup image on wall
[friendica.git] / view / jot-header.tpl
1
2 <script language="javascript" type="text/javascript" src="$baseurl/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
3 <script language="javascript" type="text/javascript">
4
5 tinyMCE.init({
6         theme : "advanced",
7         mode : "specific_textareas",
8         editor_selector: /(profile-jot-text|prvmail-text)/,
9         plugins : "bbcode",
10         theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
11         theme_advanced_buttons2 : "",
12         theme_advanced_buttons3 : "",
13         theme_advanced_toolbar_location : "top",
14         theme_advanced_toolbar_align : "center",
15         theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
16         content_css : "bbcode.css",
17         entity_encoding : "raw",
18         add_unload_trigger : false,
19         remove_linebreaks : false,
20         convert_urls: false,
21         content_css: "$baseurl/view/custom_tinymce.css"
22 });
23
24 </script>
25 <script type="text/javascript" src="include/ajaxupload.js" ></script>
26 <script>
27         $(document).ready(function() {
28                 var uploader = new window.AjaxUpload(
29                         'wall-image-upload',
30                         { action: 'wall_upload',
31                                 name: 'userfile',
32                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
33                                 onComplete: function(file,response) {
34 alert(response);                                        tinyMCE.execCommand('mceInsertRawHTML',false,response);
35                                         $('#profile-rotator').hide();
36                                 }                                
37                         }
38                 );
39
40         });
41
42         function jotGetLink() {
43                 reply = prompt("Please enter a link URL:");
44                 if(reply && reply.length) {
45                         $('#profile-rotator').show();
46                         $.get('parse_url?url=' + reply, function(data) {
47                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
48                                 $('#profile-rotator').hide();
49                         });
50                 }
51         }
52
53         function linkdropper(event) {
54                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
55                 if(linkFound)
56                         event.preventDefault();
57         }
58
59         function linkdrop(event) {
60                 var reply = event.dataTransfer.getData("text/uri-list");
61                 event.target.textContent = reply;
62                 event.preventDefault();
63                 if(reply && reply.length) {
64                         $('#profile-rotator').show();
65                         $.get('parse_url?url=' + reply, function(data) {
66                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
67                                 $('#profile-rotator').hide();
68                         });
69                 }
70         }
71
72 </script>
73