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() {
197 if(confirm('$delitems')) {
200 $("#item-delete-selected").hide();
201 $('#item-delete-selected-rotator').show();
203 $('.item-select').each( function() {
204 if($(this).is(':checked')) {
205 if(checkedstr.length != 0) {
206 checkedstr = checkedstr + ',' + $(this).val();
209 checkedstr = $(this).val();
213 $.post('item', { dropitems: checkedstr }, function(data) {
214 window.location.reload();
219 function jotGetLink() {
220 reply = prompt("$linkurl");
221 if(reply && reply.length) {
222 reply = bin2hex(reply);
223 $('#profile-rotator').show();
224 $.get('parse_url?binurl=' + reply, function(data) {
226 $('#profile-rotator').hide();
231 function jotVideoURL() {
232 reply = prompt("$vidurl");
233 if(reply && reply.length) {
234 addeditortext('[video]' + reply + '[/video]');
238 function jotAudioURL() {
239 reply = prompt("$audurl");
240 if(reply && reply.length) {
241 addeditortext('[audio]' + reply + '[/audio]');
246 function jotGetLocation() {
247 reply = prompt("$whereareu", $('#jot-location').val());
248 if(reply && reply.length) {
249 $('#jot-location').val(reply);
253 function jotTitle() {
254 reply = prompt("$title", $('#jot-title').val());
255 if(reply && reply.length) {
256 $('#jot-title').val(reply);
260 function jotShare(id) {
261 $('#like-rotator-' + id).show();
262 $.get('share/' + id, function(data) {
263 if (!editor) $("#profile-jot-text").val("");
264 initEditor(function(){
266 $('#like-rotator-' + id).hide();
267 $(window).scrollTop(0);
272 function linkdropper(event) {
273 var linkFound = event.dataTransfer.types.contains("text/uri-list");
275 event.preventDefault();
278 function linkdrop(event) {
279 var reply = event.dataTransfer.getData("text/uri-list");
280 event.target.textContent = reply;
281 event.preventDefault();
282 if(reply && reply.length) {
283 reply = bin2hex(reply);
284 $('#profile-rotator').show();
285 $.get('parse_url?binurl=' + reply, function(data) {
286 if (!editor) $("#profile-jot-text").val("");
287 initEditor(function(){
289 $('#profile-rotator').hide();
295 function itemTag(id) {
296 reply = prompt("$term");
297 if(reply && reply.length) {
298 reply = reply.replace('#','');
302 $('body').css('cursor', 'wait');
304 $.get('tagger/' + id + '?term=' + reply);
305 if(timer) clearTimeout(timer);
306 timer = setTimeout(NavUpdate,3000);
312 function itemFiler(id) {
314 var bordercolor = $("input").css("border-color");
316 $.get('filer/', function(data){
318 $("#id_term").keypress(function(){
319 $(this).css("border-color",bordercolor);
321 $("#select_term").change(function(){
322 $("#id_term").css("border-color",bordercolor);
325 $("#filer_save").click(function(e){
327 reply = $("#id_term").val();
328 if(reply && reply.length) {
330 $('body').css('cursor', 'wait');
331 $.get('filer/' + id + '?term=' + reply);
332 if(timer) clearTimeout(timer);
333 timer = setTimeout(NavUpdate,3000);
337 $("#id_term").css("border-color","#FF0000");
347 function jotClearLocation() {
348 $('#jot-coord').val('');
349 $('#profile-nolocation-wrapper').hide();
352 function addeditortext(data) {
353 if(plaintext == 'none') {
354 var currentText = $("#profile-jot-text").val();
355 $("#profile-jot-text").val(currentText + data);
358 tinyMCE.execCommand('mceInsertRawHTML',false,data);