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.onKeyUp.add(function(ed, e) {
38 var txt = tinyMCE.activeEditor.getContent();
40 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
41 $('#profile-jot-desc').html(ispublic);
44 $('#profile-jot-desc').html(' ');
48 $('#character-counter').removeClass('red');
49 $('#character-counter').removeClass('orange');
50 $('#character-counter').addClass('grey');
52 if((textlen > 140) && (textlen <= 420)) {
53 $('#character-counter').removeClass('grey');
54 $('#character-counter').removeClass('red');
55 $('#character-counter').addClass('orange');
58 $('#character-counter').removeClass('grey');
59 $('#character-counter').removeClass('orange');
60 $('#character-counter').addClass('red');
62 $('#character-counter').text(textlen);
64 ed.onInit.add(function(ed) {
65 ed.pasteAsPlainText = true;
66 $("#profile-jot-text-loading").hide();
67 $("#profile-jot-submit-wrapper").show();
68 $("#profile-upload-wrapper").show();
69 $("#profile-attach-wrapper").show();
70 $("#profile-link-wrapper").show();
71 $("#profile-youtube-wrapper").show();
72 $("#profile-video-wrapper").show();
73 $("#profile-audio-wrapper").show();
74 $("#profile-location-wrapper").show();
75 $("#profile-nolocation-wrapper").show();
76 $("#profile-title-wrapper").show();
77 $("#profile-jot-plugin-wrapper").show();
78 $("#character-counter").show();
79 if (typeof cb!="undefined") cb();
85 $("a#jot-perms-icon").fancybox({
86 'transitionIn' : 'none',
87 'transitionOut' : 'none'
90 if (typeof cb!="undefined") cb();
94 <script type="text/javascript" src="js/ajaxupload.js" ></script>
96 var ispublic = '$ispublic';
97 $(document).ready(function() {
98 /* enable tinymce on focus */
99 $("#profile-jot-text").focus(function(){
105 $("#jot-title-desc").click(function() {
106 $("#jot-title-desc").hide();
107 $("#jot-title").show();
110 var uploader = new window.AjaxUpload(
112 { action: 'wall_upload/$nickname',
114 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
115 onComplete: function(file,response) {
116 tinyMCE.execCommand('mceInsertRawHTML',false,response);
117 $('#profile-rotator').hide();
121 var file_uploader = new window.AjaxUpload(
123 { action: 'wall_attach/$nickname',
125 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
126 onComplete: function(file,response) {
127 tinyMCE.execCommand('mceInsertRawHTML',false,response);
128 $('#profile-rotator').hide();
132 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
134 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
135 selstr = $(this).text();
136 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
137 $('#jot-public').hide();
138 $('.profile-jot-net input').attr('disabled', 'disabled');
141 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
142 $('#jot-public').show();
143 $('.profile-jot-net input').attr('disabled', false);
146 }).trigger('change');
150 function deleteCheckedItems() {
153 $('.item-select').each( function() {
154 if($(this).is(':checked')) {
155 if(checkedstr.length != 0) {
156 checkedstr = checkedstr + ',' + $(this).val();
159 checkedstr = $(this).val();
163 $.post('item', { dropitems: checkedstr }, function(data) {
164 window.location.reload();
168 function jotGetLink() {
169 reply = prompt("$linkurl");
170 if(reply && reply.length) {
171 reply = bin2hex(reply);
172 $('#profile-rotator').show();
173 $.get('parse_url?binurl=' + reply, function(data) {
174 tinyMCE.execCommand('mceInsertRawHTML',false,data);
175 $('#profile-rotator').hide();
180 function jotGetVideo() {
181 reply = prompt("$utubeurl");
182 if(reply && reply.length) {
183 tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
187 function jotVideoURL() {
188 reply = prompt("$vidurl");
189 if(reply && reply.length) {
190 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
194 function jotAudioURL() {
195 reply = prompt("$audurl");
196 if(reply && reply.length) {
197 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
202 function jotGetLocation() {
203 reply = prompt("$whereareu", $('#jot-location').val());
204 if(reply && reply.length) {
205 $('#jot-location').val(reply);
209 function jotTitle() {
210 reply = prompt("$title", $('#jot-title').val());
211 if(reply && reply.length) {
212 $('#jot-title').val(reply);
216 function jotShare(id) {
217 $('#like-rotator-' + id).show();
218 $.get('share/' + id, function(data) {
219 if (!editor) $("#profile-jot-text").val("");
220 initEditor(function(){
221 tinyMCE.execCommand('mceInsertRawHTML',false,data);
222 $('#like-rotator-' + id).hide();
223 $(window).scrollTop(0);
228 function linkdropper(event) {
229 var linkFound = event.dataTransfer.types.contains("text/uri-list");
231 event.preventDefault();
234 function linkdrop(event) {
235 var reply = event.dataTransfer.getData("text/uri-list");
236 event.target.textContent = reply;
237 event.preventDefault();
238 if(reply && reply.length) {
239 reply = bin2hex(reply);
240 $('#profile-rotator').show();
241 $.get('parse_url?binurl=' + reply, function(data) {
242 if (!editor) $("#profile-jot-text").val("");
243 initEditor(function(){
244 tinyMCE.execCommand('mceInsertRawHTML',false,data);
245 $('#profile-rotator').hide();
251 function jotClearLocation() {
252 $('#jot-coord').val('');
253 $('#profile-nolocation-wrapper').hide();