Dotclear

Changeset 199


Ignore:
Timestamp:
06/14/08 18:41:46 (15 years ago)
Author:
olivier
Message:

Modal and ModalImages? parameters in prototype.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/lightbox/js/modal.js

    r198 r199  
    66      
    77     $.modal = function(data,params) { 
    8           this.params = $.extend({ 
     8          this.params = $.extend(this.params,params); 
     9          return this.build(data); 
     10     }; 
     11     $.modal.version = '1.0'; 
     12      
     13     $.modal.prototype = { 
     14          params: { 
    915               width: null, 
    1016               height: null, 
     
    1521               close_img: 'close.png', 
    1622               close_txt: 'close' 
    17           },params); 
    18            
    19           return this.build(data); 
    20      }; 
    21      $.modal.version = '1.0'; 
    22       
    23      $.modal.prototype = { 
     23          }, 
    2424          ctrl: { 
    2525               box: $(), 
     
    186186(function($) { 
    187187     $.fn.modalImages = function(params) { 
    188           params = $.extend({ 
     188          params = $.extend(this.params,params); 
     189          var links = new Array(); 
     190          this.each(function() { 
     191               if ($(this).attr('href') == '' || $(this).attr('href') == undefined || $(this).attr('href') == '#') { 
     192                    return false; 
     193               } 
     194               var index = links.length; 
     195               links.push($(this)); 
     196               $(this).click(function() { 
     197                    new $.modalImages(index,links,params); 
     198                    return false; 
     199               }); 
     200               return true; 
     201          }); 
     202           
     203          return this; 
     204     }; 
     205      
     206     $.modalImages = function(index,links,params) { 
     207          this.links = links; 
     208          this.modal = new $.modal(null,params); 
     209          this.showImage(index); 
     210     }; 
     211      
     212     $.modalImages.prototype = { 
     213          params: { 
    189214               prev_txt: 'previous', 
    190215               next_txt: 'next', 
     
    192217               next_img: 'next.png', 
    193218               blank_img: 'blank.gif' 
    194           },params); 
    195           var links = new Array(); 
    196           this.each(function() { 
    197                if ($(this).attr('href') == '' || $(this).attr('href') == undefined || $(this).attr('href') == '#') { 
    198                     return false; 
    199                } 
    200                var index = links.length; 
    201                links.push($(this)); 
    202                $(this).click(function() { 
    203                     new $.modalImages(index,links,params); 
    204                     return false; 
    205                }); 
    206                return true; 
    207           }); 
    208            
    209           return this; 
    210      }; 
    211       
    212      $.modalImages = function(index,links,params) { 
    213           this.links = links; 
    214           this.modal = new $.modal(null,params); 
    215           this.showImage(index); 
    216      }; 
    217       
    218      $.modalImages.prototype = { 
     219          }, 
    219220          showImage: function(index) { 
    220221               var This = this; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map