18
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 84332ad..94434ce 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,6 +4,7 @@
<list default="true" id="ab19ce1b-f89c-47e9-85b3-501caccc0201" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/eventsHandler.js" afterPath="$PROJECT_DIR$/public/eventsHandler.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/routes/index.js" afterPath="$PROJECT_DIR$/routes/index.js" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="intelIoTHackathon.iws" />
<ignored path=".idea/workspace.xml" />
@@ -44,11 +45,11 @@
</provider>
</entry>
</file>
- <file leaf-file-name="index.js" pinned="false" current-in-tab="true">
+ <file leaf-file-name="index.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/index.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.75">
- <caret line="70" column="35" selection-start-line="70" selection-start-column="35" selection-end-line="70" selection-end-column="35" />
+ <state vertical-scroll-proportion="0.0">
+ <caret line="49" column="25" selection-start-line="49" selection-start-column="25" selection-end-line="49" selection-end-column="25" />
<folding />
</state>
</provider>
@@ -96,17 +97,17 @@
<entry file="file://$PROJECT_DIR$/public/eventsHandler.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
- <caret line="10" column="34" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" />
+ <caret line="18" column="20" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="styles.css" pinned="false" current-in-tab="false">
+ <file leaf-file-name="styles.css" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/public/style/styles.css">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0">
- <caret line="25" column="18" selection-start-line="25" selection-start-column="18" selection-end-line="25" selection-end-column="18" />
+ <state vertical-scroll-proportion="0.78125">
+ <caret line="25" column="17" selection-start-line="25" selection-start-column="17" selection-end-line="25" selection-end-column="17" />
<folding />
</state>
</provider>
@@ -125,7 +126,7 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
- <setting file="dummy://restClient/response27.txt" root0="SKIP_INSPECTION" />
+ <setting file="dummy://restClient/response31.txt" root0="SKIP_INSPECTION" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
@@ -138,9 +139,9 @@
<option value="$PROJECT_DIR$/views/index.ejs" />
<option value="$PROJECT_DIR$/public/styles.css" />
<option value="$PROJECT_DIR$/views/mapp.ejs" />
- <option value="$PROJECT_DIR$/public/style/styles.css" />
- <option value="$PROJECT_DIR$/public/eventsHandler.js" />
<option value="$PROJECT_DIR$/routes/index.js" />
+ <option value="$PROJECT_DIR$/public/eventsHandler.js" />
+ <option value="$PROJECT_DIR$/public/style/styles.css" />
</list>
</option>
</component>
@@ -152,8 +153,7 @@
<order />
</component>
<component name="ProjectFrameBounds">
- <option name="x" value="62" />
- <option name="y" value="59" />
+ <option name="y" value="17" />
<option name="width" value="1440" />
<option name="height" value="850" />
</component>
@@ -715,7 +715,7 @@
<servers />
</component>
<component name="ToolWindowManager">
- <frame x="62" y="59" width="1440" height="850" extended-state="6" />
+ <frame x="0" y="17" width="1440" height="850" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="REST Client" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@@ -937,14 +937,6 @@
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/style/styles.css">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0">
- <caret line="25" column="18" selection-start-line="25" selection-start-column="18" selection-end-line="25" selection-end-column="18" />
- <folding />
- </state>
- </provider>
- </entry>
<entry file="file://$PROJECT_DIR$/views/layout/lkLayout.ejs">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-1.875">
@@ -969,18 +961,26 @@
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/eventsHandler.js">
+ <entry file="file://$PROJECT_DIR$/routes/index.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
- <caret line="10" column="34" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" />
+ <caret line="49" column="25" selection-start-line="49" selection-start-column="25" selection-end-line="49" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/routes/index.js">
+ <entry file="file://$PROJECT_DIR$/public/eventsHandler.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.75">
- <caret line="70" column="35" selection-start-line="70" selection-start-column="35" selection-end-line="70" selection-end-column="35" />
+ <state vertical-scroll-proportion="0.0">
+ <caret line="18" column="20" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/public/style/styles.css">
+ <provider selected="true" editor-type-id="text-editor">
+ <state vertical-scroll-proportion="0.78125">
+ <caret line="25" column="17" selection-start-line="25" selection-start-column="17" selection-end-line="25" selection-end-column="17" />
<folding />
</state>
</provider>
diff --git a/public/eventsHandler.js b/public/eventsHandler.js
index 5b52b14..a2c3d65 100644
--- a/public/eventsHandler.js
+++ b/public/eventsHandler.js
@@ -13,20 +13,23 @@
$('#reserve').click(function(){
- if(reserve) {
- $('#alert').html("Нельзя бронировать больше одного места");
+ if(window.reserve) {
+ $('.alert').html("Нельзя бронировать больше одного места");
setTimeout(function(){
- $('#alert').html("Для Вас забронировано 1 место");
+ $('.alert').html("Для Вас забронировано 1 место");
}, 2000);
return false;
}
+ console.log('1');
$.ajax({
url:"/bookPlace",
method:"POST",
success:function(){
- $('#alert').html("Мы забронировали Вам место!").fadeIn(300);
+ console.log('2');
+ $('.alert').html("Мы забронировали Вам место!").fadeIn(300);
+ window.reserve = true;
setTimeout(function(){
- $('#alert').html("Для Вас забронировано 1 место");
+ $('.alert').html("Для Вас забронировано 1 место");
}, 2000);
}
});
diff --git a/routes/index.js b/routes/index.js
index 9471e6b..420026c 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -68,7 +68,6 @@
prevParkingContext = newParkingContext;
prevParkingContext.reserved = reserve;
prevParkingContext.freeSpaces = getFreePlaces();
- console.log(newParkingContext);
}
function getFreePlaces(){