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();
11 $("#jot-title-desc").show();
14 mode : "specific_textareas",
15 editor_selector: /(profile-jot-text|prvmail-text)/,
16 plugins : "bbcode,paste,fullscreen,autoresize",
17 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
18 theme_advanced_buttons2 : "",
19 theme_advanced_buttons3 : "",
20 theme_advanced_toolbar_location : "top",
21 theme_advanced_toolbar_align : "center",
22 theme_advanced_blockformats : "blockquote,code",
23 //theme_advanced_resizing : true,
24 //theme_advanced_statusbar_location : "bottom",
25 paste_text_sticky : true,
26 entity_encoding : "raw",
27 add_unload_trigger : false,
28 remove_linebreaks : false,
29 force_p_newlines : false,
30 force_br_newlines : true,
31 forced_root_block : '',
33 content_css: "$baseurl/view/custom_tinymce.css",
34 theme_advanced_path : false,
35 setup : function(ed) {
37 ed.onKeyDown.add(function(ed,e) {
44 ed.onKeyUp.add(function(ed, e) {
45 var txt = tinyMCE.activeEditor.getContent();
46 match = txt.match(/@([^ \n]+)$/);
49 cPopup = new ACPopup(this,baseurl+"/acl");
51 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
52 if(! cPopup.ready) cPopup = null;
55 if(cPopup !== null) { cPopup.close(); cPopup = null; }
59 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
60 $('#profile-jot-desc').html(ispublic);
63 $('#profile-jot-desc').html(' ');
69 $('#character-counter').removeClass('red');
70 $('#character-counter').removeClass('orange');
71 $('#character-counter').addClass('grey');
73 if((textlen > 140) && (textlen <= 420)) {
74 $('#character-counter').removeClass('grey');
75 $('#character-counter').removeClass('red');
76 $('#character-counter').addClass('orange');
79 $('#character-counter').removeClass('grey');
80 $('#character-counter').removeClass('orange');
81 $('#character-counter').addClass('red');
83 $('#character-counter').text(textlen);
85 ed.onInit.add(function(ed) {
86 ed.pasteAsPlainText = true;
87 $("#profile-jot-text-loading").hide();
88 $("#profile-jot-submit-wrapper").show();
90 $("#profile-upload-wrapper").show();
91 $("#profile-attach-wrapper").show();
92 $("#profile-link-wrapper").show();
93 $("#profile-video-wrapper").show();
94 $("#profile-audio-wrapper").show();
95 $("#profile-location-wrapper").show();
96 $("#profile-nolocation-wrapper").show();
97 $("#profile-title-wrapper").show();
98 $("#profile-jot-plugin-wrapper").show();
100 $("#character-counter").show();
101 if (typeof cb!="undefined") cb();
107 $("a#jot-perms-icon").fancybox({
108 'transitionIn' : 'none',
109 'transitionOut' : 'none'
112 if (typeof cb!="undefined") cb();
116 <script type="text/javascript" src="js/ajaxupload.js" ></script>
118 var ispublic = '$ispublic';
119 $(document).ready(function() {
120 /* enable tinymce on focus */
121 $("#profile-jot-text").focus(function(){
128 $("#jot-title").mouseout(function() {
129 $("#jot-title").hide();
130 var ttl = $("#jot-title").val();
131 $('#jot-title-display').html(ttl);
133 $("#jot-title-display").show();
136 $("#jot-title-desc").show();
140 $("#jot-title-display").click(function() {
141 $("#jot-title-display").hide();
142 $("#jot-title").show();
143 $("#jot-title").focus();
146 $("#jot-title-desc").click(function() {
147 $("#jot-title-desc").hide();
148 $("#jot-title").show();
149 $("#jot-title").focus();
152 var uploader = new window.AjaxUpload(
154 { action: 'wall_upload/$nickname',
156 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
157 onComplete: function(file,response) {
158 tinyMCE.execCommand('mceInsertRawHTML',false,response);
159 $('#profile-rotator').hide();
163 var file_uploader = new window.AjaxUpload(
165 { action: 'wall_attach/$nickname',
167 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
168 onComplete: function(file,response) {
169 tinyMCE.execCommand('mceInsertRawHTML',false,response);
170 $('#profile-rotator').hide();
174 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
176 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
177 selstr = $(this).text();
178 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
179 $('#jot-public').hide();
180 $('.profile-jot-net input').attr('disabled', 'disabled');
183 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
184 $('#jot-public').show();
185 $('.profile-jot-net input').attr('disabled', false);
188 }).trigger('change');
192 function deleteCheckedItems() {
195 $('.item-select').each( function() {
196 if($(this).is(':checked')) {
197 if(checkedstr.length != 0) {
198 checkedstr = checkedstr + ',' + $(this).val();
201 checkedstr = $(this).val();
205 $.post('item', { dropitems: checkedstr }, function(data) {
206 window.location.reload();
210 function jotGetLink() {
211 reply = prompt("$linkurl");
212 if(reply && reply.length) {
213 reply = bin2hex(reply);
214 $('#profile-rotator').show();
215 $.get('parse_url?binurl=' + reply, function(data) {
216 tinyMCE.execCommand('mceInsertRawHTML',false,data);
217 $('#profile-rotator').hide();
222 function jotVideoURL() {
223 reply = prompt("$vidurl");
224 if(reply && reply.length) {
225 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
229 function jotAudioURL() {
230 reply = prompt("$audurl");
231 if(reply && reply.length) {
232 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
237 function jotGetLocation() {
238 reply = prompt("$whereareu", $('#jot-location').val());
239 if(reply && reply.length) {
240 $('#jot-location').val(reply);
244 function jotTitle() {
245 reply = prompt("$title", $('#jot-title').val());
246 if(reply && reply.length) {
247 $('#jot-title').val(reply);
251 function jotShare(id) {
252 $('#like-rotator-' + id).show();
253 $.get('share/' + id, function(data) {
254 if (!editor) $("#profile-jot-text").val("");
255 initEditor(function(){
256 tinyMCE.execCommand('mceInsertRawHTML',false,data);
257 $('#like-rotator-' + id).hide();
258 $(window).scrollTop(0);
263 function linkdropper(event) {
264 var linkFound = event.dataTransfer.types.contains("text/uri-list");
266 event.preventDefault();
269 function linkdrop(event) {
270 var reply = event.dataTransfer.getData("text/uri-list");
271 event.target.textContent = reply;
272 event.preventDefault();
273 if(reply && reply.length) {
274 reply = bin2hex(reply);
275 $('#profile-rotator').show();
276 $.get('parse_url?binurl=' + reply, function(data) {
277 if (!editor) $("#profile-jot-text").val("");
278 initEditor(function(){
279 tinyMCE.execCommand('mceInsertRawHTML',false,data);
280 $('#profile-rotator').hide();
286 function itemTag(id) {
287 reply = prompt("$term");
288 if(reply && reply.length) {
289 reply = reply.replace('#','');
293 $('body').css('cursor', 'wait');
295 $.get('tagger/' + id + '?term=' + reply);
296 if(timer) clearTimeout(timer);
297 timer = setTimeout(NavUpdate,3000);
303 function jotClearLocation() {
304 $('#jot-coord').val('');
305 $('#profile-nolocation-wrapper').hide();