2 <script language="javascript" type="text/javascript">
7 function initEditor(cb){
9 $("#profile-jot-text-loading").show();
12 mode : "specific_textareas",
13 editor_selector: /(profile-jot-text|prvmail-text)/,
14 auto_focus: "profile-jot-text",
15 plugins : "bbcode,paste,autoresize",
16 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
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 paste_text_sticky : true,
23 entity_encoding : "raw",
24 add_unload_trigger : false,
25 remove_linebreaks : false,
26 force_p_newlines : false,
27 force_br_newlines : true,
28 forced_root_block : '',
30 content_css: "$baseurl/view/custom_tinymce.css",
31 theme_advanced_path : false,
32 setup : function(ed) {
34 ed.onKeyUp.add(function(ed, e) {
35 var txt = tinyMCE.activeEditor.getContent();
37 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
38 $('#profile-jot-desc').html(ispublic);
41 $('#profile-jot-desc').html(' ');
45 $('#character-counter').removeClass('red');
46 $('#character-counter').removeClass('orange');
47 $('#character-counter').addClass('grey');
49 if((textlen > 140) && (textlen <= 420)) {
50 $('#character-counter').removeClass('grey');
51 $('#character-counter').removeClass('red');
52 $('#character-counter').addClass('orange');
55 $('#character-counter').removeClass('grey');
56 $('#character-counter').removeClass('orange');
57 $('#character-counter').addClass('red');
59 $('#character-counter').text(textlen);
62 ed.onInit.add(function(ed) {
63 ed.pasteAsPlainText = true;
64 $("#profile-jot-text-loading").hide();
65 $("#profile-jot-submit-wrapper").show();
66 if (typeof cb!="undefined") cb();
73 $("a#jot-perms-icon").fancybox({
74 'transitionIn' : 'none',
75 'transitionOut' : 'none'
78 if (typeof cb!="undefined") cb();
83 <script type="text/javascript" src="js/ajaxupload.js" ></script>
85 var ispublic = '$ispublic';
86 $(document).ready(function() {
88 /* enable tinymce on focus */
89 $("#profile-jot-text").focus(function(){
96 var uploader = new window.AjaxUpload(
98 { action: 'wall_upload/$nickname',
100 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
101 onComplete: function(file,response) {
102 tinyMCE.execCommand('mceInsertRawHTML',false,response);
103 $('#profile-rotator').hide();
107 var file_uploader = new window.AjaxUpload(
109 { action: 'wall_attach/$nickname',
111 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
112 onComplete: function(file,response) {
113 tinyMCE.execCommand('mceInsertRawHTML',false,response);
114 $('#profile-rotator').hide();
122 function deleteCheckedItems() {
125 $('.item-select').each( function() {
126 if($(this).is(':checked')) {
127 if(checkedstr.length != 0) {
128 checkedstr = checkedstr + ',' + $(this).val();
131 checkedstr = $(this).val();
135 $.post('item', { dropitems: checkedstr }, function(data) {
136 window.location.reload();
140 function jotGetLink() {
141 reply = prompt("$linkurl");
142 if(reply && reply.length) {
143 reply = bin2hex(reply);
144 $('#profile-rotator').show();
145 $.get('parse_url?binurl=' + reply, function(data) {
146 tinyMCE.execCommand('mceInsertRawHTML',false,data);
147 $('#profile-rotator').hide();
152 function jotVideoURL() {
153 reply = prompt("$vidurl");
154 if(reply && reply.length) {
155 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
159 function jotAudioURL() {
160 reply = prompt("$audurl");
161 if(reply && reply.length) {
162 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
167 function jotGetLocation() {
168 reply = prompt("$whereareu", $('#jot-location').val());
169 if(reply && reply.length) {
170 $('#jot-location').val(reply);
174 function jotTitle() {
175 reply = prompt("$title", $('#jot-title').val());
176 if(reply && reply.length) {
177 $('#jot-title').val(reply);
182 function jotShare(id) {
183 $('#like-rotator-' + id).show();
184 $.get('share/' + id, function(data) {
185 if (!editor) $("#profile-jot-text").val("");
186 initEditor(function(){
187 tinyMCE.execCommand('mceInsertRawHTML',false,data);
188 $('#like-rotator-' + id).hide();
189 $(window).scrollTop(0);
195 function linkdropper(event) {
196 var linkFound = event.dataTransfer.types.contains("text/uri-list");
198 event.preventDefault();
201 function linkdrop(event) {
202 var reply = event.dataTransfer.getData("text/uri-list");
203 event.target.textContent = reply;
204 event.preventDefault();
205 if(reply && reply.length) {
206 $('#profile-rotator').show();
207 $.get('parse_url?url=' + reply, function(data) {
208 if (!editor) $("#profile-jot-text").val("");
209 initEditor(function(){
210 tinyMCE.execCommand('mceInsertRawHTML',false,data);
211 $('#profile-rotator').hide();
217 function jotClearLocation() {
218 $('#jot-coord').val('');
219 $('#profile-nolocation-wrapper').hide();