Skip to content

Commit

Permalink
Added new 'Styles' property to LOs & changed order css files are loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
FayCross committed Nov 19, 2015
1 parent 7f5c745 commit 8cec5a1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
30 changes: 17 additions & 13 deletions modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function x_setUp() {

if (screen.width <= 550) {
x_browserInfo.mobile = true;
x_insertCSS(x_templateLocation + "common_html5/css/mobileStyles.css", function() {x_cssSetUp("stylesheet")});
x_insertCSS(x_templateLocation + "common_html5/css/mobileStyles.css", function() {x_cssSetUp("theme")});
} else {
x_insertCSS(x_templateLocation + "common_html5/css/desktopStyles.css", x_desktopSetUp);
}
Expand Down Expand Up @@ -439,42 +439,46 @@ function x_desktopSetUp() {
x_setFillWindow(false);
}

x_cssSetUp("stylesheet");
x_cssSetUp("theme");
}

function x_cssSetUp(param) {
if (param == "stylesheet") {
if (x_params.stylesheet != undefined) {
x_insertCSS(x_evalURL(x_params.stylesheet), function() {x_cssSetUp("theme")});
} else {
x_cssSetUp("theme");
}
} else if (param == "theme") {
if (param == "theme") {
if (x_params.theme != undefined && x_params.theme != "default") {
$.getScript(x_themePath + x_params.theme + '/' + x_params.theme + '.js'); // most themes won't have this js file
x_insertCSS(x_themePath + x_params.theme + '/' + x_params.theme + '.css', function() {x_cssSetUp("theme2")});
} else {
if (x_params.displayMode == "default" || $.isArray(x_params.displayMode)) { // immediately disable responsivetext.css after loaded
x_insertCSS(x_templateLocation + "common_html5/css/responsivetext.css", x_continueSetUp, true);
x_insertCSS(x_templateLocation + "common_html5/css/responsivetext.css", function() {x_cssSetUp("stylesheet")}, true);
} else {
x_insertCSS(x_templateLocation + "common_html5/css/responsivetext.css", x_continueSetUp);
x_insertCSS(x_templateLocation + "common_html5/css/responsivetext.css", function() {x_cssSetUp("stylesheet")});
}
}
} else if (param == "theme2") {
if (x_params.responsive == "true") {
// adds responsiveText.css for theme if it exists - in some circumstances this will be immediately disabled
if (x_params.displayMode == "default" || $.isArray(x_params.displayMode)) { // immediately disable responsivetext.css after loaded
x_insertCSS(x_themePath + x_params.theme + '/responsivetext.css', x_continueSetUp, true);
x_insertCSS(x_themePath + x_params.theme + '/responsivetext.css', function() {x_cssSetUp("stylesheet")}, true);
} else {
x_insertCSS(x_themePath + x_params.theme + '/responsivetext.css', x_continueSetUp);
x_insertCSS(x_themePath + x_params.theme + '/responsivetext.css', function() {x_cssSetUp("stylesheet")});
}
} else {
x_cssSetUp("stylesheet");
}
} else if (param == "stylesheet") {
if (x_params.stylesheet != undefined) {
x_insertCSS(x_evalURL(x_params.stylesheet), x_continueSetUp);
} else {
x_continueSetUp();
}
}
}

function x_continueSetUp() {
if (x_params.styles != undefined){
$x_head.append('<style type="text/css">' + x_params.styles + '</style>');
}

if (x_pageInfo[0].type == "menu") {
$x_pageNo.hide();
if (x_params.navigation == "Menu") {
Expand Down
1 change: 1 addition & 0 deletions modules/xerte/parent_templates/Nottingham/data.xwd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<background optional="true" type="media" label="Background Image"/>
<backgroundopacity optional="true" type="NumericStepper" min="0" max="100" step="1" label="Background Opacity"/>
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<styles optional="true" type="script" height="200" label="Styles"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="SCORM Tracking Mode" width="250" type="ComboBox" options="Full tracking of first pass,Minimal tracking of first pass,Full tracking of last pass,Minimal tracking of last pass,No tracking" data="full_first,minimal_first,full,minimal,none" defaultValue="full_first"/>
<resume label="Enable Resuming" type="CheckBox" defaultValue="false" optional="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<background optional="true" type="media" label="Background Image"/>
<backgroundopacity optional="true" type="NumericStepper" min="0" max="100" step="1" label="Background Opacity"/>
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<styles optional="true" type="script" height="200" label="Styles"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="SCORM Tracking Mode" width="250" type="ComboBox" options="Full tracking of first pass,Minimal tracking of first pass,Full tracking of last pass,Minimal tracking of last pass,No tracking" data="full_first,minimal_first,full,minimal,none" defaultValue="full_first"/>
<resume label="Enable Resuming" type="CheckBox" defaultValue="false" optional="true"/>
Expand Down
1 change: 1 addition & 0 deletions src/Nottingham/wizards/en-GB/basic.xwd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<background optional="true" type="media" label="Background Image"/>
<backgroundopacity optional="true" type="NumericStepper" min="0" max="100" step="1" label="Background Opacity"/>
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<styles optional="true" type="script" height="200" label="Styles"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="SCORM Tracking Mode" width="250" type="ComboBox" options="Full tracking of first pass,Minimal tracking of first pass,Full tracking of last pass,Minimal tracking of last pass,No tracking" data="full_first,minimal_first,full,minimal,none" defaultValue="full_first" />
<resume label="Enable Resuming" type="CheckBox" defaultValue="false" optional="true"/>
Expand Down
1 change: 1 addition & 0 deletions src/Nottingham/wizards/en-GB/template.xwd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<background optional="true" type="media" label="Background Image"/>
<backgroundopacity optional="true" type="NumericStepper" min="0" max="100" step="1" label="Background Opacity"/>
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<styles optional="true" type="script" height="200" label="Styles"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="SCORM Tracking Mode" width="250" type="ComboBox" options="Full tracking of first pass,Minimal tracking of first pass,Full tracking of last pass,Minimal tracking of last pass,No tracking" data="full_first,minimal_first,full,minimal,none" defaultValue="full_first"/>
<resume label="Enable Resuming" type="CheckBox" defaultValue="false" optional="true"/>
Expand Down

0 comments on commit 8cec5a1

Please sign in to comment.