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 $("#profile-jot-submit-wrapper").show();
88 $("#profile-upload-wrapper").show();
89 $("#profile-attach-wrapper").show();
90 $("#profile-link-wrapper").show();
91 $("#profile-video-wrapper").show();
92 $("#profile-audio-wrapper").show();
93 $("#profile-location-wrapper").show();
94 $("#profile-nolocation-wrapper").show();
95 $("#profile-title-wrapper").show();
96 $("#profile-jot-plugin-wrapper").show();
97 $("#character-counter").show();
98 if (typeof cb!="undefined") cb();
104 $("a#jot-perms-icon").fancybox({
105 'transitionIn' : 'none',
106 'transitionOut' : 'none'
109 if (typeof cb!="undefined") cb();
113 <script type="text/javascript" src="js/ajaxupload.js" ></script>
115 var ispublic = '$ispublic';
116 $(document).ready(function() {
117 /* enable tinymce on focus */
118 $("#profile-jot-text").focus(function(){
123 var uploader = new window.AjaxUpload(
125 { action: 'wall_upload/$nickname',
127 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
128 onComplete: function(file,response) {
129 tinyMCE.execCommand('mceInsertRawHTML',false,response);
130 $('#profile-rotator').hide();
134 var file_uploader = new window.AjaxUpload(
136 { action: 'wall_attach/$nickname',
138 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
139 onComplete: function(file,response) {
140 tinyMCE.execCommand('mceInsertRawHTML',false,response);
141 $('#profile-rotator').hide();
145 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
147 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
148 selstr = $(this).text();
149 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
150 $('#jot-public').hide();
151 $('.profile-jot-net input').attr('disabled', 'disabled');
154 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
155 $('#jot-public').show();
156 $('.profile-jot-net input').attr('disabled', false);
159 }).trigger('change');
163 function deleteCheckedItems() {
166 $('.item-select').each( function() {
167 if($(this).is(':checked')) {
168 if(checkedstr.length != 0) {
169 checkedstr = checkedstr + ',' + $(this).val();
172 checkedstr = $(this).val();
176 $.post('item', { dropitems: checkedstr }, function(data) {
177 window.location.reload();
181 function jotGetLink() {
182 reply = prompt("$linkurl");
183 if(reply && reply.length) {
184 reply = bin2hex(reply);
185 $('#profile-rotator').show();
186 $.get('parse_url?binurl=' + reply, function(data) {
187 tinyMCE.execCommand('mceInsertRawHTML',false,data);
188 $('#profile-rotator').hide();
193 function jotVideoURL() {
194 reply = prompt("$vidurl");
195 if(reply && reply.length) {
196 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
200 function jotAudioURL() {
201 reply = prompt("$audurl");
202 if(reply && reply.length) {
203 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
208 function jotGetLocation() {
209 reply = prompt("$whereareu", $('#jot-location').val());
210 if(reply && reply.length) {
211 $('#jot-location').val(reply);
215 function jotTitle() {
216 reply = prompt("$title", $('#jot-title').val());
217 if(reply && reply.length) {
218 $('#jot-title').val(reply);
222 function jotShare(id) {
223 $('#like-rotator-' + id).show();
224 $.get('share/' + id, function(data) {
225 if (!editor) $("#profile-jot-text").val("");
226 initEditor(function(){
227 tinyMCE.execCommand('mceInsertRawHTML',false,data);
228 $('#like-rotator-' + id).hide();
229 $(window).scrollTop(0);
234 function linkdropper(event) {
235 var linkFound = event.dataTransfer.types.contains("text/uri-list");
237 event.preventDefault();
240 function linkdrop(event) {
241 var reply = event.dataTransfer.getData("text/uri-list");
242 event.target.textContent = reply;
243 event.preventDefault();
244 if(reply && reply.length) {
245 reply = bin2hex(reply);
246 $('#profile-rotator').show();
247 $.get('parse_url?binurl=' + reply, function(data) {
248 if (!editor) $("#profile-jot-text").val("");
249 initEditor(function(){
250 tinyMCE.execCommand('mceInsertRawHTML',false,data);
251 $('#profile-rotator').hide();
257 function itemTag(id) {
258 reply = prompt("$term");
259 if(reply && reply.length) {
260 reply = reply.replace('#','');
264 $('body').css('cursor', 'wait');
266 $.get('tagger/' + id + '?term=' + reply);
267 if(timer) clearTimeout(timer);
268 timer = setTimeout(NavUpdate,3000);
274 function jotClearLocation() {
275 $('#jot-coord').val('');
276 $('#profile-nolocation-wrapper').hide();