Add: use config-dialog/onoffswitch/colorpicker/msgbox in popup

This commit is contained in:
eight 2017-12-05 04:02:38 +08:00
parent 4291a37012
commit c5bcdd8f75
3 changed files with 27 additions and 0 deletions

View File

@ -86,6 +86,16 @@
</div> </div>
</template> </template>
<link rel="stylesheet" href="vendor-overwrites/colorpicker/colorpicker.css">
<script src="vendor-overwrites/colorpicker/colorpicker.js"></script>
<link rel="stylesheet" href="msgbox/msgbox.css">
<script src="msgbox/msgbox.js"></script>
<link rel="stylesheet" href="options/onoffswitch.css">
<link rel="stylesheet" href="manage/config-dialog.css">
<script src="manage/config-dialog.js"></script>
<script src="js/dom.js"></script> <script src="js/dom.js"></script>
<script src="js/messaging.js"></script> <script src="js/messaging.js"></script>
<script src="js/localization.js"></script> <script src="js/localization.js"></script>

View File

@ -1,3 +1,12 @@
:root {
--header-width: 280px;
--checkbox-width: 24px;
--name-padding-left: 40px;
--name-padding-right: 40px;
--actions-width: 75px;
--onoffswitch-width: 60px;
}
html, body { html, body {
height: min-content; height: min-content;
} }

View File

@ -1,3 +1,5 @@
/* global configDialog */
'use strict'; 'use strict';
let installed; let installed;
@ -278,6 +280,7 @@ function createStyleElement({
$('.enable', entry).onclick = handleEvent.toggle; $('.enable', entry).onclick = handleEvent.toggle;
$('.disable', entry).onclick = handleEvent.toggle; $('.disable', entry).onclick = handleEvent.toggle;
$('.delete', entry).onclick = handleEvent.delete; $('.delete', entry).onclick = handleEvent.delete;
$('.configure', entry).onclick = handleEvent.configure;
invokeOrPostpone(!postponeDetect, detectSloppyRegexps, {entry, style}); invokeOrPostpone(!postponeDetect, detectSloppyRegexps, {entry, style});
@ -347,6 +350,11 @@ Object.assign(handleEvent, {
} }
}, },
configure(event) {
const id = handleEvent.getClickedStyleId(event);
getStylesSafe({id}).then(([style]) => style).then(configDialog);
},
indicator(event) { indicator(event) {
const entry = handleEvent.getClickedStyleElement(event); const entry = handleEvent.getClickedStyleElement(event);
const info = template.regexpProblemExplanation.cloneNode(true); const info = template.regexpProblemExplanation.cloneNode(true);