Fossil

Check-in [3e956a2354]
Login

Check-in [3e956a2354]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Chat style tweaks.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | chatroom-dev
Files: files | file ages | folders
SHA3-256: 3e956a2354c2003f8ad29a638a7e2a535cca5009b5292203d8a93bc318d33e56
User & Date: stephan 2020-12-23 10:28:53.454
Context
2020-12-23
10:41
Added a Cancel button to the drag/drop file/image field to clear the pending blob. Still need to hook it up to interact with the file input field, but that will have to wait a bit. ... (check-in: 018084c50e user: stephan tags: chatroom-dev)
10:28
Chat style tweaks. ... (check-in: 3e956a2354 user: stephan tags: chatroom-dev)
10:23
chat: added drag/drop support for files. Images get previewed like those pasted from the clipboard. ... (check-in: 4c0146f180 user: stephan tags: chatroom-dev)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/chat.c.
82
83
84
85
86
87
88
89
90
91

92
93
94
95


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
  @   flex: 5 1 auto;
  @ }
  @ #chat-input-file {
  @   display: flex;
  @   flex-direction: row;
  @   align-items: center;
  @ }
  @ #chat-input-file > span,
  @ #chat-input-file > input[type=file] {
  @   align-self: flex-start;

  @ }
  @ #chat-input-file > input {
  @   flex: 1 0 auto;
  @ }


  @ .chat-timestamp {
  @    font-family: monospace;
  @    font-size: 0.8em;
  @    white-space: pre;
  @    text-align: left;
  @    opacity: 0.8;
  @ }
  @ #chat-drop-zone {
  @   box-sizing: content-box;
  @   background-color: #e0e0e0;
  @   flex: 3 1 auto;
  @   padding: 0.5em 1em;
  @   border: 1px solid #808080;
  @   border-radius: 0.25em;
  @ }
  @ #chat-drop-zone.dragover {
  @   border: 1px dashed green;
  @ }
  @ #chat-drop-details {
  @   white-space: pre;
  @   font-family: monospace;
  @ }
  @ </style>
  @ <form accept-encoding="utf-8" id="chat-form">
  @ <div id='chat-input-area'>
  @   <div id='chat-input-line'>
  @     <input type="text" name="msg" id="sbox" \
  @      placeholder="Type message here.">
  @     <input type="submit" value="Send">
  @   </div>
  @   <div id='chat-input-file'>
  @     <span>File:</span>
  @     <input type="file" name="file">
  @     <div id="chat-drop-zone">
  @        Or drag/drop a file in this spot, or paste an image from
  @        the clipboard if supported by your environment.
  @        <div id="chat-drop-details"></div>
  @      </div>
  @   </div>
  @ </div>
  @ </form>
  @ <hr>







<


>




>
>










|




















<


|







82
83
84
85
86
87
88

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
  @   flex: 5 1 auto;
  @ }
  @ #chat-input-file {
  @   display: flex;
  @   flex-direction: row;
  @   align-items: center;
  @ }

  @ #chat-input-file > input[type=file] {
  @   align-self: flex-start;
  @   flex: 1 1 auto;
  @ }
  @ #chat-input-file > input {
  @   flex: 1 0 auto;
  @ }
  @ #chat-input-file > *:nth-child(1) { margin-right: 0.5em; }
  @ #chat-input-file > *:nth-child(2) { margin-left: 0.5em; }
  @ .chat-timestamp {
  @    font-family: monospace;
  @    font-size: 0.8em;
  @    white-space: pre;
  @    text-align: left;
  @    opacity: 0.8;
  @ }
  @ #chat-drop-zone {
  @   box-sizing: content-box;
  @   background-color: #e0e0e0;
  @   flex: 2 1 auto;
  @   padding: 0.5em 1em;
  @   border: 1px solid #808080;
  @   border-radius: 0.25em;
  @ }
  @ #chat-drop-zone.dragover {
  @   border: 1px dashed green;
  @ }
  @ #chat-drop-details {
  @   white-space: pre;
  @   font-family: monospace;
  @ }
  @ </style>
  @ <form accept-encoding="utf-8" id="chat-form">
  @ <div id='chat-input-area'>
  @   <div id='chat-input-line'>
  @     <input type="text" name="msg" id="sbox" \
  @      placeholder="Type message here.">
  @     <input type="submit" value="Send">
  @   </div>
  @   <div id='chat-input-file'>

  @     <input type="file" name="file">
  @     <div id="chat-drop-zone">
  @        Drag/drop a file into this spot, or paste an image from
  @        the clipboard if supported by your environment.
  @        <div id="chat-drop-details"></div>
  @      </div>
  @   </div>
  @ </div>
  @ </form>
  @ <hr>