Compare commits
2 Commits
6b4709d011
...
eb1284060a
| Author | SHA1 | Date | |
|---|---|---|---|
| eb1284060a | |||
| 4266ac1f12 |
@ -69,10 +69,9 @@ class ChannelMessageService(BaseService):
|
|||||||
"color": user["color"],
|
"color": user["color"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
context['message'] = whitelist_attributes(context['message'])
|
|
||||||
try:
|
try:
|
||||||
template = self.app.jinja2_env.get_template("message.html")
|
template = self.app.jinja2_env.get_template("message.html")
|
||||||
model["html"] = template.render(**context)
|
model["html"] = whitelist_attributes(template.render(**context))
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex, flush=True)
|
print(ex, flush=True)
|
||||||
|
|
||||||
@ -118,7 +117,6 @@ class ChannelMessageService(BaseService):
|
|||||||
async def save(self, model):
|
async def save(self, model):
|
||||||
context = {}
|
context = {}
|
||||||
context.update(model.record)
|
context.update(model.record)
|
||||||
context['message'] = whitelist_attributes(context['message'])
|
|
||||||
user = await self.app.services.user.get(model["user_uid"])
|
user = await self.app.services.user.get(model["user_uid"])
|
||||||
context.update(
|
context.update(
|
||||||
{
|
{
|
||||||
@ -129,7 +127,7 @@ class ChannelMessageService(BaseService):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
template = self.app.jinja2_env.get_template("message.html")
|
template = self.app.jinja2_env.get_template("message.html")
|
||||||
model["html"] = template.render(**context)
|
model["html"] = whitelist_attributes(template.render(**context))
|
||||||
return await super().save(model)
|
return await super().save(model)
|
||||||
|
|
||||||
async def offset(self, channel_uid, page=0, timestamp=None, page_size=30):
|
async def offset(self, channel_uid, page=0, timestamp=None, page_size=30):
|
||||||
|
|||||||
@ -12,7 +12,7 @@ function showTerm(options){
|
|||||||
|
|
||||||
|
|
||||||
class StarField {
|
class StarField {
|
||||||
constructor({ count = 100, container = document.body } = {}) {
|
constructor({ count = 50, container = document.body } = {}) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.starCount = count;
|
this.starCount = count;
|
||||||
this.stars = [];
|
this.stars = [];
|
||||||
@ -567,7 +567,7 @@ const count = Array.from(messages).filter(el => el.textContent.trim() === text).
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const starField = new StarField({starCount: 100});
|
const starField = new StarField({starCount: 50});
|
||||||
app.starField = starField;
|
app.starField = starField;
|
||||||
|
|
||||||
class DemoSequence {
|
class DemoSequence {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user