Save 3d in quality profile

This commit is contained in:
Ruud
2014-03-22 12:19:42 +01:00
parent 1602fe88e6
commit f976e04597
3 changed files with 101 additions and 27 deletions
@@ -63,6 +63,7 @@ var Profile = new Class({
data.types.include({
'quality': quality,
'finish': data.finish[nr] || false,
'3d': data['3d'] ? data['3d'][nr] || false : false,
'wait_for': data.wait_for[nr] || 0
})
});
@@ -124,7 +125,8 @@ var Profile = new Class({
if(!type.hasClass('deleted') && type.getElement('select').get('value') != -1)
data.types.include({
'quality': type.getElement('select').get('value'),
'finish': +type.getElement('input[type=checkbox]').checked,
'finish': +type.getElement('input.finish[type=checkbox]').checked,
'3d': +type.getElement('input.3d[type=checkbox]').checked,
'wait_for': 0
});
})
@@ -240,6 +242,7 @@ Profile.Type = new Class({
self.addEvent('change', function(){
self.el[self.qualities.get('value') == '-1' ? 'addClass' : 'removeClass']('is_empty');
self.el[Quality.getQuality(self.qualities.get('value')).allow_3d ? 'addClass': 'removeClass']('allow_3d');
self.deleted = self.qualities.get('value') == '-1';
});
@@ -250,24 +253,40 @@ Profile.Type = new Class({
var data = self.data;
self.el = new Element('li.type').adopt(
new Element('span.quality_type').adopt(
new Element('span.quality_type').grab(
self.fillQualities()
),
new Element('span.finish').adopt(
self.finish = new Element('input.inlay.finish[type=checkbox]', {
'checked': data.finish !== undefined ? data.finish : 1,
'events': {
'change': function(e){
if(self.el == self.el.getParent().getElement(':first-child')){
self.finish_class.check();
alert('Top quality always finishes the search')
return;
}
self.finish_container = new Element('label.finish').adopt(
new Element('span.finish').grab(
self.finish = new Element('input.inlay.finish[type=checkbox]', {
'checked': data.finish !== undefined ? data.finish : 1,
'events': {
'change': function(e){
if(self.el == self.el.getParent().getElement(':first-child')){
self.finish_class.check();
alert('Top quality always finishes the search')
return;
}
self.fireEvent('change');
self.fireEvent('change');
}
}
}
})
})
),
new Element('span.check_label[text=finish]')
),
self['3d_container'] = new Element('label.threed').adopt(
new Element('span.3d').grab(
self['3d'] = new Element('input.inlay.3d[type=checkbox]', {
'checked': data['3d'] !== undefined ? data['3d'] : 1,
'events': {
'change': function(e){
self.fireEvent('change');
}
}
})
),
new Element('span.check_label[text=3D]')
),
new Element('span.delete.icon2', {
'events': {
@@ -279,7 +298,11 @@ Profile.Type = new Class({
self.el[self.data.quality ? 'removeClass' : 'addClass']('is_empty');
if(self.data.quality && Quality.getQuality(self.data.quality).allow_3d)
self.el.addClass('allow_3d');
self.finish_class = new Form.Check(self.finish);
self['3d_class'] = new Form.Check(self['3d']);
},
@@ -290,7 +313,7 @@ Profile.Type = new Class({
'events': {
'change': self.fireEvent.bind(self, 'change')
}
}).adopt(
}).grab(
new Element('option', {
'text': '+ Add another quality',
'value': -1
@@ -300,7 +323,8 @@ Profile.Type = new Class({
Object.each(Quality.qualities, function(q){
new Element('option', {
'text': q.label,
'value': q.identifier
'value': q.identifier,
'data-allow_3d': q.allow_3d
}).inject(self.qualities)
});
@@ -316,6 +340,7 @@ Profile.Type = new Class({
return {
'quality': self.qualities.get('value'),
'finish': +self.finish.checked,
'3d': +self['3d'].checked,
'wait_for': 0
}
},