aboutsummaryrefslogtreecommitdiff
path: root/plugin.rb
diff options
context:
space:
mode:
authorrealitygaps <realitygaps@weho.st>2018-11-12 20:23:18 +0100
committerrealitygaps <realitygaps@weho.st>2018-11-12 20:23:18 +0100
commitf96eb3440b6f0af0524197210c49de0e45775adf (patch)
tree700af6982ba7441936bdb92a6a8e68c657282d7f /plugin.rb
downloaddiscourse-pad-f96eb3440b6f0af0524197210c49de0e45775adf.tar.gz
Initial commit
Diffstat (limited to 'plugin.rb')
-rw-r--r--plugin.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin.rb b/plugin.rb
new file mode 100644
index 0000000..e0cbd8d
--- /dev/null
+++ b/plugin.rb
@@ -0,0 +1,15 @@
+# name: embed-codimd
+# about: Embed codimd pads using Onebox. Based on https://github.com/fuerst/embed-etherpad-lite
+# version: 0.1
+# author: realitygaps
+# url: https://lab.libreho.st/librehosters/embed-codimd
+
+class Onebox::Engine::CodimdOnebox
+ include Onebox::Engine
+ #we only want to match for a specific codimd domain
+ matches_regexp /pad.libreho.st/
+
+ def to_html
+ "<iframe name='embed_readwrite' src='#{@url}' style='border-width:0' frameborder='0' scrolling='no' width='100%' height=600></iframe><br><a href='#{@url}' target='_blank'>Goto this Pad</a>"
+ end
+end