Comments (7)
One way to do this: we can detect if a window is within an iframe using this JS snippet and add a class to the body that would let us supress certain items:
if ( window.top != window.self ) {
// Window is within an iframe
} else {
// Window is not within an iframe
}
from pressbooks-book.
The IMS' LTI library does this:
$this->checkValue($_POST['launch_presentation_document_target'], ['embed', 'frame', 'iframe', 'window', 'popup', 'overlay'], ...)
From the spec: https://www.imsglobal.org/specs/ltiv1p2/implementation-guide
launch_presentation_document_target: This field communicates the kind of browser container into which the TC (LMS such as Moodle) has launched the tool. The TP (Pressbooks) can ignore this parameter and try to detect its environment through JavaScript, but this parameter gives the TP the information without requiring the use of JavaScript if the tool prefers. The possible values for this parameter are:
- frame – opened in the same frame as the resource link;
- iframe – opened within an iframe placed inside the same page/frame as the resource link;
- window – opened in a new window (or tab);
- popup – opened in a popup window;
- overlay – opened over the top of the page where the link exists (for example, using a lightbox);
- embed – the TP page is inserted directly into the TC page; this option is not expected to be a common use case but could be used, for example, when the launch request is performed on behalf of the user by the TC (server-to-server) and the response rendered within its page (e.g. within a portal-like interface).
We can set a value and pass it to Pressbooks based on this if needed.
from pressbooks-book.
Another thing Lumen's Bombadil theme does is limit what is in the header when appearing within an iframe. This is particularly important inside the Moodle LMS, because the iframe is so short on the page.
Screenshot 1- LTI link in Moodle to Pressbooks 5 site with theme book 2.0
Screenshot 2- LTI link in Moodle to Lumen's Candela/Pressbook site with theme Bombadil
Notice on Moodle 3.4 and later, there are Moodle tools that would allow the student to go back or move forward, so I might want to suppress Pressbooks' navigation, but if you work in the Blackboard ecosystem, there is not a convenient way to move from chapter to chapter, so you may want to keep the default back and forward buttons because it might actually be better/more convenient for the student to use Pressbooks navigation.
Screenshot 3- Blackboard integration with Lumen's Candela/Pressbooks site with theme Bombadil
I don't mean to confuse the issue, but I just wanted to bring up two of the other major LMSs and how flexibility and the creation of just a few options would be the most helpful for good LTI integration.
from pressbooks-book.
Hey Dac,
I'm not sure if this is doing exactly what you think it is doing. Every LTI connection from an LMS, the system administrators set the default for this setting. So if we want to display content "inside our lms" so that it appears seamless to the students, we select iframe.
I don't know what kind of experience you have with LMSs, but if it would be helpful to see how this behaves from an LMS I have access to a Blackboard and Moodle so you could see what it looks like. Not every LMS has every option available, for example in the screenshot of Moodle below, I can only choose between embed, embed without blocks, existing window, and new tab.
Embed opens in an iframe, with or without blocks just refers to if the iframe has the full width of the page, or if there is a sidebar on the page. In a new window the students will navigate away from Moodle and not have access to the rest of the course tools, and new tab is the same thing but in new window. In Moodle the administrator sets up a default, but a teacher can override this based on their own preference.
In Blackboard there are fewer options. Basically, as a teacher you can choose to open in a new window or not (iframe). There is no preset or default value that the administrator can set.
from pressbooks-book.
An LMS (Consumer) that launches an LTI link will send back info to the Provider of how it is being used.
Among the info (who launched the link, their role, context info...) will be one of those 6 browser container types.
Blackboard supports 2 of the 6. Moodle supports 5 of the 6.
We'll have more on this in the upcoming weeks. I've been working on this :)
from pressbooks-book.
The spec (also) says:
"The TP (Tool Provider aka Pressbooks) can ignore this parameter and try to detect its environment through JavaScript,"
Maybe this will turn out to the best solution. I was just pointing out another option.
from pressbooks-book.
Great, sounds like you have this completely under control. If you need testers I'm sure you know there are lots of us that would help anyway we could.
from pressbooks-book.
Related Issues (20)
- Insufficient color contrast for table captions HOT 1
- Update or remove soberwp/intervention dependency
- Media attachment page interface options misleading HOT 2
- Reduce screen size of footer navigation at large magnification
- export to epub HOT 3
- /h5p-listing/ not including the [h5p id="1"] HOT 6
- Unwanted info warnings from EPUBCheck when TTF font files are used
- With the new "Display CTA" setting in the network settings, the webbook shows a javascript error in the Firefox console if "Display CTA =0". HOT 2
- Only Super Admins able to embed IFrame from My Open Math Lab (https://www.myopenmath.com/) HOT 2
- Internal links to chapters not following the "Chapter-#" title format result are not clickable in PDF exports HOT 2
- Refactor to be PSR compatible
- Unwanted info warnings for EPUB exports when using 'Ancient Greek' HOT 2
- Customize access denied message based on user's login state HOT 3
- Auto-hyphen rendering issue on Chrome with macOS Monterey HOT 2
- 'Where to click' on mobile for "metadata" and "book information" HOT 1
- Alegreya as Header font replaced by Times New Roman in PDF exports HOT 2
- Automatic <p> tags after first paragraph in table cells with multiple paragraphs HOT 3
- Add support for Cherokee using Language & Script Support HOT 2
- Running feet spilling over onto a second line HOT 5
- Aria-label for site icon includes book title HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pressbooks-book.