diff --git a/.towns.html.un~ b/.towns.html.un~ new file mode 100644 index 0000000..af9553c Binary files /dev/null and b/.towns.html.un~ differ diff --git a/.towns.js.un~ b/.towns.js.un~ new file mode 100644 index 0000000..86a35f5 Binary files /dev/null and b/.towns.js.un~ differ diff --git a/README.md b/README.md index 4abcf1f..4fc677d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # Towns for SoftUni Code for the Git and GitHub Exercise + +#me - Editor +#jenkins - Shuffler +#docker - Styler diff --git a/final-result.png b/final-result.png new file mode 100644 index 0000000..7df2372 Binary files /dev/null and b/final-result.png differ diff --git a/towns.css b/towns.css index 3f23d97..bf3dfb8 100644 --- a/towns.css +++ b/towns.css @@ -1,3 +1,3 @@ -select, input { - width: 100px; -} \ No newline at end of file +@import url('https://fonts.googleapis.com/css?family=Rubik'); body { font-family: 'Rubik', sans-serif; } * { box-sizing: content-box; } article { background: #CCC; width: 180px; padding: 10px; margin: 10px; display: inline-block; vertical-align: top; } article>header { background: #5F5F5F; color: white; margin: 0px 0px 10px 0px; padding: 4px 6px; } + +article>header>h1 { margin: 0px; } article>select { width: 178px; } article>input { width: 176px; } article>button { display: block; margin: 10px auto 0px auto; border: none; border-radius: 3px; padding: 5px 15px; background: green; color: white; font-weight: bold; } article>button:hover { box-shadow: 0px 0px 10px white; cursor: pointer; } button#btnDelete { background: red; } #result { display: none; width: 50%; margin: 10px auto; padding: 10px 15px; background: #DDD; border-radius: 5px; border: 1px solid #777; } diff --git a/towns.html b/towns.html index d7a7960..b102502 100644 --- a/towns.html +++ b/towns.html @@ -6,24 +6,32 @@ + -

Towns

+
+
Towns
+
-
+
+
Delete Existing Town
-
+ + + + +
- \ No newline at end of file + diff --git a/towns.html~ b/towns.html~ new file mode 100644 index 0000000..d7a7960 --- /dev/null +++ b/towns.html~ @@ -0,0 +1,29 @@ + + + + + Towns + + + + + + + +

Towns

+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/towns.js b/towns.js index 6f50af6..d9511a4 100644 --- a/towns.js +++ b/towns.js @@ -1,5 +1,7 @@ $(document).ready(function() { - $('#btnDelete').click(deleteTown) + $('#btnDelete').click(deleteTown); + $('#btnAdd').click(addTown); + $('#btnShuffle').click(shuffleTowns); }); function deleteTown() { @@ -13,7 +15,41 @@ function deleteTown() { } } if (removed) - $('#result').text(townName + " deleted."); + showMessage(townName + " deleted."); else - $('#result').text(townName + " not found."); + showMessage(townName + " not found."); +} + +//this is the second part of the task performed by the Styler +function showMessage(msg) { + $('#result').text(msg).css("display", "block"); + setTimeout(function () { + $('#result').hide('blind', {}, 500); +}, 3000); +} + +//this is intended by the Shuffler on jenkinsVM +function addTown() { + let townName = $('#townNameForAdd').val(); + $('#townNameForAdd').val(''); + $('#towns').append($('