diff --git a/index.html b/index.html deleted file mode 100755 index cac076d..0000000 --- a/index.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - hub - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
Likes: 10
-
-
-
-
-
-
-
Close
-
-
-
-
-
- - -
-
- - - -
-
- - -
-
-
- - -
-
- - - - diff --git a/js/index.js b/js/index.js deleted file mode 100755 index 807d9fa..0000000 --- a/js/index.js +++ /dev/null @@ -1,130 +0,0 @@ -let videos; -let loadindex = 0; -let scrollposition = 0; -let loadedvideoid = -1; - -$(document).ready(function () { - $.post('php/videoload.php', 'action=getMovies', function (data) { - videos = data; - loadPreviewBlock(15); - }, 'json'); - - $.post('php/videoload.php', 'action=getDbSize', function (data) { - console.log(data); - }, 'json'); - - $(".closebutton").click(function () { - $("#likebtn").off(); - $("#tagbutton").off(); - $(".videopagewrapper").hide(); - $(".previewcontainer").show(); - // scroll back to last scroll position - $(window).scrollTop(scrollposition); - $(".videowrapper").html(""); - }); -}); - -$(window).scroll(function () { - if ($(window).scrollTop() >= (($(document).height() - $(window).height() - 60))) { - if ($(".videowrapper").html() === "") { - loadPreviewBlock(6); - } - } -}); - -function loadPreviewBlock(nr) { - for (let i = 0; i < nr; i++) { - if (loadindex + i < videos.length) { - loadPreview(videos[loadindex + i]); - } - } - loadindex += nr; -} - -function loadPreview(src) { - $.post('php/videoload.php', 'action=readThumbnail&movieid=' + src.movie_id, function (data) { - var preview = $(` -
-
${src.movie_name}
-
- no thumbnail found -
-
`); - preview.attr('movie_id', src.movie_id); - preview.click(function () { - console.log("preview clicked"); - scrollposition = $(window).scrollTop(); - loadedvideoid = $(this).attr("movie_id"); - loadVideo(loadedvideoid); - }); - $(".previewcontainer").append(preview); - }, 'text'); -} - -function loadVideo(movieid) { - $.post('php/videoload.php', 'action=loadVideo&movieid=' + movieid, function (data) { - $(".videowrapper").html("
"); - - const player = new Plyr('#player'); - player.source = { - type: 'video', - sources: [ - { - src: data.movie_url, - type: 'video/mp4', - size: 1080, - } - ], - poster: data.thumbnail - }; - - $(".likefield").html("Likes: " + data.likes); - - $.post('php/videoload.php', 'action=getTags&movieid=' + loadedvideoid, function (data) { - for (const tag in data.tags) { - $(".videoleftbanner").append(`
${tag}
`); - } - - console.log(data); - }, "json"); - - $("#likebtn").click(function () { - console.log("likebtn clicked"); - $.post('php/videoload.php', 'action=addLike&movieid=' + loadedvideoid, function (data) { - console.log(data); - }, "json"); - }); - - $("#tagbutton").click(function () { - console.log("tagbrn clicked"); - Swal.mixin({ - input: 'text', - confirmButtonText: 'Next →', - showCancelButton: true, - progressSteps: ['1', '2', '3'] - }).queue([ - { - title: 'Question 1', - text: 'Chaining swal2 modals is easy' - }, - 'Question 2', - 'Question 3' - ]).then((result) => { - if (result.value) { - const answers = JSON.stringify(result.value) - Swal.fire({ - title: 'All done!', - html: ` - Your answers: -
${answers}
- `, - confirmButtonText: 'Lovely!' - }) - } - }) - }); - - $(".videopagewrapper").show(); - $(".previewcontainer").hide(); - }, "json"); -} diff --git a/js/plyr.js b/js/plyr.js deleted file mode 100755 index 4baae30..0000000 --- a/js/plyr.js +++ /dev/null @@ -1,2 +0,0 @@ -"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,function(){"use strict";!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n,i,r,a="object",o=function(e){return e&&e.Math==Math&&e},s=o(typeof globalThis==a&&globalThis)||o(typeof window==a&&window)||o(typeof self==a&&self)||o(typeof e==a&&e)||Function("return this")(),l=function(e){try{return!!e()}catch(e){return!0}},c=!l(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),u={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,f={f:h&&!u.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:u},d=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},p={}.toString,m=function(e){return p.call(e).slice(8,-1)},g="".split,v=l(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==m(e)?g.call(e,""):Object(e)}:Object,y=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},b=function(e){return v(y(e))},w=function(e){return"object"==typeof e?null!==e:"function"==typeof e},k=function(e,t){if(!w(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!w(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!w(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!w(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},T={}.hasOwnProperty,S=function(e,t){return T.call(e,t)},E=s.document,A=w(E)&&w(E.createElement),x=function(e){return A?E.createElement(e):{}},P=!c&&!l(function(){return 7!=Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a}),C=Object.getOwnPropertyDescriptor,I={f:c?C:function(e,t){if(e=b(e),t=k(t,!0),P)try{return C(e,t)}catch(e){}if(S(e,t))return d(!f.f.call(e,t),e[t])}},L=function(e){if(!w(e))throw TypeError(String(e)+" is not an object");return e},M=Object.defineProperty,O={f:c?M:function(e,t,n){if(L(e),t=k(t,!0),L(n),P)try{return M(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},j=c?function(e,t,n){return O.f(e,t,d(1,n))}:function(e,t,n){return e[t]=n,e},N=function(e,t){try{j(s,e,t)}catch(n){s[e]=t}return t},_=t(function(e){var t=s["__core-js_shared__"]||N("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),R=_("native-function-to-string",Function.toString),U=s.WeakMap,F="function"==typeof U&&/native code/.test(R.call(U)),q=0,D=Math.random(),H=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++q+D).toString(36)},V=_("keys"),B=function(e){return V[e]||(V[e]=H(e))},z={},W=s.WeakMap;if(F){var K=new W,$=K.get,Y=K.has,G=K.set;n=function(e,t){return G.call(K,e,t),t},i=function(e){return $.call(K,e)||{}},r=function(e){return Y.call(K,e)}}else{var Q=B("state");z[Q]=!0,n=function(e,t){return j(e,Q,t),t},i=function(e){return S(e,Q)?e[Q]:{}},r=function(e){return S(e,Q)}}var X={set:n,get:i,has:r,enforce:function(e){return r(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!w(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},J=t(function(e){var t=X.get,n=X.enforce,i=String(R).split("toString");_("inspectSource",function(e){return R.call(e)}),(e.exports=function(e,t,r,a){var o=!!a&&!!a.unsafe,l=!!a&&!!a.enumerable,c=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof t||S(r,"name")||j(r,"name",t),n(r).source=i.join("string"==typeof t?t:"")),e!==s?(o?!c&&e[t]&&(l=!0):delete e[t],l?e[t]=r:j(e,t,r)):l?e[t]=r:N(t,r)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||R.call(this)})}),Z=s,ee=function(e){return"function"==typeof e?e:void 0},te=function(e,t){return arguments.length<2?ee(Z[e])||ee(s[e]):Z[e]&&Z[e][t]||s[e]&&s[e][t]},ne=Math.ceil,ie=Math.floor,re=function(e){return isNaN(e=+e)?0:(e>0?ie:ne)(e)},ae=Math.min,oe=function(e){return e>0?ae(re(e),9007199254740991):0},se=Math.max,le=Math.min,ce=function(e,t){var n=re(e);return n<0?se(n+t,0):le(n,t)},ue=function(e){return function(t,n,i){var r,a=b(t),o=oe(a.length),s=ce(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},he={includes:ue(!0),indexOf:ue(!1)},fe=he.indexOf,de=function(e,t){var n,i=b(e),r=0,a=[];for(n in i)!S(z,n)&&S(i,n)&&a.push(n);for(;t.length>r;)S(i,n=t[r++])&&(~fe(a,n)||a.push(n));return a},pe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],me=pe.concat("length","prototype"),ge={f:Object.getOwnPropertyNames||function(e){return de(e,me)}},ve={f:Object.getOwnPropertySymbols},ye=te("Reflect","ownKeys")||function(e){var t=ge.f(L(e)),n=ve.f;return n?t.concat(n(e)):t},be=function(e,t){for(var n=ye(t),i=O.f,r=I.f,a=0;aa;)O.f(e,n=i[a++],t[n]);return e},Ne=te("document","documentElement"),_e=B("IE_PROTO"),Re=function(){},Ue=function(){var e,t=x("iframe"),n=pe.length;for(t.style.display="none",Ne.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("