Commit abc5daf8 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

refactor help links

parent d69c23f3
...@@ -158,13 +158,17 @@ ...@@ -158,13 +158,17 @@
// if (forcing.features.length > 0) properties["forcing"] = forcing; // if (forcing.features.length > 0) properties["forcing"] = forcing;
class SimpleCardControl extends STWkit.CardControl { class SimpleCardControl extends STWkit.CardControl {
constructor(options) {super(options);} constructor(options) {super(options);
this.type = 'objects';
this.subtype = 'instant';
}
setup(map) { setup(map) {
this.container = STWkit.DomUtil.create('div', +self.name+'-control'); this.container = STWkit.DomUtil.create('div', +self.name+'-control');
this.accordionDiv = STWkit.DomUtil.create('div', 'uk-accordion', this.container); this.accordionDiv = STWkit.DomUtil.create('div', 'uk-accordion', this.container);
var locationoptions = {}; var locationoptions = {};
var initials = 'fo'; var initials = 'fo';
var type = 'object'; var type = 'objects';
var subtype = 'instant';
locationoptions['single'] = true; locationoptions['single'] = true;
locationoptions['multiple'] = true; locationoptions['multiple'] = true;
locationoptions['line'] = true; locationoptions['line'] = true;
...@@ -173,6 +177,7 @@ ...@@ -173,6 +177,7 @@
// locationoptions['polygon']['name'] = 'Area'; // locationoptions['polygon']['name'] = 'Area';
locationoptions['circle'] = false; locationoptions['circle'] = false;
locationoptions['type'] = type; locationoptions['type'] = type;
locationoptions['subtype'] = subtype;
// locationoptions['outlettype'] = false; // locationoptions['outlettype'] = false;
locationoptions['initials'] = initials; locationoptions['initials'] = initials;
var locationid = 'locationCard'; var locationid = 'locationCard';
...@@ -180,12 +185,14 @@ ...@@ -180,12 +185,14 @@
this.cardMap[locationid].show(); this.cardMap[locationid].show();
var periodoptions = {}; var periodoptions = {};
periodoptions['type'] = type; periodoptions['type'] = type;
periodoptions['subtype'] = subtype;
periodoptions['initials'] = initials; periodoptions['initials'] = initials;
// periodoptions['forwardbackward'] = false; // periodoptions['forwardbackward'] = false;
var periodid = 'periodCard'; var periodid = 'periodCard';
this.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, this.lang, map, this.domain, this.forcingmodel, periodoptions); this.cardMap[periodid] = new STWkit.PeriodCard(periodid, 'Simulation period', this.accordionDiv, this.lang, map, this.domain, this.forcingmodel, periodoptions);
var oiltypeoptions = {}; var oiltypeoptions = {};
oiltypeoptions['type'] = type; oiltypeoptions['type'] = type;
oiltypeoptions['subtype'] = subtype;
oiltypeoptions['initials'] = initials; oiltypeoptions['initials'] = initials;
// oiltypeoptions['stateofoil'] = false; // oiltypeoptions['stateofoil'] = false;
var oiltypeid = 'oiltypeCard'; var oiltypeid = 'oiltypeCard';
......
...@@ -119,6 +119,7 @@ var STWkit; ...@@ -119,6 +119,7 @@ var STWkit;
e.preventDefault(); e.preventDefault();
}; };
var type = (options && options.hasOwnProperty('type')) ? options.type : ''; var type = (options && options.hasOwnProperty('type')) ? options.type : '';
var subtype = (options && options.hasOwnProperty('subtype')) ? options.subtype : '';
var initials = (options && options.hasOwnProperty('initials')) ? options.initials : ''; var initials = (options && options.hasOwnProperty('initials')) ? options.initials : '';
var showsingle = (options && options.hasOwnProperty('single')) ? options.single : true; var showsingle = (options && options.hasOwnProperty('single')) ? options.single : true;
var showmultiple = (options && options.hasOwnProperty('multiple')) ? options.multiple : false; var showmultiple = (options && options.hasOwnProperty('multiple')) ? options.multiple : false;
...@@ -132,7 +133,7 @@ var STWkit; ...@@ -132,7 +133,7 @@ var STWkit;
outlettypeDiv.style.display = 'none'; outlettypeDiv.style.display = 'none';
var typeLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', outlettypeDiv); var typeLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', outlettypeDiv);
var objectlabelDiv = L.DomUtil.create('div', 'uk-width-1-2', typeLabelGrid); var objectlabelDiv = L.DomUtil.create('div', 'uk-width-1-2', typeLabelGrid);
_super.prototype.addLabelDiv.call(_this, objectlabelDiv, "Outlet type", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-type' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, objectlabelDiv, "Outlet type", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-type' target='_blank'>here</a>");
var typeButtonDiv = L.DomUtil.create('div', '', outlettypeDiv); var typeButtonDiv = L.DomUtil.create('div', '', outlettypeDiv);
typeButtonDiv.id = 'guide' + initials + 'type'; typeButtonDiv.id = 'guide' + initials + 'type';
typeButtonDiv.setAttribute('data-uk-button-radio', ''); typeButtonDiv.setAttribute('data-uk-button-radio', '');
...@@ -170,7 +171,7 @@ var STWkit; ...@@ -170,7 +171,7 @@ var STWkit;
self.positions = []; self.positions = [];
var positionLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm); var positionLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm);
var positionlabelDiv = L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid); var positionlabelDiv = L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
_super.prototype.addLabelDiv.call(_this, positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-position' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-position' target='_blank'>here</a>");
var positionDiv = L.DomUtil.create('div', '', self.locationForm); var positionDiv = L.DomUtil.create('div', '', self.locationForm);
positionDiv.id = 'guide' + initials + 'pos'; positionDiv.id = 'guide' + initials + 'pos';
var positionButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv); var positionButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv);
...@@ -430,6 +431,7 @@ var STWkit; ...@@ -430,6 +431,7 @@ var STWkit;
self.domain = domain; self.domain = domain;
self.forcingmodel = forcingmodel; self.forcingmodel = forcingmodel;
var type = (options && options.hasOwnProperty('type')) ? options.type : ''; var type = (options && options.hasOwnProperty('type')) ? options.type : '';
var subtype = (options && options.hasOwnProperty('subtype')) ? options.subtype : '';
var initials = (options && options.hasOwnProperty('initials')) ? options.initials : ''; var initials = (options && options.hasOwnProperty('initials')) ? options.initials : '';
var showforwardbackward = (options && options.hasOwnProperty('forwardbackward')) ? options.forwardbackward : true; var showforwardbackward = (options && options.hasOwnProperty('forwardbackward')) ? options.forwardbackward : true;
var form = L.DomUtil.create('form', 'uk-form uk-form-stacked', periodDiv); var form = L.DomUtil.create('form', 'uk-form uk-form-stacked', periodDiv);
...@@ -451,10 +453,10 @@ var STWkit; ...@@ -451,10 +453,10 @@ var STWkit;
self.maxDate = moment.utc().startOf('hour').add(240, 'hours'); self.maxDate = moment.utc().startOf('hour').add(240, 'hours');
var fieldset = L.DomUtil.create('fieldset', '', form); var fieldset = L.DomUtil.create('fieldset', '', form);
var availableRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var availableRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
_super.prototype.addLabelDiv.call(_this, availableRowDiv, "Selected period (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-period' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, availableRowDiv, "Selected period (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-period' target='_blank'>here</a>");
var availableDiv = L.DomUtil.create('div', '', availableRowDiv); var availableDiv = L.DomUtil.create('div', '', availableRowDiv);
var startRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var startRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
_super.prototype.addLabelDiv.call(_this, startRowDiv, "Start date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-start' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, startRowDiv, "Start date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-start' target='_blank'>here</a>");
var startDiv = L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', startRowDiv); var startDiv = L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', startRowDiv);
var startIcon = L.DomUtil.create('span', 'uk-icon-calendar', startDiv); var startIcon = L.DomUtil.create('span', 'uk-icon-calendar', startDiv);
self.startDateInput = L.DomUtil.create('input', 'uk-width-1-2', startDiv); self.startDateInput = L.DomUtil.create('input', 'uk-width-1-2', startDiv);
...@@ -463,7 +465,7 @@ var STWkit; ...@@ -463,7 +465,7 @@ var STWkit;
self.startTimeInput = L.DomUtil.create('input', 'uk-width-1-2', startDiv); self.startTimeInput = L.DomUtil.create('input', 'uk-width-1-2', startDiv);
self.startTimeInput.type = 'text'; self.startTimeInput.type = 'text';
var durationRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var durationRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
_super.prototype.addLabelDiv.call(_this, durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-duration' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-duration' target='_blank'>here</a>");
var durationDiv = L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', durationRowDiv); var durationDiv = L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', durationRowDiv);
durationDiv.id = 'guide' + initials + 'duration'; durationDiv.id = 'guide' + initials + 'duration';
var durationIcon = L.DomUtil.create('span', 'uk-icon-clock-o', durationDiv); var durationIcon = L.DomUtil.create('span', 'uk-icon-clock-o', durationDiv);
...@@ -477,7 +479,7 @@ var STWkit; ...@@ -477,7 +479,7 @@ var STWkit;
var directionRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var directionRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!showforwardbackward) if (!showforwardbackward)
directionRowDiv.style.display = 'none'; directionRowDiv.style.display = 'none';
_super.prototype.addLabelDiv.call(_this, directionRowDiv, "Forward / Backward", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-direction' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, directionRowDiv, "Forward / Backward", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-direction' target='_blank'>here</a>");
var directionDiv = L.DomUtil.create('div', 'uk-margin-bottom', directionRowDiv); var directionDiv = L.DomUtil.create('div', 'uk-margin-bottom', directionRowDiv);
directionDiv.setAttribute('data-uk-button-radio', ''); directionDiv.setAttribute('data-uk-button-radio', '');
var directionButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', directionDiv); var directionButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', directionDiv);
...@@ -770,6 +772,7 @@ var STWkit; ...@@ -770,6 +772,7 @@ var STWkit;
e.preventDefault(); e.preventDefault();
}; };
var type = (options && options.hasOwnProperty('type')) ? options.type : ''; var type = (options && options.hasOwnProperty('type')) ? options.type : '';
var subtype = (options && options.hasOwnProperty('subtype')) ? options.subtype : '';
_this.initials = (options && options.hasOwnProperty('initials')) ? options.initials : ''; _this.initials = (options && options.hasOwnProperty('initials')) ? options.initials : '';
_this.showstateofoil = (options && options.hasOwnProperty('stateofoil')) ? options.stateofoil : true; _this.showstateofoil = (options && options.hasOwnProperty('stateofoil')) ? options.stateofoil : true;
var fieldset = L.DomUtil.create('fieldset', '', form); var fieldset = L.DomUtil.create('fieldset', '', form);
...@@ -797,7 +800,7 @@ var STWkit; ...@@ -797,7 +800,7 @@ var STWkit;
option.textContent = txt; option.textContent = txt;
} }
var contentoilClass = L.DomUtil.create('li', 'uk-margin-top', contentOiltype); var contentoilClass = L.DomUtil.create('li', 'uk-margin-top', contentOiltype);
_super.prototype.addLabelDiv.call(_this, contentoilClass, "Select oil class", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + _this.initials + "-oilclass' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, contentoilClass, "Select oil class", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-oilclass' target='_blank'>here</a>");
var divOilClass = L.DomUtil.create('div', 'uk-form-select', contentoilClass); var divOilClass = L.DomUtil.create('div', 'uk-form-select', contentoilClass);
divOilClass.setAttribute('data-uk-form-select', ''); divOilClass.setAttribute('data-uk-form-select', '');
var selectedOilClass = L.DomUtil.create('span', '', divOilClass); var selectedOilClass = L.DomUtil.create('span', '', divOilClass);
...@@ -808,7 +811,7 @@ var STWkit; ...@@ -808,7 +811,7 @@ var STWkit;
addOption(self.selectOilClass, 'Medium oils (100-1000 cSt)', 'Medium oils (100-1000 cSt)'); addOption(self.selectOilClass, 'Medium oils (100-1000 cSt)', 'Medium oils (100-1000 cSt)');
addOption(self.selectOilClass, 'Heavy oils (>1000 cSt)', 'Heavy oils (>1000 cSt)'); addOption(self.selectOilClass, 'Heavy oils (>1000 cSt)', 'Heavy oils (>1000 cSt)');
var contentspecificOil = L.DomUtil.create('li', 'uk-margin-top', contentOiltype); var contentspecificOil = L.DomUtil.create('li', 'uk-margin-top', contentOiltype);
_super.prototype.addLabelDiv.call(_this, contentspecificOil, "Select specific oil", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + _this.initials + "-specificoil' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, contentspecificOil, "Select specific oil", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-specificoil' target='_blank'>here</a>");
var divOilSpecific = L.DomUtil.create('div', 'uk-form-select', contentspecificOil); var divOilSpecific = L.DomUtil.create('div', 'uk-form-select', contentspecificOil);
divOilSpecific.setAttribute('data-uk-form-select', ''); divOilSpecific.setAttribute('data-uk-form-select', '');
var selectedOilSpecific = L.DomUtil.create('span', '', divOilSpecific); var selectedOilSpecific = L.DomUtil.create('span', '', divOilSpecific);
...@@ -856,7 +859,7 @@ var STWkit; ...@@ -856,7 +859,7 @@ var STWkit;
var oilstateRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var oilstateRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!_this.showstateofoil) if (!_this.showstateofoil)
oilstateRowDiv.style.display = 'none'; oilstateRowDiv.style.display = 'none';
_super.prototype.addLabelDiv.call(_this, oilstateRowDiv, "State of oil", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + _this.initials + "-oilstate' target='_blank'>here</a>"); _super.prototype.addLabelDiv.call(_this, oilstateRowDiv, "State of oil", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + subtype + "-oilstate' target='_blank'>here</a>");
var oilstateDiv = L.DomUtil.create('div', 'uk-margin-bottom', oilstateRowDiv); var oilstateDiv = L.DomUtil.create('div', 'uk-margin-bottom', oilstateRowDiv);
oilstateDiv.setAttribute('data-uk-button-radio', ''); oilstateDiv.setAttribute('data-uk-button-radio', '');
var oilstateButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', oilstateDiv); var oilstateButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', oilstateDiv);
...@@ -1084,7 +1087,7 @@ var STWkit; ...@@ -1084,7 +1087,7 @@ var STWkit;
var calculationRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var calculationRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!this.showcalculationmode) if (!this.showcalculationmode)
calculationRowDiv.style.display = 'none'; calculationRowDiv.style.display = 'none';
addLabelDiv(calculationRowDiv, "Calculation mode", "See more information <a style='color:#faa732;' href='help/classic/#" + this.type + "-" + this.initials + "-calculationmode' target='_blank'>here</a>"); addLabelDiv(calculationRowDiv, "Calculation mode", "See more information <a style='color:#faa732;' href='help/classic/#" + this.type + "-" + this.subtype + "-calculationmode' target='_blank'>here</a>");
var calculationMode = L.DomUtil.create('div', 'uk-form-select', calculationRowDiv); var calculationMode = L.DomUtil.create('div', 'uk-form-select', calculationRowDiv);
calculationMode.setAttribute('data-uk-form-select', ''); calculationMode.setAttribute('data-uk-form-select', '');
var selectedMode = L.DomUtil.create('span', '', calculationMode); var selectedMode = L.DomUtil.create('span', '', calculationMode);
...@@ -1094,7 +1097,7 @@ var STWkit; ...@@ -1094,7 +1097,7 @@ var STWkit;
addOption(self.selectCalculationMode, 'Detailed', 'Detailed / slower'); addOption(self.selectCalculationMode, 'Detailed', 'Detailed / slower');
self.selectCalculationMode.selectedIndex = 1; self.selectCalculationMode.selectedIndex = 1;
var uncertaintyRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset); var uncertaintyRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
addLabelDiv(uncertaintyRowDiv, "Uncertainty", "See more information <a style='color:#faa732;' href='help/classic/#" + this.type + "-" + this.initials + "-uncertainty' target='_blank'>here</a>"); addLabelDiv(uncertaintyRowDiv, "Uncertainty", "See more information <a style='color:#faa732;' href='help/classic/#" + this.type + "-" + this.subtype + "-uncertainty' target='_blank'>here</a>");
var uncertaintyLabel = L.DomUtil.create('label', '', uncertaintyRowDiv); var uncertaintyLabel = L.DomUtil.create('label', '', uncertaintyRowDiv);
uncertaintyLabel.style.display = 'block'; uncertaintyLabel.style.display = 'block';
self.uncertaintyInput = L.DomUtil.create('input', '', uncertaintyLabel); self.uncertaintyInput = L.DomUtil.create('input', '', uncertaintyLabel);
......
This diff is collapsed.
...@@ -145,6 +145,7 @@ module STWkit { ...@@ -145,6 +145,7 @@ module STWkit {
if (key == 13) e.preventDefault(); if (key == 13) e.preventDefault();
}; };
var type = (options && options.hasOwnProperty('type'))?options.type:''; var type = (options && options.hasOwnProperty('type'))?options.type:'';
var subtype = (options && options.hasOwnProperty('subtype'))?options.subtype:'';
var initials = (options && options.hasOwnProperty('initials'))?options.initials:''; var initials = (options && options.hasOwnProperty('initials'))?options.initials:'';
var showsingle = (options && options.hasOwnProperty('single'))?options.single:true; var showsingle = (options && options.hasOwnProperty('single'))?options.single:true;
var showmultiple = (options && options.hasOwnProperty('multiple'))?options.multiple:false; var showmultiple = (options && options.hasOwnProperty('multiple'))?options.multiple:false;
...@@ -157,7 +158,7 @@ module STWkit { ...@@ -157,7 +158,7 @@ module STWkit {
if (!showoutlettype) outlettypeDiv.style.display = 'none'; if (!showoutlettype) outlettypeDiv.style.display = 'none';
var typeLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', outlettypeDiv); var typeLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', outlettypeDiv);
var objectlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2', typeLabelGrid); var objectlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2', typeLabelGrid);
super.addLabelDiv(objectlabelDiv, "Outlet type", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-type' target='_blank'>here</a>"); super.addLabelDiv(objectlabelDiv, "Outlet type", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-type' target='_blank'>here</a>");
var typeButtonDiv = <HTMLDivElement>L.DomUtil.create('div', '', outlettypeDiv); var typeButtonDiv = <HTMLDivElement>L.DomUtil.create('div', '', outlettypeDiv);
typeButtonDiv.id = 'guide'+initials+'type'; typeButtonDiv.id = 'guide'+initials+'type';
typeButtonDiv.setAttribute('data-uk-button-radio', ''); typeButtonDiv.setAttribute('data-uk-button-radio', '');
...@@ -193,7 +194,7 @@ module STWkit { ...@@ -193,7 +194,7 @@ module STWkit {
var positionLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm); var positionLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', self.locationForm);
var positionlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid); var positionlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
super.addLabelDiv(positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-position' target='_blank'>here</a>"); super.addLabelDiv(positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-position' target='_blank'>here</a>");
var positionDiv: any = <HTMLDivElement>L.DomUtil.create('div', '', self.locationForm); var positionDiv: any = <HTMLDivElement>L.DomUtil.create('div', '', self.locationForm);
positionDiv.id = 'guide'+initials+'pos'; positionDiv.id = 'guide'+initials+'pos';
var positionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv); var positionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv);
...@@ -482,6 +483,7 @@ module STWkit { ...@@ -482,6 +483,7 @@ module STWkit {
self.forcingmodel = forcingmodel; self.forcingmodel = forcingmodel;
var type = (options && options.hasOwnProperty('type'))?options.type:''; var type = (options && options.hasOwnProperty('type'))?options.type:'';
var subtype = (options && options.hasOwnProperty('subtype'))?options.subtype:'';
var initials = (options && options.hasOwnProperty('initials'))?options.initials:''; var initials = (options && options.hasOwnProperty('initials'))?options.initials:'';
var showforwardbackward = (options && options.hasOwnProperty('forwardbackward'))?options.forwardbackward:true; var showforwardbackward = (options && options.hasOwnProperty('forwardbackward'))?options.forwardbackward:true;
var form = <HTMLFormElement>L.DomUtil.create('form', 'uk-form uk-form-stacked', periodDiv); var form = <HTMLFormElement>L.DomUtil.create('form', 'uk-form uk-form-stacked', periodDiv);
...@@ -502,10 +504,10 @@ module STWkit { ...@@ -502,10 +504,10 @@ module STWkit {
self.maxDate = moment.utc().startOf('hour').add(240, 'hours'); self.maxDate = moment.utc().startOf('hour').add(240, 'hours');
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', form); var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', form);
var availableRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var availableRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(availableRowDiv, "Selected period (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-period' target='_blank'>here</a>"); super.addLabelDiv(availableRowDiv, "Selected period (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-period' target='_blank'>here</a>");
var availableDiv = <HTMLDivElement>L.DomUtil.create('div', '', availableRowDiv); var availableDiv = <HTMLDivElement>L.DomUtil.create('div', '', availableRowDiv);
var startRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var startRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(startRowDiv, "Start date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-start' target='_blank'>here</a>"); super.addLabelDiv(startRowDiv, "Start date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-start' target='_blank'>here</a>");
var startDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', startRowDiv); var startDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', startRowDiv);
var startIcon = <HTMLSpanElement>L.DomUtil.create('span', 'uk-icon-calendar', startDiv); var startIcon = <HTMLSpanElement>L.DomUtil.create('span', 'uk-icon-calendar', startDiv);
self.startDateInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', startDiv); self.startDateInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', startDiv);
...@@ -514,7 +516,7 @@ module STWkit { ...@@ -514,7 +516,7 @@ module STWkit {
self.startTimeInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', startDiv); self.startTimeInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', startDiv);
self.startTimeInput.type = 'text'; self.startTimeInput.type = 'text';
var durationRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var durationRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-duration' target='_blank'>here</a>"); super.addLabelDiv(durationRowDiv, "Duration", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-duration' target='_blank'>here</a>");
var durationDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', durationRowDiv); var durationDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', durationRowDiv);
durationDiv.id = 'guide'+initials+'duration'; durationDiv.id = 'guide'+initials+'duration';
var durationIcon = <HTMLSpanElement>L.DomUtil.create('span', 'uk-icon-clock-o', durationDiv); var durationIcon = <HTMLSpanElement>L.DomUtil.create('span', 'uk-icon-clock-o', durationDiv);
...@@ -527,7 +529,7 @@ module STWkit { ...@@ -527,7 +529,7 @@ module STWkit {
hoursSpan.textContent = " hours"; hoursSpan.textContent = " hours";
var directionRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var directionRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!showforwardbackward) directionRowDiv.style.display = 'none'; if (!showforwardbackward) directionRowDiv.style.display = 'none';
super.addLabelDiv(directionRowDiv, "Forward / Backward", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+initials+"-direction' target='_blank'>here</a>"); super.addLabelDiv(directionRowDiv, "Forward / Backward", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-direction' target='_blank'>here</a>");
var directionDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-margin-bottom', directionRowDiv); var directionDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-margin-bottom', directionRowDiv);
directionDiv.setAttribute('data-uk-button-radio', ''); directionDiv.setAttribute('data-uk-button-radio', '');
var directionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', directionDiv); var directionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', directionDiv);
...@@ -844,6 +846,7 @@ module STWkit { ...@@ -844,6 +846,7 @@ module STWkit {
}; };
var type = (options && options.hasOwnProperty('type'))?options.type:''; var type = (options && options.hasOwnProperty('type'))?options.type:'';
var subtype = (options && options.hasOwnProperty('subtype'))?options.subtype:'';
this.initials = (options && options.hasOwnProperty('initials'))?options.initials:''; this.initials = (options && options.hasOwnProperty('initials'))?options.initials:'';
this.showstateofoil = (options && options.hasOwnProperty('stateofoil'))?options.stateofoil:true; this.showstateofoil = (options && options.hasOwnProperty('stateofoil'))?options.stateofoil:true;
...@@ -874,7 +877,7 @@ module STWkit { ...@@ -874,7 +877,7 @@ module STWkit {
} }
var contentoilClass = <HTMLLIElement>L.DomUtil.create('li', 'uk-margin-top', contentOiltype); var contentoilClass = <HTMLLIElement>L.DomUtil.create('li', 'uk-margin-top', contentOiltype);
super.addLabelDiv(contentoilClass, "Select oil class", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+this.initials+"-oilclass' target='_blank'>here</a>"); super.addLabelDiv(contentoilClass, "Select oil class", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-oilclass' target='_blank'>here</a>");
var divOilClass = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', contentoilClass); var divOilClass = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', contentoilClass);
divOilClass.setAttribute('data-uk-form-select', ''); divOilClass.setAttribute('data-uk-form-select', '');
var selectedOilClass = <HTMLSpanElement>L.DomUtil.create('span', '', divOilClass); var selectedOilClass = <HTMLSpanElement>L.DomUtil.create('span', '', divOilClass);
...@@ -886,7 +889,7 @@ module STWkit { ...@@ -886,7 +889,7 @@ module STWkit {
addOption(self.selectOilClass, 'Heavy oils (>1000 cSt)', 'Heavy oils (>1000 cSt)'); addOption(self.selectOilClass, 'Heavy oils (>1000 cSt)', 'Heavy oils (>1000 cSt)');
var contentspecificOil = <HTMLLIElement>L.DomUtil.create('li', 'uk-margin-top', contentOiltype); var contentspecificOil = <HTMLLIElement>L.DomUtil.create('li', 'uk-margin-top', contentOiltype);
super.addLabelDiv(contentspecificOil, "Select specific oil", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+this.initials+"-specificoil' target='_blank'>here</a>"); super.addLabelDiv(contentspecificOil, "Select specific oil", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-specificoil' target='_blank'>here</a>");
var divOilSpecific = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', contentspecificOil); var divOilSpecific = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', contentspecificOil);
divOilSpecific.setAttribute('data-uk-form-select', ''); divOilSpecific.setAttribute('data-uk-form-select', '');
var selectedOilSpecific = <HTMLSpanElement>L.DomUtil.create('span', '', divOilSpecific); var selectedOilSpecific = <HTMLSpanElement>L.DomUtil.create('span', '', divOilSpecific);
...@@ -934,7 +937,7 @@ module STWkit { ...@@ -934,7 +937,7 @@ module STWkit {
var oilstateRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var oilstateRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!this.showstateofoil) oilstateRowDiv.style.display = 'none'; if (!this.showstateofoil) oilstateRowDiv.style.display = 'none';
super.addLabelDiv(oilstateRowDiv, "State of oil", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+this.initials+"-oilstate' target='_blank'>here</a>"); super.addLabelDiv(oilstateRowDiv, "State of oil", "See more information <a style='color:#faa732;' href='help/classic/#"+type+"-"+subtype+"-oilstate' target='_blank'>here</a>");
var oilstateDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-margin-bottom', oilstateRowDiv); var oilstateDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-margin-bottom', oilstateRowDiv);
oilstateDiv.setAttribute('data-uk-button-radio', ''); oilstateDiv.setAttribute('data-uk-button-radio', '');
var oilstateButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', oilstateDiv); var oilstateButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', oilstateDiv);
...@@ -1203,7 +1206,7 @@ module STWkit { ...@@ -1203,7 +1206,7 @@ module STWkit {
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', startform); var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', '', startform);
var calculationRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var calculationRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
if (!this.showcalculationmode) calculationRowDiv.style.display = 'none'; if (!this.showcalculationmode) calculationRowDiv.style.display = 'none';
addLabelDiv(calculationRowDiv, "Calculation mode", "See more information <a style='color:#faa732;' href='help/classic/#"+this.type+"-"+this.initials+"-calculationmode' target='_blank'>here</a>"); addLabelDiv(calculationRowDiv, "Calculation mode", "See more information <a style='color:#faa732;' href='help/classic/#"+this.type+"-"+this.subtype+"-calculationmode' target='_blank'>here</a>");
var calculationMode = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', calculationRowDiv); var calculationMode = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-select', calculationRowDiv);
calculationMode.setAttribute('data-uk-form-select',''); calculationMode.setAttribute('data-uk-form-select','');
var selectedMode = <HTMLSpanElement>L.DomUtil.create('span', '', calculationMode); var selectedMode = <HTMLSpanElement>L.DomUtil.create('span', '', calculationMode);
...@@ -1213,7 +1216,7 @@ module STWkit { ...@@ -1213,7 +1216,7 @@ module STWkit {
addOption(self.selectCalculationMode,'Detailed', 'Detailed / slower'); addOption(self.selectCalculationMode,'Detailed', 'Detailed / slower');
self.selectCalculationMode.selectedIndex = 1; self.selectCalculationMode.selectedIndex = 1;
var uncertaintyRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset); var uncertaintyRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
addLabelDiv(uncertaintyRowDiv, "Uncertainty", "See more information <a style='color:#faa732;' href='help/classic/#"+this.type+"-"+this.initials+"-uncertainty' target='_blank'>here</a>"); addLabelDiv(uncertaintyRowDiv, "Uncertainty", "See more information <a style='color:#faa732;' href='help/classic/#"+this.type+"-"+this.subtype+"-uncertainty' target='_blank'>here</a>");
var uncertaintyLabel = <HTMLLabelElement>L.DomUtil.create('label', '', uncertaintyRowDiv); var uncertaintyLabel = <HTMLLabelElement>L.DomUtil.create('label', '', uncertaintyRowDiv);
uncertaintyLabel.style.display = 'block'; uncertaintyLabel.style.display = 'block';
self.uncertaintyInput = <HTMLInputElement>L.DomUtil.create('input', '', uncertaintyLabel); self.uncertaintyInput = <HTMLInputElement>L.DomUtil.create('input', '', uncertaintyLabel);
......
Markdown is supported
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