muxator
72260b86de
db/API.js: reuse the already required padMessageHandler (1 of 2)
...
Commit 94cb743ca8
("Fix API call appendChatMessage to send new message to all
connected clients") fixed a bug, but introduced a redundant require().
2019-03-07 00:04:08 +01:00
muxator
10172af199
db/API.js: no need to parseInt(time) here
...
We are already sure that time is an int
2019-03-07 00:02:24 +01:00
muxator
b34fc2de2b
use Date.now() instead of new Date().getTime()
...
This is documented to be more performant.
The substitution was made on frontend code, too (i.e., the one in /static),
because Date.now() is supported since IE 9, and we are life supporting only
IE 11.
Commands:
find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g"
find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g"
Not done on jQuery.
2019-02-26 23:25:15 +01:00
muxator
169a06793d
db/API.js: almost removed optional argument handling
...
The HTTP API doesn't ever omit arguments, it always passes `undefined` for a
parameter that wasn't supplied in the request.
The functions that were simplified are:
- getRevisionChangeset()
- getText()
- getHTML()
- saveRevision()
The only function still supporting optional arguments is getPadSafe(), which is
only called from this module.
2019-02-19 00:15:54 +01:00
muxator
26f3f1bcd0
db/Pad.js: make "force" parameter non optional in Pad.prototype.copy()
...
This function was simulating two overloads:
1. copy(destinationID, force, callback)
2. copy(destinationID, callback), in this case "force" would be assumed false
But all the call sites always used the version with arity 3.
Thus, we can remove that optionality and always assume that the funcion will be
called with three parameters. This will simplify future work.
2019-02-13 14:01:24 +01:00
muxator
1a93ab4eb5
db/Pad: reversed truthy condition to make core logic evident
...
Since the original comparison compared for truthy and not for "===", and it's
3 AM now, I blindly negated it, in order to show how fragile it was in the first
instance.
No functional changes.
This is the final commit of this refactoring series.
2018-08-29 03:03:34 +02:00
muxator
69e1bf28aa
db/Pad: reversed condition to make core logic evident. No functional changes
...
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:52:26 +02:00
muxator
d931a700b4
db/Pad: reversed condition to make error handling evident. No functional changes
...
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:49:40 +02:00
muxator
0e8789863c
db/Pad: removed unuseful else clause, no functional changes
2018-08-29 02:46:08 +02:00
muxator
049f5f2859
db/Pad: removed unuseful else clause, no functional changes
2018-08-29 02:44:51 +02:00
muxator
e90487c3e2
db/GroupManager: early return, no functional changes
2018-08-29 02:42:29 +02:00
muxator
a1d21c0cd2
db/GroupManager: early return, no functional changes
2018-08-29 02:41:53 +02:00
muxator
9ed7608421
db/GroupManager: early return, no functional changes
2018-08-29 02:41:14 +02:00
muxator
da8faa1aa9
db/GroupManager: early return, no functional changes
2018-08-29 02:40:14 +02:00
muxator
f7254a47ea
db/GroupManager: early return, no functional changes
2018-08-29 02:39:05 +02:00
muxator
604952bc97
db/GroupManager: fix indentation
...
This is to make easier on the eye the next change.
2018-08-29 02:38:09 +02:00
muxator
c85bcf0614
db/GroupManager: move inner function on top. No functional change
...
This is to make easier on the eye the next change.
2018-08-29 02:36:25 +02:00
muxator
6af419a88e
SecurityManager.js: early return, no functional changes
2018-08-29 02:33:29 +02:00
muxator
61823e7689
db/AuthorManager: early return, no functional changes
2018-08-29 02:28:40 +02:00
muxator
2b8646a855
db/AuthorManager: early return, no functional changes
2018-08-29 02:28:35 +02:00
muxator
b59818676e
db/API.js: early return to make error handling evident. No functional changes
2018-08-29 02:18:32 +02:00
muxator
67ce19eddb
db/API.js: removed unuseful else clause, no functional changes
2018-08-29 02:16:24 +02:00
muxator
610a6db8c8
db/API.js: early return, no functional changes
2018-08-29 02:13:06 +02:00
muxator
fef57efd46
db/API.js: early return, no functional changes
2018-08-29 02:10:45 +02:00
muxator
42bc0a59e1
db/API.js: early return, no functional changes
2018-08-29 02:09:33 +02:00
muxator
05a33f1533
db/API.js, SessionManager: lot of copied & pasted code in integer parsing
...
Replaced with an early return, no functional changes.
2018-08-29 02:08:05 +02:00
muxator
1d45a63864
db/API.js: early return, no functional changes
2018-08-29 01:57:00 +02:00
muxator
30d814d8ed
db/API.js: early return, no functional changes
2018-08-29 01:57:28 +02:00
muxator
4728736dd8
db/PadManager: early return, no functional changes
2018-08-29 01:47:38 +02:00
muxator
ecb0c41d29
db/PadManager: early return, no functional changes
2018-08-29 01:46:18 +02:00
muxator
12f224ae72
db/PadManager: early return, no functional changes
2018-08-29 01:44:13 +02:00
muxator
27b3b0ecd2
logs: on the server, use template literals when possible
...
It's just synctactic sugar, but it is always better than executing string
concatenations in one's mind.
Do not do this with files in src/static, because we want to keep IE 11
compatibility.
2018-08-27 01:29:37 +02:00
John McLear
f15c7d7186
Merge pull request #3280 from lmagniez/ImprovedReadibility
...
Improved readibility
2018-04-03 17:22:08 +01:00
John McLear
2765a95774
Merge pull request #3218 from klausweiss/develop
...
Feature: New server-side hook: onAccessCheck
2018-04-03 13:38:47 +01:00
Luiza Pagliari
187e51948d
[fix] Don't show "pad deleted" message when copying pad ( #3320 )
...
Fix #3183
2018-02-16 14:18:51 -02:00
Loick Magniez
54e834194b
Changed the color palette and changed the pad's font size to 16px
2017-11-22 16:04:17 +01:00
Mikołaj Biel
2508b9749c
fix typo
2017-07-10 20:59:08 +02:00
Mikołaj Biel
35702a0589
[feat] New server-side hook: onAccessCheck
2017-07-10 20:54:32 +02:00
Luiza Pagliari
fc89034a55
[feat] New server-side hook: padCopy
...
Let plugins know when a pad is copied.
2017-05-18 18:52:14 -03:00
John McLear
d545630912
fixes #2945
2016-05-28 22:25:44 +01:00
John McLear
638757fdb5
Update DB.js
2016-01-06 00:01:48 +00:00
Francois Cassin
2bd698343a
Protects against a null atext in cloneAText
2015-11-10 16:21:43 +01:00
Bradley Arvin
a9d7ab9e18
Fix for #2809
2015-10-28 13:28:54 -04:00
Ted Mielczarek
a675659dc2
Add an appendText API
2015-10-19 15:27:09 -04:00
Andreas Fried
e6b0e954b5
Fix off-by-one: The chatHead is in fact a valid message index.
...
This fixes #2751 .
2015-09-30 00:48:15 +02:00
Stefan
cc9f88e7ed
Merge pull request #2757 from Gared/doc_append_chat_message
...
Add appendChatMessage API to docs
2015-08-30 18:15:51 +02:00
Stefan
f27aacc5bf
Fix missing bracket
2015-08-15 22:41:59 +02:00
Stefan
94cb743ca8
Fix API call appendChatMessage to send new message to all connected clients
2015-08-15 22:05:31 +02:00
Xavid
ad137fa4c8
Restore newline-adding to setText() if passed string does not end in '\n'.
...
Add a test for the ending-in-'\n' case and update tests for the other case.
2015-06-30 04:47:55 -04:00
Xavid
a4fe0d0dc8
Add an 'author' entry to the context for the padCreate and padUpdate hooks.
2015-06-21 11:29:17 -04:00