2 <script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script>
5 var ispublic = '$ispublic';
7 $(document).ready(function() {
9 /* enable tinymce on focus and click */
10 $("#profile-jot-text").focus(enableOnUser);
11 $("#profile-jot-text").click(enableOnUser);
13 var uploader = new window.AjaxUpload(
15 { action: 'wall_upload/$nickname',
17 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
18 onComplete: function(file,response) {
19 addeditortext(response);
20 $('#profile-rotator').hide();
24 var file_uploader = new window.AjaxUpload(
26 { action: 'wall_attach/$nickname',
28 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
29 onComplete: function(file,response) {
30 addeditortext(response);
31 $('#profile-rotator').hide();
39 /* function deleteCheckedItems() {
42 $('.item-select').each( function() {
43 if($(this).is(':checked')) {
44 if(checkedstr.length != 0) {
45 checkedstr = checkedstr + ',' + $(this).val();
48 checkedstr = $(this).val();
52 $.post('item', { dropitems: checkedstr }, function(data) {
53 window.location.reload();
57 function jotGetLink() {
58 reply = prompt("$linkurl");
59 if(reply && reply.length) {
60 reply = bin2hex(reply);
61 $('#profile-rotator').show();
62 $.get('parse_url?binurl=' + reply, function(data) {
64 $('#profile-rotator').hide();
69 function jotVideoURL() {
70 reply = prompt("$vidurl");
71 if(reply && reply.length) {
72 addeditortext('[video]' + reply + '[/video]');
76 function jotAudioURL() {
77 reply = prompt("$audurl");
78 if(reply && reply.length) {
79 addeditortext('[audio]' + reply + '[/audio]');
84 function jotGetLocation() {
85 reply = prompt("$whereareu", $('#jot-location').val());
86 if(reply && reply.length) {
87 $('#jot-location').val(reply);
91 function jotShare(id) {
92 if ($('#jot-popup').length != 0) $('#jot-popup').show();
94 $('#like-rotator-' + id).show();
95 $.get('share/' + id, function(data) {
96 if (!editor) $("#profile-jot-text").val("");
97 initEditor(function(){
99 $('#like-rotator-' + id).hide();
100 $(window).scrollTop(0);
106 /* function linkdropper(event) {
107 var linkFound = event.dataTransfer.types.contains("text/uri-list");
109 event.preventDefault();
112 function linkdrop(event) {
113 var reply = event.dataTransfer.getData("text/uri-list");
114 event.target.textContent = reply;
115 event.preventDefault();
116 if(reply && reply.length) {
117 reply = bin2hex(reply);
118 $('#profile-rotator').show();
119 $.get('parse_url?binurl=' + reply, function(data) {
120 if (!editor) $("#profile-jot-text").val("");
121 initEditor(function(){
123 $('#profile-rotator').hide();
129 function itemTag(id) {
130 reply = prompt("$term");
131 if(reply && reply.length) {
132 reply = reply.replace('#','');
136 $('body').css('cursor', 'wait');
138 $.get('tagger/' + id + '?term=' + reply);
139 if(timer) clearTimeout(timer);
140 timer = setTimeout(NavUpdate,3000);
146 function itemFiler(id) {
148 $.get('filer/', function(data){
150 var promptText = $('#id_term_label', data).text();
152 reply = prompt(promptText);
153 if(reply && reply.length) {
155 $('body').css('cursor', 'wait');
156 $.get('filer/' + id + '?term=' + reply, NavUpdate);
157 /* if(timer) clearTimeout(timer);
158 timer = setTimeout(NavUpdate,3000);*/
160 /* $.fancybox.close();*/
164 /* var bordercolor = $("input").css("border-color");
166 $.get('filer/', function(data){
168 $("#id_term").keypress(function(){
169 $(this).css("border-color",bordercolor);
171 $("#select_term").change(function(){
172 $("#id_term").css("border-color",bordercolor);
175 $("#filer_save").click(function(e){
177 reply = $("#id_term").val();
178 if(reply && reply.length) {
180 $('body').css('cursor', 'wait');
181 $.get('filer/' + id + '?term=' + reply);
182 if(timer) clearTimeout(timer);
183 timer = setTimeout(NavUpdate,3000);
187 $("#id_term").css("border-color","#FF0000");
195 function jotClearLocation() {
196 $('#jot-coord').val('');
197 $('#profile-nolocation-wrapper').hide();
200 function addeditortext(data) {
201 if(plaintext == 'none') {
202 var currentText = $("#profile-jot-text").val();
203 $("#profile-jot-text").val(currentText + data);
206 tinyMCE.execCommand('mceInsertRawHTML',false,data);*/