-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.html
28 lines (28 loc) · 918 Bytes
/
extension.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://contentful.github.io/ui-extensions-sdk/cf-extension.css">
<script src="https://unpkg.com/contentful-ui-extensions-sdk@3"></script>
</head>
<body>
<div class="cf-form-field">
<input type="text" class="cf-form-input">
<div class="cf-form-hint">I am a UI Extension with a default value:
<span class="default-value"></span>
</div>
</div>
<script>
'use strict';
window.contentfulExtension.init(function (extension) {
extension.window.startAutoResizer();
var inputEl = document.querySelector('.cf-form-input');
var hintEl = document.querySelector('.cf-form-hint');
extension.field.setValue(extension.parameters.instance.category);
inputEl.value = extension.parameters.instance.category;
inputEl.disabled = true;
hintEl.style.display = 'none';
});
</script>
</body>
</html>