Browse Source
Resolve the URLs the same way pictures are resolved for the chat messages
Resolve the URLs the same way pictures are resolved for the chat messages
Reset the resolve status if the incoming or sent message is edited Fix the CURL user agent Fix stripTags to remove useless spaces CSS fixes Update the dependenciespull/978/head
13 changed files with 169 additions and 41 deletions
-
10app/Message.php
-
12app/Url.php
-
6app/helpers/StringHelper.php
-
2app/helpers/UtilsHelper.php
-
15app/widgets/Chat/Chat.php
-
27app/widgets/Chat/_chat_embed.tpl
-
14app/widgets/Chat/chat.css
-
22app/widgets/Chat/chat.js
-
8app/widgets/ChatActions/ChatActions.php
-
43composer.lock
-
49database/migrations/20201222194330_add_autoincrement_to_urls_table.php
-
1public/theme/css/icon.css
-
1public/theme/css/listn.css
@ -0,0 +1,27 @@ |
|||
<li class="block"> |
|||
{if="!empty($embed->images)"} |
|||
<span class="primary icon thumb active color {$embed->url|stringToColor}" |
|||
onclick="Preview_ajaxShow('{$embed->images[0]['url']|protectPicture}')" |
|||
style="background-image: url({$embed->images[0]['url']|protectPicture})" |
|||
> |
|||
{if="count($embed->images) > 1"} |
|||
<i class="material-icons">photo_library</i> |
|||
{else} |
|||
<i class="material-icons">image</i> |
|||
{/if} |
|||
</span> |
|||
{else} |
|||
<span class="primary icon bubble gray"> |
|||
{if="$embed->providerIcon"} |
|||
<img src="{$embed->providerIcon}"/> |
|||
{else} |
|||
<i class="material-icons">link</i> |
|||
{/if} |
|||
</span> |
|||
{/if} |
|||
|
|||
<div> |
|||
<p class="line">{$embed->title}</p> |
|||
<p class="line">{$embed->description}</p> |
|||
</div> |
|||
</li> |
@ -0,0 +1,49 @@ |
|||
<?php |
|||
|
|||
use Movim\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class AddAutoincrementToUrlsTable extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->disableForeignKeyCheck(); |
|||
|
|||
$this->schema->table('urls', function (Blueprint $table) { |
|||
$table->dropPrimary(); |
|||
}); |
|||
|
|||
$this->schema->table('urls', function (Blueprint $table) { |
|||
$table->increments('id')->first(); |
|||
$table->unique('hash'); |
|||
}); |
|||
|
|||
$this->schema->table('messages', function (Blueprint $table) { |
|||
$table->integer('urlid')->unsigned()->nullable(); |
|||
|
|||
$table->foreign('urlid') |
|||
->references('id')->on('urls') |
|||
->onDelete('set null'); |
|||
}); |
|||
|
|||
$this->enableForeignKeyCheck(); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->disableForeignKeyCheck(); |
|||
|
|||
$this->schema->table('messages', function (Blueprint $table) { |
|||
$table->dropForeign('messages_urlid_foreign'); |
|||
$table->dropColumn('urlid'); |
|||
}); |
|||
|
|||
$this->schema->table('urls', function (Blueprint $table) { |
|||
$table->dropColumn('id'); |
|||
$table->dropUnique('urls_hash_unique'); |
|||
$table->primary('hash'); |
|||
}); |
|||
|
|||
$this->enableForeignKeyCheck(); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue