Skip to content

Commit 64573be

Browse files
committed
Delete buttons
1 parent b9ff292 commit 64573be

File tree

5 files changed

+42
-20
lines changed

5 files changed

+42
-20
lines changed

php/_basic_tasks.php

+22-8
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
if(isset($_GET['path'])) $path = urldecode($_GET['path']);
198198
else $path = '';
199199

200-
$text_help_file = $bp_application_path."BP2_help.txt";
200+
$text_help_file = $bp_application_path."BP2_help.txt"; // Name should be updated to BP3
201201

202202
if($test) {
203203
echo "<small>";
@@ -596,8 +596,10 @@ function compile_help($text_help_file,$html_help_file) {
596596
}
597597
$title[$i] = $thetitle;
598598
$item[$i] = '';
599-
for($j = 1; $j < count($table2); $j++)
600-
$item[$i] .= $table2[$j]."<br />";
599+
for($j = 1; $j < count($table2); $j++) {
600+
$item_line = make_links_clickable($table2[$j]);
601+
$item[$i] .= $item_line."<br />";
602+
}
601603
}
602604
fwrite($handle,$file_header."\n");
603605
$table_of_contents = "<table style=\"border-spacing: 2px;\" cellpadding=\"2px;\"><tr>";
@@ -638,7 +640,7 @@ function compile_help($text_help_file,$html_help_file) {
638640
function link_to_help() {
639641
global $html_help_file;
640642
$console_link = "produce.php?instruction=help";
641-
$link = "<p>➡ <a onclick=\"window.open('".$html_help_file."','Help','width=800,height=500'); return false;\" href=\"".$html_help_file."\">Display complete help file</a> or the console's <a href=\"".$console_link."\" onclick=\"window.open('".$console_link."','help','width=800,height=800,left=200'); return false;\">help file</a></p>";
643+
$link = "<p>➡ Display <a href=\"".$console_link."\" onclick=\"window.open('".$console_link."','help','width=800,height=800,left=200'); return false;\">console's</a> instructions or the <a onclick=\"window.open('".$html_help_file."','Help','width=800,height=500'); return false;\" href=\"".$html_help_file."\">complete help file</a></p>";
642644
return $link;
643645
}
644646

@@ -3723,7 +3725,7 @@ function filter_form_output($i) {
37233725
global $NoteOffFilter_out, $NoteOnFilter_out, $KeyPressureFilter_out, $ControlChangeFilter_out, $ProgramChangeFilter_out, $ChannelPressureFilter_out, $PitchBendFilter_out, $SystemExclusiveFilter_out, $TimeCodeFilter_out, $SongPositionFilter_out, $SongSelectFilter_out, $TuneRequestFilter_out, $EndSysExFilter_out, $TimingClockFilter_out, $StartFilter_out, $ContinueFilter_out, $ActiveSensingFilter_out, $SystemResetFilter_out;
37243726
global $url_this_page, $MIDIoutput;
37253727
echo "<div id=\"showhide_output".$i."\" style=\"background-color: Snow; width:300px;\">";
3726-
echo "<input style=\"background-color:yellow;\" type=\"submit\" onclick=\"clearsave();\" formaction=\"".$url_this_page."\" name=\"savemidiport\" value=\"SAVE MIDI ports\">";
3728+
echo "<input style=\"background-color:yellow;\" type=\"submit\" formaction=\"".$url_this_page."\" name=\"savemidiport\" value=\"SAVE MIDI ports\">";
37273729
echo "<p style=\"margin-left:12px;\"><b>Filter for MIDI output ".$MIDIoutput[$i]."</b></p>";
37283730
echo "<table style=\"background-color:azure;\">";
37293731
echo "<tr>";
@@ -3884,12 +3886,13 @@ function display_midi_ports($filename) {
38843886
echo "MIDI output&nbsp;&nbsp;<input type=\"text\" title=\"".$text_over_number."\" onchange=\"tellsave()\" name=\"MIDIoutput_".$i."\" size=\"2\" value=\"".$value."\">";
38853887
echo "&nbsp;<input type=\"text\" title=\"".$text_over_name."\" style=\"margin-bottom:6px;\" onchange=\"tellsave()\" name=\"MIDIoutputname_".$i."\" size=\"15\" value=\"".$MIDIoutputname[$i]."\">";
38863888
echo "&nbsp;<input type=\"text\" title=\"".$text_over_comment."\" name=\"MIDIoutputcomment_".$i."\" size=\"15\" value=\"".$comment."\">";
3889+
echo "&nbsp;<button type=\"button\" onclick=\"clearFields('MIDIoutput_".$i."','MIDIoutputname_".$i."','MIDIoutputcomment_".$i."')\">Delete</button>";
38873890
echo "&nbsp;<button style=\"background-color:azure; border-radius: 6px;\" onclick=\"toggledisplay_output(".$i."); return false;\">FILTER</button>";
38883891
filter_form_output($i);
38893892
echo "<br />";
38903893
}
3891-
echo "<input style=\"float:right; color:DarkBlue; backgroundsave_-color:yellow;\" onclick=\"tellsave()\" type=\"submit\" name=\"create_output\" value=\"Add an output\"><br />";
3892-
echo "<input style=\"background-color:yellow;\" type=\"submit\" onclick=\"clearsave();\" formaction=\"".$url_this_page."\" name=\"savemidiport\" value=\"SAVE MIDI ports\">";
3894+
echo "<input style=\"float:right; color:DarkBlue; backgroundsave_-color:yellow;\" type=\"submit\" name=\"create_output\" value=\"Add an output\"><br />";
3895+
echo "<input style=\"background-color:yellow;\" type=\"submit\" formaction=\"".$url_this_page."\" name=\"savemidiport\" value=\"SAVE MIDI ports\">";
38933896
echo str_replace(' ',"&nbsp;"," 👉 Delete name if changing number")."<br /><br />";
38943897
for($i = 0; $i < $NumberMIDIinputs; $i++) {
38953898
if($MIDIinput[$i] == -1) $value = '';
@@ -3899,11 +3902,12 @@ function display_midi_ports($filename) {
38993902
echo "MIDI input&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"text\" title=\"".$text_over_number."\" onchange=\"tellsave()\" name=\"MIDIinput_".$i."\" size=\"2\" value=\"".$value."\">";
39003903
echo "&nbsp;<input type=\"text\" title=\"".$text_over_name."\" style=\"margin-bottom:6px;\" onchange=\"tellsave()\" name=\"MIDIinputname_".$i."\" size=\"15\" value=\"".$MIDIinputname[$i]."\">";
39013904
echo "&nbsp;<input type=\"text\" title=\"".$text_over_comment."\" name=\"MIDIinputcomment_".$i."\" size=\"15\" value=\"".$comment."\">";
3905+
echo "&nbsp;<button type=\"button\" onclick=\"clearFields('MIDIinput_".$i."', 'MIDIinputname_".$i."', 'MIDIinputcomment_".$i."')\">Delete</button>";
39023906
echo "&nbsp;<button style=\"background-color:azure; border-radius: 6px;\" onclick=\"toggledisplay_input(".$i."); return false;\">FILTER</button>";
39033907
filter_form_input($i);
39043908
echo "<br />";
39053909
}
3906-
echo "<input style=\"float:right; color:DarkBlue; backgroundsave_-color:yellow;\" onclick=\"tellsave()\" type=\"submit\" name=\"create_input\" value=\"Add an input\">";
3910+
echo "<input style=\"float:right; color:DarkBlue; backgroundsave_-color:yellow;\" type=\"submit\" name=\"create_input\" value=\"Add an input\">";
39073911
return;
39083912
}
39093913

@@ -4111,4 +4115,14 @@ function update_scale_with_kbm($scl_name,$scale_file,$kbm_content) {
41114115
$kbm_error = '';
41124116
return $kbm_error;
41134117
}
4118+
4119+
function make_links_clickable($text) {
4120+
$pattern = '/\b(?:https?|ftp):\/\/[a-zA-Z0-9-_.]+(?:\.[a-zA-Z0-9-_.]+)+(?:\/[^\s]*)?/';
4121+
$text_with_links = preg_replace_callback($pattern, function($matches) {
4122+
$url = $matches[0];
4123+
return '<a href="'.$url.'" target="_blank">'.$url.'</a>';
4124+
}, $text);
4125+
return $text_with_links;
4126+
}
4127+
41144128
?>

php/_header.php

+8
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@
202202
echo "}
203203
</script>";
204204

205+
echo "<script>";
206+
echo "function clearFields(inputId, nameId, commentId) {
207+
document.getElementsByName(inputId)[0].value = \"\";
208+
document.getElementsByName(nameId)[0].value = \"\";
209+
document.getElementsByName(commentId)[0].value = \"\";\n";
210+
echo "}
211+
</script>";
212+
205213
echo "</head>";
206214
echo "<body>\n";
207215
?>

php/data.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1480,9 +1480,9 @@
14801480

14811481
find_replace_form();
14821482

1483-
echo "<div style=\"float:right; vertical-align:middle;\">Import MusicXML: <input style=\"color:red;\" type=\"file\" name=\"music_xml_import\">&nbsp;<input type=\"submit\" style=\"background-color:AquaMarine;\" value=\"← IMPORT\"></div>";
1483+
echo "<div style=\"float:right; vertical-align:middle;\">Import MusicXML: <input style=\"color:red;\" onclick=\"if(!checksaved()) return false;\" type=\"file\" name=\"music_xml_import\">&nbsp;<input type=\"submit\" onclick=\"if(!checksaved()) return false;\" style=\"background-color:AquaMarine;\" value=\"← IMPORT\"></div>";
14841484

1485-
echo "<div style=\"text-align:left;\"><input id=\"saveButton\" style=\"background-color:yellow; font-size:large;\" type=\"submit\" onclick=\"clearsave();\" formaction=\"".$url_this_page."\" name=\"savethisfile\" value=\"SAVE ‘".$filename."\"></div>";
1485+
echo "<div style=\"text-align:left;\"><input id=\"saveButton\" style=\"background-color:yellow; font-size:large;\" type=\"submit\" onclick=\"clearsave();\" formaction=\"".$url_this_page."#topedit\" name=\"savethisfile\" value=\"SAVE ‘".$filename."\"></div>";
14861486

14871487
$content = do_replace($content);
14881488

php/grammar.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$temp_midi_ressources = $temp_dir."trace_".my_session_id()."_".$filename."_";
5555

5656
$url = "index.php?path=".urlencode($current_directory);
57-
echo "<p>Workspace = <input style=\"background-color:azure;\" name=\"workspace\" type=\"submit\" onmouseover=\"checksaved();\" onclick=\"if(checksaved()) window.open('".$url."','_self');\" value=\"".$current_directory."\">";
57+
echo "<p>Workspace = <input style=\"background-color:azure;\" name=\"workspace\" type=\"submit\" onclick=\"if(checksaved()) window.open('".$url."','_self');\" value=\"".$current_directory."\">";
5858
// echo "&nbsp;&nbsp;session_id = ".my_session_id();
5959

6060
$hide = $need_to_save = FALSE;
@@ -480,7 +480,7 @@
480480
// $link_produce .= "&trace_production=1";
481481
$link_produce .= "&here=".urlencode($here);
482482
$window_name = window_name($filename);
483-
echo "<input style=\"color:DarkBlue; background-color:azure;\" onmouseover=\"checksaved();\" onclick=\"if(checksaved()) window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;\" type=\"submit\" name=\"produce\" value=\"CHECK TEMPLATES\"><br /><br />";
483+
echo "<input style=\"color:DarkBlue; background-color:azure;\" onclick=\"if(checksaved()) window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;\" type=\"submit\" name=\"produce\" value=\"CHECK TEMPLATES\"><br /><br />";
484484
}
485485

486486
if($produce_all_items > 0) $action = "produce-all";
@@ -548,7 +548,7 @@
548548
echo "<b>then…</b>";
549549
if($file_format == "rtmidi" AND file_exists($refresh_file)) $refresh_instruction = "document.getElementById('refresh').style.display = 'inline';";
550550
else $refresh_instruction = '';
551-
echo "&nbsp;<input onmouseover=\"checksaved();\" onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)\"";
551+
echo "&nbsp;<input onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)\"";
552552
if($error) echo " disabled style=\"background-color:azure; box-shadow: none;\"";
553553
else echo " style=\"color:DarkBlue; background-color:Aquamarine;\"";
554554
echo ">";
@@ -699,7 +699,7 @@
699699
echo "&nbsp;&nbsp;&nbsp;<input style=\"color:DarkBlue; background-color:azure; font-size:large;\" onclick=\"window.open('".$result_file."','result','width=800,height=600,left=100'); return false;\" type=\"submit\" name=\"produce\" value=\"Show latests results\">";
700700
}
701701
echo "&nbsp;<input style=\"background-color:azure; font-size:large;\" type=\"submit\" onclick=\"clearsave();\" name=\"compilegrammar\" value=\"COMPILE GRAMMAR\">";
702-
echo "&nbsp;<input onmouseover=\"checksaved();\" onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)";
702+
echo "&nbsp;<input onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)";
703703
if($error) {
704704
echo " - disabled because of missing files\"";
705705
echo " disabled style=\"background-color:azure; box-shadow: none; font-size:large;\"";
@@ -720,7 +720,7 @@
720720
echo "<p style=\"float:right; margin-right:100px;\"><input style=\"background-color:yellow; font-size:large;\" type=\"submit\" onclick=\"clearsave();\" formaction=\"".$url_this_page."#topedit\" name=\"savethisfile\" value=\"SAVE ‘".$filename."\"></p>";
721721
// echo "</div>";
722722
echo "<div>";
723-
echo "<input onmouseover=\"checksaved();\" onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)";
723+
echo "<input onclick=\"if(checksaved()) {".$refresh_instruction." window.open('".$link_produce."','".$window_name."','width=800,height=800,left=200'); return false;}\" type=\"submit\" name=\"produce\" value=\"PRODUCE ITEM(s)";
724724
if($error) {
725725
echo " - disabled because of missing files\"";
726726
echo " disabled style=\"background-color:azure; box-shadow: none; font-size:large;\"";
@@ -786,7 +786,7 @@
786786
fclose($handle);
787787
$link_play_variable = $link_produce;
788788
$link_play_variable .= "&data=".urlencode($data);
789-
echo "<input style=\"color:DarkBlue; background-color:Aquamarine;\" onmouseover=\"checksaved();\" onclick=\"if(checksaved()) window.open('".$link_play_variable."','".$window_name."','width=800,height=800,left=200'); return false;\" type=\"submit\" value=\"".$var."\"> ";
789+
echo "<input style=\"color:DarkBlue; background-color:Aquamarine;\" onclick=\"if(checksaved()) window.open('".$link_play_variable."','".$window_name."','width=800,height=800,left=200'); return false;\" type=\"submit\" value=\"".$var."\"> ";
790790
}
791791
}
792792

@@ -932,15 +932,15 @@
932932
}
933933
}
934934
echo "</tr>";
935-
echo "<tr><td></td><td></td><td><input style=\"background-color:cornsilk;\" type=\"submit\" onclick=\"this.form.target='_self';return true;\" name=\"\" value=\"CANCEL\"></td><td><input style=\"background-color:Aquamarine;\" type=\"submit\" onmouseover=\"checksaved();\" onclick=\"if(checksaved()) {this.form.target='_self'; return true;} else return false;\" name=\"apply_changes_instructions\" formaction=\"".$url_this_page."#topedition\" value=\"APPLY THESE CHANGES\"></td></tr>";
935+
echo "<tr><td></td><td></td><td><input style=\"background-color:cornsilk;\" type=\"submit\" onclick=\"this.form.target='_self';return true;\" name=\"\" value=\"CANCEL\"></td><td><input style=\"background-color:Aquamarine;\" type=\"submit\" onclick=\"if(checksaved()) {this.form.target='_self'; return true;} else return false;\" name=\"apply_changes_instructions\" formaction=\"".$url_this_page."#topedition\" value=\"APPLY THESE CHANGES\"></td></tr>";
936936
echo "</table>";
937937
$hide = TRUE;
938938
}
939939
if(!$hide) {
940940
echo "<table style=\"background-color:white; border-radius: 15px;\">";
941941
echo "<tr>";
942942
echo "<td style=\"vertical-align:middle; white-space:nowrap;\">";
943-
echo "<input style=\"background-color:Aquamarine;\" type=\"submit\" onmouseover=\"checksaved();\" onclick=\"if(checksaved()) {this.form.target='_self';return true;} else return false;\" name=\"change_convention\" formaction=\"".$url_this_page."#topchanges\" value=\"APPLY NOTE CONVENTION to this data\"> ➡</td>";
943+
echo "<input style=\"background-color:Aquamarine;\" type=\"submit\" onclick=\"if(checksaved()) {this.form.target='_self';return true;} else return false;\" name=\"change_convention\" formaction=\"".$url_this_page."#topchanges\" value=\"APPLY NOTE CONVENTION to this data\"> ➡</td>";
944944
echo "<td style=\"vertical-align:middle; white-space:nowrap;\">";
945945
echo "<input type=\"radio\" name=\"new_convention\" value=\"0\">English<br />";
946946
echo "<input type=\"radio\" name=\"new_convention\" value=\"1\">Italian/Spanish/French<br />";

php/settings_names.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Time setting step (not implemented) 1 1
2525
Time setting trace 1 1
2626
Csound trace 1 1
2727
Use MIDI in/out 0 1
28-
Reset Notes Send AllNotesOff and pedals off at the end of item 1 1
28+
Reset Notes Send AllNotesOff, pedals off and reset pitchbend at the end of item 1 1
2929
Compute while playing 1 1
3030
Trace MIDI interactions 1 1
3131
Reset rule weights 1 1
@@ -62,7 +62,7 @@ ProgNrFrom 0
6262
Fade-out time seconds (end of MIDI files and Csound scores) 1
6363
C4 (middle C) key number (0..127) usually 60 1
6464
A4 frequency (diapason) Hz (usually 440) 1
65-
Strike again NoteOn's Keep checked unless you know why! 1 1
65+
Strike again NoteOn's Keep checked unless you know why! (Read https://bp3.tech/csound-checkup/) 1 1
6666
Default volume (1..127) 1
6767
Volume controller (0..127) usually 7 1
6868
Default velocity (1..127) 1

0 commit comments

Comments
 (0)