-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathconfig.json
More file actions
61 lines (61 loc) · 1.64 KB
/
config.json
File metadata and controls
61 lines (61 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
"plugin_type": "widget",
"name": "Extension Template",
"edit_page_url": "www.optimizely.com",
"form_schema": [
{
"default_value": "beforebegin",
"field_type": "dropdown",
"name": "position",
"label": "Position",
"options": {
"choices": [
{
"value": "beforebegin",
"label": "Before"
},
{
"value": "afterend",
"label": "After"
},
{
"value": "afterbegin",
"label": "At Beginning"
},
{
"value": "beforeend",
"label": "At End Of"
}
]
}
},
{
"default_value": "",
"field_type": "selector",
"name": "selector",
"label": "Selector",
"options": null
},
{
"default_value": "Title Text",
"field_type": "text",
"name": "title",
"label": "title",
"options": null
},
{
"default_value": "Text",
"field_type": "text",
"name": "text",
"label": "text",
"options": null
}
],
"description": "",
"options": {
"html": "<div id=\"optimizely-extension-{{ extension.$instance }}\"> \n\t\n</div>\n",
"css": "",
"apply_js": "var utils = optimizely.get('utils');\n\nutils.waitForElement('body')\n .then(function(elem) {\n\t\tdocument.querySelector(extension.selector).insertAdjacentHTML(extension.position, extension.$html);\n});\n",
"undo_js": "if (document.getElementById(\"optimizely-extension-\" + extension.$instance)){\n\tdocument.getElementById(\"optimizely-extension-\" + extension.$instance).remove();\n}"
}
}