From af0c7efb0547a7a03a088bb60a8894fc694053bc Mon Sep 17 00:00:00 2001 From: jmalmsten-panopto Date: Tue, 29 Jan 2019 11:49:05 -0800 Subject: [PATCH] beta release code for 2019012900 --- lib.php | 14 +++++-- version.php | 4 +- ...odle-atto_panoptobutton-button-coverage.js | 13 ++++--- .../moodle-atto_panoptobutton-button-debug.js | 37 +++++++++++-------- .../moodle-atto_panoptobutton-button-min.js | 2 +- .../moodle-atto_panoptobutton-button.js | 37 +++++++++++-------- yui/src/button/js/button.js | 37 +++++++++++-------- 7 files changed, 88 insertions(+), 56 deletions(-) diff --git a/lib.php b/lib.php index a6e469c..dfbabbb 100644 --- a/lib.php +++ b/lib.php @@ -24,7 +24,6 @@ defined('MOODLE_INTERNAL') || die(); - /** * Initialize this plugin */ @@ -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; diff --git a/version.php b/version.php index 41559ba..7694b1f 100644 --- a/version.php +++ b/version.php @@ -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; diff --git a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-coverage.js b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-coverage.js index 6806cc4..94d7da3 100644 --- a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-coverage.js +++ b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-coverage.js @@ -1,6 +1,9 @@ -if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } -if (!__coverage__['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js']) { - __coverage__['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js'] = {"path":"build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":63}}},"2":{"name":"(anonymous_2)","line":65,"loc":{"start":{"line":65,"column":21},"end":{"line":65,"column":33}}},"3":{"name":"(anonymous_3)","line":97,"loc":{"start":{"line":97,"column":26},"end":{"line":97,"column":52}}},"4":{"name":"(anonymous_4)","line":117,"loc":{"start":{"line":117,"column":44},"end":{"line":117,"column":55}}},"5":{"name":"(anonymous_5)","line":121,"loc":{"start":{"line":121,"column":31},"end":{"line":121,"column":42}}},"6":{"name":"(anonymous_6)","line":149,"loc":{"start":{"line":149,"column":37},"end":{"line":149,"column":50}}},"7":{"name":"(anonymous_7)","line":191,"loc":{"start":{"line":191,"column":25},"end":{"line":191,"column":48}}},"8":{"name":"(anonymous_8)","line":216,"loc":{"start":{"line":216,"column":19},"end":{"line":216,"column":32}}},"9":{"name":"(anonymous_9)","line":238,"loc":{"start":{"line":238,"column":37},"end":{"line":238,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":328,"column":61}},"2":{"start":{"line":39,"column":0},"end":{"line":44,"column":4}},"3":{"start":{"line":44,"column":4},"end":{"line":57,"column":131}},"4":{"start":{"line":59,"column":4},"end":{"line":325,"column":7}},"5":{"start":{"line":67,"column":12},"end":{"line":69,"column":13}},"6":{"start":{"line":68,"column":16},"end":{"line":68,"column":23}},"7":{"start":{"line":72,"column":12},"end":{"line":72,"column":49}},"8":{"start":{"line":74,"column":12},"end":{"line":76,"column":13}},"9":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"10":{"start":{"line":79,"column":12},"end":{"line":79,"column":33}},"11":{"start":{"line":82,"column":12},"end":{"line":88,"column":15}},"12":{"start":{"line":98,"column":12},"end":{"line":112,"column":28}},"13":{"start":{"line":114,"column":12},"end":{"line":114,"column":31}},"14":{"start":{"line":117,"column":12},"end":{"line":125,"column":15}},"15":{"start":{"line":118,"column":16},"end":{"line":118,"column":53}},"16":{"start":{"line":120,"column":16},"end":{"line":124,"column":17}},"17":{"start":{"line":121,"column":20},"end":{"line":123,"column":26}},"18":{"start":{"line":122,"column":24},"end":{"line":122,"column":41}},"19":{"start":{"line":129,"column":12},"end":{"line":131,"column":13}},"20":{"start":{"line":130,"column":16},"end":{"line":130,"column":52}},"21":{"start":{"line":133,"column":12},"end":{"line":135,"column":13}},"22":{"start":{"line":134,"column":16},"end":{"line":134,"column":54}},"23":{"start":{"line":137,"column":12},"end":{"line":137,"column":59}},"24":{"start":{"line":139,"column":12},"end":{"line":139,"column":55}},"25":{"start":{"line":140,"column":12},"end":{"line":140,"column":43}},"26":{"start":{"line":142,"column":12},"end":{"line":142,"column":54}},"27":{"start":{"line":145,"column":12},"end":{"line":145,"column":87}},"28":{"start":{"line":146,"column":12},"end":{"line":146,"column":45}},"29":{"start":{"line":147,"column":12},"end":{"line":147,"column":83}},"30":{"start":{"line":149,"column":12},"end":{"line":160,"column":22}},"31":{"start":{"line":150,"column":16},"end":{"line":150,"column":49}},"32":{"start":{"line":152,"column":16},"end":{"line":154,"column":17}},"33":{"start":{"line":153,"column":20},"end":{"line":153,"column":78}},"34":{"start":{"line":157,"column":16},"end":{"line":159,"column":17}},"35":{"start":{"line":158,"column":20},"end":{"line":158,"column":77}},"36":{"start":{"line":163,"column":12},"end":{"line":163,"column":53}},"37":{"start":{"line":165,"column":12},"end":{"line":165,"column":48}},"38":{"start":{"line":166,"column":12},"end":{"line":176,"column":13}},"39":{"start":{"line":167,"column":16},"end":{"line":168,"column":94}},"40":{"start":{"line":170,"column":16},"end":{"line":170,"column":41}},"41":{"start":{"line":172,"column":16},"end":{"line":173,"column":94}},"42":{"start":{"line":175,"column":16},"end":{"line":175,"column":43}},"43":{"start":{"line":178,"column":12},"end":{"line":178,"column":28}},"44":{"start":{"line":180,"column":12},"end":{"line":180,"column":31}},"45":{"start":{"line":192,"column":12},"end":{"line":204,"column":20}},"46":{"start":{"line":206,"column":12},"end":{"line":206,"column":33}},"47":{"start":{"line":207,"column":12},"end":{"line":207,"column":84}},"48":{"start":{"line":208,"column":12},"end":{"line":208,"column":27}},"49":{"start":{"line":217,"column":12},"end":{"line":223,"column":35}},"50":{"start":{"line":225,"column":12},"end":{"line":225,"column":31}},"51":{"start":{"line":227,"column":12},"end":{"line":230,"column":14}},"52":{"start":{"line":231,"column":12},"end":{"line":231,"column":78}},"53":{"start":{"line":233,"column":12},"end":{"line":233,"column":87}},"54":{"start":{"line":234,"column":12},"end":{"line":234,"column":45}},"55":{"start":{"line":235,"column":12},"end":{"line":235,"column":83}},"56":{"start":{"line":238,"column":12},"end":{"line":303,"column":22}},"57":{"start":{"line":239,"column":16},"end":{"line":247,"column":22}},"58":{"start":{"line":248,"column":16},"end":{"line":302,"column":17}},"59":{"start":{"line":249,"column":20},"end":{"line":249,"column":49}},"60":{"start":{"line":250,"column":20},"end":{"line":250,"column":38}},"61":{"start":{"line":254,"column":20},"end":{"line":296,"column":21}},"62":{"start":{"line":256,"column":24},"end":{"line":256,"column":42}},"63":{"start":{"line":257,"column":24},"end":{"line":257,"column":46}},"64":{"start":{"line":259,"column":24},"end":{"line":287,"column":25}},"65":{"start":{"line":260,"column":28},"end":{"line":260,"column":94}},"66":{"start":{"line":264,"column":28},"end":{"line":268,"column":29}},"67":{"start":{"line":265,"column":32},"end":{"line":265,"column":59}},"68":{"start":{"line":267,"column":32},"end":{"line":267,"column":58}},"69":{"start":{"line":270,"column":28},"end":{"line":275,"column":29}},"70":{"start":{"line":271,"column":32},"end":{"line":274,"column":83}},"71":{"start":{"line":277,"column":28},"end":{"line":280,"column":66}},"72":{"start":{"line":282,"column":28},"end":{"line":286,"column":41}},"73":{"start":{"line":291,"column":24},"end":{"line":291,"column":76}},"74":{"start":{"line":293,"column":24},"end":{"line":293,"column":46}},"75":{"start":{"line":294,"column":24},"end":{"line":294,"column":83}},"76":{"start":{"line":295,"column":24},"end":{"line":295,"column":45}},"77":{"start":{"line":301,"column":20},"end":{"line":301,"column":38}}},"branchMap":{"1":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":12},"end":{"line":67,"column":12}},{"start":{"line":67,"column":12},"end":{"line":67,"column":12}}]},"2":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":12},"end":{"line":74,"column":12}},{"start":{"line":74,"column":12},"end":{"line":74,"column":12}}]},"3":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":16},"end":{"line":120,"column":16}},{"start":{"line":120,"column":16},"end":{"line":120,"column":16}}]},"4":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":12},"end":{"line":129,"column":12}},{"start":{"line":129,"column":12},"end":{"line":129,"column":12}}]},"5":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":12},"end":{"line":133,"column":12}},{"start":{"line":133,"column":12},"end":{"line":133,"column":12}}]},"6":{"line":145,"type":"cond-expr","locations":[{"start":{"line":145,"column":52},"end":{"line":145,"column":70}},{"start":{"line":145,"column":73},"end":{"line":145,"column":86}}]},"7":{"line":147,"type":"cond-expr","locations":[{"start":{"line":147,"column":59},"end":{"line":147,"column":70}},{"start":{"line":147,"column":73},"end":{"line":147,"column":82}}]},"8":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":16},"end":{"line":152,"column":16}},{"start":{"line":152,"column":16},"end":{"line":152,"column":16}}]},"9":{"line":157,"type":"if","locations":[{"start":{"line":157,"column":16},"end":{"line":157,"column":16}},{"start":{"line":157,"column":16},"end":{"line":157,"column":16}}]},"10":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":12},"end":{"line":166,"column":12}},{"start":{"line":166,"column":12},"end":{"line":166,"column":12}}]},"11":{"line":233,"type":"cond-expr","locations":[{"start":{"line":233,"column":52},"end":{"line":233,"column":70}},{"start":{"line":233,"column":73},"end":{"line":233,"column":86}}]},"12":{"line":235,"type":"cond-expr","locations":[{"start":{"line":235,"column":59},"end":{"line":235,"column":70}},{"start":{"line":235,"column":73},"end":{"line":235,"column":82}}]},"13":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":16},"end":{"line":248,"column":16}},{"start":{"line":248,"column":16},"end":{"line":248,"column":16}}]},"14":{"line":254,"type":"if","locations":[{"start":{"line":254,"column":20},"end":{"line":254,"column":20}},{"start":{"line":254,"column":20},"end":{"line":254,"column":20}}]},"15":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":28},"end":{"line":264,"column":28}},{"start":{"line":264,"column":28},"end":{"line":264,"column":28}}]},"16":{"line":264,"type":"binary-expr","locations":[{"start":{"line":264,"column":32},"end":{"line":264,"column":59}},{"start":{"line":264,"column":64},"end":{"line":264,"column":126}}]},"17":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":28},"end":{"line":270,"column":28}},{"start":{"line":270,"column":28},"end":{"line":270,"column":28}}]}},"code":["(function () { YUI.add('moodle-atto_panoptobutton-button', function (Y, NAME) {","","// This file is part of Moodle - http://moodle.org/\r","//\r","// Moodle is free software: you can redistribute it and/or modify\r","// it under the terms of the GNU General Public License as published by\r","// the Free Software Foundation, either version 3 of the License, or\r","// (at your option) any later version.\r","//\r","// Moodle is distributed in the hope that it will be useful,\r","// but WITHOUT ANY WARRANTY; without even the implied warranty of\r","// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r","// GNU General Public License for more details.\r","//\r","// You should have received a copy of the GNU General Public License\r","// along with Moodle. If not, see .\r","\r","/*\r"," * @package atto_panoptobutton\r"," * @copyright Panopto 2009 - 2016 With contributions from Joseph Malmsten (joseph.malmsten@gmail.com)\r"," * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\r"," */\r","\r","/**\r"," * @module moodle-atto_panoptobutton-button\r"," */\r","\r","/**\r"," * Atto text editor panoptobutton plugin.\r"," *\r"," * @namespace M.atto_panoptobutton\r"," * @class button\r"," * @extends M.editor_atto.EditorPlugin\r"," */\r","\r","// TODO: Use some helper to register one-shot event handling.\r","// TODO: Use string format helper.\r","\r","var COMPONENTNAME = 'atto_panoptobutton',\r"," servername = '',\r"," courseid = '',\r"," idstring = '',\r"," playlistString = '?playlistsEnabled=true'\r"," IFSOURCE = servername + '/Panopto/Pages/Sessions/EmbeddedUpload.aspx',\r"," IFHEIGHT = 550,\r"," IFWIDTH = 1060,\r"," IFID = 'pageframe',\r"," SUBMITID = 'submit',\r"," SELECTALIGN = 'float:left; display:none',\r"," CSS = {\r"," INPUTSUBMIT: 'atto_media_urlentrysubmit'\r"," },\r"," TEMPLATE = '
' +\r"," '' +\r"," '

' +\r"," '
' +\r"," '';\r","\r"," Y.namespace('M.atto_panoptobutton').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {\r"," /**\r"," * Initialize the button\r"," *\r"," * @method Initializer\r"," */\r"," initializer: function () {\r"," // If we don't have the capability to view then give up.\r"," if (this.get('disabled')) {\r"," return;\r"," }\r","\r"," // Get the external id of the course, and if it exists, append to the url for the iframe.\r"," courseid = this.get('coursecontext');\r","\r"," if (courseid) {\r"," idstring = '&folderID=' + courseid;\r"," }\r","\r"," // Set name of button icon to be loaded.\r"," var icon = 'iconone';\r","\r"," // Add the panoptobutton icon/buttons.\r"," this.addButton({\r"," icon: 'ed/' + icon,\r"," iconComponent: 'atto_panoptobutton',\r"," buttonName: icon,\r"," callback: this._displayDialogue,\r"," callbackArgs: icon\r"," });\r"," },\r","\r"," /**\r"," * Display the panoptobutton Dialogue\r"," *\r"," * @method _displayDialogue\r"," * @private\r"," */\r"," _displayDialogue: function (e, clickedicon) {\r"," var width = 1150,\r"," height = 720,\r"," dialogue = this.getDialogue({\r"," headerContent: M.util.get_string('dialogtitle', COMPONENTNAME),\r"," width: width + 'px',\r"," height: height + 'px',\r"," focusAfterHide: clickedicon\r"," }),\r"," buttonform,\r"," bodycontent,\r"," defaultserver,\r"," eventmethod,\r"," evententer,\r"," messageevent,\r"," aservername;\r","\r"," e.preventDefault();\r","\r"," // When dialog becomes invisible, reset it. This fixes problems with multiple editors per page.\r"," dialogue.after('visibleChange', function() {\r"," var attributes = dialogue.getAttrs();\r","\r"," if(attributes.visible === false) {\r"," setTimeout(function() {\r"," dialogue.reset();\r"," }, 5);\r"," }\r"," });\r","\r"," // Dialog doesn't detect changes in width without this.\r"," // If you reuse the dialog, this seems necessary.\r"," if (dialogue.width !== width + 'px') {\r"," dialogue.set('width', width + 'px');\r"," }\r","\r"," if (dialogue.height !== height + 'px') {\r"," dialogue.set('height', height + 'px');\r"," }\r"," // Append buttons to iframe.\r"," buttonform = this._getFormContent(clickedicon);\r","\r"," bodycontent = Y.Node.create('
');\r"," bodycontent.append(buttonform);\r","\r"," defaultserver = this.get('defaultserver');\r","\r"," // Setup for message handling from iframe.\r"," eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';\r"," evententer = window[eventmethod];\r"," messageevent = eventmethod === 'attachEvent' ? 'onmessage' : 'message';\r","\r"," evententer(messageevent, function (e) {\r"," var message = JSON.parse(e.data);\r","\r"," if (message.cmd === 'ready') {\r"," document.getElementById('submit').style.display = 'block';\r"," }\r","\r"," // If no video is chosen, hide the \"Insert\" button.\r"," if (message.cmd === 'notReady') {\r"," document.getElementById('submit').style.display = 'none';\r"," }\r"," }, false);\r","\r"," // Set to bodycontent.\r"," dialogue.set('bodyContent', bodycontent);\r","\r"," aservername = this.get('servename');\r"," if (aservername) {\r"," document.getElementById('pageframe').src = 'https://' + aservername +\r"," '/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;\r","\r"," servername = aservername;\r"," } else {\r"," document.getElementById('pageframe').src = 'https://' + defaultserver +\r"," '/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;\r","\r"," servername = defaultserver;\r"," }\r","\r"," dialogue.show();\r","\r"," this.markUpdated();\r"," },\r","\r"," /**\r"," * Return the dialogue content for the tool, attaching any required\r"," * events.\r"," *\r"," * @method _getDialogueContent\r"," * @return {Node} The content to place in the dialogue.\r"," * @private\r"," */\r"," _getFormContent: function (clickedicon) {\r"," var template = Y.Handlebars.compile(TEMPLATE),\r"," content = Y.Node.create(template({\r"," elementid: this.get('host').get('elementid'),\r"," CSS: CSS,\r"," component: COMPONENTNAME,\r"," clickedicon: clickedicon,\r"," isource: IFSOURCE + playlistString + idstring,\r"," iframeheight: IFHEIGHT,\r"," iframeID: IFID,\r"," submitid: SUBMITID,\r"," iframewidth: IFWIDTH,\r"," selectalign: SELECTALIGN\r"," }));\r","\r"," this._form = content;\r"," this._form.one('.' + CSS.INPUTSUBMIT).on('click', this._doInsert, this);\r"," return content;\r"," },\r","\r"," /**\r"," * Inserts the users input onto the page\r"," * @method _getDialogueContent\r"," * @private\r"," */\r"," _doInsert: function (e) {\r"," var win,\r"," message,\r"," eventmethod,\r"," evententer,\r"," messageevent,\r"," parent = this,\r"," eventfired = false;\r","\r"," e.preventDefault();\r","\r"," win = document.getElementById('pageframe').contentWindow,\r"," message = {\r"," cmd: 'createEmbeddedFrame'\r"," };\r"," win.postMessage(JSON.stringify(message), 'https://' + servername);\r","\r"," eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';\r"," evententer = window[eventmethod];\r"," messageevent = eventmethod === 'attachEvent' ? 'onmessage' : 'message';\r","\r"," // Event triggered when response is received from server with object ids.\r"," evententer(messageevent, function (e) {\r"," var message,\r"," objectstring,\r"," thumbnailChunk,\r"," idChunk,\r"," ids,\r"," names,\r"," PLAYLIST_EMBED_ID = 1,\r"," VIDEO_EMBED_ID = 0,\r"," i;\r"," if (!eventfired) {\r"," message = JSON.parse(e.data);\r"," objectstring = '';\r","\r","\r"," // Called when \"Insert\" is clicked. Creates HTML for embedding each selected video into the editor.\r"," if (message.cmd === 'deliveryList') {\r","\r"," ids = message.ids;\r"," names = message.names;\r","\r"," for (i = 0; i < ids.length; ++i) {\r"," thumbnailChunk = \"
\";\r","\r","\r","\r"," if (message.playableObjectTypes && (parseInt(message.playableObjectTypes[i]) === PLAYLIST_EMBED_ID)){\r"," idChunk = \"?pid=\" + ids[i];\r"," } else {\r"," idChunk = \"?id=\" + ids[i];\r"," }\r","\r"," if (typeof names[i] !== 'undefined') {\r"," thumbnailChunk += \"
\" + names[i] + \"
\";\r"," }\r","\r"," thumbnailChunk += \"\" +\r"," \"
\";\r","\r"," objectstring += \"
\" +\r"," thumbnailChunk +\r"," \"
\" + \"
\" +\r"," \"
\";\r"," }\r","\r"," // Hide the pop-up after we've received the selection in the \"deliveryList\" message.\r"," // Hiding before message is received causes exceptions in IE.\r"," parent.getDialogue({ focusAfterHide: null }).hide();\r","\r"," parent.editor.focus();\r"," parent.get('host').insertContentAtFocusPoint(objectstring);\r"," parent.markUpdated();\r"," }\r","\r"," // This plug-in instance has completed the job, but it's still alive until editor is closed.\r"," // If another plug-in instance is created, the event is posted also this instance.\r"," // We need to ignore such events.\r"," eventfired = true;\r"," }\r"," }, false);\r"," }\r"," }, {\r"," ATTRS: {\r"," disabled: {\r"," value: false\r"," },\r","\r"," usercontextid: {\r"," value: null\r"," },\r","\r"," defaultserver: {\r"," value: ''\r"," },\r"," coursecontext: {\r"," value: null\r"," },\r"," servename: {\r"," value: null\r"," }\r"," }\r"," });\r","","","}, '@VERSION@', {\"requires\": [\"moodle-editor_atto-plugin\"]});","","}());"]}; + +var __cov_iUVrcZyoIhQMjT$Lhpnd8A = (Function('return this'))(); +if (!__cov_iUVrcZyoIhQMjT$Lhpnd8A.__coverage__) { __cov_iUVrcZyoIhQMjT$Lhpnd8A.__coverage__ = {}; } +__cov_iUVrcZyoIhQMjT$Lhpnd8A = __cov_iUVrcZyoIhQMjT$Lhpnd8A.__coverage__; +if (!(__cov_iUVrcZyoIhQMjT$Lhpnd8A['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js'])) { + __cov_iUVrcZyoIhQMjT$Lhpnd8A['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js'] = {"path":"build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":63}}},"2":{"name":"(anonymous_2)","line":65,"loc":{"start":{"line":65,"column":21},"end":{"line":65,"column":33}}},"3":{"name":"(anonymous_3)","line":97,"loc":{"start":{"line":97,"column":26},"end":{"line":97,"column":52}}},"4":{"name":"(anonymous_4)","line":117,"loc":{"start":{"line":117,"column":44},"end":{"line":117,"column":55}}},"5":{"name":"(anonymous_5)","line":121,"loc":{"start":{"line":121,"column":31},"end":{"line":121,"column":42}}},"6":{"name":"(anonymous_6)","line":149,"loc":{"start":{"line":149,"column":37},"end":{"line":149,"column":50}}},"7":{"name":"(anonymous_7)","line":186,"loc":{"start":{"line":186,"column":25},"end":{"line":186,"column":48}}},"8":{"name":"(anonymous_8)","line":223,"loc":{"start":{"line":223,"column":19},"end":{"line":223,"column":32}}},"9":{"name":"(anonymous_9)","line":246,"loc":{"start":{"line":246,"column":37},"end":{"line":246,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":335,"column":61}},"2":{"start":{"line":39,"column":0},"end":{"line":57,"column":131}},"3":{"start":{"line":59,"column":4},"end":{"line":332,"column":7}},"4":{"start":{"line":67,"column":12},"end":{"line":69,"column":13}},"5":{"start":{"line":68,"column":16},"end":{"line":68,"column":23}},"6":{"start":{"line":72,"column":12},"end":{"line":72,"column":49}},"7":{"start":{"line":74,"column":12},"end":{"line":76,"column":13}},"8":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"9":{"start":{"line":79,"column":12},"end":{"line":79,"column":33}},"10":{"start":{"line":82,"column":12},"end":{"line":88,"column":15}},"11":{"start":{"line":98,"column":12},"end":{"line":112,"column":28}},"12":{"start":{"line":114,"column":12},"end":{"line":114,"column":31}},"13":{"start":{"line":117,"column":12},"end":{"line":125,"column":15}},"14":{"start":{"line":118,"column":16},"end":{"line":118,"column":53}},"15":{"start":{"line":120,"column":16},"end":{"line":124,"column":17}},"16":{"start":{"line":121,"column":20},"end":{"line":123,"column":26}},"17":{"start":{"line":122,"column":24},"end":{"line":122,"column":41}},"18":{"start":{"line":129,"column":12},"end":{"line":131,"column":13}},"19":{"start":{"line":130,"column":16},"end":{"line":130,"column":52}},"20":{"start":{"line":133,"column":12},"end":{"line":135,"column":13}},"21":{"start":{"line":134,"column":16},"end":{"line":134,"column":54}},"22":{"start":{"line":137,"column":12},"end":{"line":137,"column":59}},"23":{"start":{"line":139,"column":12},"end":{"line":139,"column":55}},"24":{"start":{"line":140,"column":12},"end":{"line":140,"column":43}},"25":{"start":{"line":142,"column":12},"end":{"line":142,"column":54}},"26":{"start":{"line":145,"column":12},"end":{"line":145,"column":87}},"27":{"start":{"line":146,"column":12},"end":{"line":146,"column":45}},"28":{"start":{"line":147,"column":12},"end":{"line":147,"column":83}},"29":{"start":{"line":149,"column":12},"end":{"line":160,"column":22}},"30":{"start":{"line":150,"column":16},"end":{"line":150,"column":49}},"31":{"start":{"line":152,"column":16},"end":{"line":154,"column":17}},"32":{"start":{"line":153,"column":20},"end":{"line":153,"column":78}},"33":{"start":{"line":157,"column":16},"end":{"line":159,"column":17}},"34":{"start":{"line":158,"column":20},"end":{"line":158,"column":77}},"35":{"start":{"line":163,"column":12},"end":{"line":163,"column":53}},"36":{"start":{"line":165,"column":12},"end":{"line":165,"column":48}},"37":{"start":{"line":167,"column":12},"end":{"line":167,"column":67}},"38":{"start":{"line":168,"column":12},"end":{"line":169,"column":94}},"39":{"start":{"line":171,"column":12},"end":{"line":171,"column":64}},"40":{"start":{"line":173,"column":12},"end":{"line":173,"column":28}},"41":{"start":{"line":175,"column":12},"end":{"line":175,"column":31}},"42":{"start":{"line":187,"column":12},"end":{"line":190,"column":28}},"43":{"start":{"line":192,"column":12},"end":{"line":192,"column":54}},"44":{"start":{"line":193,"column":12},"end":{"line":193,"column":48}},"45":{"start":{"line":195,"column":12},"end":{"line":195,"column":67}},"46":{"start":{"line":196,"column":12},"end":{"line":197,"column":94}},"47":{"start":{"line":199,"column":12},"end":{"line":199,"column":54}},"48":{"start":{"line":200,"column":12},"end":{"line":211,"column":20}},"49":{"start":{"line":213,"column":12},"end":{"line":213,"column":33}},"50":{"start":{"line":214,"column":12},"end":{"line":214,"column":84}},"51":{"start":{"line":215,"column":12},"end":{"line":215,"column":27}},"52":{"start":{"line":224,"column":12},"end":{"line":230,"column":35}},"53":{"start":{"line":232,"column":12},"end":{"line":232,"column":31}},"54":{"start":{"line":234,"column":12},"end":{"line":234,"column":69}},"55":{"start":{"line":235,"column":12},"end":{"line":237,"column":14}},"56":{"start":{"line":239,"column":12},"end":{"line":239,"column":78}},"57":{"start":{"line":241,"column":12},"end":{"line":241,"column":87}},"58":{"start":{"line":242,"column":12},"end":{"line":242,"column":45}},"59":{"start":{"line":243,"column":12},"end":{"line":243,"column":83}},"60":{"start":{"line":246,"column":12},"end":{"line":310,"column":22}},"61":{"start":{"line":247,"column":16},"end":{"line":254,"column":22}},"62":{"start":{"line":255,"column":16},"end":{"line":309,"column":17}},"63":{"start":{"line":256,"column":20},"end":{"line":256,"column":49}},"64":{"start":{"line":257,"column":20},"end":{"line":257,"column":38}},"65":{"start":{"line":261,"column":20},"end":{"line":303,"column":21}},"66":{"start":{"line":263,"column":24},"end":{"line":263,"column":42}},"67":{"start":{"line":264,"column":24},"end":{"line":264,"column":46}},"68":{"start":{"line":266,"column":24},"end":{"line":294,"column":25}},"69":{"start":{"line":267,"column":28},"end":{"line":267,"column":94}},"70":{"start":{"line":271,"column":28},"end":{"line":275,"column":29}},"71":{"start":{"line":272,"column":32},"end":{"line":272,"column":59}},"72":{"start":{"line":274,"column":32},"end":{"line":274,"column":58}},"73":{"start":{"line":277,"column":28},"end":{"line":282,"column":29}},"74":{"start":{"line":278,"column":32},"end":{"line":281,"column":83}},"75":{"start":{"line":284,"column":28},"end":{"line":287,"column":66}},"76":{"start":{"line":289,"column":28},"end":{"line":293,"column":41}},"77":{"start":{"line":298,"column":24},"end":{"line":298,"column":76}},"78":{"start":{"line":300,"column":24},"end":{"line":300,"column":46}},"79":{"start":{"line":301,"column":24},"end":{"line":301,"column":83}},"80":{"start":{"line":302,"column":24},"end":{"line":302,"column":45}},"81":{"start":{"line":308,"column":20},"end":{"line":308,"column":38}}},"branchMap":{"1":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":12},"end":{"line":67,"column":12}},{"start":{"line":67,"column":12},"end":{"line":67,"column":12}}]},"2":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":12},"end":{"line":74,"column":12}},{"start":{"line":74,"column":12},"end":{"line":74,"column":12}}]},"3":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":16},"end":{"line":120,"column":16}},{"start":{"line":120,"column":16},"end":{"line":120,"column":16}}]},"4":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":12},"end":{"line":129,"column":12}},{"start":{"line":129,"column":12},"end":{"line":129,"column":12}}]},"5":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":12},"end":{"line":133,"column":12}},{"start":{"line":133,"column":12},"end":{"line":133,"column":12}}]},"6":{"line":145,"type":"cond-expr","locations":[{"start":{"line":145,"column":52},"end":{"line":145,"column":70}},{"start":{"line":145,"column":73},"end":{"line":145,"column":86}}]},"7":{"line":147,"type":"cond-expr","locations":[{"start":{"line":147,"column":59},"end":{"line":147,"column":70}},{"start":{"line":147,"column":73},"end":{"line":147,"column":82}}]},"8":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":16},"end":{"line":152,"column":16}},{"start":{"line":152,"column":16},"end":{"line":152,"column":16}}]},"9":{"line":157,"type":"if","locations":[{"start":{"line":157,"column":16},"end":{"line":157,"column":16}},{"start":{"line":157,"column":16},"end":{"line":157,"column":16}}]},"10":{"line":167,"type":"cond-expr","locations":[{"start":{"line":167,"column":39},"end":{"line":167,"column":50}},{"start":{"line":167,"column":53},"end":{"line":167,"column":66}}]},"11":{"line":195,"type":"cond-expr","locations":[{"start":{"line":195,"column":39},"end":{"line":195,"column":50}},{"start":{"line":195,"column":53},"end":{"line":195,"column":66}}]},"12":{"line":241,"type":"cond-expr","locations":[{"start":{"line":241,"column":52},"end":{"line":241,"column":70}},{"start":{"line":241,"column":73},"end":{"line":241,"column":86}}]},"13":{"line":243,"type":"cond-expr","locations":[{"start":{"line":243,"column":59},"end":{"line":243,"column":70}},{"start":{"line":243,"column":73},"end":{"line":243,"column":82}}]},"14":{"line":255,"type":"if","locations":[{"start":{"line":255,"column":16},"end":{"line":255,"column":16}},{"start":{"line":255,"column":16},"end":{"line":255,"column":16}}]},"15":{"line":261,"type":"if","locations":[{"start":{"line":261,"column":20},"end":{"line":261,"column":20}},{"start":{"line":261,"column":20},"end":{"line":261,"column":20}}]},"16":{"line":271,"type":"if","locations":[{"start":{"line":271,"column":28},"end":{"line":271,"column":28}},{"start":{"line":271,"column":28},"end":{"line":271,"column":28}}]},"17":{"line":271,"type":"binary-expr","locations":[{"start":{"line":271,"column":32},"end":{"line":271,"column":59}},{"start":{"line":271,"column":64},"end":{"line":271,"column":126}}]},"18":{"line":277,"type":"if","locations":[{"start":{"line":277,"column":28},"end":{"line":277,"column":28}},{"start":{"line":277,"column":28},"end":{"line":277,"column":28}}]}},"code":["(function () { YUI.add('moodle-atto_panoptobutton-button', function (Y, NAME) {","","// This file is part of Moodle - http://moodle.org/","//","// Moodle is free software: you can redistribute it and/or modify","// it under the terms of the GNU General Public License as published by","// the Free Software Foundation, either version 3 of the License, or","// (at your option) any later version.","//","// Moodle is distributed in the hope that it will be useful,","// but WITHOUT ANY WARRANTY; without even the implied warranty of","// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the","// GNU General Public License for more details.","//","// You should have received a copy of the GNU General Public License","// along with Moodle. If not, see .","","/*"," * @package atto_panoptobutton"," * @copyright Panopto 2009 - 2016 With contributions from Joseph Malmsten (joseph.malmsten@gmail.com)"," * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later"," */","","/**"," * @module moodle-atto_panoptobutton-button"," */","","/**"," * Atto text editor panoptobutton plugin."," *"," * @namespace M.atto_panoptobutton"," * @class button"," * @extends M.editor_atto.EditorPlugin"," */","","// TODO: Use some helper to register one-shot event handling.","// TODO: Use string format helper.","","var COMPONENTNAME = 'atto_panoptobutton',"," servername = '',"," courseid = '',"," idstring = '',"," playlistString = '?playlistsEnabled=true',"," IFSOURCE = '',"," IFHEIGHT = 550,"," IFWIDTH = 1060,"," IFID = 'pageframe',"," SUBMITID = 'submit',"," SELECTALIGN = 'float:left; display:none',"," CSS = {"," INPUTSUBMIT: 'atto_media_urlentrysubmit'"," },"," TEMPLATE = '
' +"," '' +"," '

' +"," '
' +"," '';",""," Y.namespace('M.atto_panoptobutton').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {"," /**"," * Initialize the button"," *"," * @method Initializer"," */"," initializer: function () {"," // If we don't have the capability to view then give up."," if (this.get('disabled')) {"," return;"," }",""," // Get the external id of the course, and if it exists, append to the url for the iframe."," courseid = this.get('coursecontext');",""," if (courseid) {"," idstring = '&folderID=' + courseid;"," }",""," // Set name of button icon to be loaded."," var icon = 'iconone';",""," // Add the panoptobutton icon/buttons."," this.addButton({"," icon: 'ed/' + icon,"," iconComponent: 'atto_panoptobutton',"," buttonName: icon,"," callback: this._displayDialogue,"," callbackArgs: icon"," });"," },",""," /**"," * Display the panoptobutton Dialogue"," *"," * @method _displayDialogue"," * @private"," */"," _displayDialogue: function (e, clickedicon) {"," var width = 1150,"," height = 720,"," dialogue = this.getDialogue({"," headerContent: M.util.get_string('dialogtitle', COMPONENTNAME),"," width: width + 'px',"," height: height + 'px',"," focusAfterHide: clickedicon"," }),"," buttonform,"," bodycontent,"," defaultserver,"," eventmethod,"," evententer,"," messageevent,"," aservername;",""," e.preventDefault();",""," // When dialog becomes invisible, reset it. This fixes problems with multiple editors per page."," dialogue.after('visibleChange', function() {"," var attributes = dialogue.getAttrs();",""," if(attributes.visible === false) {"," setTimeout(function() {"," dialogue.reset();"," }, 5);"," }"," });",""," // Dialog doesn't detect changes in width without this."," // If you reuse the dialog, this seems necessary."," if (dialogue.width !== width + 'px') {"," dialogue.set('width', width + 'px');"," }",""," if (dialogue.height !== height + 'px') {"," dialogue.set('height', height + 'px');"," }"," // Append buttons to iframe."," buttonform = this._getFormContent(clickedicon);",""," bodycontent = Y.Node.create('
');"," bodycontent.append(buttonform);",""," defaultserver = this.get('defaultserver');",""," // Setup for message handling from iframe."," eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';"," evententer = window[eventmethod];"," messageevent = eventmethod === 'attachEvent' ? 'onmessage' : 'message';",""," evententer(messageevent, function (e) {"," var message = JSON.parse(e.data);",""," if (message.cmd === 'ready') {"," document.getElementById('submit').style.display = 'block';"," }",""," // If no video is chosen, hide the \"Insert\" button."," if (message.cmd === 'notReady') {"," document.getElementById('submit').style.display = 'none';"," }"," }, false);",""," // Set to bodycontent."," dialogue.set('bodyContent', bodycontent);",""," aservername = this.get('servename');",""," servername = aservername ? aservername : defaultserver;"," IFSOURCE = 'https://' + servername +"," '/Panopto/Pages/Sessions/EmbeddedUpload.aspx' + playlistString + idstring;",""," document.getElementById('pageframe').src = IFSOURCE;",""," dialogue.show();",""," this.markUpdated();"," },",""," /**"," * Return the dialogue content for the tool, attaching any required"," * events."," *"," * @method _getDialogueContent"," * @return {Node} The content to place in the dialogue."," * @private"," */"," _getFormContent: function (clickedicon) {"," 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,"," iframeheight: IFHEIGHT,"," iframeID: IFID,"," submitid: SUBMITID,"," iframewidth: IFWIDTH,"," selectalign: SELECTALIGN"," }));",""," this._form = content;"," this._form.one('.' + CSS.INPUTSUBMIT).on('click', this._doInsert, this);"," return content;"," },",""," /**"," * Inserts the users input onto the page"," * @method _getDialogueContent"," * @private"," */"," _doInsert: function (e) {"," var win,"," message,"," eventmethod,"," evententer,"," messageevent,"," parent = this,"," eventfired = false;",""," e.preventDefault();",""," win = document.getElementById('pageframe').contentWindow;"," message = {"," cmd: 'createEmbeddedFrame'"," };",""," win.postMessage(JSON.stringify(message), 'https://' + servername);",""," eventmethod = window.addEventListener ? 'addEventListener' : 'attachEvent';"," evententer = window[eventmethod];"," messageevent = eventmethod === 'attachEvent' ? 'onmessage' : 'message';",""," // Event triggered when response is received from server with object ids."," evententer(messageevent, function (e) {"," var message,"," objectstring,"," thumbnailChunk,"," idChunk,"," ids,"," names,"," PLAYLIST_EMBED_ID = 1,"," i;"," if (!eventfired) {"," message = JSON.parse(e.data);"," objectstring = '';","",""," // Called when \"Insert\" is clicked. Creates HTML for embedding each selected video into the editor."," if (message.cmd === 'deliveryList') {",""," ids = message.ids;"," names = message.names;",""," for (i = 0; i < ids.length; ++i) {"," thumbnailChunk = \"
\";","","",""," if (message.playableObjectTypes && (parseInt(message.playableObjectTypes[i]) === PLAYLIST_EMBED_ID)){"," idChunk = \"?pid=\" + ids[i];"," } else {"," idChunk = \"?id=\" + ids[i];"," }",""," if (typeof names[i] !== 'undefined') {"," thumbnailChunk += \"
\" + names[i] + \"
\";"," }",""," thumbnailChunk += \"\" +"," \"
\";",""," objectstring += \"
\" +"," thumbnailChunk +"," \"
\" + \"
\" +"," \"
\";"," }",""," // Hide the pop-up after we've received the selection in the \"deliveryList\" message."," // Hiding before message is received causes exceptions in IE."," parent.getDialogue({ focusAfterHide: null }).hide();",""," parent.editor.focus();"," parent.get('host').insertContentAtFocusPoint(objectstring);"," parent.markUpdated();"," }",""," // This plug-in instance has completed the job, but it's still alive until editor is closed."," // If another plug-in instance is created, the event is posted also this instance."," // We need to ignore such events."," eventfired = true;"," }"," }, false);"," }"," }, {"," ATTRS: {"," disabled: {"," value: false"," },",""," usercontextid: {"," value: null"," },",""," defaultserver: {"," value: ''"," },"," coursecontext: {"," value: null"," },"," servename: {"," value: null"," }"," }"," });","","","}, '@VERSION@', {\"requires\": [\"moodle-editor_atto-plugin\"]});","","}());"]}; } -var __cov_iUVrcZyoIhQMjT$Lhpnd8A = __coverage__['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js']; -__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['1']++;YUI.add('moodle-atto_panoptobutton-button',function(Y,NAME){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['1']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['2']++;var COMPONENTNAME='atto_panoptobutton',servername='',courseid='',idstring='',playlistString='?playlistsEnabled=true';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['3']++;IFSOURCE=servername+'/Panopto/Pages/Sessions/EmbeddedUpload.aspx',IFHEIGHT=550,IFWIDTH=1060,IFID='pageframe',SUBMITID='submit',SELECTALIGN='float:left; display:none',CSS={INPUTSUBMIT:'atto_media_urlentrysubmit'},TEMPLATE='
'+''+'

'+'
'+'';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['4']++;Y.namespace('M.atto_panoptobutton').Button=Y.Base.create('button',Y.M.editor_atto.EditorPlugin,[],{initializer:function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['2']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['5']++;if(this.get('disabled')){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['1'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['6']++;return;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['1'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['7']++;courseid=this.get('coursecontext');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['8']++;if(courseid){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['2'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['9']++;idstring='&folderID='+courseid;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['2'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['10']++;var icon='iconone';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['11']++;this.addButton({icon:'ed/'+icon,iconComponent:'atto_panoptobutton',buttonName:icon,callback:this._displayDialogue,callbackArgs:icon});},_displayDialogue:function(e,clickedicon){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['3']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['12']++;var width=1150,height=720,dialogue=this.getDialogue({headerContent:M.util.get_string('dialogtitle',COMPONENTNAME),width:width+'px',height:height+'px',focusAfterHide:clickedicon}),buttonform,bodycontent,defaultserver,eventmethod,evententer,messageevent,aservername;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['13']++;e.preventDefault();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['14']++;dialogue.after('visibleChange',function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['4']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['15']++;var attributes=dialogue.getAttrs();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['16']++;if(attributes.visible===false){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['3'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['17']++;setTimeout(function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['5']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['18']++;dialogue.reset();},5);}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['3'][1]++;}});__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['19']++;if(dialogue.width!==width+'px'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['4'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['20']++;dialogue.set('width',width+'px');}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['4'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['21']++;if(dialogue.height!==height+'px'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['5'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['22']++;dialogue.set('height',height+'px');}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['5'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['23']++;buttonform=this._getFormContent(clickedicon);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['24']++;bodycontent=Y.Node.create('
');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['25']++;bodycontent.append(buttonform);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['26']++;defaultserver=this.get('defaultserver');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['27']++;eventmethod=window.addEventListener?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['6'][0]++,'addEventListener'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['6'][1]++,'attachEvent');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['28']++;evententer=window[eventmethod];__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['29']++;messageevent=eventmethod==='attachEvent'?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['7'][0]++,'onmessage'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['7'][1]++,'message');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['30']++;evententer(messageevent,function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['6']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['31']++;var message=JSON.parse(e.data);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['32']++;if(message.cmd==='ready'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['8'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['33']++;document.getElementById('submit').style.display='block';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['8'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['34']++;if(message.cmd==='notReady'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['9'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['35']++;document.getElementById('submit').style.display='none';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['9'][1]++;}},false);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['36']++;dialogue.set('bodyContent',bodycontent);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['37']++;aservername=this.get('servename');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['38']++;if(aservername){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['10'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['39']++;document.getElementById('pageframe').src='https://'+aservername+'/Panopto/Pages/Sessions/EmbeddedUpload.aspx'+playlistString+idstring;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['40']++;servername=aservername;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['10'][1]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['41']++;document.getElementById('pageframe').src='https://'+defaultserver+'/Panopto/Pages/Sessions/EmbeddedUpload.aspx'+playlistString+idstring;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['42']++;servername=defaultserver;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['43']++;dialogue.show();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['44']++;this.markUpdated();},_getFormContent:function(clickedicon){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['7']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['45']++;var 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,iframeheight:IFHEIGHT,iframeID:IFID,submitid:SUBMITID,iframewidth:IFWIDTH,selectalign:SELECTALIGN}));__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['46']++;this._form=content;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['47']++;this._form.one('.'+CSS.INPUTSUBMIT).on('click',this._doInsert,this);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['48']++;return content;},_doInsert:function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['8']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['49']++;var win,message,eventmethod,evententer,messageevent,parent=this,eventfired=false;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['50']++;e.preventDefault();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['51']++;win=document.getElementById('pageframe').contentWindow,message={cmd:'createEmbeddedFrame'};__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['52']++;win.postMessage(JSON.stringify(message),'https://'+servername);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['53']++;eventmethod=window.addEventListener?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['11'][0]++,'addEventListener'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['11'][1]++,'attachEvent');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['54']++;evententer=window[eventmethod];__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['55']++;messageevent=eventmethod==='attachEvent'?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['12'][0]++,'onmessage'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['12'][1]++,'message');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['56']++;evententer(messageevent,function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['9']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['57']++;var message,objectstring,thumbnailChunk,idChunk,ids,names,PLAYLIST_EMBED_ID=1,VIDEO_EMBED_ID=0,i;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['58']++;if(!eventfired){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['13'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['59']++;message=JSON.parse(e.data);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['60']++;objectstring='';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['61']++;if(message.cmd==='deliveryList'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['14'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['62']++;ids=message.ids;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['63']++;names=message.names;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['64']++;for(i=0;i';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['66']++;if((__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['16'][0]++,message.playableObjectTypes)&&(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['16'][1]++,parseInt(message.playableObjectTypes[i])===PLAYLIST_EMBED_ID)){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['15'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['67']++;idChunk='?pid='+ids[i];}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['15'][1]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['68']++;idChunk='?id='+ids[i];}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['69']++;if(typeof names[i]!=='undefined'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['17'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['70']++;thumbnailChunk+='
'+names[i]+'
';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['17'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['71']++;thumbnailChunk+=''+'
';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['72']++;objectstring+='
'+thumbnailChunk+'
'+'
'+'
';}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['73']++;parent.getDialogue({focusAfterHide:null}).hide();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['74']++;parent.editor.focus();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['75']++;parent.get('host').insertContentAtFocusPoint(objectstring);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['76']++;parent.markUpdated();}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['14'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['77']++;eventfired=true;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['13'][1]++;}},false);}},{ATTRS:{disabled:{value:false},usercontextid:{value:null},defaultserver:{value:''},coursecontext:{value:null},servename:{value:null}}});},'@VERSION@',{'requires':['moodle-editor_atto-plugin']}); +__cov_iUVrcZyoIhQMjT$Lhpnd8A = __cov_iUVrcZyoIhQMjT$Lhpnd8A['build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js']; +__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['1']++;YUI.add('moodle-atto_panoptobutton-button',function(Y,NAME){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['1']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['2']++;var COMPONENTNAME='atto_panoptobutton',servername='',courseid='',idstring='',playlistString='?playlistsEnabled=true',IFSOURCE='',IFHEIGHT=550,IFWIDTH=1060,IFID='pageframe',SUBMITID='submit',SELECTALIGN='float:left; display:none',CSS={INPUTSUBMIT:'atto_media_urlentrysubmit'},TEMPLATE='
'+''+'

'+'
'+'';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['3']++;Y.namespace('M.atto_panoptobutton').Button=Y.Base.create('button',Y.M.editor_atto.EditorPlugin,[],{initializer:function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['2']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['4']++;if(this.get('disabled')){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['1'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['5']++;return;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['1'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['6']++;courseid=this.get('coursecontext');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['7']++;if(courseid){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['2'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['8']++;idstring='&folderID='+courseid;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['2'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['9']++;var icon='iconone';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['10']++;this.addButton({icon:'ed/'+icon,iconComponent:'atto_panoptobutton',buttonName:icon,callback:this._displayDialogue,callbackArgs:icon});},_displayDialogue:function(e,clickedicon){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['3']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['11']++;var width=1150,height=720,dialogue=this.getDialogue({headerContent:M.util.get_string('dialogtitle',COMPONENTNAME),width:width+'px',height:height+'px',focusAfterHide:clickedicon}),buttonform,bodycontent,defaultserver,eventmethod,evententer,messageevent,aservername;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['12']++;e.preventDefault();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['13']++;dialogue.after('visibleChange',function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['4']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['14']++;var attributes=dialogue.getAttrs();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['15']++;if(attributes.visible===false){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['3'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['16']++;setTimeout(function(){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['5']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['17']++;dialogue.reset();},5);}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['3'][1]++;}});__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['18']++;if(dialogue.width!==width+'px'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['4'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['19']++;dialogue.set('width',width+'px');}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['4'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['20']++;if(dialogue.height!==height+'px'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['5'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['21']++;dialogue.set('height',height+'px');}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['5'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['22']++;buttonform=this._getFormContent(clickedicon);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['23']++;bodycontent=Y.Node.create('
');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['24']++;bodycontent.append(buttonform);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['25']++;defaultserver=this.get('defaultserver');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['26']++;eventmethod=window.addEventListener?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['6'][0]++,'addEventListener'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['6'][1]++,'attachEvent');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['27']++;evententer=window[eventmethod];__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['28']++;messageevent=eventmethod==='attachEvent'?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['7'][0]++,'onmessage'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['7'][1]++,'message');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['29']++;evententer(messageevent,function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['6']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['30']++;var message=JSON.parse(e.data);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['31']++;if(message.cmd==='ready'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['8'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['32']++;document.getElementById('submit').style.display='block';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['8'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['33']++;if(message.cmd==='notReady'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['9'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['34']++;document.getElementById('submit').style.display='none';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['9'][1]++;}},false);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['35']++;dialogue.set('bodyContent',bodycontent);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['36']++;aservername=this.get('servename');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['37']++;servername=aservername?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['10'][0]++,aservername):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['10'][1]++,defaultserver);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['38']++;IFSOURCE='https://'+servername+'/Panopto/Pages/Sessions/EmbeddedUpload.aspx'+playlistString+idstring;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['39']++;document.getElementById('pageframe').src=IFSOURCE;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['40']++;dialogue.show();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['41']++;this.markUpdated();},_getFormContent:function(clickedicon){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['7']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['42']++;var template,content,defaultserver,aservername;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['43']++;defaultserver=this.get('defaultserver');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['44']++;aservername=this.get('servename');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['45']++;servername=aservername?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['11'][0]++,aservername):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['11'][1]++,defaultserver);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['46']++;IFSOURCE='https://'+servername+'/Panopto/Pages/Sessions/EmbeddedUpload.aspx'+playlistString+idstring;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['47']++;template=Y.Handlebars.compile(TEMPLATE);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['48']++;content=Y.Node.create(template({elementid:this.get('host').get('elementid'),CSS:CSS,component:COMPONENTNAME,clickedicon:clickedicon,isource:IFSOURCE,iframeheight:IFHEIGHT,iframeID:IFID,submitid:SUBMITID,iframewidth:IFWIDTH,selectalign:SELECTALIGN}));__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['49']++;this._form=content;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['50']++;this._form.one('.'+CSS.INPUTSUBMIT).on('click',this._doInsert,this);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['51']++;return content;},_doInsert:function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['8']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['52']++;var win,message,eventmethod,evententer,messageevent,parent=this,eventfired=false;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['53']++;e.preventDefault();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['54']++;win=document.getElementById('pageframe').contentWindow;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['55']++;message={cmd:'createEmbeddedFrame'};__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['56']++;win.postMessage(JSON.stringify(message),'https://'+servername);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['57']++;eventmethod=window.addEventListener?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['12'][0]++,'addEventListener'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['12'][1]++,'attachEvent');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['58']++;evententer=window[eventmethod];__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['59']++;messageevent=eventmethod==='attachEvent'?(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['13'][0]++,'onmessage'):(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['13'][1]++,'message');__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['60']++;evententer(messageevent,function(e){__cov_iUVrcZyoIhQMjT$Lhpnd8A.f['9']++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['61']++;var message,objectstring,thumbnailChunk,idChunk,ids,names,PLAYLIST_EMBED_ID=1,i;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['62']++;if(!eventfired){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['14'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['63']++;message=JSON.parse(e.data);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['64']++;objectstring='';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['65']++;if(message.cmd==='deliveryList'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['15'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['66']++;ids=message.ids;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['67']++;names=message.names;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['68']++;for(i=0;i';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['70']++;if((__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['17'][0]++,message.playableObjectTypes)&&(__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['17'][1]++,parseInt(message.playableObjectTypes[i])===PLAYLIST_EMBED_ID)){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['16'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['71']++;idChunk='?pid='+ids[i];}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['16'][1]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['72']++;idChunk='?id='+ids[i];}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['73']++;if(typeof names[i]!=='undefined'){__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['18'][0]++;__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['74']++;thumbnailChunk+='';}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['18'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['75']++;thumbnailChunk+=''+'
';__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['76']++;objectstring+='
'+thumbnailChunk+'
'+'
'+'
';}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['77']++;parent.getDialogue({focusAfterHide:null}).hide();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['78']++;parent.editor.focus();__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['79']++;parent.get('host').insertContentAtFocusPoint(objectstring);__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['80']++;parent.markUpdated();}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['15'][1]++;}__cov_iUVrcZyoIhQMjT$Lhpnd8A.s['81']++;eventfired=true;}else{__cov_iUVrcZyoIhQMjT$Lhpnd8A.b['14'][1]++;}},false);}},{ATTRS:{disabled:{value:false},usercontextid:{value:null},defaultserver:{value:''},coursecontext:{value:null},servename:{value:null}}});},'@VERSION@',{'requires':['moodle-editor_atto-plugin']}); diff --git a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-debug.js b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-debug.js index 95c5e1a..9d425e3 100644 --- a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-debug.js +++ b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-debug.js @@ -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', @@ -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(); @@ -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, @@ -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'; @@ -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); diff --git a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-min.js b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-min.js index beb2a7b..0b71068 100644 --- a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-min.js +++ b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_panoptobutton-button",function(e,t){var n="atto_panoptobutton",r="",i="",s="",o="?playlistsEnabled=true";IFSOURCE=r+"/Panopto/Pages/Sessions/EmbeddedUpload.aspx",IFHEIGHT=550,IFWIDTH=1060,IFID="pageframe",SUBMITID="submit",SELECTALIGN="float:left; display:none",CSS={INPUTSUBMIT:"atto_media_urlentrysubmit"},TEMPLATE='


',e.namespace("M.atto_panoptobutton").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){if(this.get("disabled"))return;i=this.get("coursecontext"),i&&(s="&folderID="+i);var e="iconone";this.addButton({icon:"ed/"+e,iconComponent:"atto_panoptobutton",buttonName:e,callback:this._displayDialogue,callbackArgs:e})},_displayDialogue:function(t,i){var u=1150,a=720,f=this.getDialogue({headerContent:M.util.get_string("dialogtitle",n),width:u+"px",height:a+"px",focusAfterHide:i}),l,c,h,p,d,v,m;t.preventDefault(),f.after("visibleChange",function(){var e=f.getAttrs();e.visible===!1&&setTimeout(function(){f.reset()},5)}),f.width!==u+"px"&&f.set("width",u+"px"),f.height!==a+"px"&&f.set("height",a+"px"),l=this._getFormContent(i),c=e.Node.create("
"),c.append(l),h=this.get("defaultserver"),p=window.addEventListener?"addEventListener":"attachEvent",d=window[p],v=p==="attachEvent"?"onmessage":"message",d(v,function(e){var t=JSON.parse(e.data);t.cmd==="ready"&&(document.getElementById("submit").style.display="block"),t.cmd==="notReady"&&(document.getElementById("submit").style.display="none")},!1),f.set("bodyContent",c),m=this.get("servename"),m?(document.getElementById("pageframe").src="https://"+m+"/Panopto/Pages/Sessions/EmbeddedUpload.aspx"+o+s,r=m):(document.getElementById("pageframe").src="https://"+h+"/Panopto/Pages/Sessions/EmbeddedUpload.aspx"+o+s,r=h),f.show(),this.markUpdated()},_getFormContent:function(t){var r=e.Handlebars.compile(TEMPLATE),i=e.Node.create(r({elementid:this.get("host").get("elementid"),CSS:CSS,component:n,clickedicon:t,isource:IFSOURCE+o+s,iframeheight:IFHEIGHT,iframeID:IFID,submitid:SUBMITID,iframewidth:IFWIDTH,selectalign:SELECTALIGN}));return this._form=i,this._form.one("."+CSS.INPUTSUBMIT).on("click",this._doInsert,this),i},_doInsert:function(e){var t,n,i,s,o,u=this,a=!1;e.preventDefault(),t=document.getElementById("pageframe").contentWindow,n={cmd:"createEmbeddedFrame"},t.postMessage(JSON.stringify(n),"https://"+r),i=window.addEventListener?"addEventListener":"attachEvent",s=window[i],o=i==="attachEvent"?"onmessage":"message",s(o,function(e){var t,n,i,s,o,f,l=1,c=0,h;if(!a){t=JSON.parse(e.data),n="";if(t.cmd==="deliveryList"){o=t.ids,f=t.names;for(h=0;h",t.playableObjectTypes&&parseInt(t.playableObjectTypes[h])===l?s="?pid="+o[h]:s="?id="+o[h],typeof f[h]!="undefined"&&(i+=""),i+=""+"
",n+="
"+i+"
"+"
"+"
";u.getDialogue({focusAfterHide:null}).hide(),u.editor.focus(),u.get("host").insertContentAtFocusPoint(n),u.markUpdated()}a=!0}},!1)}},{ATTRS:{disabled:{value:!1},usercontextid:{value:null},defaultserver:{value:""},coursecontext:{value:null},servename:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); +YUI.add("moodle-atto_panoptobutton-button",function(l,e){var p="atto_panoptobutton",m="",t="",u="",c="?playlistsEnabled=true",h="",o={INPUTSUBMIT:"atto_media_urlentrysubmit"};l.namespace("M.atto_panoptobutton").Button=l.Base.create("button",l.M.editor_atto.EditorPlugin,[],{initializer:function(){if(!this.get("disabled")){(t=this.get("coursecontext"))&&(u="&folderID="+t);var e="iconone";this.addButton({icon:"ed/"+e,iconComponent:"atto_panoptobutton",buttonName:e,callback:this._displayDialogue,callbackArgs:e})}},_displayDialogue:function(e,t){var i,a,n,o,s,d=1150,r=this.getDialogue({headerContent:M.util.get_string("dialogtitle",p),width:d+"px",height:"720px",focusAfterHide:t});e.preventDefault(),r.after("visibleChange",function(){!1===r.getAttrs().visible&&setTimeout(function(){r.reset()},5)}),r.width!==d+"px"&&r.set("width",d+"px"),"720px"!==r.height&&r.set("height","720px"),i=this._getFormContent(t),(a=l.Node.create("
")).append(i),n=this.get("defaultserver"),o=window.addEventListener?"addEventListener":"attachEvent",(0,window[o])("attachEvent"===o?"onmessage":"message",function(e){var t=JSON.parse(e.data);"ready"===t.cmd&&(document.getElementById("submit").style.display="block"),"notReady"===t.cmd&&(document.getElementById("submit").style.display="none")},!1),r.set("bodyContent",a),s=this.get("servename"),h="https://"+(m=s||n)+"/Panopto/Pages/Sessions/EmbeddedUpload.aspx"+c+u,document.getElementById("pageframe").src=h,r.show(),this.markUpdated()},_getFormContent:function(e){var t,i,a,n;return a=this.get("defaultserver"),n=this.get("servename"),h="https://"+(m=n||a)+"/Panopto/Pages/Sessions/EmbeddedUpload.aspx"+c+u,t=l.Handlebars.compile('


'),i=l.Node.create(t({elementid:this.get("host").get("elementid"),CSS:o,component:p,clickedicon:e,isource:h,iframeheight:550,iframeID:"pageframe",submitid:"submit",iframewidth:1060,selectalign:"float:left; display:none"})),this._form=i,this._form.one("."+o.INPUTSUBMIT).on("click",this._doInsert,this),i},_doInsert:function(e){var t,i,r=this,l=!1;e.preventDefault(),t={cmd:"createEmbeddedFrame"},document.getElementById("pageframe").contentWindow.postMessage(JSON.stringify(t),"https://"+m),i=window.addEventListener?"addEventListener":"attachEvent",(0,window[i])("attachEvent"===i?"onmessage":"message",function(e){var t,i,a,n,o,s,d;if(!l){if(i="","deliveryList"===(t=JSON.parse(e.data)).cmd){for(o=t.ids,s=t.names,d=0;d",n=t.playableObjectTypes&&1===parseInt(t.playableObjectTypes[d])?"?pid="+o[d]:"?id="+o[d],"undefined"!=typeof s[d]&&(a+=""),i+="
"+(a+="
")+"

";r.getDialogue({focusAfterHide:null}).hide(),r.editor.focus(),r.get("host").insertContentAtFocusPoint(i),r.markUpdated()}l=!0}},!1)}},{ATTRS:{disabled:{value:!1},usercontextid:{value:null},defaultserver:{value:""},coursecontext:{value:null},servename:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js index 95c5e1a..9d425e3 100644 --- a/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js +++ b/yui/build/moodle-atto_panoptobutton-button/moodle-atto_panoptobutton-button.js @@ -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', @@ -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(); @@ -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, @@ -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'; @@ -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); diff --git a/yui/src/button/js/button.js b/yui/src/button/js/button.js index a7b448a..b6aebf2 100644 --- a/yui/src/button/js/button.js +++ b/yui/src/button/js/button.js @@ -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', @@ -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(); @@ -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, @@ -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'; @@ -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);