parent
b00279885f
commit
cc6f698053
@ -1,7 +1,48 @@
|
||||
var LabsController = Ember.Controller.extend(Ember.Evented, {
|
||||
var LabsController = Ember.ObjectController.extend(Ember.Evented, {
|
||||
uploadButtonText: 'Import',
|
||||
importErrors: '',
|
||||
|
||||
saveLabs: function (optionName, optionValue) {
|
||||
var labsConfig = this.get('labs'),
|
||||
labsJSON = (this.get('labs')) ? JSON.parse(labsConfig) : {};
|
||||
|
||||
// Set new value in the JSON object
|
||||
labsJSON[optionName] = optionValue;
|
||||
|
||||
this.set('labs', JSON.stringify(labsJSON));
|
||||
|
||||
this.get('model').save().catch(function (errors) {
|
||||
self.showErrors(errors);
|
||||
self.get('model').rollback();
|
||||
});
|
||||
},
|
||||
|
||||
useTagsUI: Ember.computed('tagsUI', function (key, value) {
|
||||
// setter
|
||||
if (arguments.length > 1) {
|
||||
this.saveLabs('tagsUI', value);
|
||||
}
|
||||
|
||||
// getter
|
||||
var labsConfig = (this.get('labs')) ? JSON.parse(this.get('labs')) : false;
|
||||
|
||||
|
||||
return (labsConfig.tagsUI) ? labsConfig.tagsUI : false;
|
||||
}),
|
||||
|
||||
useCodeInjectionUI: Ember.computed('codeInjectionUI', function (key, value) {
|
||||
// setter
|
||||
if (arguments.length > 1) {
|
||||
this.saveLabs('codeInjectionUI', value);
|
||||
}
|
||||
|
||||
// getter
|
||||
var labsConfig = (this.get('labs')) ? JSON.parse(this.get('labs')) : false;
|
||||
|
||||
|
||||
return (labsConfig.codeInjectionUI) ? labsConfig.codeInjectionUI : false;
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onUpload: function (file) {
|
||||
var self = this,
|
||||
|
@ -16,7 +16,8 @@ var Setting = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||
activeTheme: DS.attr('string'),
|
||||
availableThemes: DS.attr(),
|
||||
ghost_head: DS.attr('string'),
|
||||
ghost_foot: DS.attr('string')
|
||||
ghost_foot: DS.attr('string'),
|
||||
labs: DS.attr('string')
|
||||
});
|
||||
|
||||
export default Setting;
|
||||
|
@ -44,4 +44,31 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<form>
|
||||
<fieldset>
|
||||
<div class="form-group for-checkbox">
|
||||
<label for="labs-tagsUI">Tag Management</label>
|
||||
<label class="checkbox" for="labs-tagsUI">
|
||||
{{input id="labs-tagsUI" name="labs[tagsUI]" type="checkbox" checked=useTagsUI}}
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>Enable the tag management interface (work in progress)</p>
|
||||
<p>A settings screen which enables you to add, edit and delete tags</p>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group for-checkbox">
|
||||
<label for="labs-codeInjectionUI">Code Injection</label>
|
||||
<label class="checkbox" for="labs-codeInjectionUI">
|
||||
{{input id="labs-codeInjectionUI" name="labs[codeInjectionUI]" type="checkbox" checked=useCodeInjectionUI}}
|
||||
<span class="input-toggle-component"></span>
|
||||
<p>Enable the code injection interface (work in progress)</p>
|
||||
<p>A settings screen which enables you to add code into your theme</p>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
@ -67,6 +67,9 @@
|
||||
},
|
||||
"ghost_foot": {
|
||||
"defaultValue" : ""
|
||||
},
|
||||
"labs": {
|
||||
"defaultValue": "{}"
|
||||
}
|
||||
},
|
||||
"theme": {
|
||||
|
Loading…
Reference in New Issue
Block a user