]> _ Git - fluidbook-html5.git/commitdiff
wait #3679 @0:15
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jun 2020 13:00:29 +0000 (15:00 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jun 2020 13:00:29 +0000 (15:00 +0200)
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/links/fluidbook.links.zoom.js
js/main.js

index c51e286d371cf314fba81951191f81b7a4b4ec25..4d4acd06b2a8687f7de917d0a413031d83dea1d0 100644 (file)
@@ -651,11 +651,11 @@ FluidbookMenu.prototype = {
                 break;
             case 'article':
                 h = hh * 0.9;
-                w = Math.min(ww,1000);
-                if(ww<800){
-                    w=ww;
-                    h=hh;
-                    fullscreen=true;
+                w = Math.min(ww, 1000);
+                if (ww < 800) {
+                    w = ww;
+                    h = hh;
+                    fullscreen = true;
                 }
                 break;
             case 'iframe':
@@ -723,6 +723,11 @@ FluidbookMenu.prototype = {
             case 'webvideo':
                 var w = Math.max(ww * 0.8, 600);
                 h = (w / 16) * 9;
+                if (h > hh * 0.9) {
+                    h = hh * 0.9;
+                    w = (h / 9) * 16;
+                }
+
                 forceHeight = true;
                 if (w > ww * 0.9) {
                     fullscreen = true;
index 1ae8feff1b7bdb8f5cdbf145729af7f652193788..d681d15dc19adaee0a73f73dd4a2c98f2dfb8ad7 100644 (file)
@@ -200,7 +200,7 @@ FluidbookLinksZoom.prototype = {
                         if (action === 'link') {
                             menu += 'href="' + data + '"  target="_blank"';
                         } else if (action === 'copy') {
-                            menu += 'data-clipboard-text="' + encodeURIComponent(data) + '" ';
+                            menu += 'data-clipboard-text="' + escapeHtml(data) + '" ';
                         } else if (action === 'video') {
                             var e = data.split(':', 2);
                             menu += ' href="#/webvideo/' + e[0] + '/' + e[1] + '" ';
index 7f317b88ba80ca8cb7e15aec8163c074e997244f..8f3105ad0247036b4cb4a993af7956640db66f61 100644 (file)
@@ -526,6 +526,15 @@ function getPublicationURL(id) {
     return url;
 }
 
+function escapeHtml(text) {
+    return text
+        .replace(/&/g, "&amp;")
+        .replace(/</g, "&lt;")
+        .replace(/>/g, "&gt;")
+        .replace(/"/g, "&quot;")
+        .replace(/'/g, "&#039;");
+}
+
 $(function () {
     $.fn.isLoaded = function () {
         if ($(this).length === 0) {