Skip to content

Commit

Permalink
Mail macro in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
BardinPetr committed Jul 19, 2018
1 parent cf20e7d commit ad2895a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 10 additions & 0 deletions static/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ var send = function send(a) {
ws.send(x);
};

var sel = function sel(x, y) {
$("#iserver").val(x);
$("#iport").val(y);
};

$(document).ready(function () {
var data = [["GMail", "imap.gmail.com", 993], ["Yandex", "imap.yandex.ru", 993], ["Mail.ru", "imap.mail.ru", 993], ["Rambler", "imap.rambler.ru", 993], ["Outlook", "imap-mail.outlook.com", 993]];
data.forEach(function (i, a, b) {
$("#imapsel_dd").append("<li><button type=\"button\" class=\"btn btn-link btn-block\" onclick=\"sel('" + i[1] + "', '" + i[2] + "')\">" + i[0] + "</button></li>");
});

$("#save").click(function () {
var data = {
imaphost: $("#iserver").val(),
Expand Down
12 changes: 9 additions & 3 deletions templates/settings-black.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta charset="UTF-8">
<title>ФинЦЕРТ</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
Expand All @@ -13,7 +13,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script src="/static/lib/css3-mediaqueries.min.js"></script>
<script src="/static/node_modules/fernet/fernetBrowser.js"></script>
<script src="/static/node_modules/fernet/fernetBrowser.js"></script>
<script src="/static/js/settings.js"></script>
<script type='text/javascript' src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
<!--[if lt IE 9]>
Expand Down Expand Up @@ -46,7 +46,13 @@
<div class="panel-heading">Введите Ваши учетные данные почты для анализа</div>
<div class="panel-body">
<div class="input-group">
<span class="input-group-addon">imap</span>
<span class="input-group-addon">imap<br>
<div class="dropdown">
<button class="btn btn-link dropdown-toggle" type="button" data-toggle="dropdown">
<span class="caret"></span></button>
<ul class="dropdown-menu" id="imapsel_dd"></ul>
</div>
</span>
<input id="iserver" type="text" class="form-control" name="msg"
placeholder="Сервер" {% if cred.data %} value="{{ cred.imaphost }}" {% endif %}>
<input id="iport" type="number" class="form-control" name="msg"
Expand Down

0 comments on commit ad2895a

Please sign in to comment.