File tree Expand file tree Collapse file tree 3 files changed +44
-7
lines changed Expand file tree Collapse file tree 3 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 150
150
151
151
< div class ="row ">
152
152
< a class ="btn btn-primary " href ="select_file.dialog " role ="button "> Open File</ a >
153
- < a class ="btn btn-primary " href ="new_file_name .dialog " role ="button "> New File</ a >
153
+ < a class ="btn btn-primary " href ="new_file .dialog " role ="button "> New File</ a >
154
154
< a class ="btn btn-primary " href ="select_files.dialog "> Open Multiple Files</ a >
155
155
< a class ="btn btn-primary " href ="select_directory.dialog "> Open Directory</ a >
156
156
</ div >
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ open_directory.stdoutFunction = function (stdout) {
32
32
displayTestResult ( 'open-directory' , stdout ) ;
33
33
}
34
34
35
+ var create_file = { } ;
36
+ create_file . scriptRelativePath = 'perl-scripts/create-file.pl' ;
37
+ create_file . stdoutFunction = function ( stdout ) {
38
+ displayTestResult ( 'new-file' , stdout ) ;
39
+ }
40
+
35
41
var perl_info = { } ;
36
42
perl_info . scriptRelativePath = 'perl-scripts/perl-info.pl' ;
37
43
perl_info . stdoutFunction = function ( stdout ) {
@@ -59,13 +65,16 @@ select_file.receiverFunction = function (fileName) {
59
65
form . submit ( ) ;
60
66
}
61
67
62
- var new_file_name = { } ;
63
- new_file_name . type = 'new-file-name' ;
64
- new_file_name . receiverFunction = function ( fileName ) {
68
+ var new_file = { } ;
69
+ new_file . type = 'new-file-name' ;
70
+ new_file . receiverFunction = function ( fileName ) {
71
+ create_file . inputData = fileName ;
65
72
clearTestData ( ) ;
66
- var pre = document . createElement ( "pre" ) ;
67
- pre . innerHTML = 'New file name: ' + fileName ;
68
- document . getElementById ( 'tests' ) . appendChild ( pre ) ;
73
+
74
+ var form = document . createElement ( 'form' ) ;
75
+ form . setAttribute ( 'action' , 'create_file.script' ) ;
76
+ document . body . appendChild ( form ) ;
77
+ form . submit ( ) ;
69
78
}
70
79
71
80
var select_files = { } ;
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/perl
2
+
3
+ # Perl Executing Browser Demo
4
+
5
+ # This program is free software;
6
+ # you can redistribute it and/or modify it under the terms of the
7
+ # GNU Lesser General Public License,
8
+ # as published by the Free Software Foundation;
9
+ # either version 3 of the License, or (at your option) any later version.
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY;
12
+ # without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE.
14
+ # Dimitar D. Mitov, 2013 - 2019
15
+ # Valcho Nedelchev, 2014 - 2016
16
+ # https://github.com/ddmitov/perl-executing-browser
17
+
18
+ use strict;
19
+ use warnings;
20
+
21
+ my $filename = <STDIN >;
22
+ chomp $filename ;
23
+
24
+ open my $filehandle , ' >>' , $filename or warn " Unable to create $! " ;
25
+ print $filehandle " Pel Executing Browser Demo Test File" ;
26
+ close $filehandle ;
27
+
28
+ print " $filename is successfully created." ;
You can’t perform that action at this time.
0 commit comments