Browse Source

Add jQuery; make logout link auto-POST.

master
Ben Kurtovic 7 years ago
parent
commit
3b59e3b4dc
3 changed files with 13 additions and 2 deletions
  1. +10
    -0
      static/main.js
  2. +2
    -0
      templates/_base.mako
  3. +1
    -2
      templates/_default.mako

+ 10
- 0
static/main.js View File

@@ -0,0 +1,10 @@
$(function() {
// Install logout auto-POST form:
$("#logout").click(function() {
$("<form>", {
"action": this.href,
"method": "post"
}).appendTo($("body")).submit();
return false;
});
});

+ 2
- 0
templates/_base.mako View File

@@ -19,6 +19,8 @@
% for size in g.eve.image.corp_widths:
<link rel="icon" type="image/png" sizes="${size}x${size}" href="${g.eve.image.corp(g.config.get('corp.id'), size)}"/>
% endfor
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="${url_for('staticv', filename='main.js')}"></script>
</head>
<body>
<%block name="header">


+ 1
- 2
templates/_default.mako View File

@@ -9,8 +9,7 @@
<img id="character-portrait" class="aligned" title="${g.auth.get_character_prop('name')}" alt="" src="${g.eve.image.character(g.auth.get_character_id(), 256)}"/>
<span id="character-summary" class="aligned">
${g.auth.get_character_prop("name")}
<span class="sep">[</span><a title="Log out" href="${url_for('logout')}">logout</a><span class="sep">]</span>
<!-- ... JS switch to a POST form -->
<span class="sep">[</span><a id="logout" title="Log out" href="${url_for('logout')}">log out</a><span class="sep">]</span>
</span>
</%block>
${next.body()}

Loading…
Cancel
Save