Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add permission to copy to clipboard #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 2024111400;
$plugin->version = 2024111500;
$plugin->requires = 2016112900;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'atto_pumukitmedia';
$plugin->dependencies = [
'filter_pumukitmedia' => 2022021801
];
$plugin->release = '1.2.0';
$plugin->release = '1.3.0';

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,13 +334,19 @@ 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; clipboard-write"></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.

Loading
Loading