Commit af2f90d1 authored by tobiasmeyrick's avatar tobiasmeyrick
Browse files

First commit

parents
Pipeline #4020 passed with stage
in 16 seconds
File added
File added
File added
File added
File added
# Full project: https://gitlab.com/pages/plain.html
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ClassicCinema.iml" filepath="$PROJECT_DIR$/.idea/ClassicCinema.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="07311041-3edc-4bfb-ad40-3329adf7b717" name="Default Changelist" comment="Update to classic cinema db">
<change afterPath="$PROJECT_DIR$/._Screenshots" afterDir="false" />
<change afterPath="$PROJECT_DIR$/._contact.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/._fonts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/._images" afterDir="false" />
<change afterPath="$PROJECT_DIR$/._style.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gitlab-ci.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/ClassicCinema.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ClassicCinemaIDB.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/IDBTest.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/._Screenshot-Classic.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/._Screenshot-Contact.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/._Screenshot-Hitchcock.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/._Screenshot-Index.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/._Screenshot-SciFi.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/Screenshot-Classic.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/Screenshot-Contact.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/Screenshot-Hitchcock.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/Screenshot-Index.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Screenshots/Screenshot-SciFi.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/carousel.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cart.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cart.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/classic.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/contact.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/fonts/._DymaxionScript-webfont.woff" afterDir="false" />
<change afterPath="$PROJECT_DIR$/fonts/._Nick's Fonts License.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/fonts/DymaxionScript-webfont.woff" afterDir="false" />
<change afterPath="$PROJECT_DIR$/fonts/Nick's Fonts License.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/hitchcock.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Attack_of_the_50ft_Woman.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Dial_M_for_Murder.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Forbidden_Planet.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Gone_With_the_Wind.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._King_Kong.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Metropolis.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._North_by_Northwest.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Plan_9_from_Outer_Space.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Tarantula.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._The_Birds.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._The_Day_of_the_Triffids.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._The_Jazz_Singer.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._The_Man_Who_Knew_Too_Much.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._The_Mummy.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._Vertigo.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._headerBackground.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._map.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._mapThumb.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/._popup.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Attack_of_the_50ft_Woman.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Dial_M_for_Murder.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Forbidden_Planet.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Gone_With_the_Wind.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/King_Kong.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Metropolis.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/North_by_Northwest.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Plan_9_from_Outer_Space.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Tarantula.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/The_Birds.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/The_Day_of_the_Triffids.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/The_Jazz_Singer.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/The_Man_Who_Knew_Too_Much.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/The_Mummy.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/Vertigo.jpg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/headerBackground.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/map.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/mapThumb.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/images/popup.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/printCart.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/scifi.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/showHide.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/style.css" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ComposerSettings">
<execution />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="JsFlowSettings">
<service-enabled>true</service-enabled>
<exe-path />
<other-services-enabled>true</other-services-enabled>
<auto-save>true</auto-save>
</component>
<component name="ProjectId" id="1fz5ZmKH2G0WD9gQquAL7y2ZUcF" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="Settings.JavaScript.Linters.JSHint" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="07311041-3edc-4bfb-ad40-3329adf7b717" name="Default Changelist" comment="" />
<created>1594766183378</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1594766183378</updated>
<workItem from="1594766184443" duration="86000" />
<workItem from="1594767415007" duration="1372000" />
<workItem from="1594952590675" duration="4529000" />
<workItem from="1596161189400" duration="5607000" />
<workItem from="1597208142368" duration="2348000" />
<workItem from="1597290826993" duration="2674000" />
<workItem from="1597371395364" duration="1558000" />
<workItem from="1597374945985" duration="276000" />
</task>
<task id="LOCAL-00001" summary="Initial commit">
<created>1594767569835</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1594767569835</updated>
</task>
<task id="LOCAL-00002" summary="Added file .gitlab-ci.yml">
<created>1594768013596</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1594768013596</updated>
</task>
<task id="LOCAL-00003" summary="Added a script for show/hide on click of movie titles">
<created>1594955083500</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1594955083500</updated>
</task>
<task id="LOCAL-00004" summary="Used modules">
<created>1595557677016</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1595557677016</updated>
</task>
<task id="LOCAL-00005" summary="Update to classic cinema db">
<created>1597371434138</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1597371434138</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="2" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list />
</value>
</entry>
<entry key="User">
<value>
<list />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Initial commit" />
<MESSAGE value="Added file .gitlab-ci.yml" />
<MESSAGE value="Added a script for show/hide on click of movie titles" />
<MESSAGE value="Used modules" />
<MESSAGE value="Update to classic cinema db" />
<option name="LAST_COMMIT_MESSAGE" value="Update to classic cinema db" />
</component>
<component name="WindowStateProjectService">
<state x="304" y="73" key="#JSHint" timestamp="1597375104383">
<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>
<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>
<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" />
</state>
<state x="410" y="148" key="RollbackChangesDialog/0.23.1440.832@0.23.1440.832" timestamp="1597132700210" />
<state x="567" y="179" key="Vcs.Push.Dialog.v2" timestamp="1597371445338">
<screen x="0" y="23" width="1440" height="832" />
</state>
<state x="567" y="179" key="Vcs.Push.Dialog.v2/0.23.1440.832@0.23.1440.832" timestamp="1597371445338" />
<state x="383" y="234" key="git4idea.merge.GitPullDialog" timestamp="1597132708925">
<screen x="0" y="23" width="1440" height="832" />
</state>
<state x="383" y="234" key="git4idea.merge.GitPullDialog/0.23.1440.832@0.23.1440.832" timestamp="1597132708925" />
</component>
</project>
\ No newline at end of file
var ClassicCinemaIDB = (function () {
/* A closure to demonstrate basic use of indexeddb
* Adapted from
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
* Nick Meek 2019
*/
//if indexeddb is not supported then no use continuing
if (!window.indexedDB) {
window.alert("Your browser doesn’t support a stable version of IndexedDB.");
return;
}
var pub = {}; //usual public interface
var db;
const dbName = "ClassicCinema";
//Some movie data to get us started
const movieData = [
{
title: "Gone With the Wind (1939)",
director: ["Victor Fleming", "George Cukor", "Sam Wood"],
starring: ["Clark Gable", "Vivien Leigh", "Leslie Howard", "Olivia de Havilland", "Hattie McDaniel"],
comments: "An epic historical romance and winner of 8 Academy Awards (from 13 nominations).",
price: 13.99
},
{
title: "The Jazz Singer (1927)",
director: ["Alan Crosland"],
starring: ["Al Jolson", "May McAvoy", "Warner Oland", "Canto Rosenblatt"],
comments: "The first feature length ’talkie’, The Jazz Singer is a piece of cinematic history",
price: 13.99
},
{
title: "Metropolis (1927)",
director: ["Fritz Lang"],
starring: ["Alfred Abel", "Brigitte Helm", "Gustav Frohlich", "Rudolf Klein-Rogge"],
comments: "A lovingly restored version of Fritz Lang’s dystopian masterpiece, one of the great achievements of the silent era.",
price: 19.99
}
];
var request = indexedDB.open(dbName, 1); // Request to open a db
//an error handler for the request
request.onerror = function (event) {
alert("Opening db error " + request.error);
};
//a success handler
request.onsuccess = function (event) {
alert("Database successfully created.")
};
/**
* Utility function to start a transaction on the specified objectStore(s)
* and return the object store.
* @param {string} store_name
* @param {string} mode either "readonly" or "readwrite"
* @return objectStore
*/
function getObjectStore(store_name, mode) {
var tx = db.transaction(store_name, mode);
return tx.objectStore(store_name);
}
//This function runs before onsuccess, if needed i.e.
// no db exists or
// version number is higher than existing db
request.onupgradeneeded = function (event) {
db = event.target.result;
// Create an objectStore to hold information about our movies. We’re
// going to use "title" as our key path because it’s guaranteed to be
// unique.
var movieObjectStore = db.createObjectStore("movies", {keyPath: "title"});
// Use transaction oncomplete to make sure the objectStore creation is
// finished before adding data into it.
movieObjectStore.transaction.oncomplete = function (event) {
// Store values in the newly created objectStore.
var customerObjectStoreTransaction = getObjectStore("movies", "readwrite");
movieData.forEach(function (m) {
customerObjectStoreTransaction.add(m);
});
};
// Create an index to search movies by title. We want to ensure that
// no two movies have the same title, so use a unique index.
movieObjectStore.createIndex("title", "title", {unique: true});
};
/**
* Displays the title, price and rating of a specified movie
* @param {string} title The title of the movie you want to find.
*/
pub.getMovieInfo = function (title) {
var store = getObjectStore("movies", "readwrite");
var request = store.get(title);
//error handler
request.onerror = function (e) {
alert("getMovieInfo error " + request.error);
};
//success handler
request.onsuccess = function (e) {
alert(request.result.title + "\n" + request.result.price + "\n" +
request.result.director);
};
};
/**
* Adds a movie to the objectStore
* @param {object} movieData The object you want added to the store
* The movieData object must take the following form:
* title: {string}
* director: [<string]
* starring: [<string>]
* comments: {string}
* price: {float}
*/
pub.addMovie = function (movieData) {
// start the transaction and get the store
var store = getObjectStore("movies", "readwrite");
var request = store.add(movieData);
// success handler
request.onsuccess = function (event) {
alert("movie added");
}
// error handler
request.onerror = function (event) {
alert("addMovie error", this.error);
}
};
// Create an objectStore to hold reviews
var reviewObjectStore = db.createObjectStore("reviews", {autoIncrement: true});
/**
* Adds a review to the objectStore
* @param {object} review The object you want added to the store.
* The review object must take the following form:
* user: {string}
* title: {string}
* review: {integer}
*/
pub.addReview = function (review) {
var store = getObjectStore("reviews", "readwrite");
var request = store.add(review);
// success handler
request.onsuccess = function (event) {
alert("review added");
};
// error handler
request.onerror = function (event) {
alert("addReview error", this.error);
};
};
pub.displayReviews = function (title) {
var store = getObjectStore("reviews", "readwrite");
var request = store.get(title);
//error handler
request.onerror = function (e) {
alert("getMovieInfo error " + request.error);
};
//success handler
request.onsuccess = function (e) {
};
};
return pub;
}());
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classic Cinema</title>
<meta charset="utf-8">
<script src="ClassicCinemaIDB.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
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