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();
11 $("#jot-title-desc").show();
14 mode : "specific_textareas",
15 editor_selector: /(profile-jot-text|prvmail-text)/,
16 plugins : "bbcode,paste,fullscreen,autoresize",
17 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
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 //theme_advanced_resizing : true,
24 //theme_advanced_statusbar_location : "bottom",
25 paste_text_sticky : true,
26 entity_encoding : "raw",
27 add_unload_trigger : false,
28 remove_linebreaks : false,
29 force_p_newlines : false,
30 force_br_newlines : true,
31 forced_root_block : '',
33 content_css: "$baseurl/view/custom_tinymce.css",
34 theme_advanced_path : false,
35 setup : function(ed) {
37 ed.onKeyDown.add(function(ed,e) {
44 ed.onKeyUp.add(function(ed, e) {
45 var txt = tinyMCE.activeEditor.getContent();
46 match = txt.match(/@([^ \n]+)$/);
49 cPopup = new ACPopup(this,baseurl+"/acl");
51 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
52 if(! cPopup.ready) cPopup = null;
55 if(cPopup !== null) { cPopup.close(); cPopup = null; }
59 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
60 $('#profile-jot-desc').html(ispublic);
63 $('#profile-jot-desc').html(' ');
69 $('#character-counter').removeClass('red');
70 $('#character-counter').removeClass('orange');
71 $('#character-counter').addClass('grey');
73 if((textlen > 140) && (textlen <= 420)) {
74 $('#character-counter').removeClass('grey');
75 $('#character-counter').removeClass('red');
76 $('#character-counter').addClass('orange');
79 $('#character-counter').removeClass('grey');
80 $('#character-counter').removeClass('orange');
81 $('#character-counter').addClass('red');
83 $('#character-counter').text(textlen);
85 ed.onInit.add(function(ed) {
86 ed.pasteAsPlainText = true;
87 $("#profile-jot-text-loading").hide();
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();
100 $("#character-counter").show();
101 if (typeof cb!="undefined") cb();
107 $("a#jot-perms-icon").fancybox({
108 'transitionIn' : 'none',
109 'transitionOut' : 'none'
112 if (typeof cb!="undefined") cb();
116 <script type="text/javascript" src="js/ajaxupload.js" ></script>
118 var ispublic = '$ispublic';
119 $(document).ready(function() {
120 /* enable tinymce on focus */
121 $("#profile-jot-text").focus(function(){
127 $("#jot-title-desc").click(function() {
128 $("#jot-title-desc").hide();
129 $("#jot-title").show();
133 var uploader = new window.AjaxUpload(
135 { action: 'wall_upload/$nickname',
137 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
138 onComplete: function(file,response) {
139 tinyMCE.execCommand('mceInsertRawHTML',false,response);
140 $('#profile-rotator').hide();
144 var file_uploader = new window.AjaxUpload(
146 { action: 'wall_attach/$nickname',
148 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
149 onComplete: function(file,response) {
150 tinyMCE.execCommand('mceInsertRawHTML',false,response);
151 $('#profile-rotator').hide();
155 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
157 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
158 selstr = $(this).text();
159 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
160 $('#jot-public').hide();
161 $('.profile-jot-net input').attr('disabled', 'disabled');
164 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
165 $('#jot-public').show();
166 $('.profile-jot-net input').attr('disabled', false);
169 }).trigger('change');
173 function deleteCheckedItems() {
176 $('.item-select').each( function() {
177 if($(this).is(':checked')) {
178 if(checkedstr.length != 0) {
179 checkedstr = checkedstr + ',' + $(this).val();
182 checkedstr = $(this).val();
186 $.post('item', { dropitems: checkedstr }, function(data) {
187 window.location.reload();
191 function jotGetLink() {
192 reply = prompt("$linkurl");
193 if(reply && reply.length) {
194 reply = bin2hex(reply);
195 $('#profile-rotator').show();
196 $.get('parse_url?binurl=' + reply, function(data) {
197 tinyMCE.execCommand('mceInsertRawHTML',false,data);
198 $('#profile-rotator').hide();
203 function jotVideoURL() {
204 reply = prompt("$vidurl");
205 if(reply && reply.length) {
206 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
210 function jotAudioURL() {
211 reply = prompt("$audurl");
212 if(reply && reply.length) {
213 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
218 function jotGetLocation() {
219 reply = prompt("$whereareu", $('#jot-location').val());
220 if(reply && reply.length) {
221 $('#jot-location').val(reply);
225 function jotTitle() {
226 reply = prompt("$title", $('#jot-title').val());
227 if(reply && reply.length) {
228 $('#jot-title').val(reply);
232 function jotShare(id) {
233 $('#like-rotator-' + id).show();
234 $.get('share/' + id, function(data) {
235 if (!editor) $("#profile-jot-text").val("");
236 initEditor(function(){
237 tinyMCE.execCommand('mceInsertRawHTML',false,data);
238 $('#like-rotator-' + id).hide();
239 $(window).scrollTop(0);
244 function linkdropper(event) {
245 var linkFound = event.dataTransfer.types.contains("text/uri-list");
247 event.preventDefault();
250 function linkdrop(event) {
251 var reply = event.dataTransfer.getData("text/uri-list");
252 event.target.textContent = reply;
253 event.preventDefault();
254 if(reply && reply.length) {
255 reply = bin2hex(reply);
256 $('#profile-rotator').show();
257 $.get('parse_url?binurl=' + reply, function(data) {
258 if (!editor) $("#profile-jot-text").val("");
259 initEditor(function(){
260 tinyMCE.execCommand('mceInsertRawHTML',false,data);
261 $('#profile-rotator').hide();
267 function itemTag(id) {
268 reply = prompt("$term");
269 if(reply && reply.length) {
270 reply = reply.replace('#','');
274 $('body').css('cursor', 'wait');
276 $.get('tagger/' + id + '?term=' + reply);
277 if(timer) clearTimeout(timer);
278 timer = setTimeout(NavUpdate,3000);
284 function jotClearLocation() {
285 $('#jot-coord').val('');
286 $('#profile-nolocation-wrapper').hide();