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 plugins : "bbcode,paste,autoresize",
15 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
16 theme_advanced_buttons2 : "",
17 theme_advanced_buttons3 : "",
18 theme_advanced_toolbar_location : "top",
19 theme_advanced_toolbar_align : "center",
20 theme_advanced_blockformats : "blockquote,code",
21 paste_text_sticky : true,
22 entity_encoding : "raw",
23 add_unload_trigger : false,
24 remove_linebreaks : false,
25 force_p_newlines : false,
26 force_br_newlines : true,
27 forced_root_block : '',
29 content_css: "$baseurl/view/custom_tinymce.css",
30 theme_advanced_path : false,
31 setup : function(ed) {
33 ed.onKeyUp.add(function(ed, e) {
34 var txt = tinyMCE.activeEditor.getContent();
36 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
37 $('#profile-jot-desc').html(ispublic);
40 $('#profile-jot-desc').html(' ');
44 $('#character-counter').removeClass('red');
45 $('#character-counter').removeClass('orange');
46 $('#character-counter').addClass('grey');
48 if((textlen > 140) && (textlen <= 420)) {
49 $('#character-counter').removeClass('grey');
50 $('#character-counter').removeClass('red');
51 $('#character-counter').addClass('orange');
54 $('#character-counter').removeClass('grey');
55 $('#character-counter').removeClass('orange');
56 $('#character-counter').addClass('red');
58 $('#character-counter').text(textlen);
61 ed.onInit.add(function(ed) {
62 ed.pasteAsPlainText = true;
63 $("#profile-jot-text-loading").hide();
64 $("#profile-jot-submit-wrapper").show();
65 if (typeof cb!="undefined") cb();
72 $("a#jot-perms-icon").fancybox({
73 'transitionIn' : 'none',
74 'transitionOut' : 'none'
77 if (typeof cb!="undefined") cb();
82 <script type="text/javascript" src="include/ajaxupload.js" ></script>
84 var ispublic = '$ispublic';
85 $(document).ready(function() {
87 /* enable tinymce on focus */
88 $("#profile-jot-text").focus(function(){
95 var uploader = new window.AjaxUpload(
97 { action: 'wall_upload/$nickname',
99 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
100 onComplete: function(file,response) {
101 tinyMCE.execCommand('mceInsertRawHTML',false,response);
102 $('#profile-rotator').hide();
106 var file_uploader = new window.AjaxUpload(
108 { action: 'wall_attach/$nickname',
110 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
111 onComplete: function(file,response) {
112 tinyMCE.execCommand('mceInsertRawHTML',false,response);
113 $('#profile-rotator').hide();
121 function deleteCheckedItems() {
124 $('.item-select').each( function() {
125 if($(this).is(':checked')) {
126 if(checkedstr.length != 0) {
127 checkedstr = checkedstr + ',' + $(this).val();
130 checkedstr = $(this).val();
134 $.post('item', { dropitems: checkedstr }, function(data) {
135 window.location.reload();
139 function jotGetLink() {
140 reply = prompt("$linkurl");
141 if(reply && reply.length) {
142 reply = bin2hex(reply);
143 $('#profile-rotator').show();
144 $.get('parse_url?url=' + reply, function(data) {
145 tinyMCE.execCommand('mceInsertRawHTML',false,data);
146 $('#profile-rotator').hide();
151 function jotGetVideo() {
152 reply = prompt("$utubeurl");
153 if(reply && reply.length) {
154 tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
158 function jotVideoURL() {
159 reply = prompt("$vidurl");
160 if(reply && reply.length) {
161 tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
165 function jotAudioURL() {
166 reply = prompt("$audurl");
167 if(reply && reply.length) {
168 tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
173 function jotGetLocation() {
174 reply = prompt("$whereareu", $('#jot-location').val());
175 if(reply && reply.length) {
176 $('#jot-location').val(reply);
180 function jotTitle() {
181 reply = prompt("$title", $('#jot-title').val());
182 if(reply && reply.length) {
183 $('#jot-title').val(reply);
188 function jotShare(id) {
189 $('#like-rotator-' + id).show();
190 $.get('share/' + id, function(data) {
191 if (!editor) $("#profile-jot-text").val("");
192 initEditor(function(){
193 tinyMCE.execCommand('mceInsertRawHTML',false,data);
194 $('#like-rotator-' + id).hide();
195 $(window).scrollTop(0);
201 function linkdropper(event) {
202 var linkFound = event.dataTransfer.types.contains("text/uri-list");
204 event.preventDefault();
207 function linkdrop(event) {
208 var reply = event.dataTransfer.getData("text/uri-list");
209 event.target.textContent = reply;
210 event.preventDefault();
211 if(reply && reply.length) {
212 $('#profile-rotator').show();
213 $.get('parse_url?url=' + reply, function(data) {
214 if (!editor) $("#profile-jot-text").val("");
215 initEditor(function(){
216 tinyMCE.execCommand('mceInsertRawHTML',false,data);
217 $('#profile-rotator').hide();
223 function jotClearLocation() {
224 $('#jot-coord').val('');
225 $('#profile-nolocation-wrapper').hide();