From 2ecb24dcf0f59b9ea7f016bc0e24b92fa2dc4d9f Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 27 Feb 2013 01:03:11 +0100 Subject: [PATCH] Switched configuration to an options-object Appart from the server-name, one can configure the used protocol and the port-numbers for the http- and the https-protocol now. --- jquery.openx.js | 19 ++++++++++++++++--- openx.jquery.json | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/jquery.openx.js b/jquery.openx.js index 5825593..66d91cb 100644 --- a/jquery.openx.js +++ b/jquery.openx.js @@ -25,7 +25,7 @@ var - domain, id, node, + settings, domain, id, node, count = 0, slots = {}, @@ -34,7 +34,7 @@ output = []; - $.openx = function( server, zones, options ) { + $.openx = function( zones, options ) { if (domain) { if (console.error) @@ -42,7 +42,20 @@ return; } - domain = document.location.protocol == 'https:' ? 'https://' + server + ':8443':'http://' + server; + settings = $.extend( + { + 'protocol': document.location.protocol, + 'server': 'localhost' + }, + options + ); + + domain = settings.protocol + '//'; + domain += settings.server; + if (settings.protocol === 'http:' && settings.http_port) + domain += ':' + settings.http_port; + if (settings.protocol === 'https:' && settings.https_port) + domain += ':' + settings.https_port; var name, diff --git a/openx.jquery.json b/openx.jquery.json index daa4b41..26855f4 100644 --- a/openx.jquery.json +++ b/openx.jquery.json @@ -3,7 +3,7 @@ "title": "jQuery OpenX", "description": "jQuery plugin, that loads banner-ads from an OpenX-server in an asynchronous and responsive way", "keywords": [ "openx" ], - "version": "0.1.0", + "version": "0.1.1", "author": { "name": "Kai Moritz", "email": "kai@juplo.de" }, "licenses": [ { "type": "LGPLv3", "url": "http://www.gnu.org/licenses/lgpl-3.0.html" } ], "homepage": "http://juplo.de/openx", -- 2.20.1