2 <script language="javascript" type="text/javascript">
7 function initEditor(cb){
9 $("#profile-jot-text-loading").show();
12 mode : "specific_textareas",
13 editor_selector: /(profile-jot-text|prvmail-text)/,
14 auto_focus: "profile-jot-text",
15 plugins : "bbcode,paste,autoresize",
16 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
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 paste_text_sticky : true,
23 entity_encoding : "raw",
24 add_unload_trigger : false,
25 remove_linebreaks : false,
26 force_p_newlines : false,
27 force_br_newlines : true,
28 forced_root_block : '',
30 content_css: "$baseurl/view/custom_tinymce.css",
31 theme_advanced_path : false,
32 setup : function(ed) {
34 ed.onKeyDown.add(function(ed,e) {
39 ed.onKeyUp.add(function(ed, e) {
40 var txt = tinyMCE.activeEditor.getContent();
41 match = txt.match(/@([^ \n]+)$/);
44 cPopup = new ACPopup(this,baseurl+"/acl");
46 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
47 if(! cPopup.ready) cPopup = null;
50 if(cPopup !== null) { cPopup.close(); cPopup = null; }
54 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
55 $('#profile-jot-desc').html(ispublic);
58 $('#profile-jot-desc').html(' ');
64 $('#character-counter').removeClass('red');
65 $('#character-counter').removeClass('orange');
66 $('#character-counter').addClass('grey');
68 if((textlen > 140) && (textlen <= 420)) {
69 $('#character-counter').removeClass('grey');
70 $('#character-counter').removeClass('red');
71 $('#character-counter').addClass('orange');
74 $('#character-counter').removeClass('grey');
75 $('#character-counter').removeClass('orange');
76 $('#character-counter').addClass('red');
78 $('#character-counter').text(textlen);
81 ed.onInit.add(function(ed) {
82 ed.pasteAsPlainText = true;
83 $("#profile-jot-text-loading").hide();
84 $("#profile-jot-submit-wrapper").show();
85 if (typeof cb!="undefined") cb();
92 $("a#jot-perms-icon").fancybox({
93 'transitionIn' : 'elastic',
94 'transitionOut' : 'elastic'
97 if (typeof cb!="undefined") cb();
102 <script type="text/javascript" src="js/ajaxupload.js" ></script>
104 var ispublic = '$ispublic';
105 $(document).ready(function() {
107 /* enable tinymce on focus */
108 $("#profile-jot-text").focus(function(){
115 var uploader = new window.AjaxUpload(
117 { action: 'wall_upload/$nickname',
119 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
120 onComplete: function(file,response) {
121 tinyMCE.execCommand('mceInsertRawHTML',false,response);
122 $('#profile-rotator').hide();
126 var file_uploader = new window.AjaxUpload(
128 { action: 'wall_attach/$nickname',
130 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
131 onComplete: function(file,response) {
132 tinyMCE.execCommand('mceInsertRawHTML',false,response);
133 $('#profile-rotator').hide();
141 function deleteCheckedItems() {
144 $('.item-select').each( function() {
145 if($(this).is(':checked')) {
146 if(checkedstr.length != 0) {
147 checkedstr = checkedstr + ',' + $(this).val();
150 checkedstr = $(this).val();
154 $.post('item', { dropitems: checkedstr }, function(data) {
155 window.location.reload();
159 function jotGetLink() {
160 reply = prompt("$linkurl");
161 if(reply && reply.length) {
162 reply = bin2hex(reply);
163 $('#profile-rotator').show();
164 $.get('parse_url?binurl=' + reply, function(data) {
165 tinyMCE.execCommand('mceInsertRawHTML',false,data);
166 $('#profile-rotator').hide();
171 function jotVideoURL() {
172 reply = prompt("$vidurl");
173 if(reply && reply.length) {
174 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
178 function jotAudioURL() {
179 reply = prompt("$audurl");
180 if(reply && reply.length) {
181 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
186 function jotGetLocation() {
187 reply = prompt("$whereareu", $('#jot-location').val());
188 if(reply && reply.length) {
189 $('#jot-location').val(reply);
193 function jotTitle() {
194 reply = prompt("$title", $('#jot-title').val());
195 if(reply && reply.length) {
196 $('#jot-title').val(reply);
201 function jotShare(id) {
202 $('#like-rotator-' + id).show();
203 $.get('share/' + id, function(data) {
204 if (!editor) $("#profile-jot-text").val("");
205 initEditor(function(){
206 tinyMCE.execCommand('mceInsertRawHTML',false,data);
207 $('#like-rotator-' + id).hide();
208 $(window).scrollTop(0);
214 function linkdropper(event) {
215 var linkFound = event.dataTransfer.types.contains("text/uri-list");
217 event.preventDefault();
220 function linkdrop(event) {
221 var reply = event.dataTransfer.getData("text/uri-list");
222 event.target.textContent = reply;
223 event.preventDefault();
224 if(reply && reply.length) {
225 reply = bin2hex(reply);
226 $('#profile-rotator').show();
227 $.get('parse_url?binurl=' + reply, function(data) {
228 if (!editor) $("#profile-jot-text").val("");
229 initEditor(function(){
230 tinyMCE.execCommand('mceInsertRawHTML',false,data);
231 $('#profile-rotator').hide();
237 function itemTag(id) {
238 reply = prompt("$term");
239 if(reply && reply.length) {
240 reply = reply.replace('#','');
244 $('body').css('cursor', 'wait');
246 $.get('tagger/' + id + '?term=' + reply);
247 if(timer) clearTimeout(timer);
248 timer = setTimeout(NavUpdate,3000);
254 function jotClearLocation() {
255 $('#jot-coord').val('');
256 $('#profile-nolocation-wrapper').hide();