Ignore:
Timestamp:
Mar 28, 2010, 9:46:21 PM (14 years ago)
Author:
nikrou
Message:

html select tag for applicable categories
show selected thumbnail
prepare localization for gettext

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/akBookStyle/trunk/js/ak_jquery-load.js

    r3876 r5432  
    22    $("a.load")
    33      .bind(ak_mouse_event, function() {
     4          $('table.thumbnails tr td.ncol').each(function() {
     5              if ($(this).hasClass('selected')) {
     6                $(this).removeClass('selected');
     7              }
     8            });
     9
    410          $a = $(this);
    5           try {
    6             $.get($a.attr('href'),{},
    7                   function success(data) {                 
    8                     $('#akPicture')
    9                       .attr('src', data.AK_PIC_SRC)
    10                       .attr('alt', data.AK_PIC_ALT)
    11                       .attr('title', data.AK_PIC_TITLE);
     11          next_thumbnail = $('table.thumbnails a[href='+$(this).attr('href')+']');         
     12          if (next_thumbnail.length==0) {
     13            if ($a.attr('id')=='akNextPicture') {
     14              rel = 'next';
     15            } else {
     16              rel = 'previous';
     17            }
     18            next_link = $('table.thumbnails div.navbar a[rel='+rel+']');
     19            window.location = next_link.attr('href');
     20          } else {
     21            next_thumbnail.parent().parent().parent().addClass('selected');
     22            try {
     23              $.get($a.attr('href'),{},
     24                    function success(data) {               
     25                      $('#akPicture')
     26                        .attr('src', data.AK_PIC_SRC)
     27                        .attr('alt', data.AK_PIC_ALT)
     28                        .attr('title', data.AK_PIC_TITLE);
    1229
    13                     if (data.AK_PREVIOUS) {
    14                       $('#akPreviousPicture')
    15                         .removeClass('hide')
    16                         .attr('href', data.AK_PREVIOUS);
    17                     } else {
    18                       $('#akPreviousPicture').addClass('hide');
    19                     }
    20                     if (data.AK_NEXT) {
    21                       $('#akNextPicture')
    22                         .removeClass('hide')
    23                         .attr('href', data.AK_NEXT);
    24                     } else {
    25                       $('#akNextPicture').addClass('hide');
    26                     }
    27                     $a.click(function(e) { e.preventDefault();});
    28                   },
    29                   'json');         
    30           } catch (e) {
    31             // alert(e);
    32           }
     30                      if (data.AK_PREVIOUS) {
     31                        $('#akPreviousPicture')
     32                          .removeClass('hide')
     33                          .attr('href', data.AK_PREVIOUS);
     34                      } else {
     35                        $('#akPreviousPicture').addClass('hide');
     36                      }
     37                      if (data.AK_NEXT) {
     38                        $('#akNextPicture')
     39                          .removeClass('hide')
     40                          .attr('href', data.AK_NEXT);
     41                      } else {
     42                        $('#akNextPicture').addClass('hide');
     43                      }
     44                      $a.click(function(e) { e.preventDefault();});
     45                    },
     46                    'json');       
     47            } catch (e) {}
     48          }
    3349          return false;
    3450        });
Note: See TracChangeset for help on using the changeset viewer.