2014-12-11 12:07:41 +09:00
|
|
|
// Custom Post Property
|
|
|
|
|
2014-12-08 10:28:56 +09:00
|
|
|
var customProperty = {
|
|
|
|
propertyName: 'customProperty',
|
|
|
|
propertySchema: {
|
2014-12-11 12:07:41 +09:00
|
|
|
type: String, // property type
|
|
|
|
label: 'customLabel', // key string used for internationalization
|
|
|
|
optional: true, // make this property optional
|
2014-12-08 10:28:56 +09:00
|
|
|
autoform: {
|
2014-12-11 12:07:41 +09:00
|
|
|
editable: true, // make this property editable by users
|
|
|
|
type: "bootstrap-datetimepicker" // assign a custom input type
|
2014-12-08 10:28:56 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-12-11 12:07:41 +09:00
|
|
|
addToPostSchema.push(customProperty);
|
|
|
|
|
|
|
|
// Custom Setting
|
|
|
|
|
|
|
|
var customSetting = {
|
|
|
|
propertyName: 'customSetting',
|
|
|
|
propertySchema: {
|
|
|
|
type: String,
|
|
|
|
optional: true,
|
|
|
|
autoform: {
|
|
|
|
group: 'customGroup', // assign custom group (fieldset) in Settings form
|
|
|
|
private: true // mark as private (not published to client)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addToSettingsSchema.push(customSetting);
|
|
|
|
|
|
|
|
// Global Function
|
|
|
|
|
|
|
|
myFunction = function (a, b) {
|
|
|
|
return a + b;
|
|
|
|
}
|