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();
13 mode : "specific_textareas",
14 editor_selector: /(profile-jot-text|prvmail-text)/,
15 plugins : "bbcode,paste,fullscreen,autoresize",
16 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
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 //theme_advanced_resizing : true,
23 //theme_advanced_statusbar_location : "bottom",
24 paste_text_sticky : true,
25 entity_encoding : "raw",
26 add_unload_trigger : false,
27 remove_linebreaks : false,
28 force_p_newlines : false,
29 force_br_newlines : true,
30 forced_root_block : '',
32 content_css: "$baseurl/view/custom_tinymce.css",
33 theme_advanced_path : false,
34 setup : function(ed) {
36 ed.onKeyDown.add(function(ed,e) {
43 ed.onKeyUp.add(function(ed, e) {
44 var txt = tinyMCE.activeEditor.getContent();
45 match = txt.match(/@([^ \n]+)$/);
48 cPopup = new ACPopup(this,baseurl+"/acl");
50 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
51 if(! cPopup.ready) cPopup = null;
54 if(cPopup !== null) { cPopup.close(); cPopup = null; }
58 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
59 $('#profile-jot-desc').html(ispublic);
62 $('#profile-jot-desc').html(' ');
68 $('#character-counter').removeClass('red');
69 $('#character-counter').removeClass('orange');
70 $('#character-counter').addClass('grey');
72 if((textlen > 140) && (textlen <= 420)) {
73 $('#character-counter').removeClass('grey');
74 $('#character-counter').removeClass('red');
75 $('#character-counter').addClass('orange');
78 $('#character-counter').removeClass('grey');
79 $('#character-counter').removeClass('orange');
80 $('#character-counter').addClass('red');
82 $('#character-counter').text(textlen);
84 ed.onInit.add(function(ed) {
85 ed.pasteAsPlainText = true;
86 $("#profile-jot-text-loading").hide();
87 $(".jothidden").show();
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();
99 $("#jot-preview-link").show();
101 $("#character-counter").show();
102 if (typeof cb!="undefined") cb();
108 $("a#jot-perms-icon").fancybox({
109 'transitionIn' : 'none',
110 'transitionOut' : 'none'
113 if (typeof cb!="undefined") cb();
117 <script type="text/javascript" src="js/ajaxupload.js" ></script>
119 var ispublic = '$ispublic';
120 $(document).ready(function() {
121 /* enable tinymce on focus */
122 $("#profile-jot-text").focus(function(){
129 var uploader = new window.AjaxUpload(
131 { action: 'wall_upload/$nickname',
133 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
134 onComplete: function(file,response) {
135 tinyMCE.execCommand('mceInsertRawHTML',false,response);
136 $('#profile-rotator').hide();
140 var file_uploader = new window.AjaxUpload(
142 { action: 'wall_attach/$nickname',
144 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
145 onComplete: function(file,response) {
146 tinyMCE.execCommand('mceInsertRawHTML',false,response);
147 $('#profile-rotator').hide();
151 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
153 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
154 selstr = $(this).text();
155 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
156 $('#jot-public').hide();
157 $('.profile-jot-net input').attr('disabled', 'disabled');
160 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
161 $('#jot-public').show();
162 $('.profile-jot-net input').attr('disabled', false);
165 }).trigger('change');
169 function deleteCheckedItems() {
172 $('.item-select').each( function() {
173 if($(this).is(':checked')) {
174 if(checkedstr.length != 0) {
175 checkedstr = checkedstr + ',' + $(this).val();
178 checkedstr = $(this).val();
182 $.post('item', { dropitems: checkedstr }, function(data) {
183 window.location.reload();
187 function jotGetLink() {
188 reply = prompt("$linkurl");
189 if(reply && reply.length) {
190 reply = bin2hex(reply);
191 $('#profile-rotator').show();
192 $.get('parse_url?binurl=' + reply, function(data) {
193 tinyMCE.execCommand('mceInsertRawHTML',false,data);
194 $('#profile-rotator').hide();
199 function jotVideoURL() {
200 reply = prompt("$vidurl");
201 if(reply && reply.length) {
202 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
206 function jotAudioURL() {
207 reply = prompt("$audurl");
208 if(reply && reply.length) {
209 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
214 function jotGetLocation() {
215 reply = prompt("$whereareu", $('#jot-location').val());
216 if(reply && reply.length) {
217 $('#jot-location').val(reply);
221 function jotTitle() {
222 reply = prompt("$title", $('#jot-title').val());
223 if(reply && reply.length) {
224 $('#jot-title').val(reply);
228 function jotShare(id) {
229 $('#like-rotator-' + id).show();
230 $.get('share/' + id, function(data) {
231 if (!editor) $("#profile-jot-text").val("");
232 initEditor(function(){
233 tinyMCE.execCommand('mceInsertRawHTML',false,data);
234 $('#like-rotator-' + id).hide();
235 $(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();