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.onKeyUp.add(function(ed, e) {
37 var txt = tinyMCE.activeEditor.getContent();
39 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
40 $('#profile-jot-desc').html(ispublic);
43 $('#profile-jot-desc').html(' ');
47 $('#character-counter').removeClass('red');
48 $('#character-counter').removeClass('orange');
49 $('#character-counter').addClass('grey');
51 if((textlen > 140) && (textlen <= 420)) {
52 $('#character-counter').removeClass('grey');
53 $('#character-counter').removeClass('red');
54 $('#character-counter').addClass('orange');
57 $('#character-counter').removeClass('grey');
58 $('#character-counter').removeClass('orange');
59 $('#character-counter').addClass('red');
61 $('#character-counter').text(textlen);
63 ed.onInit.add(function(ed) {
64 ed.pasteAsPlainText = true;
65 $("#profile-jot-text-loading").hide();
66 $("#profile-jot-submit-wrapper").show();
67 $("#profile-upload-wrapper").show();
68 $("#profile-attach-wrapper").show();
69 $("#profile-link-wrapper").show();
70 $("#profile-youtube-wrapper").show();
71 $("#profile-video-wrapper").show();
72 $("#profile-audio-wrapper").show();
73 $("#profile-location-wrapper").show();
74 $("#profile-nolocation-wrapper").show();
75 $("#profile-title-wrapper").show();
76 $("#profile-jot-plugin-wrapper").show();
77 $("#character-counter").show();
78 if (typeof cb!="undefined") cb();
84 $("a#jot-perms-icon").fancybox({
85 'transitionIn' : 'none',
86 'transitionOut' : 'none'
89 if (typeof cb!="undefined") cb();
93 <script type="text/javascript" src="include/ajaxupload.js" ></script>
95 var ispublic = '$ispublic';
96 $(document).ready(function() {
97 /* enable tinymce on focus */
98 $("#profile-jot-text").focus(function(){
103 var uploader = new window.AjaxUpload(
105 { action: 'wall_upload/$nickname',
107 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
108 onComplete: function(file,response) {
109 tinyMCE.execCommand('mceInsertRawHTML',false,response);
110 $('#profile-rotator').hide();
114 var file_uploader = new window.AjaxUpload(
116 { action: 'wall_attach/$nickname',
118 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
119 onComplete: function(file,response) {
120 tinyMCE.execCommand('mceInsertRawHTML',false,response);
121 $('#profile-rotator').hide();
125 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
127 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
128 selstr = $(this).text();
129 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
130 $('#jot-public').hide();
131 $('.profile-jot-net input').attr('disabled', 'disabled');
134 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
135 $('#jot-public').show();
136 $('.profile-jot-net input').attr('disabled', false);
139 }).trigger('change');
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 jotGetVideo() {
174 reply = prompt("$utubeurl");
175 if(reply && reply.length) {
176 tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
180 function jotVideoURL() {
181 reply = prompt("$vidurl");
182 if(reply && reply.length) {
183 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
187 function jotAudioURL() {
188 reply = prompt("$audurl");
189 if(reply && reply.length) {
190 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
195 function jotGetLocation() {
196 reply = prompt("$whereareu", $('#jot-location').val());
197 if(reply && reply.length) {
198 $('#jot-location').val(reply);
202 function jotTitle() {
203 reply = prompt("$title", $('#jot-title').val());
204 if(reply && reply.length) {
205 $('#jot-title').val(reply);
209 function jotShare(id) {
210 $('#like-rotator-' + id).show();
211 $.get('share/' + id, function(data) {
212 if (!editor) $("#profile-jot-text").val("");
213 initEditor(function(){
214 tinyMCE.execCommand('mceInsertRawHTML',false,data);
215 $('#like-rotator-' + id).hide();
216 $(window).scrollTop(0);
221 function linkdropper(event) {
222 var linkFound = event.dataTransfer.types.contains("text/uri-list");
224 event.preventDefault();
227 function linkdrop(event) {
228 var reply = event.dataTransfer.getData("text/uri-list");
229 event.target.textContent = reply;
230 event.preventDefault();
231 if(reply && reply.length) {
232 $('#profile-rotator').show();
233 $.get('parse_url?url=' + reply, function(data) {
234 if (!editor) $("#profile-jot-text").val("");
235 initEditor(function(){
236 tinyMCE.execCommand('mceInsertRawHTML',false,data);
237 $('#profile-rotator').hide();
243 function jotClearLocation() {
244 $('#jot-coord').val('');
245 $('#profile-nolocation-wrapper').hide();