store app dialog texts in html file

This commit is contained in:
j 2016-01-16 14:22:42 +05:30
parent 4cf2c13e7e
commit 2fd3e105d2
2 changed files with 34 additions and 7 deletions

27
static/html/app.html Normal file
View File

@ -0,0 +1,27 @@
<div id="about">
<p>
Open Media Library is a local web application to manage and sync your digital media collections.
</p>
</div>
<div id="faq">
<p>
not yet
</p>
</div>
<div id="terms">
<p>
The lazy brown fox jumped over the lazy black fox, but other than that not really much happened here since you last checked.
</p>
</div>
<div id="development">
<p>
The latest code is in our
<a href="https://git.0x2620.org/openmedialibrary.git">git repository</a>.
<br/>
<p>
For everything else, there's IRC, and our development mailing list. Your feedback is welcome.
</p>
<a href="irc://irc.freenode.net#openmedialibrary">IRC</a>: #openmedialibrary on freenode<br/>
<a href="https://mailb.org/mailman/listinfo/openmedialibrary-dev">Mailing List</a>: openmedialibrary-dev@openmedialibrary.com<br/>
</p>
</div>

View File

@ -38,12 +38,6 @@ oml.ui.appDialog = function() {
$logo = Ox.Element(),
$text = Ox.Element()
.addClass('OxTextPage OxSelectable'),
text = {
'about': 'Open Media Library is a local web application to manage and sync your digital media collections.',
'faq': 'not yet',
'terms': 'The lazy brown fox jumped over the lazy black fox, but other than that not really much happened here since you last checked.',
'development': 'The latest code is in our <a href="https://git.0x2620.org/openmedialibrary.git">git repository</a>.<br><br>For everything else, there\'s IRC, and our development mailing list. Your feedback is welcome.<br><br>IRC: #openmedialibrary on freenode<br>Mailing List: <a href=mailto:openmedialibrary-dev@openmedialibrary.com">openmedialibrary-dev@openmedialibrary.com</a>',
}[id],
title = Ox.getObjectById(tabs, id).title;
$('<img>')
@ -61,7 +55,13 @@ oml.ui.appDialog = function() {
if (id == 'contact') {
$content.append(oml.ui.contactForm());
} else {
$content.html('<h1><b>' + title + '</b></h1><p>' + text + '</p>');
Ox.get('/static/html/app.html', function(html) {
var $html = $('<div>'),
strings = {};
$html.html(Ox.formatString(html, strings));
var section = $html.find('#' + id).html();
$content.html('<h1><b>' + title + '</b></h1><p>' + section + '</p>');
});
}
$('<div>')
.css({