]> git.mxchange.org Git - friendica.git/blob - view/theme/frost-mobile/jot-header.tpl
Merge branch 'master' of github.com:CyberDomovoy/friendica into threaded_items
[friendica.git] / view / theme / frost-mobile / jot-header.tpl
1
2 <script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script>
3
4 <script>
5         var ispublic = '$ispublic';
6
7         $(document).ready(function() {
8                 
9                 /* enable tinymce on focus and click */
10                 $("#profile-jot-text").focus(enableOnUser);
11                 $("#profile-jot-text").click(enableOnUser);
12
13                 var uploader = new window.AjaxUpload(
14                         'wall-image-upload',
15                         { action: 'wall_upload/$nickname',
16                                 name: 'userfile',
17                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
18                                 onComplete: function(file,response) {
19                                         addeditortext(response);
20                                         $('#profile-rotator').hide();
21                                 }                                
22                         }
23                 );
24                 var file_uploader = new window.AjaxUpload(
25                         'wall-file-upload',
26                         { action: 'wall_attach/$nickname',
27                                 name: 'userfile',
28                                 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
29                                 onComplete: function(file,response) {
30                                         addeditortext(response);
31                                         $('#profile-rotator').hide();
32                                 }                                
33                         }
34                 );
35
36
37         });
38
39 /*      function deleteCheckedItems() {
40                 var checkedstr = '';
41
42                 $('.item-select').each( function() {
43                         if($(this).is(':checked')) {
44                                 if(checkedstr.length != 0) {
45                                         checkedstr = checkedstr + ',' + $(this).val();
46                                 }
47                                 else {
48                                         checkedstr = $(this).val();
49                                 }
50                         }       
51                 });
52                 $.post('item', { dropitems: checkedstr }, function(data) {
53                         window.location.reload();
54                 });
55         }*/
56
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) {
63                                 addeditortext(data);
64                                 $('#profile-rotator').hide();
65                         });
66                 }
67         }
68
69         function jotVideoURL() {
70                 reply = prompt("$vidurl");
71                 if(reply && reply.length) {
72                         addeditortext('[video]' + reply + '[/video]');
73                 }
74         }
75
76         function jotAudioURL() {
77                 reply = prompt("$audurl");
78                 if(reply && reply.length) {
79                         addeditortext('[audio]' + reply + '[/audio]');
80                 }
81         }
82
83
84         function jotGetLocation() {
85                 reply = prompt("$whereareu", $('#jot-location').val());
86                 if(reply && reply.length) {
87                         $('#jot-location').val(reply);
88                 }
89         }
90
91         function jotShare(id) {
92                 if ($('#jot-popup').length != 0) $('#jot-popup').show();
93
94                 $('#like-rotator-' + id).show();
95                 $.get('share/' + id, function(data) {
96                         if (!editor) $("#profile-jot-text").val("");
97                         initEditor(function(){
98                                 addeditortext(data);
99                                 $('#like-rotator-' + id).hide();
100                                 $(window).scrollTop(0);
101                         });
102
103                 });
104         }
105
106 /*      function linkdropper(event) {
107                 var linkFound = event.dataTransfer.types.contains("text/uri-list");
108                 if(linkFound)
109                         event.preventDefault();
110         }
111
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(){
122                                         addeditortext(data);
123                                         $('#profile-rotator').hide();
124                                 });
125                         });
126                 }
127         }*/
128
129         function itemTag(id) {
130                 reply = prompt("$term");
131                 if(reply && reply.length) {
132                         reply = reply.replace('#','');
133                         if(reply.length) {
134
135                                 commentBusy = true;
136                                 $('body').css('cursor', 'wait');
137
138                                 $.get('tagger/' + id + '?term=' + reply);
139                                 if(timer) clearTimeout(timer);
140                                 timer = setTimeout(NavUpdate,3000);
141                                 liking = 1;
142                         }
143                 }
144         }
145
146         function itemFiler(id) {
147                 
148                 $.get('filer/', function(data){
149
150                         var promptText = $('#id_term_label', data).text();
151
152                         reply = prompt(promptText);
153                         if(reply && reply.length) {
154                                 commentBusy = true;
155                                 $('body').css('cursor', 'wait');
156                                 $.get('filer/' + id + '?term=' + reply, NavUpdate);
157 /*                              if(timer) clearTimeout(timer);
158                                 timer = setTimeout(NavUpdate,3000);*/
159                                 liking = 1;
160 /*                              $.fancybox.close();*/
161                         }
162                 });
163
164 /*              var bordercolor = $("input").css("border-color");
165                 
166                 $.get('filer/', function(data){
167                         $.fancybox(data);
168                         $("#id_term").keypress(function(){
169                                 $(this).css("border-color",bordercolor);
170                         })
171                         $("#select_term").change(function(){
172                                 $("#id_term").css("border-color",bordercolor);
173                         })
174                         
175                         $("#filer_save").click(function(e){
176                                 e.preventDefault();
177                                 reply = $("#id_term").val();
178                                 if(reply && reply.length) {
179                                         commentBusy = true;
180                                         $('body').css('cursor', 'wait');
181                                         $.get('filer/' + id + '?term=' + reply);
182                                         if(timer) clearTimeout(timer);
183                                         timer = setTimeout(NavUpdate,3000);
184                                         liking = 1;
185                                         $.fancybox.close();
186                                 } else {
187                                         $("#id_term").css("border-color","#FF0000");
188                                 }
189                                 return false;
190                         });
191                 });
192 */              
193         }
194
195         function jotClearLocation() {
196                 $('#jot-coord').val('');
197                 $('#profile-nolocation-wrapper').hide();
198         }
199
200         function addeditortext(data) {
201                 if(plaintext == 'none') {
202                         var currentText = $("#profile-jot-text").val();
203                         $("#profile-jot-text").val(currentText + data);
204                 }
205 /*              else
206                         tinyMCE.execCommand('mceInsertRawHTML',false,data);*/
207         }       
208
209         $geotag
210
211 </script>
212