From 47498e6dce8264a82b0724a49b2bbae9d1393071 Mon Sep 17 00:00:00 2001 From: amillet89 Date: Thu, 12 Feb 2015 15:43:35 -0800 Subject: [PATCH] Added loadIframe method --- component.json | 9 +++++++-- lib/protos.js | 1 + test/index.js | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/component.json b/component.json index a53ec7e..6bf35dd 100644 --- a/component.json +++ b/component.json @@ -3,7 +3,11 @@ "repo": "segmentio/analytics.js-integration", "description": "The base integration factory used to create custom analytics integrations for analytics.js.", "version": "0.3.9", - "keywords": ["analytics.js", "integration", "analytics"], + "keywords": [ + "analytics.js", + "integration", + "analytics" + ], "dependencies": { "segmentio/analytics-events": "1.2.0", "avetisk/defaults": "0.0.4", @@ -20,6 +24,7 @@ "yields/slug": "1.1.0", "yields/fmt": "0.1.0", "segmentio/load-script": "0.1.3", + "segmentio/load-iframe": "0.1.0", "visionmedia/debug": "0.7.3", "segmentio/facade": "*" }, @@ -41,4 +46,4 @@ "https://raw.githubusercontent.com/" ], "main": "lib/index.js" -} +} \ No newline at end of file diff --git a/lib/protos.js b/lib/protos.js index b841a3b..8345e71 100644 --- a/lib/protos.js +++ b/lib/protos.js @@ -4,6 +4,7 @@ */ var loadScript = require('load-script'); +var loadIframe = require('load-iframe'); var events = require('analytics-events'); var normalize = require('to-no-case'); var callback = require('callback'); diff --git a/test/index.js b/test/index.js index 3921503..2e79527 100644 --- a/test/index.js +++ b/test/index.js @@ -214,6 +214,7 @@ describe('integration', function(){ Integration.tag('example-img', '') Integration.tag('example-script', ''); Integration.tag('404', ''); + Integration.tag('example-iframe', ''); integration = new Integration(); spy(integration, 'load'); }); @@ -249,6 +250,15 @@ describe('integration', function(){ done(); }); }); + + it('should load iframe', function (done) { + integration.load('example-iframe', function(){ + var iframe = integration.load.returns[0]; + assert.equal('https://jump.omnitarget.com/', iframe.src); + done(); + }); + }); + }); describe('#invoke', function(){