2 <script language="javascript" type="text/javascript">
7 function initEditor(cb){
9 $("#profile-jot-text-loading").show();
10 $("#jot-title-desc").show();
13 mode : "specific_textareas",
14 editor_selector: /(profile-jot-text|prvmail-text)/,
15 auto_focus: "profile-jot-text",
16 plugins : "bbcode,paste,autoresize",
17 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
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 paste_text_sticky : true,
24 entity_encoding : "raw",
25 add_unload_trigger : false,
26 remove_linebreaks : false,
27 force_p_newlines : false,
28 force_br_newlines : true,
29 forced_root_block : '',
31 content_css: "$baseurl/view/custom_tinymce.css",
32 theme_advanced_path : false,
33 setup : function(ed) {
35 ed.onKeyDown.add(function(ed,e) {
40 ed.onKeyUp.add(function(ed, e) {
41 var txt = tinyMCE.activeEditor.getContent();
42 match = txt.match(/@([^ \n]+)$/);
45 cPopup = new ACPopup(this,baseurl+"/acl");
47 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
48 if(! cPopup.ready) cPopup = null;
51 if(cPopup !== null) { cPopup.close(); cPopup = null; }
55 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
56 $('#profile-jot-desc').html(ispublic);
59 $('#profile-jot-desc').html(' ');
65 $('#character-counter').removeClass('red');
66 $('#character-counter').removeClass('orange');
67 $('#character-counter').addClass('grey');
69 if((textlen > 140) && (textlen <= 420)) {
70 $('#character-counter').removeClass('grey');
71 $('#character-counter').removeClass('red');
72 $('#character-counter').addClass('orange');
75 $('#character-counter').removeClass('grey');
76 $('#character-counter').removeClass('orange');
77 $('#character-counter').addClass('red');
79 $('#character-counter').text(textlen);
82 ed.onInit.add(function(ed) {
83 ed.pasteAsPlainText = true;
84 $("#profile-jot-text-loading").hide();
85 $("#profile-jot-submit-wrapper").show();
86 if (typeof cb!="undefined") cb();
93 $("a#jot-perms-icon").fancybox({
94 'transitionIn' : 'elastic',
95 'transitionOut' : 'elastic'
98 if (typeof cb!="undefined") cb();
103 <script type="text/javascript" src="js/ajaxupload.js" ></script>
105 var ispublic = '$ispublic';
106 var addtitle = '$addtitle';
108 $(document).ready(function() {
110 /* enable tinymce on focus */
111 $("#profile-jot-text").focus(function(){
117 $("#jot-title").mouseout(function() {
118 $("#jot-title").hide();
119 var ttl = $("#jot-title").val();
120 $('#jot-title-display').html(ttl);
122 $("#jot-title-display").show();
125 $("#jot-title-desc").show();
129 $("#jot-title-display").hover(function() {
130 $("#jot-title-display").hide();
131 $("#jot-title").show();
132 $("#jot-title").focus();
135 $("#jot-title-desc").click(function() {
136 $("#jot-title-desc").hide();
137 $("#jot-title").show();
138 $("#jot-title").focus();
141 var uploader = new window.AjaxUpload(
143 { action: 'wall_upload/$nickname',
145 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
146 onComplete: function(file,response) {
147 tinyMCE.execCommand('mceInsertRawHTML',false,response);
148 $('#profile-rotator').hide();
152 var file_uploader = new window.AjaxUpload(
154 { action: 'wall_attach/$nickname',
156 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
157 onComplete: function(file,response) {
158 tinyMCE.execCommand('mceInsertRawHTML',false,response);
159 $('#profile-rotator').hide();
167 function deleteCheckedItems() {
170 $('.item-select').each( function() {
171 if($(this).is(':checked')) {
172 if(checkedstr.length != 0) {
173 checkedstr = checkedstr + ',' + $(this).val();
176 checkedstr = $(this).val();
180 $.post('item', { dropitems: checkedstr }, function(data) {
181 window.location.reload();
185 function jotGetLink() {
186 reply = prompt("$linkurl");
187 if(reply && reply.length) {
188 reply = bin2hex(reply);
189 $('#profile-rotator').show();
190 $.get('parse_url?binurl=' + reply, function(data) {
191 tinyMCE.execCommand('mceInsertRawHTML',false,data);
192 $('#profile-rotator').hide();
197 function jotVideoURL() {
198 reply = prompt("$vidurl");
199 if(reply && reply.length) {
200 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
204 function jotAudioURL() {
205 reply = prompt("$audurl");
206 if(reply && reply.length) {
207 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
212 function jotGetLocation() {
213 reply = prompt("$whereareu", $('#jot-location').val());
214 if(reply && reply.length) {
215 $('#jot-location').val(reply);
219 function jotTitle() {
220 reply = prompt("$title", $('#jot-title').val());
221 if(reply && reply.length) {
222 $('#jot-title').val(reply);
227 function jotShare(id) {
228 $('#like-rotator-' + id).show();
229 $.get('share/' + id, function(data) {
230 if (!editor) $("#profile-jot-text").val("");
231 initEditor(function(){
232 tinyMCE.execCommand('mceInsertRawHTML',false,data);
233 $('#like-rotator-' + id).hide();
234 $(window).scrollTop(0);
240 function linkdropper(event) {
241 var linkFound = event.dataTransfer.types.contains("text/uri-list");
243 event.preventDefault();
246 function linkdrop(event) {
247 var reply = event.dataTransfer.getData("text/uri-list");
248 event.target.textContent = reply;
249 event.preventDefault();
250 if(reply && reply.length) {
251 reply = bin2hex(reply);
252 $('#profile-rotator').show();
253 $.get('parse_url?binurl=' + reply, function(data) {
254 if (!editor) $("#profile-jot-text").val("");
255 initEditor(function(){
256 tinyMCE.execCommand('mceInsertRawHTML',false,data);
257 $('#profile-rotator').hide();
263 function itemTag(id) {
264 reply = prompt("$term");
265 if(reply && reply.length) {
266 reply = reply.replace('#','');
270 $('body').css('cursor', 'wait');
272 $.get('tagger/' + id + '?term=' + reply);
273 if(timer) clearTimeout(timer);
274 timer = setTimeout(NavUpdate,3000);
280 function jotClearLocation() {
281 $('#jot-coord').val('');
282 $('#profile-nolocation-wrapper').hide();