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-desc").html((ttl.length) ? "<strong>" + ttl + "</strong>" : addtitle );
121 $("#jot-title-desc").show();
124 $("#jot-title-desc").click(function() {
125 $("#jot-title-desc").hide();
126 $("#jot-title").show();
127 $("#jot-title").focus();
130 var uploader = new window.AjaxUpload(
132 { action: 'wall_upload/$nickname',
134 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
135 onComplete: function(file,response) {
136 tinyMCE.execCommand('mceInsertRawHTML',false,response);
137 $('#profile-rotator').hide();
141 var file_uploader = new window.AjaxUpload(
143 { action: 'wall_attach/$nickname',
145 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
146 onComplete: function(file,response) {
147 tinyMCE.execCommand('mceInsertRawHTML',false,response);
148 $('#profile-rotator').hide();
156 function deleteCheckedItems() {
159 $('.item-select').each( function() {
160 if($(this).is(':checked')) {
161 if(checkedstr.length != 0) {
162 checkedstr = checkedstr + ',' + $(this).val();
165 checkedstr = $(this).val();
169 $.post('item', { dropitems: checkedstr }, function(data) {
170 window.location.reload();
174 function jotGetLink() {
175 reply = prompt("$linkurl");
176 if(reply && reply.length) {
177 reply = bin2hex(reply);
178 $('#profile-rotator').show();
179 $.get('parse_url?binurl=' + reply, function(data) {
180 tinyMCE.execCommand('mceInsertRawHTML',false,data);
181 $('#profile-rotator').hide();
186 function jotVideoURL() {
187 reply = prompt("$vidurl");
188 if(reply && reply.length) {
189 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
193 function jotAudioURL() {
194 reply = prompt("$audurl");
195 if(reply && reply.length) {
196 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
201 function jotGetLocation() {
202 reply = prompt("$whereareu", $('#jot-location').val());
203 if(reply && reply.length) {
204 $('#jot-location').val(reply);
208 function jotTitle() {
209 reply = prompt("$title", $('#jot-title').val());
210 if(reply && reply.length) {
211 $('#jot-title').val(reply);
216 function jotShare(id) {
217 $('#like-rotator-' + id).show();
218 $.get('share/' + id, function(data) {
219 if (!editor) $("#profile-jot-text").val("");
220 initEditor(function(){
221 tinyMCE.execCommand('mceInsertRawHTML',false,data);
222 $('#like-rotator-' + id).hide();
223 $(window).scrollTop(0);
229 function linkdropper(event) {
230 var linkFound = event.dataTransfer.types.contains("text/uri-list");
232 event.preventDefault();
235 function linkdrop(event) {
236 var reply = event.dataTransfer.getData("text/uri-list");
237 event.target.textContent = reply;
238 event.preventDefault();
239 if(reply && reply.length) {
240 reply = bin2hex(reply);
241 $('#profile-rotator').show();
242 $.get('parse_url?binurl=' + reply, function(data) {
243 if (!editor) $("#profile-jot-text").val("");
244 initEditor(function(){
245 tinyMCE.execCommand('mceInsertRawHTML',false,data);
246 $('#profile-rotator').hide();
252 function itemTag(id) {
253 reply = prompt("$term");
254 if(reply && reply.length) {
255 reply = reply.replace('#','');
259 $('body').css('cursor', 'wait');
261 $.get('tagger/' + id + '?term=' + reply);
262 if(timer) clearTimeout(timer);
263 timer = setTimeout(NavUpdate,3000);
269 function jotClearLocation() {
270 $('#jot-coord').val('');
271 $('#profile-nolocation-wrapper').hide();