Commit bf5cbab8 authored by tobiasmeyrick's avatar tobiasmeyrick
Browse files

Added jQuery

parent 99fcd9b5
Pipeline #4048 passed with stage
in 2 seconds
......@@ -11,7 +11,12 @@
</component>
<component name="ChangeListManager">
<list default="true" id="07311041-3edc-4bfb-ad40-3329adf7b717" name="Default Changelist" comment="Validator script added for form on cart page">
<change afterPath="$PROJECT_DIR$/jquery.min.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cart.js" beforeDir="false" afterPath="$PROJECT_DIR$/cart.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/classic.html" beforeDir="false" afterPath="$PROJECT_DIR$/classic.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hitchcock.html" beforeDir="false" afterPath="$PROJECT_DIR$/hitchcock.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scifi.html" beforeDir="false" afterPath="$PROJECT_DIR$/scifi.html" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -69,7 +74,9 @@
<workItem from="1597290826993" duration="2674000" />
<workItem from="1597371395364" duration="1558000" />
<workItem from="1597374945985" duration="2896000" />
<workItem from="1597466095291" duration="5738000" />
<workItem from="1597466095291" duration="6101000" />
<workItem from="1597566522735" duration="718000" />
<workItem from="1597567837076" duration="604000" />
</task>
<task id="LOCAL-00001" summary="Initial commit">
<created>1594767569835</created>
......@@ -120,7 +127,14 @@
<option name="project" value="LOCAL" />
<updated>1597547012131</updated>
</task>
<option name="localTasksCounter" value="8" />
<task id="LOCAL-00008" summary="Validator script added for form on cart page">
<created>1597552215954</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1597552215954</updated>
</task>
<option name="localTasksCounter" value="9" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -167,13 +181,15 @@
<screen x="0" y="23" width="1440" height="832" />
</state>
<state x="304" y="73" key="#JSHint/0.23.1440.832@0.23.1440.832" timestamp="1597375104383" />
<state x="144" y="95" key="MergeDialog" timestamp="1597132717837">
<screen x="0" y="23" width="1440" height="832" />
<state x="144" y="78" key="MergeDialog" timestamp="1597552230231">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="144" y="78" key="MergeDialog/0.0.1440.900@0.0.1440.900" timestamp="1597552230231" />
<state x="144" y="95" key="MergeDialog/0.23.1440.832@0.23.1440.832" timestamp="1597132717837" />
<state x="360" y="207" key="MultipleFileMergeDialog" timestamp="1597132717857">
<screen x="0" y="23" width="1440" height="832" />
<state x="360" y="199" key="MultipleFileMergeDialog" timestamp="1597552231620">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="360" y="199" key="MultipleFileMergeDialog/0.0.1440.900@0.0.1440.900" timestamp="1597552231620" />
<state x="360" y="207" key="MultipleFileMergeDialog/0.23.1440.832@0.23.1440.832" timestamp="1597132717857" />
<state x="410" y="148" key="RollbackChangesDialog" timestamp="1597132700210">
<screen x="0" y="23" width="1440" height="832" />
......@@ -189,9 +205,10 @@
</state>
<state x="0" y="0" width="601" height="900" key="dock-window-1/0.0.1440.900@0.0.1440.900" timestamp="1597546829350" />
<state x="0" y="0" width="646" height="900" key="dock-window-1/0.23.1440.832@0.23.1440.832" timestamp="1597484295541" />
<state x="383" y="234" key="git4idea.merge.GitPullDialog" timestamp="1597375528680">
<screen x="0" y="23" width="1440" height="832" />
<state x="383" y="228" key="git4idea.merge.GitPullDialog" timestamp="1597552348163">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="383" y="228" key="git4idea.merge.GitPullDialog/0.0.1440.900@0.0.1440.900" timestamp="1597552348163" />
<state x="383" y="234" key="git4idea.merge.GitPullDialog/0.23.1440.832@0.23.1440.832" timestamp="1597375528680" />
<state x="385" y="179" width="670" height="676" key="search.everywhere.popup" timestamp="1597375237309">
<screen x="0" y="23" width="1440" height="832" />
......
......@@ -4,8 +4,8 @@ var Cart = (function() {
function addToCart() {
var cartlist = [];
var movie = this.parentNode.parentNode;
var movie = $(this).parent().parent();
// var movie = this.parentNode.parentNode;
var titleOfMovie = movie.getElementsByTagName("h3")[0].innerHTML;
var priceOfMovie = movie.getElementsByClassName("price")[0].innerHTML;
var myObject = {title: titleOfMovie, price: priceOfMovie};
......@@ -21,15 +21,16 @@ var Cart = (function() {
}
pub.setup = function() {
var buttons = document.getElementsByClassName("buy");
var buttons = $("#buy");
// var buttons = document.getElementsByClassName("buy");
for (let button of buttons) {
button.onclick = addToCart;
$(button).click(addToCart);
}
};
/*let
/*
When the 'add to cart' button is pushed, create an object with
two data fields - a title and a price.
......@@ -40,11 +41,7 @@ var Cart = (function() {
}());
if (window.addEventListener) {
window.addEventListener('load', Cart.setup);
} else if (window.attachEvent) {
window.attachEvent('onload', Cart.setup);
}
$(document).ready(Cart.setup);
......@@ -6,6 +6,7 @@
<title>Classic Cinema</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="jquery.min.js"></script>
</head>
<body>
......
......@@ -6,6 +6,7 @@
<title>Classic Cinema</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="jquery.min.js"></script>
</head>
<body>
......
This diff is collapsed.
......@@ -6,6 +6,7 @@
<title>Classic Cinema</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="jquery.min.js"></script>
</head>
<body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment