Commit 529e9151 authored by carlosperate's avatar carlosperate

Move examples into root folder and add new "Serial Repeat Game".

parent 8772a6ee
...@@ -63,19 +63,23 @@ Ardublockly.bindActionFunctions = function() { ...@@ -63,19 +63,23 @@ Ardublockly.bindActionFunctions = function() {
$('.button-collapse').sideNav('hide'); $('.button-collapse').sideNav('hide');
}); });
Ardublockly.bindClick_('menu_example_1', function() { Ardublockly.bindClick_('menu_example_1', function() {
Ardublockly.loadServerXmlFile('examples/blink.xml'); Ardublockly.loadServerXmlFile('../examples/blink.xml');
$('.button-collapse').sideNav('hide'); $('.button-collapse').sideNav('hide');
}); });
Ardublockly.bindClick_('menu_example_2', function() { Ardublockly.bindClick_('menu_example_2', function() {
Ardublockly.loadServerXmlFile('examples/serial_print_ascii_.xml'); Ardublockly.loadServerXmlFile('../examples/serial_print_ascii_.xml');
$('.button-collapse').sideNav('hide'); $('.button-collapse').sideNav('hide');
}); });
Ardublockly.bindClick_('menu_example_3', function() { Ardublockly.bindClick_('menu_example_3', function() {
Ardublockly.loadServerXmlFile('examples/servo_knob.xml'); Ardublockly.loadServerXmlFile('../examples/serial_repeat_game.xml');
$('.button-collapse').sideNav('hide'); $('.button-collapse').sideNav('hide');
}); });
Ardublockly.bindClick_('menu_example_4', function() { Ardublockly.bindClick_('menu_example_4', function() {
Ardublockly.loadServerXmlFile('examples/stepper_knob.xml'); Ardublockly.loadServerXmlFile('../examples/servo_knob.xml');
$('.button-collapse').sideNav('hide');
});
Ardublockly.bindClick_('menu_example_5', function() {
Ardublockly.loadServerXmlFile('../examples/stepper_knob.xml');
$('.button-collapse').sideNav('hide'); $('.button-collapse').sideNav('hide');
}); });
......
...@@ -91,8 +91,9 @@ ...@@ -91,8 +91,9 @@
<ul> <ul>
<li id="menu_example_1"><a href="#!">Blink</a></li> <li id="menu_example_1"><a href="#!">Blink</a></li>
<li id="menu_example_2"><a href="#!">Serial print</a></li> <li id="menu_example_2"><a href="#!">Serial print</a></li>
<li id="menu_example_3"><a href="#!">Servo knob</a></li> <li id="menu_example_3"><a href="#!">Serial repeat game</a></li>
<li id="menu_example_4"><a href="#!">Stepper knob</a></li> <li id="menu_example_4"><a href="#!">Servo knob</a></li>
<li id="menu_example_5"><a href="#!">Stepper knob</a></li>
</ul> </ul>
</div> </div>
</li> </li>
......
This diff is collapsed.
...@@ -236,25 +236,34 @@ var getExamplesMenuData = function() { ...@@ -236,25 +236,34 @@ var getExamplesMenuData = function() {
BrowserWindow.getFocusedWindow() BrowserWindow.getFocusedWindow()
.webContents .webContents
.executeJavaScript( .executeJavaScript(
'Ardublockly.loadServerXmlFile("examples/' + 'Ardublockly.loadServerXmlFile("../examples/' +
'blink.xml");'); 'blink.xml");');
} }
}, { }, {
label: 'Print Serial', label: 'Serial Print',
click: function() { click: function() {
BrowserWindow.getFocusedWindow() BrowserWindow.getFocusedWindow()
.webContents .webContents
.executeJavaScript( .executeJavaScript(
'Ardublockly.loadServerXmlFile("examples/' + 'Ardublockly.loadServerXmlFile("../examples/' +
'serial_print_ascii_.xml");'); 'serial_print_ascii_.xml");');
} }
}, {
label: 'Serial Repeat Game',
click: function() {
BrowserWindow.getFocusedWindow()
.webContents
.executeJavaScript(
'Ardublockly.loadServerXmlFile("../examples/' +
'serial_repeat_game.xml");');
}
}, { }, {
label: 'Servo Knob', label: 'Servo Knob',
click: function() { click: function() {
BrowserWindow.getFocusedWindow() BrowserWindow.getFocusedWindow()
.webContents .webContents
.executeJavaScript( .executeJavaScript(
'Ardublockly.loadServerXmlFile("examples/' + 'Ardublockly.loadServerXmlFile("../examples/' +
'servo_knob.xml");'); 'servo_knob.xml");');
} }
}, { }, {
...@@ -263,7 +272,7 @@ var getExamplesMenuData = function() { ...@@ -263,7 +272,7 @@ var getExamplesMenuData = function() {
BrowserWindow.getFocusedWindow() BrowserWindow.getFocusedWindow()
.webContents .webContents
.executeJavaScript( .executeJavaScript(
'Ardublockly.loadServerXmlFile("examples/' + 'Ardublockly.loadServerXmlFile("../examples/' +
'stepper_knob.xml");'); 'stepper_knob.xml");');
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment