X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=openx.js;h=76e994bcec718316c5ceeed9ffe4f58203d2af82;hb=d95742f4f780bc45f7f091fb256251e332f41753;hp=e074a9a7b4ce5f950bc59a66f5daf2e91df6342c;hpb=85b8e0cc15c980368286f8a84444e5b7eca8e8b3;p=openx diff --git a/openx.js b/openx.js index e074a9a..76e994b 100644 --- a/openx.js +++ b/openx.js @@ -1,13 +1,25 @@ -/** Optimized methods for fetching ad-banners via OpenX */ - -/** see: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/ */ +/* + * (C) Copyright 2012 juplo (http://juplo.de/). + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser General Public License + * (LGPL) version 3.0 which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * Contributors: + * - Kai Moritz + */ (function( openx, $, undefined ) { var - id, - node, + domain, id, node, count = 0, slots = {}, @@ -18,8 +30,9 @@ openx.show_ads = function(server, zones) { + domain = document.location.protocol == 'https:' ? 'https://' + server + ':8443':'http://' + server; + var - domain = document.location.protocol == 'https:' ? 'https://' + server + ':8443':'http://' + server, name, src = domain; @@ -56,10 +69,13 @@ if (window.location) src += "&loc=" + escape(window.location); if (document.referrer) src += "&referer=" + escape(document.referrer); - $.getScript(src, init_ads); + $.getScript(src, load_flash); + + } + + function load_flash() { - src = domain + '/www/delivery/fl.js'; - $.getScript(src); + $.getScript(domain + '/www/delivery/fl.js', init_ads); }