Initial commit
commit
e40b99096b
@ -0,0 +1,65 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The Open Media Project</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
|
||||
<script type="text/javascript" src="data.js"></script>
|
||||
<script type="text/javascript" src="script.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
|
||||
s.type = 'text/javascript';
|
||||
s.async = true;
|
||||
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
|
||||
t.parentNode.insertBefore(s, t);
|
||||
})();
|
||||
/* ]]> */
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<div class="nowplaying">
|
||||
<h2>Now Playing</h2>
|
||||
<h3 id="np_title">Select a video to start watching...</h3>
|
||||
<p id="np_description"></p>
|
||||
</div>
|
||||
<h3 class="category_header">Categories</h3>
|
||||
<div id="categorylist">
|
||||
|
||||
</div>
|
||||
<div class="category_footer">
|
||||
(don't worry, selecting a category won't stop the video that is currently playing!)
|
||||
</div>
|
||||
|
||||
<a class="category_item" style="margin-top: 22px; color: yellow;" href="submit.php" target="_blank">Submit movies/series/etc.</a>
|
||||
<a class="category_item" style="color: yellow;" href="http://www.cryto.net/donate" target="_blank">Donate (via CrytoCC)</a>
|
||||
<a class="category_item" href="http://wiki.cryto.net/doku.php?id=projects:openmedia" target="_blank">Developers</a>
|
||||
<div style="text-align: center; margin-top: 22px;">
|
||||
<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.cryto.net/openmedia"></a>
|
||||
<noscript><a href="http://flattr.com/thing/626064/The-Open-Media-Project" target="_blank">
|
||||
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main">
|
||||
<div id="index" class="index_expanded">
|
||||
<div style="padding: 16px;">
|
||||
<h5>What is the Open Media Project?</h5>
|
||||
<p>The Open Media Project is a - for now - small project to promote the distribution of freely licensed video materials. Usually
|
||||
this will be videos under Creative Commons or similar licenses. All videos on this site can be distributed freely in their original form
|
||||
for non-profit purposes, and some videos may also allow you to distribute them commercially (do some research to figure this out).</p>
|
||||
<h5>How do I start?</h5>
|
||||
<p>Pick a category, and select a movie, documentary, talk or episode!</p>
|
||||
<h5>How do I help?</h5>
|
||||
<p>You can help by either <a href="submit.php" target="_blank">submitting</a> videos, or by <a href="http://www.cryto.net/donate" target="_blank">
|
||||
donating through the Cryto Coding Collective</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="video" class="video_shrunk">
|
||||
<div class="introtext"><strong>Hi there!</strong> Select a video to start watching.</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,146 @@
|
||||
function switch_video(id)
|
||||
{
|
||||
////console.log("start");
|
||||
//alert(find_video(id)['name']);
|
||||
var video = find_video(id);
|
||||
var template = "This video is not available.";
|
||||
|
||||
if(omp_sites[video["site"]] || video["site"] == "flv")
|
||||
{
|
||||
if(video["site"] == "flv")
|
||||
{
|
||||
$("#video").html("<div id=\"mediaplayer\"></div>");
|
||||
|
||||
jwplayer("mediaplayer").setup({
|
||||
flashplayer: "jwplayer/player.swf",
|
||||
file: video["parameters"][0],
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
autoplay: true
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
template = omp_sites[video["site"]];
|
||||
|
||||
template = template.replace(/\$w/g, "100%");
|
||||
template = template.replace(/\$h/g, "100%");
|
||||
|
||||
//console.log(video["parameters"]);
|
||||
|
||||
for(var i in video["parameters"])
|
||||
{
|
||||
var parameter = video["parameters"][i];
|
||||
template = template.replace(new RegExp("\\$s" + i, "g"), parameter);
|
||||
//console.log(template);
|
||||
}
|
||||
|
||||
$("#video").html(template);
|
||||
}
|
||||
|
||||
$("#np_title").html(video["name"]);
|
||||
$("#np_description").html(cut_text(video["description"], 200));
|
||||
$(".nowplaying").show();
|
||||
|
||||
hide_index();
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log(video["site"]);
|
||||
}
|
||||
}
|
||||
|
||||
function find_video(id)
|
||||
{
|
||||
for(var i in omp_videos)
|
||||
{
|
||||
var cat = omp_videos[i];
|
||||
|
||||
if(cat[id])
|
||||
{
|
||||
return cat[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cut_text(text, length)
|
||||
{
|
||||
if(text.length > length)
|
||||
{
|
||||
var pattern = new RegExp("^.{0," + length + "}\\b", "i");
|
||||
//console.log(pattern, text);
|
||||
return text.match(pattern) + "...";
|
||||
}
|
||||
else
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
function show_index()
|
||||
{
|
||||
$("#video").removeClass("video_normal").addClass("video_shrunk");
|
||||
$("#index").removeClass("index_normal").addClass("index_expanded");
|
||||
}
|
||||
|
||||
function hide_index()
|
||||
{
|
||||
$("#video").removeClass("video_shrunk").addClass("video_normal");
|
||||
$("#index").removeClass("index_expanded").addClass("index_normal");
|
||||
}
|
||||
|
||||
function load_categories()
|
||||
{
|
||||
var categorylist = [];
|
||||
|
||||
for(var i in omp_videos)
|
||||
{
|
||||
categorylist.push(i);
|
||||
//console.log(i);
|
||||
}
|
||||
|
||||
categorylist.sort();
|
||||
var list_element = $("#categorylist");
|
||||
|
||||
for(var t in categorylist)
|
||||
{
|
||||
list_element.append("<a href=\"#\" class=\"category_item\" onclick=\"load_category('" + categorylist[t] + "'); return false;\">" + categorylist[t] + "</a>");
|
||||
}
|
||||
}
|
||||
|
||||
function load_category(id)
|
||||
{
|
||||
var close_button = "<a class=\"close_button\" href=\"#\" onclick=\"hide_index(); return false;\">X</a>";
|
||||
|
||||
if(omp_videos[id])
|
||||
{
|
||||
var index_element = $("#index");
|
||||
index_element.html(close_button + "<h4>" + id + "</h4>");
|
||||
|
||||
var videolist = omp_videos[id];
|
||||
|
||||
for(var i in videolist)
|
||||
{
|
||||
index_element.append("<a href=\"#\" onclick=\"switch_video(" + i + "); return false;\" class=\"video_item\"><div class=\"video_title\">" + videolist[i]["name"] + "</div><div class=\"video_description\">" + cut_text(videolist[i]["description"], 550) + "</div></a>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#index").html(close_button + "<h4>" + id + "</h4><div class=\"error\">No videos were found in this category.</div>");
|
||||
}
|
||||
|
||||
show_index();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
load_categories();
|
||||
|
||||
/*var test = '<iframe width="$w" height="$h" src="http://www.youtube.com/embed/$s0?fs=1&autoplay=1&hd=1" frameborder="0" allowfullscreen></iframe>';
|
||||
var i = "0";
|
||||
var pattern = new RegExp("\\$s" + i, "g");
|
||||
var parameter="test";
|
||||
test = test.replace(pattern, parameter);
|
||||
//console.log(pattern);
|
||||
//console.log(/\$s0/g);
|
||||
alert(test);*/
|
||||
});
|
@ -0,0 +1,197 @@
|
||||
html, body
|
||||
{
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
font-family: sans-serif;
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p
|
||||
{
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#sidebar
|
||||
{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
width: 360px;
|
||||
background-color: #171717;
|
||||
color: white;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#sidebar .nowplaying
|
||||
{
|
||||
padding: 9px;
|
||||
margin: 5px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid silver;
|
||||
margin-bottom: 21px;
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
#np_description
|
||||
{
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
#main
|
||||
{
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.video_normal
|
||||
{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.video_shrunk
|
||||
{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.index_normal
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.index_expanded
|
||||
{
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#video
|
||||
{
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#index
|
||||
{
|
||||
background-color: #0C0C0C;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.introtext
|
||||
{
|
||||
font-size: 38px;
|
||||
padding-top: 60px;
|
||||
color: silver;
|
||||
}
|
||||
|
||||
.category_item
|
||||
{
|
||||
display: block;
|
||||
background-color: #212121;
|
||||
padding: 6px 9px;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.category_item:hover
|
||||
{
|
||||
background-color: #2B2B2B;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size: 36px;
|
||||
margin: 9px 8px;
|
||||
}
|
||||
|
||||
.video_item
|
||||
{
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
color: silver;
|
||||
border: 1px solid silver;
|
||||
margin: 12px;
|
||||
padding: 9px;
|
||||
float: left;
|
||||
width: 400px;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.video_item:hover
|
||||
{
|
||||
border: 1px solid white;
|
||||
color: white !important;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.video_title
|
||||
{
|
||||
font-size: 21px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.video_description
|
||||
{
|
||||
font-size: 15px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.category_header
|
||||
{
|
||||
margin-left: 8px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.category_footer
|
||||
{
|
||||
font-size: 13px;
|
||||
margin: 9px;
|
||||
}
|
||||
|
||||
.close_button
|
||||
{
|
||||
display: block;
|
||||
float: right;
|
||||
margin: 24px;
|
||||
border: 1px solid silver;
|
||||
color: silver;
|
||||
text-decoration: none;
|
||||
padding: 7px 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.close_button:hover
|
||||
{
|
||||
border: 1px solid white;
|
||||
color: white;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#index h5
|
||||
{
|
||||
margin-top: 10px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
#index a
|
||||
{
|
||||
color: silver;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
if(isset($_POST['submit']))
|
||||
{
|
||||
$id = file_get_contents("incr.txt");
|
||||
|
||||
if(!$id)
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
|
||||
file_put_contents("incr.txt", $id + 1);
|
||||
|
||||
$name = $_POST['name'];
|
||||
$description = $_POST['description'];
|
||||
$category = $_POST['category'];
|
||||
|
||||
if(!empty($_POST['id']))
|
||||
{
|
||||
$video_id = $_POST['id'];
|
||||
|
||||
$obj = array(
|
||||
$category => array(
|
||||
$id => array(
|
||||
"name" => $name,
|
||||
"site" => "youtube",
|
||||
"description" => $description,
|
||||
"parameters" => array($video_id)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $_POST['url'];
|
||||
|
||||
$obj = array(
|
||||
$category => array(
|
||||
$id => array(
|
||||
"name" => $name,
|
||||
"site" => $url,
|
||||
"description" => $description,
|
||||
"parameters" => array("")
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
file_put_contents("suggestions.txt", json_encode($obj) . "\n", FILE_APPEND);
|
||||
|
||||
echo("Done! Thank you.");
|
||||
}
|
||||
|
||||
?>
|
||||
<h1>Submit movie/series/etc.</h1>
|
||||
<p>All submissions are manually verified before appearing. Please do not submit 'the average Youtube video', only serious movies, documentaries, series, etc.<strong>When submitting a YouTube video, please enter the video ID, and NOT the URL.</strong></p>
|
||||
<p>It does not matter what site the video is hosted on, as long as it's either a streaming player or a directly linkable flv/mp4 file. If there is no page and just a video file, enter the video file as URL.</p>
|
||||
<h3>Only FREELY DISTRIBUTABLE (Creative Commons, etc.) movies/series/talks please!</h3>
|
||||
<form method="post" action="submit.php">
|
||||
Name: <input type="text" name="name"><hr>
|
||||
Youtube Video ID: <input type="text" name="id"> ... OR Video URL: <input type="text" name="url"><hr>
|
||||
Description:<br><textarea name="description" style="width: 300px; height: 120px;"></textarea><hr>
|
||||
Category: <input type="text" name="category"><hr>
|
||||
<button type="submit" name="submit">Submit</button>
|
||||
</form>
|
Loading…
Reference in New Issue