2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
7 <script language="javascript" type="text/javascript" src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
8 <script language="javascript" type="text/javascript">
12 var plaintext = '{{$editselect}}';
14 function initEditor(cb) {
16 $("#profile-jot-text-loading").show();
17 if(plaintext == 'none') {
18 $("#profile-jot-text-loading").hide();
19 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
20 $(".jothidden").show();
22 $("a#jot-perms-icon").colorbox({
24 'transition' : 'elastic'
26 $("#profile-jot-submit-wrapper").show();
28 $("#profile-upload-wrapper").show();
29 $("#profile-attach-wrapper").show();
30 $("#profile-link-wrapper").show();
31 $("#profile-video-wrapper").show();
32 $("#profile-audio-wrapper").show();
33 $("#profile-location-wrapper").show();
34 $("#profile-nolocation-wrapper").show();
35 $("#profile-title-wrapper").show();
36 $("#profile-jot-plugin-wrapper").show();
37 $("#jot-preview-link").show();
41 if (typeof cb!="undefined") cb();
46 mode : "specific_textareas",
47 editor_selector: /(profile-jot-text|prvmail-text)/,
48 plugins : "bbcode,paste,fullscreen,autoresize",
49 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
50 theme_advanced_buttons2 : "",
51 theme_advanced_buttons3 : "",
52 theme_advanced_toolbar_location : "top",
53 theme_advanced_toolbar_align : "center",
54 theme_advanced_blockformats : "blockquote,code",
55 //theme_advanced_resizing : true,
56 //theme_advanced_statusbar_location : "bottom",
57 paste_text_sticky : true,
58 entity_encoding : "raw",
59 add_unload_trigger : false,
60 remove_linebreaks : false,
61 //force_p_newlines : false,
62 //force_br_newlines : true,
63 forced_root_block : 'div',
65 content_css: "{{$baseurl}}/view/custom_tinymce.css",
66 theme_advanced_path : false,
67 setup : function(ed) {
69 ed.onKeyDown.add(function(ed,e) {
76 ed.onKeyUp.add(function(ed, e) {
77 var txt = tinyMCE.activeEditor.getContent();
78 match = txt.match(/@([^ \n]+)$/);
81 cPopup = new ACPopup(this,baseurl+"/acl");
83 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
84 if(! cPopup.ready) cPopup = null;
87 if(cPopup !== null) { cPopup.close(); cPopup = null; }
91 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
92 $('#profile-jot-desc').html(ispublic);
95 $('#profile-jot-desc').html(' ');
101 $('#character-counter').removeClass('red');
102 $('#character-counter').removeClass('orange');
103 $('#character-counter').addClass('grey');
105 if((textlen > 140) && (textlen <= 420)) {
106 $('#character-counter').removeClass('grey');
107 $('#character-counter').removeClass('red');
108 $('#character-counter').addClass('orange');
111 $('#character-counter').removeClass('grey');
112 $('#character-counter').removeClass('orange');
113 $('#character-counter').addClass('red');
115 $('#character-counter').text(textlen);
117 ed.onInit.add(function(ed) {
118 ed.pasteAsPlainText = true;
119 $("#profile-jot-text-loading").hide();
120 $(".jothidden").show();
121 $("#profile-jot-submit-wrapper").show();
123 $("#profile-upload-wrapper").show();
124 $("#profile-attach-wrapper").show();
125 $("#profile-link-wrapper").show();
126 $("#profile-video-wrapper").show();
127 $("#profile-audio-wrapper").show();
128 $("#profile-location-wrapper").show();
129 $("#profile-nolocation-wrapper").show();
130 $("#profile-title-wrapper").show();
131 $("#profile-jot-plugin-wrapper").show();
132 $("#jot-preview-link").show();
134 $("#character-counter").show();
135 if (typeof cb!="undefined") cb();
141 $("a#jot-perms-icon").colorbox({
143 'transition' : 'elastic'
146 if (typeof cb!="undefined") cb();
150 <script type="text/javascript" src="js/ajaxupload.js" ></script>
152 var ispublic = '{{$ispublic}}';
153 $(document).ready(function() {
154 /* enable tinymce on focus */
155 $("#profile-jot-text").focus(function(){
162 var uploader = new window.AjaxUpload(
164 { action: 'wall_upload/{{$nickname}}',
166 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
167 onComplete: function(file,response) {
168 addeditortext(response);
169 $('#profile-rotator').hide();
173 var file_uploader = new window.AjaxUpload(
175 { action: 'wall_attach/{{$nickname}}',
177 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
178 onComplete: function(file,response) {
179 addeditortext(response);
180 $('#profile-rotator').hide();
184 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
186 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
187 selstr = $(this).text();
188 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
189 $('#jot-public').hide();
190 $('.profile-jot-net input').attr('disabled', 'disabled');
193 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
194 $('#jot-public').show();
195 $('.profile-jot-net input').attr('disabled', false);
198 }).trigger('change');
202 function deleteCheckedItems() {
203 if(confirm('{{$delitems}}')) {
206 $("#item-delete-selected").hide();
207 $('#item-delete-selected-rotator').show();
209 $('.item-select').each( function() {
210 if($(this).is(':checked')) {
211 if(checkedstr.length != 0) {
212 checkedstr = checkedstr + ',' + $(this).val();
215 checkedstr = $(this).val();
219 $.post('item', { dropitems: checkedstr }, function(data) {
220 window.location.reload();
225 function jotGetLink() {
226 reply = prompt("{{$linkurl}}");
227 if(reply && reply.length) {
228 reply = bin2hex(reply);
229 $('#profile-rotator').show();
230 $.get('parse_url?binurl=' + reply, function(data) {
232 $('#profile-rotator').hide();
237 function jotVideoURL() {
238 reply = prompt("{{$vidurl}}");
239 if(reply && reply.length) {
240 addeditortext('[video]' + reply + '[/video]');
244 function jotAudioURL() {
245 reply = prompt("{{$audurl}}");
246 if(reply && reply.length) {
247 addeditortext('[audio]' + reply + '[/audio]');
252 function jotGetLocation() {
253 reply = prompt("{{$whereareu}}", $('#jot-location').val());
254 if(reply && reply.length) {
255 $('#jot-location').val(reply);
259 function jotTitle() {
260 reply = prompt("{{$title}}", $('#jot-title').val());
261 if(reply && reply.length) {
262 $('#jot-title').val(reply);
266 function jotShare(id) {
267 $('#like-rotator-' + id).show();
268 $.get('share/' + id, function(data) {
269 if (!editor) $("#profile-jot-text").val("");
270 initEditor(function(){
272 $('#like-rotator-' + id).hide();
273 $(window).scrollTop(0);
278 function linkdropper(event) {
279 var linkFound = event.dataTransfer.types.contains("text/uri-list");
281 event.preventDefault();
284 function linkdrop(event) {
285 var reply = event.dataTransfer.getData("text/uri-list");
286 event.target.textContent = reply;
287 event.preventDefault();
288 if(reply && reply.length) {
289 reply = bin2hex(reply);
290 $('#profile-rotator').show();
291 $.get('parse_url?binurl=' + reply, function(data) {
292 if (!editor) $("#profile-jot-text").val("");
293 initEditor(function(){
295 $('#profile-rotator').hide();
301 function itemTag(id) {
302 reply = prompt("{{$term}}");
303 if(reply && reply.length) {
304 reply = reply.replace('#','');
308 $('body').css('cursor', 'wait');
310 $.get('tagger/' + id + '?term=' + reply);
311 if(timer) clearTimeout(timer);
312 timer = setTimeout(NavUpdate,3000);
318 function itemFiler(id) {
320 var bordercolor = $("input").css("border-color");
322 $.get('filer/', function(data){
323 $.colorbox({html:data});
324 $("#id_term").keypress(function(){
325 $(this).css("border-color",bordercolor);
327 $("#select_term").change(function(){
328 $("#id_term").css("border-color",bordercolor);
331 $("#filer_save").click(function(e){
333 reply = $("#id_term").val();
334 if(reply && reply.length) {
336 $('body').css('cursor', 'wait');
337 $.get('filer/' + id + '?term=' + reply);
338 if(timer) clearTimeout(timer);
339 timer = setTimeout(NavUpdate,3000);
343 $("#id_term").css("border-color","#FF0000");
353 function jotClearLocation() {
354 $('#jot-coord').val('');
355 $('#profile-nolocation-wrapper').hide();
358 function addeditortext(data) {
359 if(plaintext == 'none') {
360 var currentText = $("#profile-jot-text").val();
361 $("#profile-jot-text").val(currentText + data);
364 tinyMCE.execCommand('mceInsertRawHTML',false,data);