File tree Expand file tree Collapse file tree 5 files changed +25
-5
lines changed Expand file tree Collapse file tree 5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
3
< head >
4
- < title > SQLPrepareStatementPertify </ title >
4
+ < title > SQL Prepared Statement Beautify </ title >
5
5
< link rel ="stylesheet " href ="styles/primer.css ">
6
6
< link rel ="stylesheet " href ="styles/styles.css ">
7
7
12
12
13
13
< body >
14
14
< header class ="header gradient text-center ">
15
- < h1 id ="title_hd " class ="title "> SQL Prepared Statement Pertify </ h1 >
15
+ < h1 id ="title_hd " class ="title "> SQL Prepared Statement Beautify </ h1 >
16
16
17
- < h2 class ="subtitle "> Copy your prepare statement,pertify and run .Its Easy</ h2 >
17
+ < h2 class ="subtitle "> Copy your sql prepared statement,beautify and copy .Its Easy</ h2 >
18
18
</ header >
19
19
20
+ < div id ="main " class ="main_section ">
21
+
20
22
< div id ="IpScript ">
21
23
< textarea id ="textAreaInpScript " placeholder ="Enter your script here! "> </ textarea >
24
+ </ div >
22
25
23
- < button id ="btn_pertify " class ="btn " data-clipboard-action ="copy " data-clipboard-target ="#textAreaOupScript "> Pertify&Copy</ button >
26
+ < div class ="btn_bar ">
27
+ < button id ="btn_pertify_copy " class ="btn " data-clipboard-action ="copy " data-clipboard-target ="#textAreaOupScript "> Beautify&Copy</ button >
28
+ < button id ="btn_pertify " class ="btn "> Beautify</ button >
29
+ < button id ="btn_copy " class ="btn " data-clipboard-action ="copy " data-clipboard-target ="#textAreaOupScript "> Copy</ button >
24
30
</ div >
25
31
26
32
< div >
27
33
< textarea id ="textAreaOupScript " placeholder ="Output! "> </ textarea >
28
34
</ div >
35
+
36
+ </ div >
29
37
</ body >
30
38
</ html >
Original file line number Diff line number Diff line change 7
7
8
8
$ ( document ) . ready ( function ( ) {
9
9
console . log ( "ready!" ) ;
10
+ $ ( '#btn_pertify_copy' ) . click ( onBtnPertifyClick ) ;
10
11
$ ( '#btn_pertify' ) . click ( onBtnPertifyClick ) ;
11
-
12
12
var clipboard = new Clipboard ( '.btn' ) ;
13
13
} ) ;
14
14
15
15
function onBtnPertifyClick ( ) {
16
16
var sInput = $ ( '#textAreaInpScript' ) . val ( ) ;
17
+ sInput = _removeLineBreaks ( sInput ) ;
17
18
var sSqlPrep = _extractPrepQueryFromInput ( sInput ) ;
18
19
var aColPorperties = _extractArrayOfDataFromInput ( sInput ) ;
19
20
@@ -44,4 +45,7 @@ function _prepareQuery(sQueryPrep,aQueryArgs){
44
45
return final_query ;
45
46
}
46
47
48
+ function _removeLineBreaks ( sInput ) {
49
+ return sInput . replace ( / ( \r \n | \n | \r ) / gm, "" ) ;
50
+ }
47
51
} ) ( window ) ;
Original file line number Diff line number Diff line change @@ -284,3 +284,11 @@ code {
284
284
font-size : 22px ;
285
285
}
286
286
}
287
+
288
+ .main_section {
289
+ padding : 15px 10px ;
290
+ }
291
+
292
+ .btn_bar {
293
+ padding : 10px 0px ;
294
+ }
You can’t perform that action at this time.
0 commit comments