2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
6 <script language="javascript" type="text/javascript">
10 var plaintext = '{{$editselect}}';
12 function initEditor(cb){
14 $("#profile-jot-text-loading").show();
15 if(plaintext == 'none') {
16 $("#profile-jot-text-loading").hide();
17 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
18 $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
19 $(".jothidden").show();
21 $("a#jot-perms-icon").fancybox({
22 'transitionIn' : 'elastic',
23 'transitionOut' : 'elastic'
25 $("#profile-jot-submit-wrapper").show();
27 $("#profile-upload-wrapper").show();
28 $("#profile-attach-wrapper").show();
29 $("#profile-link-wrapper").show();
30 $("#profile-video-wrapper").show();
31 $("#profile-audio-wrapper").show();
32 $("#profile-location-wrapper").show();
33 $("#profile-nolocation-wrapper").show();
34 $("#profile-title-wrapper").show();
35 $("#profile-jot-plugin-wrapper").show();
36 $("#jot-preview-link").show();
40 if (typeof cb!="undefined") cb();
45 mode : "specific_textareas",
46 editor_selector: /(profile-jot-text|prvmail-text)/,
47 plugins : "bbcode,paste,fullscreen,autoresize",
48 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
49 theme_advanced_buttons2 : "",
50 theme_advanced_buttons3 : "",
51 theme_advanced_toolbar_location : "top",
52 theme_advanced_toolbar_align : "center",
53 theme_advanced_blockformats : "blockquote,code",
54 //theme_advanced_resizing : true,
55 //theme_advanced_statusbar_location : "bottom",
56 paste_text_sticky : true,
57 entity_encoding : "raw",
58 add_unload_trigger : false,
59 remove_linebreaks : false,
60 force_p_newlines : false,
61 force_br_newlines : true,
62 forced_root_block : '',
64 content_css: "{{$baseurl}}/view/custom_tinymce.css",
65 theme_advanced_path : false,
66 setup : function(ed) {
68 ed.onKeyDown.add(function(ed,e) {
75 ed.onKeyUp.add(function(ed, e) {
76 var txt = tinyMCE.activeEditor.getContent();
77 match = txt.match(/@([^ \n]+)$/);
80 cPopup = new ACPopup(this,baseurl+"/acl");
82 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
83 if(! cPopup.ready) cPopup = null;
86 if(cPopup !== null) { cPopup.close(); cPopup = null; }
90 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
91 $('#profile-jot-desc').html(ispublic);
94 $('#profile-jot-desc').html(' ');
100 $('#character-counter').removeClass('red');
101 $('#character-counter').removeClass('orange');
102 $('#character-counter').addClass('grey');
104 if((textlen > 140) && (textlen <= 420)) {
105 $('#character-counter').removeClass('grey');
106 $('#character-counter').removeClass('red');
107 $('#character-counter').addClass('orange');
110 $('#character-counter').removeClass('grey');
111 $('#character-counter').removeClass('orange');
112 $('#character-counter').addClass('red');
114 $('#character-counter').text(textlen);
116 ed.onInit.add(function(ed) {
117 ed.pasteAsPlainText = true;
118 $("#profile-jot-text-loading").hide();
119 $(".jothidden").show();
120 $("#profile-jot-submit-wrapper").show();
122 $("#profile-upload-wrapper").show();
123 $("#profile-attach-wrapper").show();
124 $("#profile-link-wrapper").show();
125 $("#profile-video-wrapper").show();
126 $("#profile-audio-wrapper").show();
127 $("#profile-location-wrapper").show();
128 $("#profile-nolocation-wrapper").show();
129 $("#profile-title-wrapper").show();
130 $("#profile-jot-plugin-wrapper").show();
131 $("#jot-preview-link").show();
133 $("#character-counter").show();
134 if (typeof cb!="undefined") cb();
140 $("a#jot-perms-icon").fancybox({
141 'transitionIn' : 'none',
142 'transitionOut' : 'none'
145 if (typeof cb!="undefined") cb();
149 function enableOnUser(){
157 <script type="text/javascript" src="js/ajaxupload.js" >
161 var ispublic = '{{$ispublic}}';
163 $(document).ready(function() {
165 /* enable tinymce on focus and click */
166 $("#profile-jot-text").focus(enableOnUser);
167 $("#profile-jot-text").click(enableOnUser);
169 var uploader = new window.AjaxUpload(
171 { action: 'wall_upload/{{$nickname}}',
173 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
174 onComplete: function(file,response) {
175 addeditortext(response);
176 $('#profile-rotator').hide();
181 var file_uploader = new window.AjaxUpload(
183 { action: 'wall_attach/{{$nickname}}',
185 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
186 onComplete: function(file,response) {
187 addeditortext(response);
188 $('#profile-rotator').hide();
192 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
194 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
195 selstr = $(this).text();
196 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
197 $('#jot-public').hide();
198 $('.profile-jot-net input').attr('disabled', 'disabled');
201 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
202 $('#jot-public').show();
203 $('.profile-jot-net input').attr('disabled', false);
206 }).trigger('change');
210 function deleteCheckedItems() {
211 if(confirm('{{$delitems}}')) {
214 $("#item-delete-selected").hide();
215 $('#item-delete-selected-rotator').show();
217 $('.item-select').each( function() {
218 if($(this).is(':checked')) {
219 if(checkedstr.length != 0) {
220 checkedstr = checkedstr + ',' + $(this).val();
223 checkedstr = $(this).val();
227 $.post('item', { dropitems: checkedstr }, function(data) {
228 window.location.reload();
233 function jotGetLink() {
234 reply = prompt("{{$linkurl}}");
235 if(reply && reply.length) {
236 reply = bin2hex(reply);
237 $('#profile-rotator').show();
238 $.get('parse_url?binurl=' + reply, function(data) {
240 $('#profile-rotator').hide();
245 function jotVideoURL() {
246 reply = prompt("{{$vidurl}}");
247 if(reply && reply.length) {
248 addeditortext('[video]' + reply + '[/video]');
252 function jotAudioURL() {
253 reply = prompt("{{$audurl}}");
254 if(reply && reply.length) {
255 addeditortext('[audio]' + reply + '[/audio]');
260 function jotGetLocation() {
261 reply = prompt("{{$whereareu}}", $('#jot-location').val());
262 if(reply && reply.length) {
263 $('#jot-location').val(reply);
267 function jotTitle() {
268 reply = prompt("{{$title}}", $('#jot-title').val());
269 if(reply && reply.length) {
270 $('#jot-title').val(reply);
274 function jotShare(id) {
275 $('#like-rotator-' + id).show();
276 $.get('share/' + id, function(data) {
277 if (!editor) $("#profile-jot-text").val("");
278 initEditor(function(){
280 $('#like-rotator-' + id).hide();
281 $(window).scrollTop(0);
286 function linkdropper(event) {
287 var linkFound = event.dataTransfer.types.contains("text/uri-list");
289 event.preventDefault();
292 function linkdrop(event) {
293 var reply = event.dataTransfer.getData("text/uri-list");
294 event.target.textContent = reply;
295 event.preventDefault();
296 if(reply && reply.length) {
297 reply = bin2hex(reply);
298 $('#profile-rotator').show();
299 $.get('parse_url?binurl=' + reply, function(data) {
300 if (!editor) $("#profile-jot-text").val("");
301 initEditor(function(){
303 $('#profile-rotator').hide();
309 function itemTag(id) {
310 reply = prompt("{{$term}}");
311 if(reply && reply.length) {
312 reply = reply.replace('#','');
316 $('body').css('cursor', 'wait');
318 $.get('tagger/' + id + '?term=' + reply);
319 if(timer) clearTimeout(timer);
320 timer = setTimeout(NavUpdate,3000);
326 function itemFiler(id) {
328 var bordercolor = $("input").css("border-color");
330 $.get('filer/', function(data){
332 $("#id_term").keypress(function(){
333 $(this).css("border-color",bordercolor);
335 $("#select_term").change(function(){
336 $("#id_term").css("border-color",bordercolor);
339 $("#filer_save").click(function(e){
341 reply = $("#id_term").val();
342 if(reply && reply.length) {
344 $('body').css('cursor', 'wait');
345 $.get('filer/' + id + '?term=' + reply, NavUpdate);
346 // if(timer) clearTimeout(timer);
347 // timer = setTimeout(NavUpdate,3000);
351 $("#id_term").css("border-color","#FF0000");
361 function jotClearLocation() {
362 $('#jot-coord').val('');
363 $('#profile-nolocation-wrapper').hide();
366 function addeditortext(data) {
367 if(plaintext == 'none') {
368 var currentText = $("#profile-jot-text").val();
369 $("#profile-jot-text").val(currentText + data);
372 tinyMCE.execCommand('mceInsertRawHTML',false,data);