/** * [盒子下拉广告] * author: zikkeung */ $(function(){ var MODE_DEV='dev', MODE_RELEASE='release', optionsDev = { allowOrigin: [ '127.0.0.1:8080' ], excludeList: [ 'v', 'd', 's', 'tag', 'hezi', /\d{4}/ ], imgRoot: 'http://127.0.0.1:8080/img/', swf: 'http://127.0.0.1:8080/img/adtop-on.swf', isShowTpAD: true, isShowFtAD: false }, optionsRelease = { allowOrigin: [ // 'lol.duowan.com', 'ls.duowan.com', 'dnf.duowan.com', // 'wow.duowan.com', 'bns.duowan.com', 'wot.duowan.com' ], excludeList: [ 'v', 'd', 's', 'tag', 'hezi', /\d{4}/ ], imgRoot: 'http://assets.dwstatic.com/game/dropdown/img/', swf: 'http://assets.dwstatic.com/game/dropdown/img/adtop-on.swf', isShowTpAD: true, isShowFtAD: false }, options, mode; mode = MODE_DEV; options = (mode === MODE_RELEASE? optionsRelease:optionsDev); if (options.allowOrigin.join(',').indexOf(window.location.host) === -1){ return ; } if(options.excludeList && options.excludeList.length>0){ var isInExcludeList = false; subexcludeList= [], pageReg = /http:\/\/[^\/]*\/([^\/]*)/, pageMatch = pageReg.exec(window.location.href), pageType = pageMatch? pageMatch[1]:''; if (pageType!=='') { $.each(options.excludeList, function(i, item){ isInExcludeList = isInExcludeList || (item.test? item.test(pageType):(item === pageType)) ; }); if (isInExcludeList) { return; } }; } if (options.isShowTpAD || options.isShowFtAD){ var style = '