Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Aug 23, 2017
1 parent e30cccb commit 6c0566a
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 24 deletions.
4 changes: 2 additions & 2 deletions doc/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<details class="doc_details"><summary>About</summary>
This is <a href="http://hdrobotic.com/" target="_blank">Dexter</a> Development Environment<br/>
version: <span id="dde_version_id">2.0.12</span><br/>
released: <span id="dde_release_date_id">Aug 22, 2017</span>
version: <span id="dde_version_id">2.0.13</span><br/>
released: <span id="dde_release_date_id">Aug 23, 2017</span>
<p/>
DDE helps you create, debug, and send software to a Dexter robot.
You can use any JavaScript augmented with DDE-specific functions to help find out about,
Expand Down
18 changes: 18 additions & 0 deletions doc/ref_man.html
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@
Instead of a url as the argument, you can pass a literal JS object
with lots of options, described at:
<a target="_blank" href="https://www.npmjs.com/package/request">options</a>
<p/>
See also: <a href="#" onclick="open_doc(show_page_doc_id)">show_page</a>
</details>

<details id="get_page_async_doc_id" class="doc_details"><summary>get_page_async</summary>
Expand Down Expand Up @@ -3478,6 +3480,22 @@ <h4>Cover DDE Window</h4/>
Ref Man/Robot/Human/show_window</a>
</details> <!-- end show_window -->

<details id="show_page_doc_id" class="doc_details"><summary>show_page</summary>
Creates a new browser window and shows a web page in it.<br/>
<i>Parameters:</i><br/>
<b>url</b> The url to show in the new browser window.<br/>
<b>options</b> The options for the window that is created, which are the same as
Electron's BrowserWindow.
<a href="https://github.com/electron/electron/blob/master/docs/api/browser-window.md" target="_blank">Options Doc</a>
<p/>
<i>Example:</i>
<pre><code>show_page("http://hdrobotic.com",
{x:100, y:100,
width:800, height:600})
</code></pre>
See also: <a href="#" onclick="open_doc(get_page_doc_id)">get_page</a>
</details>

<details class="doc_details"><summary>Window Utilities</summary>

<details id="close_window_doc_id"class="doc_details"><summary>close_window</summary>
Expand Down
13 changes: 13 additions & 0 deletions doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 2.0.13, Aug 23, 2017</summary>
Highlights: show_page
<ul><li> <code>beep</code> fixed durations from ms to seconds in the examples.</li>

<li> Fixed test suite obj_sys_source_code item 5.</li>

<li> Fixed Sim pane Dexter videos, Dexter Photo.

<li><show_web_page renamed to <code>show_page</code> and now works.
It is now documented in Ref Man/Window/show_page</li>
</ul>
</details>

<details class="doc_details"><summary>v 2.0.12, Aug 22, 2017</summary>
Highlights: UI Tweaks and minor bug fixes.
<ul><li> Spurious printout of matrix from Kinematics code removed.</li>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
<li id="window_close_all_id" title="Closes all open 'show_windows'.&#013;Does not insert code into Editor.">Close all</li>
</ul>
</li>
<li id="show_web_page_id" title="Open a browser window on the given url.">show_web_page(...)</li>
<li id="show_page_id" title="Open a browser window on the given url.">show_page(...)</li>
<li id="get_page_id" title="Retrieves the content of&#013;a web page or data service.">get_page</li>
<li>Sound
<ul>
Expand Down Expand Up @@ -642,7 +642,7 @@
<option value='All'>All</option>
<option value='None'>None</option>
<option value='http://hdrobotic.com/videos/'>Dexter Videos</option>
<option value='http://static1.squarespace.com/static/55f1275ee4b0c65e2113baa5/563c04f5e4b0904f35c87cbb/563c0973e4b06c4bb72a5c89/1446775444596/HD+Robotics-8517.jpg?format=750w'>Dexter Photo</option>
<option value='http://static1.squarespace.com/static/55f1275ee4b0c65e2113baa5/563c04f5e4b0904f35c87cbb/563c0973e4b06c4bb72a5c89/1446775444596/HD+Robotics-8517.jpg'>Dexter Photo</option>
<!--<option value=''>Measurements Video</option>-->
</select>
<button id="demo_id" title="Moves graphical depiction of Dexter randomly." style="padding:2px">Demo</button>
Expand Down
10 changes: 5 additions & 5 deletions job_examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ beep({frequency: 330, callback: function(){beep({frequency: 220})}})
for the same instrution.*/
function my_waiting_beeper(){
var job_instance = this
beep({duration: 1000, callback: function(){job_instance.set_up_next_do()}})
beep({duration: 1, callback: function(){job_instance.set_up_next_do()}})
return "dont_call_set_up_next_do"
}
/* Now our Job definition can just list 2 references to the
Expand All @@ -447,8 +447,8 @@ Job.my_job.start()
function my_waiting_chording_beeper(){
var job_instance = this
beep({duration: 1000, frequency: 600})
beep({duration: 1000, callback: function(){job_instance.set_up_next_do()}})
beep({duration: 1, frequency: 600})
beep({duration: 1, callback: function(){job_instance.set_up_next_do()}})
return "dont_call_set_up_next_do"
}
Expand All @@ -465,8 +465,8 @@ Job.my_job.start()
One last fun audio trick: play a chord with the two notes being very close
in frequency to each other for the 'beating' effect. */
beep({frequency: 440, duration: 5000})
beep({frequency: 440.5, duration: 5000})
beep({frequency: 440, duration: 1})
beep({frequency: 440.5, duration: 1})
`,
`/* Job Example 10 Serial Port
Connections between different devices are often problematic,
Expand Down
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ ipc.on('get_page', function(event, url_or_options){
catch(err) { event.returnValue = "Error: " + err}
})

ipc.on('show_page', function(event, url, options={width: 800, height: 600}){
try{
let win = new BrowserWindow(options)
win.loadURL(url)
win.show()
event.returnValue = null
}
catch(err) { evnt.return_value = "Error: " + err }
})

// see https://github.com/konsumer/electron-prompt/blob/master/main.js
// prompt normally not supported by Electron, but this clever implementation works
var promptResponse
Expand Down
11 changes: 6 additions & 5 deletions output.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ window.beeps = beeps
window.audioCtx = new window.AudioContext()
/*
function beep(keyword_args={}){
var defaults = {duration: 500, frequency: 440, volume: 1, waveform: "triangle", callback: null}
var defaults = {duration: 1, frequency: 440, volume: 1, waveform: "triangle", callback: null}
copy_missing_fields(defaults, keyword_args)
var oscillator = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
Expand Down Expand Up @@ -1052,15 +1052,16 @@ window.beep = beep
beep_snd.play();
}
*/
//________show_web_page__________
function show_web_page(url){
//________show_page__________
function show_page(url, options={x:100, y:100, width: 800, height: 600}){
if (url.indexOf("://") == -1){
url = "http://" + url
}
window.open(url) //show_url(url)
// window.open(url) //show_url(url) //fails in electron
ipcRenderer.sendSync('show_page', url, options) //see main.js "show_page"
return url
}
window.show_web_page = show_web_page
window.show_page = show_page


/*
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "dexter_dev_env",
"productName": "dexter_dev_env",
"version": "2.0.12",
"release_date": "Aug 22, 2017",
"version": "2.0.13",
"release_date": "Aug 23, 2017",
"description": "Dexter Development Environment",
"author": "Fry",
"license": "GPL-3.0",
Expand Down
6 changes: 3 additions & 3 deletions ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
}
/*dde_overview_id.onclick = function() {
//window.open("here is text") //dde_paper_text)
//show_web_page('Dexter Development Environment.html')
//show_page('Dexter Development Environment.html')
//my_dialog_id.innerHTML = "<iframe>" + dde_paper_text + "</iframe>"
//my_dialog_id.showModal()
//window.open("doc/Dexter_Development_Environment.html") //permissions error
Expand Down Expand Up @@ -705,7 +705,7 @@ show_window({
`)}
build_window_id.onclick=ab.launch
window_close_all_id.onclick=close_all_show_windows
show_web_page_id.onclick=function(){Editor.wrap_around_selection('show_web_page(', ')\n', '"hdrobotic.com"')}
show_page_id.onclick=function(){Editor.wrap_around_selection('show_page(', ')\n', '"hdrobotic.com"')}

get_page_id.onclick=function(){Editor.insert(
`//Return the content of the given URL.
Expand Down Expand Up @@ -734,7 +734,7 @@ get_page_async("http://www.ibm.com", function(err, response, body){ out(body.len

beep_id.onclick = function(){Editor.insert("beep()\n")}
beep_options_id.onclick = function(){Editor.insert(
`beep({duration: 500, //the default, in milliseconds,
`beep({duration: 0.5, //the default,,
frequency: 440, //the default, in Hertz. This is A above middle C.
volume: 1, //the default, 0 to 1
waveform: "triangle", //the default, other choices: "sine", "square", "sawtooth"
Expand Down
4 changes: 2 additions & 2 deletions series.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ Series.instances = [
}
}),
//note that choose_file_and_get_content and get_page are really INPUT functions. change name of series to io or make a new input series?
new Series({id:"series_output_id", array: ['beep', 'beeps', 'Editor.insert', 'get_page', 'get_page_async','make_url', 'out', 'show_web_page', 'speak', 'recognize_speech'],
menu_insertion_string: "beep({duration: 500, frequency: 440, volume: 1})",
new Series({id:"series_output_id", array: ['beep', 'beeps', 'Editor.insert', 'get_page', 'get_page_async','make_url', 'out', 'show_page', 'speak', 'recognize_speech'],
menu_insertion_string: "beep({duration: 1, frequency: 440, volume: 1})",
menu_sel_start:0, menu_sel_end:4, sample: "beep"}),
new Series({id:"series_window_id", array: ['close_window', 'show_window',
'append_in_ui', 'get_in_ui', 'remove_in_ui', 'replace_in_ui', 'set_in_ui',
Expand Down
4 changes: 2 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,9 @@ function stringify_value_aux (value, job, depth=0){
function stringify_value_sans_html(value){
let result = stringify_value(value)
//result = replace_substrings(result, "<co" + "de>", "") //screws up inspetion of this fn (while inspecting 'window') having '<co de>' in it. //
result.replace(/<code>/g, "")
result = result.replace(/<code>/g, "")
//result = replace_substrings(result, "</co" + "de>", "") //
result.replace(/<\/code>/g, "")
result = result.replace(/<\/code>/g, "")
result = result.replace(/<br\/>/g, "\n")
result = result.replace(/&nbsp;/g, " ")
return result
Expand Down
2 changes: 1 addition & 1 deletion video.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
else {
//play_youtube_video(select_val)
show_web_page(select_val)
show_page(select_val)
}
}
//function show_url(url){
Expand Down

0 comments on commit 6c0566a

Please sign in to comment.