Skip to content

Commit

Permalink
feat: add permission to copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Nov 14, 2024
1 parent 955bf28 commit 5175668
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 30 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 = 2024111400;
$plugin->version = 2024111401;
$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

0 comments on commit 5175668

Please sign in to comment.