practisemaster 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/PMbundle.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,3 +30,33 @@ See https://github.com/StephanLuis/BrowserStackSelenium/blob/main/TestURLs/PMtes
|
|
|
30
30
|
# Display Flowchart
|
|
31
31
|
|
|
32
32
|
https://drive.google.com/drive/folders/1KXWqXpzDOVReIaBMAkTHVmr0r4kKMGL6?usp=sharing
|
|
33
|
+
|
|
34
|
+
# Class Diagram
|
|
35
|
+
|
|
36
|
+
```Mermaid
|
|
37
|
+
graph TD;
|
|
38
|
+
LoopEditorWebComp<..PractiseMasterWebComp;
|
|
39
|
+
PractiseMasterWebComp ..> HTMLElement;
|
|
40
|
+
PractiseMasterWebComp*..PageSupport;
|
|
41
|
+
PractiseMasterWebComp*..PractiseMaster;
|
|
42
|
+
PageSupport*..HostSite;
|
|
43
|
+
PageSupport*..Helpers;
|
|
44
|
+
PageSupport*..UserRequest;
|
|
45
|
+
PractiseMaster*..Player;
|
|
46
|
+
Player*..Plyr;
|
|
47
|
+
Player*..Loop;
|
|
48
|
+
Loop<..Chapter;
|
|
49
|
+
Player*..UIprep;
|
|
50
|
+
UserRequest*..UAParser;
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
# Mermaid Demo
|
|
55
|
+
|
|
56
|
+
```mermaid
|
|
57
|
+
graph TD;
|
|
58
|
+
A-->B;
|
|
59
|
+
A-->C;
|
|
60
|
+
B-->D;
|
|
61
|
+
C-->D;
|
|
62
|
+
```
|
package/dist/PMbundle.js
CHANGED
|
@@ -223,7 +223,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
223
223
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
224
224
|
|
|
225
225
|
"use strict";
|
|
226
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _pageSupport_pm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pageSupport-pm */ \"./src/modules/pageSupport-pm.js\");\n/* harmony import */ var _practiseMaster__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./practiseMaster */ \"./src/modules/practiseMaster.js\");\n/**\n * module allows for the newing of a PractiseMaster class \n * a global window.PractiseMaster is created\n * \n * @module PractiseMaster Module\n * @requires Player Module\n * @requires PageSupport Module\n */\n\n\n\n\n\n\n/**\n * entry point for PractiseMaster js plugin: new PractiseMaster();\n * @class PractiseMaster\n * @property {mehtod} globals() - returns window.PractiseMaster\n * @property {method} player() - news up a Player class for each pm class element\n * @property {declaration} getElementsByClassName(\"pm\") - Elements to update with a player \n * @property {declaration} getElementsByClassName(\"pmlinkbuilder\") - Elements to update with a player \n * @property {class} PageSupport(siteCSS) - news this up with any site specific css\n * @property {object} siteCSS - an object for css specific to the host site (ex WordPress)\n */\n\nclass PractiseMasterWebComp extends HTMLElement {\n\n // static observedAttributes = [\"color\", \"size\"];\n\n\n constructor() {\n\n // Always call super first in constructor\n super();\n\n // to hold elements for player()\n // with WebComponenet will only be one (no longer array)\n\n
|
|
226
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _pageSupport_pm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pageSupport-pm */ \"./src/modules/pageSupport-pm.js\");\n/* harmony import */ var _practiseMaster__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./practiseMaster */ \"./src/modules/practiseMaster.js\");\n/**\n * module allows for the newing of a PractiseMaster class \n * a global window.PractiseMaster is created\n * \n * @module PractiseMaster Module\n * @requires Player Module\n * @requires PageSupport Module\n */\n\n\n\n\n\n\n/**\n * entry point for PractiseMaster js plugin: new PractiseMaster();\n * @class PractiseMaster\n * @property {mehtod} globals() - returns window.PractiseMaster\n * @property {method} player() - news up a Player class for each pm class element\n * @property {declaration} getElementsByClassName(\"pm\") - Elements to update with a player \n * @property {declaration} getElementsByClassName(\"pmlinkbuilder\") - Elements to update with a player \n * @property {class} PageSupport(siteCSS) - news this up with any site specific css\n * @property {object} siteCSS - an object for css specific to the host site (ex WordPress)\n */\n\nclass PractiseMasterWebComp extends HTMLElement {\n\n // static observedAttributes = [\"color\", \"size\"];\n\n\n constructor() {\n\n // Always call super first in constructor\n super();\n\n // to hold elements for player()\n // with WebComponenet will only be one (no longer array)\n\n // this.pmElement;\n\n }\n\n\n connectedCallback() {\n\n this.initialiseContainers();\n\n }\n\n\n\n /**\n * As a temp solution to Plyr not taking P-M custom elements\n * @method\n */\n\n initialiseContainers() {\n\n\n // const PMwebcomp = document.querySelectorAll(\"practise-master\");\n\n\n // // check user has added data attributes\n\n\n // if (this.dataset.plyrProvider !== 'mp3' && this.dataset.plyrProvider !== 'mp4' && this.dataset.plyrProvider !== 'ogg' ) {\n // if ((!this.hasAttribute(\"data-plyr-embed-id\") || !this.hasAttribute(\"data-plyr-provider\"))) {\n // // data attribute doesn't exist\n\n\n // const errorText = `Error: each <practise-master> needs both 'data-plyr-embed-id' and 'data-plyr-provider' `;\n\n // this.textContent = errorText;\n\n // throw new Error(errorText);\n\n // }\n // }\n\n\n function cloneRemoveAttributes(target, source) {\n\n [...source.attributes].forEach(attr => { target.setAttribute(attr.nodeName, attr.nodeValue); source.removeAttribute(attr.name) });\n\n }\n\n\n function replaceWithDiv(node) {\n\n var pmdiv = document.createElement('div');\n\n cloneRemoveAttributes(pmdiv, node);\n\n node.classList.add('container');\n\n pmdiv.classList.add('pm');\n\n node.appendChild(pmdiv);\n\n }\n\n\n function replaceWithVideo(node) {\n\n\n var pmdiv = document.createElement('video');\n\n cloneRemoveAttributes(pmdiv, node);\n\n node.classList.add('container');\n\n pmdiv.classList.add('pm');\n\n // also need to copy all children to the new node\n // https://stackoverflow.com/a/56307130/2455159\n\n pmdiv.append(...node.childNodes);\n\n node.appendChild(pmdiv);\n\n }\n\n\n function replaceWithAudio(node) {\n\n\n var pmdiv = document.createElement('audio');\n\n cloneRemoveAttributes(pmdiv, node);\n\n node.classList.add('container');\n\n pmdiv.classList.add('pm');\n\n // also need to copy all children to the new node\n // https://stackoverflow.com/a/56307130/2455159\n\n pmdiv.append(...node.childNodes);\n\n node.appendChild(pmdiv);\n\n }\n\n\n\n\n\n if (this.dataset.plyrProvider === 'vimeo' || this.dataset.plyrProvider === 'youtube') {\n\n replaceWithDiv(this);\n\n } else if (this.dataset.plyrProvider === 'mp4') {\n\n replaceWithVideo(this);\n\n } else if (this.dataset.plyrProvider === 'mp3') {\n\n replaceWithAudio(this);\n\n }\n\n\n\n\n // then need to new up a PractiseMaster class\n // only want one of these (per page) once init'd then pass array of elements then call PM.player()\n\n window.PMpageSupport = new _pageSupport_pm__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n window.PractiseMaster = new _practiseMaster__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this);\n\n this.globals();\n\n\n }\n\n\n \n /**\n * instantiates any global variables from the PractiseMaster class\n * @method\n */\n\n globals() {\n\n\n window.PractiseMaster.Loop = (x, y, z) => { return window.PMpageSupport.PMloop(x, y, z); };\n\n\n window.PractiseMaster.Chapter = (x, y, z) => { return window.PMpageSupport.PMchapter(x, y, z); };\n\n\n // window.PractiseMaster.PMloop = function (id, startTime, endTime) { return window.PractiseMaster.PageSupport.PMloop(id, startTime, endTime) };\n // window.PractiseMaster.PMchapter = function (id, startTime, endTime) { return window.PractiseMaster.PageSupport.PMloop(id, startTime, endTime) };\n\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PractiseMasterWebComp);\n\n//# sourceURL=webpack://practisemaster/./src/modules/practisemasterWebComponent.js?");
|
|
227
227
|
|
|
228
228
|
/***/ }),
|
|
229
229
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "practisemaster",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "This is the PractiseMaster repo, treat it with respect! [](https://gitpod.io/#https://github.com/StephanLuis/PractiseMaster)",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"input-duration": "^2.2.3",
|