Commit Graph

201 Commits

Author SHA1 Message Date
eight
095998f07c Change: switch to msg.js 2018-10-06 13:27:58 +08:00
eight
fa3127d988 Change: switch to msg.js 2018-10-06 13:02:45 +08:00
eight
34497ebe16 WIP: switch to API 2018-10-05 18:47:52 +08:00
eight
24b1eea8a4 Merge branch 'master' of https://github.com/openstyles/stylus into dev-exclusions 2018-10-03 15:00:07 +08:00
eight
5cbe8a8d78
Add: fetch style object from DB directly in the editor (#507) 2018-10-02 20:22:18 +08:00
eight
2fd531e253 Rewrite linter system (#487)
* Add: implement new linter system

* Refactor: pull out editor worker

* Switch to new linter and worker

* Enable eslint cache

* Fix: undefined error

* Windows compatibility

* Fix: refresh linter if the editor.linter changes

* Add: stylelint

* Add: getStylelintRules, getCsslintRules

* Fix: logic to get correct linter

* WIP: linter-report

* Fix: toggle hidden state

* Add: matain the order of lint report for section editor

* Add: unhook event

* Add: gotoLintIssue

* Fix: shouldn't delete rule.init

* Add: linter-help-dialog

* Drop linterConfig

* Add: linter-config-dialog, cacheFn

* Add: use cacheFn

* Drop lint.js

* Add: refresh. Fix report order

* Fix: hide empty table

* Add: updateCount. Fix table caption

* Switch to new linter/worker

* Fix: remove unneeded comment

* Fix: cacheFn -> cacheFirstCall

* Fix: use cacheFirstCall

* Fix: cache metaIndex

* Fix: i < trs.length

* Fix: drop isEmpty

* Fix: expose some simple states to global

* Fix: return object code style

* Fix: use proxy to reflect API

* Fix: eslint-disable-line -> eslint-disable-next-line

* Fix: requestId -> id

* Fix: one-liner

* Fix: one-liner

* Fix: move dom event block to top

* Fix: pending -> pendingResponse

* Fix: onSuccess -> onUpdated

* Fix: optimize row removing when i === 0

* Fix: hook/unhook -> enableForEditor/disableForEditor

* Fix: linter.refresh -> linter.run

* Fix: some shadowing

* Fix: simplify getAnnotations

* Fix: cacheFirstCall -> memoize

* Fix: table.update -> table.updateCaption

* Fix: unneeded reassign

* Fix: callbacks -> listeners

* Fix: don't compose but extend

* Refactor: replace linter modules with linter-defaults and linter-engines

* Fix: implement linter fallbacks

* Fix: linter.onChange -> linter.onLintingUpdated

* Fix: cms -> tables

* Fix: parseMozFormat is not called correctly

* Move csslint-loader to background

* Fix: watch config changes

* Fix: switch to LINTER_DEFAULTS

* Fix: csslint-loader -> parserlib-loader
2018-10-01 09:03:17 -05:00
tophf
92d6530c8f simplify listener registration
since the function reference is constant, only one listener will be registered
2018-08-07 20:11:11 +03:00
tophf
eff0a7030c display only style name in the editor tab title
"Edit Style" was redundant and made the title unreadable when many tabs were opened.
"Add Style" is still displayed for the new styles.
2018-08-07 19:59:16 +03:00
tophf
5da1e0fb9b set onbeforeunload only when dirty
https://developers.google.com/web/updates/2018/07/page-lifecycle-api#legacy-lifecycle-apis-to-avoid
2018-08-02 20:54:40 +03:00
tophf
0c58783a6c add buttons to restore, clone, move a section 2018-07-23 21:24:35 +03:00
tophf
4283cc53a7 use the global line wrapping option in moz-export popup 2018-07-22 20:08:13 +03:00
tophf
126d909ca7 use a typical OS order for #help-popup buttons
* horizontally centered in Windows
* right-aligned otherwise
2018-07-22 19:55:27 +03:00
tophf
87da06037f make showCodeMirrorPopup modal
closes #437
2018-07-22 19:37:49 +03:00
Rob Garrison
bfe54ab4c4 Add tab communication 2018-07-22 11:21:45 -05:00
Rob Garrison
68dfa0153c Add style exclusions. Closes #113 2018-07-22 11:21:43 -05:00
tophf
e3d1c6588d prefill new style name with the domain/hostname
implements #344
2018-02-14 05:53:35 +03:00
tophf
dc1cd890ee notify event subscribers when toggling the style via Alt-Enter 2018-01-14 17:40:09 +03:00
tophf
fb1ef71f25 don't save the style in toggleStyle; use data-hotkey-tooltip 2018-01-12 14:32:15 +03:00
tophf
989df35b05 live preview in editor
* refreshAllTabs was extracted
* ...and fixed to use each frame's url when getting the styles
2018-01-12 00:54:36 +03:00
tophf
d2cba96e10 refactor CSSLint
* reduce linting delay
* parse mozformat in worker
* allow empty functions in 'filter:' property
  https://drafts.fxtf.org/filter-effects/#supported-filter-functions
* support comma-separated list in :lang()
* strip vendor prefix in isLiteral()
2018-01-07 12:31:23 +03:00
tophf
3418ac9cb9 FF: support private/container tabs 2018-01-03 10:43:56 +03:00
tophf
27fe9fa9db search/replace in extra CodeMirror boxes e.g. lint config 2018-01-01 10:35:22 +03:00
tophf
f2efff64fd FF weird bug workaround: delay initLint() by 100ms 2017-12-25 09:28:26 +03:00
tophf
57806bed45 don't set sessionStorage.justEditedStyleId to null 2017-12-24 02:37:26 +03:00
tophf
001db9a19f make editor fully clean on saving 2017-12-18 10:27:50 +03:00
tophf
6ee952f3d3 more things made focusable
* mozilla-format (i) icon
* showHelp() restores original focus
* showHelp's nested confirmation is debounced to enable focusing Yes/No
* RegExp tester tab URLs are focusable now
2017-12-13 07:38:36 +03:00
tophf
fefe82fd54 remove what-input, use own implementation, rebase on master 2017-12-13 03:27:10 +03:00
Rob Garrison
2cdd264780 fixups
Manage: Disable tabindex in nested buttons
Manage: Fix homepage link alignment
Manage: Make entry actions keyboard navigatable
Manage: Add search help accessibility
Msgbox: Save and restore focus
Manage: Fix delete confirmation cancel
Manage: Make history button accessible
Manage: Make favicons dropdown accessible
Manage: Prevent focus on hidden textarea
Msgbox: Stop tabbing outside of msgbox
Usercss: Make nondefault reset accessible
Usercss: Make colorpicker accessible
Edit: Disable tabindex in nested buttons
Edit: Make info and config icons accessible
Options: Cleanup HTML
Options: Make advanced toggle accessible
Edit: Fix issues popup
Edit: Remove link underlines from icons
2017-12-12 21:40:31 +03:00
tophf
3a82a66954 open editor a bit faster, fixup <select> bug and widget style 2017-12-11 09:12:56 +03:00
tophf
8679e55206 unregister listeners on closing showCodeMirrorPopup 2017-12-10 11:24:52 +03:00
tophf
f11235aaf9 Revert 1e1ff736 "simplify theme preloader" 2017-12-09 19:05:44 +03:00
tophf
443e3a3c7c second lockPageUI runs after there's no codebox anymore 2017-12-09 19:05:00 +03:00
tophf
ab98d46baa show import errors in messageBox 2017-12-09 19:04:19 +03:00
tophf
5f1f9c4d86 unregister CM on closing showCodeMirrorPopup 2017-12-09 18:23:18 +03:00
tophf
1c68ac1a3a initialize editor page fully in First Meaningful Paint frame
* previously it wasn't the case when colorpicker option was enabled
* the cost of always loading colorview is ~1ms for >200ms here
2017-12-08 06:20:56 +03:00
tophf
99cce55a8e ensure long words break before breaking the layout
supersedes 40075a0d
2017-12-07 23:21:27 +03:00
tophf
6a838e9d5e make sure all pre-create hooks finished 2017-12-07 20:26:41 +03:00
tophf
cb7f1de348 use hyphens when breaking words (works only in FF though) 2017-12-05 05:02:28 +03:00
tophf
40075a0d39 forcefully break long labels in aligned options 2017-12-05 04:39:29 +03:00
tophf
1e1ff73612 simplify theme preloader 2017-12-05 04:39:29 +03:00
tophf
a6f63d096e extract checkboxes to global.css, fixes 2017-12-05 04:39:29 +03:00
tophf
c0c60fb7a2 add a terse invocation syntax for $element and rename it to $create 2017-12-04 08:57:12 +03:00
tophf
f4677a7b7b actually use the name when saving 2017-12-03 20:32:50 +03:00
tophf
904e6017f2 close showHelp() if input element has can-close-on-esc class 2017-12-03 00:22:03 +03:00
tophf
0e61de2920 edit.js: pull out hooks, sections, keymap help, beautify
just a simple preparation for a proper encapsulation in the future
2017-12-02 23:46:00 +03:00
tophf
0de69e306d code refactor: add $.remove() and $$.remove() 2017-12-02 19:54:54 +03:00
tophf
a6fbc9db11 render lint squigglies 4x faster
* turns out codemirror lint addon doesn't open an overall op,
  instead it creates an op for each marker.

* also, now there's no need to disable the lint option when initializing codemirror
2017-12-01 03:49:09 +03:00
tophf
a60d53de29 edit: workaround for <details> not showing the toggle 2017-11-29 19:27:31 +03:00
tophf
189342472e manage: collapsible #options block 2017-11-29 19:27:31 +03:00
tophf
bf13383c93 workaround for URLSearchParams not stripping "?" in chrome 49-51 2017-11-28 22:19:00 +03:00