Commit 8e174f6d by Wolfgang Berndt

Move to single repository.

parents
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
dist/
# Node.JS zeug
node_modules/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
_NCrunch_*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
Tablet/App/content/
Tablet/assets/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
grunt.initConfig({
/***************************************
* Configuration
***************************************/
// Location of all source files
src: {
js: ['src/ticker.js'] // Javascript files
},
/***************************************
* Task definitions
***************************************/
// Compresses files for release
uglify: {
app: {
src: ['<%= src.js %>'],
dest: 'src/ticker.min.js',
}
}
});
};
<?php
$handle = fopen(base64_decode($_REQUEST['url']), "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>
server {
listen 80;
listen [::]:80;
root /var/www/proxy;
server_name proxy.doohmedia.net;
location / {
add_header 'Access-Control-Allow-Origin' '*';
try_files $uri $uri/ =404;
}
location ~ \.php$ {
add_header 'Access-Control-Allow-Origin' '*';
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>vertical-ticker</title>
<link rel="stylesheet" href="style.css">
<script src="jquery-3.2.1.min.js"></script>
<script src="jquery.base64.min.js"></script>
<script src="ticker.min.js"></script>
<script>
$(document).ready(function() {
// Da der Ticker die Größe des Browserfensters zur Berechnung der Elementanimationen benutzt, muss er bei
// jedem Resize neu initialisiert werden. Ein simpler Reload soll hier reichen.
$(window).on('resize', function() {
location.reload();
});
ticker.init({
// URL zum RSS-Feed. Der Feed wird vom Ticker automatisch alle 5 Minuten refreshed, ein Reload der Seite
// ist nicht notwendig.
url: "http://www.tvlokal.de/customer/rss2files/630rss.xml",
// Proxy benutzen, falls das RSS von einem anderen Server kommt und dieser keinen
// "Access-Control-Allow-Origin"-Header gesetzt hat. Kann auf *.tvlokal.de vermutlich deaktivert werden.
useproxy: true,
// Tickergeschwindigkeit in Sekunden pro 100 Pixel.
speed: "2.5",
// Hintergrund des Tickers. Das Bild halt Priorität vor der Farbe, d.h. wenn beides gesetzt ist, wird
// das Bild angezeigt.
background: {
color: "#000",
// Pfad zum Hintergrundbild. Das Bild wird unter Beibehaltung des Seitenverhältnis auf die Größe
// des Browserfensters skaliert.
image: "files/demobg.jpg"
},
// Schriftart. Der Oxygen-Player zeigt den Ticker mit IE11 an, das Format muss also EOT, WOFF oder
// TTF sein.
font: {
file: "files/Oswald-Regular.woff",
format: "woff",
},
// Styling der Überschrift. Die Werte werden direkt ins CSS der Seite geschrieben, es sind also z.B.
// auch prozentuale Werte möglich.
headline: {
size: "80px",
color: "#fff",
},
// Styling für den Tickertext.
text: {
size: "60px",
color: "#eee",
align: "justify",
},
// Styling für den Abstandshalter zwischen den Ticker-Elementen. Ist das Feld "text" leer, wird
// kein Abstandshalter eingeblendet.
spacer: {
size: "48px",
color: "#001aab",
text: "- - -",
}
});
});
</script>
</head>
<body>
<div id="viewport">
</div>
</body>
</html>
"use strict";jQuery.base64=(function($){var _PADCHAR="=",_ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_VERSION="1.0";function _getbyte64(s,i){var idx=_ALPHA.indexOf(s.charAt(i));if(idx===-1){throw"Cannot decode base64"}return idx}function _decode(s){var pads=0,i,b10,imax=s.length,x=[];s=String(s);if(imax===0){return s}if(imax%4!==0){throw"Cannot decode base64"}if(s.charAt(imax-1)===_PADCHAR){pads=1;if(s.charAt(imax-2)===_PADCHAR){pads=2}imax-=4}for(i=0;i<imax;i+=4){b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12)|(_getbyte64(s,i+2)<<6)|_getbyte64(s,i+3);x.push(String.fromCharCode(b10>>16,(b10>>8)&255,b10&255))}switch(pads){case 1:b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12)|(_getbyte64(s,i+2)<<6);x.push(String.fromCharCode(b10>>16,(b10>>8)&255));break;case 2:b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12);x.push(String.fromCharCode(b10>>16));break}return x.join("")}function _getbyte(s,i){var x=s.charCodeAt(i);if(x>255){throw"INVALID_CHARACTER_ERR: DOM Exception 5"}return x}function _encode(s){if(arguments.length!==1){throw"SyntaxError: exactly one argument required"}s=String(s);var i,b10,x=[],imax=s.length-s.length%3;if(s.length===0){return s}for(i=0;i<imax;i+=3){b10=(_getbyte(s,i)<<16)|(_getbyte(s,i+1)<<8)|_getbyte(s,i+2);x.push(_ALPHA.charAt(b10>>18));x.push(_ALPHA.charAt((b10>>12)&63));x.push(_ALPHA.charAt((b10>>6)&63));x.push(_ALPHA.charAt(b10&63))}switch(s.length-imax){case 1:b10=_getbyte(s,i)<<16;x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt((b10>>12)&63)+_PADCHAR+_PADCHAR);break;case 2:b10=(_getbyte(s,i)<<16)|(_getbyte(s,i+1)<<8);x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt((b10>>12)&63)+_ALPHA.charAt((b10>>6)&63)+_PADCHAR);break}return x.join("")}return{decode:_decode,encode:_encode,VERSION:_VERSION}}(jQuery));
\ No newline at end of file
body {
padding: 0;
margin: 0;
background-color: #000000;
font-family: sans-serif;
color: #FFFFFF;
}
#viewport {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.spacer {
width: 100%;
margin-top: 50px;
margin-bottom: 50px;
font-size: 36px;
color: darkgrey;
text-align: center;
}
.tickercontainer {
position: fixed;
}
.tickeritem {
margin-left: 5%;
margin-right: 5%;
}
.tickeritem:after {
content: "";
display: table;
clear: both;
}
h1 {
font-size: 72px;
font-weight: normal;
}
p {
font-size: 36px;
text-align: justify;
}
img {
float: left;
margin: 15px 3% 0% 0%;
}
\ No newline at end of file
var feedCache = {
validCacheDuration: 5*60*1000, // 5 minutes
lastRequestDate: null,
data: [],
getdata: function (url, useproxy, cb) {
var self = this;
var now = new Date();
// return cached data when still valid
if(this.lastRequestDate && now-this.lastRequestDate < this.validCacheDuration) {
return cb(self.data);
}
// renew cache otherwise
$.ajax({
url: (useproxy) ? 'http://proxy.doohmedia.net/get.php?url=' + $.base64.encode(url) : url,
type: 'GET',
success: function(data){
var result = [];
$(data).find("item").each(function () {
var item = $(this);
var title = item.find("title").text();
// try to get some sensible data from this xml-"html"-mess
var desc = item.find("description").html()
.replace("<![CDATA[", "")
.replace("<!--[CDATA[<p-->", "")
.replace("]]>", "")
.replace("]]&gt;", "");
if (!title && !desc) return false;
if (!title && desc === "<p></p>") return false;
result.push({title: title, desc: desc});
});
if(result.length > 0) {
// only update when we got results
self.data = result;
self.lastRequestDate = new Date();
}
return cb(self.data);
},
error: function(err) {
console.log("error while getting feed data: ", err);
// Return cache. Cache may be empty or stale, but there is nothing else we can do.
return cb(self.data);
}
});
}
};
var ticker = {
currentFeedData: [],
currentFeedIndex: -1,
config: null,
viewportHeight: null,
init: function (config) {
var self = this;
if(!config.url) return;
self.config = config;
self._setupStyling();
// get data for first run
feedCache.getdata(self.config.url, self.config.useproxy, function (data) {
self.currentFeedData = data;
self._setupNewTicker();
// refresh feed data every minute
window.setInterval(function() { self._updateFeedData(); }, 60*1000);
});
},
_setupStyling: function() {
this.viewportHeight = $('#viewport').height();
if(this.config.font && this.config.font.file && this.config.font.format) {
$('head').prepend('<style type="text/css">@font-face {font-family: "customfont"; src: url("' + this.config.font.file + '") format("' + this.config.font.format + '");}</style>');
$('body').css('font-family', 'customfont');
}
if(this.config.background.color) {
$('body').css('background-color',this.config.background.color);
}
if(this.config.background.image) {
$('body').css('background','url("' + this.config.background.image + '") no-repeat center fixed')
.css('background-size', 'cover');
}
this._styleFonts();
},
_styleFonts: function () {
if(this.config.text.size) $("p").css('font-size', this.config.text.size);
if(this.config.text.color) $("p").css('color', this.config.text.color);
if(this.config.text.align) $("p").css('text-align', this.config.text.align);
if(this.config.headline.size) $("h1").css('font-size', this.config.headline.size);
if(this.config.headline.color) $("h1").css('color', this.config.headline.color);
if(this.config.spacer.color) $(".spacer").css('color', this.config.spacer.color);
if(this.config.spacer.size) $(".spacer").css('font-size', this.config.spacer.size);
},
_updateFeedData: function () {
var self = this;
feedCache.getdata(self.config.url, self.config.useproxy, function (data) {
self.currentFeedData = data;
});
},
_setupNewTicker: function () {
var self = this;
// We can do nothing if we have no data yet.
if (self.currentFeedData.length === 0) return;
// Fill screen with items
self._createTicker();
setTimeout(function () {
// Wait 500ms for second ticker to let the DOM-setup of the first one complete.
self._createTicker();
}, 500);
},
_createTicker: function () {
var self = this;
// We can do nothing if we have no data yet
if (this.currentFeedData.length === 0) return;
// Get the top position of the last ticker item (or the bottom position of the viewport for the first ticker)
var lastTicker = $(".tickercontainer:last").get(0);
var top = (lastTicker) ? $(lastTicker).offset().top + $(lastTicker).height() : this.viewportHeight;
// Add ticker container to DOM
var newContainer = $('<div class="tickercontainer"></div>');
$("#viewport").append(newContainer);
// Add ticker items to the container
for(var i=0;i<this.currentFeedData.length;i++) {
if(this.config.spacer.text.length > 0) {
var newItem = $('<div class="tickeritem"><h1>' + this.currentFeedData[i].title + '</h1>' + this.currentFeedData[i].desc + '</div><div class="spacer">' + this.config.spacer.text + '</div>');
} else {
var newItem = $('<div class="tickeritem"><h1>' + this.currentFeedData[i].title + '</h1>' + this.currentFeedData[i].desc + '</div>');
}
$(newItem).children("p").addClass("text");
$(newContainer).append(newItem);
}
self._styleFonts();
// Set top position
$(newContainer).css('top', top + "px");
// Calculate scrolling position and speed according to set scrolling speed.
var distance = top + $(newContainer).height() + 20; // travel 20px out of screen to give some space for the fonts descent line
var time = Math.round((distance / 100) * this.config.speed);
$(newContainer).css('transition', 'transform ' + time + 's linear');
$(newContainer).css('transform', 'translate3d(0px, -' + distance + 'px ,0px)');
// Create a new ticker and clean up this one after it has scrolled out of screen.
$(newContainer).on( 'transitionend', function() {
self._createTicker();
$(newContainer).remove();
});
}
};
\ No newline at end of file
var feedCache={validCacheDuration:3e5,lastRequestDate:null,data:[],getdata:function(t,e,i){var n=this,s=new Date;if(this.lastRequestDate&&s-this.lastRequestDate<this.validCacheDuration)return i(n.data);$.ajax({url:e?"http://proxy.doohmedia.net/get.php?url="+$.base64.encode(t):t,type:"GET",success:function(t){var e=[];return $(t).find("item").each(function(){var t=$(this),i=t.find("title").text(),n=t.find("description").html().replace("<![CDATA[","").replace("\x3c!--[CDATA[<p--\x3e","").replace("]]>","").replace("]]&gt;","");return!(!i&&!n)&&(!(!i&&"<p></p>"===n)&&void e.push({title:i,desc:n}))}),e.length>0&&(n.data=e,n.lastRequestDate=new Date),i(n.data)},error:function(t){return console.log("error while getting feed data: ",t),i(n.data)}})}},ticker={currentFeedData:[],currentFeedIndex:-1,config:null,viewportHeight:null,init:function(t){var e=this;t.url&&(e.config=t,e._setupStyling(),feedCache.getdata(e.config.url,e.config.useproxy,function(t){e.currentFeedData=t,e._setupNewTicker(),window.setInterval(function(){e._updateFeedData()},6e4)}))},_setupStyling:function(){this.viewportHeight=$("#viewport").height(),this.config.font&&this.config.font.file&&this.config.font.format&&($("head").prepend('<style type="text/css">@font-face {font-family: "customfont"; src: url("'+this.config.font.file+'") format("'+this.config.font.format+'");}</style>'),$("body").css("font-family","customfont")),this.config.background.color&&$("body").css("background-color",this.config.background.color),this.config.background.image&&$("body").css("background",'url("'+this.config.background.image+'") no-repeat center fixed').css("background-size","cover"),this._styleFonts()},_styleFonts:function(){this.config.text.size&&$("p").css("font-size",this.config.text.size),this.config.text.color&&$("p").css("color",this.config.text.color),this.config.text.align&&$("p").css("text-align",this.config.text.align),this.config.headline.size&&$("h1").css("font-size",this.config.headline.size),this.config.headline.color&&$("h1").css("color",this.config.headline.color),this.config.spacer.color&&$(".spacer").css("color",this.config.spacer.color),this.config.spacer.size&&$(".spacer").css("font-size",this.config.spacer.size)},_updateFeedData:function(){var t=this;feedCache.getdata(t.config.url,t.config.useproxy,function(e){t.currentFeedData=e})},_setupNewTicker:function(){var t=this;0!==t.currentFeedData.length&&(t._createTicker(),setTimeout(function(){t._createTicker()},500))},_createTicker:function(){var t=this;if(0!==this.currentFeedData.length){var e=$(".tickercontainer:last").get(0),i=e?$(e).offset().top+$(e).height():this.viewportHeight,n=$('<div class="tickercontainer"></div>');$("#viewport").append(n);for(var s=0;s<this.currentFeedData.length;s++){if(this.config.spacer.text.length>0)c=$('<div class="tickeritem"><h1>'+this.currentFeedData[s].title+"</h1>"+this.currentFeedData[s].desc+'</div><div class="spacer">'+this.config.spacer.text+"</div>");else var c=$('<div class="tickeritem"><h1>'+this.currentFeedData[s].title+"</h1>"+this.currentFeedData[s].desc+"</div>");$(c).children("p").addClass("text"),$(n).append(c)}t._styleFonts(),$(n).css("top",i+"px");var a=i+$(n).height()+20,o=Math.round(a/100*this.config.speed);$(n).css("transition","transform "+o+"s linear"),$(n).css("transform","translate3d(0px, -"+a+"px ,0px)"),$(n).on("transitionend",function(){t._createTicker(),$(n).remove()})}}};
\ 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