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 $(".jothidden").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();
101 function enableOnUser(){
108 <script type="text/javascript" src="js/ajaxupload.js" ></script>
110 var ispublic = '$ispublic';
111 $(document).ready(function() {
113 /* enable tinymce on focus and click */
114 $("#profile-jot-text").focus(enableOnUser);
115 $("#profile-jot-text").click(enableOnUser);
117 var uploader = new window.AjaxUpload(
119 { action: 'wall_upload/$nickname',
121 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
122 onComplete: function(file,response) {
123 tinyMCE.execCommand('mceInsertRawHTML',false,response);
124 $('#profile-rotator').hide();
128 var file_uploader = new window.AjaxUpload(
130 { action: 'wall_attach/$nickname',
132 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
133 onComplete: function(file,response) {
134 tinyMCE.execCommand('mceInsertRawHTML',false,response);
135 $('#profile-rotator').hide();
143 function deleteCheckedItems() {
146 $('.item-select').each( function() {
147 if($(this).is(':checked')) {
148 if(checkedstr.length != 0) {
149 checkedstr = checkedstr + ',' + $(this).val();
152 checkedstr = $(this).val();
156 $.post('item', { dropitems: checkedstr }, function(data) {
157 window.location.reload();
161 function jotGetLink() {
162 reply = prompt("$linkurl");
163 if(reply && reply.length) {
164 reply = bin2hex(reply);
165 $('#profile-rotator').show();
166 $.get('parse_url?binurl=' + reply, function(data) {
167 tinyMCE.execCommand('mceInsertRawHTML',false,data);
168 $('#profile-rotator').hide();
173 function jotVideoURL() {
174 reply = prompt("$vidurl");
175 if(reply && reply.length) {
176 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
180 function jotAudioURL() {
181 reply = prompt("$audurl");
182 if(reply && reply.length) {
183 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
188 function jotGetLocation() {
189 reply = prompt("$whereareu", $('#jot-location').val());
190 if(reply && reply.length) {
191 $('#jot-location').val(reply);
195 function jotTitle() {
196 reply = prompt("$title", $('#jot-title').val());
197 if(reply && reply.length) {
198 $('#jot-title').val(reply);
203 function jotShare(id) {
204 $('#like-rotator-' + id).show();
205 $.get('share/' + id, function(data) {
206 if (!editor) $("#profile-jot-text").val("");
207 initEditor(function(){
208 tinyMCE.execCommand('mceInsertRawHTML',false,data);
209 $('#like-rotator-' + id).hide();
210 $(window).scrollTop(0);
216 function linkdropper(event) {
217 var linkFound = event.dataTransfer.types.contains("text/uri-list");
219 event.preventDefault();
222 function linkdrop(event) {
223 var reply = event.dataTransfer.getData("text/uri-list");
224 event.target.textContent = reply;
225 event.preventDefault();
226 if(reply && reply.length) {
227 reply = bin2hex(reply);
228 $('#profile-rotator').show();
229 $.get('parse_url?binurl=' + reply, function(data) {
230 if (!editor) $("#profile-jot-text").val("");
231 initEditor(function(){
232 tinyMCE.execCommand('mceInsertRawHTML',false,data);
233 $('#profile-rotator').hide();
239 function itemTag(id) {
240 reply = prompt("$term");
241 if(reply && reply.length) {
242 reply = reply.replace('#','');
246 $('body').css('cursor', 'wait');
248 $.get('tagger/' + id + '?term=' + reply);
249 if(timer) clearTimeout(timer);
250 timer = setTimeout(NavUpdate,3000);
256 function jotClearLocation() {
257 $('#jot-coord').val('');
258 $('#profile-nolocation-wrapper').hide();