]> _ Git - fluidbook_tools.git/commitdiff
wip #5844 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Apr 2023 12:47:39 +0000 (14:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Apr 2023 12:47:39 +0000 (14:47 +0200)
src/Links/Link.php
src/Links/PDFPopupLink.php [new file with mode: 0644]

index 1e926939ffb33475bd4fd3e6c5f89370fee0f905..c88b17c72a58471ef2a2601b899e6272bd45608c 100644 (file)
@@ -215,8 +215,9 @@ class Link {
                 }
                 break;
             case 39:
-
                 return new LayerLink($id, $init, $compiler);
+            case 41:
+                return new PDFPopupLink($id, $init, $compiler);
             default:
                 return null;
         }
diff --git a/src/Links/PDFPopupLink.php b/src/Links/PDFPopupLink.php
new file mode 100644 (file)
index 0000000..4f03f02
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+namespace Fluidbook\Tools\Links;
+
+class PDFPopupLink extends NormalLink {
+    public function getDefaultTooltip() {
+        return 'click to open the document';
+    }
+
+    public function getURL() {
+        $this->copyExternalFile($this->to);
+        return '#/pdf/' . $this->to;
+    }
+}