Comments (17)
[main textbox]
[@user dropdown here] [button to add mention]
This could reload the page so the server could append the @user link at the end of the post-in-progress. Then the user can copy-paste it to move it around inside their post.
Or maybe with CSS wizardry we can show the @user link code for the user to copy-paste into the post:
[main textbox]
[@user dropdown] copy and paste this user code: [code for @user appears here]
from oasis.
My advise is to fill a <datalist>
with the names and ids of friends and following: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
If you really want a dropdown, then it can be divided into sections using <optgroup>
to organize the dropdown: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
from oasis.
Thanks @soapdog!
I think <datalist>
is perfect, it just means we need a "add another recipient" button that refreshes the page to add a second datalist, since we can't currently do multiple
. I found this, which suggests that Chrome and Opera will let you do multiple
if you set type="email"
, but we don't want that.
from oasis.
-
To make impersonation attacks harder, let's sort your direct friends first in the list and make them visually distinguishable from the rest.
-
We'll have to include the list of users and IDs in the HTML of most pages instead of loading them on demand. It could be very long. Maybe limit it to 1 or 2 hops, plus the people who show up on the currently viewed page?
from oasis.
I love that idea, I never would've thought of that!
I'm thinking something like:
- People in this thread
- jedahan
- soapdog
- cinnamon-bun
- People that you follow
- alice
- bob
- carol
- People followed by people you follow
- dave
- emma
- frank
Just inserting the text at the bottom would be so easy, and I'd imagine we could do the same thing for blob uploads too (!).
from oasis.
Multiselect checkboxes styled as profile avatars could work real nicely. Lots of different sorting methods could be tried. Might even be able to “insert” the text within the messaging using some css styling hacks :)
from oasis.
https://w3bits.com/css-floating-labels/ for an example of making some label look like it’s in the textarea a little bit
from oasis.
I totally agree. Anything is better than what we have now. :~)
That link looks great. I've been struggling with the separate goals of make form inputs match the theme and make form inputs familiar and easy to recognize, and it hasn't always gone well. For example, I think the theme chooser is confusing, and when I watched a friend use it he selected "set theme" because it's impossible to tell that the <select>
is a dropdown menu. If we remove appearance: none
then it shows the familiar button with an arrow, but there's no way to change the button/arrow colors.
from oasis.
If you can clearly state design goals like that, I know a css wizard at work who could help :)
from oasis.
(Note for whoever implements this: my guess is that the "add a recipient button" will probably require the same code for post previews, since you're basically refreshing the page with a form button.)
from oasis.
TBH, I think I'm gonna use <datalist>
on patchfox as well... so much easier.
from oasis.
Blaze the trail!
One thing I'm still unsure how to solve: @mentions in the middle of a sentence. It's easy to maintain a list of recipients with a <datalist>
and throw those at the top of the post or something, but I'm not sure how to do mid-sentence shenanigans.
from oasis.
I wonder if theres a css target psuedo-selector that allows regex. This sounds like an awful idea.
from oasis.
total hack for zero-js searching:
<style>
input:invalid + ul {
display: none;
}
</style>
<input id=searched required pattern=".*@.*">
</input>
<ul>
<li> @micro
<li> @christianbundy
</ul>
from oasis.
https://jsfiddle.net/mpa61wyo/
from oasis.
okay, last weird experiment
<style>
input:invalid + ul, #micro, #eli, #clear {
display: none;
}
#micro:target, #eli:target {
display: block;
}
#eli:target ~ #clear, #micro:target ~ #clear {
display: block;
}
</style>
<div> sending to....
<span id=micro>[@micro](@wsOe...)</span>
<span id=eli>[@eli](@lolol...)</span>
<a href="#" id="clear">x</a>
</div>
<input id=searched required pattern=".*@.*">
</input>
<ul>
<li> <a href="#micro"> @micro </a>
<li> <a href="#eli"> @eli </a>
</ul>
https://jsfiddle.net/k7urL0h1/
from oasis.
Other ideas:
- If user includes a plaintext
@mention
in their post, replace it with a markdown link[@mention](@abcde)
when generating a preview of their post. This won't work with usernames that have spaces. We might have to include widgets on the preview page to help disambiguate the auto-links. - If user puts a full link to an Oasis user page
http://localhost:3000/author/%40...
also replace it with a markdown @mention link
from oasis.
Related Issues (20)
- Blob metadata in messages
- core dump due to too much memory? HOT 7
- Getting Error: listen EINVAL: invalid argument ::1:8989 on OpenBSD HOT 4
- Refactoring code base for easier maintaining
- Crashes on loading certain images HOT 1
- Oasis shows replies and comments from blocked people HOT 4
- ENOENT when running via podman HOT 3
- On Safari; the defacto browser for ios, video does not work.
- Various breakage under Node 16. HOT 3
- No option to reindex in Settings HOT 2
- Wanted blobs are bigger than currently set blobs.max HOT 1
- pub invites seems to be broken HOT 1
- ssb.friends.get Error HOT 27
- Critical bugs with database indexing preventing use
- allow-host parameter is not read from config file HOT 1
- Error: spawn nj-cli ENOENT when building ~/.npm-global/lib/node_modules/@fraction/oasis/node_modules/ssb-validate2-rsjs-node HOT 2
- App immediately crashing HOT 1
- Cannot install on MacOS arm64 / Apple Silicon HOT 4
- Doc: Add upgrade instructions HOT 1
- Error when installing oasis HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oasis.