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();
12 if(plaintext == 'none') {
13 $("#profile-jot-text-loading").hide();
14 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
15 $(".jothidden").show();
17 $("a#jot-perms-icon").fancybox({
18 'transitionIn' : 'elastic',
19 'transitionOut' : 'elastic'
21 $("#profile-jot-submit-wrapper").show();
23 $("#profile-upload-wrapper").show();
24 $("#profile-attach-wrapper").show();
25 $("#profile-link-wrapper").show();
26 $("#profile-video-wrapper").show();
27 $("#profile-audio-wrapper").show();
28 $("#profile-location-wrapper").show();
29 $("#profile-nolocation-wrapper").show();
30 $("#profile-title-wrapper").show();
31 $("#profile-jot-plugin-wrapper").show();
32 $("#jot-preview-link").show();
36 if (typeof cb!="undefined") cb();
41 mode : "specific_textareas",
42 editor_selector: /(profile-jot-text|prvmail-text)/,
43 plugins : "bbcode,paste,fullscreen,autoresize",
44 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
45 theme_advanced_buttons2 : "",
46 theme_advanced_buttons3 : "",
47 theme_advanced_toolbar_location : "top",
48 theme_advanced_toolbar_align : "center",
49 theme_advanced_blockformats : "blockquote,code",
50 //theme_advanced_resizing : true,
51 //theme_advanced_statusbar_location : "bottom",
52 paste_text_sticky : true,
53 entity_encoding : "raw",
54 add_unload_trigger : false,
55 remove_linebreaks : false,
56 force_p_newlines : false,
57 force_br_newlines : true,
58 forced_root_block : '',
60 content_css: "$baseurl/view/custom_tinymce.css",
61 theme_advanced_path : false,
62 setup : function(ed) {
64 ed.onKeyUp.add(function(ed, e) {
65 var txt = tinyMCE.activeEditor.getContent();
67 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
68 $('#profile-jot-desc').html(ispublic);
71 $('#profile-jot-desc').html(' ');
75 $('#character-counter').removeClass('red');
76 $('#character-counter').removeClass('orange');
77 $('#character-counter').addClass('grey');
79 if((textlen > 140) && (textlen <= 420)) {
80 $('#character-counter').removeClass('grey');
81 $('#character-counter').removeClass('red');
82 $('#character-counter').addClass('orange');
85 $('#character-counter').removeClass('grey');
86 $('#character-counter').removeClass('orange');
87 $('#character-counter').addClass('red');
89 $('#character-counter').text(textlen);
91 ed.onInit.add(function(ed) {
92 ed.pasteAsPlainText = true;
93 $("#profile-jot-text-loading").hide();
94 $("#profile-jot-submit-wrapper").show();
95 $("#profile-upload-wrapper").show();
96 $("#profile-attach-wrapper").show();
97 $("#profile-link-wrapper").show();
98 $("#profile-youtube-wrapper").show();
99 $("#profile-video-wrapper").show();
100 $("#profile-audio-wrapper").show();
101 $("#profile-location-wrapper").show();
102 $("#profile-nolocation-wrapper").show();
103 $("#profile-title-wrapper").show();
104 $("#profile-jot-plugin-wrapper").show();
105 $("#character-counter").show();
106 if (typeof cb!="undefined") cb();
112 $("a#jot-perms-icon").fancybox({
113 'transitionIn' : 'none',
114 'transitionOut' : 'none'
117 if (typeof cb!="undefined") cb();
121 <script type="text/javascript" src="js/ajaxupload.js" ></script>
123 var ispublic = '$ispublic';
124 $(document).ready(function() {
125 /* enable tinymce on focus */
126 $("#profile-jot-text").focus(function(){
132 $("#jot-title").mouseout(function() {
133 $("#jot-title").hide();
134 var ttl = $("#jot-title").val();
135 $('#jot-title-display').html(ttl);
137 $("#jot-title-display").show();
140 $("#jot-title-desc").show();
144 $("#jot-title-display").hover(function() {
145 $("#jot-title-display").hide();
146 $("#jot-title").show();
147 $("#jot-title").focus();
150 $("#jot-title-desc").click(function() {
151 $("#jot-title-desc").hide();
152 $("#jot-title").show();
153 $("#jot-title").focus();
156 var uploader = new window.AjaxUpload(
158 { action: 'wall_upload/$nickname',
160 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
161 onComplete: function(file,response) {
162 addeditortext(response);
163 $('#profile-rotator').hide();
167 var file_uploader = new window.AjaxUpload(
169 { action: 'wall_attach/$nickname',
171 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
172 onComplete: function(file,response) {
173 addeditortext(response);
174 $('#profile-rotator').hide();
178 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
180 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
181 selstr = $(this).text();
182 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
183 $('#jot-public').hide();
184 $('.profile-jot-net input').attr('disabled', 'disabled');
187 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
188 $('#jot-public').show();
189 $('.profile-jot-net input').attr('disabled', false);
192 }).trigger('change');
196 function deleteCheckedItems() {
199 $('.item-select').each( function() {
200 if($(this).is(':checked')) {
201 if(checkedstr.length != 0) {
202 checkedstr = checkedstr + ',' + $(this).val();
205 checkedstr = $(this).val();
209 $.post('item', { dropitems: checkedstr }, function(data) {
210 window.location.reload();
214 function jotGetLink() {
215 reply = prompt("$linkurl");
216 if(reply && reply.length) {
217 reply = bin2hex(reply);
218 $('#profile-rotator').show();
219 $.get('parse_url?binurl=' + reply, function(data) {
221 $('#profile-rotator').hide();
226 function jotGetVideo() {
227 reply = prompt("$utubeurl");
228 if(reply && reply.length) {
229 addeditortext('[youtube]' + reply + '[/youtube]');
233 function jotVideoURL() {
234 reply = prompt("$vidurl");
235 if(reply && reply.length) {
236 addeditortext('[video]' + reply + '[/video]');
240 function jotAudioURL() {
241 reply = prompt("$audurl");
242 if(reply && reply.length) {
243 addeditortext('[audio]' + reply + '[/audio]');
248 function jotGetLocation() {
249 reply = prompt("$whereareu", $('#jot-location').val());
250 if(reply && reply.length) {
251 $('#jot-location').val(reply);
255 function jotTitle() {
256 reply = prompt("$title", $('#jot-title').val());
257 if(reply && reply.length) {
258 $('#jot-title').val(reply);
262 function jotShare(id) {
263 $('#like-rotator-' + id).show();
264 $.get('share/' + id, function(data) {
265 if (!editor) $("#profile-jot-text").val("");
266 initEditor(function(){
268 $('#like-rotator-' + id).hide();
269 $(window).scrollTop(0);
274 function linkdropper(event) {
275 var linkFound = event.dataTransfer.types.contains("text/uri-list");
277 event.preventDefault();
280 function linkdrop(event) {
281 var reply = event.dataTransfer.getData("text/uri-list");
282 event.target.textContent = reply;
283 event.preventDefault();
284 if(reply && reply.length) {
285 reply = bin2hex(reply);
286 $('#profile-rotator').show();
287 $.get('parse_url?binurl=' + reply, function(data) {
288 if (!editor) $("#profile-jot-text").val("");
289 initEditor(function(){
291 $('#profile-rotator').hide();
297 function jotClearLocation() {
298 $('#jot-coord').val('');
299 $('#profile-nolocation-wrapper').hide();
302 function addeditortext(data) {
303 if(plaintext == 'none') {
304 var currentText = $("#profile-jot-text").val();
305 $("#profile-jot-text").val(currentText + data);
308 tinyMCE.execCommand('mceInsertRawHTML',false,data);