1 GB_showFullScreenSet = function(set, start_index, callback_fn) {
7 var gb_sets = new GB_Sets(options, set);
8 gb_sets.addCallback(callback_fn);
9 gb_sets.showSet(start_index-1);
13 GB_showImageSet = function(set, start_index, callback_fn) {
21 var gb_sets = new GB_Sets(options, set);
22 gb_sets.addCallback(callback_fn);
23 gb_sets.showSet(start_index-1);
27 GB_Sets = GB_Gallery.extend({
28 init: function(options, set) {
30 if(!this.img_next) this.img_next = this.root_dir + 'next.gif';
31 if(!this.img_prev) this.img_prev = this.root_dir + 'prev.gif';
32 this.current_set = set;
35 showSet: function(start_index) {
36 this.current_index = start_index;
38 var item = this.current_set[this.current_index];
40 this._setCaption(item.caption);
42 this.btn_prev = AJS.IMG({'class': 'left', src: this.img_prev});
43 this.btn_next = AJS.IMG({'class': 'right', src: this.img_next});
45 AJS.AEV(this.btn_prev, 'click', AJS.$b(this.switchPrev, this));
46 AJS.AEV(this.btn_next, 'click', AJS.$b(this.switchNext, this));
48 GB_STATUS = AJS.SPAN({'class': 'GB_navStatus'});
49 AJS.ACN(AJS.$('GB_middle'), this.btn_prev, GB_STATUS, this.btn_next);
54 updateStatus: function() {
55 AJS.setHTML(GB_STATUS, (this.current_index + 1) + ' / ' + this.current_set.length);
56 if(this.current_index == 0) {
57 AJS.addClass(this.btn_prev, 'disabled');
60 AJS.removeClass(this.btn_prev, 'disabled');
63 if(this.current_index == this.current_set.length-1) {
64 AJS.addClass(this.btn_next, 'disabled');
67 AJS.removeClass(this.btn_next, 'disabled');
71 _setCaption: function(caption) {
72 AJS.setHTML(AJS.$('GB_caption'), caption);
75 updateFrame: function() {
76 var item = this.current_set[this.current_index];
77 this._setCaption(item.caption);
82 switchPrev: function() {
83 if(this.current_index != 0) {
90 switchNext: function() {
91 if(this.current_index != this.current_set.length-1) {
99 AJS.AEV(window, 'load', function() {
100 AJS.preloadImages(GB_ROOT_DIR+'next.gif', GB_ROOT_DIR+'prev.gif');