-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved where JS things get instantiated, for moar bettah-ness #594
- Loading branch information
Showing
4 changed files
with
67 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1 @@ | ||
{% if state.command_url in ("/message/draft/", "/message/") %} | ||
<script src="/static/js/plupload.full.min.js"></script> | ||
{% endif %} | ||
<script> | ||
{% if result.data and result.data.addresses %} | ||
{% set addresses_json = result.data.addresses|json %} | ||
{% endif %} | ||
{% if result.data and result.data.messages %} | ||
{% set messages_json = result.data.messages|json %} | ||
{% endif %} | ||
{% if result.data and result.data.metadata %} | ||
{% set metadata_json = result.data.metadata|json %} | ||
{% endif %} | ||
$(document).ready(function() { | ||
|
||
// Start It | ||
Mailpile.render(); | ||
|
||
// Print JSON for JS Use | ||
Mailpile.instance = { | ||
"command": "{{ command }}", | ||
"state": {{state|json|safe}}, | ||
"args": "{{ args }}", | ||
"addresses": {% if result.data and result.data.addresses %}{{ addresses_json|safe }}{% else %}{}{% endif %}, | ||
"messages": {% if result.data and result.data.messages %}{{ messages_json|safe }}{% else %}{}{% endif %}, | ||
"metadata": {% if result.data and result.data.metadata %}{{ metadata_json|safe }}{% else %}{}{% endif %}, | ||
"search_tag_ids": {% if result.search_tag_ids %}{{result.search_tag_ids|safe }}{% else %}[]{% endif %}, | ||
"search_addresses": [] | ||
}; | ||
|
||
// Nagifications | ||
{% if show_nagification(config.web.nag_backup_key) %} | ||
Mailpile.notification({ | ||
status: 'warning', | ||
message: '{{_("Back up your encryption key & passphrase")}}', | ||
type: 'nagify', | ||
action: '/settings/backup-keys.html' | ||
}); | ||
{% endif %} | ||
|
||
// HTML5 Browser Notifications | ||
if (Notification.permission == "granted") { | ||
$('#notifications-permission-option').text("{{_("Browser notifications allowed")}}") | ||
} | ||
|
||
$('#notifications-permission-option').click(function() { | ||
Notification.requestPermission(); | ||
}); | ||
|
||
}); | ||
|
||
/* Plugins */ | ||
$(document).ready( | ||
{{ui_elements_setup('.plugin-activity-%(name)s', get_ui_elements('activities', state, '/'))}} | ||
); | ||
</script> | ||
<script src="/api/0/jsapi/app.js"></script> | ||
<!-- Javscript - just a lonely, empty file where there used to be some JS... might reuse --> |