From 2fd3e105d26c9f7ec7648abc83c1bd058d48950c Mon Sep 17 00:00:00 2001 From: j Date: Sat, 16 Jan 2016 14:22:42 +0530 Subject: [PATCH] store app dialog texts in html file --- static/html/app.html | 27 +++++++++++++++++++++++++++ static/js/appDialog.js | 14 +++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 static/html/app.html diff --git a/static/html/app.html b/static/html/app.html new file mode 100644 index 0000000..ea83a55 --- /dev/null +++ b/static/html/app.html @@ -0,0 +1,27 @@ +
+

+ Open Media Library is a local web application to manage and sync your digital media collections. +

+
+
+

+ not yet +

+
+
+

+ The lazy brown fox jumped over the lazy black fox, but other than that not really much happened here since you last checked. +

+
+
+

+ The latest code is in our + git repository. +
+

+ For everything else, there's IRC, and our development mailing list. Your feedback is welcome. +

+ IRC: #openmedialibrary on freenode
+ Mailing List: openmedialibrary-dev@openmedialibrary.com
+

+
diff --git a/static/js/appDialog.js b/static/js/appDialog.js index 0e3cab9..d276e48 100644 --- a/static/js/appDialog.js +++ b/static/js/appDialog.js @@ -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 git repository.

For everything else, there\'s IRC, and our development mailing list. Your feedback is welcome.

IRC: #openmedialibrary on freenode
Mailing List: openmedialibrary-dev@openmedialibrary.com', - }[id], title = Ox.getObjectById(tabs, id).title; $('') @@ -61,7 +55,13 @@ oml.ui.appDialog = function() { if (id == 'contact') { $content.append(oml.ui.contactForm()); } else { - $content.html('

' + title + '

' + text + '

'); + Ox.get('/static/html/app.html', function(html) { + var $html = $('
'), + strings = {}; + $html.html(Ox.formatString(html, strings)); + var section = $html.find('#' + id).html(); + $content.html('

' + title + '

' + section + '

'); + }); } $('
') .css({