]> git.mxchange.org Git - friendica.git/blob - view/de/jot-header.tpl
62fbe84e481fc6c79bd6e12d43c3422e3530c7ee
[friendica.git] / view / de / 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 var editor;
6
7 tinyMCE.init({
8         theme : "advanced",
9         mode : "specific_textareas",
10         editor_selector: /(profile-jot-text|prvmail-text)/,
11         plugins : "bbcode,paste",
12         theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
13         theme_advanced_buttons2 : "",
14         theme_advanced_buttons3 : "",
15         theme_advanced_toolbar_location : "top",
16         theme_advanced_toolbar_align : "center",
17         theme_advanced_blockformats : "blockquote,code",
18         paste_text_sticky : true,
19         entity_encoding : "raw",
20         add_unload_trigger : false,
21         remove_linebreaks : false,
22         force_p_newlines : false,
23         force_br_newlines : true,
24         forced_root_block : '',
25         convert_urls: false,
26         content_css: "$baseurl/view/custom_tinymce.css",
27              //Character count
28         theme_advanced_path : false,
29         setup : function(ed) {
30                 ed.onKeyUp.add(function(ed, e) {
31                         var txt = tinyMCE.activeEditor.getContent();
32                         var text = txt.length;
33                         if(txt.length <= 140) {
34                                 $('#character-counter').removeClass('red');
35                                 $('#character-counter').removeClass('orange');
36                                 $('#character-counter').addClass('grey');
37                         }
38                         if((txt.length > 140) && (txt .length <= 420)) {
39                                 $('#character-counter').removeClass('grey');
40                                 $('#character-counter').removeClass('red');
41                                 $('#character-counter').addClass('orange');
42                         }
43                         if(txt.length > 420) {
44                                 $('#character-counter').removeClass('grey');
45                                 $('#character-counter').removeClass('orange');
46                                 $('#character-counter').addClass('red');
47                         }
48                         $('#character-counter').text(text);
49         });
50
51                 ed.onInit.add(function(ed) {
52                         ed.pasteAsPlainText = true;
53                 });
54
55         }
56 });
57
58 </script>
59 <script type="text/javascript" src="include/ajaxupload.js" ></script>
60 <script>
61         $(document).ready(function() {
62                 var uploader = new window.AjaxUpload(
63                         'wall-image-upload',
64                         { action: 'wall_upload/$nickname',
65                                 name: 'userfile',
66                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
67                                 onComplete: function(file,response) {
68                                         tinyMCE.execCommand('mceInsertRawHTML',false,response);
69                                         $('#profile-rotator').hide();
70                                 }                                
71                         }
72                 );
73                 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
74                         var selstr;
75                         $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
76                                 selstr = $(this).text();
77                                 $('#profile-jot-perms img').attr('src', 'images/lock_icon.gif');
78                                 $('.profile-jot-net input').attr('disabled', 'disabled');
79                         });
80                         if(selstr == null) {
81                                 $('#profile-jot-perms img').attr('src', 'images/unlock_icon.gif');
82                                 $('.profile-jot-net input').attr('disabled', false);
83                         }
84
85                 }).trigger('change');
86
87         });
88
89         function jotGetLink() {
90                 reply = prompt("Bitte URL des Links angeben:");
91                 if(reply && reply.length) {
92                         $('#profile-rotator').show();
93                         $.get('parse_url?url=' + reply, function(data) {
94                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
95                                 $('#profile-rotator').hide();
96                         });
97                 }
98         }
99
100         function jotGetVideo() {
101                 reply = prompt("Bitte den YouTube Link angeben:");
102                 if(reply && reply.length) {
103                         tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
104                 }
105         }
106
107         function jotVideoURL() {
108                 reply = prompt("Please enter a video(.ogg) link/URL:");
109                 if(reply && reply.length) {
110                         tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
111                 }
112         }
113
114         function jotAudioURL() {
115                 reply = prompt("Please enter an audio(.ogg) link/URL:");
116                 if(reply && reply.length) {
117                         tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
118                 }
119         }
120
121         function jotGetLocation() {
122                 reply = prompt("Wo bist du im Moment?", $('#jot-location').val());
123                 if(reply && reply.length) {
124                         $('#jot-location').val(reply);
125                 }
126         }
127
128         function jotShare(id) {
129                 $('#like-rotator-' + id).show();
130                 $.get('share/' + id, function(data) {
131                         tinyMCE.execCommand('mceInsertRawHTML',false,data);
132                         $('#like-rotator-' + id).hide();
133                         $(window).scrollTop(0);
134                 });
135         }
136
137
138
139         function linkdropper(event) {
140                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
141                 if(linkFound)
142                         event.preventDefault();
143         }
144
145         function linkdrop(event) {
146                 var reply = event.dataTransfer.getData("text/uri-list");
147                 event.target.textContent = reply;
148                 event.preventDefault();
149                 if(reply && reply.length) {
150                         $('#profile-rotator').show();
151                         $.get('parse_url?url=' + reply, function(data) {
152                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
153                                 $('#profile-rotator').hide();
154                         });
155                 }
156         }
157
158         function jotClearLocation() {
159                 $('#jot-coord').val('');
160                 $('#profile-nolocation-wrapper').hide();
161         }
162
163         $geotag
164
165 </script>
166