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">
7 var plaintext = '$editselect';
9 function initEditor(cb) {
11 $("#profile-jot-text-loading").show();
12 if(plaintext == 'none') {
13 $("#profile-jot-text-loading").hide();
14 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
15 $(".jothidden").show();
17 $("a#jot-perms-icon").fancybox({
18 'transitionIn' : 'elastic',
19 'transitionOut' : 'elastic'
21 $("#profile-jot-submit-wrapper").show();
23 $("#profile-upload-wrapper").show();
24 $("#profile-attach-wrapper").show();
25 $("#profile-link-wrapper").show();
26 $("#profile-video-wrapper").show();
27 $("#profile-audio-wrapper").show();
28 $("#profile-location-wrapper").show();
29 $("#profile-nolocation-wrapper").show();
30 $("#profile-title-wrapper").show();
31 $("#profile-jot-plugin-wrapper").show();
32 $("#jot-preview-link").show();
36 if (typeof cb!="undefined") cb();
41 mode : "specific_textareas",
42 editor_selector: /(profile-jot-text|prvmail-text)/,
43 plugins : "bbcode,paste,fullscreen,autoresize",
44 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
45 theme_advanced_buttons2 : "",
46 theme_advanced_buttons3 : "",
47 theme_advanced_toolbar_location : "top",
48 theme_advanced_toolbar_align : "center",
49 theme_advanced_blockformats : "blockquote,code",
50 //theme_advanced_resizing : true,
51 //theme_advanced_statusbar_location : "bottom",
52 paste_text_sticky : true,
53 entity_encoding : "raw",
54 add_unload_trigger : false,
55 remove_linebreaks : false,
56 force_p_newlines : false,
57 force_br_newlines : true,
58 forced_root_block : '',
60 content_css: "$baseurl/view/custom_tinymce.css",
61 theme_advanced_path : false,
62 setup : function(ed) {
64 ed.onKeyDown.add(function(ed,e) {
71 ed.onKeyUp.add(function(ed, e) {
72 var txt = tinyMCE.activeEditor.getContent();
73 match = txt.match(/@([^ \n]+)$/);
76 cPopup = new ACPopup(this,baseurl+"/acl");
78 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
79 if(! cPopup.ready) cPopup = null;
82 if(cPopup !== null) { cPopup.close(); cPopup = null; }
86 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
87 $('#profile-jot-desc').html(ispublic);
90 $('#profile-jot-desc').html(' ');
96 $('#character-counter').removeClass('red');
97 $('#character-counter').removeClass('orange');
98 $('#character-counter').addClass('grey');
100 if((textlen > 140) && (textlen <= 420)) {
101 $('#character-counter').removeClass('grey');
102 $('#character-counter').removeClass('red');
103 $('#character-counter').addClass('orange');
106 $('#character-counter').removeClass('grey');
107 $('#character-counter').removeClass('orange');
108 $('#character-counter').addClass('red');
110 $('#character-counter').text(textlen);
112 ed.onInit.add(function(ed) {
113 ed.pasteAsPlainText = true;
114 $("#profile-jot-text-loading").hide();
115 $(".jothidden").show();
116 $("#profile-jot-submit-wrapper").show();
118 $("#profile-upload-wrapper").show();
119 $("#profile-attach-wrapper").show();
120 $("#profile-link-wrapper").show();
121 $("#profile-video-wrapper").show();
122 $("#profile-audio-wrapper").show();
123 $("#profile-location-wrapper").show();
124 $("#profile-nolocation-wrapper").show();
125 $("#profile-title-wrapper").show();
126 $("#profile-jot-plugin-wrapper").show();
127 $("#jot-preview-link").show();
129 $("#character-counter").show();
130 if (typeof cb!="undefined") cb();
136 $("a#jot-perms-icon").fancybox({
137 'transitionIn' : 'none',
138 'transitionOut' : 'none'
141 if (typeof cb!="undefined") cb();
145 <script type="text/javascript" src="js/ajaxupload.js" ></script>
147 var ispublic = '$ispublic';
148 $(document).ready(function() {
149 /* enable tinymce on focus */
150 $("#profile-jot-text").focus(function(){
157 var uploader = new window.AjaxUpload(
159 { action: 'wall_upload/$nickname',
161 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
162 onComplete: function(file,response) {
163 addeditortext(response);
164 $('#profile-rotator').hide();
168 var file_uploader = new window.AjaxUpload(
170 { action: 'wall_attach/$nickname',
172 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
173 onComplete: function(file,response) {
174 addeditortext(response);
175 $('#profile-rotator').hide();
179 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
181 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
182 selstr = $(this).text();
183 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
184 $('#jot-public').hide();
185 $('.profile-jot-net input').attr('disabled', 'disabled');
188 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
189 $('#jot-public').show();
190 $('.profile-jot-net input').attr('disabled', false);
193 }).trigger('change');
197 function deleteCheckedItems() {
198 if(confirm('$delitems')) {
201 $("#item-delete-selected").hide();
202 $('#item-delete-selected-rotator').show();
204 $('.item-select').each( function() {
205 if($(this).is(':checked')) {
206 if(checkedstr.length != 0) {
207 checkedstr = checkedstr + ',' + $(this).val();
210 checkedstr = $(this).val();
214 $.post('item', { dropitems: checkedstr }, function(data) {
215 window.location.reload();
220 function jotGetLink() {
221 reply = prompt("$linkurl");
222 if(reply && reply.length) {
223 reply = bin2hex(reply);
224 $('#profile-rotator').show();
225 $.get('parse_url?binurl=' + reply, function(data) {
227 $('#profile-rotator').hide();
232 function jotVideoURL() {
233 reply = prompt("$vidurl");
234 if(reply && reply.length) {
235 addeditortext('[video]' + reply + '[/video]');
239 function jotAudioURL() {
240 reply = prompt("$audurl");
241 if(reply && reply.length) {
242 addeditortext('[audio]' + reply + '[/audio]');
247 function jotGetLocation() {
248 reply = prompt("$whereareu", $('#jot-location').val());
249 if(reply && reply.length) {
250 $('#jot-location').val(reply);
254 function jotTitle() {
255 reply = prompt("$title", $('#jot-title').val());
256 if(reply && reply.length) {
257 $('#jot-title').val(reply);
261 function jotShare(id) {
262 $('#like-rotator-' + id).show();
263 $.get('share/' + id, function(data) {
264 if (!editor) $("#profile-jot-text").val("");
265 initEditor(function(){
267 $('#like-rotator-' + id).hide();
268 $(window).scrollTop(0);
273 function linkdropper(event) {
274 var linkFound = event.dataTransfer.types.contains("text/uri-list");
276 event.preventDefault();
279 function linkdrop(event) {
280 var reply = event.dataTransfer.getData("text/uri-list");
281 event.target.textContent = reply;
282 event.preventDefault();
283 if(reply && reply.length) {
284 reply = bin2hex(reply);
285 $('#profile-rotator').show();
286 $.get('parse_url?binurl=' + reply, function(data) {
287 if (!editor) $("#profile-jot-text").val("");
288 initEditor(function(){
290 $('#profile-rotator').hide();
296 function itemTag(id) {
297 reply = prompt("$term");
298 if(reply && reply.length) {
299 reply = reply.replace('#','');
303 $('body').css('cursor', 'wait');
305 $.get('tagger/' + id + '?term=' + reply);
306 if(timer) clearTimeout(timer);
307 timer = setTimeout(NavUpdate,3000);
313 function itemFiler(id) {
315 var bordercolor = $("input").css("border-color");
317 $.get('filer/', function(data){
319 $("#id_term").keypress(function(){
320 $(this).css("border-color",bordercolor);
322 $("#select_term").change(function(){
323 $("#id_term").css("border-color",bordercolor);
326 $("#filer_save").click(function(e){
328 reply = $("#id_term").val();
329 if(reply && reply.length) {
331 $('body').css('cursor', 'wait');
332 $.get('filer/' + id + '?term=' + reply);
333 if(timer) clearTimeout(timer);
334 timer = setTimeout(NavUpdate,3000);
338 $("#id_term").css("border-color","#FF0000");
348 function jotClearLocation() {
349 $('#jot-coord').val('');
350 $('#profile-nolocation-wrapper').hide();
353 function addeditortext(data) {
354 if(plaintext == 'none') {
355 var currentText = $("#profile-jot-text").val();
356 $("#profile-jot-text").val(currentText + data);
359 tinyMCE.execCommand('mceInsertRawHTML',false,data);