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

update components

This commit is contained in:
Luke Pulverenti 2015-08-10 20:14:15 -04:00
parent fa050a3b08
commit f6b3dd3b16
10 changed files with 103 additions and 28 deletions

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.6",
"version": "1.0.7",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@ -28,11 +28,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "9dad0f52150c887997045b8bbf2a82b2394b8a37"
"tag": "v1.0.7",
"commit": "033889b20c6b9ebb45a1ff153fbd667e153fe3f7"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.6",
"version": "1.0.7",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [

View file

@ -50,8 +50,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Boolean,
value: false,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
reflectToAttribute: true
},
/**
@ -72,6 +71,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
receivedFocusFromKeyboard: {
type: Boolean,
readOnly: true
},
/**
* The aria attribute to be set if the button is a toggle and in the
* active state.
*/
ariaActiveAttribute: {
type: String,
value: 'aria-pressed',
observer: '_ariaActiveAttributeChanged'
}
},
@ -82,7 +91,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
observers: [
'_detectKeyboardFocus(focused)'
'_detectKeyboardFocus(focused)',
'_activeChanged(active, ariaActiveAttribute)'
],
keyBindings: {
@ -180,11 +190,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this._changedButtonState();
},
_activeChanged: function(active) {
_ariaActiveAttributeChanged: function(value, oldValue) {
if (oldValue && oldValue != value && this.hasAttribute(oldValue)) {
this.removeAttribute(oldValue);
}
},
_activeChanged: function(active, ariaActiveAttribute) {
if (this.toggles) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this.setAttribute(this.ariaActiveAttribute,
active ? 'true' : 'false');
} else {
this.removeAttribute('aria-pressed');
this.removeAttribute(this.ariaActiveAttribute);
}
this._changedButtonState();
},

View file

@ -60,6 +60,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('true');
done();
} catch (e) {
done(e);
@ -72,6 +74,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(false);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('false');
done();
} catch (e) {
done(e);
@ -79,6 +83,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
});
});
test('the correct aria attribute is set', function(done) {
activeTarget.ariaActiveAttribute = 'aria-checked';
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-checked')).to.be.eql('true');
done();
} catch (e) {
done(e);
}
});
});
test('the aria attribute is updated correctly', function(done) {
activeTarget.ariaActiveAttribute = 'aria-checked';
MockInteractions.downAndUp(activeTarget, function() {
try {
expect(activeTarget.hasAttribute('active')).to.be.eql(true);
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-checked')).to.be.eql('true');
activeTarget.ariaActiveAttribute = 'aria-pressed';
expect(activeTarget.hasAttribute('aria-checked')).to.be.eql(false);
expect(activeTarget.hasAttribute('aria-pressed')).to.be.eql(true);
expect(activeTarget.getAttribute('aria-pressed')).to.be.eql('true');
done();
} catch (e) {
done(e);
}
});
});
});
});

View file

@ -27,14 +27,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-resizable-behavior",
"homepage": "https://github.com/PolymerElements/iron-resizable-behavior",
"_release": "1.0.2",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "85de8ba28be2bf17c81d6436ef1119022b003674"
},
"_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
"_source": "git://github.com/PolymerElements/iron-resizable-behavior.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-resizable-behavior"
"_originalSource": "PolymerElements/iron-resizable-behavior"
}

View file

@ -16,8 +16,11 @@
<div class="detailSectionContent">
<br />
<paper-checkbox class="chkSyncToExternalCard">${OptionSyncToSDCard}</paper-checkbox>
<div>
<paper-input type="text" id="txtSyncPath" label="${LabelSyncPath}" style="display:inline-block;width:80%;" readonly></paper-input>
<paper-icon-button class="btnSelectSyncPath" icon="search"></paper-icon-button>
<div class="fieldDescription">${LabelSyncPathHelp}</div>
</div>
</div>
<br />

View file

@ -56,13 +56,13 @@
return appStorage.getItem('enableFullScreen') == 'true';
},
enableSyncToExternalStorage: function (val) {
syncPath: function (val) {
if (val != null) {
update('enableSyncToExternalStorage', val.toString());
update('syncPath', val);
}
return appStorage.getItem('enableSyncToExternalStorage') != 'false';
return appStorage.getItem('syncPath');
},
displayLanguage: function (val) {

View file

@ -2,14 +2,14 @@
function loadForm(page, user) {
page.querySelector('.chkSyncToExternalCard').checked = AppSettings.enableSyncToExternalStorage();
page.querySelector('#txtSyncPath').value = AppSettings.syncPath();
Dashboard.hideLoadingMsg();
}
function saveUser(page, user) {
AppSettings.enableSyncToExternalStorage(page.querySelector('.chkSyncToExternalCard').checked);
AppSettings.syncPath(page.querySelector('#txtSyncPath').value);
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('SettingsSaved'));
}

View file

@ -1517,5 +1517,6 @@
"LabelTranscodingThreadCount": "Transcoding thread count:",
"LabelTranscodingThreadCountHelp": "Select the maximum number of threads to use when transcoding. Reducing the thread count will lower cpu usage but may not convert fast enough for a smooth playback experience.",
"OptionMax": "Max",
"HeaderEmbyGuide": "Emby Guide"
"HeaderEmbyGuide": "Emby Guide",
"LabelSyncPath": "Sync path:"
}

View file

@ -6850,8 +6850,7 @@ this.fire('dom-change');
type: Boolean,
value: false,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
reflectToAttribute: true
},
/**
@ -6872,6 +6871,16 @@ this.fire('dom-change');
receivedFocusFromKeyboard: {
type: Boolean,
readOnly: true
},
/**
* The aria attribute to be set if the button is a toggle and in the
* active state.
*/
ariaActiveAttribute: {
type: String,
value: 'aria-pressed',
observer: '_ariaActiveAttributeChanged'
}
},
@ -6882,7 +6891,8 @@ this.fire('dom-change');
},
observers: [
'_detectKeyboardFocus(focused)'
'_detectKeyboardFocus(focused)',
'_activeChanged(active, ariaActiveAttribute)'
],
keyBindings: {
@ -6980,11 +6990,18 @@ this.fire('dom-change');
this._changedButtonState();
},
_activeChanged: function(active) {
_ariaActiveAttributeChanged: function(value, oldValue) {
if (oldValue && oldValue != value && this.hasAttribute(oldValue)) {
this.removeAttribute(oldValue);
}
},
_activeChanged: function(active, ariaActiveAttribute) {
if (this.toggles) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this.setAttribute(this.ariaActiveAttribute,
active ? 'true' : 'false');
} else {
this.removeAttribute('aria-pressed');
this.removeAttribute(this.ariaActiveAttribute);
}
this._changedButtonState();
},