/*global CN, jQuery */ /* for jsLint */ /** * CN.dart.js * @library cn-fe-ads-1.3.12 * @requires CN, jQuery * @author Russell Munson * @author Joe Hartoularos */ CN.dart = (function($, CN, $D) { var /** * {Object} $window * A jQuery wrapped set of the window object. Saves rendering time. * @private */ $window = $(window), /** * {Object} ads * A collection of ad calls requested on CN.dart * @private */ ads = {}, /** * {Boolean} isDrawing * Flag indicating that CN.dart is in the process of drawing ads * @private */ isDrawing = false, /** * {Object} common * The common ad object. Used as a base class for plugin methods for easy read/write access to * shared ad values. * @private */ common = { ad : {}, params : {}, charmap : {}, container : '_frame', /* Individual ad container div suffix */ dcopt : true, /* allow dcopt param to be appended to tile 1 */ frameurl : '/ads/newad.html', /* Iframe base-url - Used for generating contained dynamic script tags for ad calls. */ embed : false, /* If set to true, embed ads in page rather than in an iframe */ initialized : false, ready : false, ord : Math.floor(Math.random()*10e12), remote : '/services/dart/', retry : false, site : "", tiles : [], tile : 0, transparency : true, /* allowtransparency to fix white background on ads in IE */ url : location.protocol + '//web.archive.org/web/20120704043319/http://ad.doubleclick.net/adj/', zone : "" }, /** * {RegExp} kwregex * @private */ kwregex = /kw=/g, /** * {String} msg_pre * Shared message prefix used in generating debug info. * @private */ msg_pre = "CN Ad ", /** * {Object} msg * Message object for easily generating debug info. * @private */ msg = { /* These are for good! */ 'true' : { gen : 'Success', call : 'Request Fired', embed : 'Set to Embedded Mode. Operating with degraded feature-set.', queue : 'Request Added to Queue', plug : 'Plugin Registered', valid : 'Plugin Action Passed Validation', finished : 'All Plugins Finished Running.', drawing : 'All Ads Have Completed Drawing', drawn : 'Ad Drawn' }, /* These are for bad =( */ 'false' : { gen : 'Error', call : 'Request Aborted', embed : 'Set to Iframe Mode. Good job.', queue : 'Request Faled To Be Added to Queue', plug : 'Plugin Skipped', valid : 'Plugin Action Failed Validation', finished : 'Plugins Still Running', drawing : 'Ads Still Drawing', drawn : 'Ad Failed To Draw' } }, /** * {Object} timer * A timer object used to record function performance. * @public */ timer = { /** * Marks a point in execution by creating a timestamp. The value of milestone dictates the key. * The milestone 'start' is used as the initial timestamp. All other timestamps are stored as * a difference to show the time in miliseconds each function call has taken from start. * @param {String} milestone A string denoting the milestone key * @example: * timer.mark('start'); // Creates a timestamp stored in timer.start * timer.mark('init'); // Creates a timestamp, then stores the difference of start and init in timer.init * @private */ mark : function(milestone) { this[milestone] = (milestone === 'start') ? (new Date()).getTime() : (new Date()).getTime() - this.start; } }, /** * {Object} nakedFrame * A jQuery wrapped set containing a blank iframe element. * @private */ nakedFrame = $('