From: Kai Moritz Date: Thu, 28 Feb 2013 14:22:45 +0000 (+0100) Subject: Fetch on resize: min/max-widths are collected from "class" X-Git-Tag: 0.2.0~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b6ffa68d8d04fa594ea7b11f5e38fea2e89cb991;p=openx Fetch on resize: min/max-widths are collected from "class" --- diff --git a/jquery.openx.js b/jquery.openx.js index d687dfa..a2343bb 100644 --- a/jquery.openx.js +++ b/jquery.openx.js @@ -29,6 +29,8 @@ count = 0, slots = {}, + min_width = {}, + max_width = {}, queue = [], output = []; @@ -92,6 +94,10 @@ * selector: string A selector for selecting the DOM-elements, that * should display ad-banners. DEFAULT: ".oa". * See: http://api.jquery.com/category/selectors/ + * min_prefix: string Prefix for the encoding of the minmal width as + * CSS-classname. DEFAULT: "min_". + * max_prefix: string Prefix for the encoding of the maximal width as + * CSS-classname. DEFAULT: "max_". */ $.openx = function( options ) { @@ -123,6 +129,8 @@ 'delivery': '/www/delivery', 'fl': 'fl.js', 'selector': '.oa', + 'min_prefix': 'min_', + 'max_prefix': 'max_', 'cache': true }, options @@ -158,10 +166,26 @@ for(name in OA_zones) { $(settings.selector).each(function() { var - id; + id, + classes, + i, + min = new RegExp('^' + settings.min_prefix + '([0-9]+)$'), + max = new RegExp('^' + settings.max_prefix + '([0-9]+)$'), + match; if (this.id === name) { id = 'oa_' + ++count; slots[id] = this; + min_width[id] = 0; + max_width[id] = Number.MAX_VALUE; + classes = this.className.split(/\s+/); + for (i=0; i