Commit ba8f7d4b authored by Dave Lane's avatar Dave Lane

initial working iframe implementation

parent 19371164
......@@ -14,11 +14,11 @@ These sample scripts require [Node.js](https://nodejs.org/en/) 6.x.x or greater.
> If you don't already have Node.js installed, using
> [nvm](https://github.com/creationix/nvm) is an easy
> way to proceed.
>
>
> You can install nvm using cURL:
>
> `curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash`
>
>
> *or* Wget:
>
> `wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash`
......@@ -88,3 +88,7 @@ of course-sized open educational resources stored in WikiEducator.
I expect that different institutions (and even different courses
within an institution) will have different needs, organizations, and
styling.
Update 2019-07-23: added iFrame embedding capability using the new [WEiFrame template](https://wikieducator.org/Template:WEiFrame) on WikiEducator.
The main concern with this is that if the site you're wanting to include in the iframe has "X-Frame-Options" (in the sites website configuration, e.g. Apache or NGINX) is set to "sameorigin". That will block the iframe display.
......@@ -2,7 +2,7 @@
/* jshint node: true, multistr: true, trailing: true, esnext: true */
"use strict";
const VERSION = "1.0.0",
const VERSION = "1.1.0",
JQUERY = "http://code.jquery.com/jquery-2.1.1.min.js",
FILEPATH = "/home/www/www";
......@@ -792,6 +792,7 @@ function getOutline() {
});
if (opt["--wpurl"]) {
console.log('--wpurl');
// allow the user to make the first page have no WP title
// by giving it a slug, but seting the text to an empty string
if (options.hasOwnProperty("no_landing_page_title")) {
......@@ -802,6 +803,7 @@ function getOutline() {
}
}
if (opt["--wpdelete"]) {
console.log('--wpdelete');
var posts = [];
function deletePages() {
var post;
......@@ -821,7 +823,7 @@ function getOutline() {
setImmediate(processPages);
}
}
console.log('before getPosts');
wp.getPosts({ post_type: "page", number: 200 }, ["post_id"], function(
err,
data
......
console.log('in iframe.js!');
module.exports = {
version: "0.0.1",
version: "0.1.0",
process: function($, opt) {
console.log('in iframe.js module!');
var ifcount = 0,
......@@ -15,7 +15,7 @@ module.exports = {
ifid;
// find the nodes in the Dom...
$(".WEiFrame").each(function() {
//iframe = ifurl = ifheight = ifwidth = ifstyle = ifstyle_string = ifclasses = ifid = "";
iframe = ifurl = ifheight = ifwidth = ifstyle = ifstyle_string = ifclasses = ifid = "";
ifcount += 1;
console.log('WEiFrame '+ifcount+' ...');
$(this).find("div").each(function() {
......@@ -50,6 +50,7 @@ module.exports = {
if (ifstyle_string != "") {
iframe += ' style="'+ifstyle_string+'"';
}
//iframe = '<div class="WEiFrame"><iframe frameborder="0" '+iframe+' /></div>';
iframe = '<div class="WEiFrame"><iframe '+iframe+' /></div>';
console.log(ifcount+'. '+iframe);
$(this).replaceWith(iframe);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment