Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Override Prettier settings for Demo page #733

Merged
merged 2 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"parser": "html",
"htmlWhitespaceSensitivity": "ignore"
}
},
{
"files": ["public/*.html"],
"options": {
"trailingComma": "es5"
}
}
]
}
42 changes: 21 additions & 21 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ <h2>Form interaction</h2>
editItems: true,
maxItemCount: 5,
removeItemButton: true,
},
}
);

var textUniqueVals = new Choices('#choices-text-unique-values', {
Expand Down Expand Up @@ -612,7 +612,7 @@ <h2>Form interaction</h2>
{
prependValue: 'item-',
appendValue: '-' + Date.now(),
},
}
).removeActiveItems();

var textPresetVal = new Choices('#choices-text-preset-values', {
Expand All @@ -629,7 +629,7 @@ <h2>Form interaction</h2>
});

var multipleDefault = new Choices(
document.getElementById('choices-multiple-groups'),
document.getElementById('choices-multiple-groups')
);

var multipleFetch = new Choices('#choices-multiple-remote-fetch', {
Expand All @@ -638,7 +638,7 @@ <h2>Form interaction</h2>
maxItemCount: 5,
}).setChoices(function() {
return fetch(
'https://api.discogs.com/artists/55980/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW',
'https://api.discogs.com/artists/55980/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW'
)
.then(function(response) {
return response.json();
Expand All @@ -654,7 +654,7 @@ <h2>Form interaction</h2>
'#choices-multiple-remove-button',
{
removeItemButton: true,
},
}
);

/* Use label on event */
Expand All @@ -673,31 +673,31 @@ <h2>Form interaction</h2>
],
'value',
'label',
false,
false
);

choicesSelect.passedElement.element.addEventListener(
'addItem',
function(event) {
document.getElementById('message').innerHTML =
'You just added "' + event.detail.label + '"';
},
}
);

choicesSelect.passedElement.element.addEventListener(
'removeItem',
function(event) {
document.getElementById('message').innerHTML =
'You just removed "' + event.detail.label + '"';
},
}
);

var singleFetch = new Choices('#choices-single-remote-fetch', {
searchPlaceholderValue: 'Search for an Arctic Monkeys record',
})
.setChoices(function() {
return fetch(
'https://api.discogs.com/artists/391170/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW',
'https://api.discogs.com/artists/391170/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW'
)
.then(function(response) {
return response.json();
Expand All @@ -717,7 +717,7 @@ <h2>Form interaction</h2>
searchPlaceholderValue: "Search for a Smiths' record",
}).setChoices(function(callback) {
return fetch(
'https://api.discogs.com/artists/83080/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW',
'https://api.discogs.com/artists/83080/releases?token=QBRmstCkwXEvCjTclCpumbtNwvVkEzGAdELXyRyW'
)
.then(function(res) {
return res.json();
Expand Down Expand Up @@ -750,7 +750,7 @@ <h2>Form interaction</h2>
],
'value',
'label',
false,
false
);

var singlePresetOpts = new Choices('#choices-single-preset-options', {
Expand Down Expand Up @@ -779,7 +779,7 @@ <h2>Form interaction</h2>
},
],
'value',
'label',
'label'
);

var singleSelectedOpt = new Choices('#choices-single-selected-option', {
Expand All @@ -801,7 +801,7 @@ <h2>Form interaction</h2>
'#choices-with-custom-props-via-html',
{
searchFields: ['label', 'value', 'customProperties'],
},
}
);

var singleNoSorting = new Choices('#choices-single-no-sorting', {
Expand All @@ -810,7 +810,7 @@ <h2>Form interaction</h2>

var cities = new Choices(document.getElementById('cities'));
var tubeStations = new Choices(
document.getElementById('tube-stations'),
document.getElementById('tube-stations')
).disable();

cities.passedElement.element.addEventListener('change', function(e) {
Expand Down Expand Up @@ -838,7 +838,7 @@ <h2>Form interaction</h2>
String(
data.highlighted
? classNames.highlightedState
: classNames.itemSelectable,
: classNames.itemSelectable
) +
'"\
data-item\
Expand All @@ -859,7 +859,7 @@ <h2>Form interaction</h2>
String(data.label) +
'\
</div>\
',
'
);
},
choice: function(classNames, data) {
Expand All @@ -874,7 +874,7 @@ <h2>Form interaction</h2>
String(
data.disabled
? classNames.itemDisabled
: classNames.itemSelectable,
: classNames.itemSelectable
) +
'"\
data-select-text="' +
Expand All @@ -885,7 +885,7 @@ <h2>Form interaction</h2>
String(
data.disabled
? 'data-choice-disabled aria-disabled="true"'
: 'data-choice-selectable',
: 'data-choice-selectable'
) +
'\
data-id="' +
Expand All @@ -896,20 +896,20 @@ <h2>Form interaction</h2>
'"\
' +
String(
data.groupId > 0 ? 'role="treeitem"' : 'role="option"',
data.groupId > 0 ? 'role="treeitem"' : 'role="option"'
) +
'\
>\
<span style="margin-right:10px;">👉🏽</span> ' +
String(data.label) +
'\
</div>\
',
'
);
},
};
},
},
}
);

var resetSimple = new Choices(document.getElementById('reset-simple'));
Expand Down