]> git.mxchange.org Git - friendica.git/blob - view/theme/dispy/jot-header.tpl
dispy ACL into the fancybox
[friendica.git] / view / theme / dispy / jot-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 editor;
6 var textlen = 0;
7
8 tinyMCE.init({
9         theme : "advanced",
10         mode : "specific_textareas",
11         editor_selector: /(profile-jot-text|prvmail-text)/,
12         plugins : "bbcode,paste,fullscreen,autoresize",
13         theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
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         //theme_advanced_resizing : true,
20         //theme_advanced_statusbar_location : "bottom",
21         paste_text_sticky : true,
22         entity_encoding : "raw",
23         add_unload_trigger : false,
24         remove_linebreaks : false,
25         force_p_newlines : false,
26         force_br_newlines : true,
27         forced_root_block : '',
28         convert_urls: false,
29         content_css: "$baseurl/view/custom_tinymce.css",
30         theme_advanced_path : false,
31         setup : function(ed) {
32              //Character count
33                 ed.onKeyUp.add(function(ed, e) {
34                         var txt = tinyMCE.activeEditor.getContent();
35                         textlen = txt.length;
36                         if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
37                                 $('#profile-jot-desc').html(ispublic);
38                         }
39                         else {
40                                 $('#profile-jot-desc').html('&nbsp;');
41                         }
42
43                         if(textlen <= 140) {
44                                 $('#character-counter').removeClass('red');
45                                 $('#character-counter').removeClass('orange');
46                                 $('#character-counter').addClass('grey');
47                         }
48                         if((textlen > 140) && (textlen <= 420)) {
49                                 $('#character-counter').removeClass('grey');
50                                 $('#character-counter').removeClass('red');
51                                 $('#character-counter').addClass('orange');
52                         }
53                         if(textlen > 420) {
54                                 $('#character-counter').removeClass('grey');
55                                 $('#character-counter').removeClass('orange');
56                                 $('#character-counter').addClass('red');
57                         }
58                         $('#character-counter').text(textlen);
59         });
60
61                 ed.onInit.add(function(ed) {
62                         ed.pasteAsPlainText = true;
63                 });
64
65         }
66 });
67
68 </script>
69 <script type="text/javascript" src="include/ajaxupload.js" ></script>
70 <script>
71     var ispublic = '$ispublic';
72         $(document).ready(function() {
73                 $("#profile-jot-acl-wrapper").hide();
74                 $("a#jot-perms-icon").fancybox({
75                     'transitionIn' : 'none',
76                     'transitionOut' : 'none'
77                 }); 
78                 var uploader = new window.AjaxUpload(
79                         'wall-image-upload',
80                         { action: 'wall_upload/$nickname',
81                                 name: 'userfile',
82                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
83                                 onComplete: function(file,response) {
84                                         tinyMCE.execCommand('mceInsertRawHTML',false,response);
85                                         $('#profile-rotator').hide();
86                                 }                                
87                         }
88                 );
89                 var file_uploader = new window.AjaxUpload(
90                         'wall-file-upload',
91                         { action: 'wall_attach/$nickname',
92                                 name: 'userfile',
93                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
94                                 onComplete: function(file,response) {
95                                         tinyMCE.execCommand('mceInsertRawHTML',false,response);
96                                         $('#profile-rotator').hide();
97                                 }                                
98                         }
99                 );              
100                 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
101                         var selstr;
102                         $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
103                                 selstr = $(this).text();
104                                 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
105                                 $('#jot-public').hide();
106                                 $('.profile-jot-net input').attr('disabled', 'disabled');
107                         });
108                         if(selstr == null) { 
109                                 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
110                                 $('#jot-public').show();
111                                 $('.profile-jot-net input').attr('disabled', false);
112                         }
113
114                 }).trigger('change');
115
116         });
117
118         function deleteCheckedItems() {
119                 var checkedstr = '';
120
121                 $('.item-select').each( function() {
122                         if($(this).is(':checked')) {
123                                 if(checkedstr.length != 0) {
124                                         checkedstr = checkedstr + ',' + $(this).val();
125                                 }
126                                 else {
127                                         checkedstr = $(this).val();
128                                 }
129                         }       
130                 });
131                 $.post('item', { dropitems: checkedstr }, function(data) {
132                         window.location.reload();
133                 });
134         }
135
136         function jotGetLink() {
137                 reply = prompt("$linkurl");
138                 if(reply && reply.length) {
139                         reply = bin2hex(reply);
140                         $('#profile-rotator').show();
141                         $.get('parse_url?url=' + reply, function(data) {
142                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
143                                 $('#profile-rotator').hide();
144                         });
145                 }
146         }
147
148         function jotGetVideo() {
149                 reply = prompt("$utubeurl");
150                 if(reply && reply.length) {
151                         tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
152                 }
153         }
154
155         function jotVideoURL() {
156                 reply = prompt("$vidurl");
157                 if(reply && reply.length) {
158                         tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
159                 }
160         }
161
162         function jotAudioURL() {
163                 reply = prompt("$audurl");
164                 if(reply && reply.length) {
165                         tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
166                 }
167         }
168
169
170         function jotGetLocation() {
171                 reply = prompt("$whereareu", $('#jot-location').val());
172                 if(reply && reply.length) {
173                         $('#jot-location').val(reply);
174                 }
175         }
176
177         function jotTitle() {
178                 reply = prompt("$title", $('#jot-title').val());
179                 if(reply && reply.length) {
180                         $('#jot-title').val(reply);
181                 }
182         }
183
184         function jotShare(id) {
185                 $('#like-rotator-' + id).show();
186                 $.get('share/' + id, function(data) {
187                         tinyMCE.execCommand('mceInsertRawHTML',false,data);
188                         $('#like-rotator-' + id).hide();
189                         $(window).scrollTop(0);
190                 });
191         }
192
193         function linkdropper(event) {
194                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
195                 if(linkFound)
196                         event.preventDefault();
197         }
198
199         function linkdrop(event) {
200                 var reply = event.dataTransfer.getData("text/uri-list");
201                 event.target.textContent = reply;
202                 event.preventDefault();
203                 if(reply && reply.length) {
204                         $('#profile-rotator').show();
205                         $.get('parse_url?url=' + reply, function(data) {
206                                 tinyMCE.execCommand('mceInsertRawHTML',false,data);
207                                 $('#profile-rotator').hide();
208                         });
209                 }
210         }
211
212         function jotClearLocation() {
213                 $('#jot-coord').val('');
214                 $('#profile-nolocation-wrapper').hide();
215         }
216
217         $geotag
218
219 </script>
220