Skip to content

Commit

Permalink
Added script optional property to LO level & every page (close #446)
Browse files Browse the repository at this point in the history
Added styles optional property to every page
  • Loading branch information
FayCross committed Apr 29, 2016
1 parent 2d9cdab commit 073c4dd
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,12 @@ function x_continueSetUp() {
);

XTInitialise(); // initialise here, because of XTStartPage in next function

// script optional property added after all interface set up & before any pages load
if (x_params.script != undefined && x_params.script != "") {
$x_head.append('<script>' + x_params.script + '</script>');
}

x_navigateToPage(true, x_startPage);
}

Expand Down Expand Up @@ -1272,6 +1278,14 @@ function x_pageLoaded() {

$this.attr(attr_name, x_evalURL(val));
});

// script & style optional properties for each page added after page is otherwise set up
if (x_currentPageXML.getAttribute("script") != undefined && x_currentPageXML.getAttribute("script") != "") {
$("#x_page" + x_currentPage).append('<script>' + x_currentPageXML.getAttribute("script") + '</script>');
}
if (x_currentPageXML.getAttribute("styles") != undefined && x_currentPageXML.getAttribute("styles") != "") {
$("#x_page" + x_currentPage).append('<style type="text/css">' + x_currentPageXML.getAttribute("styles") + '</style>');
}

$("#x_page" + x_currentPage)
.hide()
Expand Down
151 changes: 76 additions & 75 deletions modules/xerte/parent_templates/Nottingham/data.xwd

Large diffs are not rendered by default.

151 changes: 76 additions & 75 deletions modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd

Large diffs are not rendered by default.

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 @@ -41,6 +41,7 @@
<backgroundGrey optional="true" type="CheckBox" label="Background Greyscale" defaultValue="true"/>
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<styles optional="true" type="script" height="200" label="Styles"/>
<script label="Script" type="script" height="200" defaultValue="// JavaScript / jQuery" optional="true"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="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" />
<trackingPassed optional="true" label="Tracking Passing Score" width="250" type="TextInput" defaultValue="55%" tooltip="Passing score as a decimal or percantage when tracking"/>
Expand Down
2 changes: 2 additions & 0 deletions src/Nottingham/wizards/en-GB/basicPages.xwd
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<navSetting label="Navigation Buttons" options="All,Back and Next,Back Only,Next Only,None" type="ComboBox" width="120" data="all,backnext,backonly,nextonly,none" defaultValue="all" optional="true"/>
<pageID label="Page ID" defaultValue="Unique ID for this page" type="TextInput" optional="true" />
<hidePage label="Hide Page" type="CheckBox" defaultValue="false" optional="true"/>
<script label="Script" type="script" height="200" defaultValue="// JavaScript / jQuery" optional="true"/>
<styles label="Styles" type="script" height="200" optional="true"/>
</commonNodes>
Loading

0 comments on commit 073c4dd

Please sign in to comment.