1 <script language="javascript" type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
2 <script language="javascript" type="text/javascript">
6 var plaintext = '$editselect';
8 function initEditor(cb) {
10 $("#profile-jot-text-loading").show();
11 if(plaintext == 'none') {
12 $("#profile-jot-text-loading").hide();
13 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
14 $(".jothidden").show();
16 $("a#jot-perms-icon").fancybox({
17 'transitionIn' : 'elastic',
18 'transitionOut' : 'elastic'
20 $("#profile-jot-submit-wrapper").show();
22 $("#profile-upload-wrapper").show();
23 $("#profile-attach-wrapper").show();
24 $("#profile-link-wrapper").show();
25 $("#profile-video-wrapper").show();
26 $("#profile-audio-wrapper").show();
27 $("#profile-location-wrapper").show();
28 $("#profile-nolocation-wrapper").show();
29 $("#profile-title-wrapper").show();
30 $("#profile-jot-plugin-wrapper").show();
31 $("#jot-preview-link").show();
35 if (typeof cb!="undefined") cb();
40 mode : "specific_textareas",
41 editor_selector: /(profile-jot-text|prvmail-text)/,
42 plugins : "bbcode,paste,fullscreen,autoresize",
43 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
44 theme_advanced_buttons2 : "",
45 theme_advanced_buttons3 : "",
46 theme_advanced_toolbar_location : "top",
47 theme_advanced_toolbar_align : "center",
48 theme_advanced_blockformats : "blockquote,code",
49 //theme_advanced_resizing : true,
50 //theme_advanced_statusbar_location : "bottom",
51 paste_text_sticky : true,
52 entity_encoding : "raw",
53 add_unload_trigger : false,
54 remove_linebreaks : false,
55 force_p_newlines : false,
56 force_br_newlines : true,
57 forced_root_block : '',
59 content_css: "$baseurl/view/custom_tinymce.css",
60 theme_advanced_path : false,
61 setup : function(ed) {
63 ed.onKeyDown.add(function(ed,e) {
70 ed.onKeyUp.add(function(ed, e) {
71 var txt = tinyMCE.activeEditor.getContent();
72 match = txt.match(/@([^ \n]+)$/);
75 cPopup = new ACPopup(this,baseurl+"/acl");
77 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
78 if(! cPopup.ready) cPopup = null;
81 if(cPopup !== null) { cPopup.close(); cPopup = null; }
85 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
86 $('#profile-jot-desc').html(ispublic);
89 $('#profile-jot-desc').html(' ');
95 $('#character-counter').removeClass('red');
96 $('#character-counter').removeClass('orange');
97 $('#character-counter').addClass('grey');
99 if((textlen > 140) && (textlen <= 420)) {
100 $('#character-counter').removeClass('grey');
101 $('#character-counter').removeClass('red');
102 $('#character-counter').addClass('orange');
105 $('#character-counter').removeClass('grey');
106 $('#character-counter').removeClass('orange');
107 $('#character-counter').addClass('red');
109 $('#character-counter').text(textlen);
111 ed.onInit.add(function(ed) {
112 ed.pasteAsPlainText = true;
113 $("#profile-jot-text-loading").hide();
114 $(".jothidden").show();
115 $("#profile-jot-submit-wrapper").show();
117 $("#profile-upload-wrapper").show();
118 $("#profile-attach-wrapper").show();
119 $("#profile-link-wrapper").show();
120 $("#profile-video-wrapper").show();
121 $("#profile-audio-wrapper").show();
122 $("#profile-location-wrapper").show();
123 $("#profile-nolocation-wrapper").show();
124 $("#profile-title-wrapper").show();
125 $("#profile-jot-plugin-wrapper").show();
126 $("#jot-preview-link").show();
128 $("#character-counter").show();
129 if (typeof cb!="undefined") cb();
135 $("a#jot-perms-icon").fancybox({
136 'transitionIn' : 'none',
137 'transitionOut' : 'none'
140 if (typeof cb!="undefined") cb();
144 <script type="text/javascript" src="js/ajaxupload.js" ></script>
146 var ispublic = '$ispublic';
147 $(document).ready(function() {
148 /* enable tinymce on focus */
149 $("#profile-jot-text").focus(function(){
156 var uploader = new window.AjaxUpload(
158 { action: 'wall_upload/$nickname',
160 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
161 onComplete: function(file,response) {
162 addeditortext(response);
163 $('#profile-rotator').hide();
167 var file_uploader = new window.AjaxUpload(
169 { action: 'wall_attach/$nickname',
171 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
172 onComplete: function(file,response) {
173 addeditortext(response);
174 $('#profile-rotator').hide();
178 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
180 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
181 selstr = $(this).text();
182 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
183 $('#jot-public').hide();
184 $('.profile-jot-net input').attr('disabled', 'disabled');
187 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
188 $('#jot-public').show();
189 $('.profile-jot-net input').attr('disabled', false);
192 }).trigger('change');
196 function deleteCheckedItems() {
199 $('.item-select').each( function() {
200 if($(this).is(':checked')) {
201 if(checkedstr.length != 0) {
202 checkedstr = checkedstr + ',' + $(this).val();
205 checkedstr = $(this).val();
209 $.post('item', { dropitems: checkedstr }, function(data) {
210 window.location.reload();
214 function jotGetLink() {
215 reply = prompt("$linkurl");
216 if(reply && reply.length) {
217 reply = bin2hex(reply);
218 $('#profile-rotator').show();
219 $.get('parse_url?binurl=' + reply, function(data) {
221 $('#profile-rotator').hide();
226 function jotVideoURL() {
227 reply = prompt("$vidurl");
228 if(reply && reply.length) {
229 addeditortext('[video]' + reply + '[/video]');
233 function jotAudioURL() {
234 reply = prompt("$audurl");
235 if(reply && reply.length) {
236 addeditortext('[audio]' + reply + '[/audio]');
241 function jotGetLocation() {
242 reply = prompt("$whereareu", $('#jot-location').val());
243 if(reply && reply.length) {
244 $('#jot-location').val(reply);
248 function jotTitle() {
249 reply = prompt("$title", $('#jot-title').val());
250 if(reply && reply.length) {
251 $('#jot-title').val(reply);
255 function jotShare(id) {
256 $('#like-rotator-' + id).show();
257 $.get('share/' + id, function(data) {
258 if (!editor) $("#profile-jot-text").val("");
259 initEditor(function(){
261 $('#like-rotator-' + id).hide();
262 $(window).scrollTop(0);
267 function linkdropper(event) {
268 var linkFound = event.dataTransfer.types.contains("text/uri-list");
270 event.preventDefault();
273 function linkdrop(event) {
274 var reply = event.dataTransfer.getData("text/uri-list");
275 event.target.textContent = reply;
276 event.preventDefault();
277 if(reply && reply.length) {
278 reply = bin2hex(reply);
279 $('#profile-rotator').show();
280 $.get('parse_url?binurl=' + reply, function(data) {
281 if (!editor) $("#profile-jot-text").val("");
282 initEditor(function(){
284 $('#profile-rotator').hide();
290 function itemTag(id) {
291 reply = prompt("$term");
292 if(reply && reply.length) {
293 reply = reply.replace('#','');
297 $('body').css('cursor', 'wait');
299 $.get('tagger/' + id + '?term=' + reply);
300 if(timer) clearTimeout(timer);
301 timer = setTimeout(NavUpdate,3000);
307 function itemFiler(id) {
309 var bordercolor = $("input").css("border-color");
311 $.get('filer/', function(data){
313 $("#id_term").keypress(function(){
314 $(this).css("border-color",bordercolor);
316 $("#select_term").change(function(){
317 $("#id_term").css("border-color",bordercolor);
320 $("#filer_save").click(function(e){
322 reply = $("#id_term").val();
323 if(reply && reply.length) {
325 $('body').css('cursor', 'wait');
326 $.get('filer/' + id + '?term=' + reply);
327 if(timer) clearTimeout(timer);
328 timer = setTimeout(NavUpdate,3000);
332 $("#id_term").css("border-color","#FF0000");
342 function jotClearLocation() {
343 $('#jot-coord').val('');
344 $('#profile-nolocation-wrapper').hide();
347 function addeditortext(data) {
348 if(plaintext == 'none') {
349 var currentText = $("#profile-jot-text").val();
350 $("#profile-jot-text").val(currentText + data);
353 tinyMCE.execCommand('mceInsertRawHTML',false,data);