Skip to content

Commit

Permalink
Merge pull request #14 from Panopto/2019012900-beta-release-candidate
Browse files Browse the repository at this point in the history
beta release code for 2019012900
  • Loading branch information
jmalmsten-panopto authored Jan 29, 2019
2 parents a9a309a + af0c7ef commit 78e5e11
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 56 deletions.
14 changes: 11 additions & 3 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

defined('MOODLE_INTERNAL') || die();


/**
* Initialize this plugin
*/
Expand All @@ -47,17 +46,26 @@ function atto_panoptobutton_strings_for_js() {
* @return array of additional params to pass to javascript init function for this module.
*/
function atto_panoptobutton_params_for_js($elementid, $options, $fpoptions) {

global $USER, $COURSE, $DB;

$coursecontext = context_course::instance($COURSE->id);

// Gets Panopto folder ID and for course from database on the server to which the course was provisioned.
// If the course has not been provisioned, this will not return a value and the user will be able to select
// Folders and videos from the server specified as default during the plugin setup.
// folders and videos from the server specified as default during the plugin setup.
$panoptoid = $DB->get_field('block_panopto_foldermap', 'panopto_id', array('moodleid' => $coursecontext->instanceid));
$servername = $DB->get_field('block_panopto_foldermap', 'panopto_server', array('moodleid' => $coursecontext->instanceid));

// If the panopto_data file exists (it should, this plug in should not be installed without the base plug-in),
// sync the user before viewing the tool.
if (file_exists(dirname(__FILE__) . '/../../../../../blocks/panopto/lib/panopto_data.php')) {
require_once(dirname(__FILE__) . '/../../../../../blocks/panopto/lib/panopto_data.php');
$panoptodata = new \panopto_data($COURSE->id);
if (!empty($panoptodata->servername) && !empty($panoptodata->applicationkey)) {
$panoptodata->sync_external_user($USER->id);
}
}

$usercontextid = context_user::instance($USER->id)->id;
$disabled = false;

Expand Down
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') || die();

// The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2018011800;
$plugin->version = 2019012900;

// Requires this Moodle version - 2.7.
$plugin->requires = 2014051200;

// Full name of the plugin (used for diagnostics).
$plugin->component = 'atto_panoptobutton';
$plugin->maturity = MATURITY_BETA;
$plugin->maturity = MATURITY_STABLE;

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ var COMPONENTNAME = 'atto_panoptobutton',
servername = '',
courseid = '',
idstring = '',
playlistString = '?playlistsEnabled=true'
IFSOURCE = servername + '/Panopto/Pages/Sessions/EmbeddedUpload.aspx',
playlistString = '?playlistsEnabled=true',
IFSOURCE = '',
IFHEIGHT = 550,
IFWIDTH = 1060,
IFID = 'pageframe',
Expand Down Expand Up @@ -163,17 +163,12 @@ var COMPONENTNAME = 'atto_panoptobutton',
dialogue.set('bodyContent', bodycontent);

aservername = this.get('servename');
if (aservername) {
document.getElementById('pageframe').src = 'https://' + aservername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = aservername;
} else {
document.getElementById('pageframe').src = 'https://' + defaultserver +
servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = defaultserver;
}
document.getElementById('pageframe').src = IFSOURCE;

dialogue.show();

Expand All @@ -189,13 +184,25 @@ var COMPONENTNAME = 'atto_panoptobutton',
* @private
*/
_getFormContent: function (clickedicon) {
var template = Y.Handlebars.compile(TEMPLATE),
content = Y.Node.create(template({
var template,
content,
defaultserver,
aservername;

defaultserver = this.get('defaultserver');
aservername = this.get('servename');

servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

template = Y.Handlebars.compile(TEMPLATE);
content = Y.Node.create(template({
elementid: this.get('host').get('elementid'),
CSS: CSS,
component: COMPONENTNAME,
clickedicon: clickedicon,
isource: IFSOURCE + playlistString + idstring,
isource: IFSOURCE,
iframeheight: IFHEIGHT,
iframeID: IFID,
submitid: SUBMITID,
Expand Down Expand Up @@ -224,10 +231,11 @@ var COMPONENTNAME = 'atto_panoptobutton',

e.preventDefault();

win = document.getElementById('pageframe').contentWindow,
win = document.getElementById('pageframe').contentWindow;
message = {
cmd: 'createEmbeddedFrame'
};

win.postMessage(JSON.stringify(message), 'https://' + servername);

eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';
Expand All @@ -243,7 +251,6 @@ var COMPONENTNAME = 'atto_panoptobutton',
ids,
names,
PLAYLIST_EMBED_ID = 1,
VIDEO_EMBED_ID = 0,
i;
if (!eventfired) {
message = JSON.parse(e.data);
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 @@ -40,8 +40,8 @@ var COMPONENTNAME = 'atto_panoptobutton',
servername = '',
courseid = '',
idstring = '',
playlistString = '?playlistsEnabled=true'
IFSOURCE = servername + '/Panopto/Pages/Sessions/EmbeddedUpload.aspx',
playlistString = '?playlistsEnabled=true',
IFSOURCE = '',
IFHEIGHT = 550,
IFWIDTH = 1060,
IFID = 'pageframe',
Expand Down Expand Up @@ -163,17 +163,12 @@ var COMPONENTNAME = 'atto_panoptobutton',
dialogue.set('bodyContent', bodycontent);

aservername = this.get('servename');
if (aservername) {
document.getElementById('pageframe').src = 'https://' + aservername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = aservername;
} else {
document.getElementById('pageframe').src = 'https://' + defaultserver +
servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = defaultserver;
}
document.getElementById('pageframe').src = IFSOURCE;

dialogue.show();

Expand All @@ -189,13 +184,25 @@ var COMPONENTNAME = 'atto_panoptobutton',
* @private
*/
_getFormContent: function (clickedicon) {
var template = Y.Handlebars.compile(TEMPLATE),
content = Y.Node.create(template({
var template,
content,
defaultserver,
aservername;

defaultserver = this.get('defaultserver');
aservername = this.get('servename');

servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

template = Y.Handlebars.compile(TEMPLATE);
content = Y.Node.create(template({
elementid: this.get('host').get('elementid'),
CSS: CSS,
component: COMPONENTNAME,
clickedicon: clickedicon,
isource: IFSOURCE + playlistString + idstring,
isource: IFSOURCE,
iframeheight: IFHEIGHT,
iframeID: IFID,
submitid: SUBMITID,
Expand Down Expand Up @@ -224,10 +231,11 @@ var COMPONENTNAME = 'atto_panoptobutton',

e.preventDefault();

win = document.getElementById('pageframe').contentWindow,
win = document.getElementById('pageframe').contentWindow;
message = {
cmd: 'createEmbeddedFrame'
};

win.postMessage(JSON.stringify(message), 'https://' + servername);

eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';
Expand All @@ -243,7 +251,6 @@ var COMPONENTNAME = 'atto_panoptobutton',
ids,
names,
PLAYLIST_EMBED_ID = 1,
VIDEO_EMBED_ID = 0,
i;
if (!eventfired) {
message = JSON.parse(e.data);
Expand Down
37 changes: 22 additions & 15 deletions yui/src/button/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ var COMPONENTNAME = 'atto_panoptobutton',
servername = '',
courseid = '',
idstring = '',
playlistString = '?playlistsEnabled=true'
IFSOURCE = servername + '/Panopto/Pages/Sessions/EmbeddedUpload.aspx',
playlistString = '?playlistsEnabled=true',
IFSOURCE = '',
IFHEIGHT = 550,
IFWIDTH = 1060,
IFID = 'pageframe',
Expand Down Expand Up @@ -161,17 +161,12 @@ var COMPONENTNAME = 'atto_panoptobutton',
dialogue.set('bodyContent', bodycontent);

aservername = this.get('servename');
if (aservername) {
document.getElementById('pageframe').src = 'https://' + aservername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = aservername;
} else {
document.getElementById('pageframe').src = 'https://' + defaultserver +
servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

servername = defaultserver;
}
document.getElementById('pageframe').src = IFSOURCE;

dialogue.show();

Expand All @@ -187,13 +182,25 @@ var COMPONENTNAME = 'atto_panoptobutton',
* @private
*/
_getFormContent: function (clickedicon) {
var template = Y.Handlebars.compile(TEMPLATE),
content = Y.Node.create(template({
var template,
content,
defaultserver,
aservername;

defaultserver = this.get('defaultserver');
aservername = this.get('servename');

servername = aservername ? aservername : defaultserver;
IFSOURCE = 'https://' + servername +
'/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;

template = Y.Handlebars.compile(TEMPLATE);
content = Y.Node.create(template({
elementid: this.get('host').get('elementid'),
CSS: CSS,
component: COMPONENTNAME,
clickedicon: clickedicon,
isource: IFSOURCE + playlistString + idstring,
isource: IFSOURCE,
iframeheight: IFHEIGHT,
iframeID: IFID,
submitid: SUBMITID,
Expand Down Expand Up @@ -222,10 +229,11 @@ var COMPONENTNAME = 'atto_panoptobutton',

e.preventDefault();

win = document.getElementById('pageframe').contentWindow,
win = document.getElementById('pageframe').contentWindow;
message = {
cmd: 'createEmbeddedFrame'
};

win.postMessage(JSON.stringify(message), 'https://' + servername);

eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';
Expand All @@ -241,7 +249,6 @@ var COMPONENTNAME = 'atto_panoptobutton',
ids,
names,
PLAYLIST_EMBED_ID = 1,
VIDEO_EMBED_ID = 0,
i;
if (!eventfired) {
message = JSON.parse(e.data);
Expand Down

0 comments on commit 78e5e11

Please sign in to comment.