';
- for (var i = 0, length = options.items.length; i < length; i++) {
+ var i, length;
+ var isChecked;
+
+ html += '';
+ for (i = 0, length = options.items.length; i < length; i++) {
var option = options.items[i];
- html += '';
+ var radioValue = option.id.replace(',', '_');
+ isChecked = (options.query.SortBy || '').replace(',', '_') == radioValue ? ' checked' : '';
+ html += '';
}
- html += '';
+ html += '
';
html += '';
html += Globalize.translate('HeaderSortOrder');
html += '
';
- html += '';
- html += '';
- html += '';
- html += '';
+ html += '';
+ isChecked = options.query.SortOrder == 'Ascending' ? ' checked' : '';
+ html += '';
+ isChecked = options.query.SortOrder == 'Descending' ? ' checked' : '';
+ html += '';
+ html += '
';
html += '';
dlg.innerHTML = html;
@@ -3002,31 +3009,43 @@
dialogHelper.open(dlg);
}, delay);
- dlg.querySelector('.groupSortBy').addEventListener('iron-select', function () {
+ function onSortByChange() {
+ var newValue = this.value;
+ if (this.checked) {
+ var changed = options.query.SortBy != newValue;
- var newValue = this.selected.replace('_', ',');
- var changed = options.query.SortBy != newValue;
+ options.query.SortBy = newValue.replace('_', ',');
+ options.query.StartIndex = 0;
- options.query.SortBy = newValue;
- options.query.StartIndex = 0;
-
- if (options.callback && changed) {
- options.callback();
+ if (options.callback && changed) {
+ options.callback();
+ }
}
- });
+ }
- dlg.querySelector('.groupSortOrder').addEventListener('iron-select', function () {
+ var sortBys = dlg.querySelectorAll('.menuSortBy');
+ for (i = 0, length = sortBys.length; i < length; i++) {
+ sortBys[i].addEventListener('change', onSortByChange);
+ }
- var newValue = this.selected;
- var changed = options.query.SortOrder != newValue;
+ function onSortOrderChange() {
+ var newValue = this.value;
+ if (this.checked) {
+ var changed = options.query.SortOrder != newValue;
- options.query.SortOrder = newValue;
- options.query.StartIndex = 0;
+ options.query.SortOrder = newValue;
+ options.query.StartIndex = 0;
- if (options.callback && changed) {
- options.callback();
+ if (options.callback && changed) {
+ options.callback();
+ }
}
- });
+ }
+
+ var sortOrders = dlg.querySelectorAll('.menuSortOrder');
+ for (i = 0, length = sortOrders.length; i < length; i++) {
+ sortOrders[i].addEventListener('change', onSortOrderChange);
+ }
});
},
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index c477d02026..319a5b2a5b 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1170,39 +1170,53 @@ var Dashboard = {
return caps;
},
- getDefaultImageQuality: function (imageType) {
-
- var quality = 90;
- var isBackdrop = imageType.toLowerCase() == 'backdrop';
-
- if (isBackdrop) {
- quality -= 10;
- }
-
- if (browserInfo.mobile) {
- quality -= 20;
- }
-
- if (AppInfo.hasLowImageBandwidth) {
-
- // The native app can handle a little bit more than safari
- if (AppInfo.isNativeApp) {
-
- quality -= 5;
- } else {
- quality -= 20;
- }
- }
-
- return quality;
- },
-
normalizeImageOptions: function (options) {
if (AppInfo.hasLowImageBandwidth) {
options.enableImageEnhancers = false;
}
+
+ var setQuality;
+ if (options.maxWidth) {
+ setQuality = true;
+ }
+
+ if (options.width) {
+ setQuality = true;
+ }
+
+ if (options.maxHeight) {
+ setQuality = true;
+ }
+
+ if (options.height) {
+ setQuality = true;
+ }
+
+ if (setQuality) {
+ var quality = 90;
+
+ if ((options.type || '').toLowerCase() == 'backdrop') {
+ quality -= 10;
+ }
+
+ if (browserInfo.mobile || browserInfo.tv) {
+ quality -= 30;
+ }
+
+ if (AppInfo.hasLowImageBandwidth) {
+
+ // The native app can handle a little bit more than safari
+ if (AppInfo.isNativeApp) {
+
+ //quality -= 5;
+ } else {
+ quality -= 15;
+ }
+ }
+ options.quality = quality;
+ }
},
loadExternalPlayer: function () {
@@ -1545,7 +1559,6 @@ var AppInfo = {};
};
}
- apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
Events.off(apiClient, 'websocketmessage', Dashboard.onWebSocketMessageReceived);
@@ -1881,8 +1894,6 @@ var AppInfo = {};
define("paper-button", ["html!" + bowerPath + "/paper-button/paper-button.html"]);
define("paper-icon-button", ["html!" + bowerPath + "/paper-icon-button/paper-icon-button.html"]);
- define("paper-radio-group", ["html!" + bowerPath + "/paper-radio-group/paper-radio-group.html"]);
- define("paper-radio-button", ['webcomponentsjs', "html!" + bowerPath + "/paper-radio-button/paper-radio-button.html"]);
define("paper-toggle-button", ['webcomponentsjs', "html!" + bowerPath + "/paper-toggle-button/paper-toggle-button.html"]);
define("paper-textarea", ['webcomponentsjs', "html!" + bowerPath + "/paper-input/paper-textarea.html"]);
@@ -2179,6 +2190,7 @@ var AppInfo = {};
if (MainActivity.getChromeVersion() >= 48) {
define("audiorenderer", ["scripts/htmlmediarenderer"]);
+ //window.VlcAudio = true;
//define("audiorenderer", ["cordova/android/vlcplayer"]);
} else {
window.VlcAudio = true;
diff --git a/dashboard-ui/thirdparty/paper-button-style.css b/dashboard-ui/thirdparty/paper-button-style.css
index 3e6b76d558..f1098e28c5 100644
--- a/dashboard-ui/thirdparty/paper-button-style.css
+++ b/dashboard-ui/thirdparty/paper-button-style.css
@@ -362,10 +362,6 @@ paper-dropdown-menu {
display: block;
}
-paper-radio-group > * {
- padding: .5em;
-}
-
div.dialogHeader {
padding: .35em .5em;
display: flex;