Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quassel-rest-search
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
quassel-rest-search
Commits
00f57cfe
Commit
00f57cfe
authored
8 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Added sender colors and fixed a tiny bug
parent
4f5cc759
Branches
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
res/search.css
+1
-1
1 addition, 1 deletion
res/search.css
res/search.js
+65
-3
65 additions, 3 deletions
res/search.js
with
66 additions
and
4 deletions
res/search.css
+
1
−
1
View file @
00f57cfe
...
...
@@ -68,7 +68,7 @@ message sender {
}
message
time
{
width
:
1
4
8px
;
width
:
18
0
px
;
display
:
inline-block
;
padding
:
0
24px
;
text-align
:
right
;
...
...
This diff is collapsed.
Click to expand it.
res/search.js
+
65
−
3
View file @
00f57cfe
...
...
@@ -22,7 +22,7 @@ var wrap_click_handler = function (fun) {
var
sel
=
getSelection
().
toString
();
if
(
sel
)
{
event
.
stopPropagation
();
}
else
{
}
else
if
(
fun
)
{
fun
(
event
);
}
}
...
...
@@ -61,7 +61,68 @@ $("#q").blur(function () {
});
var
sendercolor
=
function
(
nick
)
{
return
""
;
var
sendercolors
=
[
"
#e90d7f
"
,
"
#8e55e9
"
,
"
#b30e0e
"
,
"
#17b339
"
,
"
#58afb3
"
,
"
#9d54b3
"
,
"
#b39775
"
,
"
#3176b3
"
,
"
#e90d7f
"
,
"
#8e55e9
"
,
"
#b30e0e
"
,
"
#17b339
"
,
"
#58afb3
"
,
"
#9d54b3
"
,
"
#b39775
"
,
"
#3176b3
"
];
var
reflect
=
function
(
crc
,
n
)
{
var
j
=
1
,
crcout
=
0
;
for
(
var
i
=
(
1
<<
(
n
-
1
));
i
>
0
;
i
>>=
1
)
{
if
((
crc
&
i
)
>
0
)
{
crcout
|=
j
;
}
j
<<=
1
;
}
return
crcout
;
};
var
qChecksum
=
function
(
str
)
{
var
crc
=
0xffff
;
var
crcHighBitMask
=
0x8000
;
for
(
var
i
=
0
;
i
<
str
.
length
;
i
++
)
{
var
b
=
str
.
codePointAt
(
i
);
var
c
=
reflect
(
b
,
8
);
for
(
var
j
=
0x80
;
j
>
0
;
j
>>=
1
)
{
var
highBit
=
crc
&
crcHighBitMask
;
crc
<<=
1
;
if
((
c
&
j
)
>
0
)
{
highBit
^=
crcHighBitMask
;
}
if
(
highBit
>
0
)
{
crc
^=
0x1021
;
}
}
}
crc
=
reflect
(
crc
,
16
);
crc
^=
0xffff
;
crc
&=
0xffff
;
return
crc
;
};
var
senderIndex
=
function
(
str
)
{
var
nickToHash
=
nick
.
replace
(
/_*$/
,
""
).
toLowerCase
();
return
qChecksum
(
str
)
&
0xF
;
};
return
sendercolors
[
senderIndex
(
nick
)];
};
var
render_buffer_full
=
function
(
buffer
)
{
...
...
@@ -164,7 +225,8 @@ var attach_context = function (elem) {
elem
.
unbind
();
var
id
=
elem
.
data
(
"
contextid
"
);
var
bufferid
=
elem
.
data
(
"
bufferid
"
);
elem
.
click
(
wrap_click_handler
(
make_toggle_context
(
bufferid
,
id
)));
elem
.
click
(
wrap_click_handler
(
function
(
e
)
{
e
.
stopPropagation
();
}));
$
(
"
#message
"
+
buffers
[
bufferid
].
contexts
[
id
].
original
.
messageid
).
click
(
wrap_click_handler
(
make_toggle_context
(
bufferid
,
id
)));
elem
.
find
(
"
.load_before
"
).
click
(
wrap_click_handler
(
function
(
e
)
{
earlier
(
bufferid
,
id
,
5
);
e
.
stopPropagation
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment