3 <script language="javascript" type="text/javascript">
8 function initEditor(callback) {
10 $("#profile-jot-text-loading").show();
11 $("#profile-jot-text-loading").hide();
12 $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
13 $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
14 $("#profile-jot-text").bbco_autocomplete('bbcode');
15 $(".jothidden").show();
16 $("a#jot-perms-icon").colorbox({
18 'transition' : 'elastic'
20 $("#profile-jot-submit-wrapper").show();
22 $("#profile-upload-wrapper").show();
23 $("#profile-attach-wrapper").show();
24 $("#profile-link-wrapper").show();
25 $("#profile-video-wrapper").show();
26 $("#profile-audio-wrapper").show();
27 $("#profile-location-wrapper").show();
28 $("#profile-nolocation-wrapper").show();
29 $("#profile-title-wrapper").show();
30 $("#profile-jot-plugin-wrapper").show();
31 $("#jot-preview-link").show();
36 if (typeof callback != "undefined") {
41 function enableOnUser(){
51 <script type="text/javascript" src="view/js/ajaxupload.js" >
55 var ispublic = '{{$ispublic}}';
57 $(document).ready(function() {
59 /* enable editor on focus and click */
60 $("#profile-jot-text").focus(enableOnUser);
61 $("#profile-jot-text").click(enableOnUser);
63 var uploader = new window.AjaxUpload(
65 { action: 'wall_upload/{{$nickname}}',
67 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
68 onComplete: function(file,response) {
69 addeditortext(response);
70 $('#profile-rotator').hide();
75 var file_uploader = new window.AjaxUpload(
77 { action: 'wall_attach/{{$nickname}}',
79 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
80 onComplete: function(file,response) {
81 addeditortext(response);
82 $('#profile-rotator').hide();
86 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
88 $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
89 selstr = $(this).text();
90 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
91 $('#jot-public').hide();
92 $('.profile-jot-net input').attr('disabled', 'disabled');
95 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
96 $('#jot-public').show();
97 $('.profile-jot-net input').attr('disabled', false);
100 }).trigger('change');
104 function deleteCheckedItems() {
105 if(confirm('{{$delitems}}')) {
108 $("#item-delete-selected").hide();
109 $('#item-delete-selected-rotator').show();
111 $('.item-select').each( function() {
112 if($(this).is(':checked')) {
113 if(checkedstr.length != 0) {
114 checkedstr = checkedstr + ',' + $(this).val();
117 checkedstr = $(this).val();
121 $.post('item', { dropitems: checkedstr }, function(data) {
122 window.location.reload();
127 function jotGetLink() {
128 reply = prompt("{{$linkurl}}");
129 if(reply && reply.length) {
130 reply = bin2hex(reply);
131 $('#profile-rotator').show();
132 $.get('parse_url?binurl=' + reply, function(data) {
134 $('#profile-rotator').hide();
139 function jotVideoURL() {
140 reply = prompt("{{$vidurl}}");
141 if(reply && reply.length) {
142 addeditortext('[video]' + reply + '[/video]');
146 function jotAudioURL() {
147 reply = prompt("{{$audurl}}");
148 if(reply && reply.length) {
149 addeditortext('[audio]' + reply + '[/audio]');
154 function jotGetLocation() {
155 reply = prompt("{{$whereareu}}", $('#jot-location').val());
156 if(reply && reply.length) {
157 $('#jot-location').val(reply);
161 function jotTitle() {
162 reply = prompt("{{$title}}", $('#jot-title').val());
163 if(reply && reply.length) {
164 $('#jot-title').val(reply);
168 function jotShare(id) {
169 $('#like-rotator-' + id).show();
170 $.get('share/' + id, function(data) {
171 if (!editor) $("#profile-jot-text").val("");
172 initEditor(function(){
174 $('#like-rotator-' + id).hide();
175 $(window).scrollTop(0);
180 function linkdropper(event) {
181 var linkFound = event.dataTransfer.types.contains("text/uri-list");
183 event.preventDefault();
186 function linkdrop(event) {
187 var reply = event.dataTransfer.getData("text/uri-list");
188 event.target.textContent = reply;
189 event.preventDefault();
190 if(reply && reply.length) {
191 reply = bin2hex(reply);
192 $('#profile-rotator').show();
193 $.get('parse_url?binurl=' + reply, function(data) {
194 if (!editor) $("#profile-jot-text").val("");
195 initEditor(function(){
197 $('#profile-rotator').hide();
203 function itemTag(id) {
204 reply = prompt("{{$term}}");
205 if(reply && reply.length) {
206 reply = reply.replace('#','');
210 $('body').css('cursor', 'wait');
212 $.get('tagger/' + id + '?term=' + reply);
213 if(timer) clearTimeout(timer);
214 timer = setTimeout(NavUpdate,3000);
220 function itemFiler(id) {
222 var bordercolor = $("input").css("border-color");
224 $.get('filer/', function(data){
225 $.colorbox({html:data});
226 $("#id_term").keypress(function(){
227 $(this).css("border-color",bordercolor);
229 $("#select_term").change(function(){
230 $("#id_term").css("border-color",bordercolor);
233 $("#filer_save").click(function(e){
235 reply = $("#id_term").val();
236 if(reply && reply.length) {
238 $('body').css('cursor', 'wait');
239 $.get('filer/' + id + '?term=' + reply, NavUpdate);
240 // if(timer) clearTimeout(timer);
241 // timer = setTimeout(NavUpdate,3000);
245 $("#id_term").css("border-color","#FF0000");
255 function jotClearLocation() {
256 $('#jot-coord').val('');
257 $('#profile-nolocation-wrapper').hide();
260 function addeditortext(data) {
261 var currentText = $("#profile-jot-text").val();
262 $("#profile-jot-text").val(currentText + data);