Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adds a markup item to distinquish bettwen text and HTML code in the s…
…ite template, and a canvas icon, which will show on 'Show Advanced'

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@930 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
thexerteproject committed May 21, 2013
1 parent 68b2584 commit d2b317d
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 29 deletions.
69 changes: 43 additions & 26 deletions modules/site/parent_templates/site/common/js/application.js
Expand Up @@ -67,6 +67,12 @@ function loadLibraries(){
$('head').append('<link rel="stylesheet" href="' + eval( $(data).find('learningObject').attr('stylesheet') ) + '" type="text/css" />');

}

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

$('head').append('<style type="text/css">' + $(data).find('learningObject').attr('styles') + '</style>');

}

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

Expand All @@ -77,7 +83,7 @@ function loadLibraries(){

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

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

loaded++;

Expand Down Expand Up @@ -191,6 +197,41 @@ function parseContent(index){
section.append( '<script>' + $(this).text() + '</script>');
}

if (this.nodeName == 'markup'){

section.append( $(this).text() );
}

if (this.nodeName == 'canvas'){

var style;

if ( $(this).attr('style') != undefined){

style = ' style="' + $(this).attr('style') + '" ';

} else {

style = '';

}

var cls;

if ( $(this).attr('class') != undefined){

cls = ' class="' + $(this).attr('class') + '" ';

} else {

cls = '';

}

section.append( '<p><canvas id="' + $(this).attr('id') + '" width="' + $(this).attr('width') + '" height="' + $(this).attr('height') + '"' + style + cls + '/></p>');

}

if (this.nodeName == 'image'){
section.append('<p><img class="img-polaroid" src="' + eval( $(this).attr('url')) + '" title="' + $(this).attr('alt') + '" alt="' + $(this).attr('alt') + '"/></p>');
}
Expand Down Expand Up @@ -446,28 +487,4 @@ function makeCarousel(node, section, sectionIndex, itemIndex){

section.append(carDiv);

}
























}
25 changes: 22 additions & 3 deletions modules/site/parent_templates/site/data.xwd
Expand Up @@ -7,8 +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"/>
<libs type="DataGrid" label="JavaScript Libraries" optional="true" height="150" 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"/>
<styles type="TextArea" height="200" optional="true" label="Styles"/>

<newNodes>
<page><![CDATA[<page name="Enter Page Title" subtitle="Enter Page Subtitle"/>]]></page>
Expand All @@ -32,7 +33,8 @@
<name type="TextInput" label="Section Title"/>

<newNodes>

<markup><![CDATA[<markup name="Name">Enter HTML Code</markup>]]></markup>
<canvas><![CDATA[<canvas name="Name" id="EnterID" width="500" height="350"/>]]></canvas>
<script><![CDATA[<script name="Name">//javascript</script>]]></script>
<navigator><![CDATA[<navigator name="Name" type="Tabs"/>]]></navigator>
<video><![CDATA[<video name="Name" url="Select File..."/>]]></video>
Expand All @@ -44,13 +46,30 @@

</section>

<markup icon="icTag" type="text" height="300" menuItem="HTML Code" label="HTML Code" remove="true" advanced="true">

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

</markup>

<text icon="icFont" type="text" height="300" menuItem="Text" label="Text" remove="true">

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

</text>

<script icon="icCog" type="script" height="400" menuItem="Script" label="Script" remove="true" divider="true">
<canvas icon="icPallette" menuItem="Canvas" label="Canvas" remove="true" advanced="true">

<name type="TextInput" label="Name"/>
<id type="TextInput" label="ID"/>
<width type="TextInput" label="Width"/>
<height type="TextInput" label="Height"/>
<class type="TextInput" label="Class" optional="true"/>
<style type="TextInput" label="Style" optional="true"/>

</canvas>

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

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

Expand Down

0 comments on commit d2b317d

Please sign in to comment.