Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JavaScript support in the site editor, and the wizard with syntax hig…
…hlighting;

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@699 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
juliantenney committed Feb 19, 2013
1 parent 104bfda commit 07aa151
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
Binary file modified modules/xerte/engine/wizard.swf
Binary file not shown.
44 changes: 16 additions & 28 deletions modules/xerte/parent_templates/site/common/js/application.js
Expand Up @@ -96,7 +96,7 @@ function parseContent(index){

//add the section contents
$(this).children().each( function(index, value){

//for all nodes append the text
if (this.nodeName == 'text'){
section.append( '<p>' + $(this).text() + '</p>');
Expand All @@ -106,33 +106,18 @@ function parseContent(index){
section.append( '<script>' + $(this).text() + '</script>');
}

//handle media
if ( $(this).attr('url') != undefined){
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>');
}

var mediaStr;
var file = eval( $(this).attr('url') );

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

mediaStr = '<p><img class="img-polaroid" src="' + file + '" title="Alt Text" alt="Alt Text"/></p>';

}

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

mediaStr = '<p><b>' + $(this).attr('name') + '</b></p><p><audio src="' + file + '" type="video/mp4" id="player1" controls="controls" preload="none" width="100%"></audio></p>';

}

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

mediaStr = '<p><b>' + $(this).attr('name') + '</b></p><p><video style="max-width: 100%" class="fullPageVideo" src="' + file + '" type="video/mp4" id="player1" controls="controls" preload="none"></video></p>';

}

//now append it to the section
section.append(mediaStr);
if (this.nodeName == 'audio'){
section.append('<p><b>' + $(this).attr('name') + '</b></p><p><audio src="' + eval( $(this).attr('url') ) + '" type="video/mp4" id="player1" controls="controls" preload="none" width="100%"></audio></p>')
}

if (this.nodeName == 'video'){
section.append('<p><b>' + $(this).attr('name') + '</b></p><p><video style="max-width: 100%" class="fullPageVideo" src="' + eval( $(this).attr('url') ) + '" type="video/mp4" id="player1" controls="controls" preload="none"></video></p>');
}

});

//a return to top button
Expand All @@ -150,9 +135,12 @@ function parseContent(index){
window.scroll(0,0);

$('body').scrollspy('refresh');


//an event for user defined code to know when loading is done
$(document).trigger('contentLoaded');

//force facebook / twitter objects to initialise
twttr.widgets.load();
FB.XFBML.parse();

}
22 changes: 11 additions & 11 deletions modules/xerte/parent_templates/site/data.xwd
Expand Up @@ -28,44 +28,44 @@

<newNodes>

<script><![CDATA[<script name="Name">JavaScript Here</script>]]></script>
<video><![CDATA[<video name="Name" url="Select File...">Text Here</video]]></video>
<audio><![CDATA[<audio name="Name" url="Select File...">Text Here</audio]]></audio>
<image><![CDATA[<image name="Name" url="Select File..." alt="Alt Text">Text Here</image>]]></image>
<text><![CDATA[<text name="Name">HTML Here</text>]]></text>
<script><![CDATA[<script name="Name">//javascript</script>]]></script>
<video><![CDATA[<video name="Name" url="Select File..."/>]]></video>
<audio><![CDATA[<audio name="Name" url="Select File..."/>]]></audio>
<image><![CDATA[<image name="Name" url="Select File..." alt="Alt Text"/>]]></image>
<text><![CDATA[<text name="Name">Enter Text Here</text>]]></text>

</newNodes>

</section>

<text icon="icFont" type="text" height="400" menuItem="Text" label="Text" remove="true">
<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">
<script icon="icCog" type="script" height="400" menuItem="Script" label="Script" remove="true" taskList="false">

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

</script>

<image icon="icImage" type="text" height="250" menuItem="Image" label="Text" remove="true">
<image icon="icImage" height="250" menuItem="Image" label="Text" remove="true">

<name type="TextInput" label="Name"/>
<url type="Media" label="Image File"/>
<alt type="TextInput" label="Alt Text"/>

</image>

<audio icon="icSound" type="text" height="250" menuItem="Audio" label="Text" remove="true">
<audio icon="icSound" height="250" menuItem="Audio" label="Text" remove="true">

<name type="TextInput" label="Name"/>
<url type="Media" label="Image File"/>

</audio>

<video icon="icFilm" type="text" height="250" menuItem="Video" label="Text" remove="true">
<video icon="icFilm" height="250" menuItem="Video" label="Text" remove="true">

<name type="TextInput" label="Name"/>
<url type="Media" label="Image File"/>
Expand Down

0 comments on commit 07aa151

Please sign in to comment.