Skip to content

Commit 113a912

Browse files
committed
Make this an iframe
1 parent 3f9ecef commit 113a912

11 files changed

Lines changed: 53 additions & 585 deletions

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1+
# Cantemo iframe plugin
12

2-
# TODO:
3-
- ✅ Create buttons with javascript
4-
- ✅ Get user role from cantemo
5-
- ✅ Get item id from cantemo
6-
- ✅ Create a startManualRule function which takes a process_id
7-
- ✅ Create buttons based on config file.
8-
- ✅ Clean up names (no myplugin)
9-
-[ ]
10-
<br/>
3+
This Cantemo plugin embeds an external tool as an `<iframe>` in the media item
4+
view. It hooks into `MediaViewItemTechMetadataTop` and renders the iframe with
5+
the current item's ID appended as a query parameter, e.g.:
116

12-
## METADATA
13-
- ✅ generate different buttons depending on item type (maby through metadat, different itemtypes have different metadata)
7+
```
8+
https://tools.bcc.media/cantemo/?id=VX-2
9+
```
1410

15-
<br/>
11+
## Changing the target URL
1612

17-
## BUGS
18-
- when portal window is in mobile view you can´t click the buttons
13+
Edit the `src` of the iframe in
14+
[`templates/manual_rule_button_plugin.html`](templates/manual_rule_button_plugin.html).
15+
`{{ item_id }}` is the Cantemo item id (e.g. `VX-2`) supplied by the plugin
16+
context.
1917

20-
<br/>
18+
## Install
19+
20+
Run `install.sh` as root on the Cantemo host. It copies the plugin into
21+
`/opt/cantemo/portal/portal/plugins/`, runs `syncdata`, and restarts portal.
2122

2223
## The args object
2324

24-
The args object on `IPluginBlock.return_str`.
25+
The `args` object on `IPluginBlock.return_string` (hook
26+
`MediaViewItemTechMetadataTop`):
2527

2628
```json
27-
[ // This is a tuple
29+
[
2830
[
2931
"pluginblock",
3032
"MediaViewItemTechMetadataTop"
3133
],
32-
{ // This is a dict
34+
{
3335
"item": "<<non-serializable: VSItem>>",
3436
"user": "<<non-serializable: SimpleLazyObject>>",
3537
"request": "<<non-serializable: Request>>",
@@ -44,5 +46,3 @@ The args object on `IPluginBlock.return_str`.
4446
}
4547
]
4648
```
47-
48-
User groups: {{user_groups}}

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
'''
44
from .plugin import *
55

6-
__version__ = "1.0.1"
6+
__version__ = "1.1.0"

install.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/bash
22
set -o pipefail
33

4-
# path to config file that you wnat to use
54
PORTAL_ROOT="/opt/cantemo/portal"
6-
CONFIG_FILE="$PORTAL_ROOT/portal_media/js/bccm-config.js"
75
PLUGIN_NAME="ManualRuleButtonPlugin"
86

97
if [ $(id -u) -ne 0 ]
@@ -20,14 +18,6 @@ fi
2018

2119
mkdir -pv $PORTAL_ROOT/portal/plugins/$PLUGIN_NAME
2220
cp -rv $DIR/* $PORTAL_ROOT/portal/plugins/$PLUGIN_NAME
23-
cp -rv $DIR/js/* $PORTAL_ROOT/portal_media/js/
24-
25-
if [ -f "$CONFIG_FILE" ]; then
26-
echo "$CONFIG_FILE exists."
27-
else
28-
echo "$CONFIG_FILE does not exist."
29-
cp -v $DIR/js/bccm-example-config.js $CONFIG_FILE
30-
fi
3121

3222
echo "Done."
3323

js/bccm-colours.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

js/bccm-customizations.js

Lines changed: 0 additions & 127 deletions
This file was deleted.

js/bccm-example-config.js

Lines changed: 0 additions & 91 deletions
This file was deleted.

js/bccm-groups.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

js/bccm-metadata.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)