voussoir
0a31dad196
Rewrite these default callbacks as alertresponse.
2020-11-06 22:34:01 -08:00
voussoir
bf9223bf67
Move response.completed into the meta.
2020-11-06 22:27:41 -08:00
voussoir
68b27fced2
Add refresh_or_alert so errors aren't missed.
2020-11-06 21:42:28 -08:00
voussoir
44952b4b05
Add some docstrings to the request code.
2020-11-03 00:03:48 -08:00
voussoir
938f8239c7
Rearrange common.js and add headers.
2020-10-17 17:32:19 -07:00
voussoir
adddba6c97
Simplify this bindable def by reversing the if/def nest.
...
Instead of defining the function with an internal if that will always
pick the same path, let's use that if to instead define a
straightforward function that just does what we want.
2020-10-13 10:53:56 -07:00
voussoir
86c09aedc1
Add album_autocomplete.js, so "Add child" box can autocomplete.
...
This makes putting albums together a little easier, though datalist
performance still leaves a lot to be desired.
2020-10-03 18:37:08 -07:00
voussoir
4e3e2fea12
Avoid creating emptystring promptclass.
2020-10-03 18:32:21 -07:00
voussoir
5d802ba9f9
Let response status be 0 even if request didn't complete.
...
Since meta.status would be undefined for an incomplete request,
I would have to check response.completed && response.meta.status,
which is too much burden. Let's set the status immediately, and
if a callback wants to do further diving we'll use completed then.
2020-10-02 19:43:36 -07:00
voussoir
d15d5f9856
Set tabbed_container data-active-tab-id on tab change.
2020-10-02 16:53:00 -07:00
voussoir
ea60190e7d
Revert most of failed experiment but keep the good parts.
...
- tag_autocomplete.tags and .synonyms are separate vars, not in tagset.
- tag_autocomplete.tags is now a Set object for faster resolve().
- get_all_tags moved to api.js.
- server provides "updated" timestamp with the all_tags list.
2020-09-29 16:54:00 -07:00
voussoir
7e58c95f15
Mostly failed experiment: tag_autocomplete indexeddb.
...
The current system has bad performance when you've got 100,000+ tags.
I discovered that when the server returns 304, the browser gives the
ajax a 200 with the full response, and it's not clear to me if js can
know it got a 304. So, the tag set is being fully re-parsed from the
response on every page load. I was thinking that I should store that in
IndexedDB to avoid the parsing step, but... since the JSON.parse is
done by my common.get before it hits this function, it's meaningless.
Not to mention I still have to rebuild the datalist on every page since
of course that state isn't shared between tabs. Not worth the DB stuff.
We'll see what happens next.
2020-09-29 16:52:20 -07:00
voussoir
8da18ba502
Add --narrow, --wide to common.css, is_wide_mode to common.js.
2020-09-18 20:57:35 -07:00
voussoir
1af8342202
Catch json parse errors, setting json_ok = false.
2020-09-15 23:10:35 -07:00
voussoir
dd0ee7a72a
Use more const.
2020-09-14 18:33:53 -07:00
voussoir
8659b55103
Use className instead of classList here.
2020-09-14 12:01:33 -07:00
voussoir
c532b711b1
During init_all, launch individuals as setTimeouts.
...
I'm having some performance issues with button_with_confirm on /tags.
This won't magically make that faster but I'm trying to stop the main
thread from dragging at least.
2020-09-14 05:54:47 -07:00
voussoir
2dc1603d5e
Use className instead of classList for initialization.
2020-09-14 05:19:10 -07:00
voussoir
cc34c4d189
Pull out init_* function innards to separate one-item functions.
2020-09-12 20:34:59 -07:00
voussoir
329c6dd27b
Trim whitespace from html_to_element input.
2020-09-12 20:33:46 -07:00
voussoir
be7decf330
Rearrange confirm_onclick because they have return statements now.
...
Now that data-onclick begins with a return statement, this code was
not running.
2020-09-12 14:33:15 -07:00
voussoir
2fad1c58fd
Use className instead of classList, as input may have spaces.
2020-09-12 13:14:55 -07:00
voussoir
892390c77a
Rewrite entry_with_history hook and use keydown instead of keyup.
2020-09-10 08:21:20 -07:00
voussoir
8aa2b8dd3c
Rewrite photo_clipboard actions to take ids instead of cards.
...
Following the previous commit about the checkbox on the /photo page,
this fixes all of the code assuming that we're dealing with photo_card
divs, the majority of which was doing nothing but accessing the id.
2020-09-10 08:20:55 -07:00
voussoir
8d2af3255b
Add endpoints set_searchhidden, unset_searchhidden and checkbox.
2020-09-09 20:51:15 -07:00
voussoir
4569e7848c
Let apply_check_all search for the checkboxes, not the photo cards.
2020-09-09 20:09:41 -07:00
voussoir
348215a8ee
Add whitelist/blacklist functionality to merge_params.
2020-09-04 15:10:41 -07:00
voussoir
5356b19858
Add explanation of data-prompt-class et al.
...
I think I left these blank because I felt they should be obvious.
But I'd rather have it explicit.
2020-09-04 14:50:51 -07:00
voussoir
139998172f
Add spinner.BAIL for cancelling spinner without launching callback.
2020-09-04 11:25:11 -07:00
voussoir
7f48c3e97c
Add css/js classes entry_with_history, _with_tagname_replacements.
2020-09-04 11:20:51 -07:00
voussoir
1f88b007cd
Fine-tune use of let/const in spinner.js.
2020-09-03 15:57:02 -07:00
voussoir
d6a46ed551
Use const for api.js url/data variables.
2020-09-03 15:42:13 -07:00
voussoir
05b39c21fd
Replace loop uses of var with let/const.
2020-09-03 15:33:37 -07:00
voussoir
8af340e442
Replace non-global uses of var with let.
2020-09-03 15:31:47 -07:00
voussoir
1849c2e58b
Add tag_autocomplete's on_pageload into its namespace.
2020-09-03 14:30:57 -07:00
voussoir
fe7b5de427
Replace many uses of forEach with for-of.
2020-09-03 14:18:05 -07:00
voussoir
45b42d3ca3
Add css/js class tabbed_container.
2020-09-03 11:54:14 -07:00
voussoir
a15f14ad06
Simplify parameter format for hotkeys.register_hotkey.
2020-09-03 11:47:40 -07:00
voussoir
bff4a12fcb
Add various comments, docstrings, and console.log.
2020-09-03 11:46:26 -07:00
voussoir
6b037e1120
Move several /batch functions into api.js.
2020-08-30 19:18:06 -07:00
voussoir
c8ab3c22c9
Remove redundant call to removeChild.
...
appendChild already takes elements out of the old parent.
2020-08-30 17:53:46 -07:00
voussoir
90873c648b
Move hotkey listener from anonymous to named function.
2020-08-30 17:53:11 -07:00
voussoir
2eed3ff1c5
Add css/js class enable_on_pageload.
2020-08-28 16:23:28 -07:00
voussoir
7609f20dd0
Let button_with_confirm inherit original CSS when not specified.
2020-08-07 21:14:27 -07:00
voussoir
3e9e7e6a52
Add more to docstring about spinner delay attribute.
2020-07-10 16:34:20 -07:00
voussoir
0cb41f09cf
Add docstring to bind_box_to_button, and some small linting.
2020-06-30 20:33:24 -07:00
voussoir
68f52271f1
Dedent by using early returns.
2020-06-28 17:07:28 -07:00
voussoir
b817a7e8b9
Use dot notation instead of subscript.
2020-06-28 16:55:48 -07:00
voussoir
6cfa83e2d8
Add attribute "completed" to response object.
2020-06-28 16:52:08 -07:00
voussoir
fbf462af64
Fix mortifying typo tag_automplete -> tag_autocomplete.
2020-06-25 10:02:42 -07:00