Changeset 51972 in spip-zone
- Timestamp:
- Sep 28, 2011, 10:54:42 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/mediabox/javascript/jquery.colorbox.js
r42391 r51972 293 293 $this.each(function () { 294 294 $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options)); 295 var eltclass = $(this).attr('class') ;295 var eltclass = $(this).attr('class') ? $(this).attr('class') : ' '; 296 296 297 if (eltclass.indexOf("boxWidth-")!==-1) {298 var w = eltclass.match(/boxWidth-([^\s'">]*)/);299 w = w[1].replace(/pc/,'%'); // % not allowed in html attribute ; use 100pc instead of 100%300 $.data(this, colorbox, $.extend($.data(this, colorbox),{width:w}));301 }302 if (eltclass.indexOf("boxHeight-")!==-1) {303 var h = eltclass.match(/boxHeight-([^\s'">]*)/);304 h = h[1].replace(/pc/,'%'); // % not allowed in html attribute ; use 100pc instead of 100%305 $.data(this, colorbox, $.extend($.data(this, colorbox),{height:h}));306 }307 if (eltclass.indexOf("boxIframe")!==-1) {308 $.data(this, colorbox, $.extend($.data(this, colorbox),{iframe:true}));309 }310 if (eltclass.indexOf("boxSlideshow_off")!==-1) {311 $.data(this, colorbox, $.extend($.data(this, colorbox),{slideshow:false}));312 }297 if (eltclass.indexOf("boxWidth-")!==-1) { 298 var w = eltclass.match(/boxWidth-([^\s'">]*)/); 299 w = w[1].replace(/pc/,'%'); // % not allowed in html attribute ; use 100pc instead of 100% 300 $.data(this, colorbox, $.extend($.data(this, colorbox),{width:w})); 301 } 302 if (eltclass.indexOf("boxHeight-")!==-1) { 303 var h = eltclass.match(/boxHeight-([^\s'">]*)/); 304 h = h[1].replace(/pc/,'%'); // % not allowed in html attribute ; use 100pc instead of 100% 305 $.data(this, colorbox, $.extend($.data(this, colorbox),{height:h})); 306 } 307 if (eltclass.indexOf("boxIframe")!==-1) { 308 $.data(this, colorbox, $.extend($.data(this, colorbox),{iframe:true})); 309 } 310 if (eltclass.indexOf("boxSlideshow_off")!==-1) { 311 $.data(this, colorbox, $.extend($.data(this, colorbox),{slideshow:false})); 312 } 313 313 $(this).addClass(boxElement); 314 314 });
Note: See TracChangeset
for help on using the changeset viewer.