2 * AUTOMATICALLY GENERATED TEMPLATE
3 * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
6 <script language="javascript" type="text/javascript" src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
7 <script language="javascript" type="text/javascript">
11 var plaintext = '{{$editselect}}';
13 function initEditor(cb) {
15 $("#profile-jot-text-loading").show();
16 if(plaintext == 'none') {
17 $("#profile-jot-text-loading").hide();
18 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
19 $(".jothidden").show();
21 $("a#jot-perms-icon").fancybox({
22 'transitionIn' : 'elastic',
23 'transitionOut' : 'elastic'
25 $("#profile-jot-submit-wrapper").show();
27 $("#profile-upload-wrapper").show();
28 $("#profile-attach-wrapper").show();
29 $("#profile-link-wrapper").show();
30 $("#profile-video-wrapper").show();
31 $("#profile-audio-wrapper").show();
32 $("#profile-location-wrapper").show();
33 $("#profile-nolocation-wrapper").show();
34 $("#profile-title-wrapper").show();
35 $("#profile-jot-plugin-wrapper").show();
36 $("#jot-preview-link").show();
40 if (typeof cb!="undefined") cb();
45 mode : "specific_textareas",
46 editor_selector: /(profile-jot-text|prvmail-text)/,
47 plugins : "bbcode,paste,fullscreen,autoresize",
48 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen",
49 theme_advanced_buttons2 : "",
50 theme_advanced_buttons3 : "",
51 theme_advanced_toolbar_location : "top",
52 theme_advanced_toolbar_align : "center",
53 theme_advanced_blockformats : "blockquote,code",
54 //theme_advanced_resizing : true,
55 //theme_advanced_statusbar_location : "bottom",
56 paste_text_sticky : true,
57 entity_encoding : "raw",
58 add_unload_trigger : false,
59 remove_linebreaks : false,
60 force_p_newlines : false,
61 force_br_newlines : true,
62 forced_root_block : '',
64 content_css: "{{$baseurl}}/view/custom_tinymce.css",
65 theme_advanced_path : false,
66 setup : function(ed) {
68 ed.onKeyDown.add(function(ed,e) {
75 ed.onKeyUp.add(function(ed, e) {
76 var txt = tinyMCE.activeEditor.getContent();
77 match = txt.match(/@([^ \n]+)$/);
80 cPopup = new ACPopup(this,baseurl+"/acl");
82 if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
83 if(! cPopup.ready) cPopup = null;
86 if(cPopup !== null) { cPopup.close(); cPopup = null; }
90 if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
91 $('#profile-jot-desc').html(ispublic);
94 $('#profile-jot-desc').html(' ');
100 $('#character-counter').removeClass('red');
101 $('#character-counter').removeClass('orange');
102 $('#character-counter').addClass('grey');
104 if((textlen > 140) && (textlen <= 420)) {
105 $('#character-counter').removeClass('grey');
106 $('#character-counter').removeClass('red');
107 $('#character-counter').addClass('orange');
110 $('#character-counter').removeClass('grey');
111 $('#character-counter').removeClass('orange');
112 $('#character-counter').addClass('red');
114 $('#character-counter').text(textlen);
116 ed.onInit.add(function(ed) {
117 ed.pasteAsPlainText = true;
118 $("#profile-jot-text-loading").hide();
119 $(".jothidden").show();
120 $("#profile-jot-submit-wrapper").show();
122 $("#profile-upload-wrapper").show();
123 $("#profile-attach-wrapper").show();
124 $("#profile-link-wrapper").show();
125 $("#profile-video-wrapper").show();
126 $("#profile-audio-wrapper").show();
127 $("#profile-location-wrapper").show();
128 $("#profile-nolocation-wrapper").show();
129 $("#profile-title-wrapper").show();
130 $("#profile-jot-plugin-wrapper").show();
131 $("#jot-preview-link").show();
133 $("#character-counter").show();
134 if (typeof cb!="undefined") cb();
140 $("a#jot-perms-icon").fancybox({
141 'transitionIn' : 'none',
142 'transitionOut' : 'none'
145 if (typeof cb!="undefined") cb();
149 <script type="text/javascript" src="js/ajaxupload.js" ></script>
151 var ispublic = '{{$ispublic}}';
152 $(document).ready(function() {
153 /* enable tinymce on focus */
154 $("#profile-jot-text").focus(function(){
161 var uploader = new window.AjaxUpload(
163 { action: 'wall_upload/{{$nickname}}',
165 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
166 onComplete: function(file,response) {
167 addeditortext(response);
168 $('#profile-rotator').hide();
172 var file_uploader = new window.AjaxUpload(
174 { action: 'wall_attach/{{$nickname}}',
176 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
177 onComplete: function(file,response) {
178 addeditortext(response);
179 $('#profile-rotator').hide();
183 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
185 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
186 selstr = $(this).text();
187 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
188 $('#jot-public').hide();
189 $('.profile-jot-net input').attr('disabled', 'disabled');
192 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
193 $('#jot-public').show();
194 $('.profile-jot-net input').attr('disabled', false);
197 }).trigger('change');
201 function deleteCheckedItems() {
202 if(confirm('{{$delitems}}')) {
205 $("#item-delete-selected").hide();
206 $('#item-delete-selected-rotator').show();
208 $('.item-select').each( function() {
209 if($(this).is(':checked')) {
210 if(checkedstr.length != 0) {
211 checkedstr = checkedstr + ',' + $(this).val();
214 checkedstr = $(this).val();
218 $.post('item', { dropitems: checkedstr }, function(data) {
219 window.location.reload();
224 function jotGetLink() {
225 reply = prompt("{{$linkurl}}");
226 if(reply && reply.length) {
227 reply = bin2hex(reply);
228 $('#profile-rotator').show();
229 $.get('parse_url?binurl=' + reply, function(data) {
231 $('#profile-rotator').hide();
236 function jotVideoURL() {
237 reply = prompt("{{$vidurl}}");
238 if(reply && reply.length) {
239 addeditortext('[video]' + reply + '[/video]');
243 function jotAudioURL() {
244 reply = prompt("{{$audurl}}");
245 if(reply && reply.length) {
246 addeditortext('[audio]' + reply + '[/audio]');
251 function jotGetLocation() {
252 reply = prompt("{{$whereareu}}", $('#jot-location').val());
253 if(reply && reply.length) {
254 $('#jot-location').val(reply);
258 function jotTitle() {
259 reply = prompt("{{$title}}", $('#jot-title').val());
260 if(reply && reply.length) {
261 $('#jot-title').val(reply);
265 function jotShare(id) {
266 $('#like-rotator-' + id).show();
267 $.get('share/' + id, function(data) {
268 if (!editor) $("#profile-jot-text").val("");
269 initEditor(function(){
271 $('#like-rotator-' + id).hide();
272 $(window).scrollTop(0);
277 function linkdropper(event) {
278 var linkFound = event.dataTransfer.types.contains("text/uri-list");
280 event.preventDefault();
283 function linkdrop(event) {
284 var reply = event.dataTransfer.getData("text/uri-list");
285 event.target.textContent = reply;
286 event.preventDefault();
287 if(reply && reply.length) {
288 reply = bin2hex(reply);
289 $('#profile-rotator').show();
290 $.get('parse_url?binurl=' + reply, function(data) {
291 if (!editor) $("#profile-jot-text").val("");
292 initEditor(function(){
294 $('#profile-rotator').hide();
300 function itemTag(id) {
301 reply = prompt("{{$term}}");
302 if(reply && reply.length) {
303 reply = reply.replace('#','');
307 $('body').css('cursor', 'wait');
309 $.get('tagger/' + id + '?term=' + reply);
310 if(timer) clearTimeout(timer);
311 timer = setTimeout(NavUpdate,3000);
317 function itemFiler(id) {
319 var bordercolor = $("input").css("border-color");
321 $.get('filer/', function(data){
323 $("#id_term").keypress(function(){
324 $(this).css("border-color",bordercolor);
326 $("#select_term").change(function(){
327 $("#id_term").css("border-color",bordercolor);
330 $("#filer_save").click(function(e){
332 reply = $("#id_term").val();
333 if(reply && reply.length) {
335 $('body').css('cursor', 'wait');
336 $.get('filer/' + id + '?term=' + reply);
337 if(timer) clearTimeout(timer);
338 timer = setTimeout(NavUpdate,3000);
342 $("#id_term").css("border-color","#FF0000");
352 function jotClearLocation() {
353 $('#jot-coord').val('');
354 $('#profile-nolocation-wrapper').hide();
357 function addeditortext(data) {
358 if(plaintext == 'none') {
359 var currentText = $("#profile-jot-text").val();
360 $("#profile-jot-text").val(currentText + data);
363 tinyMCE.execCommand('mceInsertRawHTML',false,data);