Skip to content

Commit 90f1bc0

Browse files
Merge pull request #1 from sibyaugustine/WAVE1
Wave1
2 parents be5773a + 490ade5 commit 90f1bc0

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

assets/icon_128.png

5.45 KB
Loading

assets/icon_16.png

961 Bytes
Loading

index.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>SQLPrepareStatementPertify</title>
4+
<title>SQL Prepared Statement Beautify</title>
55
<link rel="stylesheet" href="styles/primer.css">
66
<link rel="stylesheet" href="styles/styles.css">
77

@@ -12,19 +12,27 @@
1212

1313
<body>
1414
<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>
1616

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>
1818
</header>
1919

20+
<div id ="main" class="main_section">
21+
2022
<div id="IpScript">
2123
<textarea id="textAreaInpScript" placeholder="Enter your script here!"></textarea>
24+
</div>
2225

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>
2430
</div>
2531

2632
<div>
2733
<textarea id="textAreaOupScript" placeholder="Output!"></textarea>
2834
</div>
35+
36+
</div>
2937
</body>
3038
</html>

script/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77

88
$( document ).ready(function() {
99
console.log( "ready!" );
10+
$('#btn_pertify_copy').click(onBtnPertifyClick);
1011
$('#btn_pertify').click(onBtnPertifyClick);
11-
1212
var clipboard = new Clipboard('.btn');
1313
});
1414

1515
function onBtnPertifyClick(){
1616
var sInput = $('#textAreaInpScript').val();
17+
sInput = _removeLineBreaks(sInput);
1718
var sSqlPrep = _extractPrepQueryFromInput(sInput);
1819
var aColPorperties = _extractArrayOfDataFromInput(sInput);
1920

@@ -44,4 +45,7 @@ function _prepareQuery(sQueryPrep,aQueryArgs){
4445
return final_query;
4546
}
4647

48+
function _removeLineBreaks(sInput){
49+
return sInput.replace(/(\r\n|\n|\r)/gm,"");
50+
}
4751
})(window);

styles/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,11 @@ code {
284284
font-size: 22px;
285285
}
286286
}
287+
288+
.main_section{
289+
padding: 15px 10px;
290+
}
291+
292+
.btn_bar{
293+
padding: 10px 0px;
294+
}

0 commit comments

Comments
 (0)