@pitaj said:
Do you want the iframe to automatically adjust to the height of the contents? If so, this is only possible either if you get the site's html with an ajax request or if the site's url meets the same origin policy.
Yeah. Would be good. I was thinking maybe you already have some sort of code in the core already for setting dimensions say with use with iphone and ipad.
What sort of Ajax request would take the given url and be able to store those settings in the request. Then use them in the width and height dimensions in the iframe code.
(function(module) {
"use strict";
var EmbedWebPage = {},
embed = '<iframe id="iFrame" src="$1" style="width: 100%;border:0;" width="100%" height="3000" frameBorder="0" scrolling="no"></iframe>';
var embedcode = /<a href="(.+)">.+<\/a>/g;
EmbedWebPage.parse = function(data, callback) {
if (!data || !data.postData || !data.postData.content) {
return callback(null, data);
}
if (data.postData.content.match(embedcode)) {
data.postData.content = data.postData.content.replace(embedcode, embed);
}
callback(null, data);
};
module.exports = EmbedWebPage;
}(module));
I would like to trigger the embed without using direct url's, my regexp is not great though