2 <script language="javascript" type="text/javascript">
7 function initEditor(cb){
9 $("#profile-jot-text-loading").show();
10 $("#jot-title-desc").show();
13 mode : "specific_textareas",
14 editor_selector: /(profile-jot-text|prvmail-text)/,
15 auto_focus: "profile-jot-text",
16 plugins : "bbcode,paste,autoresize",
17 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
18 theme_advanced_buttons2 : "",
19 theme_advanced_buttons3 : "",
20 theme_advanced_toolbar_location : "top",
21 theme_advanced_toolbar_align : "center",
22 theme_advanced_blockformats : "blockquote,code",
23 paste_text_sticky : true,
24 entity_encoding : "raw",
25 add_unload_trigger : false,
26 remove_linebreaks : false,
27 force_p_newlines : false,
28 force_br_newlines : true,
29 forced_root_block : '',
31 content_css: "$baseurl/view/custom_tinymce.css",
32 theme_advanced_path : false,
33 setup : function(ed) {
35 ed.onKeyDown.add(function(ed,e) {
40 ed.onKeyUp.add(function(ed, e) {
41 var txt = tinyMCE.activeEditor.getContent();
42 match = txt.match(/@([^ \n]+)$/);
45 cPopup = new ACPopup(this,baseurl+"/acl");
47 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
48 if(! cPopup.ready) cPopup = null;
51 if(cPopup !== null) { cPopup.close(); cPopup = null; }
55 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
56 $('#profile-jot-desc').html(ispublic);
59 $('#profile-jot-desc').html(' ');
65 $('#character-counter').removeClass('red');
66 $('#character-counter').removeClass('orange');
67 $('#character-counter').addClass('grey');
69 if((textlen > 140) && (textlen <= 420)) {
70 $('#character-counter').removeClass('grey');
71 $('#character-counter').removeClass('red');
72 $('#character-counter').addClass('orange');
75 $('#character-counter').removeClass('grey');
76 $('#character-counter').removeClass('orange');
77 $('#character-counter').addClass('red');
79 $('#character-counter').text(textlen);
82 ed.onInit.add(function(ed) {
83 ed.pasteAsPlainText = true;
84 $("#profile-jot-text-loading").hide();
85 $(".jothidden").show();
86 if (typeof cb!="undefined") cb();
93 $("a#jot-perms-icon").fancybox({
94 'transitionIn' : 'elastic',
95 'transitionOut' : 'elastic'
98 if (typeof cb!="undefined") cb();
102 function enableOnUser(){
109 <script type="text/javascript" src="js/ajaxupload.js" ></script>
111 var ispublic = '$ispublic';
112 var addtitle = '$addtitle';
114 $(document).ready(function() {
117 /* enable tinymce on focus and click */
118 $("#profile-jot-text").focus(enableOnUser);
119 $("#profile-jot-text").click(enableOnUser);
121 /* enable tinymce on focus */
122 $("#profile-jot-text").focus(function(){
128 $("#jot-title").mouseout(function() {
129 $("#jot-title").hide();
130 var ttl = $("#jot-title").val();
131 $('#jot-title-display').html(ttl);
133 $("#jot-title-display").show();
136 $("#jot-title-desc").show();
140 $("#jot-title-display").hover(function() {
141 $("#jot-title-display").hide();
142 $("#jot-title").show();
143 $("#jot-title").focus();
146 $("#jot-title-desc").click(function() {
147 $("#jot-title-desc").hide();
148 $("#jot-title").show();
149 $("#jot-title").focus();
151 >>>>>>> friendica/master
153 var uploader = new window.AjaxUpload(
155 { action: 'wall_upload/$nickname',
157 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
158 onComplete: function(file,response) {
159 tinyMCE.execCommand('mceInsertRawHTML',false,response);
160 $('#profile-rotator').hide();
164 var file_uploader = new window.AjaxUpload(
166 { action: 'wall_attach/$nickname',
168 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
169 onComplete: function(file,response) {
170 tinyMCE.execCommand('mceInsertRawHTML',false,response);
171 $('#profile-rotator').hide();
179 function deleteCheckedItems() {
182 $('.item-select').each( function() {
183 if($(this).is(':checked')) {
184 if(checkedstr.length != 0) {
185 checkedstr = checkedstr + ',' + $(this).val();
188 checkedstr = $(this).val();
192 $.post('item', { dropitems: checkedstr }, function(data) {
193 window.location.reload();
197 function jotGetLink() {
198 reply = prompt("$linkurl");
199 if(reply && reply.length) {
200 reply = bin2hex(reply);
201 $('#profile-rotator').show();
202 $.get('parse_url?binurl=' + reply, function(data) {
203 tinyMCE.execCommand('mceInsertRawHTML',false,data);
204 $('#profile-rotator').hide();
209 function jotVideoURL() {
210 reply = prompt("$vidurl");
211 if(reply && reply.length) {
212 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
216 function jotAudioURL() {
217 reply = prompt("$audurl");
218 if(reply && reply.length) {
219 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
224 function jotGetLocation() {
225 reply = prompt("$whereareu", $('#jot-location').val());
226 if(reply && reply.length) {
227 $('#jot-location').val(reply);
231 function jotTitle() {
232 reply = prompt("$title", $('#jot-title').val());
233 if(reply && reply.length) {
234 $('#jot-title').val(reply);
239 function jotShare(id) {
240 $('#like-rotator-' + id).show();
241 $.get('share/' + id, function(data) {
242 if (!editor) $("#profile-jot-text").val("");
243 initEditor(function(){
244 tinyMCE.execCommand('mceInsertRawHTML',false,data);
245 $('#like-rotator-' + id).hide();
246 $(window).scrollTop(0);
252 function linkdropper(event) {
253 var linkFound = event.dataTransfer.types.contains("text/uri-list");
255 event.preventDefault();
258 function linkdrop(event) {
259 var reply = event.dataTransfer.getData("text/uri-list");
260 event.target.textContent = reply;
261 event.preventDefault();
262 if(reply && reply.length) {
263 reply = bin2hex(reply);
264 $('#profile-rotator').show();
265 $.get('parse_url?binurl=' + reply, function(data) {
266 if (!editor) $("#profile-jot-text").val("");
267 initEditor(function(){
268 tinyMCE.execCommand('mceInsertRawHTML',false,data);
269 $('#profile-rotator').hide();
275 function itemTag(id) {
276 reply = prompt("$term");
277 if(reply && reply.length) {
278 reply = reply.replace('#','');
282 $('body').css('cursor', 'wait');
284 $.get('tagger/' + id + '?term=' + reply);
285 if(timer) clearTimeout(timer);
286 timer = setTimeout(NavUpdate,3000);
292 function jotClearLocation() {
293 $('#jot-coord').val('');
294 $('#profile-nolocation-wrapper').hide();