X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=jquery.openx.js;h=a2343bb139ec9f6467ef4696f32a3b5318fb80ea;hb=b6ffa68d8d04fa594ea7b11f5e38fea2e89cb991;hp=f5f22532d6a0d57f218426f693a1b3d25c65c278;hpb=95859482ad5fe50bd07fa8510e1168c8ed151d0c;p=openx diff --git a/jquery.openx.js b/jquery.openx.js index f5f2253..a2343bb 100644 --- a/jquery.openx.js +++ b/jquery.openx.js @@ -29,8 +29,9 @@ count = 0, slots = {}, + min_width = {}, + max_width = {}, queue = [], - ads = [], output = []; @@ -86,11 +87,20 @@ * charset: string Charset used, when delivering the banner-codes. * If empty, the charset is guessed by OpenX. Examples * for sensible values: "UTF-8", "ISO-8859-1". + * + * + * Other settings: + * + * 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 ) { - var name, src, errors = [], i; - if (domain) { if (console.error) { console.error('jQuery.openx was already initialized!'); @@ -105,12 +115,9 @@ _options = options; - if (!options.server) - errors.push('Required option "server" is missing!'); - if (errors.length > 0) { + if (!options.server) { if (console.error) { - for (i=0; i 0) { + while (queue.length > 0) { var result, src, inline; - id = ads.shift(); - node = slots[id]; + id = queue.shift(); + node = $(slots[id]); node.slideDown(); @@ -273,7 +303,7 @@ /** script-tag with src-URL! */ if (OA_output[id].length > 0) /** The banner-code was not rendered completely yet! */ - ads.unshift(id); + queue.unshift(id); /** Load the script and halt all work until the script is loaded and executed... */ $.getScript(result[1], render_ads); // << jQuery.getScript() generates onload-Handler for _all_ browsers ;) return; @@ -300,7 +330,7 @@ for (var i=0; i