Commit 27fe08ab authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

help

parent 981ecc92
......@@ -59,7 +59,11 @@ Open browser on http://localhost:8080/demo
},
"showSearch" : true,
"showNavigation" : true,
"showHelp" : true,
"help" : {
"classic" : true,
"guide" : false,
"indepth" : false
},
"showUser" : true,
"showLanguage" : true,
"lang" : language,
......
......@@ -118,7 +118,11 @@
},
"showSearch" : true,
"showNavigation" : true,
"showHelp" : true,
"help" : {
"classic" : true,
"guide" : false,
"indepth" : false
},
"showUser" : true,
"showLanguage" : true,
"lang" : language,
......
......@@ -8,17 +8,22 @@ var Navigation = (function () {
if (options.langdata) {
this.langData = options.langdata;
}
this.showSearch == true;
this.showHelp == true;
this.showLanguage == true;
this.showUser == true;
this.showNavigation == true;
this.showSearch = true;
this.help = {
"classic": true,
"indepth": true,
"guide": true
};
this.showLanguage = true;
this.showUser = true;
this.showNavigation = true;
if (options.showSearch)
this.showSearch = options.showSearch;
if (options.showLanguage)
this.showLanguage = options.showLanguage;
if (options.showHelp)
this.showHelp = options.showHelp;
if (options.help) {
this.help = options.help;
}
if (options.showUser)
this.showUser = options.showUser;
if (options.showNavigation)
......@@ -90,7 +95,7 @@ var Navigation = (function () {
}
}
// help
if (self.showHelp) {
if (self.help) {
var largeHelp = L.DomUtil.create('a', '', L.DomUtil.create('li', '', large));
largeHelp.textContent = "Help";
largeHelp.href = "#help";
......@@ -113,6 +118,10 @@ var Navigation = (function () {
helpGuideTxt.textContent = 'An interactive guide shows the basics on how to fill out a feature or performing a task. Start the interactive guide quickly learn how Seatrack Web works. ';
var helpGuideButton = L.DomUtil.create('button', 'uk-button navigation-help-button', helpGuide);
helpGuideButton.textContent = 'Start Interactive Guide';
if (!self.help.guide) {
helpGuideButton.setAttribute('disabled', '');
}
;
var helpPrompt = L.DomUtil.create('div', 'uk-panel uk-panel-header uk-margin-bottom', L.DomUtil.create('div', 'uk-width-medium-1-4', helpGrid));
var helpPromptHead = L.DomUtil.create('h3', 'uk-panel-title', helpPrompt);
helpPromptHead.textContent = 'Prompts ';
......@@ -127,8 +136,16 @@ var Navigation = (function () {
var helpClassicButton = L.DomUtil.create('button', 'uk-button navigation-help-button', helpClassic);
helpClassicButton.textContent = 'Open documentation';
helpClassicButton.onclick = function () {
window.location.href = self.url + "/help/classic";
var modal = UIkit.modal("#help");
if (modal.isActive()) {
modal.hide();
}
window.open(self.url + "/help/classic", '_blank');
};
if (!self.help.classic) {
helpClassicButton.setAttribute('disabled', '');
}
;
var helpInDepth = L.DomUtil.create('div', 'uk-panel uk-panel-header uk-margin-bottom', L.DomUtil.create('div', 'uk-width-medium-1-4', helpGrid));
var helpInDepthHead = L.DomUtil.create('h3', 'uk-panel-title', helpInDepth);
helpInDepthHead.textContent = 'In Depth';
......@@ -136,6 +153,10 @@ var Navigation = (function () {
helpInDepthTxt.textContent = 'When the need for deeper understanding arises, look into our in depth sections for behind the scenes explanations.';
var helpInDepthButton = L.DomUtil.create('button', 'uk-button navigation-help-button', helpInDepth);
helpInDepthButton.textContent = 'Open documentation';
if (!self.help.indepth) {
helpInDepthButton.setAttribute('disabled', '');
}
;
var helpFooter = L.DomUtil.create('div', 'uk-modal-footer', helpDialog);
var helpPostTxt = L.DomUtil.create('p', 'navigation-help-smallfont', helpFooter);
helpPostTxt.innerHTML = 'We continually strive to improve the experiences of our products, please feel welcome to send any feed-back to ' + '<a href="mailto:seatrackweb@smhi.se"><span class="uk-icon-envelope"></span> seatrackweb@smhi.se</a>';
......@@ -197,7 +218,7 @@ var Navigation = (function () {
}
}
// help
if (self.showHelp) {
if (self.help) {
var smallHelpHeader = L.DomUtil.create('li', 'uk-nav-header', smallDropdownList);
var smallHelpSpan = L.DomUtil.create('span', '', smallHelpHeader);
smallHelpSpan.textContent = 'Help';
......
......@@ -16,7 +16,7 @@ class Navigation {
private userUrl: string;
private url: string;
private showSearch : boolean;
private showHelp : boolean;
private help : any;
private showLanguage : boolean;
private showUser : boolean;
private showNavigation : boolean;
......@@ -30,14 +30,20 @@ class Navigation {
if (options.langdata) {
this.langData = options.langdata;
}
this.showSearch == true;
this.showHelp == true;
this.showLanguage == true;
this.showUser == true;
this.showNavigation == true;
this.showSearch = true;
this.help = {
"classic" : true,
"indepth" : true,
"guide" : true
};
this.showLanguage = true;
this.showUser = true;
this.showNavigation = true;
if (options.showSearch) this.showSearch = options.showSearch;
if (options.showLanguage) this.showLanguage = options.showLanguage;
if (options.showHelp) this.showHelp = options.showHelp;
if (options.help) {
this.help = options.help;
}
if (options.showUser) this.showUser = options.showUser;
if (options.showNavigation) this.showNavigation = options.showNavigation;
......@@ -112,7 +118,7 @@ class Navigation {
}
}
// help
if (self.showHelp) {
if (self.help ) {
var largeHelp = <HTMLAnchorElement>L.DomUtil.create('a', '',<HTMLLIElement>L.DomUtil.create('li', '', large));
largeHelp.textContent = "Help";
largeHelp.href = "#help";
......@@ -135,6 +141,7 @@ class Navigation {
helpGuideTxt.textContent = 'An interactive guide shows the basics on how to fill out a feature or performing a task. Start the interactive guide quickly learn how Seatrack Web works. ';
var helpGuideButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button navigation-help-button',helpGuide);
helpGuideButton.textContent = 'Start Interactive Guide';
if (!self.help.guide) {helpGuideButton.setAttribute('disabled','');};
var helpPrompt = <HTMLDivElement>L.DomUtil.create('div', 'uk-panel uk-panel-header uk-margin-bottom',<HTMLDivElement>L.DomUtil.create('div', 'uk-width-medium-1-4', helpGrid));
var helpPromptHead = <HTMLHeadingElement>L.DomUtil.create('h3', 'uk-panel-title', helpPrompt);
helpPromptHead.textContent = 'Prompts ';
......@@ -149,8 +156,13 @@ class Navigation {
var helpClassicButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button navigation-help-button',helpClassic);
helpClassicButton.textContent = 'Open documentation';
helpClassicButton.onclick = function() {
window.location.href = self.url+"/help/classic";
var modal = UIkit.modal("#help");
if ( modal.isActive() ) {
modal.hide();
}
window.open(self.url+"/help/classic", '_blank');
};
if (!self.help.classic) {helpClassicButton.setAttribute('disabled','');};
var helpInDepth = <HTMLDivElement>L.DomUtil.create('div', 'uk-panel uk-panel-header uk-margin-bottom',<HTMLDivElement>L.DomUtil.create('div', 'uk-width-medium-1-4', helpGrid));
var helpInDepthHead = <HTMLHeadingElement>L.DomUtil.create('h3', 'uk-panel-title', helpInDepth);
helpInDepthHead.textContent = 'In Depth';
......@@ -158,6 +170,7 @@ class Navigation {
helpInDepthTxt.textContent = 'When the need for deeper understanding arises, look into our in depth sections for behind the scenes explanations.';
var helpInDepthButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button navigation-help-button',helpInDepth);
helpInDepthButton.textContent = 'Open documentation';
if (!self.help.indepth) {helpInDepthButton.setAttribute('disabled','');};
var helpFooter = <HTMLDivElement>L.DomUtil.create('div', 'uk-modal-footer', helpDialog);
var helpPostTxt = <HTMLParagraphElement>L.DomUtil.create('p', 'navigation-help-smallfont', helpFooter);
helpPostTxt.innerHTML = 'We continually strive to improve the experiences of our products, please feel welcome to send any feed-back to '+'<a href="mailto:seatrackweb@smhi.se"><span class="uk-icon-envelope"></span> seatrackweb@smhi.se</a>';
......@@ -220,7 +233,7 @@ class Navigation {
}
}
// help
if (self.showHelp) {
if (self.help) {
var smallHelpHeader = <HTMLLIElement>L.DomUtil.create('li', 'uk-nav-header', smallDropdownList);
var smallHelpSpan = <HTMLSpanElement>L.DomUtil.create('span', '', smallHelpHeader);
smallHelpSpan.textContent = 'Help';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment