]> git.mxchange.org Git - friendica.git/blob - view/msg-header.tpl
revup
[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 tinyMCE.init({
6         theme : "advanced",
7         mode : "specific_textareas",
8         editor_selector: /(profile-jot-text|prvmail-text)/,
9         plugins : "bbcode,paste",
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_blockformats : "blockquote,code",
16         paste_text_sticky : true,
17         entity_encoding : "raw",
18         add_unload_trigger : false,
19         remove_linebreaks : false,
20         force_p_newlines : false,
21         force_br_newlines : true,
22         forced_root_block : '',
23         convert_urls: false,
24         content_css: "$baseurl/view/custom_tinymce.css",
25              //Character count
26         theme_advanced_path : false,
27         setup : function(ed) {
28                 ed.onKeyUp.add(function(ed, e) {
29                         var txt = tinyMCE.activeEditor.getContent();
30                         var text = txt.length;
31                         if(txt.length <= 140) {
32                                 $('#character-counter').removeClass('red');
33                                 $('#character-counter').removeClass('orange');
34                                 $('#character-counter').addClass('grey');
35                         }
36                         if((txt.length > 140) && (txt .length <= 420)) {
37                                 $('#character-counter').removeClass('grey');
38                                 $('#character-counter').removeClass('red');
39                                 $('#character-counter').addClass('orange');
40                         }
41                         if(txt.length > 420) {
42                                 $('#character-counter').removeClass('grey');
43                                 $('#character-counter').removeClass('orange');
44                                 $('#character-counter').addClass('red');
45                         }
46                         $('#character-counter').text(text);
47         });
48
49                 ed.onInit.add(function(ed) {
50                         ed.pasteAsPlainText = true;
51                 });
52         }
53 });
54
55 </script>
56 <script type="text/javascript" src="js/ajaxupload.js" ></script>
57 <script>
58         $(document).ready(function() {
59                 var uploader = new window.AjaxUpload(
60                         'prvmail-upload',
61                         { action: 'wall_upload/$nickname',
62                                 name: 'userfile',
63                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
64                                 onComplete: function(file,response) {
65                                         tinyMCE.execCommand('mceInsertRawHTML',false,response);
66                                         $('#profile-rotator').hide();
67                                 }                                
68                         }
69                 );
70
71         });
72
73         function jotGetLink() {
74                 reply = prompt("$linkurl");
75                 if(reply && reply.length) {
76                         $('#profile-rotator').show();
77                         $.get('parse_url?url=' + reply, function(data) {
78                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
79                                 $('#profile-rotator').hide();
80                         });
81                 }
82         }
83
84         function linkdropper(event) {
85                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
86                 if(linkFound)
87                         event.preventDefault();
88         }
89
90         function linkdrop(event) {
91                 var reply = event.dataTransfer.getData("text/uri-list");
92                 event.target.textContent = reply;
93                 event.preventDefault();
94                 if(reply && reply.length) {
95                         $('#profile-rotator').show();
96                         $.get('parse_url?url=' + reply, function(data) {
97                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
98                                 $('#profile-rotator').hide();
99                         });
100                 }
101         }
102
103 </script>
104