changeset 2493:09936f12f885

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Thu, 25 Aug 2016 11:20:50 +0100
parents 41346c364ac1 (current diff) f0b0809c7ee5 (diff)
children 21cd592fc15b
files
diffstat 3 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/css/core.css	Mon Aug 08 14:20:59 2016 +0100
+++ b/css/core.css	Thu Aug 25 11:20:50 2016 +0100
@@ -51,6 +51,12 @@
     overflow: auto;
 }
 
+div#popupContent iframe {
+    width: 100%;
+    border: 0px none;
+    height: 290px;
+}
+
 div#popupTitleHolder {
     width: inherit;
     min-height: 25px;
--- a/js/core.js	Mon Aug 08 14:20:59 2016 +0100
+++ b/js/core.js	Thu Aug 25 11:20:50 2016 +0100
@@ -810,7 +810,16 @@
 			this.popupResponse.appendChild(input);
             this.popupResponse.style.textAlign="center";
             this.popupResponse.style.left="0%";
-		}
+		} else if (node.specification.type == "video") {
+            var video = document.createElement("video");
+            video.src = node.specification.url;
+            this.popupResponse.appendChild(video);
+        } else if (node.specification.type == "youtube") {
+            var iframe = document.createElement("iframe");
+            iframe.className = "youtube";
+            iframe.src = node.specification.url;
+            this.popupResponse.appendChild(iframe);
+        }
 		if(this.currentIndex+1 == this.popupOptions.length) {
 			if (this.node.location == "pre") {
 				this.buttonProceed.textContent = 'Start';
@@ -1060,6 +1069,7 @@
 			this.postNode();
 		} else {
 			// Reached the end of the popupOptions
+            this.popupContent.innerHTML = "";
 			this.hidePopup();
 			for (var node of this.popupOptions)
 			{
--- a/xml/test-schema.xsd	Mon Aug 08 14:20:59 2016 +0100
+++ b/xml/test-schema.xsd	Thu Aug 25 11:20:50 2016 +0100
@@ -280,6 +280,8 @@
                                         <xs:enumeration value="number" />
                                         <xs:enumeration value="radio" />
                                         <xs:enumeration value="checkbox" />
+                                        <xs:enumeration value="video" />
+                                        <xs:enumeration value="youtube" />
                                     </xs:restriction>
                                 </xs:simpleType>
                             </xs:attribute>
@@ -293,6 +295,7 @@
                                     </xs:restriction>
                                 </xs:simpleType>
                             </xs:attribute>
+                            <xs:attribute name="url" type="xs:string" use="optional"/>
                         </xs:complexType>
                     </xs:element>
                 </xs:sequence>