Skip to content

Commit

Permalink
Use URL instead of iframe to remove blocks from Moodle security. Filt…
Browse files Browse the repository at this point in the history
…er will convert URLs on iframes
  • Loading branch information
Yurujai committed Jul 3, 2024
1 parent f236823 commit 9d3fb25
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

defined('MOODLE_INTERNAL') || exit();

$plugin->version = 2023024601;
$plugin->version = 2024070302;
$plugin->requires = 2016112900;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'atto_pumukitmedia';
$plugin->dependencies = [
'filter_pumukitmedia' => 2022021801
];
$plugin->release = '1';
$plugin->release = '1.1.0';
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,7 @@ Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_a
url = e.data.url;
}

var iframe =
'<div class="embed-responsive embed-responsive-16by9 tv-iframe">' +
'<iframe class="embed-responsive-item tv-iframe-item" src="' + url +
'" allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
'<span style="display: none;">Video</span>' +
'</div>';
var iframe = '<a href="' + url + '" target="_blank" class="pumukit-media-link">' + url + '</a>';
this.get('host').insertContentAtFocusPoint(iframe);
this.markUpdated();
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,7 @@ Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_a
url = e.data.url;
}

var iframe =
'<div class="embed-responsive embed-responsive-16by9 tv-iframe">' +
'<iframe class="embed-responsive-item tv-iframe-item" src="' + url +
'" allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
'<span style="display: none;">Video</span>' +
'</div>';
var iframe = '<a href="' + url + '" target="_blank" class="pumukit-media-link">' + url + '</a>';
this.get('host').insertContentAtFocusPoint(iframe);
this.markUpdated();
},
Expand Down
13 changes: 7 additions & 6 deletions yui/src/button/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,13 @@ Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_a
url = e.data.url;
}

var iframe =
'<div class="embed-responsive embed-responsive-16by9 tv-iframe">' +
'<iframe class="embed-responsive-item tv-iframe-item" src="' + url +
'" allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
'<span style="display: none;">Video</span>' +
'</div>';
// var iframe =
// '<div class="embed-responsive embed-responsive-16by9 tv-iframe">' +
// '<iframe class="embed-responsive-item tv-iframe-item" src="' + url +
// '" allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
// '<span style="display: none;">Video</span>' +
// '</div>';
var iframe = '<a href="' + url + '" target="_blank" class="pumukit-media-link">' + url + '</a>';
this.get('host').insertContentAtFocusPoint(iframe);
this.markUpdated();
},
Expand Down

0 comments on commit 9d3fb25

Please sign in to comment.