add dummy help dialog

This commit is contained in:
rlx 2016-01-18 11:46:50 +05:30
parent 4474ebb209
commit cd8158de05
4 changed files with 87 additions and 7 deletions

View File

@ -30,7 +30,8 @@ oml.ui.appPanel = function() {
appDialog: ['about', 'faq', 'terms', 'development', 'contact'],
updateDialog: ['update'],
userDialog: ['preferences', 'peers', 'transfers'],
importExportDialog: ['import', 'export']
importExportDialog: ['import', 'export'],
helpDialog: ['help', 'documentation']
};
// close dialogs
if (Ox.every(dialogs, function(pages) {

72
static/js/helpDialog.js Normal file
View File

@ -0,0 +1,72 @@
'use strict';
oml.ui.helpDialog = function() {
var ui = oml.user.ui,
$panel = Ox.TabPanel({
content: function(id) {
return Ox.Element()
.addClass('OxTextPage OxSelectable')
.css({margin: '16px'})
.html(
'<p>The lazy brown fox and the lazy black fox '
+ 'were observed singing "Loret ipsum", '
+ 'but other than that not really much happened here '
+ 'since you last checked.</p>'
);
},
style: 'squared',
tabs: [
{
id: 'help',
title: Ox._('Help'),
selected: ui.page == 'help'
},
{
id: 'documentation',
title: Ox._('API Documentation'),
selected: ui.page == 'documentation'
}
]
})
.bindEvent({
change: function(data) {
oml.UI.set({page: data.selected});
}
}),
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'close',
style: 'squared',
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: $panel,
height: 384,
keys: {escape: 'close'},
maximizeButton: true,
minHeight: 256,
minWidth: 544 + 2 * Ox.UI.SCROLLBAR_SIZE,
removeOnClose: true,
title: 'Open Media Libary',
width: 672 + 2 * Ox.UI.SCROLLBAR_SIZE
})
.bindEvent({
close: function() {
if (Ox.contains(['help', 'documentation'], ui.page)) {
oml.UI.set({page: ''});
}
}
});
return that;
};

View File

@ -311,18 +311,15 @@ oml.ui.mainMenu = function() {
id: 'helpMenu',
title: Ox._('Help'),
items: [
{
id: 'gettingstarted',
title: 'Getting Started...'
},
{
id: 'help',
title: Ox._('{0} Help...', ['Open Media Library']),
title: Ox._('Help...'),
keyboard: 'control ?'
},
{},
{
id: 'documentation',
title: Ox._('Documentation...'),
title: Ox._('API Documentation...'),
keyboard: 'shift control ?'
}
]
@ -562,6 +559,10 @@ oml.ui.mainMenu = function() {
)).open();
} else if (id == 'advancedfind') {
oml.$ui.findDialog = oml.ui.findDialog().open();
} else if (id == 'help') {
oml.UI.set({page: 'help'});
} else if (id == 'documentation') {
oml.UI.set({page: 'documentation'});
} else {
Ox.print('MAIN MENU DOES NOT YET HANDLE', id);
}
@ -666,6 +667,11 @@ oml.ui.mainMenu = function() {
oml.$ui.findDialog = oml.ui.findDialog().open();
}
},
key_control_slash: function() {
if (!oml.hasDialogOrScreen()) {
oml.UI.set({page: 'documentation'});
}
},
key_control_shift_w: function() {
if (!oml.hasDialogOrScreen()) {
oml.UI.set({

View File

@ -27,6 +27,7 @@
"folders.js",
"fullscreenButton.js",
"gridView.js",
"helpDialog.js",
"iconDialog.js",
"identifyDialog.js",
"importExportDialog.js",