Commit Graph

3217 Commits

Author SHA1 Message Date
tophf
374244fceb Editor: remember size/pos only for detached windows 2015-03-20 17:27:20 +03:00
Jason Barnabe
0e391f928f Merge pull request #70 from hideheader/save-me-too
Manage dirty flags on all inputs
2015-03-20 09:20:28 -05:00
hideheader
4e7b15f491 Report element removals correctly
An element with a `defaultValue` now becomes dirty when removed; elements
without become clean. As a result, removing an existing section makes the
document dirty while removing a new section makes it clean(er).
2015-03-16 16:47:56 -04:00
hideheader
b7483035d5 Flatten the closure, simplify its functions 2015-03-15 16:16:12 -04:00
hideheader
d3f8e38936 Manage dirty flags on all inputs
(1) Record initial value of text, select, and checkbox elements and re/set a
dirty class on each when the value changes.
(2) Combine the individual flags into a global dirty flag.
(3) Add 'dirty' status to the document title.
2015-03-15 14:50:42 -04:00
Jason Barnabe
8811e9d441 Merge pull request #67 from hideheader/menu-item-order
[option] List actions before styles in the popup
2015-03-15 12:40:54 -05:00
Jason Barnabe
55f103125b Merge pull request #64 from hideheader/editor-options
Add editor options
2015-03-15 12:35:57 -05:00
hideheader
284d4b8ec8 Add editor options
(1) Add UI controls for `keyMap`, `tabSize`, `indentWithTabs`, and
`lineWrapping`; `indentUnit` tracks `tabSize`.
(2) Dispatch `change` events from `loadPrefs` to initialize CM options
from the controls' event listener.
(3) Move stock options from the `CM.fromTextArea` call into `CM.defaults`.
Add `CM.setOption` method, analogous to the instance method, which updates
`CM.defaults` and sets the option in all instances; add `CM.getOption`
which simply returns `CM.defaults[option]`.
(4) Move the new editor functions into `CM.commands` and replace the
functions with commands.
2015-03-15 12:40:38 -04:00
hideheader
222f970d23 [option] List actions before styles in the popup
Styles are listed before actions by default. Actions are listed before
styles if `popup.stylesFirst` is false. A control for the option is shown
in "Manage" if `popup.stylesFirstUI` is true.
2015-03-14 21:35:45 -04:00
Jason Barnabe
d9ceb98f56 Merge pull request #54 from hideheader/filtered-manage
Listing filters for 'Manage'
2015-03-14 18:17:59 -05:00
hideheader
a0482d3f0b Listing filters for 'Manage'
Two independent filters. One allows only styles that are enabled, the
other allows only styles that were written locally (that is, styles
without an update URL).
2015-03-14 13:33:36 -04:00
Jason Barnabe
3cf24400aa Merge pull request #68 from hideheader/css-lint
Remove `eval` from css-lint
2015-03-13 12:28:59 -05:00
hideheader
ae327d4ee1 Remove eval from css-lint
Evaluate string token with `RegExp.exec()` instead of `eval()`.
2015-03-12 19:35:20 -04:00
Jason Barnabe
83bcde6569 Merge pull request #61 from tophf/global-search-in-new
Edit style: more tweaks
2015-03-12 13:15:46 -05:00
tophf
a5594eb7f1 fixup: actually autofocus the added section 2015-03-12 20:59:45 +03:00
tophf
0be6f6dfe4 Edit style: remove CodeMirror's Ctrl-S handler, now redundant 2015-03-12 20:41:06 +03:00
tophf
55538f808d Edit style: allow adding sections midway, autofocus on manual add 2015-03-12 13:21:11 +03:00
tophf
b8c918e502 Mostly mute CSSLint, re-enable gutter marks, hide squiggles
Only these rules are enabled:
* Parsing Errors
* Disallow empty rules
* Require use of known properties
* Require properties appropriate for display
2015-03-12 13:18:57 +03:00
tophf
b7fb1f14e1 Edit style: warn on losing changes to applies-to fields 2015-03-12 13:18:57 +03:00
tophf
464d3eb30d Edit style: save on Ctrl-S outside code blocks too 2015-03-12 13:18:57 +03:00
tophf
c084ea3973 Edit style: retain scroll position of window & editor 2015-03-11 23:31:13 +03:00
tophf
f654cc734f Edit style: remember detached window position and size 2015-03-11 23:31:13 +03:00
tophf
8844b71aab Edit style: fix goto next/prev section after deleting one 2015-03-11 23:31:12 +03:00
Jason Barnabe
28fcb94dfa Merge pull request #66 from hideheader/save-me
Fix 'dirty' indicator on 'Code' boxes
2015-03-10 13:39:57 -05:00
Jason Barnabe
0edc0dbd56 Merge pull request #62 from hideheader/preferences
Preferences fixes & improvements
2015-03-10 13:18:08 -05:00
hideheader
8140e16474 Fix 'dirty' indicator on 'Code' boxes
Toggle a class on the container instead of changing label text.
2015-03-10 11:45:13 -04:00
hideheader
0eaa356c6c Preferences improvements
(1) An element's `change` listener can be used to initialize what it's
controlling. `loadPrefs` sends a `change` event to the element
after setting the element `value` but before adding its own `change`
listener. Add the element's listener before calling `loadPrefs` to receive
the synthetic event.
(2) `prefs.setPref` only broadcasts a notification if the value returned
by `getPref` changes.
(3) A user preference with the same (typed) value as the default is
evicted from `localStorage`. (Firefox does this.)
2015-03-07 03:29:17 -05:00
hideheader
6ec65ab9e9 Use typed preference methods correctly
(1) `loadPrefs` was called with string instead of boolean
(2) Sense of boolean `popup.breadcrumbs.usePath` was inverted
(3) `loadPrefs` wasn't passing default to `getPrefs`
(4) `JSON.stringify(string)` added quotes to string
(5) Preferences `manage.enabledFirst`, `observer.observeFrameContent`, `observer.observeFrameLoad` aren't used
2015-03-07 02:53:33 -05:00
tophf
556c8746f6 New style edit: search in all code sections 2015-03-07 06:07:25 +03:00
Jason Barnabe
eb9cc20d58 Merge pull request #60 from tophf/show-badge-fix
Actually use the show-badge preference
2015-03-06 20:10:48 -06:00
Jason Barnabe
0bf5a1c748 Merge pull request #59 from tophf/global-search
Search all sections on find, findNext, findPrev when invoked from the editor
2015-03-06 20:08:22 -06:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647
0ff7537a8d Actually use the show-badge preference 2015-03-07 05:02:13 +03:00
Jason Barnabe
9a90e15d45 Merge pull request #57 from tophf/keymap
Edit style: use 'sublime' keymap, add custom keys
2015-03-06 19:57:05 -06:00
Jason Barnabe
56ad7e869b Merge pull request #55 from hideheader/new-style-links
Create new styles with `url-prefix()`
2015-03-06 19:49:37 -06:00
tophf
74268d98eb Indicate active code box with a darker border 2015-03-07 04:06:41 +03:00
tophf
cd8d11b137 Scroll the clicked section into view 2015-03-07 04:06:40 +03:00
tophf
514a1227e4 Search all sections on find/findNext/findPrev 2015-03-07 04:06:40 +03:00
Jason
74d83e2640 Fix pushState logic for iframe changes #3+ 2015-03-05 12:02:26 -06:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647
20123760ac Edit style: use 'sublime' keymap, add custom keys
F3, Shift-F3, Ctrl-H - find/find previous/replace
Ctrl-G: go to line dialog
Alt-PgDn: next code section
Alt-PgUp: previous code section
...and many more.
2015-03-05 09:59:11 +03:00
Jason Barnabe
1c7eaa6903 Merge pull request #53 from hideheader/preferences
Oops! One pull wasn't using the new prefs methods
2015-03-04 14:15:06 -06:00
Jason
d151dd0303 Fix iframe mutation observer #3 2015-03-04 14:03:29 -06:00
hideheader
279c5a2328 Create new styles with url-prefix()
`url-prefix()` is used ca. 100 times as often as `url()`.
2015-03-04 12:03:28 -05:00
hideheader
ab6130e619 Oops! One pull wasn't using the new prefs methods 2015-03-04 03:20:39 -05:00
Jason Barnabe
1920a5e890 Merge pull request #52 from tophf/reuse-ntp
Re-use an active new tab page for manager/editor
2015-03-03 20:58:19 -06:00
Jason Barnabe
ab36efdd71 Merge pull request #50 from tophf/unsaved-code-warning
Edit style: warn before losing changes in code areas
2015-03-03 20:55:45 -06:00
Jason Barnabe
ecb0c4d8b4 Merge pull request #48 from hideheader/preferences
Get and set typed preference values
2015-03-03 20:49:19 -06:00
9adefaf01e5bf6426d838cd20eae582d2b6ba647
98a71d2812 Re-use an active new tab page for manager/editor 2015-03-04 05:29:24 +03:00
Jason Barnabe
0fe0707e02 Merge pull request #37 from hideheader/new-style-links-grr
Support "breadcrumbs" new style links
2015-03-03 20:23:53 -06:00
Jason Barnabe
b2bce0fa7a Merge pull request #34 from hideheader/Enabled-styles-first
Popup: sort enabled styles first
2015-03-03 20:18:07 -06:00
Jason Barnabe
a312794207 Merge pull request #45 from tophf/editbox-fullpagewidth
Edit style: expand URL boxes to page width
2015-03-03 20:06:03 -06:00