]> git.mxchange.org Git - friendica.git/blob - view/msg-header.tpl
1f8650bfe3ea7146ad28e6e8f74931708dcf6763
[friendica.git] / view / msg-header.tpl
1
2 <script language="javascript" type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
3 <script language="javascript" type="text/javascript">
4
5 var plaintext = '$editselect';
6
7 if(plaintext != 'none') {
8         tinyMCE.init({
9                 theme : "advanced",
10                 mode : "specific_textareas",
11                 editor_selector: /(profile-jot-text|prvmail-text)/,
12                 plugins : "bbcode,paste",
13                 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
14                 theme_advanced_buttons2 : "",
15                 theme_advanced_buttons3 : "",
16                 theme_advanced_toolbar_location : "top",
17                 theme_advanced_toolbar_align : "center",
18                 theme_advanced_blockformats : "blockquote,code",
19                 paste_text_sticky : true,
20                 entity_encoding : "raw",
21                 add_unload_trigger : false,
22                 remove_linebreaks : false,
23                 force_p_newlines : false,
24                 force_br_newlines : true,
25                 forced_root_block : '',
26                 convert_urls: false,
27                 content_css: "$baseurl/view/custom_tinymce.css",
28                      //Character count
29                 theme_advanced_path : false,
30                 setup : function(ed) {
31                         ed.onInit.add(function(ed) {
32                                 ed.pasteAsPlainText = true;
33                                 var editorId = ed.editorId;
34                                 var textarea = $('#'+editorId);
35                                 console.log(textarea);
36                                 if (typeof(textarea.attr('tabindex')) != "undefined") {
37                                         $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
38                                         textarea.attr('tabindex', null);
39                                 }
40                         });
41                 },
42         });
43 }
44
45 </script>
46 <script type="text/javascript" src="js/ajaxupload.js" ></script>
47 <script>
48         $(document).ready(function() {
49                 var uploader = new window.AjaxUpload(
50                         'prvmail-upload',
51                         { action: 'wall_upload/$nickname',
52                                 name: 'userfile',
53                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
54                                 onComplete: function(file,response) {
55                                         tinyMCE.execCommand('mceInsertRawHTML',false,response);
56                                         $('#profile-rotator').hide();
57                                 }                                
58                         }
59                 );
60
61         });
62
63         function jotGetLink() {
64                 reply = prompt("$linkurl");
65                 if(reply && reply.length) {
66                         $('#profile-rotator').show();
67                         $.get('parse_url?url=' + reply, function(data) {
68                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
69                                 $('#profile-rotator').hide();
70                         });
71                 }
72         }
73
74         function linkdropper(event) {
75                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
76                 if(linkFound)
77                         event.preventDefault();
78         }
79
80         function linkdrop(event) {
81                 var reply = event.dataTransfer.getData("text/uri-list");
82                 event.target.textContent = reply;
83                 event.preventDefault();
84                 if(reply && reply.length) {
85                         $('#profile-rotator').show();
86                         $.get('parse_url?url=' + reply, function(data) {
87                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
88                                 $('#profile-rotator').hide();
89                         });
90                 }
91         }
92
93 </script>
94