2020-10-13 16:02:30 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>Show Item Object - AIL</title>
|
|
|
|
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
<link href="{{ url_for('static', filename='css/bootstrap4.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />
|
|
|
|
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/popper.min.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/bootstrap4.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.rotate{
|
|
|
|
-moz-transition: all 0.1s linear;
|
|
|
|
-webkit-transition: all 0.1s linear;
|
|
|
|
transition: all 0.1s linear;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rotate.down{
|
|
|
|
-moz-transform:rotate(180deg);
|
|
|
|
-webkit-transform:rotate(180deg);
|
|
|
|
transform:rotate(180deg);
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
{% include 'nav_bar.html' %}
|
|
|
|
|
|
|
|
<div class="card my-2 mx-2">
|
|
|
|
<div class="card-header bg-dark">
|
2022-07-13 15:10:27 +02:00
|
|
|
<h3 class="text-white text-center" >{{ meta['name'] }}</h3>
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
<div class="card-body pb-1">
|
|
|
|
<table class="table table-condensed">
|
|
|
|
<thead class="">
|
|
|
|
<tr>
|
|
|
|
<th>Date</th>
|
|
|
|
<th>Source</th>
|
2022-07-13 15:10:27 +02:00
|
|
|
<!-- <th>Encoding</th> -->
|
2020-10-13 16:02:30 +02:00
|
|
|
<th>Size (Kb)</th>
|
|
|
|
<th>Number of lines</th>
|
|
|
|
<th>Max line length</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-07-13 15:10:27 +02:00
|
|
|
<td>{{ meta['date'] }}</td>
|
|
|
|
<td>{{ meta['source'] }}</td>
|
|
|
|
<!-- <td>{{ meta['encoding'] }}</td> -->
|
|
|
|
<td>{{ meta['size'] }}</td>
|
|
|
|
<td>{{ meta['lines']['nb'] }}</td>
|
|
|
|
<td>{{ meta['lines']['max_length'] }}</td>
|
2020-10-13 16:02:30 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<h5>
|
2022-11-22 10:47:15 +01:00
|
|
|
<span>
|
2020-10-13 16:02:30 +02:00
|
|
|
{% include 'modals/edit_tag.html' %}
|
2022-07-13 15:10:27 +02:00
|
|
|
{% for tag in meta['tags'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<button class="btn btn-{{ bootstrap_label[loop.index0 % 5] }}" data-toggle="modal" data-target="#edit_tags_modal"
|
2022-11-22 10:47:15 +01:00
|
|
|
data-tagid="{{ tag }}" data-objtype="item" data-objsubtype="" data-objid="{{ meta['id'] }}">
|
2020-10-13 16:02:30 +02:00
|
|
|
{{ tag }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
<br>
|
|
|
|
{% include 'modals/add_tags.html' %}
|
|
|
|
<button type="button" class="btn btn-light" data-toggle="modal" data-target="#add_tags_modal">
|
|
|
|
<i class="far fa-plus-square"></i>
|
|
|
|
</button>
|
2022-11-22 10:47:15 +01:00
|
|
|
</span>
|
2020-10-13 16:02:30 +02:00
|
|
|
</h5>
|
|
|
|
</div>
|
|
|
|
|
2022-07-13 15:10:27 +02:00
|
|
|
{% if meta['father'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<div class="mt-3">
|
2022-07-13 15:10:27 +02:00
|
|
|
Father: <a href="{{ url_for('objects_item.showItem')}}?id={{meta['father']}}" target="_blank">{{meta['father']}}</a>
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="d-flex flex-row-reverse bd-highlight">
|
|
|
|
<div>
|
2022-10-25 16:25:19 +02:00
|
|
|
<a href="{{ url_for('correlation.show_correlation')}}?type=item&id={{ meta['id'] }}" target="_blank">
|
2020-10-13 16:02:30 +02:00
|
|
|
<button class="btn btn-lg btn-info"><i class="fas fa-project-diagram"></i> Correlations Graph
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-03-07 15:12:01 +01:00
|
|
|
<div>
|
2022-07-13 15:10:27 +02:00
|
|
|
{% with obj_type='item', obj_id=meta['id'], obj_subtype=''%}
|
2022-03-07 15:12:01 +01:00
|
|
|
{% include 'modals/investigations_register_obj.html' %}
|
|
|
|
{% endwith %}
|
|
|
|
<div class="mr-2">
|
|
|
|
<button type="button" class="btn btn-lg btn-primary" data-toggle="modal" data-target="#investigations_register_obj_modal">
|
|
|
|
<i class="fas fa-microscope"></i> Investigations
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-13 16:02:30 +02:00
|
|
|
<div class="mx-2">
|
2022-07-13 15:10:27 +02:00
|
|
|
{% with obj_type='item', obj_id=meta['id'], obj_lvl=0%}
|
2020-10-13 16:02:30 +02:00
|
|
|
{% include 'import_export/block_add_user_object_to_export.html' %}
|
|
|
|
{% endwith %}
|
|
|
|
</div>
|
|
|
|
{% if is_hive_connected %}
|
|
|
|
<div>
|
|
|
|
{% include 'modals/create_hive_case.html' %}
|
|
|
|
<button type="button" class="btn btn-lg btn-outline-dark mx-1" data-toggle="modal" data-target="#create_hive_case_modal">
|
|
|
|
Create
|
|
|
|
<img id="thehive-icon" src="{{url_for('static', filename='image/thehive_icon.png') }}">
|
|
|
|
Case
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if misp_eventid %}
|
|
|
|
<div class="list-group" id="misp_event">
|
|
|
|
<li class="list-group-item active">MISP Events already Created</li>
|
|
|
|
<a target="_blank" href="{{ misp_url }}" class="list-group-item">{{ misp_url }}</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-07-13 15:10:27 +02:00
|
|
|
{% if meta['hive_case'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<div class="list-group" id="misp_event">
|
|
|
|
<li class="list-group-item active">The Hive Case already Created</li>
|
|
|
|
<a target="_blank" href="{{ hive_url }}" class="list-group-item">{{ hive_url }}</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-07-13 15:10:27 +02:00
|
|
|
{% if meta['duplicates'] != 0 %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<div id="accordionDuplicate" class="mb-2 mx-3">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header py-1" id="headingDuplicate">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-11">
|
|
|
|
<div class="mt-2">
|
|
|
|
<i class="far fa-clone"></i> duplicates
|
2022-07-13 15:10:27 +02:00
|
|
|
<div class="badge badge-warning">{{meta['duplicates']|length}}</div>
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-1">
|
|
|
|
<button class="btn btn-link btn-lg py-2 float-right rotate" data-toggle="collapse" data-target="#collapseDuplicate" aria-expanded="true" aria-controls="collapseDuplicate">
|
|
|
|
<i class="fas fa-chevron-circle-down"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="collapseDuplicate" class="collapse" aria-labelledby="headingDuplicate" data-parent="#accordionDuplicate">
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<table class="table" id="tableDup">
|
|
|
|
<thead class="thead-dark">
|
|
|
|
<tr>
|
|
|
|
<th>Date</th>
|
|
|
|
<th>Similarity</th>
|
|
|
|
<th>Item</th>
|
|
|
|
<th>Diff</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-13 15:10:27 +02:00
|
|
|
{% for duplicate_id in meta['duplicates'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<tr>
|
2022-07-13 15:10:27 +02:00
|
|
|
<td>{{meta['duplicates'][duplicate_id]['date']}}</td>
|
2020-10-13 16:02:30 +02:00
|
|
|
<td class="py-0">
|
|
|
|
<table class="table table-borderless table-sm my-0">
|
|
|
|
<tbody>
|
2022-07-13 15:10:27 +02:00
|
|
|
{%for dict_algo in meta['duplicates'][duplicate_id]|sort(attribute='algo')%}
|
2020-10-13 16:02:30 +02:00
|
|
|
<tr>
|
2022-07-13 15:10:27 +02:00
|
|
|
<td class="py-0">{{dict_algo['algo']}}</td>
|
2020-10-13 16:02:30 +02:00
|
|
|
<td class="w-100 py-0">
|
|
|
|
<div class="progress mt-1">
|
2022-07-13 15:10:27 +02:00
|
|
|
<div class="progress-bar progress-bar-striped {%if dict_algo['algo']=='tlsh'%}bg-secondary{%endif%}" role="progressbar" style="width: {{dict_algo['similarity']}}%;" aria-valuenow="{{dict_algo['similarity']}}" aria-valuemin="0" aria-valuemax="100">
|
|
|
|
{{dict_algo['similarity']}}%
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{%endfor%}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ url_for('objects_item.showItem')}}?id={{duplicate_id}}" target="_blank">
|
|
|
|
{{duplicate_id}}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-11-22 10:47:15 +01:00
|
|
|
<a target="_blank" href="{{ url_for('objects_item.object_item_diff') }}?id1={{meta['id']}}&id2={{duplicate_id}}" class="fa fa-columns" title="Show diff"></a>
|
2020-10-13 16:02:30 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
{% if l_64|length != 0 %}
|
|
|
|
<div id="accordionDecoded" class="mb-3">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header py-1" id="headingDecoded">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-11">
|
|
|
|
<div class="mt-2">
|
|
|
|
<i class="fas fa-lock-open"></i> Decoded Files
|
|
|
|
<div class="badge badge-warning">{{l_64|length}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-1">
|
|
|
|
<button class="btn btn-link py-2 float-right rotate" data-toggle="collapse" data-target="#collapseDecoded" aria-expanded="true" aria-controls="collapseDecoded">
|
|
|
|
<i class="fas fa-chevron-circle-down"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="collapseDecoded" class="collapse show" aria-labelledby="headingDecoded" data-parent="#accordionDecoded">
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<table id="tableb64" class="red_table table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>estimated type</th>
|
|
|
|
<th>hash</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for b64 in l_64 %}
|
|
|
|
<tr>
|
|
|
|
<td><i class="fas {{ b64[0] }}"></i> {{ b64[1] }}</td>
|
2022-11-29 16:01:01 +01:00
|
|
|
<td><a target="_blank" href="{{ url_for('correlation.show_correlation') }}?type=decoded&id={{ b64[2] }}"> {{b64[2]}} ({{ b64[4] }})</a></td>
|
2020-10-13 16:02:30 +02:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2022-07-13 15:10:27 +02:00
|
|
|
{% if meta['crawler'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<div id="accordionCrawler" class="mb-3 mx-3">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header py-1" id="headingCrawler">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-11">
|
|
|
|
<div class="mt-2">
|
|
|
|
<i class="fas fa-spider"></i> Crawler
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-1">
|
|
|
|
<button class="btn btn-link btn-lg py-2 float-right rotate down" data-toggle="collapse" data-target="#collapseCrawler" aria-expanded="true" aria-controls="collapseCrawler">
|
|
|
|
<i class="fas fa-chevron-circle-down"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="collapseCrawler" class="collapse show" aria-labelledby="headingCrawler" data-parent="#accordionCrawler">
|
|
|
|
|
|
|
|
<div class="row mx-0">
|
|
|
|
|
|
|
|
<div class="col-md-5">
|
|
|
|
<div class="my-2">
|
|
|
|
<table class="table table-sm">
|
|
|
|
<thead>
|
2022-10-25 16:25:19 +02:00
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td>Last Origin:</td>
|
|
|
|
</tr>
|
2020-10-13 16:02:30 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td><i class="far fa-file"></i></td>
|
|
|
|
<td>
|
2022-10-25 16:25:19 +02:00
|
|
|
<a class="badge" target="_blank" href="{{ url_for('objects_item.showItem', paste=meta['father']) }}">{{ meta['father'] }}</a>
|
2020-10-13 16:02:30 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2022-10-25 16:25:19 +02:00
|
|
|
<tr>
|
2020-10-13 16:02:30 +02:00
|
|
|
<td><i class="fab fa-html5"></i></td>
|
|
|
|
<td>
|
2022-10-25 16:25:19 +02:00
|
|
|
<a class="badge" target="_blank" href="{{ url_for('crawler_splash.showDomain', domain=meta['crawler']['domain']) }}">{{ meta['crawler']['domain'] }}</a>
|
2020-10-13 16:02:30 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>url</td>
|
|
|
|
<td>
|
2022-07-13 15:10:27 +02:00
|
|
|
{{ meta['crawler']['url'] }}
|
2020-10-13 16:02:30 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-7">
|
|
|
|
<div class="card my-2" style="background-color:#ecf0f1;">
|
|
|
|
<div class="card-body py-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-8">
|
2022-07-13 15:10:27 +02:00
|
|
|
<input class="custom-range mt-2" id="blocks" type="range" min="1" max="50" value="{%if meta['crawler']['is_tags_safe']%}13{%else%}0{%endif%}">
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
2022-07-13 15:10:27 +02:00
|
|
|
<button class="btn {%if meta['crawler']['is_tags_safe']%}btn-primary{%else%}btn-danger{%endif%}" onclick="blocks.value=50;pixelate();">
|
|
|
|
{%if meta['crawler']['is_tags_safe']%}
|
2020-10-13 16:02:30 +02:00
|
|
|
<i class="fas fas fa-plus-square"></i>
|
|
|
|
{%else%}
|
|
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
|
|
{%endif%}
|
|
|
|
<span class="label-icon">Full resolution</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<canvas id="canvas" style="width:100%;"></canvas>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
<!-- nav-pills nav-justified nav-tabs-->
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body pt-0 py-1 px-2">
|
|
|
|
|
|
|
|
<ul class="nav nav-pills" id="pills-tab" role="tablist">
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link active" id="pills-content-tab" data-toggle="pill" href="#pills-content" role="tab" aria-controls="pills-content" aria-selected="true">Content</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" id="pills-html2text-tab" data-toggle="pill" href="#pills-html2text" role="tab" aria-controls="pills-html2text" aria-selected="false">html2text</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Others</a>
|
|
|
|
<div class="dropdown-menu">
|
2022-07-13 15:10:27 +02:00
|
|
|
<a class="dropdown-item" href="{{ url_for('objects_item.item_raw_content', id=meta['id']) }}"><i class="far fa-file"></i> Raw Content</a>
|
2022-11-22 10:47:15 +01:00
|
|
|
<a class="dropdown-item" href="{{ url_for('objects_item.item_download', id=meta['id']) }}"><i class="fas fa-download"></i> Download</a>
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tab-content" id="pills-tabContent">
|
|
|
|
<div class="tab-pane fade show active" id="pills-content" role="tabpanel" aria-labelledby="pills-content-tab">
|
2022-07-13 15:10:27 +02:00
|
|
|
<p class="my-0"> <pre class="border">{{ meta['content'] }}</pre></p>
|
2020-10-13 16:02:30 +02:00
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="pills-html2text" role="tabpanel" aria-labelledby="pills-html2text-tab">
|
|
|
|
<p class="my-0"> <pre id="html2text-container" class="border"></pre></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var ltags
|
|
|
|
var ltagsgalaxies
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#tableDup').DataTable();
|
|
|
|
// $('#tableb64').DataTable({
|
|
|
|
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
|
|
|
|
// "iDisplayLength": 5,
|
|
|
|
// "order": [[ 1, "asc" ]]
|
|
|
|
// });
|
|
|
|
$(".rotate").click(function(){
|
|
|
|
$(this).toggleClass("down") ;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#pills-html2text-tab').on('shown.bs.tab', function (e) {
|
|
|
|
if ($('#html2text-container').is(':empty')){
|
2022-07-13 15:10:27 +02:00
|
|
|
$.get("{{ url_for('objects_item.html2text') }}?id={{ meta['id'] }}").done(function(data){
|
2020-10-13 16:02:30 +02:00
|
|
|
$('#html2text-container').text(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-07-13 15:10:27 +02:00
|
|
|
{% if meta['crawler'] %}
|
2020-10-13 16:02:30 +02:00
|
|
|
<script>
|
|
|
|
var ctx = canvas.getContext('2d'), img = new Image();
|
|
|
|
|
|
|
|
/// turn off image smoothing
|
|
|
|
ctx.webkitImageSmoothingEnabled = false;
|
|
|
|
ctx.imageSmoothingEnabled = false;
|
|
|
|
|
|
|
|
img.onload = pixelate;
|
|
|
|
img.addEventListener("error", img_error);
|
|
|
|
var draw_img = false;
|
|
|
|
|
2022-11-22 10:47:15 +01:00
|
|
|
{% if meta['crawler']['screenshot'] %}
|
|
|
|
img.src = "{{ url_for('objects_item.screenshot', filename=meta['crawler']['screenshot']) }}";
|
|
|
|
{% else %}
|
|
|
|
img.src = "";
|
|
|
|
{% endif %}
|
2020-10-13 16:02:30 +02:00
|
|
|
|
|
|
|
function pixelate() {
|
|
|
|
|
|
|
|
/// use slider value
|
|
|
|
if( blocks.value == 50 ){
|
|
|
|
size = 1;
|
|
|
|
} else {
|
|
|
|
var size = (blocks.value) * 0.01;
|
|
|
|
}
|
|
|
|
|
|
|
|
canvas.width = img.width;
|
|
|
|
canvas.height = img.height;
|
|
|
|
|
|
|
|
/// cache scaled width and height
|
|
|
|
w = canvas.width * size;
|
|
|
|
h = canvas.height * size;
|
|
|
|
|
|
|
|
/// draw original image to the scaled size
|
|
|
|
ctx.drawImage(img, 0, 0, w, h);
|
|
|
|
|
|
|
|
/// pixelated
|
|
|
|
ctx.drawImage(canvas, 0, 0, w, h, 0, 0, canvas.width, canvas.height);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function img_error() {
|
|
|
|
img.onerror=null;
|
|
|
|
img.src="{{ url_for('static', filename='image/AIL.png') }}";
|
|
|
|
blocks.value = 50;
|
|
|
|
pixelate;
|
|
|
|
}
|
|
|
|
|
|
|
|
blocks.addEventListener('change', pixelate, false);
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
|
|
</html>
|