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").mouseout(function() {
106 $("#jot-title").hide();
107 var ttl = $("#jot-title").val();
108 $('#jot-title-display').html(ttl);
110 $("#jot-title-display").show();
113 $("#jot-title-desc").show();
117 $("#jot-title-display").hover(function() {
118 $("#jot-title-display").hide();
119 $("#jot-title").show();
120 $("#jot-title").focus();
123 $("#jot-title-desc").click(function() {
124 $("#jot-title-desc").hide();
125 $("#jot-title").show();
126 $("#jot-title").focus();
129 var uploader = new window.AjaxUpload(
131 { action: 'wall_upload/$nickname',
133 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
134 onComplete: function(file,response) {
135 tinyMCE.execCommand('mceInsertRawHTML',false,response);
136 $('#profile-rotator').hide();
140 var file_uploader = new window.AjaxUpload(
142 { action: 'wall_attach/$nickname',
144 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
145 onComplete: function(file,response) {
146 tinyMCE.execCommand('mceInsertRawHTML',false,response);
147 $('#profile-rotator').hide();
151 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
153 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
154 selstr = $(this).text();
155 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
156 $('#jot-public').hide();
157 $('.profile-jot-net input').attr('disabled', 'disabled');
160 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
161 $('#jot-public').show();
162 $('.profile-jot-net input').attr('disabled', false);
165 }).trigger('change');
169 function deleteCheckedItems() {
172 $('.item-select').each( function() {
173 if($(this).is(':checked')) {
174 if(checkedstr.length != 0) {
175 checkedstr = checkedstr + ',' + $(this).val();
178 checkedstr = $(this).val();
182 $.post('item', { dropitems: checkedstr }, function(data) {
183 window.location.reload();
187 function jotGetLink() {
188 reply = prompt("$linkurl");
189 if(reply && reply.length) {
190 reply = bin2hex(reply);
191 $('#profile-rotator').show();
192 $.get('parse_url?binurl=' + reply, function(data) {
193 tinyMCE.execCommand('mceInsertRawHTML',false,data);
194 $('#profile-rotator').hide();
199 function jotGetVideo() {
200 reply = prompt("$utubeurl");
201 if(reply && reply.length) {
202 tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
206 function jotVideoURL() {
207 reply = prompt("$vidurl");
208 if(reply && reply.length) {
209 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
213 function jotAudioURL() {
214 reply = prompt("$audurl");
215 if(reply && reply.length) {
216 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
221 function jotGetLocation() {
222 reply = prompt("$whereareu", $('#jot-location').val());
223 if(reply && reply.length) {
224 $('#jot-location').val(reply);
228 function jotTitle() {
229 reply = prompt("$title", $('#jot-title').val());
230 if(reply && reply.length) {
231 $('#jot-title').val(reply);
235 function jotShare(id) {
236 $('#like-rotator-' + id).show();
237 $.get('share/' + id, function(data) {
238 if (!editor) $("#profile-jot-text").val("");
239 initEditor(function(){
240 tinyMCE.execCommand('mceInsertRawHTML',false,data);
241 $('#like-rotator-' + id).hide();
242 $(window).scrollTop(0);
247 function linkdropper(event) {
248 var linkFound = event.dataTransfer.types.contains("text/uri-list");
250 event.preventDefault();
253 function linkdrop(event) {
254 var reply = event.dataTransfer.getData("text/uri-list");
255 event.target.textContent = reply;
256 event.preventDefault();
257 if(reply && reply.length) {
258 reply = bin2hex(reply);
259 $('#profile-rotator').show();
260 $.get('parse_url?binurl=' + reply, function(data) {
261 if (!editor) $("#profile-jot-text").val("");
262 initEditor(function(){
263 tinyMCE.execCommand('mceInsertRawHTML',false,data);
264 $('#profile-rotator').hide();
270 function jotClearLocation() {
271 $('#jot-coord').val('');
272 $('#profile-nolocation-wrapper').hide();