Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
thexerteproject committed May 17, 2013
1 parent f67754b commit d899277
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 43 deletions.
Binary file modified modules/site/engine/wizard.swf
Binary file not shown.
134 changes: 93 additions & 41 deletions modules/site/parent_templates/site/common/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,56 +49,108 @@ function loadContent(){

}

//add all the pages to the pages menu: this links bak to the same page
$(data).find('page').each( function(index, value){

$('#nav').append('<li class=""><a href="javascript:parseContent(' + index + ')">' + $(this).attr('name') + '</a></li>');

});

//set the header image, if defined
if ($(data).find('learningObject').attr('header') != undefined){

$('#overview').css({filter:''}); //for IE8
//step one - libraries?
loadLibraries();

}

});

}

function loadLibraries(){

//load stylesheet and libraries...

if ( $(data).find('learningObject').attr('stylesheet') != undefined){

$('head').append('<link rel="stylesheet" href="' + eval( $(data).find('learningObject').attr('stylesheet') ) + '" type="text/css" />');

}

if ( $(data).find('learningObject').attr('libs') != undefined){

var libs = $(data).find('learningObject').attr('libs').split('||');

var libCount = libs.length;
var loaded = 0;

for (var i = 0; i< libCount; i++){

$.getScript(libs[i], function(){

$('#overview').css('background-image', "url(" + eval( $(data).find('learningObject').attr('header'))+ ")");
}

if ($(data).find('learningObject').attr('headerColour') != undefined){

var col = $(data).find('learningObject').attr('headerColour');
loaded++;

//one or two?
if (col.substr(',') != -1){
col = col.split(',');
} else {
col = [col,col];
if (loaded == libs.length){

//step two
setup();
//step three
parseContent(0);

}

$('#overview').css('background', col[0]);
$('#overview').css('background', '-moz-linear-gradient(45deg, ' + col[0] + ' 0%, ' + col[1] + ' 100%)');
$('#overview').css('background', '-webkit-gradient(linear, left bottom, right top, color-stop(0%,' + col[0] + '), color-stop(100%,' + col[1] + '))');
$('#overview').css('background', '-webkit-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', '-o-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', '-ms-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', 'linear-gradient(45deg, ' + + ' 0%,' + col[1]+ ' 100%)');
$('#overview').css('filter', 'progid:DXImageTransform.Microsoft.gradient( startColorstr=' + col[0] + ', endColorstr=' + col[1] + ',GradientType=1 )');

}

if ($(data).find('learningObject').attr('headerTextColour') != undefined){

$('#overview').css('color', $(data).find('learningObject').attr('headerTextColour'));

}

//done with one time stuff, now parse the first page...
parseContent(0);
});

}

} else {

setup();

parseContent(0);

}

}

function setup(){

//add all the pages to the pages menu: this links bak to the same page
$(data).find('page').each( function(index, value){

$('#nav').append('<li class=""><a href="javascript:parseContent(' + index + ')">' + $(this).attr('name') + '</a></li>');

});

//set the header image, if defined
if ($(data).find('learningObject').attr('header') != undefined){

$('#overview').css({filter:''}); //for IE8

$('#overview').css('background-image', "url(" + eval( $(data).find('learningObject').attr('header'))+ ")");
}

if ($(data).find('learningObject').attr('headerColour') != undefined){

var col = $(data).find('learningObject').attr('headerColour');

//one or two?
if (col.substr(',') != -1){
col = col.split(',');
} else {
col = [col,col];
}

$('#overview').css('background', col[0]);
$('#overview').css('background', '-moz-linear-gradient(45deg, ' + col[0] + ' 0%, ' + col[1] + ' 100%)');
$('#overview').css('background', '-webkit-gradient(linear, left bottom, right top, color-stop(0%,' + col[0] + '), color-stop(100%,' + col[1] + '))');
$('#overview').css('background', '-webkit-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', '-o-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', '-ms-linear-gradient(45deg, ' + col[0] + ' 0%,' + col[1] + ' 100%)');
$('#overview').css('background', 'linear-gradient(45deg, ' + + ' 0%,' + col[1]+ ' 100%)');
$('#overview').css('filter', 'progid:DXImageTransform.Microsoft.gradient( startColorstr=' + col[0] + ', endColorstr=' + col[1] + ',GradientType=1 )');

}

if ($(data).find('learningObject').attr('headerTextColour') != undefined){

$('#overview').css('color', $(data).find('learningObject').attr('headerTextColour'));

}

}


function parseContent(index){

Expand Down
6 changes: 4 additions & 2 deletions modules/site/parent_templates/site/data.xwd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<header type="Media" optional="true" label="Header Image"/>
<headerColour type="TextInput" optional="true" label="Header Colour"/>
<headerTextColour type="TextInput" optional="true" label="Header Text Colour"/>

<libs type="DataGrid" label="JavaScript Libraries" optional="true" height="200" width="390" columns="1" colWidths="390" editable="1" controls="1" headers="Library URL" newRow="Enter URL" rendererOptions="none" defaultValue="Enter URL"/>
<stylesheet type="Media" optional="true" label="Stylesheet"/>

<newNodes>
<page><![CDATA[<page name="Enter Page Title" subtitle="Enter Page Subtitle"/>]]></page>
</newNodes>
Expand Down Expand Up @@ -48,7 +50,7 @@

</text>

<script icon="icCog" type="script" height="400" menuItem="Script" label="Script" remove="true" taskList="false">
<script icon="icCog" type="script" height="400" menuItem="Script" label="Script" remove="true" divider="true">

<name type="TextInput" label="Name"/>

Expand Down

0 comments on commit d899277

Please sign in to comment.