1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

use shared usersettings

This commit is contained in:
Luke Pulverenti 2016-03-01 23:46:10 -05:00
parent f1eb4b1ad8
commit 5ca7a2ad34
12 changed files with 114 additions and 44 deletions

View file

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.12",
"_release": "1.1.12",
"version": "1.1.13",
"_release": "1.1.13",
"_resolution": {
"type": "version",
"tag": "1.1.12",
"commit": "780eab96948c0418dd4e0e158569c4b8873708d6"
"tag": "1.1.13",
"commit": "b4ee66ca683d87f985f45e44ef75ec6c11049637"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5",

View file

@ -0,0 +1,82 @@
define(['appSettings', 'apiClientResolver', 'events'], function (appsettings, apiClientResolver, events) {
function getUserId() {
var apiClient = apiClientResolver();
if (apiClient) {
return apiClient.getCurrentUserId();
}
return null;
}
var obj = function () {
var self = this;
self.set = function (name, value) {
var userId = getUserId();
if (!userId) {
throw new Error('userId cannot be null');
}
var currentValue = self.get(name);
appsettings.set(name, value, userId);
if (currentValue != value) {
events.trigger(self, 'change', [name]);
}
};
self.get = function (name) {
var userId = getUserId();
if (!userId) {
throw new Error('userId cannot be null');
}
return appsettings.get(name, userId);
};
self.enableCinemaMode = function (val) {
if (val != null) {
self.set('enableCinemaMode', val.toString());
}
val = self.get('enableCinemaMode');
if (val) {
return val != 'false';
}
return true;
};
self.language = function (val) {
if (val != null) {
self.set('language', val.toString());
}
return self.get('language');
};
self.serverConfig = function (config) {
if (config) {
return apiClientResolver().updateUserConfiguration(getUserId(), config);
} else {
return apiClientResolver().getUser(getUserId()).then(function (user) {
return user.Configuration;
});
}
};
};
return new obj();
});

View file

@ -1,6 +1,6 @@
{
"name": "iron-demo-helpers",
"version": "1.1.0",
"version": "1.1.1",
"description": "Utility classes to make building demo pages easier",
"authors": [
"The Polymer Authors"
@ -37,11 +37,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.1.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0"
},
"_release": "1.1.0",
"_release": "1.1.1",
"_resolution": {
"type": "version",
"tag": "v1.1.0",
"commit": "ea98e51e3ac7b52dd53cea05d3f027b3a41388ad"
"tag": "v1.1.1",
"commit": "49584de566eae4f6c31cd1078ce0407b53c601eb"
},
"_source": "git://github.com/polymerelements/iron-demo-helpers.git",
"_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "iron-demo-helpers",
"version": "1.1.0",
"version": "1.1.1",
"description": "Utility classes to make building demo pages easier",
"authors": [
"The Polymer Authors"

View file

@ -70,7 +70,7 @@ Custom property | Description | Default
}
.code {
padding: 0 20px;
padding: 20px;
margin: 0;
background-color: var(--google-grey-100);
font-size: 13px;

View file

@ -41,7 +41,7 @@
"tag": "v1.1.3",
"commit": "c13869b57a9464dfc3a1f26e89858f8be37e7441"
},
"_source": "git://github.com/PolymerElements/iron-icons.git",
"_source": "git://github.com/polymerelements/iron-icons.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icons"
"_originalSource": "polymerelements/iron-icons"
}

View file

@ -36,7 +36,7 @@
"tag": "v1.2.4",
"commit": "1ee4e2e11a9e5118320987d93fc2c03ae9a489f4"
},
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector"
"_originalSource": "polymerelements/iron-selector"
}

View file

@ -36,14 +36,14 @@
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0"
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/paper-icon-button",
"homepage": "https://github.com/polymerelements/paper-icon-button",
"_release": "1.0.6",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "35347d81939093cd2abe2783ac1b17fa57b7b303"
},
"_source": "git://github.com/PolymerElements/paper-icon-button.git",
"_source": "git://github.com/polymerelements/paper-icon-button.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-icon-button"
"_originalSource": "polymerelements/paper-icon-button"
}