knobs look way better

This commit is contained in:
Mark McDowall 2013-06-28 01:20:15 -07:00
parent f7c340d795
commit acf16f6bd3
6 changed files with 47 additions and 22 deletions

View File

@ -93,3 +93,8 @@
font-size : 56px; font-size : 56px;
color : white; color : white;
} }
.label-large {
padding: 4px 6px;
font-size: 16px;
}

View File

@ -475,6 +475,7 @@
) return; ) return;
s.val(v); s.val(v);
s.$.trigger('change', v);
} }
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step}; , kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};

View File

@ -1,5 +1,5 @@
<fieldset> <fieldset>
<legend>General</legend> <legend>Misc</legend>
<div class="control-group"> <div class="control-group">
<label class="control-label">Backlog Searching</label> <label class="control-label">Backlog Searching</label>
@ -49,9 +49,9 @@
<div class="controls"> <div class="controls">
<textarea rows="3" name="nzbRestrictions" class="nzb-restrictions"></textarea> <textarea rows="3" name="nzbRestrictions" class="nzb-restrictions"></textarea>
<span class="help-inline"> <span class="help-inline">
<i class="icon-question-sign" title="White list or black list nzbs based on these rules<br/>White list: +:LoL<br/>Black list: -:French"/> <i class="icon-question-sign" title="Blacklist NZBs based on these words (case-insensitive)"/>
</span> </span>
<span class="text-area-help">Newline-delimited set of rules in the form of +|-:</span> <span class="text-area-help">Newline-delimited set of rules</span>
</div> </div>
</div> </div>
</fieldset> </fieldset>

View File

@ -1,8 +1,20 @@
<div class="quality-size-item"> <div class="quality-size-item">
<h2 class="center-block">{{name}}</h2> <h2 class="center-block">{{name}}</h2>
<div class="size"> <div class="size">
<div class="size-value-wrapper">
<div>
<span class="label label-large label-warning x-size-thirty"
name="thirtyMinuteSize"
title="Maximum size for a 30 minute episode in Megabytes">
</span>
</div>
<div>
<span class="label label-large label-info x-size-sixty"
name="sixtyMinuteSize"
title="Maximum size for a 60 minute episode in Megabytes">
</span>
</div>
</div>
<input type="text" name="maxSize" class="knob x-knob" /> <input type="text" name="maxSize" class="knob x-knob" />
</div> </div>
<div class="size-value">30 minute limit: <span name="thirtyMinuteSize" class="thirty-minute-size"></span>MB</div>
<div class="size-value">60 minute limit: <span name="sixtyMinuteSize" class="sixty-minute-size"></span>MB</div>
</div> </div>

View File

@ -8,33 +8,33 @@ define(['marionette', 'Mixins/AsModelBoundView', 'jquery.knob'], function (Mario
ui: { ui: {
knob : '.x-knob', knob : '.x-knob',
thirtyMinuteSize: '.thirty-minute-size', thirtyMinuteSize: '.x-size-thirty',
sixtyMinuteSize : '.sixty-minute-size' sixtyMinuteSize : '.x-size-sixty'
}, },
events: { events: {
'change .x-knob': '_changeMaxSize' // 'change .x-knob': '_changeMaxSize'
}, },
initialize: function (options) { initialize: function (options) {
this.qualityProfileCollection = options.qualityProfiles; this.qualityProfileCollection = options.qualityProfiles;
this.model.on('change:maxSize', this._changeMaxSize, this)
}, },
onRender: function () { onRender: function () {
this.ui.knob.knob({ this.ui.knob.knob({
min : 0, min : 0,
max : 200, max : 200,
step : 10, step : 10,
cursor : 25, cursor : 25,
width : 100, width : 150,
stopper : true stopper : true,
displayInput : false
}); });
}, },
_changeMaxSize: function (e, value) { _changeMaxSize: function (e) {
this.model.set({ var value = this.model.get('maxSize');
maxSize: value
});
this.ui.thirtyMinuteSize.html(value * 30); this.ui.thirtyMinuteSize.html(value * 30);
this.ui.sixtyMinuteSize.html(value * 60); this.ui.sixtyMinuteSize.html(value * 60);

View File

@ -32,17 +32,18 @@
.quality-size-item { .quality-size-item {
.card; .card;
text-align: center;
width: 200px; width: 200px;
height: 200px; height: 220px;
padding: 10px 15px; padding: 10px 15px;
h3 { h3 {
margin-top: 0px; margin-top: 0px;
text-align: center;
} }
.size { .size {
position: relative;
height: 100px; height: 100px;
margin: 10px; margin: 10px;
text-align: center; text-align: center;
@ -52,8 +53,14 @@
box-shadow: none; box-shadow: none;
} }
.size-value { .size-value-wrapper {
text-align: center; position: absolute;
top: 50px;
width: 100%;
div {
margin-top: 2px;
}
} }
} }