]> git.mxchange.org Git - friendica.git/blob - view/theme/frost/js/main.js
toggle mobile on all themes; Frost updates
[friendica.git] / view / theme / frost / js / main.js
1
2   function openClose(theID) {
3     if(document.getElementById(theID).style.display == "block") { 
4       document.getElementById(theID).style.display = "none" 
5     }
6     else { 
7       document.getElementById(theID).style.display = "block" 
8     } 
9   }
10
11   function openMenu(theID) {
12       document.getElementById(theID).style.display = "block" 
13   }
14
15   function closeMenu(theID) {
16       document.getElementById(theID).style.display = "none" 
17   }
18
19
20
21         var src = null;
22         var prev = null;
23         var livetime = null;
24         var msie = false;
25         var stopped = false;
26         var totStopped = false;
27         var timer = null;
28         var pr = 0;
29         var liking = 0;
30         var in_progress = false;
31         var langSelect = false;
32         var commentBusy = false;
33         var last_popup_menu = null;
34         var last_popup_button = null;
35
36         $j(function() {
37                 $j.ajaxSetup({cache: false});
38
39                 msie = $j.browser.msie ;
40                 
41                 /* setup tooltips *//*
42                 $j("a,.tt").each(function(){
43                         var e = $j(this);
44                         var pos="bottom";
45                         if (e.hasClass("tttop")) pos="top";
46                         if (e.hasClass("ttbottom")) pos="bottom";
47                         if (e.hasClass("ttleft")) pos="left";
48                         if (e.hasClass("ttright")) pos="right";
49                         e.tipTip({defaultPosition: pos, edgeOffset: 8});
50                 });*/
51                 
52                 
53                 
54                 /* setup onoff widgets */
55                 $j(".onoff input").each(function(){
56                         val = $j(this).val();
57                         id = $j(this).attr("id");
58                         $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
59                         
60                 });
61                 $j(".onoff > a").click(function(event){
62                         event.preventDefault(); 
63                         var input = $j(this).siblings("input");
64                         var val = 1-input.val();
65                         var id = input.attr("id");
66                         $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
67                         $j("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
68                         input.val(val);
69                         //console.log(id);
70                 });
71                 
72                 /* setup field_richtext */
73                 setupFieldRichtext();
74
75                 /* popup menus */
76                 function close_last_popup_menu(e) {
77
78                         if( last_popup_menu ) {
79                                 if( '#' + last_popup_menu.attr('id') !== $j(e.target).attr('rel')) {
80                                         last_popup_menu.hide();
81                                         last_popup_button.removeClass("selected");
82                                         last_popup_menu = null;
83                                         last_popup_button = null;
84                                 }
85                         }
86                 }
87                 $j('a[rel^=#]').click(function(e){
88
89                         close_last_popup_menu(e);
90                         menu = $j( $j(this).attr('rel') );
91                         e.preventDefault();
92                         e.stopPropagation();
93
94                         if (menu.attr('popup')=="false") return false;
95
96                         $j(this).parent().toggleClass("selected");
97                         menu.slideToggle('fast');
98
99                         if (menu.css("display") == "none") {
100                                 last_popup_menu = null;
101                                 last_popup_button = null;
102                         } else {
103                                 last_popup_menu = menu;
104                                 last_popup_button = $j(this).parent();
105                         }
106                         return false;
107                 });
108                 $j('html').click(function(e) {
109                         close_last_popup_menu(e);
110                 });
111                 
112                 // fancyboxes
113                 $j("a.popupbox").fancybox({
114                         'transitionIn' : 'none',
115                         'transitionOut' : 'none'
116                 });
117                 
118
119                 /* notifications template */
120                 var notifications_tpl= unescape($j("#nav-notifications-template[rel=template]").html());
121                 var notifications_all = unescape($j('<div>').append( $j("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
122                 var notifications_mark = unescape($j('<div>').append( $j("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
123                 var notifications_empty = unescape($j("#nav-notifications-menu").html());
124                 
125                 /* nav update event  */
126                 $j('nav').bind('nav-update', function(e,data){;
127                         var invalid = $j(data).find('invalid').text();
128                         if(invalid == 1) { window.location.href=window.location.href }
129
130                         var net = $j(data).find('net').text();
131                         if(net == 0) { net = ''; $j('#net-update').removeClass('show') } else { $j('#net-update').addClass('show') }
132                         $j('#net-update').html(net);
133
134                         var home = $j(data).find('home').text();
135                         if(home == 0) { home = '';  $j('#home-update').removeClass('show') } else { $j('#home-update').addClass('show') }
136                         $j('#home-update').html(home);
137                         
138                         var intro = $j(data).find('intro').text();
139                         if(intro == 0) { intro = '';  $j('#intro-update').removeClass('show') } else { $j('#intro-update').addClass('show') }
140                         $j('#intro-update').html(intro);
141
142                         var mail = $j(data).find('mail').text();
143                         if(mail == 0) { mail = '';  $j('#mail-update').removeClass('show') } else { $j('#mail-update').addClass('show') }
144                         $j('#mail-update').html(mail);
145                         
146                         var intro = $j(data).find('intro').text();
147                         if(intro == 0) { intro = '';  $j('#intro-update-li').removeClass('show') } else { $j('#intro-update-li').addClass('show') }
148                         $j('#intro-update-li').html(intro);
149
150                         var mail = $j(data).find('mail').text();
151                         if(mail == 0) { mail = '';  $j('#mail-update-li').removeClass('show') } else { $j('#mail-update-li').addClass('show') }
152                         $j('#mail-update-li').html(mail);
153
154                         var eNotif = $j(data).find('notif')
155                         
156                         if (eNotif.children("note").length==0){
157                                 $j("#nav-notifications-menu").html(notifications_empty);
158                         } else {
159                                 nnm = $j("#nav-notifications-menu");
160                                 nnm.html(notifications_all + notifications_mark);
161                                 //nnm.attr('popup','true');
162                                 eNotif.children("note").each(function(){
163                                         e = $j(this);
164                                         text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
165                                         html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
166                                         nnm.append(html);
167                                 });
168                         }
169                         notif = eNotif.attr('count');
170                         if (notif>0){
171                                 $j("#nav-notifications-linkmenu").addClass("on");
172                         } else {
173                                 $j("#nav-notifications-linkmenu").removeClass("on");
174                         }
175                         if(notif == 0) { notif = ''; $j('#notify-update').removeClass('show') } else { $j('#notify-update').addClass('show') }
176                         $j('#notify-update').html(notif);
177                         
178                         var eSysmsg = $j(data).find('sysmsgs');
179                         eSysmsg.children("notice").each(function(){
180                                 text = $j(this).text();
181                                 $j.jGrowl(text, { sticky: false, theme: 'notice', life: 3000 }); // originally: sticky: true,
182                         });
183                         eSysmsg.children("info").each(function(){
184                                 text = $j(this).text();
185                                 $j.jGrowl(text, { sticky: false, theme: 'info', life: 1000 });
186                         });
187                         
188                 });
189                 
190                 
191                 NavUpdate(); 
192                 // Allow folks to stop the ajax page updates with the pause/break key
193                 $j(document).keydown(function(event) {
194                         if(event.keyCode == '8') {
195                                 var target = event.target || event.srcElement;
196                                 if (!/input|textarea/i.test(target.nodeName)) {
197                                         return false;
198                                 }
199                         }
200                         if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
201                                 event.preventDefault();
202                                 if(stopped == false) {
203                                         stopped = true;
204                                         if (event.ctrlKey) {
205                                                 totStopped = true;
206                                         }
207                                         $j('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
208                                 } else {
209                                         unpause();
210                                 }
211                         } else {
212                                 if (!totStopped) {
213                                         unpause();
214                                 }
215                         }
216                 });
217                 
218                 
219         });
220
221         function NavUpdate() {
222
223                 if(! stopped) {
224                         var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
225                         $j.get(pingCmd,function(data) {
226                                 $j(data).find('result').each(function() {
227                                         // send nav-update event
228                                         $j('nav').trigger('nav-update', this);
229                                         
230                                         
231                                         // start live update
232
233                                         
234
235                                         if($j('#live-network').length)   { src = 'network'; liveUpdate(); }
236                                         if($j('#live-profile').length)   { src = 'profile'; liveUpdate(); }
237                                         if($j('#live-community').length) { src = 'community'; liveUpdate(); }
238                                         if($j('#live-notes').length)     { src = 'notes'; liveUpdate(); }
239                                         if($j('#live-display').length) {
240                                                 if(liking) {
241                                                         liking = 0;
242                                                         window.location.href=window.location.href 
243                                                 }
244                                         }
245                                         if($j('#live-photos').length) {
246                                                 if(liking) {
247                                                         liking = 0;
248                                                         window.location.href=window.location.href 
249                                                 }
250                                         }
251
252                                         
253                                         
254                                         
255                                 });
256                         }) ;
257                 }
258                 timer = setTimeout(NavUpdate,updateInterval);
259         }
260
261         function liveUpdate() {
262                 if((src == null) || (stopped) || (! profile_uid)) { $j('.like-rotator').hide(); return; }
263                 if(($j('.comment-edit-text-full').length) || (in_progress)) {
264                         if(livetime) {
265                                 clearTimeout(livetime);
266                         }
267                         livetime = setTimeout(liveUpdate, 10000);
268                         return;
269                 }
270                 if(livetime != null)
271                         livetime = null;
272
273                 prev = 'live-' + src;
274
275                 in_progress = true;
276                 var udargs = ((netargs.length) ? '/' + netargs : '');
277                 var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
278
279                 $j.get(update_url,function(data) {
280                         in_progress = false;
281                         //                      $j('.collapsed-comments',data).each(function() {
282                         //      var ident = $j(this).attr('id');
283                         //      var is_hidden = $j('#' + ident).is(':hidden');
284                         //      if($j('#' + ident).length) {
285                         //              $j('#' + ident).replaceWith($j(this));
286                         //              if(is_hidden)
287                         //                      $j('#' + ident).hide();
288                         //      }
289                         //});
290
291                         // add a new thread
292
293                         $j('.toplevel_item',data).each(function() {
294                                 var ident = $j(this).attr('id');
295
296                                 if($j('#' + ident).length == 0 && profile_page == 1) {
297                                         $j('img',this).each(function() {
298                                                 $j(this).attr('src',$j(this).attr('dst'));
299                                         });
300                                         $j('#' + prev).after($j(this));
301                                 }
302                                 else {
303                                         $j('img',this).each(function() {
304                                                 $j(this).attr('src',$j(this).attr('dst'));
305                                         });
306                                         $j('#' + ident).replaceWith($j(this));
307                                 }
308                                 prev = ident;
309                         });
310
311                         // reset vars for inserting individual items
312
313                         /*prev = 'live-' + src;
314
315                         $j('.wall-item-outside-wrapper',data).each(function() {
316                                 var ident = $j(this).attr('id');
317
318                                 if($j('#' + ident).length == 0 && prev != 'live-' + src) {
319                                                 $j('img',this).each(function() {
320                                                         $j(this).attr('src',$j(this).attr('dst'));
321                                                 });
322                                                 $j('#' + prev).after($j(this));
323                                 }
324                                 else { 
325                                         $j('#' + ident + ' ' + '.wall-item-ago').replaceWith($j(this).find('.wall-item-ago')); 
326                                         if($j('#' + ident + ' ' + '.comment-edit-text-empty').length)
327                                                 $j('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($j(this).find('.wall-item-comment-wrapper'));
328                                         $j('#' + ident + ' ' + '.hide-comments-total').replaceWith($j(this).find('.hide-comments-total'));
329                                         $j('#' + ident + ' ' + '.wall-item-like').replaceWith($j(this).find('.wall-item-like'));
330                                         $j('#' + ident + ' ' + '.wall-item-dislike').replaceWith($j(this).find('.wall-item-dislike'));
331                                         $j('#' + ident + ' ' + '.my-comment-photo').each(function() {
332                                                 $j(this).attr('src',$j(this).attr('dst'));
333                                         });
334                                 }
335                                 prev = ident; 
336                         });*/
337                         
338                         $j('.like-rotator').hide();
339                         if(commentBusy) {
340                                 commentBusy = false;
341                                 $j('body').css('cursor', 'auto');
342                         }
343                         /* autocomplete @nicknames */
344                         $j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
345
346                         var bimgs = $j(".wall-item-body > img").not(function() { return this.complete; });
347                         var bimgcount = bimgs.length;
348
349                         if (bimgcount) {
350                                 bimgs.load(function() {
351                                         bimgcount--;
352                                         if (! bimgcount) {
353                                                 collapseHeight();
354
355                                         }
356                                 });
357                         } else {
358                                 collapseHeight();
359                         }
360
361                 });
362         }
363
364         function collapseHeight() {
365                 $j(".wall-item-body").each(function() {
366                                 if($j(this).height() > 410) {
367                                 if(! $j(this).hasClass('divmore')) {
368                                         $j(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 300 });
369                                         $j(this).addClass('divmore');
370                                 }
371                         }                                       
372                 });
373         }
374
375         function imgbright(node) {
376                 $j(node).removeClass("drophide").addClass("drop");
377         }
378
379         function imgdull(node) {
380                 $j(node).removeClass("drop").addClass("drophide");
381         }
382
383         // Since our ajax calls are asynchronous, we will give a few 
384         // seconds for the first ajax call (setting like/dislike), then 
385         // run the updater to pick up any changes and display on the page.
386         // The updater will turn any rotators off when it's done. 
387         // This function will have returned long before any of these
388         // events have completed and therefore there won't be any
389         // visible feedback that anything changed without all this
390         // trickery. This still could cause confusion if the "like" ajax call
391         // is delayed and NavUpdate runs before it completes.
392
393         function dolike(ident,verb) {
394                 unpause();
395                 $j('#like-rotator-' + ident.toString()).show();
396                 $j.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
397 //              if(timer) clearTimeout(timer);
398 //              timer = setTimeout(NavUpdate,3000);
399                 liking = 1;
400         }
401
402         function dostar(ident) {
403                 ident = ident.toString();
404 //              $j('#like-rotator-' + ident).show();
405                 $j.get('starred/' + ident, function(data) {
406                         if(data.match(/1/)) {
407                                 $j('#starred-' + ident).addClass('starred');
408                                 $j('#starred-' + ident).removeClass('unstarred');
409                                 $j('#star-' + ident).addClass('hidden');
410                                 $j('#unstar-' + ident).removeClass('hidden');
411                         }
412                         else {                  
413                                 $j('#starred-' + ident).addClass('unstarred');
414                                 $j('#starred-' + ident).removeClass('starred');
415                                 $j('#star-' + ident).removeClass('hidden');
416                                 $j('#unstar-' + ident).addClass('hidden');
417                         }
418 //                      $j('#like-rotator-' + ident).hide();    
419                 });
420         }
421
422         function getPosition(e) {
423                 var cursor = {x:0, y:0};
424                 if ( e.pageX || e.pageY  ) {
425                         cursor.x = e.pageX;
426                         cursor.y = e.pageY;
427                 }
428                 else {
429                         if( e.clientX || e.clientY ) {
430                                 cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
431                                 cursor.y = e.clientY + (document.documentElement.scrollTop  || document.body.scrollTop)  - document.documentElement.clientTop;
432                         }
433                         else {
434                                 if( e.x || e.y ) {
435                                         cursor.x = e.x;
436                                         cursor.y = e.y;
437                                 }
438                         }
439                 }
440                 return cursor;
441         }
442
443         var lockvisible = false;
444
445         function lockview(event,id) {
446                 event = event || window.event;
447                 cursor = getPosition(event);
448                 if(lockvisible) {
449                         lockviewhide();
450                 }
451                 else {
452                         lockvisible = true;
453                         $j.get('lockview/' + id, function(data) {
454                                 $j('#panel').html(data);
455                                 $j('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
456                                 $j('#panel').show();
457                         });
458                 }
459         }
460
461         function lockviewhide() {
462                 lockvisible = false;
463                 $j('#panel').hide();
464         }
465
466         function post_comment(id) {
467                 unpause();
468                 commentBusy = true;
469                 $j('body').css('cursor', 'wait');
470                 $j("#comment-preview-inp-" + id).val("0");
471                 $j.post(  
472              "item",  
473              $j("#comment-edit-form-" + id).serialize(),
474                         function(data) {
475                                 if(data.success) {
476                                         $j("#comment-edit-wrapper-" + id).hide();
477                                         $j("#comment-edit-text-" + id).val('');
478                                 var tarea = document.getElementById("comment-edit-text-" + id);
479                                         if(tarea)
480                                                 commentClose(tarea,id);
481                                         if(timer) clearTimeout(timer);
482                                         timer = setTimeout(NavUpdate,10);
483                                 }
484                                 if(data.reload) {
485                                         window.location.href=data.reload;
486                                 }
487                         },
488                         "json"  
489          );  
490          return false;  
491         }
492
493
494         function preview_comment(id) {
495                 $j("#comment-preview-inp-" + id).val("1");
496                 $j("#comment-edit-preview-" + id).show();
497                 $j.post(  
498              "item",  
499              $j("#comment-edit-form-" + id).serialize(),
500                         function(data) {
501                                 if(data.preview) {
502                                                 
503                                         $j("#comment-edit-preview-" + id).html(data.preview);
504                                         $j("#comment-edit-preview-" + id + " a").click(function() { return false; });
505                                 }
506                         },
507                         "json"  
508          );  
509          return true;  
510         }
511
512
513
514         function preview_post() {
515                 $j("#jot-preview").val("1");
516                 $j("#jot-preview-content").show();
517                 tinyMCE.triggerSave();
518                 $j.post(  
519                         "item",  
520                         $j("#profile-jot-form").serialize(),
521                         function(data) {
522                                 if(data.preview) {                      
523                                         $j("#jot-preview-content").html(data.preview);
524                                         $j("#jot-preview-content" + " a").click(function() { return false; });
525                                 }
526                         },
527                         "json"  
528                 );  
529                 $j("#jot-preview").val("0");
530                 return true;  
531         }
532
533
534         function unpause() {
535                 // unpause auto reloads if they are currently stopped
536                 totStopped = false;
537                 stopped = false;
538             $j('#pause').html('');
539         }
540                 
541
542     function bin2hex(s){  
543         // Converts the binary representation of data to hex    
544         //   
545         // version: 812.316  
546         // discuss at: http://phpjs.org/functions/bin2hex  
547         // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
548         // +   bugfixed by: Onno Marsman  
549         // +   bugfixed by: Linuxworld  
550         // *     example 1: bin2hex('Kev');  
551         // *     returns 1: '4b6576'  
552         // *     example 2: bin2hex(String.fromCharCode(0x00));  
553         // *     returns 2: '00'  
554         var v,i, f = 0, a = [];  
555         s += '';  
556         f = s.length;  
557           
558         for (i = 0; i<f; i++) {  
559             a[i] = s.charCodeAt(i).toString(16).replace(/^([\da-f])$/,"0$1");  
560         }  
561           
562         return a.join('');  
563     }  
564
565         function groupChangeMember(gid, cid, sec_token) {
566                 $j('body .fakelink').css('cursor', 'wait');
567                 $j.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
568                                 $j('#group-update-wrapper').html(data);
569                                 $j('body .fakelink').css('cursor', 'auto');                             
570                 });
571         }
572
573         function profChangeMember(gid,cid) {
574                 $j('body .fakelink').css('cursor', 'wait');
575                 $j.get('profperm/' + gid + '/' + cid, function(data) {
576                                 $j('#prof-update-wrapper').html(data);
577                                 $j('body .fakelink').css('cursor', 'auto');                             
578                 });
579         }
580
581         function contactgroupChangeMember(gid,cid) {
582                 $j('body').css('cursor', 'wait');
583                 $j.get('contactgroup/' + gid + '/' + cid, function(data) {
584                                 $j('body').css('cursor', 'auto');
585                 });
586         }
587
588
589 function checkboxhighlight(box) {
590   if($j(box).is(':checked')) {
591         $j(box).addClass('checkeditem');
592   }
593   else {
594         $j(box).removeClass('checkeditem');
595   }
596 }
597
598 function notifyMarkAll() {
599         $j.get('notify/mark/all', function(data) {
600                 if(timer) clearTimeout(timer);
601                 timer = setTimeout(NavUpdate,1000);
602         });
603 }
604
605
606 // code from http://www.tinymce.com/wiki.php/How-to_implement_a_custom_file_browser
607 function fcFileBrowser (field_name, url, type, win) {
608     /* TODO: If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
609        the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
610        These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
611
612
613     var cmsURL = baseurl+"/fbrowser/"+type+"/";
614
615     tinyMCE.activeEditor.windowManager.open({
616         file : cmsURL,
617         title : 'File Browser',
618         width : 420,  // Your dimensions may differ - toy around with them!
619         height : 400,
620         resizable : "yes",
621         inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
622         close_previous : "no"
623     }, {
624         window : win,
625         input : field_name
626     });
627     return false;
628   }
629
630 function setupFieldRichtext(){
631         tinyMCE.init({
632                 theme : "advanced",
633                 mode : "specific_textareas",
634                 editor_selector: "fieldRichtext",
635                 plugins : "bbcode,paste, inlinepopups",
636                 theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
637                 theme_advanced_buttons2 : "",
638                 theme_advanced_buttons3 : "",
639                 theme_advanced_toolbar_location : "top",
640                 theme_advanced_toolbar_align : "center",
641                 theme_advanced_blockformats : "blockquote,code",
642                 paste_text_sticky : true,
643                 entity_encoding : "raw",
644                 add_unload_trigger : false,
645                 remove_linebreaks : false,
646                 force_p_newlines : false,
647                 force_br_newlines : true,
648                 forced_root_block : '',
649                 convert_urls: false,
650                 content_css: baseurl+"/view/custom_tinymce.css",
651                 theme_advanced_path : false,
652                 file_browser_callback : "fcFileBrowser",
653         });
654 }
655
656
657 /** 
658  * sprintf in javascript 
659  *      "{0} and {1}".format('zero','uno'); 
660  **/
661 String.prototype.format = function() {
662     var formatted = this;
663     for (var i = 0; i < arguments.length; i++) {
664         var regexp = new RegExp('\\{'+i+'\\}', 'gi');
665         formatted = formatted.replace(regexp, arguments[i]);
666     }
667     return formatted;
668 };
669 // Array Remove
670 Array.prototype.remove = function(item) {
671   to=undefined; from=this.indexOf(item);
672   var rest = this.slice((to || from) + 1 || this.length);
673   this.length = from < 0 ? this.length + from : from;
674   return this.push.apply(this, rest);
675 };
676
677 function previewTheme(elm) {
678         theme = $j(elm).val();
679         $j.getJSON('pretheme?f=&theme=' + theme,function(data) {
680                         $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
681         });
682
683 }