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">
8 function initEditor(cb) {
10 $("#profile-jot-text-loading").show();
13 mode : "specific_textareas",
14 editor_selector: /(profile-jot-text|prvmail-text)/,
15 plugins : "bbcode,paste,fullscreen,autoresize",
16 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
17 theme_advanced_buttons2 : "",
18 theme_advanced_buttons3 : "",
19 theme_advanced_toolbar_location : "top",
20 theme_advanced_toolbar_align : "center",
21 theme_advanced_blockformats : "blockquote,code",
22 //theme_advanced_resizing : true,
23 //theme_advanced_statusbar_location : "bottom",
24 paste_text_sticky : true,
25 entity_encoding : "raw",
26 add_unload_trigger : false,
27 remove_linebreaks : false,
28 force_p_newlines : false,
29 force_br_newlines : true,
30 forced_root_block : '',
32 content_css: "$baseurl/view/custom_tinymce.css",
33 theme_advanced_path : false,
34 setup : function(ed) {
36 ed.onKeyDown.add(function(ed,e) {
43 ed.onKeyUp.add(function(ed, e) {
44 var txt = tinyMCE.activeEditor.getContent();
45 match = txt.match(/@([^ \n]+)$/);
48 cPopup = new ACPopup(this,baseurl+"/acl");
50 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
51 if(! cPopup.ready) cPopup = null;
54 if(cPopup !== null) { cPopup.close(); cPopup = null; }
58 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
59 $('#profile-jot-desc').html(ispublic);
62 $('#profile-jot-desc').html(' ');
68 $('#character-counter').removeClass('red');
69 $('#character-counter').removeClass('orange');
70 $('#character-counter').addClass('grey');
72 if((textlen > 140) && (textlen <= 420)) {
73 $('#character-counter').removeClass('grey');
74 $('#character-counter').removeClass('red');
75 $('#character-counter').addClass('orange');
78 $('#character-counter').removeClass('grey');
79 $('#character-counter').removeClass('orange');
80 $('#character-counter').addClass('red');
82 $('#character-counter').text(textlen);
84 ed.onInit.add(function(ed) {
85 ed.pasteAsPlainText = true;
86 $("#profile-jot-text-loading").hide();
87 $("#profile-jot-submit-wrapper").show();
89 $("#profile-upload-wrapper").show();
90 $("#profile-attach-wrapper").show();
91 $("#profile-link-wrapper").show();
92 $("#profile-video-wrapper").show();
93 $("#profile-audio-wrapper").show();
94 $("#profile-location-wrapper").show();
95 $("#profile-nolocation-wrapper").show();
96 $("#profile-title-wrapper").show();
97 $("#profile-jot-plugin-wrapper").show();
99 $("#character-counter").show();
100 if (typeof cb!="undefined") cb();
106 $("a#jot-perms-icon").fancybox({
107 'transitionIn' : 'none',
108 'transitionOut' : 'none'
111 if (typeof cb!="undefined") cb();
115 <script type="text/javascript" src="js/ajaxupload.js" ></script>
117 var ispublic = '$ispublic';
118 $(document).ready(function() {
119 /* enable tinymce on focus */
120 $("#profile-jot-text").focus(function(){
125 var uploader = new window.AjaxUpload(
127 { action: 'wall_upload/$nickname',
129 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
130 onComplete: function(file,response) {
131 tinyMCE.execCommand('mceInsertRawHTML',false,response);
132 $('#profile-rotator').hide();
136 var file_uploader = new window.AjaxUpload(
138 { action: 'wall_attach/$nickname',
140 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
141 onComplete: function(file,response) {
142 tinyMCE.execCommand('mceInsertRawHTML',false,response);
143 $('#profile-rotator').hide();
147 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
149 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
150 selstr = $(this).text();
151 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
152 $('#jot-public').hide();
153 $('.profile-jot-net input').attr('disabled', 'disabled');
156 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
157 $('#jot-public').show();
158 $('.profile-jot-net input').attr('disabled', false);
161 }).trigger('change');
165 function deleteCheckedItems() {
168 $('.item-select').each( function() {
169 if($(this).is(':checked')) {
170 if(checkedstr.length != 0) {
171 checkedstr = checkedstr + ',' + $(this).val();
174 checkedstr = $(this).val();
178 $.post('item', { dropitems: checkedstr }, function(data) {
179 window.location.reload();
183 function jotGetLink() {
184 reply = prompt("$linkurl");
185 if(reply && reply.length) {
186 reply = bin2hex(reply);
187 $('#profile-rotator').show();
188 $.get('parse_url?binurl=' + reply, function(data) {
189 tinyMCE.execCommand('mceInsertRawHTML',false,data);
190 $('#profile-rotator').hide();
195 function jotVideoURL() {
196 reply = prompt("$vidurl");
197 if(reply && reply.length) {
198 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
202 function jotAudioURL() {
203 reply = prompt("$audurl");
204 if(reply && reply.length) {
205 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
210 function jotGetLocation() {
211 reply = prompt("$whereareu", $('#jot-location').val());
212 if(reply && reply.length) {
213 $('#jot-location').val(reply);
217 function jotTitle() {
218 reply = prompt("$title", $('#jot-title').val());
219 if(reply && reply.length) {
220 $('#jot-title').val(reply);
224 function jotShare(id) {
225 $('#like-rotator-' + id).show();
226 $.get('share/' + id, function(data) {
227 if (!editor) $("#profile-jot-text").val("");
228 initEditor(function(){
229 tinyMCE.execCommand('mceInsertRawHTML',false,data);
230 $('#like-rotator-' + id).hide();
231 $(window).scrollTop(0);
236 function linkdropper(event) {
237 var linkFound = event.dataTransfer.types.contains("text/uri-list");
239 event.preventDefault();
242 function linkdrop(event) {
243 var reply = event.dataTransfer.getData("text/uri-list");
244 event.target.textContent = reply;
245 event.preventDefault();
246 if(reply && reply.length) {
247 reply = bin2hex(reply);
248 $('#profile-rotator').show();
249 $.get('parse_url?binurl=' + reply, function(data) {
250 if (!editor) $("#profile-jot-text").val("");
251 initEditor(function(){
252 tinyMCE.execCommand('mceInsertRawHTML',false,data);
253 $('#profile-rotator').hide();
259 function itemTag(id) {
260 reply = prompt("$term");
261 if(reply && reply.length) {
262 reply = reply.replace('#','');
266 $('body').css('cursor', 'wait');
268 $.get('tagger/' + id + '?term=' + reply);
269 if(timer) clearTimeout(timer);
270 timer = setTimeout(NavUpdate,3000);
276 function jotClearLocation() {
277 $('#jot-coord').val('');
278 $('#profile-nolocation-wrapper').hide();