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

New manager layout #636

Draft
wants to merge 67 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
4475a8a
new manage layout
Mottie Nov 25, 2018
ed07cb8
Make entries draggable
Mottie Nov 25, 2018
5c38441
Delay loading of non-essential css/js
Mottie Nov 26, 2018
fbcc7aa
Add bulk action panel
Mottie Nov 27, 2018
f57af79
Fix filter, search & add bulk ui html
Mottie Nov 27, 2018
a1b7847
Move style header & remove template
Mottie Nov 28, 2018
17e1860
Wire up bulk action toggle
Mottie Nov 28, 2018
cf695c7
Cleanup UI
Mottie Nov 29, 2018
7cd8403
Update labels on style toggle
Mottie Nov 29, 2018
0e7ff1c
Add busy icon
Mottie Nov 29, 2018
52f012d
Fix action icon wrapping
Mottie Dec 1, 2018
9368c27
Cleanup updateDate code
Mottie Dec 1, 2018
d379e5f
Add multisort to header & labels
Mottie Dec 2, 2018
9a31452
Modify localization to allow including parameters in HTML
Mottie Dec 3, 2018
57c5589
Change header ID
Mottie Dec 3, 2018
e3be7bf
Fix bulk actions markup
Mottie Dec 3, 2018
de7b0f4
WIP: sort injection order
Mottie Dec 3, 2018
cf4d4a2
Use semverCompare on version column
Mottie Dec 3, 2018
529172d
Fix tabbing to actions
Mottie Dec 3, 2018
bc404e8
Fix enabled update when toggled from popup
Mottie Dec 4, 2018
331be7a
Add css tooltips
Mottie Dec 8, 2018
d2930e5
Add back update history button
Mottie Dec 8, 2018
8f87494
Add filter toolbar indicator
Mottie Dec 8, 2018
596d6a9
Ditch tabs & add header icons
Mottie Dec 14, 2018
42a7578
Fix style header localization
Mottie Dec 15, 2018
218b6b4
Add applies to config modal
Mottie Dec 17, 2018
198315c
Change default sort
Mottie Dec 31, 2018
30a69f5
Fix bulk import
Mottie Dec 19, 2018
a7026bd
Wire up some bulk actions
Mottie Dec 31, 2018
44889f6
Fix bulk export
Mottie Jan 1, 2019
ead5e74
Fix import dropdown
Mottie Jan 1, 2019
a0ba63b
Remove bulk reset
Mottie Jan 1, 2019
4030496
Fix bulk updates
Mottie Jan 2, 2019
b5387de
Fix label updates
Mottie Jan 2, 2019
9fd4e0f
Fix styling for width < 1100px
Mottie Jan 2, 2019
e547d93
Only open bulk action with filter checkbox
Mottie Jan 3, 2019
c966cfe
Change active dragging color
Mottie Jan 3, 2019
e873ffd
Move home & support buttons to the right
Mottie Jan 3, 2019
bc3f2e0
Add more css variables
Mottie Jan 3, 2019
0d87689
Make entire style name clickable
Mottie Jan 3, 2019
9b408aa
Fix checked icon size
Mottie Jan 3, 2019
e9510c0
Only allow manual sort with ID column sort
Mottie Jan 3, 2019
30a780a
Show a default of 6 applies to favicons
Mottie Jan 3, 2019
7abc4f7
Add export & update all buttons to header
Mottie Jan 13, 2019
ae6bace
Reduce favicon size
Mottie Jan 13, 2019
ebeaba3
Make entry name full height
Mottie Jan 13, 2019
6759341
Fix hover highlight
Mottie Jan 13, 2019
3042054
Fix entry height variable
Mottie Jan 13, 2019
99f8bbb
Brighten checked checkbox color
Mottie Jan 13, 2019
5cc9e68
Increase tooltip contrast
Mottie Jan 13, 2019
1bc84bb
Fix header backup dropdown position
Mottie Jan 13, 2019
bd117b8
Build & save injection order values
Mottie Jan 17, 2019
67682fa
Fix favicon size
Mottie Jan 19, 2019
44df296
Change favicon option to show by default
Mottie Jan 19, 2019
f9ccd3e
Increase spacing between header icons
Mottie Jan 21, 2019
7d7e7e9
Stop using detail summary as applies to expander
Mottie Jan 28, 2019
71baf44
Remove injection order code (for now)
Mottie Jan 28, 2019
0dfd668
Fix a few style issues
Mottie Jan 28, 2019
6c747fa
Change new style into a dropdown
Mottie Mar 10, 2019
cd309aa
Prevent JS error in Chrome while emulating mobile devices
Mottie Mar 11, 2019
84163ba
Change layout in lower resolutions
Mottie Mar 11, 2019
89644d0
Replace home icon with external link icon
Mottie Mar 11, 2019
48b1877
Tweaks
Mottie Mar 11, 2020
9224c7a
Cleanup manage styles
Mottie Mar 12, 2020
67e886b
Fix msgbox js error
Mottie Mar 12, 2020
2fd08cb
Restore options popup
Mottie Mar 12, 2020
5047ceb
Switch to filter text/buttons
Mottie Mar 23, 2020
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
Prev Previous commit
Next Next commit
WIP: sort injection order
  • Loading branch information
Mottie committed Mar 11, 2020
commit de7b0f44f17e40d0901ea05ccff6a5dab27093d7
10 changes: 9 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1258,9 +1258,17 @@
"description": "Title of sort column, indicating that the style can be manually sorted by dragging & dropping"
},
"sortLabel": {
"message": "Click to sort; Shift + click to sort multiple columns",
"message": "Click to sort by \"$name$\";\nUse shift + click to sort by multiple items",
"placeholders": {
"name": {
"content": "$1"
}
},
"description": "Title added to links in the manager page header to inform the user on how to sort the columns"
},
"sortHeaderOrderLabel": {
"message": "Click and drag the icon to change the style injection order"
},
"styleBadRegexp": {
"message": "Regexp is invalid.",
"description": "Validation message for a bad regexp in a style"
Expand Down
12 changes: 6 additions & 6 deletions manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ <h1 id="main-header">
</svg>
</a>
</div>
<a href="#" class="entry-col sortable header-id" data-type="order" i18n-title="sortLabel">#</a>
<a href="#" class="entry-col sortable header-state center-text" i18n-text="genericEnabledLabel" i18n-title="sortLabel" data-type="disabled"></a>
<a href="#" class="entry-col sortable header-id" data-type="order" i18n-title="sortLabel;injection order">#</a>
<a href="#" class="entry-col sortable header-state center-text" i18n-text="genericEnabledLabel" i18n-title="sortLabel;enabled styles" data-type="disabled"></a>
<div class="entry-col header-name">
<a href="#" class="sortable" i18n-text="genericName" i18n-title="sortLabel" data-type="title"></a>
<a href="#" class="sortable" i18n-text="genericName" i18n-title="sortLabel;style name" data-type="title"></a>
</div>
<div class="entry-col header-actions" i18n-text="optionsActions"></div>
<div class="entry-col header-sort center-text" i18n-text="sortHeader" i18n-title="sortOrderLabel"></div>
<a href="#" class="entry-col sortable header-version" i18n-title="sortLabel" data-type="version">v#</a>
<a href="#" class="entry-col sortable header-last-update center-text" i18n-text="searchResultUpdated" i18n-title="sortLabel" data-type="dateUpdated"></a>
<div class="entry-col header-sort center-text" i18n-text="sortHeader" i18n-title="sortHeaderOrderLabel"></div>
<a href="#" class="entry-col sortable header-version" i18n-title="sortLabel;style version" data-type="version">v#</a>
<a href="#" class="entry-col sortable header-last-update center-text" i18n-text="searchResultUpdated" i18n-title="sortLabel;last updated" data-type="dateUpdated"></a>
<div class="entry-col header-applies-to" i18n-text="appliesLabel"></div>
</header>
</div>
Expand Down
3 changes: 2 additions & 1 deletion manage/draggable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global UI $$ */
/* global UI $$ updateInjectionOrder */
'use strict';

// Polyfill for mobile? - https://caniuse.com/#feat=dragndrop
Expand All @@ -10,6 +10,7 @@
el.classList.remove('dragging');
});
$('body').classList.remove('dragging');
updateInjectionOrder();
}

document.addEventListener('dragstart', event => {
Expand Down
17 changes: 16 additions & 1 deletion manage/manage-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ global messageBox getStyleWithNoCode
objectDiff
configDialog
sorter msg prefs API onDOMready $ $$ setupLivePrefs
URLS enforceInputRange t formatDate
URLS enforceInputRange t
getOwnTab getActiveTab openURL animateElement sessionStorageHash debounce
scrollElementIntoView FIREFOX
UI
*/
/* exported updateInjectionOrder */
'use strict';

let installed;
Expand Down Expand Up @@ -445,6 +446,20 @@ function removeSelection() {
}
}

function updateInjectionOrder() {
const entries = [...installed.children];
entries.shift(); // remove header
console.log(entries[1].styleMeta.id, entries[1].styleMeta.injectionOrder)

entries.forEach((entry, index) => {
entry.styleMeta.injectionOrder = index + 1;
$('.entry-id', entry).textContent = index + 1;
});
sorter.update();

// TODO: Update database
}

function lazyLoad() {
setTimeout(() => {
$$('link[data-href]').forEach(link => {
Expand Down
7 changes: 4 additions & 3 deletions manage/manage-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const UI = {
(style.updateUrl ? ' updatable' : '') +
(style.usercssData ? ' usercss' : '');

$('.entry-id', entry).textContent = style.sortOrder || style.id;
$('.entry-id', entry).textContent = style.injectionOrder || style.id;
let el = $('.entry-homepage', entry);
el.classList.toggle('invisible', !style.url);
el.href = style.url || '';
Expand Down Expand Up @@ -282,12 +282,13 @@ const UI = {
const label = document.createElement('a');
labels.className = 'header-labels';
label.className = 'header-label sortable';
label.title = t('sortLabel');
label.href = '#';
Object.keys(UI.labels).forEach(item => {
const newLabel = label.cloneNode(true);
const text = UI.labels[item].text;
newLabel.dataset.type = item;
newLabel.textContent = UI.labels[item].text;
newLabel.textContent = text;
newLabel.title = t('sortLabel', text);
labels.appendChild(newLabel);
});
header.appendChild(labels);
Expand Down
2 changes: 1 addition & 1 deletion manage/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const sorter = (() => {
},
order: {
text: '#',
parse: ({style}) => style.id,
parse: ({style}) => style.injectionOrder || style.id,
sorter: sorterType.number,
},
usercss: {
Expand Down