Skip to content

Commit

Permalink
Allow clipboard write on iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Oct 14, 2024
1 parent f236823 commit ff4e1a6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

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

$plugin->version = 2023024601;
$plugin->version = 2024101400;
$plugin->requires = 2016112900;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'atto_pumukitmedia';
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var TABCONTENT_UPLOAD =
'<div class="tab-pane" id="{{elementid}}_upload">' +
'<iframe class="custom-tab-content"' +
' src="{{PUMUKITURL}}/openedx/sso/upload?hash={{HASH}}&username={{USERNAME}}&email={{EMAIL}}&lang=en"' +
' allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
' allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'</div>';

TEMPLATE = TEMPLATE + ITEM_UPLOAD;
Expand All @@ -71,7 +71,7 @@ var TABCONTENT_PERSONALRECORDER =
'<div data-medium-type="personal_recorder" class="tab-pane" id="{{elementid}}_personal_recorder">' +
'<iframe class="custom-tab-content" id="pumukitmedia_iframe_recorder"' +
' src="{{PUMUKITURL}}/openedx/sso/personal_recorder?hash={{HASH}}&username={{USERNAME}}&email={{EMAIL}}&lang=en"' +
' allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
' allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'</div>';

var TEMPLATE_MANAGER =
Expand All @@ -85,7 +85,7 @@ var TABCONTENT_MANAGERSERIES =
'<div class="tab-pane active" id="{{elementid}}_manager">' +
'<iframe class="custom-tab-content"' +
' src="{{PUMUKITURL}}/openedx/sso/manager?hash={{HASH}}&username={{USERNAME}}&email={{EMAIL}}&lang=en"' +
' allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
' allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'</div>';

var TEMPLATE_PLAYLIST =
Expand All @@ -99,7 +99,7 @@ var TABCONTENT_MANAGERPLAYLIST =
'<div class="tab-pane" id="{{elementid}}_playlists">' +
'<iframe class="custom-tab-content"' +
' src="{{PUMUKITURL}}/openedx/sso/manager?hash={{HASH}}&username={{USERNAME}}&email={{EMAIL}}&lang=en&playlist=true"' +
' allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
' allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'</div>';

var TEMPLATE_SHAREDVIDEOS =
Expand All @@ -112,7 +112,7 @@ var TEMPLATE_SHAREDVIDEOS =
var TABCONTENT_SHAREDVIDEOS =
'<div class="tab-pane" id="{{elementid}}_public">' +
'<iframe class="custom-tab-content" src="{{PUMUKITURL}}/openedx/search/public/multimediaobjects"' +
' allowfullscreen allow="microphone; camera; display-capture"></iframe>' +
' allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'</div>';

Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
Expand Down Expand Up @@ -145,7 +145,7 @@ Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_a
this.get('hash') + "&username=" +
this.get('username') + "&email="+
this.get('email') + "&lang=en";
iframe.allow = "microphone; camera; display-capture";
iframe.allow = "microphone; camera; display-capture; clipboard-write";
document.getElementsByTagName('body')[0].appendChild(iframe);
}
},
Expand Down Expand Up @@ -334,17 +334,17 @@ Y.namespace('M.atto_pumukitmedia').Button = Y.Base.create('button', Y.M.editor_a

this.editor.focus();

var url = this.get('pumukitmediaurl') + '/openedx/openedx/embed/?id=' + e.data.mmId;
var url = this.get('pumukitmediaurl') + '/openedx/openedx/embed/' + e.data.mmId;
if(e.data.playlist) {
url = this.get('pumukitmediaurl') + '/openedx/openedx/playlist/embed/?id=' + e.data.playlist;
url = this.get('pumukitmediaurl') + '/openedx/openedx/playlist/embed/' + e.data.playlist;
} else if(e.data.url){
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>' +
'" allowfullscreen allow="microphone; camera; display-capture; clipboard-write"></iframe>' +
'<span style="display: none;">Video</span>' +
'</div>';
this.get('host').insertContentAtFocusPoint(iframe);
Expand Down

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

Loading

0 comments on commit ff4e1a6

Please sign in to comment.