links refactoring

pull/8/head
Antelle 2015-10-24 00:21:21 +03:00
parent 878e5eaa18
commit 1856e124b6
7 changed files with 28 additions and 10 deletions

View File

@ -0,0 +1,10 @@
'use strict';
var Links = {
Repo: 'https://github.com/antelle/keeweb',
Desktop: 'https://github.com/antelle/keeweb/releases',
WebApp: 'https://antelle.github.io/keeweb/',
License: 'https://github.com/antelle/keeweb/blob/master/MIT-LICENSE.txt'
};
module.exports = Links;

View File

@ -1,14 +1,17 @@
'use strict';
var Backbone = require('backbone'),
RuntimeInfo = require('../../util/runtime-info');
RuntimeInfo = require('../../util/runtime-info'),
Links = require('../../const/links');
var SettingsAboutView = Backbone.View.extend({
template: require('templates/settings/settings-about.html'),
render: function() {
this.renderTemplate({
version: RuntimeInfo.version
version: RuntimeInfo.version,
licenseLink: Links.License,
repoLink: Links.Repo
});
}
});

View File

@ -5,6 +5,7 @@ var Backbone = require('backbone'),
PasswordDisplay = require('../../util/password-display'),
Alerts = require('../../util/alerts'),
RuntimeInfo = require('../../util/runtime-info'),
Links = require('../../const/links'),
FileSaver = require('filesaver');
var SettingsAboutView = Backbone.View.extend({
@ -26,6 +27,7 @@ var SettingsAboutView = Backbone.View.extend({
this.renderTemplate({
cmd: FeatureDetector.actionShortcutSymbol(true),
supportFiles: RuntimeInfo.launcher,
desktopLink: Links.Desktop,
name: this.model.get('name'),
path: this.model.get('path'),

View File

@ -1,7 +1,8 @@
'use strict';
var Backbone = require('backbone'),
RuntimeInfo = require('../../util/runtime-info');
RuntimeInfo = require('../../util/runtime-info'),
Links = require('../../const/links');
var SettingsHelpView = Backbone.View.extend({
template: require('templates/settings/settings-help.html'),
@ -11,7 +12,9 @@ var SettingsHelpView = Backbone.View.extend({
'Environment: ' + (RuntimeInfo.launcher ? RuntimeInfo.launcher : 'web') + '\n' +
'User-Agent: ' + RuntimeInfo.userAgent;
this.renderTemplate({
issueBody: encodeURIComponent('!please, describe your issue here!\n\n' + appInfo),
issueLink: Links.Repo + '/issues/new?body=' + encodeURIComponent('!please, describe your issue here!\n\n' + appInfo),
desktopLink: Links.Desktop,
webAppLink: Links.WebApp,
appInfo: _.escape(appInfo)
});
}

View File

@ -1,8 +1,8 @@
<div>
<h1><i class="fa fa-info"></i> About KeeWeb v<%= version %></h1>
<p>This is an open-source app created by <a href="http://antelle.net" target="_blank">Antelle</a> and licensed under
<a href="http://github.com/antelle/keepass-web/MIT-LICENSE.txt" target="_blank">MIT</a>.
The source code and issues are <a href="http://github.com/antelle/keepass-web" target="_blank">on GitHub <i class="fa fa-github-alt"></i></a>.</p>
<a href="<%= licenseLink %>" target="_blank">MIT</a>.
The source code and issues are <a href="<%= repoLink %>" target="_blank">on GitHub <i class="fa fa-github-alt"></i></a>.</p>
<p>This app is built with these awesome tools:</p>
<h3>Libraries</h3>
<ul>

View File

@ -6,7 +6,7 @@
<p>This database is loaded in memory. To enable auto-save and saving with shortcut <%= cmd %>S,
please, save it to <%= supportFiles ? ' file or ' : '' %> Dropbox.</p>
<% if (!supportFiles) { %>
<p>Want to work seamlessly with local files? <a href="http://github.com/antelle/keeweb" target="_blank">Download a desktop app</a></p>
<p>Want to work seamlessly with local files? <a href="<%= desktopLink %>" target="_blank">Download a desktop app</a></p>
<% } %>
<% } %>

View File

@ -6,7 +6,7 @@
The file format is 100% compatible and should be understood by both apps.
</p>
<h2>Problems?</h2>
<p>If something goes wrong, please, <a href="https://github.com/antelle/keeweb/issues/new?body=<%= issueBody %>" target="_blank">open an issue on GitHub</a>
<p>If something goes wrong, please, <a href="<%= issueLink %>" target="_blank">open an issue on GitHub</a>
or <a href="http://antelle.net/" target="_blank">contact a developer</a> directly.
</p>
<p>App information:</p>
@ -17,14 +17,14 @@
<i class="fa fa-windows"></i>
<i class="fa fa-apple"></i>
<i class="fa fa-linux"></i>
<a href="https://github.com/antelle/keeweb/releases" target="_blank">Desktop apps</a>
<a href="<%= desktopLink %>" target="_blank">Desktop apps</a>
</li>
<li>
<i class="fa fa-chrome"></i>
<i class="fa fa-firefox"></i>
<i class="fa fa-opera"></i>
<i class="fa fa-internet-explorer"></i>
<a href="https://antelle.github.io/keeweb/" target="_blank">Web app</a>
<a href="<%= webAppLink %>" target="_blank">Web app</a>
</li>
</ul>
</div>