Created
March 15, 2024 21:30
-
-
Save robisatthefunction/5620102f1ebdffe7600146ae0abd1e40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugin_type": "widget", | |
"name": "Text Change: Hydration Compatible", | |
"edit_page_url": "atticandbutton.us", | |
"form_schema": [ | |
{ | |
"default_value": ".hero__title", | |
"name": "selector", | |
"field_type": "selector", | |
"options": null, | |
"label": "selector" | |
}, | |
{ | |
"default_value": "Hello", | |
"name": "text", | |
"field_type": "text", | |
"options": null, | |
"label": "text" | |
} | |
], | |
"description": "", | |
"options": { | |
"html": "", | |
"css": "", | |
"apply_js": "var utils = window.optimizely.get('utils');\n\n//https://docs.developers.optimizely.com/web/docs/utilities#section-observe-selector\nutils.observeSelector(extension.selector, function(element) {\n element.innerHTML = extension.text;\n}, {\n \"timeout\": 1000000,\n \"once\": false,\n \"onTimeout\": function() {\n console.log(\"Stopped observing\");\n }\n});\n\n", | |
"undo_js": "var extensionElement = document.getElementById('optimizely-extension-' + extension.$instance);\nif (extensionElement) {\n extensionElement.parentElement.removeChild(extensionElement);\n}\n" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment