Commit Graph

264 Commits (0c51201901a444817b8e5ba5eb5644e2b5329e79)

Author SHA1 Message Date
voussoir 89195d3449 Add comment about response catching strictness levels. 2021-01-01 19:08:36 -08:00
voussoir 8f9b4142a6 Improve UI performance of selecting / deselecting photo cards.
Move save_clipboard into a 0-timeout. Check checkboxes immediately
instead of relying on apply_check_all / update_pagestate to make a
redundant loop through everything.
2020-12-26 13:21:06 -08:00
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 843e8d6743 Oops, put photos_holder rule in etiquette.css, not common. 2020-11-04 17:35:54 -08:00
voussoir 7770f7640a Add class photos_holder which is centers photos in narrow mode.
In narrow mode, it's very possible to wind up with only 1 photo per row,
and it looks silly when they are left-justified. Centered looks a little
more natural to me in this case.
2020-11-04 17:11:48 -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 7715e10b12 Trade padding for bigger font on remove_tag_button.
Primarily affects the "unlink" / "delete" buttons on /tags.
Without the padding we can get an extra pt of font size, and these
buttons are somewhat of a readability struggle.
2020-10-17 17:28:32 -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 41353b2eb4 Move current default css into theme_turquoise. Always pick a theme. 2020-09-25 16:27:47 -07:00
voussoir 3fb198f994 Add explicit @media queries for wide mode, not just default to override.
Any properties that are different in wide/narrow mode should be defined
in the correct media query. I got tired of having wide mode be the
default and then narrow mode having to unset/initial all the attributes
that aren't relevant to narrow.
2020-09-18 21:12:28 -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 9a29048ccf Split sticky_side functionality into _side, _bottom.
This makes the role of each css definition more clear, and could allow
for cases where the side is sticky in wide mode but not sticky in
narrow mode.
2020-09-18 20:37:40 -07:00
voussoir 1af8342202 Catch json parse errors, setting json_ok = false. 2020-09-15 23:10:35 -07:00
voussoir 35b5b5cd21 Some slate.css color tweaks. 2020-09-15 15:04:27 -07:00
voussoir 2a379919e0 Use grid instead of flexbox for message_area for better gaps. 2020-09-15 15:03:40 -07:00
voussoir 9102b37d5a Let slate.css use black text on buttons. 2020-09-14 20:25:51 -07:00
voussoir dd0ee7a72a Use more const. 2020-09-14 18:33:53 -07:00
voussoir 733776ee88 Failed experiment: clientside updates of tag actions.
I'm committing this so I can reference it later if I decide to try
again, but for the time being I'm going to immediately revert it.
2020-09-14 17:21:13 -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 2d01297729 Adjust photo_card_searchhidden to 2px dotted border. 2020-09-09 23:55:46 -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 804afe912f Add css class .photo_card_searchhidden. 2020-09-09 19:24:43 -07:00
voussoir 82758ed336 Rename color_3d_shadow -> color_shadow. 2020-09-09 15:57:53 -07:00
voussoir 53da81a283 Add .bold class. 2020-09-05 17:47:29 -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 0ee1599c93 Improve color of tab buttons active/inactive/hover. 2020-09-03 12:04:18 -07:00
voussoir 45b42d3ca3 Add css/js class tabbed_container. 2020-09-03 11:54:14 -07:00
voussoir 8dafe8c4f4 Synchronize Etiquette common.css and YCDL common.css. 2020-09-03 11:50:16 -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 c5fbcf0056 Add z-index to photo_card_selected::after. 2020-08-28 17:56:30 -07:00
voussoir 8163f33ba3 Reinstate z-index for photo_card_filename:hover.
For extremely long titles, it was being obscured by the photo
card on the next row.
2020-08-28 17:12:32 -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 b6f4874b66 Move colored button class rules below button element rules. 2020-08-07 21:07:30 -07:00
voussoir 976534982b Add border-radius to album cards, like photo cards. 2020-07-26 19:17:47 -07:00
voussoir 3e9e7e6a52 Add more to docstring about spinner delay attribute. 2020-07-10 16:34:20 -07:00
voussoir 592c8d6bd2 Increase tag_object line height from 1.3 to 1.5.
I'm finding weird behavior where on the main /tags page, hovering
over the tags shows the delete / unlink button without a problem,
but on a specific tag page hovering over this button causes the
rest of the list to shift a pixel or two.
I'm sure this line-height fix is nothing more than a bandaid and
not the right thing to change.
2020-07-01 16:40:30 -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 b81aad78dd Rename CSS vars color_theme_* and color_site_* to color_*.
There was just no point to naming them like this because all of the
color vars obviously represent some part of the site's color theme.
2020-06-25 10:03:50 -07:00
voussoir fbf462af64 Fix mortifying typo tag_automplete -> tag_autocomplete. 2020-06-25 10:02:42 -07:00
voussoir 8c50700290 Add more docstring to button_with_confirm data-onclick parameter. 2020-06-17 14:08:03 -07:00
voussoir a56b5274c9 Read spinner button function from onclick instead of data-onclick.
I think my original reason for doing this was to prevent the button
from being operational until after the spinner initialization has
completed, so you don't get any weird half-functional spinner buttons.
However, in practice I'm finding that I constantly forget about this
and it adds tedium to creating spinner buttons.
Will review if any actual problems come up.
2020-06-17 14:04:27 -07:00
voussoir d6ca8206b4 Synchronize Etiquette common.js and YCDL common.js. 2020-06-17 13:38:20 -07:00
voussoir e1033d0138 Move tagname related functions from common.js to tag_autocomplete.js. 2020-06-17 12:42:08 -07:00
voussoir fdfc7308b0 Move all spinner related functions from common.js to spinner.js. 2020-06-17 12:41:13 -07:00
voussoir 91ac2315e6 Put meta before data in the json responses. 2020-06-17 12:37:22 -07:00
voussoir 136a47bf10 Add support for spinner groups, all buttons spin when one clicked. 2020-06-11 18:20:20 -07:00
voussoir 2f5510fd0c Rename variable spinner_button_count -> spinner_button_index. 2020-05-28 19:01:42 -07:00
voussoir 83c2ed7882 Redesign album grid cards to look more like photo cards.
Unfortunately these cards are taller rather than wider so the
already-neglected unlink buttom becomes even more horizontally crammed.
That's going to need a big fixup anyway.
2020-04-02 22:28:36 -07:00
voussoir e5f2b788fe Replace bottom & right margin with all-round 8px.
The two-sided margin was meant to create a particular spacing on the
albums page, but the purpose of cards is I should be able to use
them in many other contexts. So an all-round margin is easier to
work with when displaying cards anywhere else.
2020-04-02 21:59:22 -07:00
voussoir 9ac91d3850 Add tag delete button to specific tag page.
On the main tag listing, for child tags, you only get an unlink
button on hover. So if you want to delete a child tag you'd have to
unlink, then refresh, then delete. Now you can just go to its page
and delete it there.
2020-02-27 14:57:27 -08:00
voussoir 45cb96cc5c Add endpoint /photo/photo_id/delete. 2020-02-26 18:57:29 -08:00
voussoir 4da331a3ab Fix entry_with_replacements unable to select text.
This hook had a bug where you couldn't select text because every
time you push a button, including ctrl+a or shift+left/right, the
cursor position gets reset and then deselects immediately.

So let's only reset the content and cursor only when text changes,
so arrow keys and ctrl don't have any negative effects.
2020-01-30 12:28:28 -08:00
voussoir 10b674e8d8 Add entry_with_tagname_replacements for use on tagname inputs.
Unfortunately, when adjusting the box's value, it causes the datalist
to disappear, and it only comes back after you press another key.
I can't figure out how to make the datalist reappear automatically
with js.
2020-01-15 20:29:56 -08:00
voussoir e7ac27962f Make <a> tags always have pointer cursor.
At the moment, tag_objects have an option for a javascript void
link for the purpose of getting a pointer cursor without a real link.
Well I want to phase those javascript void links out so let's just
make a tags always pointy.
2020-01-14 16:17:59 -08:00
voussoir 89bfca8f9f Add endpoint for photo generate thumbnail. 2020-01-12 14:52:03 -08:00
voussoir e5d0974306 Add a blue transparency over selected photos. 2020-01-11 16:33:30 -08:00
voussoir a4458efc7a Add basic thumbnail for albums. 2020-01-11 16:23:56 -08:00
voussoir b7f745443b Rearrange some of these rules. 2019-12-21 14:50:38 -08:00
voussoir fcce2a55a2 Apply filename hover effects to grid view only. 2019-12-21 14:49:42 -08:00
voussoir d509e3cd20 Hide thumbnail and tools from list-view album cards. 2019-12-21 14:47:04 -08:00
voussoir c984159a76 Minor css tweaks. 2019-09-11 01:13:10 -07:00
voussoir d273adbf27 Move new #right:before to common.css. 2019-09-11 01:12:04 -07:00
voussoir 23cdd4dc2b Now remove these explicit border-boxes. 2019-09-10 19:31:18 -07:00
voussoir cac18b76d0 Switch to border-box by default. 2019-09-10 15:32:35 -07:00
voussoir 42be44a509 Set #content_body grid-gap to get both row and column gaps. 2019-08-26 14:50:45 -07:00