2019-10-23 12:30:52 -04:00
|
|
|
import Component from "@ember/component";
|
2019-11-07 16:38:28 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2022-05-13 11:56:23 -04:00
|
|
|
import { dasherize } from "@ember/string";
|
2015-08-20 13:43:12 -04:00
|
|
|
|
2019-10-23 12:30:52 -04:00
|
|
|
export default Component.extend({
|
2015-08-20 13:43:12 -04:00
|
|
|
classNames: ["embed-setting"],
|
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("field")
|
2015-08-20 13:43:12 -04:00
|
|
|
inputId(field) {
|
2022-05-13 11:56:23 -04:00
|
|
|
return dasherize(field);
|
2015-08-20 13:43:12 -04:00
|
|
|
},
|
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("field")
|
2015-08-20 13:43:12 -04:00
|
|
|
translationKey(field) {
|
|
|
|
return `admin.embedding.${field}`;
|
|
|
|
},
|
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("type")
|
2015-08-20 13:43:12 -04:00
|
|
|
isCheckbox(type) {
|
|
|
|
return type === "checkbox";
|
|
|
|
},
|
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("value")
|
2015-08-20 13:43:12 -04:00
|
|
|
checked: {
|
|
|
|
get(value) {
|
|
|
|
return !!value;
|
|
|
|
},
|
|
|
|
set(value) {
|
2015-10-11 08:48:37 -04:00
|
|
|
this.set("value", value);
|
2015-08-20 13:43:12 -04:00
|
|
|
return value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|