/
githubmirror
/
oppia
Обзор
Документация
Войти
/
githubmirror
/
oppia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
assets/scripts/embedding_tests_dev_0.0.2.min.html
80 строк
2 KB
Mosin Shaikh
Fix the Part of #11371 Remove jquery constructs used in angularJS codeRemove jquery constructs - 2 (#23060)
21 дек 2025, 03:06
Не верифицирован
21 дек 2025, 03:06
34ae126
Код
Авторство
О чём код?
<h2>v0.0.2 (minified)</h2> <p>For instructions: see the README file in /assets/scripts.</p> <p> NB: When you complete an exploration the text "Exploration completed" should appear in the paragraph below it. This checks that events are being sent from the Oppia iframe to the containing page. </p> <style type="text/css"> .e2e-test-results { display: none; } </style> <script src="/assets/scripts/oppia-player-0.0.2.min.js"></script> <script src="/assets/scripts/embedding_tests.js"></script> <input class="e2e-test-exploration-id-input-field" type="text" placeholder="explorationId"> <input class="e2e-test-exploration-id-submit-button" type="submit" value="Update Exploration ID" onclick="onChangeExpId()"> <div class="e2e-test-results"> <div> <h3>Iframe embedding</h3> <iframe src="/embed/exploration/idToBeReplaced" width="700" height="600"> </iframe> </div> <div class="e2e-test-standard"> <h3>Standard embedding of the latest version</h3> <oppia oppia-id="idToBeReplaced"></oppia> </div> <div class="e2e-test-old-version"> <h3>Standard embedding of version 2 of the exploration</h3> <oppia oppia-id="idToBeReplaced" exploration-version="2"></oppia> </div> <div class="e2e-test-missing-id"> <h3>ERROR: No oppia id specified</h3> <oppia></oppia> </div> <div class="e2e-test-invalid-id"> <h3>ERROR: 404 error</h3> <oppia oppia-id="fake_id"></oppia> </div> </div> <script type="text/javascript"> var placeholderExplorationId = 'idToBeReplaced'; var onChangeExpId = function() { var inputEl = document.querySelector('.e2e-test-exploration-id-input-field'); var newExplorationId = inputEl.value; if (!/^[a-zA-Z0-9_-]+$/.test(newExplorationId)) { alert( 'Invalid exploration ID. Only letters, numbers, underscores and ' + 'dashes are allowed.'); return; } var iframes = document.querySelectorAll('div > iframe'); iframes.forEach(function(iframe) { var src = iframe.getAttribute('src'); iframe.setAttribute('src', src.replace( placeholderExplorationId, encodeURIComponent(newExplorationId))); }); placeholderExplorationId = newExplorationId; var oppiaElements = document.querySelectorAll('oppia[oppia-id="idToBeReplaced"]'); oppiaElements.forEach(function(el) { el.setAttribute('oppia-id', newExplorationId); }); var resultsEl = document.querySelector('.e2e-test-results'); if (resultsEl) { resultsEl.style.display = 'block'; } }; </script>