2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
6 <script language="javascript" type="text/javascript">
10 var plaintext = '{{$editselect}}';
12 function initEditor(cb){
14 $("#profile-jot-text-loading").show();
15 if(plaintext == 'none') {
16 $("#profile-jot-text-loading").hide();
17 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
18 $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
20 $("a#jot-perms-icon").fancybox({
21 'transitionIn' : 'elastic',
22 'transitionOut' : 'elastic'
24 $(".jothidden").show();
25 if (typeof cb!="undefined") cb();
30 mode : "specific_textareas",
31 editor_selector: {{$editselect}},
32 auto_focus: "profile-jot-text",
33 plugins : "bbcode,paste,autoresize, inlinepopups",
34 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
35 theme_advanced_buttons2 : "",
36 theme_advanced_buttons3 : "",
37 theme_advanced_toolbar_location : "top",
38 theme_advanced_toolbar_align : "center",
39 theme_advanced_blockformats : "blockquote,code",
40 gecko_spellcheck : true,
41 paste_text_sticky : true,
42 entity_encoding : "raw",
43 add_unload_trigger : false,
44 remove_linebreaks : false,
45 force_p_newlines : false,
46 force_br_newlines : true,
47 forced_root_block : '',
49 content_css: "{{$baseurl}}/view/custom_tinymce.css",
50 theme_advanced_path : false,
51 file_browser_callback : "fcFileBrowser",
52 setup : function(ed) {
54 ed.onKeyDown.add(function(ed,e) {
59 ed.onKeyUp.add(function(ed, e) {
60 var txt = tinyMCE.activeEditor.getContent();
61 match = txt.match(/@([^ \n]+)$/);
64 cPopup = new ACPopup(this,baseurl+"/acl");
66 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
67 if(! cPopup.ready) cPopup = null;
70 if(cPopup !== null) { cPopup.close(); cPopup = null; }
74 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
75 $('#profile-jot-desc').html(ispublic);
78 $('#profile-jot-desc').html(' ');
84 $('#character-counter').removeClass('red');
85 $('#character-counter').removeClass('orange');
86 $('#character-counter').addClass('grey');
88 if((textlen > 140) && (textlen <= 420)) {
89 $('#character-counter').removeClass('grey');
90 $('#character-counter').removeClass('red');
91 $('#character-counter').addClass('orange');
94 $('#character-counter').removeClass('grey');
95 $('#character-counter').removeClass('orange');
96 $('#character-counter').addClass('red');
98 $('#character-counter').text(textlen);
101 ed.onInit.add(function(ed) {
102 ed.pasteAsPlainText = true;
103 $("#profile-jot-text-loading").hide();
104 $(".jothidden").show();
105 if (typeof cb!="undefined") cb();
112 $("a#jot-perms-icon").fancybox({
113 'transitionIn' : 'elastic',
114 'transitionOut' : 'elastic'
117 if (typeof cb!="undefined") cb();
121 function enableOnUser(){
128 <script type="text/javascript" src="{{$baseurl}}/js/ajaxupload.js" ></script>
130 var ispublic = '{{$ispublic}}';
132 $(document).ready(function() {
134 /* enable tinymce on focus and click */
135 $("#profile-jot-text").focus(enableOnUser);
136 $("#profile-jot-text").click(enableOnUser);
138 var uploader = new window.AjaxUpload(
140 { action: 'wall_upload/{{$nickname}}',
142 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
143 onComplete: function(file,response) {
144 addeditortext(response);
145 $('#profile-rotator').hide();
149 var file_uploader = new window.AjaxUpload(
151 { action: 'wall_attach/{{$nickname}}',
153 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
154 onComplete: function(file,response) {
155 addeditortext(response);
156 $('#profile-rotator').hide();
164 function deleteCheckedItems() {
165 if(confirm('{{$delitems}}')) {
168 $("#item-delete-selected").hide();
169 $('#item-delete-selected-rotator').show();
171 $('.item-select').each( function() {
172 if($(this).is(':checked')) {
173 if(checkedstr.length != 0) {
174 checkedstr = checkedstr + ',' + $(this).val();
177 checkedstr = $(this).val();
181 $.post('item', { dropitems: checkedstr }, function(data) {
182 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) {
194 $('#profile-rotator').hide();
199 function jotVideoURL() {
200 reply = prompt("{{$vidurl}}");
201 if(reply && reply.length) {
202 addeditortext('[video]' + reply + '[/video]');
206 function jotAudioURL() {
207 reply = prompt("{{$audurl}}");
208 if(reply && reply.length) {
209 addeditortext('[audio]' + reply + '[/audio]');
214 function jotGetLocation() {
215 reply = prompt("{{$whereareu}}", $('#jot-location').val());
216 if(reply && reply.length) {
217 $('#jot-location').val(reply);
221 function jotShare(id) {
222 if ($('#jot-popup').length != 0) $('#jot-popup').show();
224 $('#like-rotator-' + id).show();
225 $.get('share/' + id, function(data) {
226 if (!editor) $("#profile-jot-text").val("");
227 initEditor(function(){
229 $('#like-rotator-' + id).hide();
230 $(window).scrollTop(0);
236 function linkdropper(event) {
237 var linkFound = event.dataTransfer.types.contains("text/uri-list");
239 event.preventDefault();
242 function linkdrop(event) {
243 var reply = event.dataTransfer.getData("text/uri-list");
244 event.target.textContent = reply;
245 event.preventDefault();
246 if(reply && reply.length) {
247 reply = bin2hex(reply);
248 $('#profile-rotator').show();
249 $.get('parse_url?binurl=' + reply, function(data) {
250 if (!editor) $("#profile-jot-text").val("");
251 initEditor(function(){
253 $('#profile-rotator').hide();
259 function itemTag(id) {
260 reply = prompt("{{$term}}");
261 if(reply && reply.length) {
262 reply = reply.replace('#','');
266 $('body').css('cursor', 'wait');
268 $.get('tagger/' + id + '?term=' + reply);
269 if(timer) clearTimeout(timer);
270 timer = setTimeout(NavUpdate,3000);
276 function itemFiler(id) {
278 var bordercolor = $("input").css("border-color");
280 $.get('filer/', function(data){
282 $("#id_term").keypress(function(){
283 $(this).css("border-color",bordercolor);
285 $("#select_term").change(function(){
286 $("#id_term").css("border-color",bordercolor);
289 $("#filer_save").click(function(e){
291 reply = $("#id_term").val();
292 if(reply && reply.length) {
294 $('body').css('cursor', 'wait');
295 $.get('filer/' + id + '?term=' + reply, NavUpdate);
296 // if(timer) clearTimeout(timer);
297 // timer = setTimeout(NavUpdate,3000);
301 $("#id_term").css("border-color","#FF0000");
309 function jotClearLocation() {
310 $('#jot-coord').val('');
311 $('#profile-nolocation-wrapper').hide();
314 function addeditortext(data) {
315 if(plaintext == 'none') {
316 var currentText = $("#profile-jot-text").val();
317 $("#profile-jot-text").val(currentText + data);
320 tinyMCE.execCommand('mceInsertRawHTML',false,data);